stablezact-pay 0.70.0 → 0.71.1

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/dist/index.umd.js CHANGED
@@ -7,8 +7,8 @@ read:function(e,t,n,i,r){var o,s,a=8*r-i-1,c=(1<<a)-1,l=c>>1,u=-7,d=n?r-1:0,h=n?
7
7
  * @author Feross Aboukhadijeh <https://feross.org>
8
8
  * @license MIT
9
9
  */
10
- !function(e){const t=f,n=S,i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},e.INSPECT_MAX_BYTES=50;const r=2147483647;e.kMaxLength=r;const{Uint8Array:o,ArrayBuffer:s,SharedArrayBuffer:a}=globalThis;function c(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new o(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return u(e,t,n)}function u(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let i=c(n);const r=i.write(e,t);r!==n&&(i=i.slice(0,r));return i}(e,t);if(s.isView(e))return function(e){if(_(e,o)){const t=new o(e);return p(t.buffer,t.byteOffset,t.byteLength)}return A(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(_(e,s)||e&&_(e.buffer,s))return p(e,t,n);if(void 0!==a&&(_(e,a)||e&&_(e.buffer,a)))return p(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return l.from(i,t,n);const r=function(e){if(l.isBuffer(e)){const t=0|m(e.length),n=c(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||$(e.length)?c(0):A(e);if("Buffer"===e.type&&Array.isArray(e.data))return A(e.data)}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return d(e),c(e<0?0:0|m(e))}function A(e){const t=e.length<0?0:0|m(e.length),n=c(t);for(let i=0;i<t;i+=1)n[i]=255&e[i];return n}function p(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===t&&void 0===n?new o(e):void 0===n?new o(e,t):new o(e,t,n),Object.setPrototypeOf(i,l.prototype),i}function m(e){if(e>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(s.isView(e)||_(e,s))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;let r=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(r)return i?-1:G(e).length;t=(""+t).toLowerCase(),r=!0}}function y(e,t,n){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,n);case"utf8":case"utf-8":return M(this,t,n);case"ascii":return Q(this,t,n);case"latin1":case"binary":return U(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function b(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function w(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),$(n=+n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:v(e,t,n,i,r);if("number"==typeof t)return t&=255,"function"==typeof o.prototype.indexOf?r?o.prototype.indexOf.call(e,t,n):o.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,i,r){let o,s=1,a=e.length,c=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(r){let i=-1;for(o=n;o<a;o++)if(l(e,o)===l(t,-1===i?0:o-i)){if(-1===i&&(i=o),o-i+1===c)return i*s}else-1!==i&&(o-=o-i),i=-1}else for(n+c>a&&(n=a-c),o=n;o>=0;o--){let n=!0;for(let i=0;i<c;i++)if(l(e,o+i)!==l(t,i)){n=!1;break}if(n)return o}return-1}function k(e,t,n,i){n=Number(n)||0;const r=e.length-n;i?(i=Number(i))>r&&(i=r):i=r;const o=t.length;let s;for(i>o/2&&(i=o/2),s=0;s<i;++s){const i=parseInt(t.substr(2*s,2),16);if($(i))return s;e[n+s]=i}return s}function x(e,t,n,i){return J(G(t,e.length-n),e,n,i)}function C(e,t,n,i){return J(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,i)}function B(e,t,n,i){return J(W(t),e,n,i)}function I(e,t,n,i){return J(function(e,t){let n,i,r;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),i=n>>8,r=n%256,o.push(r),o.push(i);return o}(t,e.length-n),e,n,i)}function E(e,n,i){return 0===n&&i===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,i))}function M(e,t,n){n=Math.min(e.length,n);const i=[];let r=t;for(;r<n;){const t=e[r];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(r+s<=n){let n,i,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:n=e[r+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(o=c));break;case 3:n=e[r+1],i=e[r+2],128==(192&n)&&128==(192&i)&&(c=(15&t)<<12|(63&n)<<6|63&i,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:n=e[r+1],i=e[r+2],a=e[r+3],128==(192&n)&&128==(192&i)&&128==(192&a)&&(c=(15&t)<<18|(63&n)<<12|(63&i)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),r+=s}return function(e){const t=e.length;if(t<=D)return String.fromCharCode.apply(String,e);let n="",i=0;for(;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=D));return n}(i)}l.TYPED_ARRAY_SUPPORT=function(){try{const e=new o(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,o.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,n){return u(e,t,n)},Object.setPrototypeOf(l.prototype,o.prototype),Object.setPrototypeOf(l,o),l.alloc=function(e,t,n){return function(e,t,n){return d(e),e<=0?c(e):void 0!==t?"string"==typeof n?c(e).fill(t,n):c(e).fill(t):c(e)}(e,t,n)},l.allocUnsafe=function(e){return h(e)},l.allocUnsafeSlow=function(e){return h(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(_(e,o)&&(e=l.from(e,e.offset,e.byteLength)),_(t,o)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,i=t.length;for(let r=0,o=Math.min(n,i);r<o;++r)if(e[r]!==t[r]){n=e[r],i=t[r];break}return n<i?-1:i<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const i=l.allocUnsafe(t);let r=0;for(n=0;n<e.length;++n){let t=e[n];if(_(t,o))r+t.length>i.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(i,r)):o.prototype.set.call(i,t,r);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(i,r)}r+=t.length}return i},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?M(this,0,e):y.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let t="";const n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},i&&(l.prototype[i]=l.prototype.inspect),l.prototype.compare=function(e,t,n,i,r){if(_(e,o)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;if(this===e)return 0;let s=(r>>>=0)-(i>>>=0),a=(n>>>=0)-(t>>>=0);const c=Math.min(s,a),u=this.slice(i,r),d=e.slice(t,n);for(let o=0;o<c;++o)if(u[o]!==d[o]){s=u[o],a=d[o];break}return s<a?-1:a<s?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return w(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return w(this,e,t,n,!1)},l.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}const r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return k(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":case"latin1":case"binary":return C(this,e,t,n);case"base64":return B(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const D=4096;function Q(e,t,n){let i="";n=Math.min(e.length,n);for(let r=t;r<n;++r)i+=String.fromCharCode(127&e[r]);return i}function U(e,t,n){let i="";n=Math.min(e.length,n);for(let r=t;r<n;++r)i+=String.fromCharCode(e[r]);return i}function F(e,t,n){const i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);let r="";for(let o=t;o<n;++o)r+=ee[e[o]];return r}function N(e,t,n){const i=e.slice(t,n);let r="";for(let o=0;o<i.length-1;o+=2)r+=String.fromCharCode(i[o]+256*i[o+1]);return r}function T(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,n,i,r,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function P(e,t,n,i,r){V(t,i,r,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,n}function O(e,t,n,i,r){V(t,i,r,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=s,s>>=8,e[n+2]=s,s>>=8,e[n+1]=s,s>>=8,e[n]=s,n+8}function R(e,t,n,i,r,o){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function z(e,t,i,r,o){return t=+t,i>>>=0,o||R(e,0,i,4),n.write(e,t,i,r,23,4),i+4}function q(e,t,i,r,o){return t=+t,i>>>=0,o||R(e,0,i,8),n.write(e,t,i,r,52,8),i+8}l.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const i=this.subarray(e,t);return Object.setPrototypeOf(i,l.prototype),i},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);let i=this[e],r=1,o=0;for(;++o<t&&(r*=256);)i+=this[e+o]*r;return i},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);let i=this[e+--t],r=1;for(;t>0&&(r*=256);)i+=this[e+--t]*r;return i},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=te(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);const i=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,r=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(i)+(BigInt(r)<<BigInt(32))}),l.prototype.readBigUInt64BE=te(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);const i=t*2**24+65536*this[++e]+256*this[++e]+this[++e],r=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(i)<<BigInt(32))+BigInt(r)}),l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);let i=this[e],r=1,o=0;for(;++o<t&&(r*=256);)i+=this[e+o]*r;return r*=128,i>=r&&(i-=Math.pow(2,8*t)),i},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);let i=t,r=1,o=this[e+--i];for(;i>0&&(r*=256);)o+=this[e+--i]*r;return r*=128,o>=r&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=te(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);const i=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),l.prototype.readBigInt64BE=te(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);const i=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)}),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),n.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t>>>=0,n>>>=0,!i){L(this,e,t,n,Math.pow(2,8*n)-1,0)}let r=1,o=0;for(this[t]=255&e;++o<n&&(r*=256);)this[t+o]=e/r&255;return t+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t>>>=0,n>>>=0,!i){L(this,e,t,n,Math.pow(2,8*n)-1,0)}let r=n-1,o=1;for(this[t+r]=255&e;--r>=0&&(o*=256);)this[t+r]=e/o&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=te(function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=te(function(e,t=0){return O(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*n-1);L(this,e,t,n,i-1,-i)}let r=0,o=1,s=0;for(this[t]=255&e;++r<n&&(o*=256);)e<0&&0===s&&0!==this[t+r-1]&&(s=1),this[t+r]=(e/o|0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*n-1);L(this,e,t,n,i-1,-i)}let r=n-1,o=1,s=0;for(this[t+r]=255&e;--r>=0&&(o*=256);)e<0&&0===s&&0!==this[t+r+1]&&(s=1),this[t+r]=(e/o|0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=te(function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=te(function(e,t=0){return O(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeFloatLE=function(e,t,n){return z(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return z(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return q(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return q(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,i){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);const r=i-n;return this===e&&"function"==typeof o.prototype.copyWithin?this.copyWithin(t,n,i):o.prototype.set.call(e,this.subarray(n,i),t),r},l.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!l.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){const t=e.charCodeAt(0);("utf8"===i&&t<128||"latin1"===i)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let r;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(r=t;r<n;++r)this[r]=e;else{const o=l.isBuffer(e)?e:l.from(e,i),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(r=0;r<n-t;++r)this[r+t]=o[r%s]}return this};const Y={};function K(e,t,n){Y[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function H(e){let t="",n=e.length;const i="-"===e[0]?1:0;for(;n>=i+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function V(e,t,n,i,r,o){if(e>n||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`,new Y.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){j(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||Z(t,e.length-(n+1))}(i,r,o)}function j(e,t){if("number"!=typeof e)throw new Y.ERR_INVALID_ARG_TYPE(t,"number",e)}function Z(e,t,n){if(Math.floor(e)!==e)throw j(e,n),new Y.ERR_OUT_OF_RANGE("offset","an integer",e);if(t<0)throw new Y.ERR_BUFFER_OUT_OF_BOUNDS;throw new Y.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}K("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),K("ERR_OUT_OF_RANGE",function(e,t,n){let i=`The value of "${e}" is out of range.`,r=n;return Number.isInteger(n)&&Math.abs(n)>2**32?r=H(String(n)):"bigint"==typeof n&&(r=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(r=H(r)),r+="n"),i+=` It must be ${t}. Received ${r}`,i},RangeError);const X=/[^+/0-9A-Za-z-_]/g;function G(e,t){let n;t=t||1/0;const i=e.length;let r=null;const o=[];for(let s=0;s<i;++s){if(n=e.charCodeAt(s),n>55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(t-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function W(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,n,i){let r;for(r=0;r<i&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function _(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function $(e){return e!=e}const ee=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const i=16*n;for(let r=0;r<16;++r)t[i+r]=e[n]+e[r]}return t}();function te(e){return"undefined"==typeof BigInt?ne:e}function ne(){throw new Error("BigInt not supported")}}(m);const B=m.Buffer,I=m.Blob,E=m.BlobOptions,M=m.Buffer,D=m.File,Q=m.FileOptions,U=m.INSPECT_MAX_BYTES,F=m.SlowBuffer,N=m.TranscodeEncoding,T=m.atob,L=m.btoa,P=m.constants,O=m.isAscii,R=m.isUtf8,z=m.kMaxLength,q=m.kStringMaxLength,Y=m.resolveObjectURL,K=m.transcode,H=Object.freeze(Object.defineProperty({__proto__:null,Blob:I,BlobOptions:E,Buffer:M,File:D,FileOptions:Q,INSPECT_MAX_BYTES:U,SlowBuffer:F,TranscodeEncoding:N,atob:T,btoa:L,constants:P,default:B,isAscii:O,isUtf8:R,kMaxLength:z,kStringMaxLength:q,resolveObjectURL:Y,transcode:K},Symbol.toStringTag,{value:"Module"})),V=n.lazy(()=>Promise.resolve().then(()=>tU)),j=e=>t.jsx(n.Suspense,{fallback:null,children:t.jsx(V,{...e})}),Z=n.createContext(null),X=n.forwardRef(({customerEmail:e="",merchantName:t="",onSuccess:i,onError:r,onClose:o,theme:s="light",autoOpen:a=!1,testMode:c=!1,debug:l=!1,merchantWalletAddresses:u={}},d)=>{const h=n.useContext(Z);if(!h)throw new Error("CoinleyCheckout must be used within a CoinleyProvider");const{openPayment:A,closePayment:p}=h,m=t=>{try{if(!t.amount||t.amount<=0)throw new Error("Amount must be greater than 0");const n={...t,customerEmail:t.customerEmail||e,merchantWalletAddresses:{...u,...t.merchantWalletAddresses},metadata:{...t.metadata,testMode:c,checkoutVersion:"1.0.0"}};A(n,{onSuccess:i,onError:r,onClose:o})}catch(gd){r&&r(gd)}},f=()=>{p()};return n.useImperativeHandle(d,()=>({open:m,close:f})),null});X.displayName="CoinleyCheckout";const G=n.lazy(()=>Promise.resolve().then(()=>sU));class W{constructor(e="https://payment.coinley.io/"){this.basePaymentUrl=e.endsWith("/")?e:e+"/"}generatePaymentURL(e){const{merchant:t,amount:n,productAmount:i,platformFee:r,networkFee:o,token:s="USDC",network:a="Ethereum Mainnet",merchantAddress:c}=e;if(!t)throw new Error("Merchant name is required");if(!n)throw new Error("Amount is required");if(!c)throw new Error("Merchant address (smart contract) is required");const l=i||.95*n,u=r||.03*n,d=o||.02*n,h=new URLSearchParams({merchant:t,amount:n.toString(),productAmount:l.toString(),platformFee:u.toString(),networkFee:d.toString(),token:s,network:a,merchantAddress:c});return this.basePaymentUrl+"?"+h.toString()}async generateQRCode(e,t={}){const{width:n=300,margin:i=2,colorDark:o="#7c3aed",colorLight:s="#ffffff"}=t;try{const t=this.generatePaymentURL(e);return{qrCodeDataURL:await r.toDataURL(t,{width:n,margin:i,color:{dark:o,light:s}}),paymentURL:t,paymentData:{...e,qrCodeUrl:t}}}catch(gd){throw new Error(`Failed to generate QR code: ${gd.message}`)}}async generateQRCodeToCanvas(e,t,n={}){const{width:i=300,margin:o=2,colorDark:s="#7c3aed",colorLight:a="#ffffff"}=n;try{const n=this.generatePaymentURL(e);return await r.toCanvas(t,n,{width:i,margin:o,color:{dark:s,light:a}}),n}catch(gd){throw new Error(`Failed to generate QR code to canvas: ${gd.message}`)}}validatePaymentData(e){const t=[],n=[];e.merchant||t.push("Merchant name is required"),(!e.amount||e.amount<=0)&&t.push("Valid amount is required"),e.merchantAddress||t.push("Merchant address (smart contract) is required"),e.merchantAddress&&!/^0x[a-fA-F0-9]{40}$/.test(e.merchantAddress)&&t.push("Invalid Ethereum address format for merchantAddress"),e.amount>1e4&&n.push("Large payment amount detected");return(e.platformFee||0)+(e.networkFee||0)>.1*e.amount&&n.push("High fees detected (>10% of total amount)"),{isValid:0===t.length,errors:t,warnings:n}}async createPaymentQR(e){const{merchantName:t,amount:n,productAmount:i,platformFee:r,networkFee:o,token:s,network:a,merchantWalletAddresses:c,selectedNetwork:l="ethereum",...u}=e,d={merchant:t||"Coinley Merchant",amount:n,productAmount:i,platformFee:r,networkFee:o,token:s||"USDC",network:a||"Ethereum Mainnet",merchantAddress:(null==c?void 0:c[l])||(null==c?void 0:c.ethereum)||(null==c?void 0:c.splitPaymentContract),...u},h=this.validatePaymentData(d);if(!h.isValid)throw new Error(`Payment validation failed: ${h.errors.join(", ")}`);return{...await this.generateQRCode(d),validation:h,instructions:{userAction:"Scan this QR code with your mobile wallet to pay",expectedFlow:"QR Scan → Payment Screen → Wallet Connect → Split Payment → Confirmation",supportedWallets:["MetaMask","Trust Wallet","Coinbase Wallet","WalletConnect compatible wallets"]}}}}const J=new W;function _(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $,ee,te={exports:{}},ne=te.exports={};function ie(){throw new Error("setTimeout has not been defined")}function re(){throw new Error("clearTimeout has not been defined")}function oe(e){if($===setTimeout)return setTimeout(e,0);if(($===ie||!$)&&setTimeout)return $=setTimeout,setTimeout(e,0);try{return $(e,0)}catch(t){try{return $.call(null,e,0)}catch(n){return $.call(this,e,0)}}}!function(){try{$="function"==typeof setTimeout?setTimeout:ie}catch(e){$=ie}try{ee="function"==typeof clearTimeout?clearTimeout:re}catch(e){ee=re}}();var se,ae=[],ce=!1,le=-1;function ue(){ce&&se&&(ce=!1,se.length?ae=se.concat(ae):le=-1,ae.length&&de())}function de(){if(!ce){var e=oe(ue);ce=!0;for(var t=ae.length;t;){for(se=ae,ae=[];++le<t;)se&&se[le].run();le=-1,t=ae.length}se=null,ce=!1,function(e){if(ee===clearTimeout)return clearTimeout(e);if((ee===re||!ee)&&clearTimeout)return ee=clearTimeout,clearTimeout(e);try{return ee(e)}catch(t){try{return ee.call(null,e)}catch(n){return ee.call(this,e)}}}(e)}}function he(e,t){this.fun=e,this.array=t}function Ae(){}ne.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];ae.push(new he(e,t)),1!==ae.length||ce||oe(de)},he.prototype.run=function(){this.fun.apply(null,this.array)},ne.title="browser",ne.browser=!0,ne.env={},ne.argv=[],ne.version="",ne.versions={},ne.on=Ae,ne.addListener=Ae,ne.once=Ae,ne.off=Ae,ne.removeListener=Ae,ne.removeAllListeners=Ae,ne.emit=Ae,ne.prependListener=Ae,ne.prependOnceListener=Ae,ne.listeners=function(e){return[]},ne.binding=function(e){throw new Error("process.binding is not supported")},ne.cwd=function(){return"/"},ne.chdir=function(e){throw new Error("process.chdir is not supported")},ne.umask=function(){return 0};const pe=_(te.exports);var me;if("undefined"==typeof window){var fe={hostname:""};me={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:fe,referrer:""},screen:{width:0,height:0},location:fe,addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(){},CustomEvent:function(){}}}else me=window;function ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function ye(e,t,n,i,r,o,s){try{var a=e[o](s),c=a.value}catch(gd){return void n(gd)}a.done?t(c):Promise.resolve(c).then(i,r)}function be(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){ye(o,i,r,s,a,"next",e)}function a(e){ye(o,i,r,s,a,"throw",e)}s(void 0)})}}function we(e,t,n){return(we=De()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&Ie(r,n.prototype),r}).apply(null,arguments)}function ve(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}function ke(){return ke=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ke.apply(this,arguments)}function xe(e){return(xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ce(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ie(e,t)}function Se(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function Be(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}function Ie(e,t){return(Ie=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ee(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function Me(e){var t="function"==typeof Map?new Map:void 0;return Me=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return we(e,arguments,xe(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ie(i,e)},Me(e)}function De(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(De=function(){return!!e})()}function Qe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ge(e,t):void 0}}(e))||t){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ue(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function Fe(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var Ne,Te=Object.defineProperty,Le=function(e,t,n){return function(e,t,n){return t in e?Te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":Ee(t))?t+"":t,n)},Pe=Object.defineProperty,Oe=function(e,t,n){return function(e,t,n){return t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":Ee(t))?t+"":t,n)},Re=function(e){return e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e}(Re||{}),ze={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},qe={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ye={};function Ke(e){if(Ye[e])return Ye[e];var t=globalThis[e],n=t.prototype,i=e in ze?ze[e]:void 0,r=Boolean(i&&i.every(function(e){var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))})),o=e in qe?qe[e]:void 0,s=Boolean(o&&o.every(function(e){var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(r&&s&&!globalThis.Zone)return Ye[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var c=a.contentWindow;if(!c)return t.prototype;var l=c[e].prototype;return document.body.removeChild(a),l?Ye[e]=l:n}catch(u){return n}}var He={};function Ve(e,t,n){var i,r=e+"."+String(n);if(He[r])return He[r].call(t);var o=Ke(e),s=null==(i=Object.getOwnPropertyDescriptor(o,n))?void 0:i.get;return s?(He[r]=s,s.call(t)):t[n]}var je={};function Ze(e,t,n){var i=e+"."+String(n);if(je[i])return je[i].bind(t);var r=Ke(e)[n];return"function"!=typeof r?t[n]:(je[i]=r,r.bind(t))}var Xe={childNodes:function(e){return Ve("Node",e,"childNodes")},parentNode:function(e){return Ve("Node",e,"parentNode")},parentElement:function(e){return Ve("Node",e,"parentElement")},textContent:function(e){return Ve("Node",e,"textContent")},contains:function(e,t){return Ze("Node",e,"contains")(t)},getRootNode:function(e){return Ze("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ve("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ve("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ve("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ve("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Ke("MutationObserver").constructor},patch:function(e,t,n){try{if(!(t in e))return function(){};var i=e[t],r=n(i);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=r,function(){e[t]=i}}catch(o){return function(){}}}};function Ge(e){return e.nodeType===e.ELEMENT_NODE}function We(e){var t=e&&"host"in e&&"mode"in e&&Xe.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Xe.shadowRoot(t)===e)}function Je(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function _e(e){try{var t=e.rules||e.cssRules;if(!t)return null;var n=e.href;!n&&e.ownerNode&&e.ownerNode.ownerDocument&&(n=e.ownerNode.ownerDocument.location.href);var i=Array.from(t,function(e){return $e(e,n)}).join("");return(r=i).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r}catch(gd){return null}var r}function $e(e,t){if(function(e){return"styleSheet"in e}(e)){var n;try{n=_e(e.styleSheet)||function(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer("+e.layerName+")"),e.supportsText&&n.push("supports("+e.supportsText+")"),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(gd){n=e.cssText}return e.styleSheet.href?ut(n,e.styleSheet.href):n}var i,r=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,r=r.replace(i,"$1\\$2")),t?ut(r,t):r}var et=function(){function e(){Oe(this,"idNodeMap",new Map),Oe(this,"nodeMetaMap",new WeakMap)}var t=e.prototype;return t.getId=function(e){var t;if(!e)return-1;var n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-1},t.getNode=function(e){return this.idNodeMap.get(e)||null},t.getIds=function(){return Array.from(this.idNodeMap.keys())},t.getMeta=function(e){return this.nodeMetaMap.get(e)||null},t.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},t.has=function(e){return this.idNodeMap.has(e)},t.hasNode=function(e){return this.nodeMetaMap.has(e)},t.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},t.replace=function(e,t){var n=this.getNode(e);if(n){var i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)},t.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function tt(e){var t=e.element,n=e.maskInputOptions,i=e.tagName,r=e.type,o=e.value,s=e.maskInputFn,a=o||"",c=r&&nt(r);return(n[i.toLowerCase()]||c&&n[c])&&(a=s?s(a,t):"*".repeat(a.length)),a}function nt(e){return e.toLowerCase()}var it="__rrweb_original__";function rt(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?nt(t):null}function ot(e,t){var n;try{n=new URL(e,null!=t?t:window.location.href)}catch(o){return null}var i,r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!=(i=null==r?void 0:r[1])?i:null}var st=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,at=/^(?:[a-z+]+:)?\/\//i,ct=/^www\..*/i,lt=/^(data:)([^,]*),(.*)/i;function ut(e,t){return(e||"").replace(st,function(e,n,i,r,o,s){var a,c=i||o||s,l=n||r||"";if(!c)return e;if(at.test(c)||ct.test(c))return"url("+l+c+l+")";if(lt.test(c))return"url("+l+c+l+")";if("/"===c[0])return"url("+l+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+c)+l+")";var u=t.split("/"),d=c.split("/");u.pop();for(var h,A=Qe(d);!(h=A()).done;){var p=h.value;"."!==p&&(".."===p?u.pop():u.push(p))}return"url("+l+u.join("/")+l+")"})}function dt(e,t){return void 0===t&&(t=!1),t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function ht(e,t){return function(e,t,n){void 0===n&&(n=!1);var i=Array.from(t.childNodes),r=[],o=0;if(i.length>1&&e&&"string"==typeof e)for(var s=dt(e,n),a=s.length/e.length,c=1;c<i.length;c++)if(i[c].textContent&&"string"==typeof i[c].textContent){for(var l=dt(i[c].textContent,n),u=3;u<l.length&&(l[u].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,u),1));u++);for(;u<l.length;u++){var d=l.substring(0,u),h=s.split(d),A=-1;if(2===h.length)A=h[0].length;else if(h.length>2&&""===h[0]&&""!==i[c-1].textContent)A=s.indexOf(d,1);else if(1===h.length){if(d=d.substring(0,d.length-1),(h=s.split(d)).length<=1)return r.push(e),r;u=101}else u===l.length-1&&(A=s.indexOf(d));if(h.length>=2&&u>100){var p=i[c-1].textContent;if(p&&"string"==typeof p){var m=dt(p).length;A=s.indexOf(d,m)}-1===A&&(A=h[0].length)}if(-1!==A){for(var f=Math.floor(A/a);f>0&&f<e.length;){if((o+=1)>50*i.length)return r.push(e),r;var g=dt(e.substring(0,f),n);if(g.length===A){r.push(e.substring(0,f)),e=e.substring(f),s=s.substring(A);break}g.length<A?f+=Math.max(1,Math.floor((A-g.length)/a)):f-=Math.max(1,Math.floor((g.length-A)*a))}break}}}return r.push(e),r}(e,t).join("/* rr_split */")}var At,pt,mt=1,ft=new RegExp("[^a-z0-9-_:]");function gt(){return mt++}var yt=/^[^ \t\n\r\u000c]+/,bt=/^[, \t\n\r\u000c]+/;var wt=new WeakMap;function vt(e,t){return t&&""!==t.trim()?xt(e,t):t}function kt(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function xt(e,t){var n=wt.get(e);if(n||(n=e.createElement("a"),wt.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function Ct(e,t,n,i){return i?"src"===n||"href"===n&&("use"!==t||"#"!==i[0])||"xlink:href"===n&&"#"!==i[0]?vt(e,i):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function i(e){var i,r=e.exec(t.substring(n));return r?(i=r[0],n+=i.length,i):""}for(var r=[];i(bt),!(n>=t.length);){var o=i(yt);if(","===o.slice(-1))o=vt(e,o.substring(0,o.length-1)),r.push(o);else{var s="";o=vt(e,o);for(var a=!1;;){var c=t.charAt(n);if(""===c){r.push((o+s).trim());break}if(a)")"===c&&(a=!1);else{if(","===c){n+=1,r.push((o+s).trim());break}"("===c&&(a=!0)}s+=c,n+=1}}}return r.join(", ")}(e,i):"style"===n?ut(i,xt(e)):"object"===t&&"data"===n?vt(e,i):i:vt(e,i):i}function St(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function Bt(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&Bt(Xe.parentNode(e),t,n);for(var i=e.classList.length;i--;){var r=e.classList[i];if(t.test(r))return!0}return!!n&&Bt(Xe.parentNode(e),t,n)}function It(e,t,n,i){var r;if(Ge(e)){if(r=e,!Xe.childNodes(r).length)return!1}else{if(null===Xe.parentElement(e))return!1;r=Xe.parentElement(e)}try{if("string"==typeof t){if(i){if(r.closest("."+t))return!0}else if(r.classList.contains(t))return!0}else if(Bt(r,t,i))return!0;if(n)if(i){if(r.closest(n))return!0}else if(r.matches(n))return!0}catch(o){}return!1}function Et(e,t){var n=t.doc,i=t.mirror,r=t.blockClass,o=t.blockSelector,s=t.needsMask,a=t.inlineStylesheet,c=t.maskInputOptions,l=void 0===c?{}:c,u=t.maskTextFn,d=t.maskInputFn,h=t.dataURLOptions,A=void 0===h?{}:h,p=t.inlineImages,m=t.recordCanvas,f=t.keepIframeSrcFn,g=t.newlyAddedElement,y=void 0!==g&&g,b=t.cssCaptured,w=void 0!==b&&b,v=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,i);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Re.Document,childNodes:[],compatMode:e.compatMode}:{type:Re.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Re.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){for(var n,i=t.doc,r=t.blockClass,o=t.blockSelector,s=t.inlineStylesheet,a=t.maskInputOptions,c=void 0===a?{}:a,l=t.maskInputFn,u=t.dataURLOptions,d=void 0===u?{}:u,h=t.inlineImages,A=t.recordCanvas,p=t.keepIframeSrcFn,m=t.newlyAddedElement,f=void 0!==m&&m,g=t.rootId,y=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;){var r=e.classList[i];if(t.test(r))return!0}if(n)return e.matches(n)}catch(o){}return!1}(e,r,o),b=function(e){if(Se(e,HTMLFormElement))return"form";var t=nt(e.tagName);return ft.test(t)?"div":t}(e),w={},v=e.attributes.length,k=0;k<v;k++){var x=e.attributes[k];St(b,x.name,x.value)||(w[x.name]=Ct(i,b,nt(x.name),x.value))}if("link"===b&&s){var C=Array.from(i.styleSheets).find(function(t){return t.href===e.href}),S=null;C&&(S=_e(C)),S&&(delete w.rel,delete w.href,w._cssText=S)}if("style"===b&&e.sheet){var B=_e(e.sheet);B&&(e.childNodes.length>1&&(B=ht(B,e)),w._cssText=B)}if("input"===b||"textarea"===b||"select"===b){var I=e.value,E=e.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&I?w.value=tt({element:e,type:rt(e),tagName:b,value:I,maskInputOptions:c,maskInputFn:l}):E&&(w.checked=E)}"option"===b&&(e.selected&&!c.select?w.selected=!0:delete w.selected);"dialog"===b&&e.open&&(w.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===b&&A)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var i=0;i<e.height;i+=50){var r=t.getImageData,o=it in r?r[it]:r;if(new Uint32Array(o.call(t,n,i,Math.min(50,e.width-n),Math.min(50,e.height-i)).data.buffer).some(function(e){return 0!==e}))return!1}return!0})(e)||(w.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var M=e.toDataURL(d.type,d.quality),D=i.createElement("canvas");D.width=e.width,D.height=e.height,M!==D.toDataURL(d.type,d.quality)&&(w.rr_dataURL=M)}if("img"===b&&h){At||(At=i.createElement("canvas"),pt=At.getContext("2d"));var Q=e,U=Q.currentSrc||Q.getAttribute("src")||"<unknown-src>",F=Q.crossOrigin,N=function(){Q.removeEventListener("load",N);try{At.width=Q.naturalWidth,At.height=Q.naturalHeight,pt.drawImage(Q,0,0),w.rr_dataURL=At.toDataURL(d.type,d.quality)}catch(e){if("anonymous"!==Q.crossOrigin)return Q.crossOrigin="anonymous",void(Q.complete&&0!==Q.naturalWidth?N():Q.addEventListener("load",N));console.warn("Cannot inline img src="+U+"! Error: "+e)}"anonymous"===Q.crossOrigin&&(F?w.crossOrigin=F:Q.removeAttribute("crossorigin"))};Q.complete&&0!==Q.naturalWidth?N():Q.addEventListener("load",N)}if("audio"===b||"video"===b){var T=w;T.rr_mediaState=e.paused?"paused":"played",T.rr_mediaCurrentTime=e.currentTime,T.rr_mediaPlaybackRate=e.playbackRate,T.rr_mediaMuted=e.muted,T.rr_mediaLoop=e.loop,T.rr_mediaVolume=e.volume}f||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop));if(y){var L=e.getBoundingClientRect(),P=L.width,O=L.height;w={class:w.class,rr_width:P+"px",rr_height:O+"px"}}"iframe"!==b||p(w.src)||(e.contentDocument||(w.rr_src=w.src),delete w.src);try{customElements.get(b)&&(n=!0)}catch(R){}return{type:Re.Element,tagName:b,attributes:w,childNodes:[],isSVG:kt(e)||void 0,needBlock:y,rootId:g,isCustom:n}}(e,{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:d,dataURLOptions:A,inlineImages:p,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:y,rootId:v});case e.TEXT_NODE:return function(e,t){var n=t.needsMask,i=t.maskTextFn,r=t.rootId,o=t.cssCaptured,s=Xe.parentNode(e),a=s&&s.tagName,c="",l="STYLE"===a||void 0,u="SCRIPT"===a||void 0;u?c="SCRIPT_PLACEHOLDER":o||(c=Xe.textContent(e),l&&c&&(c=ut(c,xt(t.doc))));!l&&!u&&c&&n&&(c=i?i(c,Xe.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:Re.Text,textContent:c||"",rootId:r}}(e,{doc:n,needsMask:s,maskTextFn:u,rootId:v,cssCaptured:w});case e.CDATA_SECTION_NODE:return{type:Re.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:Re.Comment,textContent:Xe.textContent(e)||"",rootId:v};default:return!1}}function Mt(e){return null==e?"":e.toLowerCase()}function Dt(e,t){var n=t.doc,i=t.mirror,r=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,c=t.skipChild,l=void 0!==c&&c,u=t.inlineStylesheet,d=void 0===u||u,h=t.maskInputOptions,A=void 0===h?{}:h,p=t.maskTextFn,m=t.maskInputFn,f=t.slimDOMOptions,g=t.dataURLOptions,y=void 0===g?{}:g,b=t.inlineImages,w=void 0!==b&&b,v=t.recordCanvas,k=void 0!==v&&v,x=t.onSerialize,C=t.onIframeLoad,S=t.iframeLoadTimeout,B=void 0===S?5e3:S,I=t.onStylesheetLoad,E=t.stylesheetLoadTimeout,M=void 0===E?5e3:E,D=t.keepIframeSrcFn,Q=void 0===D?function(){return!1}:D,U=t.newlyAddedElement,F=void 0!==U&&U,N=t.cssCaptured,T=void 0!==N&&N,L=t.needsMask,P=t.preserveWhiteSpace,O=void 0===P||P;L||(L=It(e,s,a,void 0===L));var R,z=Et(e,{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:L,inlineStylesheet:d,maskInputOptions:A,maskTextFn:p,maskInputFn:m,dataURLOptions:y,inlineImages:w,recordCanvas:k,keepIframeSrcFn:Q,newlyAddedElement:F,cssCaptured:T});if(!z)return console.warn(e,"not serialized"),null;R=i.hasNode(e)?i.getId(e):function(e,t){if(t.comment&&e.type===Re.Comment)return!0;if(e.type===Re.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===ot(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Mt(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Mt(e.attributes.name)||"icon"===Mt(e.attributes.rel)||"apple-touch-icon"===Mt(e.attributes.rel)||"shortcut icon"===Mt(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Mt(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Mt(e.attributes.property).match(/^(og|twitter|fb):/)||Mt(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Mt(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Mt(e.attributes.name)||"googlebot"===Mt(e.attributes.name)||"bingbot"===Mt(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Mt(e.attributes.name)||"generator"===Mt(e.attributes.name)||"framework"===Mt(e.attributes.name)||"publisher"===Mt(e.attributes.name)||"progid"===Mt(e.attributes.name)||Mt(e.attributes.property).match(/^article:/)||Mt(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Mt(e.attributes.name)||"yandex-verification"===Mt(e.attributes.name)||"csrf-token"===Mt(e.attributes.name)||"p:domain_verify"===Mt(e.attributes.name)||"verify-v1"===Mt(e.attributes.name)||"verification"===Mt(e.attributes.name)||"shopify-checkout-api-token"===Mt(e.attributes.name)))return!0}}return!1}(z,f)||!O&&z.type===Re.Text&&!z.textContent.replace(/^\s+|\s+$/gm,"").length?-2:gt();var q=Object.assign(z,{id:R});if(i.add(e,q),-2===R)return null;x&&x(e);var Y=!l;if(q.type===Re.Element){Y=Y&&!q.needBlock,delete q.needBlock;var K=Xe.shadowRoot(e);K&&Je(K)&&(q.isShadowHost=!0)}if((q.type===Re.Document||q.type===Re.Element)&&Y){f.headWhitespace&&q.type===Re.Element&&"head"===q.tagName&&(O=!1);var H={doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:L,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:d,maskInputOptions:A,maskTextFn:p,maskInputFn:m,slimDOMOptions:f,dataURLOptions:y,inlineImages:w,recordCanvas:k,preserveWhiteSpace:O,onSerialize:x,onIframeLoad:C,iframeLoadTimeout:B,onStylesheetLoad:I,stylesheetLoadTimeout:M,keepIframeSrcFn:Q,cssCaptured:!1};if(q.type===Re.Element&&"textarea"===q.tagName&&void 0!==q.attributes.value);else{q.type===Re.Element&&void 0!==q.attributes._cssText&&"string"==typeof q.attributes._cssText&&(H.cssCaptured=!0);for(var V,j=Qe(Array.from(Xe.childNodes(e)));!(V=j()).done;){var Z=Dt(V.value,H);Z&&q.childNodes.push(Z)}}var X=null;if(Ge(e)&&(X=Xe.shadowRoot(e)))for(var G,W=Qe(Array.from(Xe.childNodes(X)));!(G=W()).done;){var J=Dt(G.value,H);J&&(Je(X)&&(J.isShadow=!0),q.childNodes.push(J))}}var _=Xe.parentNode(e);return _&&We(_)&&Je(_)&&(q.isShadow=!0),q.type===Re.Element&&"iframe"===q.tagName&&function(e,t,n){var i=e.contentWindow;if(i){var r,o=!1;try{r=i.document.readyState}catch(gd){return}if("complete"===r){var s="about:blank";if(i.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()})}}}(e,function(){var t=e.contentDocument;if(t&&C){var n=Dt(t,{doc:t,mirror:i,blockClass:r,blockSelector:o,needsMask:L,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:A,maskTextFn:p,maskInputFn:m,slimDOMOptions:f,dataURLOptions:y,inlineImages:w,recordCanvas:k,preserveWhiteSpace:O,onSerialize:x,onIframeLoad:C,iframeLoadTimeout:B,onStylesheetLoad:I,stylesheetLoadTimeout:M,keepIframeSrcFn:Q});n&&C(e,n)}},B),q.type===Re.Element&&"link"===q.tagName&&"string"==typeof q.attributes.rel&&("stylesheet"===q.attributes.rel||"preload"===q.attributes.rel&&"string"==typeof q.attributes.href&&"css"===ot(q.attributes.href))&&function(e,t,n){var i,r=!1;try{i=e.sheet}catch(gd){return}if(!i){var o=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(o),r=!0,t()})}}(e,function(){if(I){var t=Dt(e,{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:L,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:A,maskTextFn:p,maskInputFn:m,slimDOMOptions:f,dataURLOptions:y,inlineImages:w,recordCanvas:k,preserveWhiteSpace:O,onSerialize:x,onIframeLoad:C,iframeLoadTimeout:B,onStylesheetLoad:I,stylesheetLoadTimeout:M,keepIframeSrcFn:Q});t&&I(e,t)}},M),q}function Qt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ut(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return Se(this,e)?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})}),n}var Ft={exports:{}},Nt=String,Tt=function(){return{isColorSupported:!1,reset:Nt,bold:Nt,dim:Nt,italic:Nt,underline:Nt,inverse:Nt,hidden:Nt,strikethrough:Nt,black:Nt,red:Nt,green:Nt,yellow:Nt,blue:Nt,magenta:Nt,cyan:Nt,white:Nt,gray:Nt,bgBlack:Nt,bgRed:Nt,bgGreen:Nt,bgYellow:Nt,bgBlue:Nt,bgMagenta:Nt,bgCyan:Nt,bgWhite:Nt}};Ft.exports=Tt(),Ft.exports.createColors=Tt;var Lt=Ft.exports,Pt=Ut(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),Ot=Lt,Rt=Pt,zt=function(e){function t(n,i,r,o,s,a){var c;return(c=e.call(this,n)||this).name="CssSyntaxError",c.reason=n,s&&(c.file=s),o&&(c.source=o),a&&(c.plugin=a),void 0!==i&&void 0!==r&&("number"==typeof i?(c.line=i,c.column=r):(c.line=i.line,c.column=i.column,c.endLine=r.line,c.endColumn=r.column)),c.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(c,t),c}Ce(t,e);var n=t.prototype;return n.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},n.showSourceCode=function(e){var t=this;if(!this.source)return"";var n=this.source;null==e&&(e=Ot.isColorSupported),Rt&&e&&(n=Rt(n));var i,r,o=n.split(/\r?\n/),s=Math.max(this.line-3,0),a=Math.min(this.line+2,o.length),c=String(a).length;if(e){var l=Ot.createColors(!0),u=l.bold,d=l.gray,h=l.red;i=function(e){return u(h(e))},r=function(e){return d(e)}}else i=r=function(e){return e};return o.slice(s,a).map(function(e,n){var o=s+1+n,a=" "+(" "+o).slice(-c)+" | ";if(o===t.line){var l=r(a.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return i(">")+r(a)+e+"\n "+l+i("^")}return" "+r(a)+e}).join("\n")},n.toString=function(){var e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e},t}(Me(Error)),qt=zt;zt.default=zt;var Yt={};Yt.isClean=Symbol("isClean"),Yt.my=Symbol("my");var Kt={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};var Ht=function(){function e(e){this.builder=e}var t=e.prototype;return t.atrule=function(e,t){var n="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:i&&(n+=" "),e.nodes)this.block(e,n+i);else{var r=(e.raws.between||"")+(t?";":"");this.builder(n+i+r,e)}},t.beforeAfter=function(e,t){var n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");for(var i=e.parent,r=0;i&&"root"!==i.type;)r+=1,i=i.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var s=0;s<r;s++)n+=o}return n},t.block=function(e,t){var n,i=this.raw(e,"between","beforeOpen");this.builder(t+i+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")},t.body=function(e){for(var t=e.nodes.length-1;t>0&&"comment"===e.nodes[t].type;)t-=1;for(var n=this.raw(e,"semicolon"),i=0;i<e.nodes.length;i++){var r=e.nodes[i],o=this.raw(r,"before");o&&this.builder(o),this.stringify(r,t!==i||n)}},t.comment=function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)},t.decl=function(e,t){var n=this.raw(e,"between","colon"),i=e.prop+n+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)},t.document=function(e){this.body(e)},t.raw=function(e,t,n){var i;if(n||(n=t),t&&void 0!==(i=e.raws[t]))return i;var r=e.parent;if("before"===n){if(!r||"root"===r.type&&r.first===e)return"";if(r&&"document"===r.type)return""}if(!r)return Kt[n];var o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);var s,a="raw"+((s=n)[0].toUpperCase()+s.slice(1));return this[a]?i=this[a](o,e):o.walk(function(e){if(void 0!==(i=e.raws[t]))return!1}),void 0===i&&(i=Kt[n]),o.rawCache[n]=i,i},t.rawBeforeClose=function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t},t.rawBeforeComment=function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n},t.rawBeforeDecl=function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n},t.rawBeforeOpen=function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t},t.rawBeforeRule=function(e){var t;return e.walk(function(n){if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return(t=n.raws.before).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t},t.rawColon=function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t},t.rawEmptyBody=function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t},t.rawIndent=function(e){return e.raws.indent?e.raws.indent:(e.walk(function(n){var i=n.parent;if(i&&i!==e&&i.parent&&i.parent===e&&void 0!==n.raws.before){var r=n.raws.before.split("\n");return t=(t=r[r.length-1]).replace(/\S/g,""),!1}}),t);var t},t.rawSemicolon=function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t},t.rawValue=function(e,t){var n=e[t],i=e.raws[t];return i&&i.value===n?i.raw:n},t.root=function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)},t.rule=function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")},t.stringify=function(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)},e}(),Vt=Ht;Ht.default=Ht;var jt=Vt;function Zt(e,t){new jt(t).stringify(e)}var Xt=Zt;Zt.default=Zt;var Gt=Yt.isClean,Wt=Yt.my,Jt=qt,_t=Vt,$t=Xt;function en(e,t){var n=new e.constructor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&"proxyCache"!==i){var r=e[i],o=void 0===r?"undefined":Ee(r);"parent"===i&&"object"===o?t&&(n[i]=t):"source"===i?n[i]=r:Array.isArray(r)?n[i]=r.map(function(e){return en(e,n)}):("object"===o&&null!==r&&(r=en(r)),n[i]=r)}return n}var tn=function(){function e(e){for(var t in void 0===e&&(e={}),this.raws={},this[Gt]=!1,this[Wt]=!0,e)if("nodes"===t){this.nodes=[];for(var n,i=Qe(e[t]);!(n=i()).done;){var r=n.value;"function"==typeof r.clone?this.append(r.clone()):this.append(r)}}else this[t]=e[t]}var t=e.prototype;return t.addToError=function(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){var t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,"$&"+t.input.from+":"+t.start.line+":"+t.start.column+"$&")}return e},t.after=function(e){return this.parent.insertAfter(this,e),this},t.assign=function(e){for(var t in void 0===e&&(e={}),e)this[t]=e[t];return this},t.before=function(e){return this.parent.insertBefore(this,e),this},t.cleanRaws=function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between},t.clone=function(e){void 0===e&&(e={});var t=en(this);for(var n in e)t[n]=e[n];return t},t.cloneAfter=function(e){void 0===e&&(e={});var t=this.clone(e);return this.parent.insertAfter(this,t),t},t.cloneBefore=function(e){void 0===e&&(e={});var t=this.clone(e);return this.parent.insertBefore(this,t),t},t.error=function(e,t){if(void 0===t&&(t={}),this.source){var n=this.rangeBy(t),i=n.end,r=n.start;return this.source.input.error(e,{column:r.column,line:r.line},{column:i.column,line:i.line},t)}return new Jt(e)},t.getProxyProcessor=function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}},t.markDirty=function(){if(this[Gt]){this[Gt]=!1;for(var e=this;e=e.parent;)e[Gt]=!1}},t.next=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e+1]}},t.positionBy=function(e,t){var n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){var i=(t=this.toString()).indexOf(e.word);-1!==i&&(n=this.positionInside(i,t))}return n},t.positionInside=function(e,t){for(var n=t||this.toString(),i=this.source.start.column,r=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?(i=1,r+=1):i+=1;return{column:i,line:r}},t.prev=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e-1]}},t.rangeBy=function(e){var t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){var i=this.toString(),r=i.indexOf(e.word);-1!==r&&(t=this.positionInside(r,i),n=this.positionInside(r+e.word.length,i))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}},t.raw=function(e,t){return(new _t).raw(this,e,t)},t.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},t.replaceWith=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(this.parent){for(var i,r=this,o=!1,s=Qe(t);!(i=s()).done;){var a=i.value;a===this?o=!0:o?(this.parent.insertAfter(r,a),r=a):this.parent.insertBefore(r,a)}o||this.remove()}return this},t.root=function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e},t.toJSON=function(e,t){var n={},i=null==t;t=t||new Map;var r=0;for(var o in this)if(Object.prototype.hasOwnProperty.call(this,o)&&"parent"!==o&&"proxyCache"!==o){var s=this[o];if(Array.isArray(s))n[o]=s.map(function(e){return"object"===(void 0===e?"undefined":Ee(e))&&e.toJSON?e.toJSON(null,t):e});else if("object"===(void 0===s?"undefined":Ee(s))&&s.toJSON)n[o]=s.toJSON(null,t);else if("source"===o){var a=t.get(s.input);null==a&&(a=r,t.set(s.input,r),r++),n[o]={end:s.end,inputId:a,start:s.start}}else n[o]=s}return i&&(n.inputs=[].concat(t.keys()).map(function(e){return e.toJSON()})),n},t.toProxy=function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache},t.toString=function(e){void 0===e&&(e=$t),e.stringify&&(e=e.stringify);var t="";return e(this,function(e){t+=e}),t},t.warn=function(e,t,n){var i={node:this};for(var r in n)i[r]=n[r];return e.warn(t,i)},ve(e,[{key:"proxyOf",get:function(){return this}}]),e}(),nn=tn;tn.default=tn;var rn=function(e){function t(t){var n;return t&&void 0!==t.value&&"string"!=typeof t.value&&(t=ke({},t,{value:String(t.value)})),(n=e.call(this,t)||this).type="decl",n}return Ce(t,e),ve(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),t}(nn),on=rn;rn.default=rn;var sn=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},an=Pt.SourceMapConsumer,cn=Pt.SourceMapGenerator,ln=Pt.existsSync,un=Pt.readFileSync,dn=Pt.dirname,hn=Pt.join;var An=function(){function e(e,t){if(!1!==t.map){this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");var n=t.map?t.map.prev:void 0,i=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=dn(this.mapFile)),i&&(this.text=i)}}var t=e.prototype;return t.consumer=function(){return this.consumerCache||(this.consumerCache=new an(this.text)),this.consumerCache},t.decodeInline=function(e){var t;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),B?B.from(t,"base64").toString():window.atob(t);var n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)},t.getAnnotationURL=function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()},t.isMap=function(e){return"object"===(void 0===e?"undefined":Ee(e))&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))},t.loadAnnotation=function(e){var t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(t){var n=e.lastIndexOf(t.pop()),i=e.indexOf("*/",n);n>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,i)))}},t.loadFile=function(e){if(this.root=dn(e),ln(e))return this.mapFile=e,un(e,"utf-8").toString().trim()},t.loadMap=function(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(Se(t,an))return cn.fromSourceMap(t).toString();if(Se(t,cn))return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){var i=this.loadFile(n);if(!i)throw new Error("Unable to load previous source map: "+n.toString());return i}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){var r=this.annotation;return e&&(r=hn(dn(e),r)),this.loadFile(r)}}},t.startWith=function(e,t){return!!e&&e.substr(0,t.length)===t},t.withContent=function(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},e}(),pn=An;An.default=An;var mn=Pt.SourceMapConsumer,fn=Pt.SourceMapGenerator,gn=Pt.fileURLToPath,yn=Pt.pathToFileURL,bn=Pt.isAbsolute,wn=Pt.resolve,vn=sn,kn=Pt,xn=qt,Cn=pn,Sn=Symbol("fromOffsetCache"),Bn=Boolean(mn&&fn),In=Boolean(wn&&bn),En=function(){function e(e,t){if(void 0===t&&(t={}),null==e||"object"===(void 0===e?"undefined":Ee(e))&&!e.toString)throw new Error("PostCSS received "+e+" instead of CSS string");if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!In||/^\w+:\/\//.test(t.from)||bn(t.from)?this.file=t.from:this.file=wn(t.from)),In&&Bn){var n=new Cn(this.css,t);if(n.text){this.map=n;var i=n.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+vn(6)+">"),this.map&&(this.map.file=this.from)}var t=e.prototype;return t.error=function(e,t,n,i){var r,o,s;if(void 0===i&&(i={}),t&&"object"===(void 0===t?"undefined":Ee(t))){var a=t,c=n;if("number"==typeof a.offset){var l=this.fromOffset(a.offset);t=l.line,n=l.col}else t=a.line,n=a.column;if("number"==typeof c.offset){var u=this.fromOffset(c.offset);o=u.line,s=u.col}else o=c.line,s=c.column}else if(!n){var d=this.fromOffset(t);t=d.line,n=d.col}var h=this.origin(t,n,o,s);return(r=h?new xn(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,i.plugin):new xn(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:s,line:o},this.css,this.file,i.plugin)).input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(yn&&(r.input.url=yn(this.file).toString()),r.input.file=this.file),r},t.fromOffset=function(e){var t;if(this[Sn])t=this[Sn];else{var n=this.css.split("\n");t=new Array(n.length);for(var i=0,r=0,o=n.length;r<o;r++)t[r]=i,i+=n[r].length+1;this[Sn]=t}var s=0;if(e>=t[t.length-1])s=t.length-1;else for(var a,c=t.length-2;s<c;)if(e<t[a=s+(c-s>>1)])c=a-1;else{if(!(e>=t[a+1])){s=a;break}s=a+1}return{col:e-t[s]+1,line:s+1}},t.mapResolve=function(e){return/^\w+:\/\//.test(e)?e:wn(this.map.consumer().sourceRoot||this.map.root||".",e)},t.origin=function(e,t,n,i){if(!this.map)return!1;var r,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(r=s.originalPositionFor({column:i,line:n})),o=bn(a.source)?yn(a.source):new URL(a.source,this.map.consumer().sourceRoot||yn(this.map.mapFile));var c={column:a.column,endColumn:r&&r.column,endLine:r&&r.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!gn)throw new Error("file: protocol is not available in this PostCSS build");c.file=gn(o)}var l=s.sourceContentFor(a.source);return l&&(c.source=l),c},t.toJSON=function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var i=n[t];null!=this[i]&&(e[i]=this[i])}return this.map&&(e.map=ke({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e},ve(e,[{key:"from",get:function(){return this.file||this.id}}]),e}(),Mn=En;En.default=En,kn&&kn.registerInput&&kn.registerInput(En);var Dn=Pt.SourceMapConsumer,Qn=Pt.SourceMapGenerator,Un=Pt.dirname,Fn=Pt.relative,Nn=Pt.resolve,Tn=Pt.sep,Ln=Pt.pathToFileURL,Pn=Mn,On=Boolean(Dn&&Qn),Rn=Boolean(Un&&Nn&&Fn&&Tn),zn=function(){function e(e,t,n,i){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}var t=e.prototype;return t.addAnnotation=function(){var e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";var t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"},t.applyPrevMaps=function(){for(var e,t=Qe(this.previous());!(e=t()).done;){var n=e.value,i=this.toUrl(this.path(n.file)),r=n.root||Un(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new Dn(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,i,this.toUrl(this.path(r)))}},t.clearAnnotation=function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;t>=0;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))},t.generate=function(){if(this.clearAnnotation(),Rn&&On&&this.isMap())return this.generateMap();var e="";return this.stringify(this.root,function(t){e+=t}),[e]},t.generateMap=function(){if(this.root)this.generateString();else if(1===this.previous().length){var e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Qn.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Qn({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},t.generateString=function(){var e=this;this.css="",this.map=new Qn({file:this.outputFile(),ignoreInvalidMapping:!0});var t,n,i=1,r=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(a,c,l){if(e.css+=a,c&&"end"!==l&&(s.generated.line=i,s.generated.column=r-1,c.source&&c.source.start?(s.source=e.sourcePath(c),s.original.line=c.source.start.line,s.original.column=c.source.start.column-1,e.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,e.map.addMapping(s))),(t=a.match(/\n/g))?(i+=t.length,n=a.lastIndexOf("\n"),r=a.length-n):r+=a.length,c&&"start"!==l){var u=c.parent||{raws:{}};("decl"===c.type||"atrule"===c.type&&!c.nodes)&&c===u.last&&!u.raws.semicolon||(c.source&&c.source.end?(s.source=e.sourcePath(c),s.original.line=c.source.end.line,s.original.column=c.source.end.column-1,s.generated.line=i,s.generated.column=r-2,e.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=i,s.generated.column=r-1,e.map.addMapping(s)))}})},t.isAnnotation=function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))},t.isInline=function(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))},t.isMap=function(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0},t.isSourcesContent=function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})},t.outputFile=function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"},t.path=function(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;var n=this.opts.to?Un(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=Un(Nn(n,this.mapOpts.annotation)));var i=Fn(n,e);return this.memoizedPaths.set(e,i),i},t.previous=function(){var e=this;if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(function(t){if(t.source&&t.source.input.map){var n=t.source.input.map;e.previousMaps.includes(n)||e.previousMaps.push(n)}});else{var t=new Pn(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps},t.setSourcesContent=function(){var e=this,t={};if(this.root)this.root.walk(function(n){if(n.source){var i=n.source.input.from;if(i&&!t[i]){t[i]=!0;var r=e.usesFileUrls?e.toFileUrl(i):e.toUrl(e.path(i));e.map.setSourceContent(r,n.source.input.css)}}});else if(this.css){var n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}},t.sourcePath=function(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))},t.toBase64=function(e){return B?B.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))},t.toFileUrl=function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(Ln){var n=Ln(e).toString();return this.memoizedFileURLs.set(e,n),n}throw new Error("`map.absolute` option is not available in this PostCSS build")},t.toUrl=function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===Tn&&(e=e.replace(/\\/g,"/"));var n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n},e}(),qn=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="comment",n}return Ce(t,e),t}(nn),Yn=qn;qn.default=qn;var Kn,Hn,Vn,jn,Zn=Yt.isClean,Xn=Yt.my,Gn=on,Wn=Yn;function Jn(e){return e.map(function(e){return e.nodes&&(e.nodes=Jn(e.nodes)),delete e.source,e})}function _n(e){if(e[Zn]=!1,e.proxyOf.nodes)for(var t,n=Qe(e.proxyOf.nodes);!(t=n()).done;){_n(t.value)}}var $n=function(e){function t(){return e.apply(this,arguments)||this}Ce(t,e);var n=t.prototype;return n.append=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var i,r=Qe(t);!(i=r()).done;)for(var o,s=i.value,a=Qe(this.normalize(s,this.last));!(o=a()).done;){var c=o.value;this.proxyOf.nodes.push(c)}return this.markDirty(),this},n.cleanRaws=function(t){if(e.prototype.cleanRaws.call(this,t),this.nodes)for(var n,i=Qe(this.nodes);!(n=i()).done;){n.value.cleanRaws(t)}},n.each=function(e){if(this.proxyOf.nodes){for(var t,n,i=this.getIterator();this.indexes[i]<this.proxyOf.nodes.length&&(t=this.indexes[i],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[i]+=1;return delete this.indexes[i],n}},n.every=function(e){return this.nodes.every(e)},n.getIterator=function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e},n.getProxyProcessor=function(){return{get:function(e,t){return"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];var o;return(o=e)[t].apply(o,[].concat(i.map(function(e){return"function"==typeof e?function(t,n){return e(t.toProxy(),n)}:e})))}:"every"===t||"some"===t?function(n){return e[t](function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return n.apply(void 0,[].concat([e.toProxy()],i))})}:"root"===t?function(){return e.root().toProxy()}:"nodes"===t?e.nodes.map(function(e){return e.toProxy()}):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]},set:function(e,t,n){return e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}},n.index=function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))},n.insertAfter=function(e,t){var n,i=this.index(e),r=this.normalize(t,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(var o,s=Qe(r);!(o=s()).done;){var a=o.value;this.proxyOf.nodes.splice(i+1,0,a)}for(var c in this.indexes)i<(n=this.indexes[c])&&(this.indexes[c]=n+r.length);return this.markDirty(),this},n.insertBefore=function(e,t){var n,i=this.index(e),r=0===i&&"prepend",o=this.normalize(t,this.proxyOf.nodes[i],r).reverse();i=this.index(e);for(var s,a=Qe(o);!(s=a()).done;){var c=s.value;this.proxyOf.nodes.splice(i,0,c)}for(var l in this.indexes)i<=(n=this.indexes[l])&&(this.indexes[l]=n+o.length);return this.markDirty(),this},n.normalize=function(e,n){var i=this;if("string"==typeof e)e=Jn(Kn(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r,o=Qe(e=e.slice(0));!(r=o()).done;){var s=r.value;s.parent&&s.parent.removeChild(s,"ignore")}else if("root"===e.type&&"document"!==this.type)for(var a,c=Qe(e=e.nodes.slice(0));!(a=c()).done;){var l=a.value;l.parent&&l.parent.removeChild(l,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new Gn(e)]}else if(e.selector)e=[new Hn(e)];else if(e.name)e=[new Vn(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new Wn(e)]}return e.map(function(e){return e[Xn]||t.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[Zn]&&_n(e),void 0===e.raws.before&&n&&void 0!==n.raws.before&&(e.raws.before=n.raws.before.replace(/\S/g,"")),e.parent=i.proxyOf,e})},n.prepend=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var i,r=Qe(t=t.reverse());!(i=r()).done;){for(var o,s=i.value,a=this.normalize(s,this.first,"prepend").reverse(),c=Qe(a);!(o=c()).done;){var l=o.value;this.proxyOf.nodes.unshift(l)}for(var u in this.indexes)this.indexes[u]=this.indexes[u]+a.length}return this.markDirty(),this},n.push=function(e){return e.parent=this,this.proxyOf.nodes.push(e),this},n.removeAll=function(){for(var e,t=Qe(this.proxyOf.nodes);!(e=t()).done;){e.value.parent=void 0}return this.proxyOf.nodes=[],this.markDirty(),this},n.removeChild=function(e){var t;for(var n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this},n.replaceValues=function(e,t,n){return n||(n=t,t={}),this.walkDecls(function(i){t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,n))}),this.markDirty(),this},n.some=function(e){return this.nodes.some(e)},n.walk=function(e){return this.each(function(t,n){var i;try{i=e(t,n)}catch(r){throw t.addToError(r)}return!1!==i&&t.walk&&(i=t.walk(e)),i})},n.walkAtRules=function(e,t){return t?Se(e,RegExp)?this.walk(function(n,i){if("atrule"===n.type&&e.test(n.name))return t(n,i)}):this.walk(function(n,i){if("atrule"===n.type&&n.name===e)return t(n,i)}):(t=e,this.walk(function(e,n){if("atrule"===e.type)return t(e,n)}))},n.walkComments=function(e){return this.walk(function(t,n){if("comment"===t.type)return e(t,n)})},n.walkDecls=function(e,t){return t?Se(e,RegExp)?this.walk(function(n,i){if("decl"===n.type&&e.test(n.prop))return t(n,i)}):this.walk(function(n,i){if("decl"===n.type&&n.prop===e)return t(n,i)}):(t=e,this.walk(function(e,n){if("decl"===e.type)return t(e,n)}))},n.walkRules=function(e,t){return t?Se(e,RegExp)?this.walk(function(n,i){if("rule"===n.type&&e.test(n.selector))return t(n,i)}):this.walk(function(n,i){if("rule"===n.type&&n.selector===e)return t(n,i)}):(t=e,this.walk(function(e,n){if("rule"===e.type)return t(e,n)}))},ve(t,[{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}]),t}(nn);$n.registerParse=function(e){Kn=e},$n.registerRule=function(e){Hn=e},$n.registerAtRule=function(e){Vn=e},$n.registerRoot=function(e){jn=e};var ei=$n;$n.default=$n,$n.rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,Vn.prototype):"rule"===e.type?Object.setPrototypeOf(e,Hn.prototype):"decl"===e.type?Object.setPrototypeOf(e,Gn.prototype):"comment"===e.type?Object.setPrototypeOf(e,Wn.prototype):"root"===e.type&&Object.setPrototypeOf(e,jn.prototype),e[Xn]=!0,e.nodes&&e.nodes.forEach(function(e){$n.rebuild(e)})};var ti,ni,ii=function(e){function t(t){var n;return(n=e.call(this,ke({type:"document"},t))||this).nodes||(n.nodes=[]),n}return Ce(t,e),t.prototype.toResult=function(e){return void 0===e&&(e={}),new ti(new ni,this,e).stringify()},t}(ei);ii.registerLazyResult=function(e){ti=e},ii.registerProcessor=function(e){ni=e};var ri=ii;ii.default=ii;var oi=function(){function e(e,t){if(void 0===t&&(t={}),this.type="warning",this.text=e,t.node&&t.node.source){var n=t.node.rangeBy(t);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(var i in t)this[i]=t[i]}return e.prototype.toString=function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text},e}(),si=oi;oi.default=oi;var ai=si,ci=function(){function e(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}var t=e.prototype;return t.toString=function(){return this.css},t.warn=function(e,t){void 0===t&&(t={}),t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);var n=new ai(e,t);return this.messages.push(n),n},t.warnings=function(){return this.messages.filter(function(e){return"warning"===e.type})},ve(e,[{key:"content",get:function(){return this.css}}]),e}(),li=ci;ci.default=ci;var ui="'".charCodeAt(0),di='"'.charCodeAt(0),hi="\\".charCodeAt(0),Ai="/".charCodeAt(0),pi="\n".charCodeAt(0),mi=" ".charCodeAt(0),fi="\f".charCodeAt(0),gi="\t".charCodeAt(0),yi="\r".charCodeAt(0),bi="[".charCodeAt(0),wi="]".charCodeAt(0),vi="(".charCodeAt(0),ki=")".charCodeAt(0),xi="{".charCodeAt(0),Ci="}".charCodeAt(0),Si=";".charCodeAt(0),Bi="*".charCodeAt(0),Ii=":".charCodeAt(0),Ei="@".charCodeAt(0),Mi=/[\t\n\f\r "#'()/;[\\\]{}]/g,Di=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Qi=/.[\r\n"'(/\\]/,Ui=/[\da-f]/i,Fi=ei,Ni=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="atrule",n}Ce(t,e);var n=t.prototype;return n.append=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r;return this.proxyOf.nodes||(this.nodes=[]),(r=e.prototype.append).call.apply(r,[].concat([this],n))},n.prepend=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r;return this.proxyOf.nodes||(this.nodes=[]),(r=e.prototype.prepend).call.apply(r,[].concat([this],n))},t}(Fi),Ti=Ni;Ni.default=Ni,Fi.registerAtRule(Ni);var Li,Pi,Oi=ei,Ri=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="root",n.nodes||(n.nodes=[]),n}Ce(t,e);var n=t.prototype;return n.normalize=function(t,n,i){var r=e.prototype.normalize.call(this,t);if(n)if("prepend"===i)this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(var o,s=Qe(r);!(o=s()).done;){o.value.raws.before=n.raws.before}return r},n.removeChild=function(t,n){var i=this.index(t);return!n&&0===i&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),e.prototype.removeChild.call(this,t)},n.toResult=function(e){return void 0===e&&(e={}),new Li(new Pi,this,e).stringify()},t}(Oi);Ri.registerLazyResult=function(e){Li=e},Ri.registerProcessor=function(e){Pi=e};var zi=Ri;Ri.default=Ri,Oi.registerRoot(Ri);var qi={comma:function(e){return qi.split(e,[","],!0)},space:function(e){return qi.split(e,[" ","\n","\t"])},split:function(e,t,n){for(var i,r=[],o="",s=!1,a=0,c=!1,l="",u=!1,d=Qe(e);!(i=d()).done;){var h=i.value;u?u=!1:"\\"===h?u=!0:c?h===l&&(c=!1):'"'===h||"'"===h?(c=!0,l=h):"("===h?a+=1:")"===h?a>0&&(a-=1):0===a&&t.includes(h)&&(s=!0),s?(""!==o&&r.push(o.trim()),o="",s=!1):o+=h}return(n||""!==o)&&r.push(o.trim()),r}},Yi=qi;qi.default=qi;var Ki=ei,Hi=Yi,Vi=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="rule",n.nodes||(n.nodes=[]),n}return Ce(t,e),ve(t,[{key:"selectors",get:function(){return Hi.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}}]),t}(Ki),ji=Vi;Vi.default=Vi,Ki.registerRule(Vi);var Zi=on,Xi=function(e,t){void 0===t&&(t={});var n,i,r,o,s,a,c,l,u,d,h=e.css.valueOf(),A=t.ignoreErrors,p=h.length,m=0,f=[],g=[];function y(t){throw e.error("Unclosed "+t,m)}return{back:function(e){g.push(e)},endOfFile:function(){return 0===g.length&&m>=p},nextToken:function(e){if(g.length)return g.pop();if(!(m>=p)){var t=!!e&&e.ignoreUnclosed;switch(n=h.charCodeAt(m)){case pi:case mi:case gi:case yi:case fi:i=m;do{i+=1,n=h.charCodeAt(i)}while(n===mi||n===pi||n===gi||n===yi||n===fi);d=["space",h.slice(m,i)],m=i-1;break;case bi:case wi:case xi:case Ci:case Ii:case Si:case ki:var b=String.fromCharCode(n);d=[b,b,m];break;case vi:if(l=f.length?f.pop()[1]:"",u=h.charCodeAt(m+1),"url"===l&&u!==ui&&u!==di&&u!==mi&&u!==pi&&u!==gi&&u!==fi&&u!==yi){i=m;do{if(a=!1,-1===(i=h.indexOf(")",i+1))){if(A||t){i=m;break}y("bracket")}for(c=i;h.charCodeAt(c-1)===hi;)c-=1,a=!a}while(a);d=["brackets",h.slice(m,i+1),m,i],m=i}else i=h.indexOf(")",m+1),o=h.slice(m,i+1),-1===i||Qi.test(o)?d=["(","(",m]:(d=["brackets",o,m,i],m=i);break;case ui:case di:r=n===ui?"'":'"',i=m;do{if(a=!1,-1===(i=h.indexOf(r,i+1))){if(A||t){i=m+1;break}y("string")}for(c=i;h.charCodeAt(c-1)===hi;)c-=1,a=!a}while(a);d=["string",h.slice(m,i+1),m,i],m=i;break;case Ei:Mi.lastIndex=m+1,Mi.test(h),i=0===Mi.lastIndex?h.length-1:Mi.lastIndex-2,d=["at-word",h.slice(m,i+1),m,i],m=i;break;case hi:for(i=m,s=!0;h.charCodeAt(i+1)===hi;)i+=1,s=!s;if(n=h.charCodeAt(i+1),s&&n!==Ai&&n!==mi&&n!==pi&&n!==gi&&n!==yi&&n!==fi&&(i+=1,Ui.test(h.charAt(i)))){for(;Ui.test(h.charAt(i+1));)i+=1;h.charCodeAt(i+1)===mi&&(i+=1)}d=["word",h.slice(m,i+1),m,i],m=i;break;default:n===Ai&&h.charCodeAt(m+1)===Bi?(0===(i=h.indexOf("*/",m+2)+1)&&(A||t?i=h.length:y("comment")),d=["comment",h.slice(m,i+1),m,i],m=i):(Di.lastIndex=m+1,Di.test(h),i=0===Di.lastIndex?h.length-1:Di.lastIndex-2,d=["word",h.slice(m,i+1),m,i],f.push(d),m=i)}return m++,d}},position:function(){return m}}},Gi=Yn,Wi=Ti,Ji=zi,_i=ji,$i={empty:!0,space:!0};var er=function(){function e(e){this.input=e,this.root=new Ji,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}var t=e.prototype;return t.atrule=function(e){var t,n,i,r=new Wi;r.name=e[1].slice(1),""===r.name&&this.unnamedAtrule(r,e),this.init(r,e[2]);for(var o=!1,s=!1,a=[],c=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){r.source.end=this.getPosition(e[2]),r.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(n=a[i=a.length-1];n&&"space"===n[0];)n=a[--i];n&&(r.source.end=this.getPosition(n[3]||n[2]),r.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(r.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(r,"params",a),o&&(e=a[a.length-1],r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),s&&(r.nodes=[],this.current=r)},t.checkMissedSemicolon=function(e){var t=this.colon(e);if(!1!==t){for(var n,i=0,r=t-1;r>=0&&("space"===(n=e[r])[0]||2!==(i+=1));r--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}},t.colon=function(e){for(var t,n,i,r,o=0,s=Qe(e.entries());!(r=s()).done;){var a=r.value,c=a[0];if("("===(n=(t=a[1])[0])&&(o+=1),")"===n&&(o-=1),0===o&&":"===n){if(i){if("word"===i[0]&&"progid"===i[1])continue;return c}this.doubleColon(t)}i=t}return!1},t.comment=function(e){var t=new Gi;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;var n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{var i=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}},t.createTokenizer=function(){this.tokenizer=Xi(this.input)},t.decl=function(e,t){var n=new Zi;this.init(n,e[0][2]);var i,r=e[e.length-1];for(";"===r[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(r[3]||r[2]||function(e){for(var t=e.length-1;t>=0;t--){var n=e[t],i=n[3]||n[2];if(i)return i}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(i=e.shift())[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var s,a=[];e.length&&("space"===(s=e[0][0])||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(var c=e.length-1;c>=0;c--){if("!important"===(i=e[c])[1].toLowerCase()){n.important=!0;var l=this.stringFrom(e,c);" !important"!==(l=this.spacesFromEnd(e)+l)&&(n.raws.important=l);break}if("important"===i[1].toLowerCase()){for(var u=e.slice(0),d="",h=c;h>0;h--){var A=u[h][0];if(0===d.trim().indexOf("!")&&"space"!==A)break;d=u.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=u)}if("space"!==i[0]&&"comment"!==i[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=a.map(function(e){return e[1]}).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)},t.doubleColon=function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})},t.emptyRule=function(e){var t=new _i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t},t.end=function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)},t.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())},t.freeSemicolon=function(e){if(this.spaces+=e[1],this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}},t.getPosition=function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}},t.init=function(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)},t.other=function(e){for(var t=!1,n=null,i=!1,r=null,o=[],s=e[1].startsWith("--"),a=[],c=e;c;){if(n=c[0],a.push(c),"("===n||"["===n)r||(r=c),o.push("("===n?")":"]");else if(s&&i&&"{"===n)r||(r=c),o.push("}");else if(0===o.length){if(";"===n){if(i)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(i=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(r=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(r),t&&i){if(!s)for(;a.length&&("space"===(c=a[a.length-1][0])||"comment"===c);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)},t.parse=function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()},t.precheckMissedSemicolon=function(){},t.raw=function(e,t,n,i){for(var r,o,s,a,c=n.length,l="",u=!0,d=0;d<c;d+=1)"space"!==(o=(r=n[d])[0])||d!==c-1||i?"comment"===o?(a=n[d-1]?n[d-1][0]:"empty",s=n[d+1]?n[d+1][0]:"empty",$i[a]||$i[s]||","===l.slice(-1)?u=!1:l+=r[1]):l+=r[1]:u=!1;if(!u){var h=n.reduce(function(e,t){return e+t[1]},"");e.raws[t]={raw:h,value:l}}e[t]=l},t.rule=function(e){e.pop();var t=new _i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t},t.spacesAndCommentsFromEnd=function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n},t.spacesAndCommentsFromStart=function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n},t.spacesFromEnd=function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t},t.stringFrom=function(e,t){for(var n="",i=t;i<e.length;i++)n+=e[i][1];return e.splice(t,e.length-t),n},t.unclosedBlock=function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)},t.unclosedBracket=function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})},t.unexpectedClose=function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})},t.unknownWord=function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})},t.unnamedAtrule=function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})},e}(),tr=ei,nr=er,ir=Mn;function rr(e,t){var n=new ir(e,t),i=new nr(n);try{i.parse()}catch(r){throw r}return i.root}var or=rr;rr.default=rr,tr.registerParse(rr);var sr=Yt.isClean,ar=Yt.my,cr=zn,lr=Xt,ur=ei,dr=ri,hr=li,Ar=or,pr=zi,mr={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},fr={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},gr={Once:!0,postcssPlugin:!0,prepare:!0};function yr(e){return"object"===(void 0===e?"undefined":Ee(e))&&"function"==typeof e.then}function br(e){var t=!1,n=mr[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function wr(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:br(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function vr(e){return e[sr]=!1,e.nodes&&e.nodes.forEach(function(e){return vr(e)}),e}var kr={},xr=function(){function e(t,n,i){var r,o=this;if(this.stringified=!1,this.processed=!1,"object"!==(void 0===n?"undefined":Ee(n))||null===n||"root"!==n.type&&"document"!==n.type)if(Se(n,e)||Se(n,hr))r=vr(n.root),n.map&&(void 0===i.map&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=n.map);else{var s=Ar;i.syntax&&(s=i.syntax.parse),i.parser&&(s=i.parser),s.parse&&(s=s.parse);try{r=s(n,i)}catch(gd){this.processed=!0,this.error=gd}r&&!r[ar]&&ur.rebuild(r)}else r=vr(n);this.result=new hr(t,r,i),this.helpers=ke({},kr,{postcss:kr,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===(void 0===e?"undefined":Ee(e))&&e.prepare?ke({},e,e.prepare(o.result)):e})}var t=e.prototype;return t.async=function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.getAsyncError=function(){throw new Error("Use process(css).then(cb) to work with async plugins")},t.handleError=function(e,t){var n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(n.postcssVersion){0}}else e.plugin=n.postcssPlugin,e.setMessage()}catch(i){console&&console.error&&console.error(i)}return e},t.prepareVisitors=function(){var e=this;this.listeners={};for(var t,n=function(t,n,i){e.listeners[n]||(e.listeners[n]=[]),e.listeners[n].push([t,i])},i=Qe(this.plugins);!(t=i()).done;){var r=t.value;if("object"===(void 0===r?"undefined":Ee(r)))for(var o in r){if(!fr[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event "+o+" in "+r.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!gr[o])if("object"===Ee(r[o]))for(var s in r[o])n(r,"*"===s?o:o+"-"+s.toLowerCase(),r[o][s]);else"function"==typeof r[o]&&n(r,o,r[o])}}this.hasListener=Object.keys(this.listeners).length>0},t.runAsync=function(){var e=this;return be(function(){var t,n,i,r,o,s,a,c,l,u,d,h;return Ue(this,function(A){switch(A.label){case 0:e.plugin=0,t=0,A.label=1;case 1:if(!(t<e.plugins.length))return[3,6];if(n=e.plugins[t],!yr(i=e.runOnRoot(n)))return[3,5];A.label=2;case 2:return A.trys.push([2,4,,5]),[4,i];case 3:return A.sent(),[3,5];case 4:throw r=A.sent(),e.handleError(r);case 5:return t++,[3,1];case 6:if(e.prepareVisitors(),!e.hasListener)return[3,18];o=e.result.root,A.label=7;case 7:if(o[sr])return[3,14];o[sr]=!0,s=[wr(o)],A.label=8;case 8:if(!(s.length>0))return[3,13];if(!yr(a=e.visitTick(s)))return[3,12];A.label=9;case 9:return A.trys.push([9,11,,12]),[4,a];case 10:return A.sent(),[3,12];case 11:throw c=A.sent(),l=s[s.length-1].node,e.handleError(c,l);case 12:return[3,8];case 13:return[3,7];case 14:if(!e.listeners.OnceExit)return[3,18];u=function(){var t,n,i,r,s;return Ue(this,function(a){switch(a.label){case 0:t=h.value,n=t[0],i=t[1],e.result.lastPlugin=n,a.label=1;case 1:return a.trys.push([1,6,,7]),"document"!==o.type?[3,3]:(r=o.nodes.map(function(t){return i(t,e.helpers)}),[4,Promise.all(r)]);case 2:return a.sent(),[3,5];case 3:return[4,i(o,e.helpers)];case 4:a.sent(),a.label=5;case 5:return[3,7];case 6:throw s=a.sent(),e.handleError(s);case 7:return[2]}})},d=Qe(e.listeners.OnceExit),A.label=15;case 15:return(h=d()).done?[3,18]:[5,Fe(u())];case 16:A.sent(),A.label=17;case 17:return[3,15];case 18:return e.processed=!0,[2,e.stringify()]}})})()},t.runOnRoot=function(e){var t=this;this.result.lastPlugin=e;try{if("object"===(void 0===e?"undefined":Ee(e))&&e.Once){if("document"===this.result.root.type){var n=this.result.root.nodes.map(function(n){return e.Once(n,t.helpers)});return yr(n[0])?Promise.all(n):n}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(gd){throw this.handleError(gd)}},t.stringify=function(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts,t=lr;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);var n=new cr(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result},t.sync=function(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e,t=Qe(this.plugins);!(e=t()).done;){var n=e.value;if(yr(this.runOnRoot(n)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var i=this.result.root;!i[sr];)i[sr]=!0,this.walkSync(i);if(this.listeners.OnceExit)if("document"===i.type)for(var r,o=Qe(i.nodes);!(r=o()).done;){var s=r.value;this.visitSync(this.listeners.OnceExit,s)}else this.visitSync(this.listeners.OnceExit,i)}return this.result},t.then=function(e,t){return this.async().then(e,t)},t.toString=function(){return this.css},t.visitSync=function(e,t){for(var n,i=Qe(e);!(n=i()).done;){var r=n.value,o=r[0],s=r[1];this.result.lastPlugin=o;var a=void 0;try{a=s(t,this.helpers)}catch(c){throw this.handleError(c,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(yr(a))throw this.getAsyncError()}},t.visitTick=function(e){var t=e[e.length-1],n=t.node,i=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(i.length>0&&t.visitorIndex<i.length){var r=i[t.visitorIndex],o=r[0],s=r[1];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return s(n.toProxy(),this.helpers)}catch(d){throw this.handleError(d,n)}}if(0!==t.iterator){for(var a,c=t.iterator;a=n.nodes[n.indexes[c]];)if(n.indexes[c]+=1,!a[sr])return a[sr]=!0,void e.push(wr(a));t.iterator=0,delete n.indexes[c]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[sr]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}e.pop()}else e.pop()},t.walkSync=function(e){var t=this;e[sr]=!0;for(var n,i=Qe(br(e));!(n=i()).done;){var r=n.value;if(0===r)e.nodes&&e.each(function(e){e[sr]||t.walkSync(e)});else{var o=this.listeners[r];if(o&&this.visitSync(o,e.toProxy()))return}}},t.warnings=function(){return this.sync().warnings()},ve(e,[{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}]),e}();xr.registerPostcss=function(e){kr=e};var Cr=xr;xr.default=xr,pr.registerLazyResult(xr),dr.registerLazyResult(xr);var Sr=zn,Br=Xt,Ir=or,Er=li,Mr=function(){function e(e,t,n){var i;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;var r=Br;this.result=new Er(this._processor,i,this._opts),this.result.css=t;var o=this;Object.defineProperty(this.result,"root",{get:function(){return o.root}});var s=new Sr(r,i,this._opts,t);if(s.isMap()){var a=s.generate(),c=a[0],l=a[1];c&&(this.result.css=c),l&&(this.result.map=l)}else s.clearAnnotation(),this.result.css=s.css}var t=e.prototype;return t.async=function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.sync=function(){if(this.error)throw this.error;return this.result},t.then=function(e,t){return this.async().then(e,t)},t.toString=function(){return this._css},t.warnings=function(){return[]},ve(e,[{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=Ir;try{e=t(this._css,this._opts)}catch(gd){this.error=gd}if(this.error)throw this.error;return this._root=e,e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),e}(),Dr=Mr;Mr.default=Mr;var Qr=Dr,Ur=Cr,Fr=ri,Nr=zi,Tr=function(){function e(e){void 0===e&&(e=[]),this.version="8.4.38",this.plugins=this.normalize(e)}var t=e.prototype;return t.normalize=function(e){for(var t,n=[],i=Qe(e);!(t=i()).done;){var r=t.value;if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"===(void 0===r?"undefined":Ee(r))&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if("object"===(void 0===r?"undefined":Ee(r))&&r.postcssPlugin)n.push(r);else if("function"==typeof r)n.push(r);else if("object"!==(void 0===r?"undefined":Ee(r))||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin")}return n},t.process=function(e,t){return void 0===t&&(t={}),this.plugins.length||t.parser||t.stringifier||t.syntax?new Ur(this,e,t):new Qr(this,e,t)},t.use=function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this},e}(),Lr=Tr;Tr.default=Tr,Nr.registerProcessor(Tr),Fr.registerProcessor(Tr);var Pr=on,Or=pn,Rr=Yn,zr=Ti,qr=Mn,Yr=zi,Kr=ji;function Hr(e,t){if(Array.isArray(e))return e.map(function(e){return Hr(e)});var n=e.inputs,i=Be(e,["inputs"]);if(n){t=[];for(var r,o=Qe(n);!(r=o()).done;){var s=ke({},r.value,{__proto__:qr.prototype});s.map&&(s.map=ke({},s.map,{__proto__:Or.prototype})),t.push(s)}}if(i.nodes&&(i.nodes=e.nodes.map(function(e){return Hr(e,t)})),i.source){var a=i.source,c=a.inputId,l=Be(a,["inputId"]);i.source=l,null!=c&&(i.source.input=t[c])}if("root"===i.type)return new Yr(i);if("decl"===i.type)return new Pr(i);if("rule"===i.type)return new Kr(i);if("comment"===i.type)return new Rr(i);if("atrule"===i.type)return new zr(i);throw new Error("Unknown node type: "+e.type)}var Vr=Hr;Hr.default=Hr;var jr=qt,Zr=on,Xr=Cr,Gr=ei,Wr=Lr,Jr=Xt,_r=Vr,$r=ri,eo=si,to=Yn,no=Ti,io=li,ro=Mn,oo=or,so=Yi,ao=ji,co=zi,lo=nn;function uo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new Wr(t)}uo.plugin=function(e,t){var n,i=!1;function r(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];console&&console.warn&&!i&&(i=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),pe.env.LANG&&pe.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));var s=t.apply(void 0,[].concat(r));return s.postcssPlugin=e,s.postcssVersion=(new Wr).version,s}return Object.defineProperty(r,"postcss",{get:function(){return n||(n=r()),n}}),r.process=function(e,t,n){return uo([r(n)]).process(e,t)},r},uo.stringify=Jr,uo.parse=oo,uo.fromJSON=_r,uo.list=so,uo.comment=function(e){return new to(e)},uo.atRule=function(e){return new no(e)},uo.decl=function(e){return new Zr(e)},uo.rule=function(e){return new ao(e)},uo.root=function(e){return new co(e)},uo.document=function(e){return new $r(e)},uo.CssSyntaxError=jr,uo.Declaration=Zr,uo.Container=Gr,uo.Processor=Wr,uo.Document=$r,uo.Comment=to,uo.Warning=eo,uo.AtRule=no,uo.Result=io,uo.Input=ro,uo.Rule=ao,uo.Root=co,uo.Node=lo,Xr.registerPostcss(uo);var ho=uo;uo.default=uo;var Ao=Qt(ho);Ao.stringify,Ao.fromJSON,Ao.plugin,Ao.parse,Ao.list,Ao.document,Ao.comment,Ao.atRule,Ao.rule,Ao.decl,Ao.root,Ao.CssSyntaxError,Ao.Declaration,Ao.Container,Ao.Processor,Ao.Document,Ao.Comment,Ao.Warning,Ao.AtRule,Ao.Result,Ao.Input,Ao.Rule,Ao.Root,Ao.Node;var po=Object.defineProperty,mo=function(e,t,n){return function(e,t,n){return t in e?po(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":Ee(t))?t+"":t,n)};function fo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function go(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return Se(this,e)?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})}),n}var yo={exports:{}},bo=String,wo=function(){return{isColorSupported:!1,reset:bo,bold:bo,dim:bo,italic:bo,underline:bo,inverse:bo,hidden:bo,strikethrough:bo,black:bo,red:bo,green:bo,yellow:bo,blue:bo,magenta:bo,cyan:bo,white:bo,gray:bo,bgBlack:bo,bgRed:bo,bgGreen:bo,bgYellow:bo,bgBlue:bo,bgMagenta:bo,bgCyan:bo,bgWhite:bo}};yo.exports=wo(),yo.exports.createColors=wo;var vo=yo.exports,ko=go(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),xo=vo,Co=ko,So=function(e){function t(n,i,r,o,s,a){var c;return(c=e.call(this,n)||this).name="CssSyntaxError",c.reason=n,s&&(c.file=s),o&&(c.source=o),a&&(c.plugin=a),void 0!==i&&void 0!==r&&("number"==typeof i?(c.line=i,c.column=r):(c.line=i.line,c.column=i.column,c.endLine=r.line,c.endColumn=r.column)),c.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(c,t),c}Ce(t,e);var n=t.prototype;return n.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},n.showSourceCode=function(e){var t=this;if(!this.source)return"";var n=this.source;null==e&&(e=xo.isColorSupported),Co&&e&&(n=Co(n));var i,r,o=n.split(/\r?\n/),s=Math.max(this.line-3,0),a=Math.min(this.line+2,o.length),c=String(a).length;if(e){var l=xo.createColors(!0),u=l.bold,d=l.gray,h=l.red;i=function(e){return u(h(e))},r=function(e){return d(e)}}else i=r=function(e){return e};return o.slice(s,a).map(function(e,n){var o=s+1+n,a=" "+(" "+o).slice(-c)+" | ";if(o===t.line){var l=r(a.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return i(">")+r(a)+e+"\n "+l+i("^")}return" "+r(a)+e}).join("\n")},n.toString=function(){var e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e},t}(Me(Error)),Bo=So;So.default=So;var Io={};Io.isClean=Symbol("isClean"),Io.my=Symbol("my");var Eo={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};var Mo=function(){function e(e){this.builder=e}var t=e.prototype;return t.atrule=function(e,t){var n="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:i&&(n+=" "),e.nodes)this.block(e,n+i);else{var r=(e.raws.between||"")+(t?";":"");this.builder(n+i+r,e)}},t.beforeAfter=function(e,t){var n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");for(var i=e.parent,r=0;i&&"root"!==i.type;)r+=1,i=i.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var s=0;s<r;s++)n+=o}return n},t.block=function(e,t){var n,i=this.raw(e,"between","beforeOpen");this.builder(t+i+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")},t.body=function(e){for(var t=e.nodes.length-1;t>0&&"comment"===e.nodes[t].type;)t-=1;for(var n=this.raw(e,"semicolon"),i=0;i<e.nodes.length;i++){var r=e.nodes[i],o=this.raw(r,"before");o&&this.builder(o),this.stringify(r,t!==i||n)}},t.comment=function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)},t.decl=function(e,t){var n=this.raw(e,"between","colon"),i=e.prop+n+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)},t.document=function(e){this.body(e)},t.raw=function(e,t,n){var i;if(n||(n=t),t&&void 0!==(i=e.raws[t]))return i;var r=e.parent;if("before"===n){if(!r||"root"===r.type&&r.first===e)return"";if(r&&"document"===r.type)return""}if(!r)return Eo[n];var o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);var s,a="raw"+((s=n)[0].toUpperCase()+s.slice(1));return this[a]?i=this[a](o,e):o.walk(function(e){if(void 0!==(i=e.raws[t]))return!1}),void 0===i&&(i=Eo[n]),o.rawCache[n]=i,i},t.rawBeforeClose=function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t},t.rawBeforeComment=function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n},t.rawBeforeDecl=function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n},t.rawBeforeOpen=function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t},t.rawBeforeRule=function(e){var t;return e.walk(function(n){if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return(t=n.raws.before).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t},t.rawColon=function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t},t.rawEmptyBody=function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t},t.rawIndent=function(e){return e.raws.indent?e.raws.indent:(e.walk(function(n){var i=n.parent;if(i&&i!==e&&i.parent&&i.parent===e&&void 0!==n.raws.before){var r=n.raws.before.split("\n");return t=(t=r[r.length-1]).replace(/\S/g,""),!1}}),t);var t},t.rawSemicolon=function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t},t.rawValue=function(e,t){var n=e[t],i=e.raws[t];return i&&i.value===n?i.raw:n},t.root=function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)},t.rule=function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")},t.stringify=function(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)},e}(),Do=Mo;Mo.default=Mo;var Qo=Do;function Uo(e,t){new Qo(t).stringify(e)}var Fo=Uo;Uo.default=Uo;var No=Io.isClean,To=Io.my,Lo=Bo,Po=Do,Oo=Fo;function Ro(e,t){var n=new e.constructor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&"proxyCache"!==i){var r=e[i],o=void 0===r?"undefined":Ee(r);"parent"===i&&"object"===o?t&&(n[i]=t):"source"===i?n[i]=r:Array.isArray(r)?n[i]=r.map(function(e){return Ro(e,n)}):("object"===o&&null!==r&&(r=Ro(r)),n[i]=r)}return n}var zo=function(){function e(e){for(var t in void 0===e&&(e={}),this.raws={},this[No]=!1,this[To]=!0,e)if("nodes"===t){this.nodes=[];for(var n,i=Qe(e[t]);!(n=i()).done;){var r=n.value;"function"==typeof r.clone?this.append(r.clone()):this.append(r)}}else this[t]=e[t]}var t=e.prototype;return t.addToError=function(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){var t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,"$&"+t.input.from+":"+t.start.line+":"+t.start.column+"$&")}return e},t.after=function(e){return this.parent.insertAfter(this,e),this},t.assign=function(e){for(var t in void 0===e&&(e={}),e)this[t]=e[t];return this},t.before=function(e){return this.parent.insertBefore(this,e),this},t.cleanRaws=function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between},t.clone=function(e){void 0===e&&(e={});var t=Ro(this);for(var n in e)t[n]=e[n];return t},t.cloneAfter=function(e){void 0===e&&(e={});var t=this.clone(e);return this.parent.insertAfter(this,t),t},t.cloneBefore=function(e){void 0===e&&(e={});var t=this.clone(e);return this.parent.insertBefore(this,t),t},t.error=function(e,t){if(void 0===t&&(t={}),this.source){var n=this.rangeBy(t),i=n.end,r=n.start;return this.source.input.error(e,{column:r.column,line:r.line},{column:i.column,line:i.line},t)}return new Lo(e)},t.getProxyProcessor=function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}},t.markDirty=function(){if(this[No]){this[No]=!1;for(var e=this;e=e.parent;)e[No]=!1}},t.next=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e+1]}},t.positionBy=function(e,t){var n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){var i=(t=this.toString()).indexOf(e.word);-1!==i&&(n=this.positionInside(i,t))}return n},t.positionInside=function(e,t){for(var n=t||this.toString(),i=this.source.start.column,r=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?(i=1,r+=1):i+=1;return{column:i,line:r}},t.prev=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e-1]}},t.rangeBy=function(e){var t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){var i=this.toString(),r=i.indexOf(e.word);-1!==r&&(t=this.positionInside(r,i),n=this.positionInside(r+e.word.length,i))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}},t.raw=function(e,t){return(new Po).raw(this,e,t)},t.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},t.replaceWith=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(this.parent){for(var i,r=this,o=!1,s=Qe(t);!(i=s()).done;){var a=i.value;a===this?o=!0:o?(this.parent.insertAfter(r,a),r=a):this.parent.insertBefore(r,a)}o||this.remove()}return this},t.root=function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e},t.toJSON=function(e,t){var n={},i=null==t;t=t||new Map;var r=0;for(var o in this)if(Object.prototype.hasOwnProperty.call(this,o)&&"parent"!==o&&"proxyCache"!==o){var s=this[o];if(Array.isArray(s))n[o]=s.map(function(e){return"object"===(void 0===e?"undefined":Ee(e))&&e.toJSON?e.toJSON(null,t):e});else if("object"===(void 0===s?"undefined":Ee(s))&&s.toJSON)n[o]=s.toJSON(null,t);else if("source"===o){var a=t.get(s.input);null==a&&(a=r,t.set(s.input,r),r++),n[o]={end:s.end,inputId:a,start:s.start}}else n[o]=s}return i&&(n.inputs=[].concat(t.keys()).map(function(e){return e.toJSON()})),n},t.toProxy=function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache},t.toString=function(e){void 0===e&&(e=Oo),e.stringify&&(e=e.stringify);var t="";return e(this,function(e){t+=e}),t},t.warn=function(e,t,n){var i={node:this};for(var r in n)i[r]=n[r];return e.warn(t,i)},ve(e,[{key:"proxyOf",get:function(){return this}}]),e}(),qo=zo;zo.default=zo;var Yo=function(e){function t(t){var n;return t&&void 0!==t.value&&"string"!=typeof t.value&&(t=ke({},t,{value:String(t.value)})),(n=e.call(this,t)||this).type="decl",n}return Ce(t,e),ve(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),t}(qo),Ko=Yo;Yo.default=Yo;var Ho=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},Vo=ko.SourceMapConsumer,jo=ko.SourceMapGenerator,Zo=ko.existsSync,Xo=ko.readFileSync,Go=ko.dirname,Wo=ko.join;var Jo=function(){function e(e,t){if(!1!==t.map){this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");var n=t.map?t.map.prev:void 0,i=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Go(this.mapFile)),i&&(this.text=i)}}var t=e.prototype;return t.consumer=function(){return this.consumerCache||(this.consumerCache=new Vo(this.text)),this.consumerCache},t.decodeInline=function(e){var t;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),B?B.from(t,"base64").toString():window.atob(t);var n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)},t.getAnnotationURL=function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()},t.isMap=function(e){return"object"===(void 0===e?"undefined":Ee(e))&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))},t.loadAnnotation=function(e){var t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(t){var n=e.lastIndexOf(t.pop()),i=e.indexOf("*/",n);n>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,i)))}},t.loadFile=function(e){if(this.root=Go(e),Zo(e))return this.mapFile=e,Xo(e,"utf-8").toString().trim()},t.loadMap=function(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(Se(t,Vo))return jo.fromSourceMap(t).toString();if(Se(t,jo))return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){var i=this.loadFile(n);if(!i)throw new Error("Unable to load previous source map: "+n.toString());return i}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){var r=this.annotation;return e&&(r=Wo(Go(e),r)),this.loadFile(r)}}},t.startWith=function(e,t){return!!e&&e.substr(0,t.length)===t},t.withContent=function(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},e}(),_o=Jo;Jo.default=Jo;var $o=ko.SourceMapConsumer,es=ko.SourceMapGenerator,ts=ko.fileURLToPath,ns=ko.pathToFileURL,is=ko.isAbsolute,rs=ko.resolve,os=Ho,ss=ko,as=Bo,cs=_o,ls=Symbol("fromOffsetCache"),us=Boolean($o&&es),ds=Boolean(rs&&is),hs=function(){function e(e,t){if(void 0===t&&(t={}),null==e||"object"===(void 0===e?"undefined":Ee(e))&&!e.toString)throw new Error("PostCSS received "+e+" instead of CSS string");if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!ds||/^\w+:\/\//.test(t.from)||is(t.from)?this.file=t.from:this.file=rs(t.from)),ds&&us){var n=new cs(this.css,t);if(n.text){this.map=n;var i=n.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+os(6)+">"),this.map&&(this.map.file=this.from)}var t=e.prototype;return t.error=function(e,t,n,i){var r,o,s;if(void 0===i&&(i={}),t&&"object"===(void 0===t?"undefined":Ee(t))){var a=t,c=n;if("number"==typeof a.offset){var l=this.fromOffset(a.offset);t=l.line,n=l.col}else t=a.line,n=a.column;if("number"==typeof c.offset){var u=this.fromOffset(c.offset);o=u.line,s=u.col}else o=c.line,s=c.column}else if(!n){var d=this.fromOffset(t);t=d.line,n=d.col}var h=this.origin(t,n,o,s);return(r=h?new as(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,i.plugin):new as(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:s,line:o},this.css,this.file,i.plugin)).input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(ns&&(r.input.url=ns(this.file).toString()),r.input.file=this.file),r},t.fromOffset=function(e){var t;if(this[ls])t=this[ls];else{var n=this.css.split("\n");t=new Array(n.length);for(var i=0,r=0,o=n.length;r<o;r++)t[r]=i,i+=n[r].length+1;this[ls]=t}var s=0;if(e>=t[t.length-1])s=t.length-1;else for(var a,c=t.length-2;s<c;)if(e<t[a=s+(c-s>>1)])c=a-1;else{if(!(e>=t[a+1])){s=a;break}s=a+1}return{col:e-t[s]+1,line:s+1}},t.mapResolve=function(e){return/^\w+:\/\//.test(e)?e:rs(this.map.consumer().sourceRoot||this.map.root||".",e)},t.origin=function(e,t,n,i){if(!this.map)return!1;var r,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(r=s.originalPositionFor({column:i,line:n})),o=is(a.source)?ns(a.source):new URL(a.source,this.map.consumer().sourceRoot||ns(this.map.mapFile));var c={column:a.column,endColumn:r&&r.column,endLine:r&&r.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!ts)throw new Error("file: protocol is not available in this PostCSS build");c.file=ts(o)}var l=s.sourceContentFor(a.source);return l&&(c.source=l),c},t.toJSON=function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var i=n[t];null!=this[i]&&(e[i]=this[i])}return this.map&&(e.map=ke({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e},ve(e,[{key:"from",get:function(){return this.file||this.id}}]),e}(),As=hs;hs.default=hs,ss&&ss.registerInput&&ss.registerInput(hs);var ps=ko.SourceMapConsumer,ms=ko.SourceMapGenerator,fs=ko.dirname,gs=ko.relative,ys=ko.resolve,bs=ko.sep,ws=ko.pathToFileURL,vs=As,ks=Boolean(ps&&ms),xs=Boolean(fs&&ys&&gs&&bs),Cs=function(){function e(e,t,n,i){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}var t=e.prototype;return t.addAnnotation=function(){var e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";var t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"},t.applyPrevMaps=function(){for(var e,t=Qe(this.previous());!(e=t()).done;){var n=e.value,i=this.toUrl(this.path(n.file)),r=n.root||fs(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new ps(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,i,this.toUrl(this.path(r)))}},t.clearAnnotation=function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;t>=0;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))},t.generate=function(){if(this.clearAnnotation(),xs&&ks&&this.isMap())return this.generateMap();var e="";return this.stringify(this.root,function(t){e+=t}),[e]},t.generateMap=function(){if(this.root)this.generateString();else if(1===this.previous().length){var e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ms.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new ms({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},t.generateString=function(){var e=this;this.css="",this.map=new ms({file:this.outputFile(),ignoreInvalidMapping:!0});var t,n,i=1,r=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(a,c,l){if(e.css+=a,c&&"end"!==l&&(s.generated.line=i,s.generated.column=r-1,c.source&&c.source.start?(s.source=e.sourcePath(c),s.original.line=c.source.start.line,s.original.column=c.source.start.column-1,e.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,e.map.addMapping(s))),(t=a.match(/\n/g))?(i+=t.length,n=a.lastIndexOf("\n"),r=a.length-n):r+=a.length,c&&"start"!==l){var u=c.parent||{raws:{}};("decl"===c.type||"atrule"===c.type&&!c.nodes)&&c===u.last&&!u.raws.semicolon||(c.source&&c.source.end?(s.source=e.sourcePath(c),s.original.line=c.source.end.line,s.original.column=c.source.end.column-1,s.generated.line=i,s.generated.column=r-2,e.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=i,s.generated.column=r-1,e.map.addMapping(s)))}})},t.isAnnotation=function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))},t.isInline=function(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))},t.isMap=function(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0},t.isSourcesContent=function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})},t.outputFile=function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"},t.path=function(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;var n=this.opts.to?fs(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=fs(ys(n,this.mapOpts.annotation)));var i=gs(n,e);return this.memoizedPaths.set(e,i),i},t.previous=function(){var e=this;if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(function(t){if(t.source&&t.source.input.map){var n=t.source.input.map;e.previousMaps.includes(n)||e.previousMaps.push(n)}});else{var t=new vs(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps},t.setSourcesContent=function(){var e=this,t={};if(this.root)this.root.walk(function(n){if(n.source){var i=n.source.input.from;if(i&&!t[i]){t[i]=!0;var r=e.usesFileUrls?e.toFileUrl(i):e.toUrl(e.path(i));e.map.setSourceContent(r,n.source.input.css)}}});else if(this.css){var n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}},t.sourcePath=function(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))},t.toBase64=function(e){return B?B.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))},t.toFileUrl=function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ws){var n=ws(e).toString();return this.memoizedFileURLs.set(e,n),n}throw new Error("`map.absolute` option is not available in this PostCSS build")},t.toUrl=function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===bs&&(e=e.replace(/\\/g,"/"));var n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n},e}(),Ss=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="comment",n}return Ce(t,e),t}(qo),Bs=Ss;Ss.default=Ss;var Is,Es,Ms,Ds,Qs=Io.isClean,Us=Io.my,Fs=Ko,Ns=Bs;function Ts(e){return e.map(function(e){return e.nodes&&(e.nodes=Ts(e.nodes)),delete e.source,e})}function Ls(e){if(e[Qs]=!1,e.proxyOf.nodes)for(var t,n=Qe(e.proxyOf.nodes);!(t=n()).done;){Ls(t.value)}}var Ps=function(e){function t(){return e.apply(this,arguments)||this}Ce(t,e);var n=t.prototype;return n.append=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var i,r=Qe(t);!(i=r()).done;)for(var o,s=i.value,a=Qe(this.normalize(s,this.last));!(o=a()).done;){var c=o.value;this.proxyOf.nodes.push(c)}return this.markDirty(),this},n.cleanRaws=function(t){if(e.prototype.cleanRaws.call(this,t),this.nodes)for(var n,i=Qe(this.nodes);!(n=i()).done;){n.value.cleanRaws(t)}},n.each=function(e){if(this.proxyOf.nodes){for(var t,n,i=this.getIterator();this.indexes[i]<this.proxyOf.nodes.length&&(t=this.indexes[i],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[i]+=1;return delete this.indexes[i],n}},n.every=function(e){return this.nodes.every(e)},n.getIterator=function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e},n.getProxyProcessor=function(){return{get:function(e,t){return"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];var o;return(o=e)[t].apply(o,[].concat(i.map(function(e){return"function"==typeof e?function(t,n){return e(t.toProxy(),n)}:e})))}:"every"===t||"some"===t?function(n){return e[t](function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return n.apply(void 0,[].concat([e.toProxy()],i))})}:"root"===t?function(){return e.root().toProxy()}:"nodes"===t?e.nodes.map(function(e){return e.toProxy()}):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]},set:function(e,t,n){return e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}},n.index=function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))},n.insertAfter=function(e,t){var n,i=this.index(e),r=this.normalize(t,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(var o,s=Qe(r);!(o=s()).done;){var a=o.value;this.proxyOf.nodes.splice(i+1,0,a)}for(var c in this.indexes)i<(n=this.indexes[c])&&(this.indexes[c]=n+r.length);return this.markDirty(),this},n.insertBefore=function(e,t){var n,i=this.index(e),r=0===i&&"prepend",o=this.normalize(t,this.proxyOf.nodes[i],r).reverse();i=this.index(e);for(var s,a=Qe(o);!(s=a()).done;){var c=s.value;this.proxyOf.nodes.splice(i,0,c)}for(var l in this.indexes)i<=(n=this.indexes[l])&&(this.indexes[l]=n+o.length);return this.markDirty(),this},n.normalize=function(e,n){var i=this;if("string"==typeof e)e=Ts(Is(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r,o=Qe(e=e.slice(0));!(r=o()).done;){var s=r.value;s.parent&&s.parent.removeChild(s,"ignore")}else if("root"===e.type&&"document"!==this.type)for(var a,c=Qe(e=e.nodes.slice(0));!(a=c()).done;){var l=a.value;l.parent&&l.parent.removeChild(l,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new Fs(e)]}else if(e.selector)e=[new Es(e)];else if(e.name)e=[new Ms(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new Ns(e)]}return e.map(function(e){return e[Us]||t.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[Qs]&&Ls(e),void 0===e.raws.before&&n&&void 0!==n.raws.before&&(e.raws.before=n.raws.before.replace(/\S/g,"")),e.parent=i.proxyOf,e})},n.prepend=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var i,r=Qe(t=t.reverse());!(i=r()).done;){for(var o,s=i.value,a=this.normalize(s,this.first,"prepend").reverse(),c=Qe(a);!(o=c()).done;){var l=o.value;this.proxyOf.nodes.unshift(l)}for(var u in this.indexes)this.indexes[u]=this.indexes[u]+a.length}return this.markDirty(),this},n.push=function(e){return e.parent=this,this.proxyOf.nodes.push(e),this},n.removeAll=function(){for(var e,t=Qe(this.proxyOf.nodes);!(e=t()).done;){e.value.parent=void 0}return this.proxyOf.nodes=[],this.markDirty(),this},n.removeChild=function(e){var t;for(var n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this},n.replaceValues=function(e,t,n){return n||(n=t,t={}),this.walkDecls(function(i){t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,n))}),this.markDirty(),this},n.some=function(e){return this.nodes.some(e)},n.walk=function(e){return this.each(function(t,n){var i;try{i=e(t,n)}catch(r){throw t.addToError(r)}return!1!==i&&t.walk&&(i=t.walk(e)),i})},n.walkAtRules=function(e,t){return t?Se(e,RegExp)?this.walk(function(n,i){if("atrule"===n.type&&e.test(n.name))return t(n,i)}):this.walk(function(n,i){if("atrule"===n.type&&n.name===e)return t(n,i)}):(t=e,this.walk(function(e,n){if("atrule"===e.type)return t(e,n)}))},n.walkComments=function(e){return this.walk(function(t,n){if("comment"===t.type)return e(t,n)})},n.walkDecls=function(e,t){return t?Se(e,RegExp)?this.walk(function(n,i){if("decl"===n.type&&e.test(n.prop))return t(n,i)}):this.walk(function(n,i){if("decl"===n.type&&n.prop===e)return t(n,i)}):(t=e,this.walk(function(e,n){if("decl"===e.type)return t(e,n)}))},n.walkRules=function(e,t){return t?Se(e,RegExp)?this.walk(function(n,i){if("rule"===n.type&&e.test(n.selector))return t(n,i)}):this.walk(function(n,i){if("rule"===n.type&&n.selector===e)return t(n,i)}):(t=e,this.walk(function(e,n){if("rule"===e.type)return t(e,n)}))},ve(t,[{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}]),t}(qo);Ps.registerParse=function(e){Is=e},Ps.registerRule=function(e){Es=e},Ps.registerAtRule=function(e){Ms=e},Ps.registerRoot=function(e){Ds=e};var Os=Ps;Ps.default=Ps,Ps.rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,Ms.prototype):"rule"===e.type?Object.setPrototypeOf(e,Es.prototype):"decl"===e.type?Object.setPrototypeOf(e,Fs.prototype):"comment"===e.type?Object.setPrototypeOf(e,Ns.prototype):"root"===e.type&&Object.setPrototypeOf(e,Ds.prototype),e[Us]=!0,e.nodes&&e.nodes.forEach(function(e){Ps.rebuild(e)})};var Rs,zs,qs=function(e){function t(t){var n;return(n=e.call(this,ke({type:"document"},t))||this).nodes||(n.nodes=[]),n}return Ce(t,e),t.prototype.toResult=function(e){return void 0===e&&(e={}),new Rs(new zs,this,e).stringify()},t}(Os);qs.registerLazyResult=function(e){Rs=e},qs.registerProcessor=function(e){zs=e};var Ys=qs;qs.default=qs;var Ks=function(){function e(e,t){if(void 0===t&&(t={}),this.type="warning",this.text=e,t.node&&t.node.source){var n=t.node.rangeBy(t);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(var i in t)this[i]=t[i]}return e.prototype.toString=function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text},e}(),Hs=Ks;Ks.default=Ks;var Vs=Hs,js=function(){function e(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}var t=e.prototype;return t.toString=function(){return this.css},t.warn=function(e,t){void 0===t&&(t={}),t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);var n=new Vs(e,t);return this.messages.push(n),n},t.warnings=function(){return this.messages.filter(function(e){return"warning"===e.type})},ve(e,[{key:"content",get:function(){return this.css}}]),e}(),Zs=js;js.default=js;var Xs="'".charCodeAt(0),Gs='"'.charCodeAt(0),Ws="\\".charCodeAt(0),Js="/".charCodeAt(0),_s="\n".charCodeAt(0),$s=" ".charCodeAt(0),ea="\f".charCodeAt(0),ta="\t".charCodeAt(0),na="\r".charCodeAt(0),ia="[".charCodeAt(0),ra="]".charCodeAt(0),oa="(".charCodeAt(0),sa=")".charCodeAt(0),aa="{".charCodeAt(0),ca="}".charCodeAt(0),la=";".charCodeAt(0),ua="*".charCodeAt(0),da=":".charCodeAt(0),ha="@".charCodeAt(0),Aa=/[\t\n\f\r "#'()/;[\\\]{}]/g,pa=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,ma=/.[\r\n"'(/\\]/,fa=/[\da-f]/i,ga=Os,ya=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="atrule",n}Ce(t,e);var n=t.prototype;return n.append=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r;return this.proxyOf.nodes||(this.nodes=[]),(r=e.prototype.append).call.apply(r,[].concat([this],n))},n.prepend=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r;return this.proxyOf.nodes||(this.nodes=[]),(r=e.prototype.prepend).call.apply(r,[].concat([this],n))},t}(ga),ba=ya;ya.default=ya,ga.registerAtRule(ya);var wa,va,ka=Os,xa=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="root",n.nodes||(n.nodes=[]),n}Ce(t,e);var n=t.prototype;return n.normalize=function(t,n,i){var r=e.prototype.normalize.call(this,t);if(n)if("prepend"===i)this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(var o,s=Qe(r);!(o=s()).done;){o.value.raws.before=n.raws.before}return r},n.removeChild=function(t,n){var i=this.index(t);return!n&&0===i&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),e.prototype.removeChild.call(this,t)},n.toResult=function(e){return void 0===e&&(e={}),new wa(new va,this,e).stringify()},t}(ka);xa.registerLazyResult=function(e){wa=e},xa.registerProcessor=function(e){va=e};var Ca=xa;xa.default=xa,ka.registerRoot(xa);var Sa={comma:function(e){return Sa.split(e,[","],!0)},space:function(e){return Sa.split(e,[" ","\n","\t"])},split:function(e,t,n){for(var i,r=[],o="",s=!1,a=0,c=!1,l="",u=!1,d=Qe(e);!(i=d()).done;){var h=i.value;u?u=!1:"\\"===h?u=!0:c?h===l&&(c=!1):'"'===h||"'"===h?(c=!0,l=h):"("===h?a+=1:")"===h?a>0&&(a-=1):0===a&&t.includes(h)&&(s=!0),s?(""!==o&&r.push(o.trim()),o="",s=!1):o+=h}return(n||""!==o)&&r.push(o.trim()),r}},Ba=Sa;Sa.default=Sa;var Ia=Os,Ea=Ba,Ma=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="rule",n.nodes||(n.nodes=[]),n}return Ce(t,e),ve(t,[{key:"selectors",get:function(){return Ea.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}}]),t}(Ia),Da=Ma;Ma.default=Ma,Ia.registerRule(Ma);var Qa=Ko,Ua=function(e,t){void 0===t&&(t={});var n,i,r,o,s,a,c,l,u,d,h=e.css.valueOf(),A=t.ignoreErrors,p=h.length,m=0,f=[],g=[];function y(t){throw e.error("Unclosed "+t,m)}return{back:function(e){g.push(e)},endOfFile:function(){return 0===g.length&&m>=p},nextToken:function(e){if(g.length)return g.pop();if(!(m>=p)){var t=!!e&&e.ignoreUnclosed;switch(n=h.charCodeAt(m)){case _s:case $s:case ta:case na:case ea:i=m;do{i+=1,n=h.charCodeAt(i)}while(n===$s||n===_s||n===ta||n===na||n===ea);d=["space",h.slice(m,i)],m=i-1;break;case ia:case ra:case aa:case ca:case da:case la:case sa:var b=String.fromCharCode(n);d=[b,b,m];break;case oa:if(l=f.length?f.pop()[1]:"",u=h.charCodeAt(m+1),"url"===l&&u!==Xs&&u!==Gs&&u!==$s&&u!==_s&&u!==ta&&u!==ea&&u!==na){i=m;do{if(a=!1,-1===(i=h.indexOf(")",i+1))){if(A||t){i=m;break}y("bracket")}for(c=i;h.charCodeAt(c-1)===Ws;)c-=1,a=!a}while(a);d=["brackets",h.slice(m,i+1),m,i],m=i}else i=h.indexOf(")",m+1),o=h.slice(m,i+1),-1===i||ma.test(o)?d=["(","(",m]:(d=["brackets",o,m,i],m=i);break;case Xs:case Gs:r=n===Xs?"'":'"',i=m;do{if(a=!1,-1===(i=h.indexOf(r,i+1))){if(A||t){i=m+1;break}y("string")}for(c=i;h.charCodeAt(c-1)===Ws;)c-=1,a=!a}while(a);d=["string",h.slice(m,i+1),m,i],m=i;break;case ha:Aa.lastIndex=m+1,Aa.test(h),i=0===Aa.lastIndex?h.length-1:Aa.lastIndex-2,d=["at-word",h.slice(m,i+1),m,i],m=i;break;case Ws:for(i=m,s=!0;h.charCodeAt(i+1)===Ws;)i+=1,s=!s;if(n=h.charCodeAt(i+1),s&&n!==Js&&n!==$s&&n!==_s&&n!==ta&&n!==na&&n!==ea&&(i+=1,fa.test(h.charAt(i)))){for(;fa.test(h.charAt(i+1));)i+=1;h.charCodeAt(i+1)===$s&&(i+=1)}d=["word",h.slice(m,i+1),m,i],m=i;break;default:n===Js&&h.charCodeAt(m+1)===ua?(0===(i=h.indexOf("*/",m+2)+1)&&(A||t?i=h.length:y("comment")),d=["comment",h.slice(m,i+1),m,i],m=i):(pa.lastIndex=m+1,pa.test(h),i=0===pa.lastIndex?h.length-1:pa.lastIndex-2,d=["word",h.slice(m,i+1),m,i],f.push(d),m=i)}return m++,d}},position:function(){return m}}},Fa=Bs,Na=ba,Ta=Ca,La=Da,Pa={empty:!0,space:!0};var Oa=function(){function e(e){this.input=e,this.root=new Ta,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}var t=e.prototype;return t.atrule=function(e){var t,n,i,r=new Na;r.name=e[1].slice(1),""===r.name&&this.unnamedAtrule(r,e),this.init(r,e[2]);for(var o=!1,s=!1,a=[],c=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){r.source.end=this.getPosition(e[2]),r.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(n=a[i=a.length-1];n&&"space"===n[0];)n=a[--i];n&&(r.source.end=this.getPosition(n[3]||n[2]),r.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(r.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(r,"params",a),o&&(e=a[a.length-1],r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),s&&(r.nodes=[],this.current=r)},t.checkMissedSemicolon=function(e){var t=this.colon(e);if(!1!==t){for(var n,i=0,r=t-1;r>=0&&("space"===(n=e[r])[0]||2!==(i+=1));r--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}},t.colon=function(e){for(var t,n,i,r,o=0,s=Qe(e.entries());!(r=s()).done;){var a=r.value,c=a[0];if("("===(n=(t=a[1])[0])&&(o+=1),")"===n&&(o-=1),0===o&&":"===n){if(i){if("word"===i[0]&&"progid"===i[1])continue;return c}this.doubleColon(t)}i=t}return!1},t.comment=function(e){var t=new Fa;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;var n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{var i=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}},t.createTokenizer=function(){this.tokenizer=Ua(this.input)},t.decl=function(e,t){var n=new Qa;this.init(n,e[0][2]);var i,r=e[e.length-1];for(";"===r[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(r[3]||r[2]||function(e){for(var t=e.length-1;t>=0;t--){var n=e[t],i=n[3]||n[2];if(i)return i}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(i=e.shift())[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var s,a=[];e.length&&("space"===(s=e[0][0])||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(var c=e.length-1;c>=0;c--){if("!important"===(i=e[c])[1].toLowerCase()){n.important=!0;var l=this.stringFrom(e,c);" !important"!==(l=this.spacesFromEnd(e)+l)&&(n.raws.important=l);break}if("important"===i[1].toLowerCase()){for(var u=e.slice(0),d="",h=c;h>0;h--){var A=u[h][0];if(0===d.trim().indexOf("!")&&"space"!==A)break;d=u.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=u)}if("space"!==i[0]&&"comment"!==i[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=a.map(function(e){return e[1]}).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)},t.doubleColon=function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})},t.emptyRule=function(e){var t=new La;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t},t.end=function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)},t.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())},t.freeSemicolon=function(e){if(this.spaces+=e[1],this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}},t.getPosition=function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}},t.init=function(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)},t.other=function(e){for(var t=!1,n=null,i=!1,r=null,o=[],s=e[1].startsWith("--"),a=[],c=e;c;){if(n=c[0],a.push(c),"("===n||"["===n)r||(r=c),o.push("("===n?")":"]");else if(s&&i&&"{"===n)r||(r=c),o.push("}");else if(0===o.length){if(";"===n){if(i)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(i=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(r=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(r),t&&i){if(!s)for(;a.length&&("space"===(c=a[a.length-1][0])||"comment"===c);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)},t.parse=function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()},t.precheckMissedSemicolon=function(){},t.raw=function(e,t,n,i){for(var r,o,s,a,c=n.length,l="",u=!0,d=0;d<c;d+=1)"space"!==(o=(r=n[d])[0])||d!==c-1||i?"comment"===o?(a=n[d-1]?n[d-1][0]:"empty",s=n[d+1]?n[d+1][0]:"empty",Pa[a]||Pa[s]||","===l.slice(-1)?u=!1:l+=r[1]):l+=r[1]:u=!1;if(!u){var h=n.reduce(function(e,t){return e+t[1]},"");e.raws[t]={raw:h,value:l}}e[t]=l},t.rule=function(e){e.pop();var t=new La;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t},t.spacesAndCommentsFromEnd=function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n},t.spacesAndCommentsFromStart=function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n},t.spacesFromEnd=function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t},t.stringFrom=function(e,t){for(var n="",i=t;i<e.length;i++)n+=e[i][1];return e.splice(t,e.length-t),n},t.unclosedBlock=function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)},t.unclosedBracket=function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})},t.unexpectedClose=function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})},t.unknownWord=function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})},t.unnamedAtrule=function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})},e}(),Ra=Os,za=Oa,qa=As;function Ya(e,t){var n=new qa(e,t),i=new za(n);try{i.parse()}catch(r){throw r}return i.root}var Ka=Ya;Ya.default=Ya,Ra.registerParse(Ya);var Ha=Io.isClean,Va=Io.my,ja=Cs,Za=Fo,Xa=Os,Ga=Ys,Wa=Zs,Ja=Ka,_a=Ca,$a={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ec={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},tc={Once:!0,postcssPlugin:!0,prepare:!0};function nc(e){return"object"===(void 0===e?"undefined":Ee(e))&&"function"==typeof e.then}function ic(e){var t=!1,n=$a[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function rc(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:ic(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function oc(e){return e[Ha]=!1,e.nodes&&e.nodes.forEach(function(e){return oc(e)}),e}var sc={},ac=function(){function e(t,n,i){var r,o=this;if(this.stringified=!1,this.processed=!1,"object"!==(void 0===n?"undefined":Ee(n))||null===n||"root"!==n.type&&"document"!==n.type)if(Se(n,e)||Se(n,Wa))r=oc(n.root),n.map&&(void 0===i.map&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=n.map);else{var s=Ja;i.syntax&&(s=i.syntax.parse),i.parser&&(s=i.parser),s.parse&&(s=s.parse);try{r=s(n,i)}catch(gd){this.processed=!0,this.error=gd}r&&!r[Va]&&Xa.rebuild(r)}else r=oc(n);this.result=new Wa(t,r,i),this.helpers=ke({},sc,{postcss:sc,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===(void 0===e?"undefined":Ee(e))&&e.prepare?ke({},e,e.prepare(o.result)):e})}var t=e.prototype;return t.async=function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.getAsyncError=function(){throw new Error("Use process(css).then(cb) to work with async plugins")},t.handleError=function(e,t){var n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(n.postcssVersion){0}}else e.plugin=n.postcssPlugin,e.setMessage()}catch(i){console&&console.error&&console.error(i)}return e},t.prepareVisitors=function(){var e=this;this.listeners={};for(var t,n=function(t,n,i){e.listeners[n]||(e.listeners[n]=[]),e.listeners[n].push([t,i])},i=Qe(this.plugins);!(t=i()).done;){var r=t.value;if("object"===(void 0===r?"undefined":Ee(r)))for(var o in r){if(!ec[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event "+o+" in "+r.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!tc[o])if("object"===Ee(r[o]))for(var s in r[o])n(r,"*"===s?o:o+"-"+s.toLowerCase(),r[o][s]);else"function"==typeof r[o]&&n(r,o,r[o])}}this.hasListener=Object.keys(this.listeners).length>0},t.runAsync=function(){var e=this;return be(function(){var t,n,i,r,o,s,a,c,l,u,d,h;return Ue(this,function(A){switch(A.label){case 0:e.plugin=0,t=0,A.label=1;case 1:if(!(t<e.plugins.length))return[3,6];if(n=e.plugins[t],!nc(i=e.runOnRoot(n)))return[3,5];A.label=2;case 2:return A.trys.push([2,4,,5]),[4,i];case 3:return A.sent(),[3,5];case 4:throw r=A.sent(),e.handleError(r);case 5:return t++,[3,1];case 6:if(e.prepareVisitors(),!e.hasListener)return[3,18];o=e.result.root,A.label=7;case 7:if(o[Ha])return[3,14];o[Ha]=!0,s=[rc(o)],A.label=8;case 8:if(!(s.length>0))return[3,13];if(!nc(a=e.visitTick(s)))return[3,12];A.label=9;case 9:return A.trys.push([9,11,,12]),[4,a];case 10:return A.sent(),[3,12];case 11:throw c=A.sent(),l=s[s.length-1].node,e.handleError(c,l);case 12:return[3,8];case 13:return[3,7];case 14:if(!e.listeners.OnceExit)return[3,18];u=function(){var t,n,i,r,s;return Ue(this,function(a){switch(a.label){case 0:t=h.value,n=t[0],i=t[1],e.result.lastPlugin=n,a.label=1;case 1:return a.trys.push([1,6,,7]),"document"!==o.type?[3,3]:(r=o.nodes.map(function(t){return i(t,e.helpers)}),[4,Promise.all(r)]);case 2:return a.sent(),[3,5];case 3:return[4,i(o,e.helpers)];case 4:a.sent(),a.label=5;case 5:return[3,7];case 6:throw s=a.sent(),e.handleError(s);case 7:return[2]}})},d=Qe(e.listeners.OnceExit),A.label=15;case 15:return(h=d()).done?[3,18]:[5,Fe(u())];case 16:A.sent(),A.label=17;case 17:return[3,15];case 18:return e.processed=!0,[2,e.stringify()]}})})()},t.runOnRoot=function(e){var t=this;this.result.lastPlugin=e;try{if("object"===(void 0===e?"undefined":Ee(e))&&e.Once){if("document"===this.result.root.type){var n=this.result.root.nodes.map(function(n){return e.Once(n,t.helpers)});return nc(n[0])?Promise.all(n):n}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(gd){throw this.handleError(gd)}},t.stringify=function(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts,t=Za;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);var n=new ja(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result},t.sync=function(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e,t=Qe(this.plugins);!(e=t()).done;){var n=e.value;if(nc(this.runOnRoot(n)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var i=this.result.root;!i[Ha];)i[Ha]=!0,this.walkSync(i);if(this.listeners.OnceExit)if("document"===i.type)for(var r,o=Qe(i.nodes);!(r=o()).done;){var s=r.value;this.visitSync(this.listeners.OnceExit,s)}else this.visitSync(this.listeners.OnceExit,i)}return this.result},t.then=function(e,t){return this.async().then(e,t)},t.toString=function(){return this.css},t.visitSync=function(e,t){for(var n,i=Qe(e);!(n=i()).done;){var r=n.value,o=r[0],s=r[1];this.result.lastPlugin=o;var a=void 0;try{a=s(t,this.helpers)}catch(c){throw this.handleError(c,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(nc(a))throw this.getAsyncError()}},t.visitTick=function(e){var t=e[e.length-1],n=t.node,i=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(i.length>0&&t.visitorIndex<i.length){var r=i[t.visitorIndex],o=r[0],s=r[1];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return s(n.toProxy(),this.helpers)}catch(d){throw this.handleError(d,n)}}if(0!==t.iterator){for(var a,c=t.iterator;a=n.nodes[n.indexes[c]];)if(n.indexes[c]+=1,!a[Ha])return a[Ha]=!0,void e.push(rc(a));t.iterator=0,delete n.indexes[c]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[Ha]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}e.pop()}else e.pop()},t.walkSync=function(e){var t=this;e[Ha]=!0;for(var n,i=Qe(ic(e));!(n=i()).done;){var r=n.value;if(0===r)e.nodes&&e.each(function(e){e[Ha]||t.walkSync(e)});else{var o=this.listeners[r];if(o&&this.visitSync(o,e.toProxy()))return}}},t.warnings=function(){return this.sync().warnings()},ve(e,[{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}]),e}();ac.registerPostcss=function(e){sc=e};var cc=ac;ac.default=ac,_a.registerLazyResult(ac),Ga.registerLazyResult(ac);var lc=Cs,uc=Fo,dc=Ka,hc=Zs,Ac=function(){function e(e,t,n){var i;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;var r=uc;this.result=new hc(this._processor,i,this._opts),this.result.css=t;var o=this;Object.defineProperty(this.result,"root",{get:function(){return o.root}});var s=new lc(r,i,this._opts,t);if(s.isMap()){var a=s.generate(),c=a[0],l=a[1];c&&(this.result.css=c),l&&(this.result.map=l)}else s.clearAnnotation(),this.result.css=s.css}var t=e.prototype;return t.async=function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.sync=function(){if(this.error)throw this.error;return this.result},t.then=function(e,t){return this.async().then(e,t)},t.toString=function(){return this._css},t.warnings=function(){return[]},ve(e,[{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=dc;try{e=t(this._css,this._opts)}catch(gd){this.error=gd}if(this.error)throw this.error;return this._root=e,e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),e}(),pc=Ac;Ac.default=Ac;var mc=pc,fc=cc,gc=Ys,yc=Ca,bc=function(){function e(e){void 0===e&&(e=[]),this.version="8.4.38",this.plugins=this.normalize(e)}var t=e.prototype;return t.normalize=function(e){for(var t,n=[],i=Qe(e);!(t=i()).done;){var r=t.value;if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"===(void 0===r?"undefined":Ee(r))&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if("object"===(void 0===r?"undefined":Ee(r))&&r.postcssPlugin)n.push(r);else if("function"==typeof r)n.push(r);else if("object"!==(void 0===r?"undefined":Ee(r))||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin")}return n},t.process=function(e,t){return void 0===t&&(t={}),this.plugins.length||t.parser||t.stringifier||t.syntax?new fc(this,e,t):new mc(this,e,t)},t.use=function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this},e}(),wc=bc;bc.default=bc,yc.registerProcessor(bc),gc.registerProcessor(bc);var vc=Ko,kc=_o,xc=Bs,Cc=ba,Sc=As,Bc=Ca,Ic=Da;function Ec(e,t){if(Array.isArray(e))return e.map(function(e){return Ec(e)});var n=e.inputs,i=Be(e,["inputs"]);if(n){t=[];for(var r,o=Qe(n);!(r=o()).done;){var s=ke({},r.value,{__proto__:Sc.prototype});s.map&&(s.map=ke({},s.map,{__proto__:kc.prototype})),t.push(s)}}if(i.nodes&&(i.nodes=e.nodes.map(function(e){return Ec(e,t)})),i.source){var a=i.source,c=a.inputId,l=Be(a,["inputId"]);i.source=l,null!=c&&(i.source.input=t[c])}if("root"===i.type)return new Bc(i);if("decl"===i.type)return new vc(i);if("rule"===i.type)return new Ic(i);if("comment"===i.type)return new xc(i);if("atrule"===i.type)return new Cc(i);throw new Error("Unknown node type: "+e.type)}var Mc=Ec;Ec.default=Ec;var Dc=Bo,Qc=Ko,Uc=cc,Fc=Os,Nc=wc,Tc=Fo,Lc=Mc,Pc=Ys,Oc=Hs,Rc=Bs,zc=ba,qc=Zs,Yc=As,Kc=Ka,Hc=Ba,Vc=Da,jc=Ca,Zc=qo;function Xc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new Nc(t)}Xc.plugin=function(e,t){var n,i=!1;function r(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];console&&console.warn&&!i&&(i=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),pe.env.LANG&&pe.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));var s=t.apply(void 0,[].concat(r));return s.postcssPlugin=e,s.postcssVersion=(new Nc).version,s}return Object.defineProperty(r,"postcss",{get:function(){return n||(n=r()),n}}),r.process=function(e,t,n){return Xc([r(n)]).process(e,t)},r},Xc.stringify=Tc,Xc.parse=Kc,Xc.fromJSON=Lc,Xc.list=Hc,Xc.comment=function(e){return new Rc(e)},Xc.atRule=function(e){return new zc(e)},Xc.decl=function(e){return new Qc(e)},Xc.rule=function(e){return new Vc(e)},Xc.root=function(e){return new jc(e)},Xc.document=function(e){return new Pc(e)},Xc.CssSyntaxError=Dc,Xc.Declaration=Qc,Xc.Container=Fc,Xc.Processor=Nc,Xc.Document=Pc,Xc.Comment=Rc,Xc.Warning=Oc,Xc.AtRule=zc,Xc.Result=qc,Xc.Input=Yc,Xc.Rule=Vc,Xc.Root=jc,Xc.Node=Zc,Uc.registerPostcss(Xc);var Gc=Xc;Xc.default=Xc;var Wc=fo(Gc);Wc.stringify,Wc.fromJSON,Wc.plugin,Wc.parse,Wc.list,Wc.document,Wc.comment,Wc.atRule,Wc.rule,Wc.decl,Wc.root,Wc.CssSyntaxError,Wc.Declaration,Wc.Container,Wc.Processor,Wc.Document,Wc.Comment,Wc.Warning,Wc.AtRule,Wc.Result,Wc.Input,Wc.Rule,Wc.Root,Wc.Node;var Jc=function(){function e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];mo(this,"parentElement",null),mo(this,"parentNode",null),mo(this,"ownerDocument"),mo(this,"firstChild",null),mo(this,"lastChild",null),mo(this,"previousSibling",null),mo(this,"nextSibling",null),mo(this,"ELEMENT_NODE",1),mo(this,"TEXT_NODE",3),mo(this,"nodeType"),mo(this,"nodeName"),mo(this,"RRNodeType")}var t=e.prototype;return t.contains=function(t){if(!Se(t,e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1},t.appendChild=function(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")},t.insertBefore=function(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")},t.removeChild=function(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")},t.toString=function(){return"RRNode"},ve(e,[{key:"childNodes",get:function(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}}]),e}(),_c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},$c={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},el={};function tl(e){if(el[e])return el[e];var t=globalThis[e],n=t.prototype,i=e in _c?_c[e]:void 0,r=Boolean(i&&i.every(function(e){var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))})),o=e in $c?$c[e]:void 0,s=Boolean(o&&o.every(function(e){var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(r&&s&&!globalThis.Zone)return el[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var c=a.contentWindow;if(!c)return t.prototype;var l=c[e].prototype;return document.body.removeChild(a),l?el[e]=l:n}catch(u){return n}}var nl={};function il(e,t,n){var i,r=e+"."+String(n);if(nl[r])return nl[r].call(t);var o=tl(e),s=null==(i=Object.getOwnPropertyDescriptor(o,n))?void 0:i.get;return s?(nl[r]=s,s.call(t)):t[n]}var rl={};function ol(e,t,n){var i=e+"."+String(n);if(rl[i])return rl[i].bind(t);var r=tl(e)[n];return"function"!=typeof r?t[n]:(rl[i]=r,r.bind(t))}function sl(){return tl("MutationObserver").constructor}function al(e,t,n){try{if(!(t in e))return function(){};var i=e[t],r=n(i);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=r,function(){e[t]=i}}catch(o){return function(){}}}var cl={childNodes:function(e){return il("Node",e,"childNodes")},parentNode:function(e){return il("Node",e,"parentNode")},parentElement:function(e){return il("Node",e,"parentElement")},textContent:function(e){return il("Node",e,"textContent")},contains:function(e,t){return ol("Node",e,"contains")(t)},getRootNode:function(e){return ol("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?il("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?il("Element",e,"shadowRoot"):null},querySelector:function(e,t){return il("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return il("Element",e,"querySelectorAll")(t)},mutationObserver:sl,patch:al};function ll(e,t,n){void 0===n&&(n=document);var i={capture:!0,passive:!0};return n.addEventListener(e,t,i),function(){return n.removeEventListener(e,t,i)}}var ul="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",dl={map:{},getId:function(){return console.error(ul),-1},getNode:function(){return console.error(ul),null},removeNodeFromMap:function(){console.error(ul)},has:function(){return console.error(ul),!1},reset:function(){console.error(ul)}};function hl(e,t,n){void 0===n&&(n={});var i=null,r=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var c=Date.now();r||!1!==n.leading||(r=c);var l=t-(c-r),u=this;l<=0||l>t?(i&&(clearTimeout(i),i=null),r=c,e.apply(u,s)):i||!1===n.trailing||(i=setTimeout(function(){r=!1===n.leading?0:Date.now(),i=null,e.apply(u,s)},l))}}function Al(e,t,n,i,r){void 0===r&&(r=window);var o=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,i?n:{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return Al(e,t,o||{},!0)}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(dl=new Proxy(dl,{get:function(e,t,n){return"map"===t&&console.error(ul),Reflect.get(e,t,n)}}));var pl=Date.now;function ml(e){var t,n,i,r,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=cl.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=cl.parentElement(o.body))?void 0:i.scrollTop)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollTop)||0}}function fl(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function gl(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function yl(e){return e?e.nodeType===e.ELEMENT_NODE?e:cl.parentElement(e):null}function bl(e,t,n,i){if(!e)return!1;var r=yl(e);if(!r)return!1;try{if("string"==typeof t){if(r.classList.contains(t))return!0;if(i&&null!==r.closest("."+t))return!0}else if(Bt(r,t,i))return!0}catch(o){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1}function wl(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)}function vl(e,t){if(We(e))return!1;var n=t.getId(e);if(!t.has(n))return!0;var i=cl.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||vl(i,t))}function kl(e){return Boolean(e.changedTouches)}function xl(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Cl(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Sl(e){return!!e&&(Se(e,Jc)&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(cl.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(pl=function(){return(new Date).getTime()});var Bl=function(){function e(){Le(this,"id",1),Le(this,"styleIDMap",new WeakMap),Le(this,"idStyleMap",new Map)}var t=e.prototype;return t.getId=function(e){var t;return null!=(t=this.styleIDMap.get(e))?t:-1},t.has=function(e){return this.styleIDMap.has(e)},t.add=function(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n},t.getStyle=function(e){return this.idStyleMap.get(e)||null},t.reset=function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1},t.generateId=function(){return this.id++},e}();function Il(e){var t,n=null;return"getRootNode"in e&&(null==(t=cl.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&cl.host(cl.getRootNode(e))&&(n=cl.host(cl.getRootNode(e))),n}function El(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=Il(n);)n=t;return n}(e);return cl.contains(t,n)}function Ml(e){var t=e.ownerDocument;return!!t&&(cl.contains(t,e)||El(e))}var Dl=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(Dl||{}),Ql=function(e){return e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e}(Ql||{}),Ul=function(e){return e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e}(Ul||{}),Fl=function(e){return e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e}(Fl||{}),Nl=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(Nl||{}),Tl=function(e){return e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e}(Tl||{}),Ll=function(e){return e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e}(Ll||{});function Pl(e){return"__ln"in e}var Ol,Rl=function(){function e(){Le(this,"length",0),Le(this,"head",null),Le(this,"tail",null)}var t=e.prototype;return t.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},t.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Pl(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Pl(e.nextSibling)&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++},t.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)},e}(),zl=function(e,t){return e+"@"+t},ql=function(){function e(){var e=this;Le(this,"frozen",!1),Le(this,"locked",!1),Le(this,"texts",[]),Le(this,"attributes",[]),Le(this,"attributeMap",new WeakMap),Le(this,"removes",[]),Le(this,"mapRemoves",[]),Le(this,"movedMap",{}),Le(this,"addedSet",new Set),Le(this,"movedSet",new Set),Le(this,"droppedSet",new Set),Le(this,"removesSubTreeCache",new Set),Le(this,"mutationCb"),Le(this,"blockClass"),Le(this,"blockSelector"),Le(this,"maskTextClass"),Le(this,"maskTextSelector"),Le(this,"inlineStylesheet"),Le(this,"maskInputOptions"),Le(this,"maskTextFn"),Le(this,"maskInputFn"),Le(this,"keepIframeSrcFn"),Le(this,"recordCanvas"),Le(this,"inlineImages"),Le(this,"slimDOMOptions"),Le(this,"dataURLOptions"),Le(this,"doc"),Le(this,"mirror"),Le(this,"iframeManager"),Le(this,"stylesheetManager"),Le(this,"shadowDomManager"),Le(this,"canvasManager"),Le(this,"processedNodeManager"),Le(this,"unattachedDoc"),Le(this,"processMutations",function(t){t.forEach(e.processMutation),e.emit()}),Le(this,"emit",function(){if(!e.frozen&&!e.locked){for(var t=[],n=new Set,i=new Rl,r=function(t){for(var n=t,i=-2;-2===i;)i=(n=n&&n.nextSibling)&&e.mirror.getId(n);return i},o=function(o){var s=cl.parentNode(o);if(s&&Ml(o)){var a=!1;if(o.nodeType===Node.TEXT_NODE){var c=s.tagName;if("TEXTAREA"===c)return;"STYLE"===c&&e.addedSet.has(s)&&(a=!0)}var l=We(s)?e.mirror.getId(Il(o)):e.mirror.getId(s),u=r(o);if(-1===l||-1===u)return i.addNode(o);var d=Dt(o,{doc:e.doc,mirror:e.mirror,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,dataURLOptions:e.dataURLOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(t){xl(t,e.mirror)&&e.iframeManager.addIframe(t),Cl(t,e.mirror)&&e.stylesheetManager.trackLinkElement(t),Sl(o)&&e.shadowDomManager.addShadowRoot(cl.shadowRoot(o),e.doc)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:function(t,n){e.stylesheetManager.attachLinkElement(t,n)},cssCaptured:a});d&&(t.push({parentId:l,nextId:u,node:d}),n.add(d.id))}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());for(var s,a=Qe(e.movedSet);!(s=a()).done;){var c=s.value;Kl(e.removesSubTreeCache,c,e.mirror)&&!e.movedSet.has(cl.parentNode(c))||o(c)}for(var l,u=Qe(e.addedSet);!(l=u()).done;){var d=l.value;Hl(e.droppedSet,d)||Kl(e.removesSubTreeCache,d,e.mirror)?Hl(e.movedSet,d)?o(d):e.droppedSet.add(d):o(d)}for(var h=null;i.length;){var A=null;if(h){var p=e.mirror.getId(cl.parentNode(h.value)),m=r(h.value);-1!==p&&-1!==m&&(A=h)}if(!A)for(var f=i.tail;f;){var g=f;if(f=f.previous,g){var y=e.mirror.getId(cl.parentNode(g.value));if(-1===r(g.value))continue;if(-1!==y){A=g;break}var b=g.value,w=cl.parentNode(b);if(w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var v=cl.host(w);if(-1!==e.mirror.getId(v)){A=g;break}}}}if(!A){for(;i.head;)i.removeNode(i.head.value);break}h=A.previous,i.removeNode(A.value),o(A.value)}var k={texts:e.texts.map(function(t){var n=t.node,i=cl.parentNode(n);return i&&"TEXTAREA"===i.tagName&&e.genTextAreaValueMutation(i),{id:e.mirror.getId(n),value:t.value}}).filter(function(e){return!n.has(e.id)}).filter(function(t){return e.mirror.has(t.id)}),attributes:e.attributes.map(function(t){var n=t.attributes;if("string"==typeof n.style){var i=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);i.length<n.style.length&&(i+r).split("var(").length===n.style.split("var(").length&&(n.style=t.styleDiff)}return{id:e.mirror.getId(t.node),attributes:n}}).filter(function(e){return!n.has(e.id)}).filter(function(t){return e.mirror.has(t.id)}),removes:e.removes,adds:t};(k.texts.length||k.attributes.length||k.removes.length||k.adds.length)&&(e.texts=[],e.attributes=[],e.attributeMap=new WeakMap,e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.removesSubTreeCache=new Set,e.movedMap={},e.mutationCb(k))}}),Le(this,"genTextAreaValueMutation",function(t){var n=e.attributeMap.get(t);n||(n={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},e.attributes.push(n),e.attributeMap.set(t,n));var i=Array.from(cl.childNodes(t),function(e){return cl.textContent(e)||""}).join("");n.attributes.value=tt({element:t,maskInputOptions:e.maskInputOptions,tagName:t.tagName,type:rt(t),value:i,maskInputFn:e.maskInputFn})}),Le(this,"processMutation",function(t){if(!wl(t.target,e.mirror,e.slimDOMOptions))switch(t.type){case"characterData":var n=cl.textContent(t.target);bl(t.target,e.blockClass,e.blockSelector,!1)||n===t.oldValue||e.texts.push({value:It(t.target,e.maskTextClass,e.maskTextSelector,!0)&&n?e.maskTextFn?e.maskTextFn(n,yl(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break;case"attributes":var i=t.target,r=t.attributeName,o=t.target.getAttribute(r);if("value"===r){var s=rt(i);o=tt({element:i,maskInputOptions:e.maskInputOptions,tagName:i.tagName,type:s,value:o,maskInputFn:e.maskInputFn})}if(bl(t.target,e.blockClass,e.blockSelector,!1)||o===t.oldValue)return;var a=e.attributeMap.get(t.target);if("IFRAME"===i.tagName&&"src"===r&&!e.keepIframeSrcFn(o)){if(i.contentDocument)return;r="rr_src"}if(a||(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},e.attributes.push(a),e.attributeMap.set(t.target,a)),"type"===r&&"INPUT"===i.tagName&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!St(i.tagName,r))if(a.attributes[r]=Ct(e.doc,nt(i.tagName),nt(r),o),"style"===r){if(!e.unattachedDoc)try{e.unattachedDoc=document.implementation.createHTMLDocument()}catch(g){e.unattachedDoc=e.doc}var c=e.unattachedDoc.createElement("span");t.oldValue&&c.setAttribute("style",t.oldValue);for(var l,u=Qe(Array.from(i.style));!(l=u()).done;){var d=l.value,h=i.style.getPropertyValue(d),A=i.style.getPropertyPriority(d);h!==c.style.getPropertyValue(d)||A!==c.style.getPropertyPriority(d)?a.styleDiff[d]=""===A?h:[h,A]:a._unchangedStyles[d]=[h,A]}for(var p,m=Qe(Array.from(c.style));!(p=m()).done;){var f=p.value;""===i.style.getPropertyValue(f)&&(a.styleDiff[f]=!1)}}else"open"===r&&"DIALOG"===i.tagName&&(i.matches("dialog:modal")?a.attributes.rr_open_mode="modal":a.attributes.rr_open_mode="non-modal");break;case"childList":if(bl(t.target,e.blockClass,e.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void e.genTextAreaValueMutation(t.target);t.addedNodes.forEach(function(n){return e.genAdds(n,t.target)}),t.removedNodes.forEach(function(n){var i=e.mirror.getId(n),r=We(t.target)?e.mirror.getId(cl.host(t.target)):e.mirror.getId(t.target);bl(t.target,e.blockClass,e.blockSelector,!1)||wl(n,e.mirror,e.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(n,e.mirror)||(e.addedSet.has(n)?(Yl(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===i||vl(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[zl(i,r)]?Yl(e.movedSet,n):(e.removes.push({parentId:r,id:i,isShadow:!(!We(t.target)||!Je(t.target))||void 0}),function(e,t){var n=[e];for(;n.length;){var i=n.pop();t.has(i)||(t.add(i),cl.childNodes(i).forEach(function(e){return n.push(e)}))}}(n,e.removesSubTreeCache))),e.mapRemoves.push(n))})}}),Le(this,"genAdds",function(t,n){if(!e.processedNodeManager.inOtherBuffer(t,e)&&!e.addedSet.has(t)&&!e.movedSet.has(t)){if(e.mirror.hasNode(t)){if(wl(t,e.mirror,e.slimDOMOptions))return;e.movedSet.add(t);var i=null;n&&e.mirror.hasNode(n)&&(i=e.mirror.getId(n)),i&&-1!==i&&(e.movedMap[zl(e.mirror.getId(t),i)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);bl(t,e.blockClass,e.blockSelector,!1)||(cl.childNodes(t).forEach(function(t){return e.genAdds(t)}),Sl(t)&&cl.childNodes(cl.shadowRoot(t)).forEach(function(n){e.processedNodeManager.add(n,e),e.genAdds(n,t)}))}})}var t=e.prototype;return t.init=function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(function(n){t[n]=e[n]})},t.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},t.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},t.isFrozen=function(){return this.frozen},t.lock=function(){this.locked=!0,this.canvasManager.lock()},t.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},t.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function Yl(e,t){e.delete(t),cl.childNodes(t).forEach(function(t){return Yl(e,t)})}function Kl(e,t,n){return 0!==e.size&&function(e,t){var n=cl.parentNode(t);return!!n&&e.has(n)}(e,t)}function Hl(e,t){return 0!==e.size&&Vl(e,t)}function Vl(e,t){var n=cl.parentNode(t);return!!n&&(!!e.has(n)||Vl(e,n))}var jl=function(e){if(!Ol)return e;return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];try{return e.apply(void 0,[].concat(n))}catch(gd){if(Ol&&!0===Ol(gd))return;throw gd}}},Zl=[];function Xl(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(n){}return e&&e.target}function Gl(e,t){var n=new ql;Zl.push(n),n.init(e);var i=new(sl())(jl(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Wl(e){var t=e.mouseInteractionCb,n=e.doc,i=e.mirror,r=e.blockClass,o=e.blockSelector,s=e.sampling;if(!1===s.mouseInteraction)return function(){};var a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,c=[],l=null;return Object.keys(Ul).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]}).forEach(function(e){var s=nt(e),a=function(e){return function(n){var s=Xl(n);if(!bl(s,r,o,!0)){var a=null,c=e;if("pointerType"in n){switch(n.pointerType){case"mouse":a=Fl.Mouse;break;case"touch":a=Fl.Touch;break;case"pen":a=Fl.Pen}a===Fl.Touch?Ul[e]===Ul.MouseDown?c="TouchStart":Ul[e]===Ul.MouseUp&&(c="TouchEnd"):Fl.Pen}else kl(n)&&(a=Fl.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Fl.Touch||c.startsWith("Mouse")&&a===Fl.Mouse)&&(a=null)):Ul[e]===Ul.Click&&(a=l,l=null);var u=kl(n)?n.changedTouches[0]:n;if(u){var d=i.getId(s),h=u.clientX,A=u.clientY;jl(t)(ke({type:Ul[c],id:d,x:h,y:A},null!==a&&{pointerType:a}))}}}}(e);if(window.PointerEvent)switch(Ul[e]){case Ul.MouseDown:case Ul.MouseUp:s=s.replace("mouse","pointer");break;case Ul.TouchStart:case Ul.TouchEnd:return}c.push(ll(s,a,n))}),jl(function(){c.forEach(function(e){return e()})})}function Jl(e){var t=e.scrollCb,n=e.doc,i=e.mirror,r=e.blockClass,o=e.blockSelector,s=e.sampling;return ll("scroll",jl(hl(jl(function(e){var s=Xl(e);if(s&&!bl(s,r,o,!0)){var a=i.getId(s);if(s===n&&n.defaultView){var c=ml(n.defaultView);t({id:a,x:c.left,y:c.top})}else t({id:a,x:s.scrollLeft,y:s.scrollTop})}}),s.scroll||100)),n)}var _l=["INPUT","TEXTAREA","SELECT"],$l=new WeakMap;function eu(e){return function(e,t){if(ru("CSSGroupingRule")&&Se(e.parentRule,CSSGroupingRule)||ru("CSSMediaRule")&&Se(e.parentRule,CSSMediaRule)||ru("CSSSupportsRule")&&Se(e.parentRule,CSSSupportsRule)||ru("CSSConditionRule")&&Se(e.parentRule,CSSConditionRule)){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var i=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(i)}return t}(e,[])}function tu(e,t,n){var i,r;return e?(e.ownerNode?i=t.getId(e.ownerNode):r=n.getId(e),{styleId:r,id:i}):{}}function nu(e,t){var n,i,r,o=e.mirror,s=e.stylesheetManager,a=null;a="#document"===t.nodeName?o.getId(t):o.getId(cl.host(t));var c="#document"===t.nodeName?null==(n=t.defaultView)?void 0:n.Document:null==(r=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:r.ShadowRoot,l=(null==c?void 0:c.prototype)?Object.getOwnPropertyDescriptor(null==c?void 0:c.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&c&&l?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:function(){var e;return null==(e=l.get)?void 0:e.call(this)},set:function(e){var t,n=null==(t=l.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{s.adoptStyleSheets(e,a)}catch(i){}return n}}),jl(function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):function(){}}function iu(e,t){void 0===t&&(t={});var n,i=e.doc.defaultView;if(!i)return function(){};!function(e,t){var n=e.mutationCb,i=e.mousemoveCb,r=e.mouseInteractionCb,o=e.scrollCb,s=e.viewportResizeCb,a=e.inputCb,c=e.mediaInteractionCb,l=e.styleSheetRuleCb,u=e.styleDeclarationCb,d=e.canvasMutationCb,h=e.fontCb,A=e.selectionCb,p=e.customElementCb;e.mutationCb=function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];var o;t.mutation&&(o=t).mutation.apply(o,[].concat(i)),n.apply(void 0,[].concat(i))},e.mousemoveCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o;t.mousemove&&(o=t).mousemove.apply(o,[].concat(n)),i.apply(void 0,[].concat(n))},e.mouseInteractionCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var o;t.mouseInteraction&&(o=t).mouseInteraction.apply(o,[].concat(n)),r.apply(void 0,[].concat(n))},e.scrollCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.scroll&&(r=t).scroll.apply(r,[].concat(n)),o.apply(void 0,[].concat(n))},e.viewportResizeCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.viewportResize&&(r=t).viewportResize.apply(r,[].concat(n)),s.apply(void 0,[].concat(n))},e.inputCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.input&&(r=t).input.apply(r,[].concat(n)),a.apply(void 0,[].concat(n))},e.mediaInteractionCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.mediaInteaction&&(r=t).mediaInteaction.apply(r,[].concat(n)),c.apply(void 0,[].concat(n))},e.styleSheetRuleCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.styleSheetRule&&(r=t).styleSheetRule.apply(r,[].concat(n)),l.apply(void 0,[].concat(n))},e.styleDeclarationCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.styleDeclaration&&(r=t).styleDeclaration.apply(r,[].concat(n)),u.apply(void 0,[].concat(n))},e.canvasMutationCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.canvasMutation&&(r=t).canvasMutation.apply(r,[].concat(n)),d.apply(void 0,[].concat(n))},e.fontCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.font&&(r=t).font.apply(r,[].concat(n)),h.apply(void 0,[].concat(n))},e.selectionCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.selection&&(r=t).selection.apply(r,[].concat(n)),A.apply(void 0,[].concat(n))},e.customElementCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.customElement&&(r=t).customElement.apply(r,[].concat(n)),p.apply(void 0,[].concat(n))}}(e,t),e.recordDOM&&(n=Gl(e,e.doc));var r,o,s,a,c,l=function(e){var t=e.mousemoveCb,n=e.sampling,i=e.doc,r=e.mirror;if(!1===n.mousemove)return function(){};var o,s="number"==typeof n.mousemove?n.mousemove:50,a="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,c=[],l=hl(jl(function(e){var n=Date.now()-o;t(c.map(function(e){return e.timeOffset-=n,e}),e),c=[],o=null}),a),u=jl(hl(jl(function(e){var t=Xl(e),n=kl(e)?e.changedTouches[0]:e,i=n.clientX,s=n.clientY;o||(o=pl()),c.push({x:i,y:s,id:r.getId(t),timeOffset:pl()-o}),l("undefined"!=typeof DragEvent&&Se(e,DragEvent)?Ql.Drag:Se(e,MouseEvent)?Ql.MouseMove:Ql.TouchMove)}),s,{trailing:!1})),d=[ll("mousemove",u,i),ll("touchmove",u,i),ll("drag",u,i)];return jl(function(){d.forEach(function(e){return e()})})}(e),u=Wl(e),d=Jl(e),h=(r={win:i},o=e.viewportResizeCb,s=r.win,a=-1,c=-1,ll("resize",jl(hl(jl(function(){var e=fl(),t=gl();a===e&&c===t||(o({width:Number(t),height:Number(e)}),a=e,c=t)}),200)),s)),A=function(e){var t=e.inputCb,n=e.doc,i=e.mirror,r=e.blockClass,o=e.blockSelector,s=e.ignoreClass,a=e.ignoreSelector,c=e.maskInputOptions,l=e.maskInputFn,u=e.sampling,d=e.userTriggeredOnInput;function h(e){var t=Xl(e),i=e.isTrusted,u=t&&t.tagName;if(t&&"OPTION"===u&&(t=cl.parentElement(t)),t&&u&&!(_l.indexOf(u)<0)&&!bl(t,r,o,!0)&&!(t.classList.contains(s)||a&&t.matches(a))){var h=t.value,p=!1,m=rt(t)||"";"radio"===m||"checkbox"===m?p=t.checked:(c[u.toLowerCase()]||c[m])&&(h=tt({element:t,maskInputOptions:c,tagName:u,type:m,value:h,maskInputFn:l})),A(t,d?{text:h,isChecked:p,userTriggered:i}:{text:h,isChecked:p});var f=t.name;"radio"===m&&f&&p&&n.querySelectorAll('input[type="radio"][name="'+f+'"]').forEach(function(e){if(e!==t){var n=e.value;A(e,d?{text:n,isChecked:!p,userTriggered:!1}:{text:n,isChecked:!p})}})}}function A(e,n){var r=$l.get(e);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){$l.set(e,n);var o=i.getId(e);jl(t)(ke({},n,{id:o}))}}var p=("last"===u.input?["change"]:["input","change"]).map(function(e){return ll(e,jl(h),n)}),m=n.defaultView;if(!m)return function(){p.forEach(function(e){return e()})};var f,g=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&(f=p).push.apply(f,[].concat(y.map(function(e){return Al(e[0],e[1],{set:function(){jl(h)({target:this,isTrusted:!1})}},!1,m)}))),jl(function(){p.forEach(function(e){return e()})})}(e),p=function(e){var t=e.mediaInteractionCb,n=e.blockClass,i=e.blockSelector,r=e.mirror,o=e.sampling,s=e.doc,a=jl(function(e){return hl(jl(function(o){var s=Xl(o);if(s&&!bl(s,n,i,!0)){var a=s.currentTime,c=s.volume,l=s.muted,u=s.playbackRate,d=s.loop;t({type:e,id:r.getId(s),currentTime:a,volume:c,muted:l,playbackRate:u,loop:d})}}),o.media||500)}),c=[ll("play",a(Tl.Play),s),ll("pause",a(Tl.Pause),s),ll("seeked",a(Tl.Seeked),s),ll("volumechange",a(Tl.VolumeChange),s),ll("ratechange",a(Tl.RateChange),s)];return jl(function(){c.forEach(function(e){return e()})})}(e),m=function(){},f=function(){},g=function(){},y=function(){};e.recordDOM&&(m=function(e,t){var n=e.styleSheetRuleCb,i=e.mirror,r=e.stylesheetManager,o=t.win;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return function(){};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:jl(function(e,t,o){var s=o[0],a=o[1],c=tu(t,i,r.styleMirror),l=c.id,u=c.styleId;return(l&&-1!==l||u&&-1!==u)&&n({id:l,styleId:u,adds:[{rule:s,index:a}]}),e.apply(t,o)})}),o.CSSStyleSheet.prototype.addRule=function(e,t,n){void 0===n&&(n=this.cssRules.length);var i=e+" { "+t+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};var a,c,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:jl(function(e,t,o){var s=o[0],a=tu(t,i,r.styleMirror),c=a.id,l=a.styleId;return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,removes:[{index:s}]}),e.apply(t,o)})}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:jl(function(e,t,o){var s=o[0],a=tu(t,i,r.styleMirror),c=a.id,l=a.styleId;return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,replace:s}),e.apply(t,o)})})),o.CSSStyleSheet.prototype.replaceSync&&(c=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:jl(function(e,t,o){var s=o[0],a=tu(t,i,r.styleMirror),c=a.id,l=a.styleId;return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,replaceSync:s}),e.apply(t,o)})}));var u={};ou("CSSGroupingRule")?u.CSSGroupingRule=o.CSSGroupingRule:(ou("CSSMediaRule")&&(u.CSSMediaRule=o.CSSMediaRule),ou("CSSConditionRule")&&(u.CSSConditionRule=o.CSSConditionRule),ou("CSSSupportsRule")&&(u.CSSSupportsRule=o.CSSSupportsRule));var d={};return Object.entries(u).forEach(function(e){var t=e[0],o=e[1];d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:jl(function(e,t,o){var s=o[0],a=o[1],c=tu(t.parentStyleSheet,i,r.styleMirror),l=c.id,u=c.styleId;return(l&&-1!==l||u&&-1!==u)&&n({id:l,styleId:u,adds:[{rule:s,index:[].concat(eu(t),[a||0])}]}),e.apply(t,o)})}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:jl(function(e,t,o){var s=o[0],a=tu(t.parentStyleSheet,i,r.styleMirror),c=a.id,l=a.styleId;return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,removes:[{index:[].concat(eu(t),[s])}]}),e.apply(t,o)})})}),jl(function(){o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=l,a&&(o.CSSStyleSheet.prototype.replace=a),c&&(o.CSSStyleSheet.prototype.replaceSync=c),Object.entries(u).forEach(function(e){var t=e[0],n=e[1];n.prototype.insertRule=d[t].insertRule,n.prototype.deleteRule=d[t].deleteRule})})}(e,{win:i}),f=nu(e,e.doc),g=function(e,t){var n=e.styleDeclarationCb,i=e.mirror,r=e.ignoreCSSAttributes,o=e.stylesheetManager,s=t.win,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:jl(function(e,t,s){var c,l=s[0],u=s[1],d=s[2];if(r.has(l))return a.apply(t,[l,u,d]);var h=tu(null==(c=t.parentRule)?void 0:c.parentStyleSheet,i,o.styleMirror),A=h.id,p=h.styleId;return(A&&-1!==A||p&&-1!==p)&&n({id:A,styleId:p,set:{property:l,value:u,priority:d},index:eu(t.parentRule)}),e.apply(t,s)})});var c=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(c,{apply:jl(function(e,t,s){var a,l=s[0];if(r.has(l))return c.apply(t,[l]);var u=tu(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,o.styleMirror),d=u.id,h=u.styleId;return(d&&-1!==d||h&&-1!==h)&&n({id:d,styleId:h,remove:{property:l},index:eu(t.parentRule)}),e.apply(t,s)})}),jl(function(){s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=c})}(e,{win:i}),e.collectFonts&&(y=function(e){var t=e.fontCb,n=e.doc,i=n.defaultView;if(!i)return function(){};var r=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(e,t,n){var i=new s(e,t,n);return o.set(i,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var a=al(n.fonts,"add",function(e){return function(n){return setTimeout(jl(function(){var e=o.get(n);e&&(t(e),o.delete(n))}),0),e.apply(this,[n])}});return r.push(function(){i.FontFace=s}),r.push(a),jl(function(){r.forEach(function(e){return e()})})}(e)));for(var b,w=function(e){var t=e.doc,n=e.mirror,i=e.blockClass,r=e.blockSelector,o=e.selectionCb,s=!0,a=jl(function(){var e=t.getSelection();if(!(!e||s&&(null==e?void 0:e.isCollapsed))){s=e.isCollapsed||!1;for(var a=[],c=e.rangeCount||0,l=0;l<c;l++){var u=e.getRangeAt(l),d=u.startContainer,h=u.startOffset,A=u.endContainer,p=u.endOffset;bl(d,i,r,!0)||bl(A,i,r,!0)||a.push({start:n.getId(d),startOffset:h,end:n.getId(A),endOffset:p})}o({ranges:a})}});return a(),ll("selectionchange",a)}(e),v=function(e){var t=e.doc,n=e.customElementCb,i=t.defaultView;return i&&i.customElements?al(i.customElements,"define",function(e){return function(t,i,r){try{n({define:{name:t}})}catch(o){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,i,r])}}):function(){}}(e),k=[],x=Qe(e.plugins);!(b=x()).done;){var C=b.value;k.push(C.observer(C.callback,i,C.options))}return jl(function(){Zl.forEach(function(e){return e.reset()}),null==n||n.disconnect(),l(),u(),d(),h(),A(),p(),m(),f(),g(),y(),w(),v(),k.forEach(function(e){return e()})})}function ru(e){return void 0!==window[e]}function ou(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var su=function(){function e(e){Le(this,"iframeIdToRemoteIdMap",new WeakMap),Le(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}var t=e.prototype;return t.getId=function(e,t,n,i){var r=n||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e),s=r.get(t);return s||(s=this.generateIdFn(),r.set(t,s),o.set(s,t)),s},t.getIds=function(e,t){var n=this,i=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(function(t){return n.getId(e,t,i,r)})},t.getRemoteId=function(e,t,n){var i=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var r=i.get(t);return r||-1},t.getRemoteIds=function(e,t){var n=this,i=this.getRemoteIdToIdMap(e);return t.map(function(t){return n.getRemoteId(e,t,i)})},t.reset=function(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)},t.getIdToRemoteIdMap=function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t},t.getRemoteIdToIdMap=function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t},e}(),au=function(){function e(e){Le(this,"iframes",new WeakMap),Le(this,"crossOriginIframeMap",new WeakMap),Le(this,"crossOriginIframeMirror",new su(gt)),Le(this,"crossOriginIframeStyleMirror"),Le(this,"crossOriginIframeRootIdMap",new WeakMap),Le(this,"mirror"),Le(this,"mutationCb"),Le(this,"wrappedEmit"),Le(this,"loadListener"),Le(this,"stylesheetManager"),Le(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new su(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}var t=e.prototype;return t.addIframe=function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)},t.addLoadListener=function(e){this.loadListener=e},t.attachIframe=function(e,t){var n,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))},t.handleMessage=function(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var i=this.transformCrossOriginEvent(n,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}},t.transformCrossOriginEvent=function(e,t){var n,i=this;switch(t.type){case Dl.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:Dl.IncrementalSnapshot,data:{source:Ql.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Dl.Meta:case Dl.Load:case Dl.DomContentLoaded:return!1;case Dl.Plugin:return t;case Dl.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Dl.IncrementalSnapshot:switch(t.data.source){case Ql.Mutation:return t.data.adds.forEach(function(t){i.replaceIds(t,e,["parentId","nextId","previousId"]),i.replaceIdOnNode(t.node,e);var n=i.crossOriginIframeRootIdMap.get(e);n&&i.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(function(t){i.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(function(t){i.replaceIds(t,e,["id"])}),t.data.texts.forEach(function(t){i.replaceIds(t,e,["id"])}),t;case Ql.Drag:case Ql.TouchMove:case Ql.MouseMove:return t.data.positions.forEach(function(t){i.replaceIds(t,e,["id"])}),t;case Ql.ViewportResize:return!1;case Ql.MediaInteraction:case Ql.MouseInteraction:case Ql.Scroll:case Ql.CanvasMutation:case Ql.Input:return this.replaceIds(t.data,e,["id"]),t;case Ql.StyleSheetRule:case Ql.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Ql.Font:return t;case Ql.Selection:return t.data.ranges.forEach(function(t){i.replaceIds(t,e,["start","end"])}),t;case Ql.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach(function(t){i.replaceStyleIds(t,e,["styleId"])}),t}}return!1},t.replace=function(e,t,n,i){for(var r,o=Qe(i);!(r=o()).done;){var s=r.value;(Array.isArray(t[s])||"number"==typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(n,t[s]):t[s]=e.getId(n,t[s]))}return t},t.replaceIds=function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)},t.replaceStyleIds=function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)},t.replaceIdOnNode=function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(function(e){n.replaceIdOnNode(e,t)})},t.patchRootIdOnNode=function(e,t){var n=this;e.type===Ll.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(function(e){n.patchRootIdOnNode(e,t)})},e}(),cu=function(){function e(e){Le(this,"shadowDoms",new WeakSet),Le(this,"mutationCb"),Le(this,"scrollCb"),Le(this,"bypassOptions"),Le(this,"mirror"),Le(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}var t=e.prototype;return t.init=function(){this.reset(),this.patchAttachShadow(Element,document)},t.addShadowRoot=function(e,t){var n=this;if(Je(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var i=Gl(ke({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(function(){return i.disconnect()}),this.restoreHandlers.push(Jl(ke({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&n.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,n.mirror.getId(cl.host(e))),n.restoreHandlers.push(nu({mirror:n.mirror,stylesheetManager:n.bypassOptions.stylesheetManager},e))},0)}},t.observeAttachShadow=function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)},t.patchAttachShadow=function(e,t){var n=this;this.restoreHandlers.push(al(e.prototype,"attachShadow",function(e){return function(i){var r=e.call(this,i),o=cl.shadowRoot(this);return o&&Ml(this)&&n.addShadowRoot(o,t),r}}))},t.reset=function(){this.restoreHandlers.forEach(function(e){try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet},e}(),lu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",uu="undefined"==typeof Uint8Array?[]:new Uint8Array(256),du=0;du<64;du++)uu[lu.charCodeAt(du)]=du;var hu=new Map;var Au=function(e,t,n){if(e&&(fu(e,t)||"object"===(void 0===e?"undefined":Ee(e)))){var i=function(e,t){var n=hu.get(e);return n||(n=new Map,hu.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),r=i.indexOf(e);return-1===r&&(r=i.length,i.push(e)),r}};function pu(e,t,n){if(Se(e,Array))return e.map(function(e){return pu(e,t,n)});if(null===e)return e;if(Se(e,Float32Array)||Se(e,Float64Array)||Se(e,Int32Array)||Se(e,Uint32Array)||Se(e,Uint8Array)||Se(e,Uint16Array)||Se(e,Int16Array)||Se(e,Int8Array)||Se(e,Uint8ClampedArray))return{rr_type:e.constructor.name,args:[Object.values(e)]};if(Se(e,ArrayBuffer))return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),i=n.length,r="";for(t=0;t<i;t+=3)r+=lu[n[t]>>2],r+=lu[(3&n[t])<<4|n[t+1]>>4],r+=lu[(15&n[t+1])<<2|n[t+2]>>6],r+=lu[63&n[t+2]];return i%3==2?r=r.substring(0,r.length-1)+"=":i%3==1&&(r=r.substring(0,r.length-2)+"=="),r}(e)};if(Se(e,DataView))return{rr_type:e.constructor.name,args:[pu(e.buffer,t,n),e.byteOffset,e.byteLength]};if(Se(e,HTMLImageElement))return{rr_type:e.constructor.name,src:e.src};if(Se(e,HTMLCanvasElement)){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return Se(e,ImageData)?{rr_type:e.constructor.name,args:[pu(e.data,t,n),e.width,e.height]}:fu(e,t)||"object"===(void 0===e?"undefined":Ee(e))?{rr_type:e.constructor.name,index:Au(e,t,n)}:e}var mu=function(e,t,n){return e.map(function(e){return pu(e,t,n)})},fu=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(function(e){return"function"==typeof t[e]});return Boolean(n.find(function(n){return Se(e,t[n])}))};function gu(e,t,n,i){var r=[];try{var o=al(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!bl(this,t,n,!0)){var c=function(e){return"experimental-webgl"===e?"webgl":e}(r);if("__context"in this||(this.__context=c),i&&["webgl","webgl2"].includes(c))if(s[0]&&"object"===Ee(s[0])){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[].concat([r],s))}});r.push(o)}catch(s){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){r.forEach(function(e){return e()})}}function yu(e,t,n,i,r,o){for(var s,a=function(){var a=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return"continue";try{if("function"!=typeof e[a])return"continue";var l=al(e,a,function(e){return function(){for(var s=arguments.length,c=new Array(s),l=0;l<s;l++)c[l]=arguments[l];var u=e.apply(this,c);if(Au(u,o,this),"tagName"in this.canvas&&!bl(this.canvas,i,r,!0)){var d=mu(c,o,this),h={type:t,property:a,args:d};n(this.canvas,h)}return u}});c.push(l)}catch(d){var u=Al(e,a,{set:function(e){n(this.canvas,{type:t,property:a,args:[e],setter:!0})}});c.push(u)}},c=[],l=Qe(Object.getOwnPropertyNames(e));!(s=l()).done;)a();return c}var bu,wu="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",vu="undefined"!=typeof window&&window.Blob&&new Blob([(bu=wu,Uint8Array.from(atob(bu),function(e){return e.charCodeAt(0)}))],{type:"text/javascript;charset=utf-8"});function ku(e){var t;try{if(!(t=vu&&(window.URL||window.webkitURL).createObjectURL(vu)))throw"";var n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",function(){(window.URL||window.webkitURL).revokeObjectURL(t)}),n}catch(i){return new Worker("data:text/javascript;base64,"+wu,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var xu,Cu,Su,Bu=function(){function e(e){var t=this;Le(this,"pendingCanvasMutations",new Map),Le(this,"rafStamps",{latestId:0,invokeId:null}),Le(this,"mirror"),Le(this,"mutationCb"),Le(this,"resetObservers"),Le(this,"frozen",!1),Le(this,"locked",!1),Le(this,"processMutation",function(e,n){!(t.rafStamps.invokeId&&t.rafStamps.latestId!==t.rafStamps.invokeId)&&t.rafStamps.invokeId||(t.rafStamps.invokeId=t.rafStamps.latestId),t.pendingCanvasMutations.has(e)||t.pendingCanvasMutations.set(e,[]),t.pendingCanvasMutations.get(e).push(n)});var n=e.sampling,i=void 0===n?"all":n,r=e.win,o=e.blockClass,s=e.blockSelector,a=e.recordCanvas,c=e.dataURLOptions;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&"all"===i&&this.initCanvasMutationObserver(r,o,s),a&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,o,s,{dataURLOptions:c})}var t=e.prototype;return t.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},t.freeze=function(){this.frozen=!0},t.unfreeze=function(){this.frozen=!1},t.lock=function(){this.locked=!0},t.unlock=function(){this.locked=!1},t.initCanvasFPSObserver=function(e,t,n,i,r){var o=this,s=gu(t,n,i,!0),a=new Map,c=new ku;c.onmessage=function(e){var t=e.data.id;if(a.set(t,!1),"base64"in e.data){var n=e.data,i=n.base64,r=n.type,s=n.width,c=n.height;o.mutationCb({id:t,type:Nl["2D"],commands:[{property:"clearRect",args:[0,0,s,c]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i}],type:r}]},0,0]}]})}};var l,u=1e3/e,d=0,h=function(e){if(d&&e-d<u)l=requestAnimationFrame(h);else{d=e;var s,A=o;(s=[],t.document.querySelectorAll("canvas").forEach(function(e){bl(e,n,i,!0)||s.push(e)}),s).forEach(be(function(e){var t,n,i,o;return Ue(this,function(s){switch(s.label){case 0:return n=A.mirror.getId(e),a.get(n)?[2]:0===e.width||0===e.height?[2]:(a.set(n,!0),["webgl","webgl2"].includes(e.__context)&&(i=e.getContext(e.__context),!1===(null==(t=null==i?void 0:i.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)),[4,createImageBitmap(e)]);case 1:return o=s.sent(),c.postMessage({id:n,bitmap:o,width:e.width,height:e.height,dataURLOptions:r.dataURLOptions},[o]),[2]}})})),l=requestAnimationFrame(h)}};l=requestAnimationFrame(h),this.resetObservers=function(){s(),cancelAnimationFrame(l)}},t.initCanvasMutationObserver=function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=gu(e,t,n,!1),r=function(e,t,n,i){for(var r,o=function(){var o=r.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return"continue";var a=al(t.CanvasRenderingContext2D.prototype,o,function(r){return function(){for(var s=this,a=arguments.length,c=new Array(a),l=0;l<a;l++)c[l]=arguments[l];return bl(this.canvas,n,i,!0)||setTimeout(function(){var n=mu(c,t,s);e(s.canvas,{type:Nl["2D"],property:o,args:n})},0),r.apply(this,c)}});s.push(a)}catch(l){var c=Al(t.CanvasRenderingContext2D.prototype,o,{set:function(t){e(this.canvas,{type:Nl["2D"],property:o,args:[t],setter:!0})}});s.push(c)}},s=[],a=Qe(Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype));!(r=a()).done;)o();return function(){s.forEach(function(e){return e()})}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,i){var r,o,s=[];return(r=s).push.apply(r,[].concat(yu(t.WebGLRenderingContext.prototype,Nl.WebGL,e,n,i,t))),void 0!==t.WebGL2RenderingContext&&(o=s).push.apply(o,[].concat(yu(t.WebGL2RenderingContext.prototype,Nl.WebGL2,e,n,i,t))),function(){s.forEach(function(e){return e()})}}(this.processMutation.bind(this),e,t,n);this.resetObservers=function(){i(),r(),o()}},t.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},t.startRAFTimestamping=function(){var e=this,t=function(n){e.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)},t.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach(function(t,n){var i=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,i)}),requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},t.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var i=n.map(function(e){return e.type,Be(e,["type"])}),r=n[0].type;this.mutationCb({id:t,type:r,commands:i}),this.pendingCanvasMutations.delete(e)}}},e}(),Iu=function(){function e(e){Le(this,"trackedLinkElements",new WeakSet),Le(this,"mutationCb"),Le(this,"adoptedStyleSheetCb"),Le(this,"styleMirror",new Bl),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}var t=e.prototype;return t.attachLinkElement=function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)},t.trackLinkElement=function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))},t.adoptStyleSheets=function(e,t){var n,i=function(){var e=r.value,t=void 0;n.styleMirror.has(e)?t=n.styleMirror.getId(e):(t=n.styleMirror.add(e),s.push({styleId:t,rules:Array.from(e.rules||CSSRule,function(t,n){return{rule:$e(t,e.href),index:n}})})),o.styleIds.push(t)};if(0!==e.length){for(var r,o={id:t,styleIds:[]},s=[],a=Qe(e);!(r=a()).done;)n=this,i();s.length>0&&(o.styles=s),this.adoptedStyleSheetCb(o)}},t.reset=function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet},t.trackStylesheetInLinkElement=function(e){},e}(),Eu=function(){function e(){Le(this,"nodeMap",new WeakMap),Le(this,"active",!1)}var t=e.prototype;return t.inOtherBuffer=function(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some(function(e){return e!==t})},t.add=function(e,t){var n=this;this.active||(this.active=!0,requestAnimationFrame(function(){n.nodeMap=new WeakMap,n.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))},t.destroy=function(){},e}(),Mu=!1;try{if(2!==Array.from([1],function(e){return 2*e})[0]){var Du=document.createElement("iframe");document.body.appendChild(Du),Array.from=(null==(Ne=Du.contentWindow)?void 0:Ne.Array.from)||Array.from,document.body.removeChild(Du)}}catch(wU){}var Qu,Uu,Fu=new et;function Nu(e){void 0===e&&(e={});var t=e.emit,n=e.checkoutEveryNms,i=e.checkoutEveryNth,r=e.blockClass,o=void 0===r?"rr-block":r,s=e.blockSelector,a=void 0===s?null:s,c=e.ignoreClass,l=void 0===c?"rr-ignore":c,u=e.ignoreSelector,d=void 0===u?null:u,h=e.maskTextClass,A=void 0===h?"rr-mask":h,p=e.maskTextSelector,m=void 0===p?null:p,f=e.inlineStylesheet,g=void 0===f||f,y=e.maskAllInputs,b=e.maskInputOptions,w=e.slimDOMOptions,v=e.maskInputFn,k=e.maskTextFn,x=e.hooks,C=e.packFn,S=e.sampling,B=void 0===S?{}:S,I=e.dataURLOptions,E=void 0===I?{}:I,M=e.mousemoveWait,D=e.recordDOM,Q=void 0===D||D,U=e.recordCanvas,F=void 0!==U&&U,N=e.recordCrossOriginIframes,T=void 0!==N&&N,L=e.recordAfter,P=void 0===L?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":L,O=e.userTriggeredOnInput,R=void 0!==O&&O,z=e.collectFonts,q=void 0!==z&&z,Y=e.inlineImages,K=void 0!==Y&&Y,H=e.plugins,V=e.keepIframeSrcFn,j=void 0===V?function(){return!1}:V,Z=e.ignoreCSSAttributes,X=void 0===Z?new Set([]):Z,G=e.errorHandler;Ol=G;var W=!T||window.parent===window,J=!1;if(!W)try{window.parent.document&&(J=!1)}catch(ge){J=!0}if(W&&!t)throw new Error("emit function is required");if(!W&&!J)return function(){};void 0!==M&&void 0===B.mousemove&&(B.mousemove=M),Fu.reset();var _,$,ee=!0===y?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0,hidden:!0}:void 0!==b?b:{password:!0},te=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w,headTitleMutations:"all"===w}:w||{};void 0===_&&(_=window),"NodeList"in _&&!_.NodeList.prototype.forEach&&(_.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in _&&!_.DOMTokenList.prototype.forEach&&(_.DOMTokenList.prototype.forEach=Array.prototype.forEach);var ne=0,ie=function(e){for(var t,n=Qe(H||[]);!(t=n()).done;){var i=t.value;i.eventProcessor&&(e=i.eventProcessor(e))}return C&&!J&&(e=C(e)),e};xu=function(e,r){var o,s=e;if(s.timestamp=pl(),!(null==(o=Zl[0])?void 0:o.isFrozen())||s.type===Dl.FullSnapshot||s.type===Dl.IncrementalSnapshot&&s.data.source===Ql.Mutation||Zl.forEach(function(e){return e.unfreeze()}),W)null==t||t(ie(s),r);else if(J){var a={type:"rrweb",event:ie(s),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(s.type===Dl.FullSnapshot)$=s,ne=0;else if(s.type===Dl.IncrementalSnapshot){if(s.data.source===Ql.Mutation&&s.data.isAttachIframe)return;ne++;var c=i&&ne>=i,l=n&&s.timestamp-$.timestamp>n;(c||l)&&Cu(!0)}};for(var re,oe=function(e){xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.Mutation},e)})},se=function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.Scroll},e)})},ae=function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.CanvasMutation},e)})},ce=new Iu({mutationCb:oe,adoptedStyleSheetCb:function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.AdoptedStyleSheet},e)})}}),le=new au({mirror:Fu,mutationCb:oe,stylesheetManager:ce,recordCrossOriginIframes:T,wrappedEmit:xu}),ue=Qe(H||[]);!(re=ue()).done;){var de=re.value;de.getMirror&&de.getMirror({nodeMirror:Fu,crossOriginIframeMirror:le.crossOriginIframeMirror,crossOriginIframeStyleMirror:le.crossOriginIframeStyleMirror})}var he=new Eu;Su=new Bu({recordCanvas:F,mutationCb:ae,win:window,blockClass:o,blockSelector:a,mirror:Fu,sampling:B.canvas,dataURLOptions:E});var Ae=new cu({mutationCb:oe,scrollCb:se,bypassOptions:{blockClass:o,blockSelector:a,maskTextClass:A,maskTextSelector:m,inlineStylesheet:g,maskInputOptions:ee,dataURLOptions:E,maskTextFn:k,maskInputFn:v,recordCanvas:F,inlineImages:K,sampling:B,slimDOMOptions:te,iframeManager:le,stylesheetManager:ce,canvasManager:Su,keepIframeSrcFn:j,processedNodeManager:he},mirror:Fu});Cu=function(e){if(void 0===e&&(e=!1),Q){xu({type:Dl.Meta,data:{href:window.location.href,width:gl(),height:fl()}},e),ce.reset(),Ae.init(),Zl.forEach(function(e){return e.lock()});var t=function(e,t){var n=t||{},i=n.mirror,r=void 0===i?new et:i,o=n.blockClass,s=void 0===o?"rr-block":o,a=n.blockSelector,c=void 0===a?null:a,l=n.maskTextClass,u=void 0===l?"rr-mask":l,d=n.maskTextSelector,h=void 0===d?null:d,A=n.inlineStylesheet,p=void 0===A||A,m=n.inlineImages,f=void 0!==m&&m,g=n.recordCanvas,y=void 0!==g&&g,b=n.maskAllInputs,w=void 0!==b&&b,v=n.maskTextFn,k=n.maskInputFn,x=n.slimDOM,C=void 0!==x&&x,S=n.dataURLOptions,B=n.preserveWhiteSpace,I=n.onSerialize,E=n.onIframeLoad,M=n.iframeLoadTimeout,D=n.onStylesheetLoad,Q=n.stylesheetLoadTimeout,U=n.keepIframeSrcFn;return Dt(e,{doc:e,mirror:r,blockClass:s,blockSelector:c,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===w?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0,hidden:!0}:!1===w?{password:!0}:w,maskTextFn:v,maskInputFn:k,slimDOMOptions:!0===C||"all"===C?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===C,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===C?{}:C,dataURLOptions:S,inlineImages:f,recordCanvas:y,preserveWhiteSpace:B,onSerialize:I,onIframeLoad:E,iframeLoadTimeout:M,onStylesheetLoad:D,stylesheetLoadTimeout:Q,keepIframeSrcFn:void 0===U?function(){return!1}:U,newlyAddedElement:!1})}(document,{mirror:Fu,blockClass:o,blockSelector:a,maskTextClass:A,maskTextSelector:m,inlineStylesheet:g,maskAllInputs:ee,maskTextFn:k,maskInputFn:v,slimDOM:te,dataURLOptions:E,recordCanvas:F,inlineImages:K,onSerialize:function(e){xl(e,Fu)&&le.addIframe(e),Cl(e,Fu)&&ce.trackLinkElement(e),Sl(e)&&Ae.addShadowRoot(cl.shadowRoot(e),document)},onIframeLoad:function(e,t){le.attachIframe(e,t),Ae.observeAttachShadow(e)},onStylesheetLoad:function(e,t){ce.attachLinkElement(e,t)},keepIframeSrcFn:j});if(!t)return console.warn("Failed to snapshot the document");xu({type:Dl.FullSnapshot,data:{node:t,initialOffset:ml(window)}},e),Zl.forEach(function(e){return e.unlock()}),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ce.adoptStyleSheets(document.adoptedStyleSheets,Fu.getId(document))}};try{var pe=[],me=function(e){var t;return jl(iu)({mutationCb:oe,mousemoveCb:function(e,t){return xu({type:Dl.IncrementalSnapshot,data:{source:t,positions:e}})},mouseInteractionCb:function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.MouseInteraction},e)})},scrollCb:se,viewportResizeCb:function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.ViewportResize},e)})},inputCb:function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.Input},e)})},mediaInteractionCb:function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.MediaInteraction},e)})},styleSheetRuleCb:function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.StyleSheetRule},e)})},styleDeclarationCb:function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.StyleDeclaration},e)})},canvasMutationCb:ae,fontCb:function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.Font},e)})},selectionCb:function(e){xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.Selection},e)})},customElementCb:function(e){xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.CustomElement},e)})},blockClass:o,ignoreClass:l,ignoreSelector:d,maskTextClass:A,maskTextSelector:m,maskInputOptions:ee,inlineStylesheet:g,sampling:B,recordDOM:Q,recordCanvas:F,inlineImages:K,userTriggeredOnInput:R,collectFonts:q,doc:e,maskInputFn:v,maskTextFn:k,keepIframeSrcFn:j,blockSelector:a,slimDOMOptions:te,dataURLOptions:E,mirror:Fu,iframeManager:le,stylesheetManager:ce,shadowDomManager:Ae,processedNodeManager:he,canvasManager:Su,ignoreCSSAttributes:X,plugins:(null==(t=null==H?void 0:H.filter(function(e){return e.observer}))?void 0:t.map(function(e){return{observer:e.observer,options:e.options,callback:function(t){return xu({type:Dl.Plugin,data:{plugin:e.name,payload:t}})}}}))||[]},x)};le.addLoadListener(function(e){try{pe.push(me(e.contentDocument))}catch(gd){console.warn(gd)}});var fe=function(){Cu(),pe.push(me(document)),Mu=!0};return"interactive"===document.readyState||"complete"===document.readyState?fe():(pe.push(ll("DOMContentLoaded",function(){xu({type:Dl.DomContentLoaded,data:{}}),"DOMContentLoaded"===P&&fe()})),pe.push(ll("load",function(){xu({type:Dl.Load,data:{}}),"load"===P&&fe()},window))),function(){pe.forEach(function(e){try{e()}catch(gd){String(gd).toLowerCase().includes("cross-origin")||console.warn(gd)}}),he.destroy(),Mu=!1,Ol=void 0}}catch(gd){console.warn(gd)}}Nu.addCustomEvent=function(e,t){if(!Mu)throw new Error("please add custom event after start recording");xu({type:Dl.Custom,data:{tag:e,payload:t}})},Nu.freezePage=function(){Zl.forEach(function(e){return e.freeze()})},Nu.takeFullSnapshot=function(e){if(!Mu)throw new Error("please take full snapshot after start recording");Cu(e)},Nu.mirror=Fu,(Uu=Qu||(Qu={}))[Uu.NotStarted=0]="NotStarted",Uu[Uu.Running=1]="Running",Uu[Uu.Stopped=2]="Stopped",Nu.addCustomEvent,Nu.freezePage,Nu.takeFullSnapshot;var Tu=Object.defineProperty,Lu=function(e,t,n){return function(e,t,n){return t in e?Tu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":Ee(t))?t+"":t,n)};var Pu=function(){function e(e){Lu(this,"fileName"),Lu(this,"functionName"),Lu(this,"lineNumber"),Lu(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}return e.prototype.toString=function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t},e}(),Ou=/(^|@)\S+:\d+/,Ru=/^\s*at .*(\S+:\d+|\(native\))/m,zu=/^(eval@)?(\[native code])?$/,qu={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Ru)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Ru)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:i.pop()),o=i.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0];return new Pu({functionName:o,fileName:s,lineNumber:r[1],columnNumber:r[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(zu)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Pu({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(e.replace(t,""));return new Pu({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),i=[],r=2,o=n.length;r<o;r+=2){var s=t.exec(n[r]);s&&i.push(new Pu({fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),i=[],r=0,o=n.length;r<o;r+=2){var s=t.exec(n[r]);s&&i.push(new Pu({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Ou)&&!e.match(/^Error created at/)},this).map(function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Pu({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Yu(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var i=e.parentElement,r=[];if(i.children&&i.children.length>0)for(var o=0;o<i.children.length;o++){var s=i.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===n&&r.push(s)}r.length>1&&(n+=":eq("+r.indexOf(e)+")"),t=n+(t?">"+t:""),e=i}return t}function Ku(e){return"[object Object]"===Object.prototype.toString.call(e)}function Hu(e,t){if(0===t)return!0;for(var n,i=Qe(Object.keys(e));!(n=i()).done;){var r=n.value;if(Ku(e[r])&&Hu(e[r],t-1))return!0}return!1}function Vu(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var i=[],r=[];return JSON.stringify(e,function(e,t){if(i.length>0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?r.splice(o,1/0,e):r.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Ku(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ku(e)&&Hu(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=t.slice(0,n.stringLengthLimit)+"...");return t}(t);if("bigint"===(void 0===t?"undefined":Ee(t)))return t.toString()+"n";if(Se(t,Event)){var s={};for(var a in t){var c=t[a];Array.isArray(c)?s[a]=Yu(c.length?c[0]:null):s[a]=c}return s}return Se(t,Node)?Se(t,HTMLElement)?t?t.outerHTML:"":t.nodeName:Se(t,Error)?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t})}var ju={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Zu(e,t,n){var i,r=n?Object.assign({},ju,n):ju,o=r.logger;if(!o)return function(){};i="string"==typeof o?t[o]:o;var s=0,a=!1,c=[];if(r.level.includes("error")){var l=function(t){var n=t.message,i=t.error,o=qu.parse(i).map(function(e){return e.toString()}),s=[Vu(n,r.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",l),c.push(function(){t.removeEventListener("error",l)});var u=function(t){var n,i;Se(t.reason,Error)?i=[Vu("Uncaught (in promise) "+(n=t.reason).name+": "+n.message,r.stringifyOptions)]:(n=new Error,i=[Vu("Uncaught (in promise)",r.stringifyOptions),Vu(t.reason,r.stringifyOptions)]);var o=qu.parse(n).map(function(e){return e.toString()});e({level:"error",trace:o,payload:i})};t.addEventListener("unhandledrejection",u),c.push(function(){t.removeEventListener("unhandledrejection",u)})}for(var d,h=Qe(r.level);!(d=h()).done;){var A=d.value;c.push(p(i,A))}return function(){c.forEach(function(e){return e()})};function p(t,n){var i=this;return t[n]?function(e,t,n){try{if(!(t in e))return function(){};var i=e[t],r=n(i);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=r,function(){e[t]=i}}catch(o){return function(){}}}(t,n,function(t){var o=i;return function(){for(var i=arguments.length,c=new Array(i),l=0;l<i;l++)c[l]=arguments[l];if(t.apply(o,c),!("assert"===n&&c[0]||a)){a=!0;try{var u=qu.parse(new Error).map(function(e){return e.toString()}).splice(1),d=("assert"===n?c.slice(1):c).map(function(e){return Vu(e,r.stringifyOptions)});++s<r.lengthThreshold?e({level:n,trace:u,payload:d}):s===r.lengthThreshold&&e({level:"warn",trace:[],payload:[Vu("The number of log records reached the threshold.")]})}catch(gd){t.apply(void 0,[].concat(["rrweb logger error:",gd],c))}finally{a=!1}}}}):function(){}}}var Xu,Gu,Wu,Ju=me.setImmediate,_u=Object.prototype.toString,$u=void 0!==Ju?function(e){return Ju(e)}:setTimeout;try{Object.defineProperty({},"x",{}),Xu=function(e,t,n,i){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:!1!==i})}}catch(wU){Xu=function(e,t,n){return e[t]=n,e}}function ed(e,t){Wu.add(e,t),Gu||(Gu=$u(Wu.drain))}function td(e){var t,n=typeof e;return null===e||"object"!==n&&"function"!==n||(t=e.then),"function"==typeof t&&t}function nd(){for(var e=0;e<this.chain.length;e++)id(this,1===this.state?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function id(e,t,n){var i,r;try{!1===t?n.reject(e.msg):(i=!0===t?e.msg:t.call(void 0,e.msg))===n.promise?n.reject(TypeError("Promise-chain cycle")):(r=td(i))?r.call(i,n.resolve,n.reject):n.resolve(i)}catch(wU){n.reject(wU)}}function rd(e){var t,n=this;if(!n.triggered){n.triggered=!0,n.def&&(n=n.def);try{(t=td(e))?ed(function(){var i=new ad(n);try{t.call(e,function(){rd.apply(i,arguments)},function(){od.apply(i,arguments)})}catch(wU){od.call(i,wU)}}):(n.msg=e,n.state=1,n.chain.length>0&&ed(nd,n))}catch(wU){od.call(new ad(n),wU)}}}function od(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&ed(nd,t))}function sd(e,t,n,i){for(var r=0;r<t.length;r++)(function(r){e.resolve(t[r]).then(function(e){n(r,e)},i)})(r)}function ad(e){this.def=e,this.triggered=!1}function cd(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function ld(e){if("function"!=typeof e)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var t=new cd(this);this.then=function(e,n){var i={success:"function"!=typeof e||e,failure:"function"==typeof n&&n};return i.promise=new this.constructor(function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");i.resolve=e,i.reject=t}),t.chain.push(i),0!==t.state&&ed(nd,t),i.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){rd.call(t,e)},function(e){od.call(t,e)})}catch(wU){od.call(t,wU)}}Wu=function(){var e,t,n;function i(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(r,o){n=new i(r,o),t?t.next=n:e=n,t=n,n=void 0},drain:function(){var n=e;for(e=t=Gu=void 0;n;)n.fn.call(n.self),n=n.next}}}();var ud,dd=Xu({},"constructor",ld,!1);ld.prototype=dd,Xu(dd,"__NPO__",0,!1),Xu(ld,"resolve",function(e){return e&&"object"==typeof e&&1===e.__NPO__?e:new this(function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");t(e)})}),Xu(ld,"reject",function(e){return new this(function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");n(e)})}),Xu(ld,"all",function(e){var t=this;return"[object Array]"!==_u.call(e)?t.reject(TypeError("Not an array")):0===e.length?t.resolve([]):new t(function(n,i){if("function"!=typeof n||"function"!=typeof i)throw TypeError("Not a function");var r=e.length,o=Array(r),s=0;sd(t,e,function(e,t){o[e]=t,++s===r&&n(o)},i)})}),Xu(ld,"race",function(e){var t=this;return"[object Array]"!==_u.call(e)?t.reject(TypeError("Not an array")):new t(function(n,i){if("function"!=typeof n||"function"!=typeof i)throw TypeError("Not a function");sd(t,e,function(e,t){n(t)},i)})}),ud="undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")?Promise:ld;var hd,Ad,pd,md,fd,gd,yd,bd,wd,vd,kd={DEBUG:!1,LIB_VERSION:"2.73.0"},xd=864e5,Cd=8e3,Sd=Array.prototype,Bd=Function.prototype,Id=Object.prototype,Ed=Sd.slice,Md=Id.toString,Dd=Id.hasOwnProperty,Qd=me.console,Ud=me.navigator,Fd=me.document,Nd=me.opera,Td=me.screen,Ld=Ud.userAgent,Pd=Bd.bind,Od=Sd.forEach,Rd=Sd.indexOf,zd=Sd.map,qd=Array.isArray,Yd={},Kd={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},Hd={log:function(){if(kd.DEBUG&&!Kd.isUndefined(Qd)&&Qd)try{Qd.log.apply(Qd,arguments)}catch(wU){Kd.each(arguments,function(e){Qd.log(e)})}},warn:function(){if(kd.DEBUG&&!Kd.isUndefined(Qd)&&Qd){var e=["Mixpanel warning:"].concat(Kd.toArray(arguments));try{Qd.warn.apply(Qd,e)}catch(wU){Kd.each(e,function(e){Qd.warn(e)})}}},error:function(){if(kd.DEBUG&&!Kd.isUndefined(Qd)&&Qd){var e=["Mixpanel error:"].concat(Kd.toArray(arguments));try{Qd.error.apply(Qd,e)}catch(wU){Kd.each(e,function(e){Qd.error(e)})}}},critical:function(){if(!Kd.isUndefined(Qd)&&Qd){var e=["Mixpanel error:"].concat(Kd.toArray(arguments));try{Qd.error.apply(Qd,e)}catch(wU){Kd.each(e,function(e){Qd.error(e)})}}}},Vd=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(Hd,arguments)}},jd=function(e){return{log:Vd(Hd.log,e),error:Vd(Hd.error,e),critical:Vd(Hd.critical,e)}},Zd=function(e){return function(){try{return e.apply(this,arguments)}catch(t){Hd.critical("Implementation error. Please turn on debug and contact support@mixpanel.com."),kd.DEBUG&&Hd.critical(t)}}},Xd=function(e){var t=e.prototype;for(var n in t)"function"==typeof t[n]&&(t[n]=Zd(t[n]))};Kd.bind=function(e,t){var n,i;if(Pd&&e.bind===Pd)return Pd.apply(e,Ed.call(arguments,1));if(!Kd.isFunction(e))throw new TypeError;return n=Ed.call(arguments,2),i=function(){if(!(this instanceof i))return e.apply(t,n.concat(Ed.call(arguments)));var r={};r.prototype=e.prototype;var o=new r;r.prototype=null;var s=e.apply(o,n.concat(Ed.call(arguments)));return Object(s)===s?s:o},i},Kd.each=function(e,t,n){if(null!=e)if(Od&&e.forEach===Od)e.forEach(t,n);else if(e.length===+e.length){for(var i=0,r=e.length;i<r;i++)if(i in e&&t.call(n,e[i],i,e)===Yd)return}else for(var o in e)if(Dd.call(e,o)&&t.call(n,e[o],o,e)===Yd)return},Kd.extend=function(e){return Kd.each(Ed.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},Kd.isArray=qd||function(e){return"[object Array]"===Md.call(e)},Kd.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(t){return!1}},Kd.isArguments=function(e){return!(!e||!Dd.call(e,"callee"))},Kd.toArray=function(e){return e?e.toArray?e.toArray():Kd.isArray(e)||Kd.isArguments(e)?Ed.call(e):Kd.values(e):[]},Kd.map=function(e,t,n){if(zd&&e.map===zd)return e.map(t,n);var i=[];return Kd.each(e,function(e){i.push(t.call(n,e))}),i},Kd.keys=function(e){var t=[];return null===e||Kd.each(e,function(e,n){t[t.length]=n}),t},Kd.values=function(e){var t=[];return null===e||Kd.each(e,function(e){t[t.length]=e}),t},Kd.include=function(e,t){var n=!1;return null===e?n:Rd&&e.indexOf===Rd?-1!=e.indexOf(t):(Kd.each(e,function(e){if(n||(n=e===t))return Yd}),n)},Kd.includes=function(e,t){return-1!==e.indexOf(t)},Kd.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},Kd.isObject=function(e){return e===Object(e)&&!Kd.isArray(e)},Kd.isEmptyObject=function(e){if(Kd.isObject(e)){for(var t in e)if(Dd.call(e,t))return!1;return!0}return!1},Kd.isUndefined=function(e){return void 0===e},Kd.isString=function(e){return"[object String]"==Md.call(e)},Kd.isDate=function(e){return"[object Date]"==Md.call(e)},Kd.isNumber=function(e){return"[object Number]"==Md.call(e)},Kd.isElement=function(e){return!(!e||1!==e.nodeType)},Kd.encodeDates=function(e){return Kd.each(e,function(t,n){Kd.isDate(t)?e[n]=Kd.formatDate(t):Kd.isObject(t)&&(e[n]=Kd.encodeDates(t))}),e},Kd.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Kd.formatDate=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},Kd.strip_empty_properties=function(e){var t={};return Kd.each(e,function(e,n){Kd.isString(e)&&e.length>0&&(t[n]=e)}),t},Kd.truncate=function(e,t){var n;return"string"==typeof e?n=e.slice(0,t):Kd.isArray(e)?(n=[],Kd.each(e,function(e){n.push(Kd.truncate(e,t))})):Kd.isObject(e)?(n={},Kd.each(e,function(e,i){n[i]=Kd.truncate(e,t)})):n=e,n},Kd.JSONEncode=function(){return function(e){var t=function(e){var t=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,function(e){var t=n[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'},n=function(e,i){var r="",o=0,s="",a="",c=0,l=r,u=[],d=i[e];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(e)),typeof d){case"string":return t(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(r+=" ",u=[],"[object Array]"===Md.apply(d)){for(c=d.length,o=0;o<c;o+=1)u[o]=n(o,d)||"null";return a=0===u.length?"[]":r?"[\n"+r+u.join(",\n"+r)+"\n"+l+"]":"["+u.join(",")+"]",r=l,a}for(s in d)Dd.call(d,s)&&(a=n(s,d))&&u.push(t(s)+(r?": ":":")+a);return a=0===u.length?"{}":r?"{"+u.join(",")+l+"}":"{"+u.join(",")+"}",r=l,a}};return n("",{"":e})}}(),Kd.JSONDecode=(fd={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},gd=function(e){var t=new SyntaxError(e);throw t.at=hd,t.text=pd,t},yd=function(e){return e&&e!==Ad&&gd("Expected '"+e+"' instead of '"+Ad+"'"),Ad=pd.charAt(hd),hd+=1,Ad},bd=function(){var e,t="";for("-"===Ad&&(t="-",yd("-"));Ad>="0"&&Ad<="9";)t+=Ad,yd();if("."===Ad)for(t+=".";yd()&&Ad>="0"&&Ad<="9";)t+=Ad;if("e"===Ad||"E"===Ad)for(t+=Ad,yd(),"-"!==Ad&&"+"!==Ad||(t+=Ad,yd());Ad>="0"&&Ad<="9";)t+=Ad,yd();if(e=+t,isFinite(e))return e;gd("Bad number")},wd=function(){var e,t,n,i="";if('"'===Ad)for(;yd();){if('"'===Ad)return yd(),i;if("\\"===Ad)if(yd(),"u"===Ad){for(n=0,t=0;t<4&&(e=parseInt(yd(),16),isFinite(e));t+=1)n=16*n+e;i+=String.fromCharCode(n)}else{if("string"!=typeof fd[Ad])break;i+=fd[Ad]}else i+=Ad}gd("Bad string")},vd=function(){for(;Ad&&Ad<=" ";)yd()},md=function(){switch(vd(),Ad){case"{":return function(){var e,t={};if("{"===Ad){if(yd("{"),vd(),"}"===Ad)return yd("}"),t;for(;Ad;){if(e=wd(),vd(),yd(":"),Object.hasOwnProperty.call(t,e)&&gd('Duplicate key "'+e+'"'),t[e]=md(),vd(),"}"===Ad)return yd("}"),t;yd(","),vd()}}gd("Bad object")}();case"[":return function(){var e=[];if("["===Ad){if(yd("["),vd(),"]"===Ad)return yd("]"),e;for(;Ad;){if(e.push(md()),vd(),"]"===Ad)return yd("]"),e;yd(","),vd()}}gd("Bad array")}();case'"':return wd();case"-":return bd();default:return Ad>="0"&&Ad<="9"?bd():function(){switch(Ad){case"t":return yd("t"),yd("r"),yd("u"),yd("e"),!0;case"f":return yd("f"),yd("a"),yd("l"),yd("s"),yd("e"),!1;case"n":return yd("n"),yd("u"),yd("l"),yd("l"),null}gd('Unexpected "'+Ad+'"')}()}},function(e){var t;return pd=e,hd=0,Ad=" ",t=md(),vd(),Ad&&gd("Syntax error"),t}),Kd.base64Encode=function(e){var t,n,i,r,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,c=0,l="",u=[];if(!e)return e;e=Kd.utf8Encode(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,i=o>>6&63,r=63&o,u[c++]=s.charAt(t)+s.charAt(n)+s.charAt(i)+s.charAt(r)}while(a<e.length);switch(l=u.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l},Kd.utf8Encode=function(e){var t,n,i,r,o="";for(t=n=0,i=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,r=0;r<i;r++){var s=e.charCodeAt(r),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(n>t&&(o+=e.substring(t,n)),o+=a,t=n=r+1)}return n>t&&(o+=e.substring(t,e.length)),o},Kd.UUID=function(){try{return me.crypto.randomUUID()}catch(wU){for(var e=new Array(36),t=0;t<36;t++)e[t]=Math.floor(16*Math.random());return e[14]=4,e[19]=e[19]&=-5,e[19]=e[19]|=8,e[8]=e[13]=e[18]=e[23]="-",Kd.map(e,function(e){return e.toString(16)}).join("")}};var Gd=["ahrefsbot","ahrefssiteaudit","amazonbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandex","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];Kd.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<Gd.length;t++)if(-1!==e.indexOf(Gd[t]))return!0;return!1},Kd.HTTPBuildQuery=function(e,t){var n,i,r=[];return Kd.isUndefined(t)&&(t="&"),Kd.each(e,function(e,t){n=encodeURIComponent(e.toString()),i=encodeURIComponent(t),r[r.length]=i+"="+n}),r.join(t)},Kd.getQueryParam=function(e,t){t=t.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var n=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);if(null===n||n&&"string"!=typeof n[1]&&n[1].length)return"";var i=n[1];try{i=decodeURIComponent(i)}catch(wU){Hd.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},Kd.cookie={get:function(e){for(var t=e+"=",n=Fd.cookie.split(";"),i=0;i<n.length;i++){for(var r=n[i];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}return null},parse:function(e){var t;try{t=Kd.JSONDecode(Kd.cookie.get(e))||{}}catch(wU){}return t},set_seconds:function(e,t,n,i,r,o,s){var a="",c="",l="";if(s)a="; domain="+s;else if(i){var u=ah(Fd.location.hostname);a=u?"; domain=."+u:""}if(n){var d=new Date;d.setTime(d.getTime()+1e3*n),c="; expires="+d.toGMTString()}o&&(r=!0,l="; SameSite=None"),r&&(l+="; secure"),Fd.cookie=e+"="+encodeURIComponent(t)+c+"; path=/"+a+l},set:function(e,t,n,i,r,o,s){var a="",c="",l="";if(s)a="; domain="+s;else if(i){var u=ah(Fd.location.hostname);a=u?"; domain=."+u:""}if(n){var d=new Date;d.setTime(d.getTime()+24*n*60*60*1e3),c="; expires="+d.toGMTString()}o&&(r=!0,l="; SameSite=None"),r&&(l+="; secure");var h=e+"="+encodeURIComponent(t)+c+"; path=/"+a+l;return Fd.cookie=h,h},remove:function(e,t,n){Kd.cookie.set(e,"",-1,t,!1,!1,n)}};var Wd=function(e){var t=!0;try{var n="__mplss_"+rh(8);e.setItem(n,"xyz"),"xyz"!==e.getItem(n)&&(t=!1),e.removeItem(n)}catch(wU){t=!1}return t},Jd=null,_d=function(e,t){return null===Jd||t?Jd=Wd(e||me.localStorage):Jd},$d=null;function eh(e,t,n){var i=function(e){Hd.error(t+" error: "+e)};return{is_supported:function(i){var r=n(e,i);return r||Hd.error(t+" unsupported"),r},error:i,get:function(t){try{return e.getItem(t)}catch(wU){i(wU)}return null},parse:function(t){try{return Kd.JSONDecode(e.getItem(t))||{}}catch(wU){}return null},set:function(t,n){try{e.setItem(t,n)}catch(wU){i(wU)}},remove:function(t){try{e.removeItem(t)}catch(wU){i(wU)}}}}Kd.localStorage=eh(me.localStorage,"localStorage",_d),Kd.sessionStorage=eh(me.sessionStorage,"sessionStorage",function(e,t){return null===$d||t?$d=Wd(e||me.sessionStorage):$d}),Kd.register_event=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,i,r,o){if(t)if(t.addEventListener&&!r)t.addEventListener(n,i,!!o);else{var s="on"+n,a=t[s];t[s]=function(t,n,i){var r=function(r){if(r=r||e(me.event)){var o,s,a=!0;return Kd.isFunction(i)&&(o=i(r)),s=n.call(t,r),!1!==o&&!1!==s||(a=!1),a}};return r}(t,i,a)}else Hd.error("No valid element provided to register_event")}}();var th=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');Kd.dom_query=function(){function e(e){return e.all?e.all:e.getElementsByTagName("*")}var t=/[\t\r\n]/g;function n(e,n){var i=" "+n+" ";return(" "+e.className+" ").replace(t," ").indexOf(i)>=0}function i(t){if(!Fd.getElementsByTagName)return[];var i,r,o,s,a,c,l,u,d,h,A=t.split(" "),p=[Fd];for(c=0;c<A.length;c++)if((i=A[c].replace(/^\s+/,"").replace(/\s+$/,"")).indexOf("#")>-1){o=(r=i.split("#"))[0];var m=r[1],f=Fd.getElementById(m);if(!f||o&&f.nodeName.toLowerCase()!=o)return[];p=[f]}else if(i.indexOf(".")>-1){o=(r=i.split("."))[0];var g=r[1];for(o||(o="*"),s=[],a=0,l=0;l<p.length;l++)for(d="*"==o?e(p[l]):p[l].getElementsByTagName(o),u=0;u<d.length;u++)s[a++]=d[u];for(p=[],h=0,l=0;l<s.length;l++)s[l].className&&Kd.isString(s[l].className)&&n(s[l],g)&&(p[h++]=s[l])}else{var y=i.match(th);if(y){o=y[1];var b,w=y[2],v=y[3],k=y[4];for(o||(o="*"),s=[],a=0,l=0;l<p.length;l++)for(d="*"==o?e(p[l]):p[l].getElementsByTagName(o),u=0;u<d.length;u++)s[a++]=d[u];switch(p=[],h=0,v){case"=":b=function(e){return e.getAttribute(w)==k};break;case"~":b=function(e){return e.getAttribute(w).match(new RegExp("\\b"+k+"\\b"))};break;case"|":b=function(e){return e.getAttribute(w).match(new RegExp("^"+k+"-?"))};break;case"^":b=function(e){return 0===e.getAttribute(w).indexOf(k)};break;case"$":b=function(e){return e.getAttribute(w).lastIndexOf(k)==e.getAttribute(w).length-k.length};break;case"*":b=function(e){return e.getAttribute(w).indexOf(k)>-1};break;default:b=function(e){return e.getAttribute(w)}}for(p=[],h=0,l=0;l<s.length;l++)b(s[l])&&(p[h++]=s[l])}else{for(o=i,s=[],a=0,l=0;l<p.length;l++)for(d=p[l].getElementsByTagName(o),u=0;u<d.length;u++)s[a++]=d[u];p=s}}return p}return function(e){return Kd.isElement(e)?[e]:Kd.isObject(e)&&!Kd.isUndefined(e.length)?e:i.call(this,e)}}();var nh=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],ih=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];Kd.info={campaignParams:function(e){var t="",n={};return Kd.each(nh,function(i){(t=Kd.getQueryParam(Fd.URL,i)).length?n[i]=t:void 0!==e&&(n[i]=e)}),n},clickParams:function(){var e="",t={};return Kd.each(ih,function(n){(e=Kd.getQueryParam(Fd.URL,n)).length&&(t[n]=e)}),t},marketingParams:function(){return Kd.extend(Kd.info.campaignParams(),Kd.info.clickParams())},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=Kd.info.searchEngine(e),n="yahoo"!=t?"q":"p",i={};if(null!==t){i.$search_engine=t;var r=Kd.getQueryParam(e,n);r.length&&(i.mp_keyword=r)}return i},browser:function(e,t,n){return t=t||"",n||Kd.includes(e," OPR/")?Kd.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":Kd.includes(e,"IEMobile")||Kd.includes(e,"WPDesktop")?"Internet Explorer Mobile":Kd.includes(e,"SamsungBrowser/")?"Samsung Internet":Kd.includes(e,"Edge")||Kd.includes(e,"Edg/")?"Microsoft Edge":Kd.includes(e,"FBIOS")?"Facebook Mobile":Kd.includes(e,"Whale/")?"Whale Browser":Kd.includes(e,"Chrome")?"Chrome":Kd.includes(e,"CriOS")?"Chrome iOS":Kd.includes(e,"UCWEB")||Kd.includes(e,"UCBrowser")?"UC Browser":Kd.includes(e,"FxiOS")?"Firefox iOS":Kd.includes(t,"Apple")?Kd.includes(e,"Mobile")?"Mobile Safari":"Safari":Kd.includes(e,"Android")?"Android Mobile":Kd.includes(e,"Konqueror")?"Konqueror":Kd.includes(e,"Firefox")?"Firefox":Kd.includes(e,"MSIE")||Kd.includes(e,"Trident/")?"Internet Explorer":Kd.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/,"Whale Browser":/Whale\/(\d+(\.\d+)?)/}[Kd.info.browser(e,t,n)];if(void 0===i)return null;var r=e.match(i);return r?parseFloat(r[r.length-2]):null},os:function(){var e=Ld;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return me.location.href},properties:function(e){return"object"!=typeof e&&(e={}),Kd.extend(Kd.strip_empty_properties({$os:Kd.info.os(),$browser:Kd.info.browser(Ld,Ud.vendor,Nd),$referrer:Fd.referrer,$referring_domain:Kd.info.referringDomain(Fd.referrer),$device:Kd.info.device(Ld)}),{$current_url:Kd.info.currentUrl(),$browser_version:Kd.info.browserVersion(Ld,Ud.vendor,Nd),$screen_height:Td.height,$screen_width:Td.width,mp_lib:"web",$lib_version:kd.LIB_VERSION,$insert_id:rh(),time:Kd.timestamp()/1e3},Kd.strip_empty_properties(e))},people_properties:function(){return Kd.extend(Kd.strip_empty_properties({$os:Kd.info.os(),$browser:Kd.info.browser(Ld,Ud.vendor,Nd)}),{$browser_version:Kd.info.browserVersion(Ld,Ud.vendor,Nd)})},mpPageViewProperties:function(){return Kd.strip_empty_properties({current_page_title:Fd.title,current_domain:me.location.hostname,current_url_path:me.location.pathname,current_url_protocol:me.location.protocol,current_url_search:me.location.search})}};var rh=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},oh=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,sh=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,ah=function(e){var t=sh,n=e.split("."),i=n[n.length-1];(i.length>4||"com"===i||"org"===i)&&(t=oh);var r=e.match(t);return r?r[0]:""},ch=function(){},lh=null,uh=null;"undefined"!=typeof JSON&&(lh=JSON.stringify,uh=JSON.parse),lh=lh||Kd.JSONEncode,uh=uh||Kd.JSONDecode;Kd.info=Kd.info,Kd.info.browser=Kd.info.browser,Kd.info.browserVersion=Kd.info.browserVersion,Kd.info.device=Kd.info.device,Kd.info.properties=Kd.info.properties,Kd.isBlockedUA=Kd.isBlockedUA,Kd.isEmptyObject=Kd.isEmptyObject,Kd.isObject=Kd.isObject,Kd.JSONDecode=Kd.JSONDecode,Kd.JSONEncode=Kd.JSONEncode,Kd.toArray=Kd.toArray,Kd.NPO=ld;var dh="mixpanelRecordingEvents",hh="mixpanelRecordingRegistry",Ah=[dh,hh],ph=function(e){this.dbPromise=null,this.storeName=e};ph.prototype._openDb=function(){return new ud(function(e,t){var n=me.indexedDB.open("mixpanelBrowserDb",1);n.onerror=function(){t(n.error)},n.onsuccess=function(){e(n.result)},n.onupgradeneeded=function(e){var t=e.target.result;Ah.forEach(function(e){t.createObjectStore(e)})}})},ph.prototype.init=function(){return me.indexedDB?(this.dbPromise||(this.dbPromise=this._openDb()),this.dbPromise.then(function(e){return e instanceof me.IDBDatabase?ud.resolve():ud.reject(e)})):ud.reject("indexedDB is not supported in this browser")},ph.prototype.isInitialized=function(){return!!this.dbPromise},ph.prototype.makeTransaction=function(e,t){var n=this.storeName,i=function(i){return new ud(function(r,o){var s=i.transaction(n,e);s.oncomplete=function(){r(s)},s.onabort=s.onerror=function(){o(s.error)},t(s.objectStore(n))})};return this.dbPromise.then(i).catch(function(e){return e&&"InvalidStateError"===e.name?(this.dbPromise=this._openDb(),this.dbPromise.then(i)):ud.reject(e)}.bind(this))},ph.prototype.setItem=function(e,t){return this.makeTransaction("readwrite",function(n){n.put(t,e)})},ph.prototype.getItem=function(e){var t;return this.makeTransaction("readonly",function(n){t=n.get(e)}).then(function(){return t.result})},ph.prototype.removeItem=function(e){return this.makeTransaction("readwrite",function(t){t.delete(e)})},ph.prototype.getAll=function(){var e;return this.makeTransaction("readonly",function(t){e=t.getAll()}).then(function(){return e.result})};function mh(e,t){Bh(!0,e,t)}function fh(e,t){Bh(!1,e,t)}function gh(e,t){return"1"===Sh(e,t)}function yh(e,t){if(function(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||me,n=t.navigator||{},i=!1;return Kd.each([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],function(e){Kd.includes([!0,1,"1","yes"],e)&&(i=!0)}),i}(t))return Hd.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var n="0"===Sh(e,t);return n&&Hd.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function bh(e){return Ih(e,function(e){return this.get_config(e)})}function wh(e){return Ih(e,function(e){return this._get_config(e)})}function vh(e){return Ih(e,function(e){return this._get_config(e)})}function kh(e,t){xh(t=t||{}).remove(Ch(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function xh(e){return"localStorage"===(e=e||{}).persistenceType?Kd.localStorage:Kd.cookie}function Ch(e,t){return((t=t||{}).persistencePrefix||"__mp_opt_in_out_")+e}function Sh(e,t){return xh(t).get(Ch(e,t))}function Bh(e,t,n){Kd.isString(t)&&t.length?(xh(n=n||{}).set(Ch(t,n),e?1:0,Kd.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})):Hd.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function Ih(e,t){return function(){var n=!1;try{var i=t.call(this,"token"),r=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),s=t.call(this,"opt_out_tracking_cookie_prefix"),a=t.call(this,"window");i&&(n=yh(i,{ignoreDnt:r,persistenceType:o,persistencePrefix:s,window:a}))}catch(wU){Hd.error("Unexpected error when checking tracking opt-out status: "+wU)}if(!n)return e.apply(this,arguments);var c=arguments[arguments.length-1];"function"==typeof c&&c(0)}}var Eh=jd("lock"),Mh=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||me.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3,this.promiseImpl=t.promiseImpl||ud};Mh.prototype.withLock=function(e,t){return new(0,this.promiseImpl)(Kd.bind(function(n,i){var r=t||(new Date).getTime()+"|"+Math.random(),o=(new Date).getTime(),s=this.storageKey,a=this.pollIntervalMS,c=this.timeoutMS,l=this.storage,u=s+":X",d=s+":Y",h=s+":Z",A=function(e){if((new Date).getTime()-o>c)return Eh.error("Timeout waiting for mutex on "+s+"; clearing lock. ["+r+"]"),l.removeItem(h),l.removeItem(d),void f();setTimeout(function(){try{e()}catch(wU){i(wU)}},a*(Math.random()+.1))},p=function(e,t){e()?t():A(function(){p(e,t)})},m=function(){var e=l.getItem(d);return(!e||e===r)&&(l.setItem(d,r),l.getItem(d)===r||(_d(l,!0)||i(new Error("localStorage support dropped while acquiring lock")),!1))},f=function(){l.setItem(u,r),p(m,function(){l.getItem(u)!==r?A(function(){l.getItem(d)===r?p(function(){return!l.getItem(h)},g):f()}):g()})},g=function(){l.setItem(h,"1");var t=function(){l.removeItem(h),l.getItem(d)===r&&l.removeItem(d),l.getItem(u)===r&&l.removeItem(u)};e().then(function(e){t(),n(e)}).catch(function(e){t(),i(e)})};try{if(!_d(l,!0))throw new Error("localStorage support check failed");f()}catch(wU){i(wU)}},this))};var Dh=function(e){this.storage=e||me.localStorage};Dh.prototype.init=function(){return ud.resolve()},Dh.prototype.isInitialized=function(){return!0},Dh.prototype.setItem=function(e,t){return new ud(Kd.bind(function(n,i){try{this.storage.setItem(e,lh(t))}catch(r){i(r)}n()},this))},Dh.prototype.getItem=function(e){return new ud(Kd.bind(function(t,n){var i;try{i=uh(this.storage.getItem(e))}catch(r){n(r)}t(i)},this))},Dh.prototype.removeItem=function(e){return new ud(Kd.bind(function(t,n){try{this.storage.removeItem(e)}catch(i){n(i)}t()},this))};var Qh=jd("batch"),Uh=function(e,t){var n,i,r,o;t=t||{},this.storageKey=e,this.usePersistence=t.usePersistence,this.usePersistence&&(this.queueStorage=t.queueStorage||new Dh,this.lock=new Mh(e,{storage:t.sharedLockStorage||me.localStorage,timeoutMS:t.sharedLockTimeoutMS})),this.reportError=t.errorReporter||Kd.bind(Qh.error,Qh),this.pid=t.pid||null,this.memQueue=[],this.initialized=!1,t.enqueueThrottleMs?this.enqueuePersisted=(n=Kd.bind(this._enqueuePersisted,this),i=t.enqueueThrottleMs,r=null,o=[],function(e){var t=this;return o.push(e),r||(r=new ud(function(e){setTimeout(function(){var i=n.apply(t,[o]);r=null,o=[],e(i)},i)})),r}):this.enqueuePersisted=Kd.bind(function(e){return this._enqueuePersisted([e])},this)};Uh.prototype.ensureInit=function(){return this.initialized||!this.usePersistence?ud.resolve():this.queueStorage.init().then(Kd.bind(function(){this.initialized=!0},this)).catch(Kd.bind(function(e){this.reportError("Error initializing queue persistence. Disabling persistence",e),this.initialized=!0,this.usePersistence=!1},this))},Uh.prototype.enqueue=function(e,t){var n={id:rh(),flushAfter:(new Date).getTime()+2*t,payload:e};return this.usePersistence?this.enqueuePersisted(n):(this.memQueue.push(n),ud.resolve(!0))},Uh.prototype._enqueuePersisted=function(e){var t=Kd.bind(function(){return this.ensureInit().then(Kd.bind(function(){return this.readFromStorage()},this)).then(Kd.bind(function(t){return this.saveToStorage(t.concat(e))},this)).then(Kd.bind(function(t){return t&&(this.memQueue=this.memQueue.concat(e)),t},this)).catch(Kd.bind(function(t){return this.reportError("Error enqueueing items",t,e),!1},this))},this);return this.lock.withLock(t,this.pid).catch(Kd.bind(function(e){return this.reportError("Error acquiring storage lock",e),!1},this))},Uh.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);return this.usePersistence&&t.length<e?this.ensureInit().then(Kd.bind(function(){return this.readFromStorage()},this)).then(Kd.bind(function(n){if(n.length){var i={};Kd.each(t,function(e){i[e.id]=!0});for(var r=0;r<n.length;r++){var o=n[r];if((new Date).getTime()>o.flushAfter&&!i[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}return t},this)):ud.resolve(t)};var Fh=function(e,t){var n=[];return Kd.each(e,function(e){e.id&&!t[e.id]&&n.push(e)}),n};Uh.prototype.removeItemsByID=function(e){var t={};if(Kd.each(e,function(e){t[e]=!0}),this.memQueue=Fh(this.memQueue,t),this.usePersistence){var n=Kd.bind(function(){return this.ensureInit().then(Kd.bind(function(){return this.readFromStorage()},this)).then(Kd.bind(function(e){return e=Fh(e,t),this.saveToStorage(e)},this)).then(Kd.bind(function(){return this.readFromStorage()},this)).then(Kd.bind(function(e){for(var n=0;n<e.length;n++){var i=e[n];if(i.id&&t[i.id])throw new Error("Item not removed from storage")}return!0},this)).catch(Kd.bind(function(t){return this.reportError("Error removing items",t,e),!1},this))},this);return this.lock.withLock(n,this.pid).catch(Kd.bind(function(e){return this.reportError("Error acquiring storage lock",e),!_d(this.lock.storage,!0)&&n().then(Kd.bind(function(e){return e||this.queueStorage.removeItem(this.storageKey).then(function(){return e})},this)).catch(Kd.bind(function(e){return this.reportError("Error clearing queue",e),!1},this))},this))}return ud.resolve(!0)};var Nh=function(e,t){var n=[];return Kd.each(e,function(e){var i=e.id;if(i in t){var r=t[i];null!==r&&(e.payload=r,n.push(e))}else n.push(e)}),n};Uh.prototype.updatePayloads=function(e){return this.memQueue=Nh(this.memQueue,e),this.usePersistence?this.lock.withLock(Kd.bind(function(){return this.ensureInit().then(Kd.bind(function(){return this.readFromStorage()},this)).then(Kd.bind(function(t){return t=Nh(t,e),this.saveToStorage(t)},this)).catch(Kd.bind(function(t){return this.reportError("Error updating items",e,t),!1},this))},this),this.pid).catch(Kd.bind(function(e){return this.reportError("Error acquiring storage lock",e),!1},this)):ud.resolve(!0)},Uh.prototype.readFromStorage=function(){return this.ensureInit().then(Kd.bind(function(){return this.queueStorage.getItem(this.storageKey)},this)).then(Kd.bind(function(e){return e&&(Kd.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null)),e||[]},this)).catch(Kd.bind(function(e){return this.reportError("Error retrieving queue",e),[]},this))},Uh.prototype.saveToStorage=function(e){return this.ensureInit().then(Kd.bind(function(){return this.queueStorage.setItem(this.storageKey,e)},this)).then(function(){return!0}).catch(Kd.bind(function(e){return this.reportError("Error saving queue",e),!1},this))},Uh.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(Kd.bind(function(){return this.queueStorage.removeItem(this.storageKey)},this)):ud.resolve()};var Th=jd("batch"),Lh=function(e,t){this.errorReporter=t.errorReporter,this.queue=new Uh(e,{errorReporter:Kd.bind(this.reportError,this),queueStorage:t.queueStorage,sharedLockStorage:t.sharedLockStorage,sharedLockTimeoutMS:t.sharedLockTimeoutMS,usePersistence:t.usePersistence,enqueueThrottleMs:t.enqueueThrottleMs}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=t.flushOnlyOnInterval||!1,this._flushPromise=null};Lh.prototype.enqueue=function(e){return this.queue.enqueue(e,this.flushInterval)},Lh.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},Lh.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},Lh.prototype.clear=function(){return this.queue.clear()},Lh.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},Lh.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},Lh.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(Kd.bind(function(){this.stopped||(this._flushPromise=this.flush())},this),this.flushInterval))},Lh.prototype.sendRequestPromise=function(e,t){return new ud(Kd.bind(function(n){this.sendRequest(e,t,n)},this))},Lh.prototype.flush=function(e){if(this.requestInProgress)return Th.log("Flush: Request already in progress"),ud.resolve();this.requestInProgress=!0,e=e||{};var t=this.libConfig.batch_request_timeout_ms,n=(new Date).getTime(),i=this.batchSize;return this.queue.fillBatch(i).then(Kd.bind(function(r){var o=r.length===i,s=[],a={};if(Kd.each(r,function(e){var t=e.payload;if(this.beforeSendHook&&!e.orphaned&&(t=this.beforeSendHook(t)),t){t.event&&t.properties&&(t.properties=Kd.extend({},t.properties,{mp_sent_by_lib_version:kd.LIB_VERSION}));var n=!0,i=e.id;i?(this.itemIdsSentSuccessfully[i]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:e,batchSize:r.length,timesSent:this.itemIdsSentSuccessfully[i]}),n=!1):this.reportError("[dupe] found item with no ID",{item:e}),n&&s.push(t)}a[e.id]=t},this),s.length<1)return this.requestInProgress=!1,this.resetFlush(),ud.resolve();var c=Kd.bind(function(){return this.queue.removeItemsByID(Kd.map(r,function(e){return e.id})).then(Kd.bind(function(e){return Kd.each(r,Kd.bind(function(e){var t=e.id;t?(this.itemIdsSentSuccessfully[t]=this.itemIdsSentSuccessfully[t]||0,this.itemIdsSentSuccessfully[t]++,this.itemIdsSentSuccessfully[t]>5&&this.reportError("[dupe] item ID sent too many times",{item:e,batchSize:r.length,timesSent:this.itemIdsSentSuccessfully[t]})):this.reportError("[dupe] found item with no ID while removing",{item:e})},this)),e?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!o?(this.resetFlush(),ud.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),ud.resolve())},this))},this),l=Kd.bind(function(o){this.requestInProgress=!1;try{if(e.unloading)return this.queue.updatePayloads(a);if(Kd.isObject(o)&&"timeout"===o.error&&(new Date).getTime()-n>=t)return this.reportError("Network timeout; retrying"),this.flush();if(Kd.isObject(o)&&(o.httpStatusCode>=500||429===o.httpStatusCode||o.httpStatusCode<=0&&(u=me.navigator.onLine,!Kd.isUndefined(u)&&!u)||"timeout"===o.error)){var s=2*this.flushInterval;return o.retryAfter&&(s=1e3*parseInt(o.retryAfter,10)||s),s=Math.min(6e5,s),this.reportError("Error; retry in "+s+" ms"),this.scheduleFlush(s),ud.resolve()}if(Kd.isObject(o)&&413===o.httpStatusCode){if(r.length>1){var l=Math.max(1,Math.floor(i/2));return this.batchSize=Math.min(this.batchSize,l,r.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),ud.resolve()}return this.reportError("Single-event request too large; dropping",r),this.resetBatchSize(),c()}return c()}catch(wU){this.reportError("Error handling API response",wU),this.resetFlush()}var u},this),u={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};return e.unloading&&(u.transport="sendBeacon"),Th.log("MIXPANEL REQUEST:",s),this.sendRequestPromise(s,u).then(l)},this)).catch(Kd.bind(function(e){this.reportError("Error flushing request queue",e),this.resetFlush()},this))},Lh.prototype.reportError=function(e,t){if(Th.error.apply(Th.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(n){Th.error(n)}};var Ph=function(e){var t=Date.now();return!e||t>e.maxExpires||t>e.idleExpires},Oh=jd("recorder"),Rh=me.CompressionStream,zh={batch_size:1e3,batch_flush_interval_ms:1e4,batch_request_timeout_ms:9e4,batch_autostart:!0},qh=new Set([Ql.MouseMove,Ql.MouseInteraction,Ql.Scroll,Ql.ViewportResize,Ql.Input,Ql.TouchMove,Ql.MediaInteraction,Ql.Drag,Ql.Selection]);var Yh=function(e){this._mixpanel=e.mixpanelInstance,this._onIdleTimeout=e.onIdleTimeout||ch,this._onMaxLengthReached=e.onMaxLengthReached||ch,this._onBatchSent=e.onBatchSent||ch,this._rrwebRecord=e.rrwebRecord||null,this._stopRecording=null,this.replayId=e.replayId,this.batchStartUrl=e.batchStartUrl||null,this.replayStartUrl=e.replayStartUrl||null,this.idleExpires=e.idleExpires||null,this.maxExpires=e.maxExpires||null,this.replayStartTime=e.replayStartTime||null,this.lastEventTimestamp=e.lastEventTimestamp||null,this.seqNo=e.seqNo||0,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=xd,this.recordMinMs=0;var t=_d(e.sharedLockStorage,!0)&&!this.getConfig("disable_persistence");this.batcherKey="__mprec_"+this.getConfig("name")+"_"+this.getConfig("token")+"_"+this.replayId,this.queueStorage=new ph(dh),this.batcher=new Lh(this.batcherKey,{errorReporter:this.reportError.bind(this),flushOnlyOnInterval:!0,libConfig:zh,sendRequestFunc:this.flushEventsWithOptOut.bind(this),queueStorage:this.queueStorage,sharedLockStorage:e.sharedLockStorage,usePersistence:t,stopAllBatchingFunc:this.stopRecording.bind(this),enqueueThrottleMs:250,sharedLockTimeoutMS:1e4})};Yh.prototype.getUserIdInfo=function(){if(this.finalFlushUserIdInfo)return this.finalFlushUserIdInfo;var e={distinct_id:String(this._mixpanel.get_distinct_id())},t=this._mixpanel.get_property("$device_id");t&&(e.$device_id=t);var n=this._mixpanel.get_property("$user_id");return n&&(e.$user_id=n),e},Yh.prototype.unloadPersistedData=function(){return this.batcher.stop(),this.queueStorage.init().catch(function(){this.reportError("Error initializing IndexedDB storage for unloading persisted data.")}.bind(this)).then(function(){return this.getDurationMs()<this._getRecordMinMs()?this.queueStorage.removeItem(this.batcherKey):this.batcher.flush().then(function(){return this.queueStorage.removeItem(this.batcherKey)}.bind(this))}.bind(this))},Yh.prototype.getConfig=function(e){return this._mixpanel.get_config(e)},Yh.prototype.get_config=function(e){return this.getConfig(e)},Yh.prototype.startRecording=function(e){if(null!==this._rrwebRecord)if(null===this._stopRecording){this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>xd&&(this.recordMaxMs=xd,Oh.critical("record_max_ms cannot be greater than "+xd+"ms. Capping value.")),this.maxExpires||(this.maxExpires=(new Date).getTime()+this.recordMaxMs),this.recordMinMs=this._getRecordMinMs(),this.replayStartTime||(this.replayStartTime=(new Date).getTime(),this.batchStartUrl=Kd.info.currentUrl(),this.replayStartUrl=Kd.info.currentUrl()),e||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var t=function(){clearTimeout(this.idleTimeoutId);var e=this.getConfig("record_idle_timeout_ms");this.idleTimeoutId=setTimeout(this._onIdleTimeout,e),this.idleExpires=(new Date).getTime()+e}.bind(this);t();var n,i=this.getConfig("record_block_selector");""!==i&&null!==i||(i=void 0);try{this._stopRecording=this._rrwebRecord({emit:function(e){this.idleExpires&&this.idleExpires<e.timestamp?this._onIdleTimeout():(function(e){return e.type===Dl.IncrementalSnapshot&&qh.has(e.data.source)}(e)&&(this.batcher.stopped&&(new Date).getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),t()),this.__enqueuePromise=this.batcher.enqueue(e),(null===this.lastEventTimestamp||e.timestamp>this.lastEventTimestamp)&&(this.lastEventTimestamp=e.timestamp))}.bind(this),blockClass:this.getConfig("record_block_class"),blockSelector:i,collectFonts:this.getConfig("record_collect_fonts"),dataURLOptions:{type:"image/webp",quality:.6},maskAllInputs:!0,maskTextClass:this.getConfig("record_mask_text_class"),maskTextSelector:this.getConfig("record_mask_text_selector"),recordCanvas:this.getConfig("record_canvas"),sampling:{canvas:15},plugins:this.getConfig("record_console")?[(n={stringifyOptions:{stringLengthLimit:1e3,numOfKeysLimit:50,depthOfLimit:2}},{name:"rrweb/console@1",observer:Zu,options:n})]:[]})}catch(wU){this.reportError("Unexpected error when starting rrweb recording.",wU)}if("function"!=typeof this._stopRecording)return this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,void this.stopRecording();var r=this.maxExpires-(new Date).getTime();this.maxTimeoutId=setTimeout(this._onMaxLengthReached.bind(this),r)}else Oh.log("Recording already in progress, skipping startRecording.");else this.reportError("rrweb record function not provided. ")},Yh.prototype.stopRecording=function(e){if(this.finalFlushUserIdInfo=this.getUserIdInfo(),!this.isRrwebStopped()){try{this._stopRecording()}catch(wU){this.reportError("Error with rrweb stopRecording",wU)}this._stopRecording=null}var t;return this.batcher.stopped?t=this.batcher.clear():e||(t=this.batcher.flush()),this.batcher.stop(),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId),t},Yh.prototype.isRrwebStopped=function(){return null===this._stopRecording},Yh.prototype.flushEventsWithOptOut=function(e,t,n){var i=function(e){0===e&&(this.stopRecording(),n({error:"Tracking has been opted out, stopping recording."}))}.bind(this);this._flushEvents(e,t,n,i)},Yh.prototype.serialize=function(){var e;try{e=this._mixpanel.get_tab_id()}catch(t){this.reportError("Error getting tab ID for serialization ",t),e=null}return{replayId:this.replayId,seqNo:this.seqNo,replayStartTime:this.replayStartTime,batchStartUrl:this.batchStartUrl,replayStartUrl:this.replayStartUrl,lastEventTimestamp:this.lastEventTimestamp,idleExpires:this.idleExpires,maxExpires:this.maxExpires,tabId:e}},Yh.deserialize=function(e,t){return new Yh(Kd.extend({},t,{replayId:e.replayId,batchStartUrl:e.batchStartUrl,replayStartUrl:e.replayStartUrl,idleExpires:e.idleExpires,maxExpires:e.maxExpires,replayStartTime:e.replayStartTime,lastEventTimestamp:e.lastEventTimestamp,seqNo:e.seqNo,sharedLockStorage:t.sharedLockStorage}))},Yh.prototype._sendRequest=function(e,t,n,i){var r=function(t,n){200===t.status&&this.replayId===e&&(this.seqNo++,this.batchStartUrl=Kd.info.currentUrl()),this._onBatchSent(),i({status:0,httpStatusCode:t.status,responseBody:n,retryAfter:t.headers.get("Retry-After")})}.bind(this),o=this._mixpanel.get_api_host&&this._mixpanel.get_api_host("record")||this.getConfig("api_host");me.fetch(o+"/"+this.getConfig("api_routes").record+"?"+new URLSearchParams(t),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getConfig("token")+":"),"Content-Type":"application/octet-stream"},body:n}).then(function(e){e.json().then(function(t){r(e,t)}).catch(function(e){i({error:e})})}).catch(function(e){i({error:e,httpStatusCode:0})})},Yh.prototype._flushEvents=bh(function(e,t,n){var i=e.length;if(i>0){for(var r=this.replayId,o=1/0,s=-1/0,a=!1,c=0;c<i;c++)o=Math.min(o,e[c].timestamp),s=Math.max(s,e[c].timestamp),e[c].type===Dl.FullSnapshot&&(a=!0);if(0===this.seqNo){if(!a)return n({error:"First batch does not contain a full snapshot. Aborting recording."}),void this.stopRecording(!0);this.replayStartTime=o}else this.replayStartTime||(this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=o);var l=s-this.replayStartTime,u={$current_url:this.batchStartUrl,$lib_version:kd.LIB_VERSION,batch_start_time:o/1e3,mp_lib:"web",replay_id:r,replay_length_ms:l,replay_start_time:this.replayStartTime/1e3,replay_start_url:this.replayStartUrl,seq:this.seqNo},d=JSON.stringify(e);if(Object.assign(u,this.getUserIdInfo()),function(e,t,n){if(!me.CompressionStream)return!1;var i=Kd.info.browser(e,t,n),r=Kd.info.browserVersion(e,t,n);return!(("Safari"===i||"Mobile Safari"===i)&&r>=16.4&&r<16.6)}(Ld,Ud.vendor,Nd)){var h=new Blob([d],{type:"application/json"}).stream().pipeThrough(new Rh("gzip"));new Response(h).blob().then(function(e){u.format="gzip",this._sendRequest(r,u,e,n)}.bind(this))}else u.format="body",this._sendRequest(r,u,d,n)}}),Yh.prototype.reportError=function(e,t){Oh.error.apply(Oh.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.getConfig("error_reporter")(e,t)}catch(n){Oh.error(n)}},Yh.prototype.getDurationMs=function(){return null===this.replayStartTime?0:null===this.lastEventTimestamp?(new Date).getTime()-this.replayStartTime:this.lastEventTimestamp-this.replayStartTime},Yh.prototype._getRecordMinMs=function(){var e=this.getConfig("record_min_ms");return e>Cd?(Oh.critical("record_min_ms cannot be greater than 8000ms. Capping value."),Cd):e};var Kh=function(e){this.idb=new ph(hh),this.errorReporter=e.errorReporter,this.mixpanelInstance=e.mixpanelInstance,this.sharedLockStorage=e.sharedLockStorage};Kh.prototype.isPersistenceEnabled=function(){return!this.mixpanelInstance.get_config("disable_persistence")},Kh.prototype.handleError=function(e){this.errorReporter("IndexedDB error: ",e)},Kh.prototype.setActiveRecording=function(e){if(!this.isPersistenceEnabled())return ud.resolve();var t=e.tabId;return t?this.idb.init().then(function(){return this.idb.setItem(t,e)}.bind(this)).catch(this.handleError.bind(this)):(console.warn("No tab ID is set, cannot persist recording metadata."),ud.resolve())},Kh.prototype.getActiveRecording=function(){return this.isPersistenceEnabled()?this.idb.init().then(function(){return this.idb.getItem(this.mixpanelInstance.get_tab_id())}.bind(this)).then(function(e){return Ph(e)?null:e}.bind(this)).catch(this.handleError.bind(this)):ud.resolve(null)},Kh.prototype.clearActiveRecording=function(){return this.isPersistenceEnabled()?this.markActiveRecordingExpired():this.deleteActiveRecording()},Kh.prototype.markActiveRecordingExpired=function(){return this.getActiveRecording().then(function(e){if(e)return e.maxExpires=0,this.setActiveRecording(e)}.bind(this)).catch(this.handleError.bind(this))},Kh.prototype.deleteActiveRecording=function(){return this.idb.isInitialized()?this.idb.removeItem(this.mixpanelInstance.get_tab_id()).catch(this.handleError.bind(this)):ud.resolve()},Kh.prototype.flushInactiveRecordings=function(){return this.isPersistenceEnabled()?this.idb.init().then(function(){return this.idb.getAll()}.bind(this)).then(function(e){var t=e.filter(function(e){return Ph(e)}).map(function(e){return Yh.deserialize(e,{mixpanelInstance:this.mixpanelInstance,sharedLockStorage:this.sharedLockStorage}).unloadPersistedData().then(function(){return this.idb.removeItem(e.tabId)}.bind(this)).catch(this.handleError.bind(this))}.bind(this));return ud.all(t)}.bind(this)).catch(this.handleError.bind(this)):ud.resolve([])};var Hh=jd("recorder"),Vh=function(e,t,n){this.mixpanelInstance=e,this.rrwebRecord=t||Nu,this.sharedLockStorage=n,this.recordingRegistry=new Kh({mixpanelInstance:this.mixpanelInstance,errorReporter:Hh.error,sharedLockStorage:n}),this._flushInactivePromise=this.recordingRegistry.flushInactiveRecordings(),this.activeRecording=null,this.stopRecordingInProgress=!1};Vh.prototype.startRecording=function(e){if(e=e||{},!this.activeRecording||this.activeRecording.isRrwebStopped()){var t=function(){Hh.log("Idle timeout reached, restarting recording."),this.resetRecording()}.bind(this),n=function(){Hh.log("Max recording length reached, stopping recording."),this.resetRecording()}.bind(this),i=function(){this.recordingRegistry.setActiveRecording(this.activeRecording.serialize()),this.__flushPromise=this.activeRecording.batcher._flushPromise}.bind(this),r={mixpanelInstance:this.mixpanelInstance,onBatchSent:i,onIdleTimeout:t,onMaxLengthReached:n,replayId:Kd.UUID(),rrwebRecord:this.rrwebRecord,sharedLockStorage:this.sharedLockStorage};return e.activeSerializedRecording?this.activeRecording=Yh.deserialize(e.activeSerializedRecording,r):this.activeRecording=new Yh(r),this.activeRecording.startRecording(e.shouldStopBatcher),this.recordingRegistry.setActiveRecording(this.activeRecording.serialize())}Hh.log("Recording already in progress, skipping startRecording.")},Vh.prototype.stopRecording=function(){return this.stopRecordingInProgress=!0,this._stopCurrentRecording(!1,!0).then(function(){return this.recordingRegistry.clearActiveRecording()}.bind(this)).then(function(){this.stopRecordingInProgress=!1}.bind(this))},Vh.prototype.pauseRecording=function(){return this._stopCurrentRecording(!1)},Vh.prototype._stopCurrentRecording=function(e,t){if(this.activeRecording){var n=this.activeRecording.stopRecording(e);return t&&(this.activeRecording=null),n}return ud.resolve()},Vh.prototype.resumeRecording=function(e){return this.activeRecording&&this.activeRecording.isRrwebStopped()?(this.activeRecording.startRecording(!1),ud.resolve(null)):this.recordingRegistry.getActiveRecording().then(function(t){return t&&!this.stopRecordingInProgress?this.startRecording({activeSerializedRecording:t}):e?this.startRecording({shouldStopBatcher:!1}):(Hh.log("No resumable recording found."),null)}.bind(this))},Vh.prototype.resetRecording=function(){this.stopRecording(),this.startRecording({shouldStopBatcher:!0})},Vh.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(Vh.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),me.__mp_recorder=Vh;var jh="change",Zh="click",Xh="hashchange",Gh="load",Wh="mp_locationchange",Jh="popstate",_h="scrollend",$h="scroll",eA="submit",tA="visibilitychange",nA=["clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","x","y"],iA=["mp-include"],rA=["mp-no-track"],oA=rA.concat(["mp-sensitive"]),sA=["aria-label","aria-labelledby","aria-describedby","href","name","role","title","type"],aA={button:!0,checkbox:!0,combobox:!0,grid:!0,link:!0,listbox:!0,menu:!0,menubar:!0,menuitem:!0,menuitemcheckbox:!0,menuitemradio:!0,navigation:!0,option:!0,radio:!0,radiogroup:!0,searchbox:!0,slider:!0,spinbutton:!0,switch:!0,tab:!0,tablist:!0,textbox:!0,tree:!0,treegrid:!0,treeitem:!0},cA={base:!0,head:!0,html:!0,link:!0,meta:!0,script:!0,style:!0,title:!0,br:!0,hr:!0,wbr:!0,noscript:!0,picture:!0,source:!0,template:!0,track:!0},lA={article:!0,div:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,p:!0,section:!0,span:!0},uA=["onclick","onmousedown","onmouseup","onpointerdown","onpointerup","ontouchend","ontouchstart"],dA=jd("autocapture");function hA(e){for(var t={},n=AA(e).split(" "),i=0;i<n.length;i++){var r=n[i];r&&(t[r]=!0)}return t}function AA(e){switch(typeof e.className){case"string":return e.className;case"object":return e.className.baseVal||e.getAttribute("class")||"";default:return""}}function pA(e){if(e.previousElementSibling)return e.previousElementSibling;do{e=e.previousSibling}while(e&&!wA(e));return e}function mA(e,t,n,i,r,o){var s={$classes:AA(e).split(" "),$tag_name:e.tagName.toLowerCase()},a=e.id;a&&(s.$id=a),xA(e,t,r,o)&&Kd.each(sA.concat(i),function(t){if(e.hasAttribute(t)&&!n[t]){var i=e.getAttribute(t);CA(i)&&(s["$attr-"+t]=i)}});for(var c=1,l=1,u=e;u=pA(u);)c++,u.tagName===e.tagName&&l++;return s.$nth_child=c,s.$nth_of_type=l,s}function fA(e,t){var n=t.allowElementCallback,i=t.allowSelectors||[],r=t.blockAttrs||[],o=t.blockElementCallback,s=t.blockSelectors||[],a=t.captureTextContent||!1,c=t.captureExtraAttrs||[],l=t.capturedForHeatMap||!1,u={};Kd.each(r,function(e){u[e]=!0});var d=null,h=void 0===e.target?e.srcElement:e.target;if(kA(h)&&(h=h.parentNode),function(e,t){if(!e||vA(e,"html")||!wA(e))return!1;switch(e.tagName.toLowerCase()){case"form":return t.type===eA;case"input":return-1===["button","submit"].indexOf(e.getAttribute("type"))?t.type===jh:t.type===Zh;case"select":case"textarea":return t.type===jh;default:return t.type===Zh}}(h,e)&&yA(h,e,n,i)&&!bA(h,e,o,s)){for(var A=[h],p=h;p.parentNode&&!vA(p,"body");)A.push(p.parentNode),p=p.parentNode;var m,f=[],g=!1;if(Kd.each(A,function(t){var r=xA(t,e,n,i);u.href||"a"!==t.tagName.toLowerCase()||(m=t.getAttribute("href"),m=r&&CA(m)&&m),bA(t,e,o,s)&&(g=!0),f.push(mA(t,e,u,c,n,i))},this),!g){var y=Fd.documentElement;if(d={$event_type:e.type,$host:me.location.host,$pathname:me.location.pathname,$elements:f,$el_attr__href:m,$viewportHeight:Math.max(y.clientHeight,me.innerHeight||0),$viewportWidth:Math.max(y.clientWidth,me.innerWidth||0),$pageHeight:Fd.body.offsetHeight||0,$pageWidth:Fd.body.offsetWidth||0},Kd.each(c,function(e){if(!u[e]&&h.hasAttribute(e)){var t=h.getAttribute(e);CA(t)&&(d["$el_attr__"+e]=t)}}),a&&(b=gA(h,e,n,i))&&b.length&&(d.$el_text=b),e.type===Zh&&(Kd.each(nA,function(t){t in e&&(d["$"+t]=e[t])}),l&&(d.$captured_for_heatmap=!0),h=function(e){for(var t=e.target,n=e.composedPath(),i=0;i<n.length;i++){var r=n[i];if(vA(r,"a")||vA(r,"button")||vA(r,"input")||vA(r,"select")||r.getAttribute&&"button"===r.getAttribute("role")){t=r;break}if(r===t)break}return t}(e)),a){var b=gA(h,e,n,i);b&&b.length&&(d.$el_text=b)}if(h){if(!yA(h,e,n,i)||bA(h,e,o,s))return null;var w=mA(h,e,u,c,n,i);d.$target=w,d.$el_classes=w.$classes,Kd.extend(d,Kd.strip_empty_properties({$el_id:w.$id,$el_tag_name:w.$tag_name}))}}}return d}function gA(e,t,n,i){var r="";return xA(e,t,n,i)&&e.childNodes&&e.childNodes.length&&Kd.each(e.childNodes,function(e){kA(e)&&e.textContent&&(r+=Kd.trim(e.textContent).split(/(\s+)/).filter(CA).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),Kd.trim(r)}function yA(e,t,n,i){if(n)try{if(!n(e,t))return!1}catch(wU){return dA.critical("Error while checking element in allowElementCallback",wU),!1}if(!i.length)return!0;for(var r=0;r<i.length;r++){var o=i[r];try{if(e.matches(o))return!0}catch(wU){dA.critical("Error while checking selector: "+o,wU)}}return!1}function bA(e,t,n,i){var r;if(n)try{if(n(e,t))return!0}catch(wU){return dA.critical("Error while checking element in blockElementCallback",wU),!0}if(i&&i.length)for(r=0;r<i.length;r++){var o=i[r];try{if(e.matches(o))return!0}catch(wU){dA.critical("Error while checking selector: "+o,wU)}}var s=hA(e);for(r=0;r<rA.length;r++)if(s[rA[r]])return!0;return!1}function wA(e){return e&&1===e.nodeType}function vA(e,t){return e&&e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function kA(e){return e&&3===e.nodeType}function xA(e,t,n,i){var r;if(!yA(e,t,n,i))return!1;for(var o=e;o.parentNode&&!vA(o,"body");o=o.parentNode){var s=hA(o);for(r=0;r<oA.length;r++)if(s[oA[r]])return!1}var a=hA(e);for(r=0;r<iA.length;r++)if(a[iA[r]])return!0;if(vA(e,"input")||vA(e,"select")||vA(e,"textarea")||"true"===e.getAttribute("contenteditable"))return!1;var c=e.type||"";if("string"==typeof c)switch(c.toLowerCase()){case"hidden":case"password":return!1}var l=e.name||e.id||"";if("string"==typeof l){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(l.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function CA(e){if(null===e||Kd.isUndefined(e))return!1;if("string"==typeof e){e=Kd.trim(e);if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0}function SA(e){var t="onscrollend"in me,n=Zd(e),i=_h;if(!t){var r=null;n=Zd(function(){clearTimeout(r),r=setTimeout(e,100)}),i=$h}return{listener:n,eventType:i}}function BA(e){var t=e.tagName.toLowerCase();return"button"===t||"input"===t||"select"===t||"textarea"===t||"details"===t||"dialog"===t||(!!e.isContentEditable||(!!(e.onclick||e.onmousedown||e.onmouseup||e.ontouchstart||e.ontouchend)||(!!function(e){for(var t=0;t<uA.length;t++)if(e.hasAttribute(uA[t]))return!0;return!1}(e)||(!!function(e){var t=e.getAttribute("role");if(!t)return!1;var n=t.trim().split(/\s+/)[0].toLowerCase();return aA[n]}(e)||(!("a"!==t||!e.hasAttribute("href"))||!!e.hasAttribute("tabindex"))))))}function IA(e){if(!e||!e.tagName)return!0;var t=e.tagName.toLowerCase();if(cA[t])return!0;if(BA(e))return!1;for(var n=e.parentElement,i=0;n&&i<5;){if(BA(n))return!1;if(n.getRootNode&&n.getRootNode()!==Fd){var r=n.getRootNode();if(r.host&&BA(r.host))return!1}n=n.parentElement,i++}return!!lA[t]}function EA(e){return"composedPath"in e?e.composedPath():[]}function MA(e){var t=EA(e);return t&&t.length>0?t[0]:e.target||e.srcElement}function DA(){this.clicks=[]}function QA(e,t){this.changeCallback=e||function(){},this.observerConfig=t,this.observedShadowRoots=null,this.shadowObservers=[]}DA.prototype.isRageClick=function(e,t){var n=(t=t||{}).threshold_px||30,i=t.timeout_ms||1e3,r=t.click_count||4;if(t.interactive_elements_only||false){var o=MA(e);if(!o||IA(o))return!1}var s=Date.now(),a=e.pageX,c=e.pageY,l=this.clicks[this.clicks.length-1];if(l&&s-l.timestamp<i&&Math.sqrt(Math.pow(a-l.x,2)+Math.pow(c-l.y,2))<n){if(this.clicks.push({x:a,y:c,timestamp:s}),this.clicks.length>=r)return this.clicks=[],!0}else this.clicks=[{x:a,y:c,timestamp:s}];return!1},QA.prototype.getEventTarget=function(e){if(this.observedShadowRoots)return MA(e)},QA.prototype.observeFromEvent=function(e){if(this.observedShadowRoots)for(var t=EA(e),n=0;n<t.length;n++){var i=t[n];i&&i.shadowRoot&&this.observeShadowRoot(i.shadowRoot)}},QA.prototype.observeShadowRoot=function(e){if(this.observedShadowRoots&&!this.observedShadowRoots.has(e)){var t=this;try{this.observedShadowRoots.add(e);var n=new window.MutationObserver(function(){t.changeCallback()});n.observe(e,this.observerConfig),this.shadowObservers.push(n)}catch(i){dA.critical("Error while observing shadow root",i)}}},QA.prototype.start=function(){this.observedShadowRoots||("undefined"!=typeof WeakSet?this.observedShadowRoots=new WeakSet:dA.critical("Shadow DOM observation unavailable: WeakSet not supported"))},QA.prototype.stop=function(){if(this.observedShadowRoots){for(var e=0;e<this.shadowObservers.length;e++)try{this.shadowObservers[e].disconnect()}catch(t){dA.critical("Error while disconnecting shadow DOM observer",t)}this.shadowObservers=[],this.observedShadowRoots=null}};var UA=[jh,"input",eA,"select","toggle"],FA=[_h],NA=[Xh],TA={characterData:!0,childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","hidden","checked","selected","value","display","visibility"]};function LA(e){this.eventListeners=[],this.mutationObserver=null,this.shadowDOMObserver=null,this.isTracking=!1,this.lastChangeEventTimestamp=0,this.pendingClicks=[],this.onDeadClickCallback=e,this.processingActive=!1,this.processingTimeout=null}LA.prototype.addClick=function(e){var t=this.shadowDOMObserver&&this.shadowDOMObserver.getEventTarget(e);return t||(t=e.target||e.srcElement),!(!t||IA(t))&&(this.shadowDOMObserver&&this.shadowDOMObserver.observeFromEvent(e),this.pendingClicks.push({element:t,event:e,timestamp:Date.now()}),!0)},LA.prototype.trackClick=function(e,t){if(!this.isTracking)return!1;var n=this.addClick(e);return n&&this.triggerProcessing(t),n},LA.prototype.getDeadClicks=function(e){if(0===this.pendingClicks.length)return[];var t=e.timeout_ms,n=Date.now(),i=this.pendingClicks.slice();this.pendingClicks=[];for(var r=[],o=0;o<i.length;o++){var s=i[o];n-s.timestamp>=t?this.hasChangesAfter(s.timestamp)||r.push(s):this.pendingClicks.push(s)}return r},LA.prototype.hasChangesAfter=function(e){return this.lastChangeEventTimestamp>=e-100},LA.prototype.recordChangeEvent=function(){this.lastChangeEventTimestamp=Date.now()},LA.prototype.triggerProcessing=function(e){this.processingActive||(this.processingActive=!0,this.processRecursively(e))},LA.prototype.processRecursively=function(e){if(this.isTracking&&this.onDeadClickCallback){var t=e.timeout_ms,n=this;this.processingTimeout=setTimeout(function(){if(n.processingActive){for(var t=n.getDeadClicks(e),i=0;i<t.length;i++)n.onDeadClickCallback(t[i].event);n.pendingClicks.length>0?n.processRecursively(e):n.processingActive=!1}},t)}else this.processingActive=!1},LA.prototype.startTracking=function(){if(!this.isTracking){this.isTracking=!0;var e=this;UA.forEach(function(t){var n=function(){e.recordChangeEvent()};document.addEventListener(t,n,{capture:!0,passive:!0}),e.eventListeners.push({target:document,event:t,handler:n,options:{capture:!0,passive:!0}})}),NA.forEach(function(t){var n=function(){e.recordChangeEvent()};window.addEventListener(t,n),e.eventListeners.push({target:window,event:t,handler:n})}),FA.forEach(function(t){var n=function(){e.recordChangeEvent()};window.addEventListener(t,n,{passive:!0}),e.eventListeners.push({target:window,event:t,handler:n,options:{passive:!0}})});var t=function(){e.recordChangeEvent()};if(document.addEventListener("selectionchange",t),e.eventListeners.push({target:document,event:"selectionchange",handler:t}),window.MutationObserver)try{this.mutationObserver=new window.MutationObserver(function(){e.recordChangeEvent()}),this.mutationObserver.observe(document.body||document.documentElement,TA)}catch(n){dA.critical("Error while setting up mutation observer",n)}if(window.customElements)try{this.shadowDOMObserver=new QA(function(){e.recordChangeEvent()},TA),this.shadowDOMObserver.start()}catch(n){dA.critical("Error while setting up shadow DOM observer",n),this.shadowDOMObserver=null}}},LA.prototype.stopTracking=function(){if(this.isTracking){this.isTracking=!1,this.pendingClicks=[],this.lastChangeEventTimestamp=0,this.processingActive=!1,this.processingTimeout&&(clearTimeout(this.processingTimeout),this.processingTimeout=null);for(var e=0;e<this.eventListeners.length;e++){var t=this.eventListeners[e];try{t.target.removeEventListener(t.event,t.handler,t.options)}catch(n){dA.critical("Error while removing event listener",n)}}if(this.eventListeners=[],this.mutationObserver){try{this.mutationObserver.disconnect()}catch(n){dA.critical("Error while disconnecting mutation observer",n)}this.mutationObserver=null}if(this.shadowDOMObserver){try{this.shadowDOMObserver.stop()}catch(n){dA.critical("Error while stopping shadow DOM observer",n)}this.shadowDOMObserver=null}}};var PA="autocapture",OA="full-url",RA="allow_selectors",zA="allow_url_regexes",qA="block_attrs",YA="block_element_callback",KA="block_selectors",HA="block_url_regexes",VA="capture_extra_attrs",jA="capture_text_content",ZA="scroll_capture_all",XA="scroll_depth_percent_checkpoints",GA="click",WA="dead_click",JA="input",_A="pageview",$A="rage_click",ep="scroll",tp="page_leave",np="submit",ip={};ip[RA]=[],ip[zA]=[],ip[qA]=[],ip[YA]=null,ip[KA]=[],ip[HA]=[],ip[VA]=[],ip[jA]=!1,ip[ZA]=!1,ip[XA]=[25,50,75,100],ip[GA]=!0,ip[WA]=!0,ip[JA]=!0,ip[_A]=OA,ip[$A]=!0,ip[ep]=!0,ip[tp]=!1,ip[np]=!0;var rp={$mp_autocapture:!0},op="$mp_click",sp="$mp_dead_click",ap="$mp_rage_click",cp=function(e){this.mp=e,this.maxScrollViewDepth=0,this.hasTrackedScrollSession=!1,this.previousScrollHeight=0};cp.prototype.init=function(){!function(){try{return!!Fd.createElement("div").matches}catch(wU){return!1}}()?dA.critical("Autocapture unavailable: missing required DOM APIs"):(this.initPageListeners(),this.initPageviewTracking(),this.initClickTracking(),this.initDeadClickTracking(),this.initInputTracking(),this.initScrollTracking(),this.initSubmitTracking(),this.initRageClickTracking(),this.initPageLeaveTracking())},cp.prototype.getFullConfig=function(){var e=this.mp.get_config(PA);return e?Kd.isObject(e)?Kd.extend({},ip,e):ip:{}},cp.prototype.getConfig=function(e){return this.getFullConfig()[e]},cp.prototype.currentUrlBlocked=function(){var e,t=Kd.info.currentUrl(),n=this.getConfig(zA)||[];if(n.length){var i=!1;for(e=0;e<n.length;e++){var r=n[e];try{if(t.match(r)){i=!0;break}}catch(wU){return dA.critical("Error while checking block URL regex: "+r,wU),!0}}if(!i)return!0}var o=this.getConfig(HA)||[];if(!o||!o.length)return!1;for(e=0;e<o.length;e++)try{if(t.match(o[e]))return!0}catch(wU){return dA.critical("Error while checking block URL regex: "+o[e],wU),!0}return!1},cp.prototype.pageviewTrackingConfig=function(){return this.mp.get_config(PA)?this.getConfig(_A):this.mp.get_config("track_pageview")},cp.prototype.trackDomEvent=function(e,t){if(!this.currentUrlBlocked()){var n=this.mp.is_recording_heatmap_data()&&(t===op&&!this.getConfig(GA)||t===ap&&!this._getClickTrackingConfig($A)||t===sp&&!this._getClickTrackingConfig(WA)),i=fA(e,{allowElementCallback:this.getConfig("allow_element_callback"),allowSelectors:this.getConfig(RA),blockAttrs:this.getConfig(qA),blockElementCallback:this.getConfig(YA),blockSelectors:this.getConfig(KA),captureExtraAttrs:this.getConfig(VA),captureTextContent:this.getConfig(jA),capturedForHeatMap:n});i&&(Kd.extend(i,rp),this.mp.track(t,i))}},cp.prototype.initPageListeners=function(){if(me.removeEventListener(Jh,this.listenerPopstate),me.removeEventListener(Xh,this.listenerHashchange),this.pageviewTrackingConfig()||this.getConfig(tp)||this.mp.get_config("record_heatmap_data")){this.listenerPopstate=function(){me.dispatchEvent(new Event(Wh))},this.listenerHashchange=function(){me.dispatchEvent(new Event(Wh))},me.addEventListener(Jh,this.listenerPopstate),me.addEventListener(Xh,this.listenerHashchange);var e=me.history.pushState;"function"==typeof e&&(me.history.pushState=function(t,n,i){e.call(me.history,t,n,i),me.dispatchEvent(new Event(Wh))});var t=me.history.replaceState;"function"==typeof t&&(me.history.replaceState=function(e,n,i){t.call(me.history,e,n,i),me.dispatchEvent(new Event(Wh))})}},cp.prototype._getClickTrackingConfig=function(e){var t=this.getConfig(e);return t?!0===t?{}:"object"==typeof t?t:{}:null},cp.prototype._trackPageLeave=function(e,t,n){if(!this.hasTrackedScrollSession&&(this.getConfig(tp)||this.mp.is_recording_heatmap_data())){this.hasTrackedScrollSession=!0;var i=Math.max(Fd.documentElement.clientHeight,me.innerHeight||0),r=Math.round(Math.max(this.maxScrollViewDepth-i,0)/(n-i)*100),o=Math.round(i/n*100);n<=i&&(r=100,o=100);var s=Kd.extend({$max_scroll_view_depth:this.maxScrollViewDepth,$max_scroll_percentage:r,$fold_line_percentage:o,$scroll_height:n,$event_type:e.type,$current_url:t||Kd.info.currentUrl(),$viewportHeight:i,$viewportWidth:Math.max(Fd.documentElement.clientWidth,me.innerWidth||0),$captured_for_heatmap:this.mp.is_recording_heatmap_data()},rp);this.mp.track("$mp_page_leave",s,{transport:"sendBeacon"})}},cp.prototype._initScrollDepthTracking=function(){if(me.removeEventListener($h,this.listenerScrollDepth),me.removeEventListener(_h,this.listenerScrollDepth),this.mp.get_config("record_heatmap_data")){dA.log("Initializing scroll depth tracking"),this.maxScrollViewDepth=Math.max(Fd.documentElement.clientHeight,me.innerHeight||0);var e=SA(function(){if(!this.currentUrlBlocked()){var e=Math.max(Fd.documentElement.clientHeight,me.innerHeight||0)+me.scrollY;e>this.maxScrollViewDepth&&(this.maxScrollViewDepth=e),this.previousScrollHeight=Fd.body.scrollHeight}}.bind(this));this.listenerScrollDepth=e.listener,me.addEventListener(e.eventType,this.listenerScrollDepth)}},cp.prototype.initClickTracking=function(){me.removeEventListener(Zh,this.listenerClick),(this.getConfig(GA)||this.mp.get_config("record_heatmap_data"))&&(dA.log("Initializing click tracking"),this.listenerClick=function(e){(this.getConfig(GA)||this.mp.is_recording_heatmap_data())&&this.trackDomEvent(e,op)}.bind(this),me.addEventListener(Zh,this.listenerClick))},cp.prototype.initDeadClickTracking=function(){this._getClickTrackingConfig(WA)||this.mp.get_config("record_heatmap_data")?(dA.log("Initializing dead click tracking"),this._deadClickTracker||(this._deadClickTracker=new LA(function(e){this.trackDomEvent(e,sp)}.bind(this)),this._deadClickTracker.startTracking()),this.listenerDeadClick||(this.listenerDeadClick=function(e){var t=this._getClickTrackingConfig(WA);if((t||this.mp.is_recording_heatmap_data())&&!this.currentUrlBlocked()){var n=t||{};n.timeout_ms||(n.timeout_ms=500),this._deadClickTracker.trackClick(e,n)}}.bind(this),me.addEventListener(Zh,this.listenerDeadClick))):this.stopDeadClickTracking()},cp.prototype.initInputTracking=function(){me.removeEventListener(jh,this.listenerChange),this.getConfig(JA)&&(dA.log("Initializing input tracking"),this.listenerChange=function(e){this.getConfig(JA)&&this.trackDomEvent(e,"$mp_input_change")}.bind(this),me.addEventListener(jh,this.listenerChange))},cp.prototype.initPageviewTracking=function(){if(me.removeEventListener(Wh,this.listenerLocationchange),this.pageviewTrackingConfig()){dA.log("Initializing pageview tracking");var e="",t=!1;this.currentUrlBlocked()||(t=this.mp.track_pageview(rp)),t&&(e=Kd.info.currentUrl()),this.listenerLocationchange=Zd(function(){if(!this.currentUrlBlocked()){var t=Kd.info.currentUrl(),n=!1,i=t.split("#")[0].split("?")[0]!==e.split("#")[0].split("?")[0],r=this.pageviewTrackingConfig();if(r===OA?n=t!==e:"url-with-path-and-query-string"===r?n=t.split("#")[0]!==e.split("#")[0]:"url-with-path"===r&&(n=i),n)this.mp.track_pageview(rp)&&(e=t),i&&(this.lastScrollCheckpoint=0,dA.log("Path change: re-initializing scroll depth checkpoints"))}}.bind(this)),me.addEventListener(Wh,this.listenerLocationchange)}},cp.prototype.initRageClickTracking=function(){me.removeEventListener(Zh,this.listenerRageClick),(this._getClickTrackingConfig($A)||this.mp.get_config("record_heatmap_data"))&&(dA.log("Initializing rage click tracking"),this._rageClickTracker||(this._rageClickTracker=new DA),this.listenerRageClick=function(e){var t=this._getClickTrackingConfig($A);(t||this.mp.is_recording_heatmap_data())&&(this.currentUrlBlocked()||this._rageClickTracker.isRageClick(e,t)&&this.trackDomEvent(e,ap))}.bind(this),me.addEventListener(Zh,this.listenerRageClick))},cp.prototype.initScrollTracking=function(){if(me.removeEventListener(_h,this.listenerScroll),me.removeEventListener($h,this.listenerScroll),this.getConfig(ep)){dA.log("Initializing scroll tracking"),this.lastScrollCheckpoint=0;var e=SA(function(){if(this.getConfig(ep)&&!this.currentUrlBlocked()){var e=this.getConfig(ZA),t=(this.getConfig(XA)||[]).slice().sort(function(e,t){return e-t}),n=me.scrollY,i=Kd.extend({$scroll_top:n},rp);try{var r=Fd.body.scrollHeight,o=Math.round(n/(r-me.innerHeight)*100);if(i.$scroll_height=r,i.$scroll_percentage=o,o>this.lastScrollCheckpoint)for(var s=0;s<t.length;s++){var a=t[s];o>=a&&this.lastScrollCheckpoint<a&&(i.$scroll_checkpoint=a,this.lastScrollCheckpoint=a,e=!0)}}catch(wU){dA.critical("Error while calculating scroll percentage",wU)}e&&this.mp.track("$mp_scroll",i)}}.bind(this));this.listenerScroll=e.listener,me.addEventListener(e.eventType,this.listenerScroll)}},cp.prototype.initSubmitTracking=function(){me.removeEventListener(eA,this.listenerSubmit),this.getConfig(np)&&(dA.log("Initializing submit tracking"),this.listenerSubmit=function(e){this.getConfig(np)&&this.trackDomEvent(e,"$mp_submit")}.bind(this),me.addEventListener(eA,this.listenerSubmit))},cp.prototype.initPageLeaveTracking=function(){if(Fd.removeEventListener(tA,this.listenerPageLeaveVisibilitychange),me.removeEventListener(Wh,this.listenerPageLeaveLocationchange),me.removeEventListener(Gh,this.listenerPageLoad),this.getConfig(tp)||this.mp.get_config("record_heatmap_data")){dA.log("Initializing page visibility tracking."),this._initScrollDepthTracking();var e=Kd.info.currentUrl();this.listenerPageLoad=function(){this.previousScrollHeight=Fd.body.scrollHeight}.bind(this),me.addEventListener(Gh,this.listenerPageLoad),this.listenerPageLeaveLocationchange=Zd(function(t){if(!this.currentUrlBlocked()){var n=Kd.info.currentUrl();n!==e&&(this._trackPageLeave(t,e,this.previousScrollHeight),e=n,this.maxScrollViewDepth=Math.max(Fd.documentElement.clientHeight,me.innerHeight||0),this.previousScrollHeight=Fd.body.scrollHeight,this.hasTrackedScrollSession=!1)}}.bind(this)),me.addEventListener(Wh,this.listenerPageLeaveLocationchange),this.listenerPageLeaveVisibilitychange=function(t){Fd.hidden&&this._trackPageLeave(t,e,this.previousScrollHeight)}.bind(this),Fd.addEventListener(tA,this.listenerPageLeaveVisibilitychange)}},cp.prototype.stopDeadClickTracking=function(){this.listenerDeadClick&&(me.removeEventListener(Zh,this.listenerDeadClick),this.listenerDeadClick=null),this._deadClickTracker&&(this._deadClickTracker.stopTracking(),this._deadClickTracker=null)},Xd(cp);var lp=jd("flags"),up="flags",dp="context",hp={};hp[dp]={};var Ap=function(e){this.fetch=me.fetch,this.getFullApiRoute=e.getFullApiRoute,this.getMpConfig=e.getConfigFunc,this.setMpConfig=e.setConfigFunc,this.getMpProperty=e.getPropertyFunc,this.track=e.trackingFunc};Ap.prototype.init=function(){this.minApisSupported()?(this.flags=null,this.fetchFlags(),this.trackedFeatures=new Set):lp.critical("Feature Flags unavailable: missing minimum required APIs")},Ap.prototype.getFullConfig=function(){var e=this.getMpConfig(up);return e?Kd.isObject(e)?Kd.extend({},hp,e):hp:{}},Ap.prototype.getConfig=function(e){return this.getFullConfig()[e]},Ap.prototype.isSystemEnabled=function(){return!!this.getMpConfig(up)},Ap.prototype.updateContext=function(e,t){if(!this.isSystemEnabled())return lp.critical("Feature Flags not enabled, cannot update context"),Promise.resolve();var n=this.getMpConfig(up);Kd.isObject(n)||(n={});var i=t&&t.replace?{}:this.getConfig(dp);return n[dp]=Kd.extend({},i,e),this.setMpConfig(up,n),this.fetchFlags()},Ap.prototype.areFlagsReady=function(){return this.isSystemEnabled()||lp.error("Feature Flags not enabled"),!!this.flags},Ap.prototype.fetchFlags=function(){if(!this.isSystemEnabled())return Promise.resolve();var e=this.getMpProperty("distinct_id"),t=this.getMpProperty("$device_id"),n="00-"+Kd.UUID().replace(/-/g,"")+"-"+Kd.UUID().replace(/-/g,"").substring(0,16)+"-01";lp.log("Fetching flags for distinct ID: "+e);var i=Kd.extend({distinct_id:e,device_id:t},this.getConfig(dp)),r=new URLSearchParams;r.set("context",JSON.stringify(i)),r.set("token",this.getMpConfig("token")),r.set("mp_lib","web"),r.set("$lib_version",kd.LIB_VERSION);var o=this.getFullApiRoute()+"?"+r.toString();return this._fetchInProgressStartTime=Date.now(),this.fetchPromise=this.fetch.call(me,o,{method:"GET",headers:{Authorization:"Basic "+btoa(this.getMpConfig("token")+":"),traceparent:n}}).then(function(e){return this.markFetchComplete(),e.json().then(function(e){var t=e.flags;if(!t)throw new Error("No flags in API response");var i=new Map;Kd.each(t,function(e,t){i.set(t,{key:e.variant_key,value:e.variant_value,experiment_id:e.experiment_id,is_experiment_active:e.is_experiment_active,is_qa_tester:e.is_qa_tester})}),this.flags=i,this._traceparent=n}.bind(this)).catch(function(e){this.markFetchComplete(),lp.error(e)}.bind(this))}.bind(this)).catch(function(e){this.markFetchComplete(),lp.error(e)}.bind(this)),this.fetchPromise},Ap.prototype.markFetchComplete=function(){this._fetchInProgressStartTime?(this._fetchStartTime=this._fetchInProgressStartTime,this._fetchCompleteTime=Date.now(),this._fetchLatency=this._fetchCompleteTime-this._fetchStartTime,this._fetchInProgressStartTime=null):lp.error("Fetch in progress started time not set, cannot mark fetch complete")},Ap.prototype.getVariant=function(e,t){return this.fetchPromise?this.fetchPromise.then(function(){return this.getVariantSync(e,t)}.bind(this)).catch(function(e){return lp.error(e),t}):new Promise(function(e){lp.critical("Feature Flags not initialized"),e(t)})},Ap.prototype.getVariantSync=function(e,t){if(!this.areFlagsReady())return lp.log("Flags not loaded yet"),t;var n=this.flags.get(e);return n?(this.trackFeatureCheck(e,n),n):(lp.log('No flag found: "'+e+'"'),t)},Ap.prototype.getVariantValue=function(e,t){return this.getVariant(e,{value:t}).then(function(e){return e.value}).catch(function(e){return lp.error(e),t})},Ap.prototype.getFeatureData=function(e,t){return lp.critical("mixpanel.flags.get_feature_data() is deprecated and will be removed in a future release. Use mixpanel.flags.get_variant_value() instead."),this.getVariantValue(e,t)},Ap.prototype.getVariantValueSync=function(e,t){return this.getVariantSync(e,{value:t}).value},Ap.prototype.isEnabled=function(e,t){return this.getVariantValue(e).then(function(){return this.isEnabledSync(e,t)}.bind(this)).catch(function(e){return lp.error(e),t})},Ap.prototype.isEnabledSync=function(e,t){t=t||!1;var n=this.getVariantValueSync(e,t);return!0!==n&&!1!==n&&(lp.error('Feature flag "'+e+'" value: '+n+" is not a boolean; returning fallback value: "+t),n=t),n},Ap.prototype.trackFeatureCheck=function(e,t){if(!this.trackedFeatures.has(e)){this.trackedFeatures.add(e);var n={"Experiment name":e,"Variant name":t.key,$experiment_type:"feature_flag","Variant fetch start time":new Date(this._fetchStartTime).toISOString(),"Variant fetch complete time":new Date(this._fetchCompleteTime).toISOString(),"Variant fetch latency (ms)":this._fetchLatency,"Variant fetch traceparent":this._traceparent};"undefined"!==t.experiment_id&&(n.$experiment_id=t.experiment_id),"undefined"!==t.is_experiment_active&&(n.$is_experiment_active=t.is_experiment_active),"undefined"!==t.is_qa_tester&&(n.$is_qa_tester=t.is_qa_tester),this.track("$experiment_started",n)}},Ap.prototype.minApisSupported=function(){return!!this.fetch&&"undefined"!=typeof Promise&&"undefined"!=typeof Map&&"undefined"!=typeof Set},Xd(Ap),Ap.prototype.are_flags_ready=Ap.prototype.areFlagsReady,Ap.prototype.get_variant=Ap.prototype.getVariant,Ap.prototype.get_variant_sync=Ap.prototype.getVariantSync,Ap.prototype.get_variant_value=Ap.prototype.getVariantValue,Ap.prototype.get_variant_value_sync=Ap.prototype.getVariantValueSync,Ap.prototype.is_enabled=Ap.prototype.isEnabled,Ap.prototype.is_enabled_sync=Ap.prototype.isEnabledSync,Ap.prototype.update_context=Ap.prototype.updateContext,Ap.prototype.get_feature_data=Ap.prototype.getFeatureData;var pp=function(){};pp.prototype.create_properties=function(){},pp.prototype.event_handler=function(){},pp.prototype.after_track_handler=function(){},pp.prototype.init=function(e){return this.mp=e,this},pp.prototype.track=function(e,t,n,i){var r=this,o=Kd.dom_query(e);if(0!==o.length)return Kd.each(o,function(e){Kd.register_event(e,this.override_event,function(e){var o={},s=r.create_properties(n,this),a=r.mp.get_config("track_links_timeout");r.event_handler(e,this,o),window.setTimeout(r.track_callback(i,s,o,!0),a),r.mp.track(t,s,r.track_callback(i,s,o))})},this),!0;Hd.error("The DOM query ("+e+") returned 0 elements")},pp.prototype.track_callback=function(e,t,n,i){i=i||!1;var r=this;return function(){n.callback_fired||(n.callback_fired=!0,e&&!1===e(i,t)||r.after_track_handler(t,n,i))}},pp.prototype.create_properties=function(e,t){return"function"==typeof e?e(t):Kd.extend({},e)};var mp=function(){this.override_event="click"};Kd.inherit(mp,pp),mp.prototype.create_properties=function(e,t){var n=mp.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},mp.prototype.event_handler=function(e,t,n){n.new_tab=2===e.which||e.metaKey||e.ctrlKey||"_blank"===t.target,n.href=t.href,n.new_tab||e.preventDefault()},mp.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout(function(){window.location=t.href},0)};var fp=function(){this.override_event="submit"};Kd.inherit(fp,pp),fp.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()},fp.prototype.after_track_handler=function(e,t){setTimeout(function(){t.element.submit()},0)};var gp="$set",yp="$set_once",bp="$unset",wp="$add",vp="$append",kp="$union",xp="$remove",Cp={set_action:function(e,t){var n={},i={};return Kd.isObject(e)?Kd.each(e,function(e,t){this._is_reserved_property(t)||(i[t]=e)},this):i[e]=t,n[gp]=i,n},unset_action:function(e){var t={},n=[];return Kd.isArray(e)||(e=[e]),Kd.each(e,function(e){this._is_reserved_property(e)||n.push(e)},this),t[bp]=n,t},set_once_action:function(e,t){var n={},i={};return Kd.isObject(e)?Kd.each(e,function(e,t){this._is_reserved_property(t)||(i[t]=e)},this):i[e]=t,n[yp]=i,n},union_action:function(e,t){var n={},i={};return Kd.isObject(e)?Kd.each(e,function(e,t){this._is_reserved_property(t)||(i[t]=Kd.isArray(e)?e:[e])},this):i[e]=Kd.isArray(t)?t:[t],n[kp]=i,n},append_action:function(e,t){var n={},i={};return Kd.isObject(e)?Kd.each(e,function(e,t){this._is_reserved_property(t)||(i[t]=e)},this):i[e]=t,n[vp]=i,n},remove_action:function(e,t){var n={},i={};return Kd.isObject(e)?Kd.each(e,function(e,t){this._is_reserved_property(t)||(i[t]=e)},this):i[e]=t,n[xp]=i,n},delete_action:function(){var e={$delete:""};return e}},Sp=function(){};Kd.extend(Sp.prototype,Cp),Sp.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n},Sp.prototype.set=vh(function(e,t,n){var i=this.set_action(e,t);return Kd.isObject(e)&&(n=t),this._send_request(i,n)}),Sp.prototype.set_once=vh(function(e,t,n){var i=this.set_once_action(e,t);return Kd.isObject(e)&&(n=t),this._send_request(i,n)}),Sp.prototype.unset=vh(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)}),Sp.prototype.union=vh(function(e,t,n){Kd.isObject(e)&&(n=t);var i=this.union_action(e,t);return this._send_request(i,n)}),Sp.prototype.delete=vh(function(e){var t=this.delete_action();return this._send_request(t,e)}),Sp.prototype.remove=vh(function(e,t,n){var i=this.remove_action(e,t);return this._send_request(i,n)}),Sp.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var n=Kd.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._mixpanel.get_api_host("groups")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},t)},Sp.prototype._is_reserved_property=function(e){return"$group_key"===e||"$group_id"===e},Sp.prototype._get_config=function(e){return this._mixpanel.get_config(e)},Sp.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},Sp.prototype.remove=Sp.prototype.remove,Sp.prototype.set=Sp.prototype.set,Sp.prototype.set_once=Sp.prototype.set_once,Sp.prototype.union=Sp.prototype.union,Sp.prototype.unset=Sp.prototype.unset,Sp.prototype.toString=Sp.prototype.toString;var Bp=function(){};Kd.extend(Bp.prototype,Cp),Bp.prototype._init=function(e){this._mixpanel=e},Bp.prototype.set=wh(function(e,t,n){var i=this.set_action(e,t);return Kd.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),i[gp]=Kd.extend({},Kd.info.people_properties(),i[gp]),this._send_request(i,n)}),Bp.prototype.set_once=wh(function(e,t,n){var i=this.set_once_action(e,t);return Kd.isObject(e)&&(n=t),this._send_request(i,n)}),Bp.prototype.unset=wh(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)}),Bp.prototype.increment=wh(function(e,t,n){var i={},r={};return Kd.isObject(e)?(Kd.each(e,function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void Hd.error("Invalid increment value passed to mixpanel.people.increment - must be a number");r[t]=e}},this),n=t):(Kd.isUndefined(t)&&(t=1),r[e]=t),i[wp]=r,this._send_request(i,n)}),Bp.prototype.append=wh(function(e,t,n){Kd.isObject(e)&&(n=t);var i=this.append_action(e,t);return this._send_request(i,n)}),Bp.prototype.remove=wh(function(e,t,n){Kd.isObject(e)&&(n=t);var i=this.remove_action(e,t);return this._send_request(i,n)}),Bp.prototype.union=wh(function(e,t,n){Kd.isObject(e)&&(n=t);var i=this.union_action(e,t);return this._send_request(i,n)}),Bp.prototype.track_charge=wh(function(){Hd.error("mixpanel.people.track_charge() is deprecated and no longer has any effect.")}),Bp.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},Bp.prototype.delete_user=function(){if(this._identify_called()){var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)}Hd.error("mixpanel.people.delete_user() requires you to call identify() first")},Bp.prototype.toString=function(){return this._mixpanel.toString()+".people"},Bp.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),i=this._mixpanel.get_property("$user_id"),r=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),i&&(e.$user_id=i),r&&(e.$had_persisted_distinct_id=r);var o=Kd.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._mixpanel.get_api_host("people")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),Kd.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),Kd.truncate(o,255))},Bp.prototype._get_config=function(e){return this._mixpanel.get_config(e)},Bp.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},Bp.prototype._enqueue=function(e){gp in e?this._mixpanel.persistence._add_to_people_queue(gp,e):yp in e?this._mixpanel.persistence._add_to_people_queue(yp,e):bp in e?this._mixpanel.persistence._add_to_people_queue(bp,e):wp in e?this._mixpanel.persistence._add_to_people_queue(wp,e):vp in e?this._mixpanel.persistence._add_to_people_queue(vp,e):xp in e?this._mixpanel.persistence._add_to_people_queue(xp,e):kp in e?this._mixpanel.persistence._add_to_people_queue(kp,e):Hd.error("Invalid call to _enqueue():",e)},Bp.prototype._flush_one_queue=function(e,t,n,i){var r=this,o=Kd.extend({},this._mixpanel.persistence.load_queue(e)),s=o;Kd.isUndefined(o)||!Kd.isObject(o)||Kd.isEmptyObject(o)||(r._mixpanel.persistence._pop_from_people_queue(e,o),r._mixpanel.persistence.save(),i&&(s=i(o)),t.call(r,s,function(t,i){0===t&&r._mixpanel.persistence._add_to_people_queue(e,o),Kd.isUndefined(n)||n(t,i)}))},Bp.prototype._flush=function(e,t,n,i,r,o,s){var a=this;this._flush_one_queue(gp,this.set,e),this._flush_one_queue(yp,this.set_once,i),this._flush_one_queue(bp,this.unset,o,function(e){return Kd.keys(e)}),this._flush_one_queue(wp,this.increment,t),this._flush_one_queue(kp,this.union,r);var c=this._mixpanel.persistence.load_queue(vp);if(!Kd.isUndefined(c)&&Kd.isArray(c)&&c.length)for(var l,u=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(vp,l),Kd.isUndefined(n)||n(e,t)},d=c.length-1;d>=0;d--)c=this._mixpanel.persistence.load_queue(vp),l=c.pop(),a._mixpanel.persistence.save(),Kd.isEmptyObject(l)||a.append(l,u);var h=this._mixpanel.persistence.load_queue(xp);if(!Kd.isUndefined(h)&&Kd.isArray(h)&&h.length)for(var A,p=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(xp,A),Kd.isUndefined(s)||s(e,t)},m=h.length-1;m>=0;m--)h=this._mixpanel.persistence.load_queue(xp),A=h.pop(),a._mixpanel.persistence.save(),Kd.isEmptyObject(A)||a.remove(A,p)},Bp.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},Bp.prototype.set=Bp.prototype.set,Bp.prototype.set_once=Bp.prototype.set_once,Bp.prototype.unset=Bp.prototype.unset,Bp.prototype.increment=Bp.prototype.increment,Bp.prototype.append=Bp.prototype.append,Bp.prototype.remove=Bp.prototype.remove,Bp.prototype.union=Bp.prototype.union,Bp.prototype.track_charge=Bp.prototype.track_charge,Bp.prototype.clear_charges=Bp.prototype.clear_charges,Bp.prototype.delete_user=Bp.prototype.delete_user,Bp.prototype.toString=Bp.prototype.toString;var Ip,Ep="__mps",Mp="__mpso",Dp="__mpus",Qp="__mpa",Up="__mpap",Fp="__mpr",Np="__mpu",Tp="$people_distinct_id",Lp="__alias",Pp="__timers",Op=[Ep,Mp,Dp,Qp,Up,Fp,Np,Tp,Lp,Pp],Rp=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;"cookie"!==t&&"localStorage"!==t&&(Hd.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&Kd.localStorage.is_supported()?this.storage=Kd.localStorage:this.storage=Kd.cookie,this.load(),this.update_config(e),this.upgrade(),this.save()};Rp.prototype.properties=function(){var e={};return this.load(),Kd.each(this.props,function(t,n){Kd.include(Op,n)||(e[n]=t)}),e},Rp.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Kd.extend({},e))}},Rp.prototype.upgrade=function(){var e,t;this.storage===Kd.localStorage?(e=Kd.cookie.parse(this.name),Kd.cookie.remove(this.name),Kd.cookie.remove(this.name,!0),e&&this.register_once(e)):this.storage===Kd.cookie&&(t=Kd.localStorage.parse(this.name),Kd.localStorage.remove(this.name),t&&this.register_once(t))},Rp.prototype.save=function(){this.disabled||this.storage.set(this.name,lh(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},Rp.prototype.load_prop=function(e){return this.load(),this.props[e]},Rp.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},Rp.prototype.clear=function(){this.remove(),this.props={}},Rp.prototype.register_once=function(e,t,n){return!!Kd.isObject(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n,this.load(),Kd.each(e,function(e,n){this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e)},this),this.save(),!0)},Rp.prototype.register=function(e,t){return!!Kd.isObject(e)&&(this.expire_days=void 0===t?this.default_expiry:t,this.load(),Kd.extend(this.props,e),this.save(),!0)},Rp.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())},Rp.prototype.update_search_keyword=function(e){this.register(Kd.info.searchInfo(e))},Rp.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:Kd.info.referringDomain(e)||"$direct"},"")},Rp.prototype.get_referrer_info=function(){return Kd.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Rp.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},Rp.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},Rp.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},Rp.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},Rp.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},Rp.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Rp.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},Rp.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),i=t[e],r=this._get_or_create_queue(gp),o=this._get_or_create_queue(yp),s=this._get_or_create_queue(bp),a=this._get_or_create_queue(wp),c=this._get_or_create_queue(kp),l=this._get_or_create_queue(xp,[]),u=this._get_or_create_queue(vp,[]);n===Ep?(Kd.extend(r,i),this._pop_from_people_queue(wp,i),this._pop_from_people_queue(kp,i),this._pop_from_people_queue(bp,i)):n===Mp?(Kd.each(i,function(e,t){t in o||(o[t]=e)}),this._pop_from_people_queue(bp,i)):n===Dp?Kd.each(i,function(e){Kd.each([r,o,a,c],function(t){e in t&&delete t[e]}),Kd.each(u,function(t){e in t&&delete t[e]}),s[e]=!0}):n===Qp?(Kd.each(i,function(e,t){t in r?r[t]+=e:(t in a||(a[t]=0),a[t]+=e)},this),this._pop_from_people_queue(bp,i)):n===Np?(Kd.each(i,function(e,t){Kd.isArray(e)&&(t in c||(c[t]=[]),Kd.each(e,function(e){Kd.include(c[t],e)||c[t].push(e)}))}),this._pop_from_people_queue(bp,i)):n===Fp?(l.push(i),this._pop_from_people_queue(vp,i)):n===Up&&(u.push(i),this._pop_from_people_queue(bp,i)),Hd.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),Hd.log(t),this.save()},Rp.prototype._pop_from_people_queue=function(e,t){var n=this.props[this._get_queue_key(e)];Kd.isUndefined(n)||Kd.each(t,function(t,i){e===vp||e===xp?Kd.each(n,function(e){e[i]===t&&delete e[i]}):delete n[i]},this)},Rp.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))},Rp.prototype._get_queue_key=function(e){return e===gp?Ep:e===yp?Mp:e===bp?Dp:e===wp?Qp:e===vp?Up:e===xp?Fp:e===kp?Np:void Hd.error("Invalid queue:",e)},Rp.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=Kd.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},Rp.prototype.set_event_timer=function(e,t){var n=this.load_prop(Pp)||{};n[e]=t,this.props[Pp]=n,this.save()},Rp.prototype.remove_event_timer=function(e){var t=(this.load_prop(Pp)||{})[e];return Kd.isUndefined(t)||(delete this.props[Pp][e],this.save()),t};var zp,qp=function(e,t){throw new Error(e+" not available in this build.")},Yp="mixpanel",Kp="base64",Hp="$device:",Vp=me.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,jp=!Vp&&-1===Ld.indexOf("MSIE")&&-1===Ld.indexOf("Mozilla"),Zp=null;Ud.sendBeacon&&(Zp=function(){return Ud.sendBeacon.apply(Ud,arguments)});var Xp={track:"track/",engage:"engage/",groups:"groups/",record:"record/",flags:"flags/"},Gp={api_host:"https://api-js.mixpanel.com",api_hosts:{},api_routes:Xp,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",api_payload_format:Kp,app_host:"https://mixpanel.com",autocapture:!1,cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:ch,flags:!1,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:ch,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video, audio",record_canvas:!1,record_collect_fonts:!1,record_console:!0,record_heatmap_data:!1,record_idle_timeout_ms:18e5,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:xd,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},Wp=!1,Jp=function(){},_p=function(e,t,n){var i,r=n===Yp?zp:zp[n];if(r&&0===Ip)i=r;else{if(r&&!Kd.isArray(r))return void Hd.error("You have already initialized "+n);i=new Jp}if(i._cached_groups={},i._init(e,t,n),i.people=new Bp,i.people._init(i),!i.get_config("skip_first_touch_marketing")){var o=Kd.info.campaignParams(null),s={},a=!1;Kd.each(o,function(e,t){s["initial_"+t]=e,e&&(a=!0)}),a&&i.people.set_once(s)}kd.DEBUG=kd.DEBUG||i.get_config("debug");var c=0===Ip?"module":"snippet";return me.dispatchEvent(new me.CustomEvent("$mp_sdk_to_extension_event",{detail:{instance:i,source:c,token:e,name:n,info:Kd.info}})),!Kd.isUndefined(r)&&Kd.isArray(r)&&(i._execute_array.call(i.people,r.people),i._execute_array(r)),i};Jp.prototype.init=function(e,t,n){if(Kd.isUndefined(n))this.report_error("You must name your new library: init(token, config, name)");else{if(n!==Yp){var i=_p(e,t,n);return zp[n]=i,i._loaded(),i}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},Jp.prototype._init=function(e,t,n){t=t||{},this.__loaded=!0,this.config={};var i={};"api_payload_format"in t||(t.api_host||Gp.api_host).match(/\.mixpanel\.com/)&&(i.api_payload_format="json");if(this.hooks={},this.set_config(Kd.extend({},Gp,i,t,{name:n,token:e,callback_fn:(n===Yp?n:Yp+"."+n)+"._jsc"})),this._jsc=ch,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests)if(Kd.localStorage.is_supported(!0)&&Vp){if(this.init_batchers(),Zp&&me.addEventListener){var r=Kd.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);me.addEventListener("pagehide",function(e){e.persisted&&r()}),me.addEventListener("visibilitychange",function(){"hidden"===Fd.visibilityState&&r()})}}else this._batch_requests=!1,Hd.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),Kd.each(this.get_batcher_configs(),function(e){Hd.log("Clearing batch queue "+e.queue_key),Kd.localStorage.remove(e.queue_key)});this.persistence=this.cookie=new Rp(this.config),this.unpersisted_superprops={},this._gdpr_init();var o=Kd.UUID();this.get_distinct_id()||this.register_once({distinct_id:Hp+o,$device_id:o},""),this.flags=new Ap({getFullApiRoute:Kd.bind(function(){return this.get_api_host("flags")+"/"+this.get_config("api_routes").flags},this),getConfigFunc:Kd.bind(this.get_config,this),setConfigFunc:Kd.bind(this.set_config,this),getPropertyFunc:Kd.bind(this.get_property,this),trackingFunc:Kd.bind(this.track,this)}),this.flags.init(),this.flags=this.flags,this.autocapture=new cp(this),this.autocapture.init(),this._init_tab_id(),this._check_and_start_session_recording()},Jp.prototype._init_tab_id=function(){if(this.get_config("disable_persistence"))Hd.log("Tab ID initialization skipped due to disable_persistence config");else if(Kd.sessionStorage.is_supported())try{var e=this.get_config("name")+"_"+this.get_config("token"),t="mp_tab_id_"+e,n="mp_gen_new_tab_id_"+e;!Kd.sessionStorage.get(n)&&Kd.sessionStorage.get(t)||Kd.sessionStorage.set(t,"$tab-"+Kd.UUID()),Kd.sessionStorage.set(n,"1"),this.tab_id=Kd.sessionStorage.get(t),me.addEventListener("beforeunload",function(){Kd.sessionStorage.remove(n)})}catch(wU){this.report_error("Error initializing tab id",wU)}else this.report_error("Session storage is not supported, cannot keep track of unique tab ID.")},Jp.prototype.get_tab_id=function(){return this.tab_id||null},Jp.prototype._should_load_recorder=function(){if(this.get_config("disable_persistence"))return Hd.log("Load recorder check skipped due to disable_persistence config"),Promise.resolve(!1);var e=new ph(hh),t=this.get_tab_id();return e.init().then(function(){return e.getAll()}).then(function(e){for(var n=0;n<e.length;n++)if(Ph(e[n])||e[n].tabId===t)return!0;return!1}).catch(Kd.bind(function(e){this.report_error("Error checking recording registry",e)},this))},Jp.prototype._check_and_start_session_recording=bh(function(e){if(me.MutationObserver){var t=Kd.bind(function(e){var t=Kd.bind(function(){this._recorder=this._recorder||new me.__mp_recorder(this),this._recorder.resumeRecording(e)},this);Kd.isUndefined(me.__mp_recorder)?qp(this.get_config("recorder_src"),t):t()},this),n=this.get_config("record_sessions_percent")>0&&100*Math.random()<=this.get_config("record_sessions_percent");e||n?t(!0):this._should_load_recorder().then(function(e){e&&t(!1)})}else Hd.critical("Browser does not support MutationObserver; skipping session recording")}),Jp.prototype.start_session_recording=function(){this._check_and_start_session_recording(!0)},Jp.prototype.stop_session_recording=function(){return this._recorder?this._recorder.stopRecording():Promise.resolve()},Jp.prototype.pause_session_recording=function(){return this._recorder?this._recorder.pauseRecording():Promise.resolve()},Jp.prototype.resume_session_recording=function(){return this._recorder?this._recorder.resumeRecording():Promise.resolve()},Jp.prototype.is_recording_heatmap_data=function(){return this._get_session_replay_id()&&this.get_config("record_heatmap_data")},Jp.prototype.get_session_recording_properties=function(){var e={},t=this._get_session_replay_id();return t&&(e.$mp_replay_id=t),e},Jp.prototype.get_session_replay_url=function(){var e=null,t=this._get_session_replay_id();t&&(e="https://mixpanel.com/projects/replay-redirect?"+Kd.HTTPBuildQuery({replay_id:t,distinct_id:this.get_distinct_id(),token:this.get_config("token")}));return e},Jp.prototype._get_session_replay_id=function(){var e=null;return this._recorder&&(e=this._recorder.replayId),e||null},Jp.prototype.__get_recorder=function(){return this._recorder},Jp.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var e=Kd.info.campaignParams(null);Kd.each(e,function(e,t){this.unregister(t)}.bind(this))}},Jp.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(Fd.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(Kd.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(Fd.referrer)},Jp.prototype._dom_loaded=function(){Kd.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),this.has_opted_out_tracking()||Kd.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue},Jp.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!Wp)return this.__dom_loaded_queue.push([e,t]),!1;var n=(new e).init(this);return n.track.apply(n,t)},Jp.prototype._prepare_callback=function(e,t){if(Kd.isUndefined(e))return null;if(Vp){return function(n){e(n,t)}}var n=this._jsc,i=""+Math.floor(1e8*Math.random()),r=this.get_config("callback_fn")+"["+i+"]";return n[i]=function(r){delete n[i],e(r,t)},r},Jp.prototype._send_request=function(e,t,n,i){var r=!0;if(jp)return this.__request_queue.push(arguments),r;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;i||!Kd.isFunction(n)&&"string"!=typeof n||(i=n,n=null),n=Kd.extend(o,n||{}),Vp||(n.method="GET");var a="POST"===n.method,c=Zp&&a&&"sendbeacon"===n.transport.toLowerCase(),l=n.verbose;t.verbose&&(l=!0),this.get_config("test")&&(t.test=1),l&&(t.verbose=1),this.get_config("img")&&(t.img=1),Vp||(i?t.callback=i:(l||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),a&&(s="data="+encodeURIComponent(t.data),delete t.data),Kd.extend(t,this.get_config("api_extra_query_params")),e+="?"+Kd.HTTPBuildQuery(t);var u=this;if("img"in t){var d=Fd.createElement("img");d.src=e,Fd.body.appendChild(d)}else if(c){try{r=Zp(e,s)}catch(g){u.report_error(g),r=!1}try{i&&i(r?1:0)}catch(g){u.report_error(g)}}else if(Vp)try{var h=new XMLHttpRequest;h.open(n.method,e,!0);var A=this.get_config("xhr_headers");if(a&&(A["Content-Type"]="application/x-www-form-urlencoded"),Kd.each(A,function(e,t){h.setRequestHeader(t,e)}),n.timeout_ms&&void 0!==h.timeout){h.timeout=n.timeout_ms;var p=(new Date).getTime()}h.withCredentials=!0,h.onreadystatechange=function(){var e;if(4===h.readyState)if(200===h.status){if(i)if(l){var t;try{t=Kd.JSONDecode(h.responseText)}catch(g){if(u.report_error(g),!n.ignore_json_errors)return;t=h.responseText}i(t)}else i(Number(h.responseText))}else if(e=h.timeout&&!h.status&&(new Date).getTime()-p>=h.timeout?"timeout":"Bad HTTP status: "+h.status+" "+h.statusText,u.report_error(e),i)if(l){var r=h.responseHeaders||{};i({status:0,httpStatusCode:h.status,error:e,retryAfter:r["Retry-After"]})}else i(0)},h.send(s)}catch(g){u.report_error(g),r=!1}else{var m=Fd.createElement("script");m.type="text/javascript",m.async=!0,m.defer=!0,m.src=e;var f=Fd.getElementsByTagName("script")[0];f.parentNode.insertBefore(m,f)}return r},Jp.prototype._execute_array=function(e){var t,n=[],i=[],r=[];Kd.each(e,function(e){e&&(t=e[0],Kd.isArray(t)?r.push(e):"function"==typeof e?e.call(this):Kd.isArray(e)&&"alias"===t?n.push(e):Kd.isArray(e)&&-1!==t.indexOf("track")&&"function"==typeof this[t]?r.push(e):i.push(e))},this);var o=function(e,t){Kd.each(e,function(e){if(Kd.isArray(e[0])){var n=t;Kd.each(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};o(n,this),o(i,this),o(r,this)},Jp.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},Jp.prototype.get_batcher_configs=function(){var e="__mpq_"+this.get_config("token");return this._batcher_configs=this._batcher_configs||{events:{type:"events",api_name:"track",queue_key:e+"_ev"},people:{type:"people",api_name:"engage",queue_key:e+"_pp"},groups:{type:"groups",api_name:"groups",queue_key:e+"_gr"}},this._batcher_configs},Jp.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=Kd.bind(function(e){return new Lh(e.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:Kd.bind(function(t,n,i){var r=this.get_config("api_routes");this._send_request(this.get_api_host(e.api_name)+"/"+r[e.api_name],this._encode_data_for_request(t),n,this._prepare_callback(i,t))},this),beforeSendHook:Kd.bind(function(t){var n=this._run_hook("before_send_"+e.type,t);return n?n[0]:null},this),stopAllBatchingFunc:Kd.bind(this.stop_batch_senders,this),usePersistence:!0})},this),t=this.get_batcher_configs();this.request_batchers={events:e(t.events),people:e(t.people),groups:e(t.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},Jp.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,Kd.each(this.request_batchers,function(e){e.start()}))},Jp.prototype.stop_batch_senders=function(){this._batch_requests=!1,Kd.each(this.request_batchers,function(e){e.stop(),e.clear()})},Jp.prototype.push=function(e){this._execute_array([e])},Jp.prototype.disable=function(e){void 0===e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},Jp.prototype._encode_data_for_request=function(e){var t=lh(e);return this.get_config("api_payload_format")===Kp&&(t=Kd.base64Encode(t)),{data:t}},Jp.prototype._track_or_batch=function(e,t){var n=Kd.truncate(e.data,255),i=e.endpoint,r=e.batcher,o=e.should_send_immediately,s=e.send_request_options||{};t=t||ch;var a=!0,c=Kd.bind(function(){return s.skip_hooks||(n=this._run_hook("before_send_"+e.type,n))&&(n=n[0]),n?(Hd.log("MIXPANEL REQUEST:"),Hd.log(n),this._send_request(i,this._encode_data_for_request(n),s,this._prepare_callback(t,n))):null},this);return this._batch_requests&&!o?r.enqueue(n).then(function(e){e?t(1,n):c()}):a=c(),a&&n},Jp.prototype.track=bh(function(e,t,n,i){var r;if(!n||!n.skip_hooks){if(null===(r=this._run_hook("before_track",e,t)))return;e=r[0],t=r[1]}i||"function"!=typeof n||(i=n,n=null);var o=(n=n||{}).transport;o&&(n.transport=o);var s=n.send_immediately;if("function"!=typeof i&&(i=ch),Kd.isUndefined(e))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(e)){(t=Kd.extend({},t)).token=this.get_config("token");var a=this.persistence.remove_event_timer(e);if(!Kd.isUndefined(a)){var c=(new Date).getTime()-a;t.$duration=parseFloat((c/1e3).toFixed(3))}this._set_default_superprops();var l=this.get_config("track_marketing")?Kd.info.marketingParams():{};t=Kd.extend({},Kd.info.properties({mp_loader:this.get_config("mp_loader")}),l,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),t);var u=this.get_config("property_blacklist");Kd.isArray(u)?Kd.each(u,function(e){delete t[e]}):this.report_error("Invalid value for property_blacklist config: "+u);var d={event:e,properties:t};return r=this._track_or_batch({type:"events",data:d,endpoint:this.get_api_host("events")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:s,send_request_options:n},i)}i(0)}}),Jp.prototype.set_group=bh(function(e,t,n){Kd.isArray(t)||(t=[t]);var i={};return i[e]=t,this.register(i),this.people.set(e,t,n)}),Jp.prototype.add_group=bh(function(e,t,n){var i=this.get_property(e),r={};return void 0===i?(r[e]=[t],this.register(r)):-1===i.indexOf(t)&&(i.push(t),r[e]=i,this.register(r)),this.people.union(e,t,n)}),Jp.prototype.remove_group=bh(function(e,t,n){var i=this.get_property(e);if(void 0!==i){var r=i.indexOf(t);r>-1&&(i.splice(r,1),this.register({group_key:i})),0===i.length&&this.unregister(e)}return this.people.remove(e,t,n)}),Jp.prototype.track_with_groups=bh(function(e,t,n,i){var r=Kd.extend({},t||{});return Kd.each(n,function(e,t){null!=e&&(r[t]=e)}),this.track(e,r,i)}),Jp.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},Jp.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},Jp.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),i=this._cached_groups[n];return void 0!==i&&i._group_key===e&&i._group_id===t||((i=new Sp)._init(this,e,t),this._cached_groups[n]=i),i},Jp.prototype.track_pageview=bh(function(e,t){"object"!=typeof e&&(e={});var n=(t=t||{}).event_name||"$mp_web_page_view",i=Kd.extend(Kd.info.mpPageViewProperties(),Kd.info.campaignParams(),Kd.info.clickParams()),r=Kd.extend({},i,e);return this.track(n,r)}),Jp.prototype.track_links=function(){return this._track_dom.call(this,mp,arguments)},Jp.prototype.track_forms=function(){return this._track_dom.call(this,fp,arguments)},Jp.prototype.time_event=function(e){Kd.isUndefined(e)?this.report_error("No event name provided to mixpanel.time_event"):this._event_is_disabled(e)||this.persistence.set_event_timer(e,(new Date).getTime())};var $p={persistent:!0},em=function(e){var t;return t=Kd.isObject(e)?e:Kd.isUndefined(e)?{}:{days:e},Kd.extend({},$p,t)};Jp.prototype.register=function(e,t){var n=this._run_hook("before_register",e,t);if(null!==n){e=n[0],t=n[1];var i=em(t);i.persistent?this.persistence.register(e,i.days):Kd.extend(this.unpersisted_superprops,e)}},Jp.prototype.register_once=function(e,t,n){var i=this._run_hook("before_register_once",e,t,n);if(null!==i){e=i[0],t=i[1],n=i[2];var r=em(n);r.persistent?this.persistence.register_once(e,t,r.days):(void 0===t&&(t="None"),Kd.each(e,function(e,n){this.unpersisted_superprops.hasOwnProperty(n)&&this.unpersisted_superprops[n]!==t||(this.unpersisted_superprops[n]=e)},this))}},Jp.prototype.unregister=function(e,t){var n=this._run_hook("before_unregister",e,t);null!==n&&(e=n[0],t=n[1],(t=em(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e])},Jp.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},Jp.prototype.identify=function(e,t,n,i,r,o,s,a){var c=this._run_hook("before_identify",e);if(null===c)return-1;e=c[0];var l=this.get_distinct_id();if(e&&l!==e){if("string"==typeof e&&0===e.indexOf(Hp))return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var u=l;this.register_once({$had_persisted_distinct_id:!0,$device_id:u},"")}e!==l&&e!==this.get_property(Lp)&&(this.unregister(Lp),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,i,r,o,s,a),e!==l&&this.track("$identify",{distinct_id:e,$anon_distinct_id:l},{skip_hooks:!0}),e!==l&&this.flags.fetchFlags()},Jp.prototype.reset=function(){this.stop_session_recording(),this.persistence.clear(),this._flags.identify_called=!1;var e=Kd.UUID();this.register_once({distinct_id:Hp+e,$device_id:e},""),this._check_and_start_session_recording()},Jp.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},Jp.prototype.alias=function(e,t){if(e===this.get_property(Tp))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return Kd.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Lp,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},function(){n.identify(e)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},Jp.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},Jp.prototype.set_config=function(e){Kd.isObject(e)&&(Kd.extend(this.config,e),e.batch_size&&Kd.each(this.request_batchers,function(e){e.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),kd.DEBUG=kd.DEBUG||this.get_config("debug"),("autocapture"in e||"record_heatmap_data"in e)&&this.autocapture&&this.autocapture.init(),Kd.isObject(e.hooks)&&(this.hooks={},Kd.each(e.hooks,function(e,t){if(Kd.isFunction(e))this.hooks[t]=[e];else if(Kd.isArray(e)){this.hooks[t]=[];for(var n=0;n<e.length;n++)Kd.isFunction(e[n])||Hd.critical("Invalid hook added. Hook is not a function"),this.hooks[t].push(e[n])}else Hd.critical("Invalid hooks added. Ensure that the hook values passed into config.hooks are functions or arrays of functions.")},this)))},Jp.prototype.get_config=function(e){return this.config[e]},Jp.prototype._run_hook=function(e){var t=Ed.call(arguments,1);return Kd.each(this.hooks[e],function(n){if(null===t)return null;var i=n.apply(this,t);void 0===i?(this.report_error(e+" hook did not return a valid value"),t=null):(Kd.isArray(i)||(i=[i]),t.splice.apply(t,[0,i.length].concat(i)))},this),t},Jp.prototype.get_property=function(e){return this.persistence.load_prop([e])},Jp.prototype.get_api_host=function(e){return this.get_config("api_hosts")[e]||this.get_config("api_host")},Jp.prototype.toString=function(){var e=this.get_config("name");return e!==Yp&&(e=Yp+"."+e),e},Jp.prototype._event_is_disabled=function(e){return Kd.isBlockedUA(Ld)||this._flags.disable_all_events||Kd.include(this.__disabled_events,e)},Jp.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&Kd.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_tracking()||!this.get_config("opt_out_tracking_by_default")&&!Kd.cookie.get("mp_optout")||(Kd.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},Jp.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t),t?(this.stop_batch_senders(),this.stop_session_recording()):this._batchers_were_started&&this.start_batch_senders()},Jp.prototype._gdpr_call_func=function(e,t){return t=Kd.extend({track:Kd.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),Kd.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})},Jp.prototype.opt_in_tracking=function(e){e=Kd.extend({enable_persistence:!0},e),this._gdpr_call_func(mh,e),this._gdpr_update_persistence(e)},Jp.prototype.opt_out_tracking=function(e){(e=Kd.extend({clear_persistence:!0,delete_user:!0},e)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(fh,e),this._gdpr_update_persistence(e)},Jp.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(gh,e)},Jp.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(yh,e)},Jp.prototype.clear_opt_in_out_tracking=function(e){e=Kd.extend({enable_persistence:!0},e),this._gdpr_call_func(kh,e),this._gdpr_update_persistence(e)},Jp.prototype.report_error=function(e,t){Hd.error.apply(Hd.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){Hd.error(n)}},Jp.prototype.add_hook=function(e,t){this.hooks[e]||(this.hooks[e]=[]),this.hooks[e].push(t)},Jp.prototype.remove_hook=function(e,t){var n;this.hooks[e]&&(-1!==(n=this.hooks[e].indexOf(t))?this.hooks[e].splice(n,1):Hd.log("remove_hook failed. Matching hook was not found"))},Jp.prototype.init=Jp.prototype.init,Jp.prototype.reset=Jp.prototype.reset,Jp.prototype.disable=Jp.prototype.disable,Jp.prototype.time_event=Jp.prototype.time_event,Jp.prototype.track=Jp.prototype.track,Jp.prototype.track_links=Jp.prototype.track_links,Jp.prototype.track_forms=Jp.prototype.track_forms,Jp.prototype.track_pageview=Jp.prototype.track_pageview,Jp.prototype.register=Jp.prototype.register,Jp.prototype.register_once=Jp.prototype.register_once,Jp.prototype.unregister=Jp.prototype.unregister,Jp.prototype.identify=Jp.prototype.identify,Jp.prototype.alias=Jp.prototype.alias,Jp.prototype.name_tag=Jp.prototype.name_tag,Jp.prototype.set_config=Jp.prototype.set_config,Jp.prototype.get_config=Jp.prototype.get_config,Jp.prototype.get_api_host=Jp.prototype.get_api_host,Jp.prototype.get_property=Jp.prototype.get_property,Jp.prototype.get_distinct_id=Jp.prototype.get_distinct_id,Jp.prototype.toString=Jp.prototype.toString,Jp.prototype.opt_out_tracking=Jp.prototype.opt_out_tracking,Jp.prototype.opt_in_tracking=Jp.prototype.opt_in_tracking,Jp.prototype.has_opted_out_tracking=Jp.prototype.has_opted_out_tracking,Jp.prototype.has_opted_in_tracking=Jp.prototype.has_opted_in_tracking,Jp.prototype.clear_opt_in_out_tracking=Jp.prototype.clear_opt_in_out_tracking,Jp.prototype.get_group=Jp.prototype.get_group,Jp.prototype.set_group=Jp.prototype.set_group,Jp.prototype.add_group=Jp.prototype.add_group,Jp.prototype.remove_group=Jp.prototype.remove_group,Jp.prototype.add_hook=Jp.prototype.add_hook,Jp.prototype.remove_hook=Jp.prototype.remove_hook,Jp.prototype.track_with_groups=Jp.prototype.track_with_groups,Jp.prototype.start_batch_senders=Jp.prototype.start_batch_senders,Jp.prototype.stop_batch_senders=Jp.prototype.stop_batch_senders,Jp.prototype.start_session_recording=Jp.prototype.start_session_recording,Jp.prototype.stop_session_recording=Jp.prototype.stop_session_recording,Jp.prototype.pause_session_recording=Jp.prototype.pause_session_recording,Jp.prototype.resume_session_recording=Jp.prototype.resume_session_recording,Jp.prototype.get_session_recording_properties=Jp.prototype.get_session_recording_properties,Jp.prototype.get_session_replay_url=Jp.prototype.get_session_replay_url,Jp.prototype.get_tab_id=Jp.prototype.get_tab_id,Jp.prototype.DEFAULT_API_ROUTES=Xp,Jp.prototype.__get_recorder=Jp.prototype.__get_recorder,Rp.prototype.properties=Rp.prototype.properties,Rp.prototype.update_search_keyword=Rp.prototype.update_search_keyword,Rp.prototype.update_referrer_info=Rp.prototype.update_referrer_info,Rp.prototype.get_cross_subdomain=Rp.prototype.get_cross_subdomain,Rp.prototype.clear=Rp.prototype.clear;var tm={},nm=function(){zp.init=function(e,t,n){if(n)return zp[n]||(zp[n]=tm[n]=_p(e,t,n),zp[n]._loaded()),zp[n];var i=zp;tm[Yp]?i=tm[Yp]:e&&((i=_p(e,t,Yp))._loaded(),tm[Yp]=i),zp=i,1===Ip&&(me[Yp]=zp),Kd.each(tm,function(e,t){t!==Yp&&(zp[t]=e)}),zp._=Kd}};var im=(qp=function(e,t){t()},Ip=0,zp=new Jp,nm(),zp.init(),function(){function e(){e.done||(e.done=!0,Wp=!0,jp=!1,Kd.each(tm,function(e){e._dom_loaded()}))}if(Fd.addEventListener)"complete"===Fd.readyState?e():Fd.addEventListener("DOMContentLoaded",e,!1);else if(Fd.attachEvent){Fd.attachEvent("onreadystatechange",e);var t=!1;try{t=null===me.frameElement}catch(n){}Fd.documentElement.doScroll&&t&&function t(){try{Fd.documentElement.doScroll("left")}catch(n){return void setTimeout(t,1)}e()}()}Kd.register_event(me,"load",e,!0)}(),zp);let rm=!1;const om=()=>{rm||(im.init("c9fdb235976ef567b15bcb07bad264f3",{debug:!1,track_pageview:!1,persistence:"localStorage"}),rm=!0)},sm={init:()=>{om()},track:(e,t={})=>{rm||om(),im.track(e,{source:"coinley-sdk",...t,timestamp:(new Date).toISOString()})},trackModalOpened:(e,t)=>{sm.track("SDK Modal Opened",{merchant_name:e,amount:t})},trackModalClosed:(e="user_closed")=>{sm.track("SDK Modal Closed",{reason:e})},trackNetworkSelected:(e,t)=>{sm.track("Network Selected",{network:e,merchant_name:t})},trackTokenSelected:(e,t,n)=>{sm.track("Token Selected",{token:e,network:t,merchant_name:n})},trackWalletConnectStarted:e=>{sm.track("Wallet Connect Started",{wallet_type:e})},trackWalletConnected:(e,t,n)=>{sm.track("Wallet Connected",{wallet_type:e,wallet_address:(null==t?void 0:t.slice(0,10))+"...",network:n})},trackWalletConnectionFailed:(e,t)=>{sm.track("Wallet Connection Failed",{wallet_type:e,error:(null==t?void 0:t.message)||t})},trackWalletDisconnected:()=>{sm.track("Wallet Disconnected")},trackPaymentCreated:(e,t,n,i)=>{sm.track("Payment Created",{payment_id:e,amount:t,network:n,token:i})},trackPaymentApprovalStarted:(e,t)=>{sm.track("Payment Approval Started",{payment_id:e,amount:t})},trackPaymentApproved:(e,t)=>{sm.track("Payment Approved",{payment_id:e,amount:t})},trackPaymentExecutionStarted:(e,t)=>{sm.track("Payment Execution Started",{payment_id:e,amount:t})},trackPaymentSuccess:(e,t,n,i,r)=>{sm.track("Payment Success",{payment_id:e,amount:t,network:n,token:i,transaction_hash:r})},trackPaymentFailed:(e,t,n,i,r)=>{sm.track("Payment Failed",{payment_id:e,amount:t,network:n,token:i,error:(null==r?void 0:r.message)||r})},trackPaymentCancelled:(e,t)=>{sm.track("Payment Cancelled",{payment_id:e,stage:t})},trackError:(e,t,n={})=>{sm.track("SDK Error",{error_type:e,error_message:t,...n})},trackNetworkSwitchRequested:(e,t)=>{sm.track("Network Switch Requested",{from_network:e,to_network:t})},trackNetworkSwitchSuccess:e=>{sm.track("Network Switch Success",{network:e})},trackNetworkSwitchFailed:(e,t)=>{sm.track("Network Switch Failed",{network:e,error:(null==t?void 0:t.message)||t})}};let am=!1;const cm=(e,t)=>{"undefined"!=typeof window&&window.clarity&&window.clarity("set",e,t)},lm={init:e=>((e="v0r7eqoiy1")=>{var t,n,i,r,o,s,a;am||"undefined"==typeof window||(t=window,n=document,r="script",o=e,t[i="clarity"]=t[i]||function(){(t[i].q=t[i].q||[]).push(arguments)},(s=n.createElement(r)).async=1,s.src="https://www.clarity.ms/tag/"+o,(a=n.getElementsByTagName(r)[0]).parentNode.insertBefore(s,a),am=!0)})(e),trackModalOpened:(e,t)=>{cm("event","modal_opened"),cm("merchant",e||"unknown"),cm("amount",String(t||0))},trackModalClosed:e=>{cm("event","modal_closed"),cm("close_reason",e||"unknown")},trackNetworkSelected:(e,t)=>{cm("event","network_selected"),cm("network",e||"unknown")},trackTokenSelected:(e,t,n)=>{cm("event","token_selected"),cm("token",e||"unknown"),cm("network",t||"unknown")},trackPaymentCreated:(e,t,n,i)=>{cm("event","payment_created"),cm("payment_id",e||"unknown"),cm("network",n||"unknown"),cm("token",i||"unknown")},trackPaymentSuccess:(e,t,n,i,r)=>{cm("event","payment_success"),cm("payment_id",e||"unknown"),cm("network",n||"unknown"),cm("token",i||"unknown")},trackPaymentFailed:(e,t,n,i,r)=>{cm("event","payment_failed"),cm("payment_id",e||"unknown"),cm("error",String(r||"unknown").substring(0,100))},trackError:(e,t,n)=>{cm("event","error"),cm("error_type",e||"unknown"),cm("error_message",String(t||"").substring(0,100))},identify:(e,t)=>((e,t)=>{"undefined"!=typeof window&&window.clarity&&window.clarity("identify",e,t)})(e,t)},um={USD:{id:2781,symbol:"USD",name:"US Dollar",sign:"$"},NGN:{id:2819,symbol:"NGN",name:"Nigerian Naira",sign:"₦"},GHS:{id:2796,symbol:"GHS",name:"Ghana Cedis",sign:"GH₵"},ZAR:{id:2812,symbol:"ZAR",name:"South African Rand",sign:"R"},EUR:{id:2790,symbol:"EUR",name:"Euro",sign:"€"},GBP:{id:2791,symbol:"GBP",name:"British Pound",sign:"£"}};let dm={rates:{},timestamp:0,TTL:3e5};const hm=e=>e&&um.hasOwnProperty(e.toUpperCase()),Am=e=>e&&um[e.toUpperCase()]||null,pm=async()=>{var e,t;const n=Date.now();if(dm.timestamp&&n-dm.timestamp<dm.TTL)return dm.rates;try{const i=Object.keys(um).filter(e=>"USD"!==e),r=await fetch(`https://pro-api.coinmarketcap.com/v2/tools/price-conversion?amount=1&symbol=USD&convert=${i.join(",")}`,{headers:{"X-CMC_PRO_API_KEY":"fa1c508f6c3649f082a2bb1ad7962d60",Accept:"application/json"}});if(!r.ok)throw new Error(`CoinMarketCap API error: ${r.status}`);const o=await r.json();if(0!==(null==(e=o.status)?void 0:e.error_code))throw new Error((null==(t=o.status)?void 0:t.error_message)||"Unknown API error");const s={USD:1};if(o.data&&o.data[0]&&o.data[0].quote)for(const e of i)o.data[0].quote[e]&&(s[e]=o.data[0].quote[e].price);return dm={rates:s,timestamp:n,TTL:dm.TTL},s}catch(gd){if(console.error("[CurrencyConversion] Failed to fetch rates:",gd),Object.keys(dm.rates).length>0)return console.warn("[CurrencyConversion] Using stale cached rates"),dm.rates;const t={USD:1,NGN:1550,GHS:15.5,ZAR:18.5,EUR:.92,GBP:.79};return console.warn("[CurrencyConversion] Using fallback rates:",t),t}},mm=async(e,t)=>{const n=(null==t?void 0:t.toUpperCase())||"USD";if("USD"===n)return{usdAmount:parseFloat(e),rate:1,fromCurrency:"USD"};if(!hm(n))throw new Error(`Unsupported currency: ${n}. Supported: ${Object.keys(um).join(", ")}`);const i=(await pm())[n];if(!i)throw new Error(`Exchange rate not available for ${n}`);const r=parseFloat(e)/i;return{usdAmount:Math.round(100*r)/100,rate:i,fromCurrency:n}},fm=(e,t)=>{const n=(null==t?void 0:t.toUpperCase())||"USD",i=Am(n);if(!i)return`${e} ${n}`;const r=new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e);return`${i.sign}${r}`},gm=async()=>{try{return await pm(),!0}catch(gd){return console.error("[CurrencyConversion] Prefetch failed:",gd),!1}},ym={};function bm(e,t,n,i){if(!e||"object"!=typeof e)return{valid:!1,error:"Invalid payload"};if(!t||"string"!=typeof t)return{valid:!1,error:"Missing signature"};if(!n)return{valid:!1,error:"Missing timestamp"};if(!i||i.length<32)return{valid:!1,error:"Webhook secret must be at least 32 characters"};const r="string"==typeof n?parseInt(n,10):n;if(isNaN(r))return{valid:!1,error:"Invalid timestamp"};if(Date.now()-r>3e5)return{valid:!1,error:"Webhook timestamp too old (potential replay attack)"};const o={...e,timestamp:parseInt(r)},s=JSON.stringify(o,Object.keys(o).sort()),a=ym.createHmac("sha256",i).update(s).digest("hex"),c=t.startsWith("sha256=")?t.slice(7):t;try{const e=B.from(c,"hex"),t=B.from(a,"hex");if(e.length!==t.length)return{valid:!1,error:"Invalid webhook signature"};if(!ym.timingSafeEqual(e,t))return{valid:!1,error:"Invalid webhook signature"}}catch{return{valid:!1,error:"Invalid webhook signature"}}return{valid:!0}}"undefined"!=typeof window&&(window.Buffer=M),"undefined"!=typeof globalThis&&(globalThis.Buffer=M);const wm={formatAmount:(e,t=2)=>e.toFixed(t),truncateAddress:(e,t=6,n=4)=>e?e.length<=t+n?e:`${e.slice(0,t)}...${e.slice(-n)}`:"",isValidAddress:(e,t)=>{if(!e)return!1;switch(t.toLowerCase()){case"ethereum":case"bsc":case"polygon":return/^0x[a-fA-F0-9]{40}$/.test(e);case"tron":return/^T[a-zA-Z0-9]{33}$/.test(e);case"solana":return/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(e);default:return e.length>0}},copyToClipboard:async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}};class vm extends Error{constructor(e,t){super(e),this.name="CoinleyError",this.code=t}}const km={react:"\nimport { CoinleyProvider, CoinleyCheckout } from 'coinley-test';\n\n// New recommended way - using publicKey only\n<CoinleyProvider\n publicKey=\"pk_your-public-key\"\n apiUrl=\"https://api.coinley.io\"\n>\n <CoinleyCheckout\n ref={checkoutRef}\n onSuccess={({ paymentId, transactionHash, senderAddress, network, currency, paymentDetails }) => {\n console.log('Payment successful!');\n console.log('Payment ID:', paymentId);\n console.log('Transaction Hash:', transactionHash);\n console.log('Sender Address:', senderAddress); // Wallet address that made the payment\n console.log('Network:', network); // e.g., 'ethereum', 'bsc', 'polygon'\n console.log('Currency:', currency); // e.g., 'USDT', 'USDC'\n console.log('Full Details:', paymentDetails);\n }}\n onError={(error) => console.error('Error:', error)}\n onClose={() => console.log('Closed')}\n />\n</CoinleyProvider>\n\n// Legacy way (still supported) - using apiKey + apiSecret\n<CoinleyProvider\n apiKey=\"your-api-key\"\n apiSecret=\"your-api-secret\"\n apiUrl=\"https://api.coinley.io\"\n>\n ...\n</CoinleyProvider>\n ",vanilla:'\n\x3c!-- Include via CDN --\x3e\n<script src="https://unpkg.com/coinley-test@latest/vanilla"><\/script>\n<link rel="stylesheet" href="https://unpkg.com/coinley-test@latest/vanilla/style.css">\n\n<script>\n// New recommended way - using publicKey only\nconst coinley = new CoinleyVanilla({\n publicKey: "pk_your-public-key",\n apiUrl: "https://api.coinley.io",\n theme: "light"\n});\n\n// Legacy way (still supported)\nconst coinleyLegacy = new CoinleyVanilla({\n apiKey: "your-api-key",\n apiSecret: "your-api-secret",\n apiUrl: "https://api.coinley.io",\n theme: "light"\n});\n\n// Use in checkout\ncoinley.open({\n amount: 100,\n currency: "USD", // Supported: USD, EUR, NGN, GHS, ZAR\n customerEmail: "customer@example.com",\n merchantName: "Your Store",\n merchantWalletAddresses: {\n ethereum: "0x...",\n bsc: "0x..."\n }\n}, {\n onSuccess: ({ paymentId, transactionHash, senderAddress, network, currency, paymentDetails }) => {\n console.log(\'Payment successful!\');\n console.log(\'Sender Address:\', senderAddress); // Wallet that made the payment\n console.log(\'Network:\', network); // e.g., \'ethereum\', \'bsc\'\n console.log(\'Currency:\', currency); // e.g., \'USDT\', \'USDC\'\n },\n onError: (error) => console.error(\'Error:\', error),\n onClose: () => console.log(\'Closed\')\n});\n<\/script>\n '};function xm(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};return Object.assign(t,{extend:function e(t){return n=>{const i="function"==typeof n?n(t):n,r={...t,...i};return Object.assign(r,{extend:e(r)})}}(t)})}const Cm="2.45.0";let Sm={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Cm}`};class Bm extends Error{constructor(e,t={}){var n;const i=t.cause instanceof Bm?t.cause.details:(null==(r=t.cause)?void 0:r.message)?t.cause.message:t.details;var r;const o=t.cause instanceof Bm&&t.cause.docsPath||t.docsPath,s=null==(n=Sm.getDocsUrl)?void 0:n.call(Sm,{...t,docsPath:o});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...i?[`Details: ${i}`]:[],...Sm.version?[`Version: ${Sm.version}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=i,this.docsPath=o,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=Cm}walk(e){return Im(this,e)}}function Im(e,t){return(null==t?void 0:t(e))?e:e&&"object"==typeof e&&"cause"in e&&void 0!==e.cause?Im(e.cause,t):t?null:e}class Em extends Bm{constructor({max:e,min:t,signed:n,size:i,value:r}){super(`Number "${r}" is not in safe ${i?`${8*i}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class Mm extends Bm{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function Dm(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function Qm(e){return Dm(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function Um(e,{dir:t="left"}={}){let n="string"==typeof e?e.replace("0x",""):e,i=0;for(let r=0;r<n.length-1&&"0"===n["left"===t?r:n.length-r-1].toString();r++)i++;return n="left"===t?n.slice(i):n.slice(0,n.length-i),"string"==typeof e?(1===n.length&&"right"===t&&(n=`${n}0`),`0x${n.length%2==1?`0${n}`:n}`):n}class Fm extends Bm{constructor({offset:e,position:t,size:n}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}class Nm extends Bm{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function Tm(e,{dir:t,size:n=32}={}){return"string"==typeof e?function(e,{dir:t,size:n=32}={}){if(null===n)return e;const i=e.replace("0x","");if(i.length>2*n)throw new Nm({size:Math.ceil(i.length/2),targetSize:n,type:"hex"});return`0x${i["right"===t?"padEnd":"padStart"](2*n,"0")}`}(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new Nm({size:e.length,targetSize:n,type:"bytes"});const i=new Uint8Array(n);for(let r=0;r<n;r++){const o="right"===t;i[o?r:n-r-1]=e[o?r:e.length-r-1]}return i}(e,{dir:t,size:n})}const Lm=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Pm(e,t={}){return"number"==typeof e||"bigint"==typeof e?Rm(e,t):"string"==typeof e?function(e,t={}){const n=zm.encode(e);return Om(n,t)}(e,t):"boolean"==typeof e?function(e,t={}){const n=`0x${Number(e)}`;if("number"==typeof t.size)return Zm(n,{size:t.size}),Tm(n,{size:t.size});return n}(e,t):Om(e,t)}function Om(e,t={}){let n="";for(let r=0;r<e.length;r++)n+=Lm[e[r]];const i=`0x${n}`;return"number"==typeof t.size?(Zm(i,{size:t.size}),Tm(i,{dir:"right",size:t.size})):i}function Rm(e,t={}){const{signed:n,size:i}=t,r=BigInt(e);let o;i?o=n?(1n<<8n*BigInt(i)-1n)-1n:2n**(8n*BigInt(i))-1n:"number"==typeof e&&(o=BigInt(Number.MAX_SAFE_INTEGER));const s="bigint"==typeof o&&n?-o-1n:0;if(o&&r>o||r<s){const t="bigint"==typeof e?"n":"";throw new Em({max:o?`${o}${t}`:void 0,min:`${s}${t}`,signed:n,size:i,value:`${e}${t}`})}const a=`0x${(n&&r<0?(1n<<BigInt(8*i))+BigInt(r):r).toString(16)}`;return i?Tm(a,{size:i}):a}const zm=new TextEncoder;const qm=new TextEncoder;function Ym(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=Rm(e,t);return Vm(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return Zm(n,{size:t.size}),Tm(n,{size:t.size});return n}(e,t):Dm(e)?Vm(e,t):jm(e,t)}const Km={zero:48,nine:57,A:65,F:70,a:97,f:102};function Hm(e){return e>=Km.zero&&e<=Km.nine?e-Km.zero:e>=Km.A&&e<=Km.F?e-(Km.A-10):e>=Km.a&&e<=Km.f?e-(Km.a-10):void 0}function Vm(e,t={}){let n=e;t.size&&(Zm(n,{size:t.size}),n=Tm(n,{dir:"right",size:t.size}));let i=n.slice(2);i.length%2&&(i=`0${i}`);const r=i.length/2,o=new Uint8Array(r);for(let s=0,a=0;s<r;s++){const e=Hm(i.charCodeAt(a++)),t=Hm(i.charCodeAt(a++));if(void 0===e||void 0===t)throw new Bm(`Invalid byte sequence ("${i[a-2]}${i[a-1]}" in "${i}").`);o[s]=16*e+t}return o}function jm(e,t={}){const n=qm.encode(e);return"number"==typeof t.size?(Zm(n,{size:t.size}),Tm(n,{dir:"right",size:t.size})):n}function Zm(e,{size:t}){if(Qm(e)>t)throw new Mm({givenSize:Qm(e),maxSize:t})}function Xm(e,t={}){const{signed:n}=t;t.size&&Zm(e,{size:t.size});const i=BigInt(e);if(!n)return i;const r=(e.length-2)/2;return i<=(1n<<8n*BigInt(r)-1n)-1n?i:i-BigInt(`0x${"f".padStart(2*r,"f")}`)-1n}function Gm(e,t={}){const n=Xm(e,t),i=Number(n);if(!Number.isSafeInteger(i))throw new Em({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${n}n`});return i}function Wm(e,t){return({exclude:n,format:i})=>({exclude:n,format:(e,r)=>{const o=t(e,r);if(n)for(const t of n)delete o[t];return{...o,...i(e,r)}},type:e})}const Jm={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function _m(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?Gm(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?Gm(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Jm[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=e.authorizationList.map(e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if("bigint"==typeof n.v){if(0n===n.v||27n===n.v)return 0;if(1n===n.v||28n===n.v)return 1;if(n.v>=35n)return n.v%2n==0n?1:0}})(),"legacy"===n.type&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),"eip2930"===n.type&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),"eip1559"===n.type&&delete n.maxFeePerBlobGas,n}const $m=Wm("transaction",_m);function ef(e,t){const n=(e.transactions??[]).map(e=>"string"==typeof e?e:_m(e));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const tf=Wm("block",ef);function nf(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):null===e.blockTimestamp?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const rf={"0x0":"reverted","0x1":"success"};function of(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(e=>nf(e)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Gm(e.transactionIndex):null,status:e.status?rf[e.status]:null,type:e.type?Jm[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const sf=Wm("transactionReceipt",of),af={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function cf(e,t){const n={};return void 0!==e.authorizationList&&(n.authorizationList=e.authorizationList.map(e=>({address:e.address,r:e.r?Rm(BigInt(e.r)):e.r,s:e.s?Rm(BigInt(e.s)):e.s,chainId:Rm(e.chainId),nonce:Rm(e.nonce),...void 0!==e.yParity?{yParity:Rm(e.yParity)}:{},...void 0!==e.v&&void 0===e.yParity?{v:Rm(e.v)}:{}}))),void 0!==e.accessList&&(n.accessList=e.accessList),void 0!==e.blobVersionedHashes&&(n.blobVersionedHashes=e.blobVersionedHashes),void 0!==e.blobs&&("string"!=typeof e.blobs[0]?n.blobs=e.blobs.map(e=>Om(e)):n.blobs=e.blobs),void 0!==e.data&&(n.data=e.data),e.account&&(n.from=e.account.address),void 0!==e.from&&(n.from=e.from),void 0!==e.gas&&(n.gas=Rm(e.gas)),void 0!==e.gasPrice&&(n.gasPrice=Rm(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(n.maxFeePerBlobGas=Rm(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(n.maxFeePerGas=Rm(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(n.maxPriorityFeePerGas=Rm(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(n.nonce=Rm(e.nonce)),void 0!==e.to&&(n.to=e.to),void 0!==e.type&&(n.type=af[e.type]),void 0!==e.value&&(n.value=Rm(e.value)),n}const lf=Wm("transactionRequest",cf);const uf=2n**256n-1n,df=50000n,hf=2097120n,Af={block:tf({format(e){var t;const n=null==(t=e.transactions)?void 0:t.map(e=>{var t;if("string"==typeof e)return e;const n=null==(t=Af.transaction)?void 0:t.format(e);return"0x71"===n.typeHex?n.type="eip712":"0xff"===n.typeHex&&(n.type="priority"),n});return{l1BatchNumber:e.l1BatchNumber?Xm(e.l1BatchNumber):null,l1BatchTimestamp:e.l1BatchTimestamp?Xm(e.l1BatchTimestamp):null,transactions:n}}}),transaction:$m({format(e){const t={};return"0x71"===e.type?t.type="eip712":"0xff"===e.type&&(t.type="priority"),{...t,l1BatchNumber:e.l1BatchNumber?Xm(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?Xm(e.l1BatchTxIndex):null}}}),transactionReceipt:sf({format:e=>({l1BatchNumber:e.l1BatchNumber?Xm(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?Xm(e.l1BatchTxIndex):null,logs:e.logs.map(e=>({...nf(e),l1BatchNumber:e.l1BatchNumber?Xm(e.l1BatchNumber):null,transactionLogIndex:Gm(e.transactionLogIndex),logType:e.logType})),l2ToL1Logs:e.l2ToL1Logs.map(e=>({blockNumber:Xm(e.blockHash),blockHash:e.blockHash,l1BatchNumber:e.l1BatchNumber?Xm(e.l1BatchNumber):null,transactionIndex:Xm(e.transactionIndex),shardId:Xm(e.shardId),isService:e.isService,sender:e.sender,key:e.key,value:e.value,transactionHash:e.transactionHash,logIndex:Xm(e.logIndex)}))})}),transactionRequest:lf({exclude:["customSignature","factoryDeps","gasPerPubdata","paymaster","paymasterInput"],format:e=>e.gasPerPubdata||e.paymaster&&e.paymasterInput||e.factoryDeps||e.customSignature?{eip712Meta:{...e.gasPerPubdata?{gasPerPubdata:Pm(e.gasPerPubdata)}:{gasPerPubdata:Pm(df)},...e.paymaster&&e.paymasterInput?{paymasterParams:{paymaster:e.paymaster,paymasterInput:Array.from(Vm(e.paymasterInput))}}:{},...e.factoryDeps?{factoryDeps:e.factoryDeps.map(e=>Array.from(Vm(e)))}:{},...e.customSignature?{customSignature:Array.from(Vm(e.customSignature))}:{}},type:"0x71"}:{}})};function pf(e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}class mf extends Bm{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class ff extends Bm{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class gf extends Bm{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const yf={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new gf({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new ff({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new mf({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new mf({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function bf(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(yf);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function wf(e,t="hex"){const n=vf(e),i=bf(new Uint8Array(n.length));return n.encode(i),"hex"===t?Om(i.bytes):i.bytes}function vf(e){return Array.isArray(e)?function(e){const t=e.reduce((e,t)=>e+t.length,0),n=kf(t);return{length:t<=55?1+t:1+n+t,encode(i){t<=55?i.pushByte(192+t):(i.pushByte(247+n),1===n?i.pushUint8(t):2===n?i.pushUint16(t):3===n?i.pushUint24(t):i.pushUint32(t));for(const{encode:t}of e)t(i)}}}(e.map(e=>vf(e))):function(e){const t="string"==typeof e?Vm(e):e,n=kf(t.length),i=1===t.length&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length;return{length:i,encode(e){1===t.length&&t[0]<128?e.pushBytes(t):t.length<=55?(e.pushByte(128+t.length),e.pushBytes(t)):(e.pushByte(183+n),1===n?e.pushUint8(t.length):2===n?e.pushUint16(t.length):3===n?e.pushUint24(t.length):e.pushUint32(t.length),e.pushBytes(t))}}}(e)}function kf(e){if(e<256)return 1;if(e<65536)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new Bm("Length is too large.")}const xf={gwei:9,wei:18},Cf={ether:-9,wei:9};function Sf(e,t){let n=e.toString();const i=n.startsWith("-");i&&(n=n.slice(1)),n=n.padStart(t,"0");let[r,o]=[n.slice(0,n.length-t),n.slice(n.length-t)];return o=o.replace(/(0+)$/,""),`${i?"-":""}${r||"0"}${o?`.${o}`:""}`}function Bf(e,t="wei"){return Sf(e,xf[t])}function If(e,t="wei"){return Sf(e,Cf[t])}function Ef(e){const t=Object.entries(e).map(([e,t])=>void 0===t||!1===t?null:[e,t]).filter(Boolean),n=t.reduce((e,[t])=>Math.max(e,t.length),0);return t.map(([e,t])=>` ${`${e}:`.padEnd(n+1)} ${t}`).join("\n")}class Mf extends Bm{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class Df extends Bm{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Ef(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class Qf extends Bm{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}function Uf(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),i="string"==typeof e.blobs[0]?e.blobs.map(e=>Vm(e)):e.blobs,r=[];for(const o of i)r.push(Uint8Array.from(t.blobToKzgCommitment(o)));return"bytes"===n?r:r.map(e=>Om(e))}function Ff(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),i="string"==typeof e.blobs[0]?e.blobs.map(e=>Vm(e)):e.blobs,r="string"==typeof e.commitments[0]?e.commitments.map(e=>Vm(e)):e.commitments,o=[];for(let s=0;s<i.length;s++){const e=i[s],n=r[s];o.push(Uint8Array.from(t.computeBlobKzgProof(e,n)))}return"bytes"===n?o:o.map(e=>Om(e))}const Nf="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;
11
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Tf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function Lf(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Pf(e,...t){if(!Tf(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Of(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");Lf(e.outputLen),Lf(e.blockLen)}function Rf(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function zf(e,t){Pf(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function qf(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Yf(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Kf(e,t){return e<<32-t|e>>>t}function Hf(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const Vf=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])()?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=Hf(e[t]);return e},jf=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),Zf=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Xf(e){if(Pf(e),jf)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=Zf[e[n]];return t}const Gf=48,Wf=57,Jf=65,_f=70,$f=97,eg=102;function tg(e){return e>=Gf&&e<=Wf?e-Gf:e>=Jf&&e<=_f?e-(Jf-10):e>=$f&&e<=eg?e-($f-10):void 0}function ng(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(jf)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(n);for(let r=0,o=0;r<n;r++,o+=2){const t=tg(e.charCodeAt(o)),n=tg(e.charCodeAt(o+1));if(void 0===t||void 0===n){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+o)}i[r]=16*t+n}return i}function ig(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}(e)),Pf(e),e}function rg(...e){let t=0;for(let i=0;i<e.length;i++){const n=e[i];Pf(n),t+=n.length}const n=new Uint8Array(t);for(let i=0,r=0;i<e.length;i++){const t=e[i];n.set(t,r),r+=t.length}return n}class og{}function sg(e){const t=t=>e().update(ig(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function ag(e=32){if(Nf&&"function"==typeof Nf.getRandomValues)return Nf.getRandomValues(new Uint8Array(e));if(Nf&&"function"==typeof Nf.randomBytes)return Uint8Array.from(Nf.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}function cg(e,t,n){return e&t^~e&n}function lg(e,t,n){return e&t^e&n^t&n}class ug extends og{constructor(e,t,n,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(e),this.view=Yf(this.buffer)}update(e){Rf(this),Pf(e=ig(e));const{view:t,buffer:n,blockLen:i}=this,r=e.length;for(let o=0;o<r;){const s=Math.min(i-this.pos,r-o);if(s===i){const t=Yf(e);for(;i<=r-o;o+=i)this.process(t,o);continue}n.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Rf(this),zf(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:i,isLE:r}=this;let{pos:o}=this;t[o++]=128,qf(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(n,0),o=0);for(let u=o;u<i;u++)t[u]=0;!function(e,t,n,i){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,i);const r=BigInt(32),o=BigInt(4294967295),s=Number(n>>r&o),a=Number(n&o),c=i?4:0,l=i?0:4;e.setUint32(t+c,s,i),e.setUint32(t+l,a,i)}(n,i-8,BigInt(8*this.length),r),this.process(n,0);const s=Yf(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;u<c;u++)s.setUint32(4*u,l[u],r)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:i,finished:r,destroyed:o,pos:s}=this;return e.destroyed=o,e.finished=r,e.length=i,e.pos=s,i%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}}const dg=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),hg=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Ag=BigInt(2**32-1),pg=BigInt(32);function mg(e,t=!1){return t?{h:Number(e&Ag),l:Number(e>>pg&Ag)}:{h:0|Number(e>>pg&Ag),l:0|Number(e&Ag)}}function fg(e,t=!1){const n=e.length;let i=new Uint32Array(n),r=new Uint32Array(n);for(let o=0;o<n;o++){const{h:n,l:s}=mg(e[o],t);[i[o],r[o]]=[n,s]}return[i,r]}const gg=(e,t,n)=>e>>>n,yg=(e,t,n)=>e<<32-n|t>>>n,bg=(e,t,n)=>e>>>n|t<<32-n,wg=(e,t,n)=>e<<32-n|t>>>n,vg=(e,t,n)=>e<<64-n|t>>>n-32,kg=(e,t,n)=>e>>>n-32|t<<64-n;function xg(e,t,n,i){const r=(t>>>0)+(i>>>0);return{h:e+n+(r/2**32|0)|0,l:0|r}}const Cg=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),Sg=(e,t,n,i)=>t+n+i+(e/2**32|0)|0,Bg=(e,t,n,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0),Ig=(e,t,n,i,r)=>t+n+i+r+(e/2**32|0)|0,Eg=(e,t,n,i,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0)+(r>>>0),Mg=(e,t,n,i,r,o)=>t+n+i+r+o+(e/2**32|0)|0,Dg=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Qg=new Uint32Array(64);class Ug extends ug{constructor(e=32){super(64,e,8,!1),this.A=0|dg[0],this.B=0|dg[1],this.C=0|dg[2],this.D=0|dg[3],this.E=0|dg[4],this.F=0|dg[5],this.G=0|dg[6],this.H=0|dg[7]}get(){const{A:e,B:t,C:n,D:i,E:r,F:o,G:s,H:a}=this;return[e,t,n,i,r,o,s,a]}set(e,t,n,i,r,o,s,a){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|i,this.E=0|r,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let u=0;u<16;u++,t+=4)Qg[u]=e.getUint32(t,!1);for(let u=16;u<64;u++){const e=Qg[u-15],t=Qg[u-2],n=Kf(e,7)^Kf(e,18)^e>>>3,i=Kf(t,17)^Kf(t,19)^t>>>10;Qg[u]=i+Qg[u-7]+n+Qg[u-16]|0}let{A:n,B:i,C:r,D:o,E:s,F:a,G:c,H:l}=this;for(let u=0;u<64;u++){const e=l+(Kf(s,6)^Kf(s,11)^Kf(s,25))+cg(s,a,c)+Dg[u]+Qg[u]|0,t=(Kf(n,2)^Kf(n,13)^Kf(n,22))+lg(n,i,r)|0;l=c,c=a,a=s,s=o+e|0,o=r,r=i,i=n,n=e+t|0}n=n+this.A|0,i=i+this.B|0,r=r+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,i,r,o,s,a,c,l)}roundClean(){qf(Qg)}destroy(){this.set(0,0,0,0,0,0,0,0),qf(this.buffer)}}const Fg=(()=>fg(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),Ng=(()=>Fg[0])(),Tg=(()=>Fg[1])(),Lg=new Uint32Array(80),Pg=new Uint32Array(80);class Og extends ug{constructor(e=64){super(128,e,16,!1),this.Ah=0|hg[0],this.Al=0|hg[1],this.Bh=0|hg[2],this.Bl=0|hg[3],this.Ch=0|hg[4],this.Cl=0|hg[5],this.Dh=0|hg[6],this.Dl=0|hg[7],this.Eh=0|hg[8],this.El=0|hg[9],this.Fh=0|hg[10],this.Fl=0|hg[11],this.Gh=0|hg[12],this.Gl=0|hg[13],this.Hh=0|hg[14],this.Hl=0|hg[15]}get(){const{Ah:e,Al:t,Bh:n,Bl:i,Ch:r,Cl:o,Dh:s,Dl:a,Eh:c,El:l,Fh:u,Fl:d,Gh:h,Gl:A,Hh:p,Hl:m}=this;return[e,t,n,i,r,o,s,a,c,l,u,d,h,A,p,m]}set(e,t,n,i,r,o,s,a,c,l,u,d,h,A,p,m){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|i,this.Ch=0|r,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|l,this.Fh=0|u,this.Fl=0|d,this.Gh=0|h,this.Gl=0|A,this.Hh=0|p,this.Hl=0|m}process(e,t){for(let y=0;y<16;y++,t+=4)Lg[y]=e.getUint32(t),Pg[y]=e.getUint32(t+=4);for(let y=16;y<80;y++){const e=0|Lg[y-15],t=0|Pg[y-15],n=bg(e,t,1)^bg(e,t,8)^gg(e,0,7),i=wg(e,t,1)^wg(e,t,8)^yg(e,t,7),r=0|Lg[y-2],o=0|Pg[y-2],s=bg(r,o,19)^vg(r,o,61)^gg(r,0,6),a=wg(r,o,19)^kg(r,o,61)^yg(r,o,6),c=Bg(i,a,Pg[y-7],Pg[y-16]),l=Ig(c,n,s,Lg[y-7],Lg[y-16]);Lg[y]=0|l,Pg[y]=0|c}let{Ah:n,Al:i,Bh:r,Bl:o,Ch:s,Cl:a,Dh:c,Dl:l,Eh:u,El:d,Fh:h,Fl:A,Gh:p,Gl:m,Hh:f,Hl:g}=this;for(let y=0;y<80;y++){const e=bg(u,d,14)^bg(u,d,18)^vg(u,d,41),t=wg(u,d,14)^wg(u,d,18)^kg(u,d,41),b=u&h^~u&p,w=Eg(g,t,d&A^~d&m,Tg[y],Pg[y]),v=Mg(w,f,e,b,Ng[y],Lg[y]),k=0|w,x=bg(n,i,28)^vg(n,i,34)^vg(n,i,39),C=wg(n,i,28)^kg(n,i,34)^kg(n,i,39),S=n&r^n&s^r&s,B=i&o^i&a^o&a;f=0|p,g=0|m,p=0|h,m=0|A,h=0|u,A=0|d,({h:u,l:d}=xg(0|c,0|l,0|v,0|k)),c=0|s,l=0|a,s=0|r,a=0|o,r=0|n,o=0|i;const I=Cg(k,C,B);n=Sg(I,v,x,S),i=0|I}({h:n,l:i}=xg(0|this.Ah,0|this.Al,0|n,0|i)),({h:r,l:o}=xg(0|this.Bh,0|this.Bl,0|r,0|o)),({h:s,l:a}=xg(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:l}=xg(0|this.Dh,0|this.Dl,0|c,0|l)),({h:u,l:d}=xg(0|this.Eh,0|this.El,0|u,0|d)),({h:h,l:A}=xg(0|this.Fh,0|this.Fl,0|h,0|A)),({h:p,l:m}=xg(0|this.Gh,0|this.Gl,0|p,0|m)),({h:f,l:g}=xg(0|this.Hh,0|this.Hl,0|f,0|g)),this.set(n,i,r,o,s,a,c,l,u,d,h,A,p,m,f,g)}roundClean(){qf(Lg,Pg)}destroy(){qf(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Rg=sg(()=>new Ug),zg=sg(()=>new Og),qg=Rg;function Yg(e,t){const n=t||"hex",i=qg(Dm(e,{strict:!1})?Ym(e):e);return"bytes"===n?i:Pm(i)}function Kg(e){const{commitment:t,version:n=1}=e,i=e.to??("string"==typeof t?"hex":"bytes"),r=Yg(t,"bytes");return r.set([n],0),"bytes"===i?r:Om(r)}const Hg=4096,Vg=131072,jg=761855;class Zg extends Bm{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`],name:"BlobSizeTooLargeError"})}}class Xg extends Bm{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class Gg extends Bm{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`],name:"InvalidVersionedHashSizeError"})}}class Wg extends Bm{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:["Expected: 1",`Received: ${t}`],name:"InvalidVersionedHashVersionError"})}}function Jg(e){const{data:t,kzg:n,to:i}=e,r=e.blobs??function(e){const t=e.to??("string"==typeof e.data?"hex":"bytes"),n="string"==typeof e.data?Vm(e.data):e.data,i=Qm(n);if(!i)throw new Xg;if(i>jg)throw new Zg({maxSize:jg,size:i});const r=[];let o=!0,s=0;for(;o;){const e=bf(new Uint8Array(Vg));let t=0;for(;t<Hg;){const i=n.slice(s,s+31);if(e.pushByte(0),e.pushBytes(i),i.length<31){e.pushByte(128),o=!1;break}t++,s+=31}r.push(e)}return"bytes"===t?r.map(e=>e.bytes):r.map(e=>Om(e.bytes))}({data:t,to:i}),o=e.commitments??Uf({blobs:r,kzg:n,to:i}),s=e.proofs??Ff({blobs:r,commitments:o,kzg:n,to:i}),a=[];for(let c=0;c<r.length;c++)a.push({blob:r[c],commitment:o[c],proof:s[c]});return a}class _g extends Bm{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class $g extends Bm{constructor({chainId:e}){super("number"==typeof e?`Chain ID "${e}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}class ey extends Bm{constructor({cause:e,message:t}={}){var n;const i=null==(n=null==t?void 0:t.replace("execution reverted: ",""))?void 0:n.replace("execution reverted","");super(`Execution reverted ${i?`with reason: ${i}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(ey,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(ey,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class ty extends Bm{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${If(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(ty,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class ny extends Bm{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${If(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(ny,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class iy extends Bm{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(iy,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class ry extends Bm{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(ry,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class oy extends Bm{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(oy,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class sy extends Bm{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(sy,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class ay extends Bm{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(ay,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class cy extends Bm{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(cy,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class ly extends Bm{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(ly,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class uy extends Bm{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${If(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${If(n)} gwei`:""}).`].join("\n"),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(uy,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class dy extends Bm{constructor({cause:e}){super(`An error occurred while executing: ${null==e?void 0:e.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}class hy extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const e=this.keys().next().value;e&&this.delete(e)}return this}}const Ay=BigInt(0),py=BigInt(1),my=BigInt(2),fy=BigInt(7),gy=BigInt(256),yy=BigInt(113),by=[],wy=[],vy=[];for(let vU=0,kU=py,xU=1,CU=0;vU<24;vU++){[xU,CU]=[CU,(2*xU+3*CU)%5],by.push(2*(5*CU+xU)),wy.push((vU+1)*(vU+2)/2%64);let e=Ay;for(let t=0;t<7;t++)kU=(kU<<py^(kU>>fy)*yy)%gy,kU&my&&(e^=py<<(py<<BigInt(t))-py);vy.push(e)}const ky=fg(vy,!0),xy=ky[0],Cy=ky[1],Sy=(e,t,n)=>n>32?((e,t,n)=>t<<n-32|e>>>64-n)(e,t,n):((e,t,n)=>e<<n|t>>>32-n)(e,t,n),By=(e,t,n)=>n>32?((e,t,n)=>e<<n-32|t>>>64-n)(e,t,n):((e,t,n)=>t<<n|e>>>32-n)(e,t,n);class Iy extends og{constructor(e,t,n,i=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=i,this.rounds=r,Lf(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");var o;this.state=new Uint8Array(200),this.state32=(o=this.state,new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4)))}clone(){return this._cloneInto()}keccak(){Vf(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const t=(i+8)%10,r=(i+2)%10,o=n[r],s=n[r+1],a=Sy(o,s,1)^n[t],c=By(o,s,1)^n[t+1];for(let n=0;n<50;n+=10)e[i+n]^=a,e[i+n+1]^=c}let t=e[2],r=e[3];for(let n=0;n<24;n++){const i=wy[n],o=Sy(t,r,i),s=By(t,r,i),a=by[n];t=e[a],r=e[a+1],e[a]=o,e[a+1]=s}for(let i=0;i<50;i+=10){for(let t=0;t<10;t++)n[t]=e[i+t];for(let t=0;t<10;t++)e[i+t]^=~n[(t+2)%10]&n[(t+4)%10]}e[0]^=xy[i],e[1]^=Cy[i]}qf(n)}(this.state32,this.rounds),Vf(this.state32),this.posOut=0,this.pos=0}update(e){Rf(this),Pf(e=ig(e));const{blockLen:t,state:n}=this,i=e.length;for(let r=0;r<i;){const o=Math.min(t-this.pos,i-r);for(let t=0;t<o;t++)n[this.pos++]^=e[r++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:i}=this;e[n]^=t,128&t&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Rf(this,!1),Pf(e),this.finish();const t=this.state,{blockLen:n}=this;for(let i=0,r=e.length;i<r;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,r-i);e.set(t.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Lf(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(zf(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,qf(this.state)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:i,rounds:r,enableXOF:o}=this;return e||(e=new Iy(t,n,i,o,r)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=r,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Ey=(()=>{return e=1,t=136,n=32,sg(()=>new Iy(t,e,n));var e,t,n})();const My=new hy(8192);function Dy(e,t){if(My.has(`${e}.${t}`))return My.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),i=function(e){return Ey(Dm(e,{strict:!1})?Ym(e):e)}(jm(n)),r=n.split("");for(let s=0;s<40;s+=2)i[s>>1]>>4>=8&&r[s]&&(r[s]=r[s].toUpperCase()),(15&i[s>>1])>=8&&r[s+1]&&(r[s+1]=r[s+1].toUpperCase());const o=`0x${r.join("")}`;return My.set(`${e}.${t}`,o),o}const Qy=/^0x[a-fA-F0-9]{40}$/,Uy=new hy(8192);function Fy(e,t){const{strict:n=!0}=t??{},i=`${e}.${n}`;if(Uy.has(i))return Uy.get(i);const r=!(!Qy.test(e)||e.toLowerCase()!==e&&n&&Dy(e)!==e);return Uy.set(i,r),r}function Ny(e,t,n,{strict:i}={}){return Dm(e,{strict:!1})?function(e,t,n,{strict:i}={}){const r=`0x${e.replace("0x","").slice(2*t,2*n)}`;i&&Ty(r,t,n);return r}(e,t,n,{strict:i}):function(e,t,n,{strict:i}={}){const r=e.slice(t,n);i&&Ty(r,t,n);return r}(e,t,n,{strict:i})}function Ty(e,t,n){if(Qm(e)!==n-t)throw new Fm({offset:n,position:"end",size:Qm(e)})}function Ly(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:i,to:r}=e;if(t<=0)throw new $g({chainId:t});if(r&&!Fy(r))throw new _g({address:r});if(i&&i>uf)throw new ty({maxFeePerGas:i});if(n&&i&&n>i)throw new uy({maxFeePerGas:i,maxPriorityFeePerGas:n})}function Py(e){if(!e||0===e.length)return[];const t=[];for(let n=0;n<e.length;n++){const{address:i,storageKeys:r}=e[n];for(let e=0;e<r.length;e++)if(r[e].length-2!=64)throw new Qf({storageKey:r[e]});if(!Fy(i,{strict:!1}))throw new _g({address:i});t.push([i,r])}return t}function Oy(e,t){const n=function(e){if(e.type)return e.type;if(void 0!==e.authorizationList)return"eip7702";if(void 0!==e.blobs||void 0!==e.blobVersionedHashes||void 0!==e.maxFeePerBlobGas||void 0!==e.sidecars)return"eip4844";if(void 0!==e.maxFeePerGas||void 0!==e.maxPriorityFeePerGas)return"eip1559";if(void 0!==e.gasPrice)return void 0!==e.accessList?"eip2930":"legacy";throw new Df({transaction:e})}(e);return"eip1559"===n?function(e,t){const{chainId:n,gas:i,nonce:r,to:o,value:s,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:l,data:u}=e;Ly(e);const d=Py(l),h=[Rm(n),r?Rm(r):"0x",c?Rm(c):"0x",a?Rm(a):"0x",i?Rm(i):"0x",o??"0x",s?Rm(s):"0x",u??"0x",d,...Ry(e,t)];return pf(["0x02",wf(h)])}(e,t):"eip2930"===n?function(e,t){const{chainId:n,gas:i,data:r,nonce:o,to:s,value:a,accessList:c,gasPrice:l}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:i,maxFeePerGas:r,to:o}=e;if(t<=0)throw new $g({chainId:t});if(o&&!Fy(o))throw new _g({address:o});if(n||r)throw new Bm("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(i&&i>uf)throw new ty({maxFeePerGas:i})}(e);const u=Py(c),d=[Rm(n),o?Rm(o):"0x",l?Rm(l):"0x",i?Rm(i):"0x",s??"0x",a?Rm(a):"0x",r??"0x",u,...Ry(e,t)];return pf(["0x01",wf(d)])}(e,t):"eip4844"===n?function(e,t){const{chainId:n,gas:i,nonce:r,to:o,value:s,maxFeePerBlobGas:a,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;!function(e){const{blobVersionedHashes:t}=e;if(t){if(0===t.length)throw new Xg;for(const e of t){const t=Qm(e),n=Gm(Ny(e,0,1));if(32!==t)throw new Gg({hash:e,size:t});if(1!==n)throw new Wg({hash:e,version:n})}}Ly(e)}(e);let h=e.blobVersionedHashes,A=e.sidecars;if(e.blobs&&(void 0===h||void 0===A)){const t="string"==typeof e.blobs[0]?e.blobs:e.blobs.map(e=>Om(e)),n=e.kzg,i=Uf({blobs:t,kzg:n});if(void 0===h&&(h=function(e){const{commitments:t,version:n}=e,i=e.to??("string"==typeof t[0]?"hex":"bytes"),r=[];for(const o of t)r.push(Kg({commitment:o,to:i,version:n}));return r}({commitments:i})),void 0===A){A=Jg({blobs:t,commitments:i,proofs:Ff({blobs:t,commitments:i,kzg:n})})}}const p=Py(u),m=[Rm(n),r?Rm(r):"0x",l?Rm(l):"0x",c?Rm(c):"0x",i?Rm(i):"0x",o??"0x",s?Rm(s):"0x",d??"0x",p,a?Rm(a):"0x",h??[],...Ry(e,t)],f=[],g=[],y=[];if(A)for(let b=0;b<A.length;b++){const{blob:e,commitment:t,proof:n}=A[b];f.push(e),g.push(t),y.push(n)}return pf(["0x03",wf(A?[m,f,g,y]:m)])}(e,t):"eip7702"===n?function(e,t){const{authorizationList:n,chainId:i,gas:r,nonce:o,to:s,value:a,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;!function(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:e}=n,t=n.address;if(!Fy(t))throw new _g({address:t});if(e<0)throw new $g({chainId:e})}Ly(e)}(e);const h=Py(u),A=function(e){if(!e||0===e.length)return[];const t=[];for(const n of e){const{chainId:e,nonce:i,...r}=n,o=n.address;t.push([e?Pm(e):"0x",o,i?Pm(i):"0x",...Ry({},r)])}return t}(n);return pf(["0x04",wf([Rm(i),o?Rm(o):"0x",l?Rm(l):"0x",c?Rm(c):"0x",r?Rm(r):"0x",s??"0x",a?Rm(a):"0x",d??"0x",h,A,...Ry(e,t)])])}(e,t):function(e,t){const{chainId:n=0,gas:i,data:r,nonce:o,to:s,value:a,gasPrice:c}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:i,maxFeePerGas:r,to:o}=e;if(o&&!Fy(o))throw new _g({address:o});if(void 0!==t&&t<=0)throw new $g({chainId:t});if(n||r)throw new Bm("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(i&&i>uf)throw new ty({maxFeePerGas:i})}(e);let l=[o?Rm(o):"0x",c?Rm(c):"0x",i?Rm(i):"0x",s??"0x",a?Rm(a):"0x",r??"0x"];if(t){const e=(()=>{if(t.v>=35n){return(t.v-35n)/2n>0?t.v:27n+(35n===t.v?0n:1n)}if(n>0)return BigInt(2*n)+BigInt(35n+t.v-27n);const e=27n+(27n===t.v?0n:1n);if(t.v!==e)throw new Mf({v:t.v});return e})(),i=Um(t.r),r=Um(t.s);l=[...l,Rm(e),"0x00"===i?"0x":i,"0x00"===r?"0x":r]}else n>0&&(l=[...l,Rm(n),"0x","0x"]);return wf(l)}(e,t)}function Ry(e,t){const n=t??e,{v:i,yParity:r}=n;if(void 0===n.r)return[];if(void 0===n.s)return[];if(void 0===i&&void 0===r)return[];const o=Um(n.r),s=Um(n.s);return["number"==typeof r?r?Rm(1):"0x":0n===i?"0x":1n===i?Rm(1):27n===i?"0x":Rm(1),"0x00"===o?"0x":o,"0x00"===s?"0x":s]}class zy extends Bm{constructor(){super(["Transaction is not an EIP712 transaction.","","Transaction must:",' - include `type: "eip712"`'," - include one of the following: `customSignature`, `paymaster`, `paymasterInput`, `gasPerPubdata`, `factoryDeps`"].join("\n"),{name:"InvalidEip712TransactionError"})}}function qy(e){return"eip712"===e.type||!!("customSignature"in e&&e.customSignature||"paymaster"in e&&e.paymaster||"paymasterInput"in e&&e.paymasterInput||"gasPerPubdata"in e&&"bigint"==typeof e.gasPerPubdata||"factoryDeps"in e&&e.factoryDeps)}function Yy(e){const{chainId:t,to:n,from:i,paymaster:r,paymasterInput:o}=e;if(!qy(e))throw new zy;if(!t||t<=0)throw new $g({chainId:t});if(n&&!Fy(n))throw new _g({address:n});if(i&&!Fy(i))throw new _g({address:i});if(r&&!Fy(r))throw new _g({address:r});if(r&&!o)throw new Bm("`paymasterInput` must be provided when `paymaster` is defined");if(!r&&o)throw new Bm("`paymaster` must be provided when `paymasterInput` is defined")}const Ky={transaction:function(e,t){return qy(e)?function(e){const{chainId:t,gas:n,nonce:i,to:r,from:o,value:s,maxFeePerGas:a,maxPriorityFeePerGas:c,customSignature:l,factoryDeps:u,paymaster:d,paymasterInput:h,gasPerPubdata:A,data:p}=e;Yy(e);const m=[i?Pm(i):"0x",c?Pm(c):"0x",a?Pm(a):"0x",n?Pm(n):"0x",r??"0x",s?Pm(s):"0x",p??"0x",Pm(t),Pm(""),Pm(""),Pm(t),o??"0x",Pm(A||df),u??[],l??"0x",d&&h?[d,h]:[]];return pf(["0x71",wf(m)])}(e):Oy(e,t)}};class Hy extends Bm{constructor({givenLength:e,maxBytecodeSize:t}){super(`Bytecode cannot be longer than ${t} bytes. Given length: ${e}`,{name:"BytecodeLengthExceedsMaxSizeError"})}}class Vy extends Bm{constructor({givenLengthInWords:e}){super(`Bytecode length in 32-byte words must be odd. Given length in words: ${e}`,{name:"BytecodeLengthInWordsMustBeOddError"})}}class jy extends Bm{constructor({givenLength:e}){super(`The bytecode length in bytes must be divisible by 32. Given length: ${e}`,{name:"BytecodeLengthMustBeDivisibleBy32Error"})}}const Zy={blockTime:1e3,formatters:Af,serializers:Ky,custom:{getEip712Domain:e=>{Yy(e);const t=function(e){const{gas:t,nonce:n,to:i,from:r,value:o,maxFeePerGas:s,maxPriorityFeePerGas:a,factoryDeps:c,paymaster:l,paymasterInput:u,gasPerPubdata:d,data:h}=e;return{txType:113n,from:BigInt(r),to:i?BigInt(i):0n,gasLimit:t??0n,gasPerPubdataByteLimit:d??df,maxFeePerGas:s??0n,maxPriorityFeePerGas:a??0n,paymaster:l?BigInt(l):0n,nonce:n?BigInt(n):0n,value:o??0n,data:h??"0x",factoryDeps:(null==c?void 0:c.map(e=>Pm(function(e){const t=Ym(e);if(t.length%32!=0)throw new jy({givenLength:t.length});if(t.length>hf)throw new Hy({givenLength:t.length,maxBytecodeSize:hf});const n=Ym(Yg(t)),i=t.length/32;if(i%2==0)throw new Vy({givenLengthInWords:i});const r=Tm(Ym(i),{size:2}),o=new Uint8Array([1,0]);return n.set(o,0),n.set(r,2),n}(e))))??[],paymasterInput:u||"0x"}}(e);return{domain:{name:"zkSync",version:"2",chainId:e.chainId},types:{Transaction:[{name:"txType",type:"uint256"},{name:"from",type:"uint256"},{name:"to",type:"uint256"},{name:"gasLimit",type:"uint256"},{name:"gasPerPubdataByteLimit",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymaster",type:"uint256"},{name:"nonce",type:"uint256"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"factoryDeps",type:"bytes32[]"},{name:"paymasterInput",type:"bytes"}]},primaryType:"Transaction",message:t}}}},Xy=xm({...Zy,blockTime:200,id:2741,name:"Abstract",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://api.mainnet.abs.xyz"],webSocket:["wss://api.mainnet.abs.xyz/ws"]}},blockExplorers:{default:{name:"Etherscan",url:"https://abscan.org"},native:{name:"Abstract Explorer",url:"https://explorer.mainnet.abs.xyz"}},contracts:{multicall3:{address:"0xAa4De41dba0Ca5dCBb288b7cC6b708F3aaC759E7",blockCreated:5288},erc6492Verifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:5263}}}),Gy={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}};function Wy(e,t){return function(e){return"deposit"===e.type||void 0!==e.sourceHash}(e)?function(e){!function(e){const{from:t,to:n}=e;if(t&&!Fy(t))throw new _g({address:t});if(n&&!Fy(n))throw new _g({address:n})}(e);const{sourceHash:t,data:n,from:i,gas:r,isSystemTx:o,mint:s,to:a,value:c}=e,l=[t,i,a??"0x",s?Pm(s):"0x",c?Pm(c):"0x",r?Pm(r):"0x",o?"0x1":"0x",n??"0x"];return pf(["0x7e",wf(l)])}(e):Oy(e,t)}const Jy={blockTime:2e3,contracts:Gy,formatters:{block:tf({format(e){var t;return{transactions:null==(t=e.transactions)?void 0:t.map(e=>{if("string"==typeof e)return e;const t=_m(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?Xm(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}),stateRoot:e.stateRoot}}}),transaction:$m({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?Xm(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:sf({format:e=>({l1GasPrice:e.l1GasPrice?Xm(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?Xm(e.l1GasUsed):null,l1Fee:e.l1Fee?Xm(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})},serializers:{transaction:Wy}},_y=xm({id:33139,name:"ApeChain",nativeCurrency:{name:"ApeCoin",symbol:"APE",decimals:18},rpcUrls:{default:{http:["https://rpc.apechain.com/http"],webSocket:["wss://rpc.apechain.com/ws"]}},blockExplorers:{default:{name:"Apescan",url:"https://apescan.io",apiUrl:"https://api.apescan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:20889}},sourceId:42161}),$y=xm({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:250,rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),eb=xm({id:592,name:"Astar",network:"astar-mainnet",nativeCurrency:{name:"Astar",symbol:"ASTR",decimals:18},rpcUrls:{default:{http:["https://astar.api.onfinality.io/public"]}},blockExplorers:{default:{name:"Astar Subscan",url:"https://astar.subscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:761794}},testnet:!1}),tb=xm({id:43114,name:"Avalanche",blockTime:1700,nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://snowtrace.io",apiUrl:"https://api.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11907934}}}),nb=1,ib=xm({...Jy,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...Jy.contracts,disputeGameFactory:{[nb]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[nb]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[nb]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[nb]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:1}),rb=xm({id:80094,name:"Berachain",blockTime:2e3,nativeCurrency:{decimals:18,name:"BERA Token",symbol:"BERA"},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:0},ensRegistry:{address:"0x5b22280886a2f5e09a49bea7e320eab0e5320e28",blockCreated:877007},ensUniversalResolver:{address:"0x4D41762915F83c76EcaF6776d9b08076aA32b492",blockCreated:9310021}},rpcUrls:{default:{http:["https://rpc.berachain.com"]}},blockExplorers:{default:{name:"Berascan",url:"https://berascan.com"}},ensTlds:[".bera"],testnet:!1}),ob=1,sb=xm({...Jy,id:81457,name:"Blast",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.blast.io"]}},blockExplorers:{default:{name:"Blastscan",url:"https://blastscan.io",apiUrl:"https://api.blastscan.io/api"}},contracts:{...Jy.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:212929},l2OutputOracle:{[ob]:{address:"0x826D1B0D4111Ad9146Eb8941D7Ca2B6a44215c76",blockCreated:19300358}},portal:{[ob]:{address:"0x0Ec68c5B10F21EFFb74f2A5C61DFe6b08C0Db6Cb",blockCreated:19300357}},l1StandardBridge:{[ob]:{address:"0x697402166Fbf2F22E970df8a6486Ef171dbfc524",blockCreated:19300360}}},sourceId:1}),ab=xm({id:3637,name:"Botanix",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:18},rpcUrls:{default:{http:["https://rpc.botanixlabs.com"],webSocket:["wss://rpc.botanixlabs.com/ws"]}},blockExplorers:{default:{name:"Botanixscan",url:"https://botanixscan.io"}}}),cb=xm({id:56,name:"BNB Smart Chain",blockTime:750,nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://56.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"BscScan",url:"https://bscscan.com",apiUrl:"https://api.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}}),lb={estimateFeesPerGas:async e=>{var t;if(!(null==(t=e.request)?void 0:t.feeCurrency))return null;const[n,i]=await Promise.all([ub(e.client,e.request.feeCurrency),db(e.client,e.request.feeCurrency)]);return{maxFeePerGas:e.multiply(n-i)+i,maxPriorityFeePerGas:i}}};async function ub(e,t){const n=await e.request({method:"eth_gasPrice",params:[t]});return BigInt(n)}async function db(e,t){const n=await e.request({method:"eth_maxPriorityFeePerGas",params:[t]});return BigInt(n)}function hb(e){return 0===e||0n===e||null==e||"0"===e||""===e||"string"==typeof e&&("0x"===Um(e).toLowerCase()||"0x00"===Um(e).toLowerCase())}function Ab(e){return!hb(e)}function pb(e){return"cip64"===e.type||function(e){return void 0!==e.maxFeePerGas&&void 0!==e.maxPriorityFeePerGas}(e)&&Ab(e.feeCurrency)}const mb={transaction:function(e,t){return pb(e)?function(e,t){!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:i,maxFeePerGas:r,to:o,feeCurrency:s}=e;if(t<=0)throw new $g({chainId:t});if(o&&!Fy(o))throw new _g({address:o});if(i)throw new Bm("`gasPrice` is not a valid CIP-64 Transaction attribute.");if(Ab(r)&&r>fb)throw new ty({maxFeePerGas:r});if(Ab(n)&&Ab(r)&&n>r)throw new uy({maxFeePerGas:r,maxPriorityFeePerGas:n});if(Ab(s)&&!Fy(s))throw new Bm("`feeCurrency` MUST be a token address for CIP-64 transactions.");if(hb(s))throw new Bm("`feeCurrency` must be provided for CIP-64 transactions.")}(e);const{chainId:n,gas:i,nonce:r,to:o,value:s,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:l,feeCurrency:u,data:d}=e,h=[Pm(n),r?Pm(r):"0x",c?Pm(c):"0x",a?Pm(a):"0x",i?Pm(i):"0x",o??"0x",s?Pm(s):"0x",d??"0x",Py(l),u,...Ry(e,t)];return pf(["0x7b",wf(h)])}(e,t):Wy(e,t)}};const fb=uf;const gb=xm({...{blockTime:1e3,contracts:Gy,formatters:{block:tf({format(e){var t;return{transactions:null==(t=e.transactions)?void 0:t.map(e=>{if("string"==typeof e)return e;return{..._m(e),...e.gatewayFee?{gatewayFee:Xm(e.gatewayFee),gatewayFeeRecipient:e.gatewayFeeRecipient}:{},feeCurrency:e.feeCurrency}})}}}),transaction:$m({format(e){if("0x7e"===e.type)return{isSystemTx:e.isSystemTx,mint:e.mint?Xm(e.mint):void 0,sourceHash:e.sourceHash,type:"deposit"};const t={feeCurrency:e.feeCurrency};return"0x7b"===e.type?t.type="cip64":("0x7c"===e.type&&(t.type="cip42"),t.gatewayFee=e.gatewayFee?Xm(e.gatewayFee):null,t.gatewayFeeRecipient=e.gatewayFeeRecipient),t}}),transactionRequest:lf({format(e){const t={};return e.feeCurrency&&(t.feeCurrency=e.feeCurrency),pb(e)&&(t.type="0x7b"),t}})},serializers:mb,fees:lb},id:42220,name:"Celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://celoscan.io",apiUrl:"https://api.celoscan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:13112599}},testnet:!1}),yb=xm({id:4158,name:"CrossFi Mainnet",nativeCurrency:{decimals:18,name:"CrossFi",symbol:"XFI"},rpcUrls:{default:{http:["https://rpc.mainnet.ms"]}},blockExplorers:{default:{name:"CrossFi Blockchain Explorer",url:"https://xfiscan.com"}},testnet:!1}),bb=xm({id:747,name:"Flow EVM Mainnet",nativeCurrency:{decimals:18,name:"Flow",symbol:"FLOW"},rpcUrls:{default:{http:["https://mainnet.evm.nodes.onflow.org"]}},blockExplorers:{default:{name:"Mainnet Explorer",url:"https://evm.flowscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6205}},blockTime:800}),wb=xm({id:63157,name:"Geist Mainnet",nativeCurrency:{decimals:18,name:"Aavegotchi GHST Token",symbol:"GHST"},rpcUrls:{default:{http:["https://geist-mainnet.g.alchemy.com/public"]}},blockExplorers:{default:{name:"Blockscout",url:"https://geist-mainnet.explorer.alchemy.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:660735}}}),vb=xm({id:100,name:"Gnosis",nativeCurrency:{decimals:18,name:"xDAI",symbol:"XDAI"},blockTime:5e3,rpcUrls:{default:{http:["https://rpc.gnosischain.com"],webSocket:["wss://rpc.gnosischain.com/wss"]}},blockExplorers:{default:{name:"Gnosisscan",url:"https://gnosisscan.io",apiUrl:"https://api.gnosisscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:21022491}}}),kb=xm({id:999,name:"HyperEVM",nativeCurrency:{name:"HYPE",symbol:"HYPE",decimals:18},blockExplorers:{default:{name:"HyperEVMScan",url:"https://hyperevmscan.io"}},rpcUrls:{default:{http:["https://rpc.hyperliquid.xyz/evm"]}},testnet:!1}),xb=1,Cb=xm({...Jy,id:57073,name:"Ink",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc-gel.inkonchain.com","https://rpc-qnd.inkonchain.com"],webSocket:["wss://rpc-gel.inkonchain.com","wss://rpc-qnd.inkonchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.inkonchain.com",apiUrl:"https://explorer.inkonchain.com/api/v2"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:0},...Jy.contracts,disputeGameFactory:{[xb]:{address:"0x10d7b35078d3baabb96dd45a9143b94be65b12cd"}},portal:{[xb]:{address:"0x5d66c1782664115999c47c9fa5cd031f495d3e4f"}},l1StandardBridge:{[xb]:{address:"0x88ff1e5b602916615391f55854588efcbb7663f0"}}},testnet:!1,sourceId:1}),Sb=xm({id:232,name:"Lens",nativeCurrency:{name:"GHO",symbol:"GHO",decimals:18},rpcUrls:{default:{http:["https://rpc.lens.xyz"]}},blockExplorers:{default:{name:"Lens Block Explorer",url:"https://explorer.lens.xyz",apiUrl:"https://explorer.lens.xyz/api"}}});function Bb(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}class Ib extends Bm{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join("\n"),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}function Eb(e){return e.reduce((e,{slot:t,value:n})=>`${e} ${t}: ${n}\n`,"")}class Mb extends Bm{constructor(e,{account:t,docsPath:n,chain:i,data:r,gas:o,gasPrice:s,maxFeePerGas:a,maxPriorityFeePerGas:c,nonce:l,to:u,value:d,stateOverride:h}){var A;const p=t?Bb(t):void 0;let m=Ef({from:null==p?void 0:p.address,to:u,value:void 0!==d&&`${Bf(d)} ${(null==(A=null==i?void 0:i.nativeCurrency)?void 0:A.symbol)||"ETH"}`,data:r,gas:o,gasPrice:void 0!==s&&`${If(s)} gwei`,maxFeePerGas:void 0!==a&&`${If(a)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${If(c)} gwei`,nonce:l});h&&(m+=`\n${function(e){return e.reduce((e,{address:t,...n})=>{let i=`${e} ${t}:\n`;return n.nonce&&(i+=` nonce: ${n.nonce}\n`),n.balance&&(i+=` balance: ${n.balance}\n`),n.code&&(i+=` code: ${n.code}\n`),n.state&&(i+=" state:\n",i+=Eb(n.state)),n.stateDiff&&(i+=" stateDiff:\n",i+=Eb(n.stateDiff)),i}," State Override:\n").slice(0,-1)}(h)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",m].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}function Db(e,{docsPath:t,...n}){const i=(()=>{const t=function(e,t){const n=(e.details||"").toLowerCase(),i=e instanceof Bm?e.walk(e=>(null==e?void 0:e.code)===ey.code):e;return i instanceof Bm?new ey({cause:e,message:i.details}):ey.nodeMessage.test(n)?new ey({cause:e,message:e.details}):ty.nodeMessage.test(n)?new ty({cause:e,maxFeePerGas:null==t?void 0:t.maxFeePerGas}):ny.nodeMessage.test(n)?new ny({cause:e,maxFeePerGas:null==t?void 0:t.maxFeePerGas}):iy.nodeMessage.test(n)?new iy({cause:e,nonce:null==t?void 0:t.nonce}):ry.nodeMessage.test(n)?new ry({cause:e,nonce:null==t?void 0:t.nonce}):oy.nodeMessage.test(n)?new oy({cause:e,nonce:null==t?void 0:t.nonce}):sy.nodeMessage.test(n)?new sy({cause:e}):ay.nodeMessage.test(n)?new ay({cause:e,gas:null==t?void 0:t.gas}):cy.nodeMessage.test(n)?new cy({cause:e,gas:null==t?void 0:t.gas}):ly.nodeMessage.test(n)?new ly({cause:e}):uy.nodeMessage.test(n)?new uy({cause:e,maxFeePerGas:null==t?void 0:t.maxFeePerGas,maxPriorityFeePerGas:null==t?void 0:t.maxPriorityFeePerGas}):new dy({cause:e})}(e,n);return t instanceof dy?e:t})();return new Mb(i,{docsPath:t,...n})}function Qb(e,{format:t}){if(!t)return{};const n={};return function t(i){const r=Object.keys(i);for(const o of r)o in e&&(n[o]=e[o]),i[o]&&"object"==typeof i[o]&&!Array.isArray(i[o])&&t(i[o])}(t(e||{})),n}async function Ub(e,t){var n,i,r;const{account:o=e.account}=t;if(!o)throw new Ib;const s=Bb(o);try{const{accessList:o,blockNumber:a,blockTag:c,data:l,gas:u,gasPrice:d,maxFeePerGas:h,maxPriorityFeePerGas:A,nonce:p,to:m,value:f,...g}=t,y=("bigint"==typeof a?Rm(a):void 0)||c;!function(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:i,to:r}=e,o=t?Bb(t):void 0;if(o&&!Fy(o.address))throw new _g({address:o.address});if(r&&!Fy(r))throw new _g({address:r});if(n&&n>uf)throw new ty({maxFeePerGas:n});if(i&&n&&i>n)throw new uy({maxFeePerGas:n,maxPriorityFeePerGas:i})}(t);const b=null==(r=null==(i=null==(n=e.chain)?void 0:n.formatters)?void 0:i.transactionRequest)?void 0:r.format,w=(b||cf)({...Qb(g,{format:b}),account:s,accessList:o,data:l,gas:u,gasPrice:d,maxFeePerGas:h,maxPriorityFeePerGas:A,nonce:p,to:m,value:f},"estimateGas"),{baseFeePerGas:v,gasLimit:k,priorityFeePerGas:x}=await e.request({method:"linea_estimateGas",params:y?[w,y]:[w]});return{baseFeePerGas:BigInt(v),gasLimit:BigInt(k),priorityFeePerGas:BigInt(x)}}catch(wU){throw Db(wU,{...t,account:s,chain:e.chain})}}async function Fb({client:e,multiply:t,request:n,type:i}){try{const r=await Ub(e,{...n,account:null==n?void 0:n.account}),{priorityFeePerGas:o}=r,s=t(BigInt(r.baseFeePerGas))+o;return"legacy"===i?{gasPrice:s}:{maxFeePerGas:s,maxPriorityFeePerGas:o}}catch{return null}}const Nb=xm({...{fees:{estimateFeesPerGas:Fb,async maxPriorityFeePerGas({block:e,client:t,request:n}){const i=await Fb({block:e,client:t,multiply:e=>e,request:n,type:"eip1559"});return(null==i?void 0:i.maxPriorityFeePerGas)?i.maxPriorityFeePerGas:null}}},id:59144,name:"Linea Mainnet",blockTime:2e3,nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build",apiUrl:"https://api.lineascan.build/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:42},ensRegistry:{address:"0x50130b669B28C339991d8676FA73CF122a121267",blockCreated:6682888},ensUniversalResolver:{address:"0x4D41762915F83c76EcaF6776d9b08076aA32b492",blockCreated:22222151}},ensTlds:[".linea.eth"],testnet:!1}),Tb=xm({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),Lb=xm({id:5e3,name:"Mantle",nativeCurrency:{decimals:18,name:"MNT",symbol:"MNT"},rpcUrls:{default:{http:["https://rpc.mantle.xyz"]}},blockExplorers:{default:{name:"Mantle Explorer",url:"https://mantlescan.xyz/",apiUrl:"https://api.mantlescan.xyz/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:304717}}}),Pb=xm({id:1088,name:"Metis",nativeCurrency:{decimals:18,name:"Metis",symbol:"METIS"},rpcUrls:{default:{http:["https://metis.rpc.hypersync.xyz","https://metis-pokt.nodies.app","https://api.blockeden.xyz/metis/67nCBdZQSH9z3YqDDjdm","https://metis-andromeda.rpc.thirdweb.com","https://metis-andromeda.gateway.tenderly.co","https://metis.api.onfinality.io/public","https://andromeda.metis.io/?owner=1088","https://metis-mainnet.public.blastapi.io"],webSocket:["wss://metis-rpc.publicnode.com","wss://metis.drpc.org"]}},blockExplorers:{default:{name:"Metis Explorer",url:"https://explorer.metis.io",apiUrl:"https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:2338552}}}),Ob=xm({id:143,name:"Monad",blockTime:400,nativeCurrency:{name:"Monad",symbol:"MON",decimals:18},rpcUrls:{default:{http:["https://rpc.monad.xyz","https://rpc1.monad.xyz"],webSocket:["wss://rpc.monad.xyz","wss://rpc1.monad.xyz"]}},blockExplorers:{default:{name:"MonadVision",url:"https://monadvision.com"},monadscan:{name:"Monadscan",url:"https://monadscan.com",apiUrl:"https://api.monadscan.com/api"}},testnet:!1,contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:9248132}}}),Rb=56,zb=xm({id:204,name:"opBNB",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:{default:{http:["https://opbnb-mainnet-rpc.bnbchain.org"]}},blockExplorers:{default:{name:"opBNB (BSCScan)",url:"https://opbnb.bscscan.com",apiUrl:"https://api-opbnb.bscscan.com/api"}},contracts:{...Jy.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:512881},l2OutputOracle:{[Rb]:{address:"0x153CAB79f4767E2ff862C94aa49573294B13D169"}},portal:{[Rb]:{address:"0x1876EA7702C0ad0C6A2ae6036DE7733edfBca519"}},l1StandardBridge:{[Rb]:{address:"0xF05F0e4362859c3331Cb9395CBC201E3Fa6757Ea"}}},sourceId:56}),qb=1,Yb=xm({...Jy,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...Jy.contracts,disputeGameFactory:{[qb]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[qb]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[qb]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[qb]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:1}),Kb=xm({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),Hb=xm({id:1101,name:"Polygon zkEVM",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://zkevm-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://zkevm.polygonscan.com",apiUrl:"https://api-zkevm.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:57746}}}),Vb=xm({id:30,name:"Rootstock Mainnet",network:"rootstock",nativeCurrency:{decimals:18,name:"Rootstock Bitcoin",symbol:"RBTC"},rpcUrls:{default:{http:["https://public-node.rsk.co"]}},blockExplorers:{default:{name:"RSK Explorer",url:"https://explorer.rsk.co"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:4249540}}}),jb=xm({id:534352,name:"Scroll",blockTime:3e3,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.scroll.io"],webSocket:["wss://wss-rpc.scroll.io/ws"]}},blockExplorers:{default:{name:"Scrollscan",url:"https://scrollscan.com",apiUrl:"https://api.scrollscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14}},testnet:!1}),Zb=xm({id:1329,name:"Sei Network",nativeCurrency:{name:"Sei",symbol:"SEI",decimals:18},rpcUrls:{default:{http:["https://evm-rpc.sei-apis.com/"],webSocket:["wss://evm-ws.sei-apis.com/"]}},blockExplorers:{default:{name:"Seitrace",url:"https://seitrace.com",apiUrl:"https://seitrace.com/pacific-1/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"}}}),Xb=1,Gb=xm({...Jy,id:360,name:"Shape",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.shape.network"]}},blockExplorers:{default:{name:"shapescan",url:"https://shapescan.xyz",apiUrl:"https://shapescan.xyz/api"}},contracts:{...Jy.contracts,l2OutputOracle:{[Xb]:{address:"0x6Ef8c69CfE4635d866e3E02732068022c06e724D",blockCreated:20369940}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1},portal:{[Xb]:{address:"0xEB06fFa16011B5628BaB98E29776361c83741dd3",blockCreated:20369933}},l1StandardBridge:{[Xb]:{address:"0x62Edd5f4930Ea92dCa3fB81689bDD9b9d076b57B",blockCreated:20369935}}},sourceId:1}),Wb=1,Jb=xm({...Jy,id:1868,name:"Soneium Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.soneium.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://soneium.blockscout.com",apiUrl:"https://soneium.blockscout.com/api"}},contracts:{...Jy.contracts,disputeGameFactory:{[Wb]:{address:"0x512a3d2c7a43bd9261d2b8e8c9c70d4bd4d503c0"}},l2OutputOracle:{[Wb]:{address:"0x0000000000000000000000000000000000000000"}},portal:{[Wb]:{address:"0x88e529a6ccd302c948689cd5156c83d4614fae92",blockCreated:7061266}},l1StandardBridge:{[Wb]:{address:"0xeb9bf100225c214efc3e7c651ebbadcf85177607",blockCreated:7061266}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1}},sourceId:1}),_b=xm({id:146,name:"Sonic",blockTime:630,nativeCurrency:{decimals:18,name:"Sonic",symbol:"S"},rpcUrls:{default:{http:["https://rpc.soniclabs.com"]}},blockExplorers:{default:{name:"Sonic Explorer",url:"https://sonicscan.org"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:60}},testnet:!1}),$b=xm({id:1514,name:"Story",nativeCurrency:{decimals:18,name:"IP Token",symbol:"IP"},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:340998},ensRegistry:{address:"0x5dc881dda4e4a8d312be3544ad13118d1a04cb17",blockCreated:648924},ensUniversalResolver:{address:"0xddfb18888a9466688235887dec2a10c4f5effee9",blockCreated:649114}},rpcUrls:{default:{http:["https://mainnet.storyrpc.io"]}},blockExplorers:{default:{name:"Story explorer",url:"https://storyscan.io",apiUrl:"https://storyscan.io/api/v2"}},ensTlds:[".ip"],testnet:!1}),ew=1,tw=xm({...Jy,id:5330,name:"Superseed",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.superseed.xyz"]}},blockExplorers:{default:{name:"Superseed Explorer",url:"https://explorer.superseed.xyz",apiUrl:"https://explorer.superseed.xyz/api/v2"}},contracts:{...Jy.contracts,disputeGameFactory:{[ew]:{address:"0x8b097CF1f9BbD9cbFD0DD561858a1FCbC8857Be0",blockCreated:20737481}},l2OutputOracle:{[ew]:{address:"0x693A0F8854F458D282DE3C5b69E8eE5EEE8aA949",blockCreated:20737481}},portal:{[ew]:{address:"0x2c2150aa5c75A24fB93d4fD2F2a895D618054f07",blockCreated:20737481}},l1StandardBridge:{[ew]:{address:"0x8b0576E39F1233679109F9b40cFcC2a7E0901Ede",blockCreated:20737481}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"}},sourceId:1});class nw extends og{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Of(e);const n=ig(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,r=new Uint8Array(i);r.set(n.length>i?e.create().update(n).digest():n);for(let o=0;o<r.length;o++)r[o]^=54;this.iHash.update(r),this.oHash=e.create();for(let o=0;o<r.length;o++)r[o]^=106;this.oHash.update(r),qf(r)}update(e){return Rf(this),this.iHash.update(e),this}digestInto(e){Rf(this),Pf(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:i,destroyed:r,blockLen:o,outputLen:s}=this;return e.finished=i,e.destroyed=r,e.blockLen=o,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const iw=(e,t,n)=>new nw(e,t).update(n).digest();iw.create=(e,t)=>new nw(e,t);const rw=1,ow=xm({...Jy,id:130,name:"Unichain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:1e3,rpcUrls:{default:{http:["https://mainnet.unichain.org/"]}},blockExplorers:{default:{name:"Uniscan",url:"https://uniscan.xyz",apiUrl:"https://api.uniscan.xyz/api"}},contracts:{...Jy.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0},disputeGameFactory:{[rw]:{address:"0x2F12d621a16e2d3285929C9996f478508951dFe4"}},portal:{[rw]:{address:"0x0bd48f6B86a26D3a217d0Fa6FfE2B491B956A7a2"}},l1StandardBridge:{[rw]:{address:"0x81014F44b0a345033bB2b3B21C7a1A308B35fEeA"}}},sourceId:1}),sw=1,aw=xm({...Jy,id:480,name:"World Chain",network:"worldchain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://worldchain-mainnet.g.alchemy.com/public"]}},blockExplorers:{default:{name:"Worldscan",url:"https://worldscan.org",apiUrl:"https://api.worldscan.org/api"},blockscout:{name:"Blockscout",url:"https://worldchain-mainnet.explorer.alchemy.com",apiUrl:"https://worldchain-mainnet.explorer.alchemy.com/api"}},contracts:{...Jy.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0},disputeGameFactory:{[sw]:{address:"0x069c4c579671f8c120b1327a73217D01Ea2EC5ea"}},l2OutputOracle:{[sw]:{address:"0x19A6d1E9034596196295CF148509796978343c5D"}},portal:{[sw]:{address:"0xd5ec14a83B7d95BE1E2Ac12523e2dEE12Cbeea6C"}},l1StandardBridge:{[sw]:{address:"0x470458C91978D2d929704489Ad730DC3E3001113"}}},testnet:!1,sourceId:1}),cw=xm({id:7e3,name:"ZetaChain",nativeCurrency:{decimals:18,name:"Zeta",symbol:"ZETA"},rpcUrls:{default:{http:["https://zetachain-evm.blockpi.network/v1/rpc/public"]}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1632781}},blockExplorers:{default:{name:"ZetaScan",url:"https://zetascan.com"}},testnet:!1}),lw=xm({...Zy,blockTime:200,id:324,name:"ZKsync Era",network:"zksync-era",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]}},blockExplorers:{default:{name:"Etherscan",url:"https://era.zksync.network/",apiUrl:"https://api-era.zksync.network/api"},native:{name:"ZKsync Explorer",url:"https://explorer.zksync.io/",apiUrl:"https://block-explorer-api.mainnet.zksync.io/api"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963"},erc6492Verifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:45659388}}}),uw="YWG990wOlIikc1tU7-WWTepfU8d1f4dp",dw=[{chain:Tb,shortName:"ethereum",displayName:"Ethereum",alchemySlug:"eth-mainnet"},{chain:Yb,shortName:"optimism",displayName:"Optimism",alchemySlug:"opt-mainnet"},{chain:cb,shortName:"bsc",displayName:"BNB Smart Chain",alchemySlug:"bnb-mainnet"},{chain:vb,shortName:"gnosis",displayName:"Gnosis",alchemySlug:"gnosis-mainnet"},{chain:ow,shortName:"unichain",displayName:"Unichain",alchemySlug:"unichain-mainnet"},{chain:Kb,shortName:"polygon",displayName:"Polygon",alchemySlug:"polygon-mainnet"},{chain:Ob,shortName:"monad",displayName:"Monad",alchemySlug:"monad-mainnet"},{chain:_b,shortName:"sonic",displayName:"Sonic",alchemySlug:"sonic-mainnet"},{chain:zb,shortName:"opbnb",displayName:"opBNB",alchemySlug:"opbnb-mainnet"},{chain:Sb,shortName:"lens",displayName:"Lens",alchemySlug:"lens-mainnet"},{chain:Gb,shortName:"shape",displayName:"Shape",alchemySlug:"shape-mainnet"},{chain:aw,shortName:"worldchain",displayName:"World Chain",alchemySlug:"worldchain-mainnet"},{chain:bb,shortName:"flow",displayName:"Flow EVM",alchemySlug:"flow-mainnet"},{chain:kb,shortName:"hyperliquid",displayName:"Hyperliquid",alchemySlug:"hyperliquid-mainnet"},{chain:Pb,shortName:"metis",displayName:"Metis",alchemySlug:"metis-mainnet"},{chain:Hb,shortName:"polygon-zkevm",displayName:"Polygon zkEVM",alchemySlug:"polygonzkevm-mainnet"},{chain:Zb,shortName:"sei",displayName:"Sei",alchemySlug:"sei-mainnet"},{chain:$b,shortName:"story",displayName:"Story",alchemySlug:"story-mainnet"},{chain:Jb,shortName:"soneium",displayName:"Soneium",alchemySlug:"soneium-mainnet"},{chain:Xy,shortName:"abstract",displayName:"Abstract",alchemySlug:"abstract-mainnet"},{chain:ab,shortName:"botanix",displayName:"Botanix",alchemySlug:"botanix-mainnet"},{chain:yb,shortName:"crossfi",displayName:"CrossFi",alchemySlug:"crossfi-mainnet"},{chain:Lb,shortName:"mantle",displayName:"Mantle",alchemySlug:"mantle-mainnet"},{chain:tw,shortName:"superseed",displayName:"Superseed",alchemySlug:"superseed-mainnet"},{chain:cw,shortName:"zetachain",displayName:"ZetaChain",alchemySlug:"zetachain-mainnet"},{chain:ib,shortName:"base",displayName:"Base",alchemySlug:"base-mainnet"},{chain:_y,shortName:"apechain",displayName:"ApeChain",alchemySlug:"apechain-mainnet"},{chain:$y,shortName:"arbitrum",displayName:"Arbitrum",alchemySlug:"arb-mainnet"},{chain:gb,shortName:"celo",displayName:"Celo",alchemySlug:"celo-mainnet"},{chain:tb,shortName:"avalanche",displayName:"Avalanche C-Chain",alchemySlug:"avax-mainnet"},{chain:jb,shortName:"scroll",displayName:"Scroll",alchemySlug:"scroll-mainnet"},{chain:Cb,shortName:"ink",displayName:"Ink",alchemySlug:"ink-mainnet"},{chain:Nb,shortName:"linea",displayName:"Linea",alchemySlug:"linea-mainnet"},{chain:wb,shortName:"geist",displayName:"Geist",alchemySlug:"geist-mainnet"},{chain:rb,shortName:"berachain",displayName:"Berachain",alchemySlug:"berachain-mainnet"},{chain:sb,shortName:"blast",displayName:"Blast",alchemySlug:"blast-mainnet"},{chain:eb,shortName:"astar",displayName:"Astar",alchemySlug:"astar-mainnet"},{chain:lw,shortName:"zksync",displayName:"zkSync",alchemySlug:"zksync-mainnet"},{chain:Vb,shortName:"rootstock",displayName:"Rootstock",alchemySlug:"rootstock-mainnet"},{chain:o.defineChain({id:69e3,name:"AnimeChain",nativeCurrency:{name:"Animecoin",symbol:"ANIME",decimals:18},rpcUrls:{default:{http:[`https://anime-mainnet.g.alchemy.com/v2/${uw}`]}},blockExplorers:{default:{name:"AnimeChain Explorer",url:"https://explorer.anime.xyz"}}}),shortName:"anime",displayName:"AnimeChain",alchemySlug:"anime-mainnet"}].map(({chain:e,shortName:t,displayName:n,alchemySlug:i})=>({...e,shortName:t,displayName:n,alchemySlug:i}));dw.map(e=>e.id);const hw=Object.fromEntries(dw.map(e=>[e.id,e.alchemySlug])),Aw=Object.fromEntries(dw.map(e=>[e.shortName,e.id])),pw=(Object.fromEntries(dw.map(e=>[e.shortName,e.displayName])),Object.fromEntries(dw.map(e=>[e.id,e])));Object.fromEntries(dw.map(e=>[e.shortName,e]));const mw=e=>{const t="string"==typeof e?parseInt(e,10):e;return pw[t]||null},fw="https://coinley.io/logo.png",gw={timeout:15e3,retryCount:2,retryDelay:1e3},yw=Object.fromEntries(dw.map(e=>[e.id,u.fallback([u.http(`https://${e.alchemySlug}.g.alchemy.com/v2/${uw}`,gw),u.http(`https://${e.alchemySlug}.g.alchemy.com/v2/qtIcCe_-8t4rIWktnWJm0`,gw)])])),bw=u.createConfig({chains:dw,connectors:[h.injected(),h.metaMask({dappMetadata:{name:"Coinley Payment",icon:fw}}),h.coinbaseWallet({appName:"Coinley Payment",appLogoUrl:fw}),h.walletConnect({projectId:"1d05a3403626aae7674102b52350de60",metadata:{name:"Coinley Payment",description:"Crypto Payment Gateway",url:"undefined"!=typeof window?window.location.origin:"https://coinley.io",icons:["https://coinley.io/logo.png"]},showQrModal:!0})],transports:yw});let ww=class{constructor(e,t,n=null){this.baseURL=e.endsWith("/")?e.slice(0,-1):e,t&&t.startsWith("pk_")?(this.publicKey=t,this.apiKey=null,this.apiSecret=null):(this.publicKey=null,this.apiKey=t,this.apiSecret=n)}async request(e,t={}){const n=`${this.baseURL}${e}`,i={"Content-Type":"application/json",...t.headers};this.publicKey?i["X-Public-Key"]=this.publicKey:(i["X-API-Key"]=this.apiKey,i["X-API-Secret"]=this.apiSecret);const r=t.timeout||6e4,o=new AbortController,s=setTimeout(()=>o.abort(),r);try{const e=await fetch(n,{...t,headers:i,signal:o.signal});if(clearTimeout(s),!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error||`HTTP ${e.status}`)}return e.json()}catch(gd){if(clearTimeout(s),"AbortError"===gd.name)throw new Error(`Request timeout after ${r/1e3}s: ${e}`);throw gd}}async getNetworks(){try{return await this.request("/api/networks")}catch(gd){return{networks:[{id:"1",name:"Ethereum",shortName:"ethereum",chainId:"0x1",type:"ethereum"},{id:"56",name:"BSC",shortName:"bsc",chainId:"0x38",type:"bsc"},{id:"137",name:"Polygon",shortName:"polygon",chainId:"0x89",type:"polygon"},{id:"42161",name:"Arbitrum",shortName:"arbitrum",chainId:"0xa4b1",type:"arbitrum"},{id:"10",name:"Optimism",shortName:"optimism",chainId:"0xa",type:"optimism"},{id:"43114",name:"Avalanche",shortName:"avalanche",chainId:"0xa86a",type:"avalanche"}]}}}async getPayableNetworks(){try{return await this.request("/api/networks/payable")}catch(gd){return this.getNetworks()}}async getTokens(){try{return await this.request("/api/networks/stablecoins")}catch(gd){return{stablecoins:[{id:"1",name:"Tether USD",symbol:"USDT",contractAddress:"0xdAC17F958D2ee523a2206206994597C13D831ec7",decimals:6,networkId:"1",Network:{shortName:"ethereum",name:"Ethereum"}},{id:"2",name:"USD Coin",symbol:"USDC",contractAddress:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",decimals:6,networkId:"1",Network:{shortName:"ethereum",name:"Ethereum"}},{id:"3",name:"Tether USD",symbol:"USDT",contractAddress:"0x55d398326f99059fF775485246999027B3197955",decimals:18,networkId:"56",Network:{shortName:"bsc",name:"BSC"}},{id:"4",name:"USD Coin",symbol:"USDC",contractAddress:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",decimals:18,networkId:"56",Network:{shortName:"bsc",name:"BSC"}},{id:"5",name:"Tether USD",symbol:"USDT",contractAddress:"0xc2132D05D31c914a87c6611C10748AEb04B58e8F",decimals:6,networkId:"137",Network:{shortName:"polygon",name:"Polygon"}},{id:"6",name:"USD Coin",symbol:"USDC",contractAddress:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",decimals:6,networkId:"137",Network:{shortName:"polygon",name:"Polygon"}},{id:"7",name:"Tether USD",symbol:"USDT",contractAddress:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",decimals:6,networkId:"42161",Network:{shortName:"arbitrum",name:"Arbitrum"}},{id:"8",name:"USD Coin",symbol:"USDC",contractAddress:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",decimals:6,networkId:"42161",Network:{shortName:"arbitrum",name:"Arbitrum"}},{id:"9",name:"Tether USD",symbol:"USDT",contractAddress:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",decimals:6,networkId:"10",Network:{shortName:"optimism",name:"Optimism"}},{id:"10",name:"USD Coin",symbol:"USDC",contractAddress:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",decimals:6,networkId:"10",Network:{shortName:"optimism",name:"Optimism"}},{id:"11",name:"Tether USD",symbol:"USDT",contractAddress:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",decimals:6,networkId:"43114",Network:{shortName:"avalanche",name:"Avalanche"}},{id:"12",name:"USD Coin",symbol:"USDC",contractAddress:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",decimals:6,networkId:"43114",Network:{shortName:"avalanche",name:"Avalanche"}},{id:"13",name:"Tether USD",symbol:"USDT",contractAddress:"0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e",decimals:6,networkId:"42220",Network:{shortName:"celo",name:"Celo"}},{id:"14",name:"USD Coin",symbol:"USDC",contractAddress:"0xcebA9300f2b948710d2653dD7B07f33A8B32118C",decimals:6,networkId:"42220",Network:{shortName:"celo",name:"Celo"}},{id:"15",name:"Tether USD",symbol:"USDT",contractAddress:"0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2",decimals:6,networkId:"8453",Network:{shortName:"base",name:"Base"}},{id:"16",name:"USD Coin",symbol:"USDC",contractAddress:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",decimals:6,networkId:"8453",Network:{shortName:"base",name:"Base"}}]}}}async getPayableTokens(){try{return await this.request("/api/networks/payable/stablecoins")}catch(gd){return this.getTokens()}}async createPayment(e){return await this.request("/api/payments/create",{method:"POST",body:JSON.stringify(e)})}async verifyQRPayment(e){return await this.request("/api/payments/verify-qr",{method:"POST",body:JSON.stringify({paymentId:e})})}async checkPaymentStatus(e){return await this.request(`/api/payments/status/${e}`)}async getContractInfo(e){try{const t=await this.request(`/api/payments/contract/${e}`);if(!t.success)throw new Error("Contract not supported on this network");return t.contractInfo}catch(gd){throw new Error(gd.message||"Failed to get contract information")}}async processPayment(e,t,n,i){try{return await this.request("/api/payments/process",{method:"POST",body:JSON.stringify({paymentId:e,transactionHash:t,network:n,senderAddress:i}),timeout:9e4})}catch(gd){throw console.error("❌ [API] processPayment error:",gd),console.error("❌ [API] processPayment error details:",{message:gd.message,name:gd.name,stack:gd.stack}),gd}}async failPayment(e,t="Payment cancelled by user",n="failed"){return await this.request("/api/payments/fail",{method:"POST",body:JSON.stringify({paymentId:e,reason:t,status:n})})}async getSupportedDepositChains(){try{return await this.request("/api/deposits/supported-chains")}catch(gd){return console.warn("Failed to get supported deposit chains:",gd.message),{success:!0,chains:[{chainId:8453,name:"Base",confirmations:5},{chainId:56,name:"BSC",confirmations:10},{chainId:42161,name:"Arbitrum",confirmations:10},{chainId:137,name:"Polygon",confirmations:15},{chainId:10,name:"Optimism",confirmations:5},{chainId:43114,name:"Avalanche",confirmations:10},{chainId:143,name:"Monad",confirmations:5}]}}}async createDepositPayment(e){return await this.request("/api/deposits/create",{method:"POST",body:JSON.stringify(e)})}async getDepositStatus(e){return await this.request(`/api/deposits/status/${e}`)}async getDepositBalance(e){return await this.request(`/api/deposits/balance/${e}`)}async requestDepositRefund(e,t){return await this.request(`/api/deposits/refund-request/${e}`,{method:"POST",body:JSON.stringify({refundAddress:t})})}async getBridgeRoute(e){return(await this.request("/api/bridge/quote",{method:"POST",body:JSON.stringify(e),timeout:45e3})).route}async getBridgeTokens(e){const t=new URLSearchParams({chainId:String(e)}).toString();return(await this.request(`/api/bridge/tokens?${t}`,{timeout:3e4})).tokens||[]}async getBridgeStatusV2(e){const t=new URLSearchParams(e).toString();return(await this.request(`/api/bridge/status?${t}`,{timeout:2e4})).status}async trackBridge(e){return await this.request("/api/bridge/track",{method:"POST",body:JSON.stringify(e),timeout:2e4})}async getCrossChainSources(){var e;const t=await this.request("/api/payments/cross-chain/sources");return Array.isArray(t)?t:Array.isArray(null==t?void 0:t.sources)?t.sources:Array.isArray(null==(e=null==t?void 0:t.data)?void 0:e.sources)?t.data.sources:[]}async createCrossChainPayment(e){return await this.request("/api/payments/cross-chain/create",{method:"POST",body:JSON.stringify(e)})}async getCrossChainStatus(e){return await this.request(`/api/payments/cross-chain/status/${e}`)}isDepositSupported(e){return[8453,56,42161,137,10,43114,143,59144,534352,130].includes(parseInt(e))}};const vw="https://li.quest/v1",kw=["base","arbitrum","optimism","polygon","bsc","avalanche"],xw={1:"ethereum",10:"optimism",56:"bsc",100:"gnosis",130:"unichain",137:"polygon",143:"monad",146:"sonic",324:"zksync",480:"world-chain",747:"flow-evm",999:"hyperliquid",1088:"metis",1329:"sei",1868:"soneium",2741:"abstract",5e3:"mantle",8453:"base",33139:"apechain",42161:"arbitrum",42170:"arbitrum-nova",42220:"celo",43114:"avalanche",57073:"ink",59144:"linea",80094:"berachain",81457:"blast",534352:"scroll"},Cw="0x0000000000000000000000000000000000000000",Sw={1:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",8453:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",42161:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",137:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",10:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",56:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",43114:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",42220:"0xcebA9300f2b948710d2653dD7B07f33A8B32118C"},Bw={1:"0xdAC17F958D2ee523a2206206994597C13D831ec7",8453:"0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2",42161:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",137:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",56:"0x55d398326f99059fF775485246999027B3197955"},Iw=(e,t=6)=>e?{address:e,decimals:t}:null,Ew=e=>({usdc:Iw(Sw[e]),usdt:Iw(Bw[e])}),Mw=e=>{if(!e||0===e.length)return null;for(const t of kw){const n=e.find(e=>{var n;return(null==(n=e.shortName)?void 0:n.toLowerCase())===t});if(n)return n}return e[0]},Dw=(e,t="USDC")=>"USDT"===t.toUpperCase()?Bw[e]||null:Sw[e]||null,Qw=0x416edef1601be,Uw={SOL:"11111111111111111111111111111111",USDC:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",USDT:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"},Fw=(e,t)=>{var n,i;const r=null==e?void 0:e.toUpperCase();return t?"USDC"===r?(null==(n=t.usdc)?void 0:n.address)||null:"USDT"===r&&(null==(i=t.usdt)?void 0:i.address)||null:null},Nw=(e,t,i)=>{const[r,o]=n.useState("method"),[s,a]=n.useState([]),[c,l]=n.useState([]),[u,d]=n.useState([]),[h,A]=n.useState([]),[p,m]=n.useState(null),[f,g]=n.useState(null),[y,b]=n.useState(null),[w,v]=n.useState(null),[k,x]=n.useState(!1),[C,S]=n.useState(""),[B,I]=n.useState(!1),[E,M]=n.useState("Processing transaction..."),[D,Q]=n.useState("deposit"),[U,F]=n.useState(null),[N,T]=n.useState([]),[L,P]=n.useState(!1),[O,R]=n.useState(null),z=n.useRef(new ww(e,t,i)),q=async e=>{try{const t=new Set(e.filter(e=>e.chainId&&"solana"!==e.shortName&&"solana"!==e.chainType).map(e=>parseInt(e.chainId)));if(0===t.size)return;const n=Mw(e);if(!n)return;const i=parseInt(n.chainId),r=Ew(i),o=Object.entries(xw).filter(([e])=>{const n=parseInt(e,10);if(!n)return!1;if(t.has(n))return!1;const i=Ew(n);return!(!i.usdc&&!i.usdt)}).map(([e,t])=>{const i=parseInt(e,10),o=Ew(i);return{id:`bridge-${i}`,name:t||`Chain ${i}`,shortName:t||`chain-${i}`,chainId:i,chainType:"evm",isBridgeNetwork:!0,bridgeDestination:{...n,bridgeTokens:r},bridgeTokens:o,logo:null}});T(o)}catch(t){console.warn("[PaymentFlow] Bridge network loading failed:",t.message),T([])}};return{currentStep:r,networks:s,merchantNetworks:c,tokens:u,merchantTokens:h,selectedNetwork:p,selectedToken:f,paymentMethod:y,paymentData:w,loading:k,error:C,processing:B,processingMessage:E,paymentType:D,actualTransactionHash:U,bridgeNetworks:N,isBridgePayment:L,bridgeDestination:O,setIsBridgePayment:P,setBridgeDestination:R,setCurrentStep:o,setSelectedNetwork:m,setSelectedToken:g,setPaymentMethod:b,setPaymentData:v,setError:S,setProcessing:I,setProcessingMessage:M,setPaymentType:Q,setActualTransactionHash:F,loadData:async()=>{try{x(!0),S("");const[e,t,n,i]=await Promise.all([z.current.getNetworks(),z.current.getTokens(),z.current.getPayableNetworks?z.current.getPayableNetworks():z.current.getNetworks(),z.current.getPayableTokens?z.current.getPayableTokens():z.current.getTokens()]),r=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test("undefined"!=typeof navigator?navigator.userAgent:""),o=(e=[])=>e.reduce((e,t)=>{if("tron"===t.shortName||"algorand"===t.shortName)return e;if("arbitrum-nova"===t.shortName||42170===parseInt(t.chainId))return e;const n="solana"===t.shortName||"solana"===t.chainType;if(n&&r)return e;if(!(n||t.chainId&&null!==t.chainId))return e;const i=n?`solana-${t.shortName}`:`${t.chainId}-${t.shortName}`;return e.some(e=>("solana"===e.shortName||"solana"===e.chainType?`solana-${e.shortName}`:`${e.chainId}-${e.shortName}`)===i)||e.push(t),e},[]),s=o(n.networks||e.networks||[]),c=o(e.networks||[]),u=(e=[])=>e.reduce((e,t)=>{var n,i,o,s,a,c,l;if(!["USDC","USDT","SOL"].includes(t.symbol))return e;if("tron"===(null==(n=t.Network)?void 0:n.shortName)||"algorand"===(null==(i=t.Network)?void 0:i.shortName))return e;if("arbitrum-nova"===(null==(o=t.Network)?void 0:o.shortName)||42170===parseInt(null==(s=t.Network)?void 0:s.chainId))return e;if(("solana"===(null==(a=t.Network)?void 0:a.shortName)||"solana"===(null==(c=t.Network)?void 0:c.chainType))&&r)return e;const u=`${t.symbol}-${(null==(l=t.Network)?void 0:l.shortName)||t.networkId}`;return e.some(e=>{var t;return`${e.symbol}-${(null==(t=e.Network)?void 0:t.shortName)||e.networkId}`===u})||e.push(t),e},[]),h=u(i.stablecoins||t.stablecoins||[]),p=u(t.stablecoins||[]);a(s),l(c),d(h),A(p),q(c)}catch(wU){S("Failed to load payment options. Using fallback data.")}finally{x(!1)}},createPayment:async e=>{var t,n;const i=(null==e?void 0:e.__coinleyAttemptMeta)||null;try{x(!0),S("");const r=parseFloat(e.amount);if(!r||r<=0||isNaN(r))throw new Error("Invalid payment amount. Please ensure the order total is greater than zero before proceeding.");const s=(null==p?void 0:p.isBridgeNetwork)&&(null==p?void 0:p.bridgeDestination)?p.bridgeDestination.shortName:p.shortName,a={amount:e.amount,currency:f.symbol,network:s,customerEmail:e.customerEmail,callbackUrl:e.callbackUrl,metadata:{...e.metadata,merchantWalletAddresses:e.merchantWalletAddresses,paymentMethod:y,selectedNetwork:s,selectedToken:f.symbol,wagmiEnabled:!0,...(null==p?void 0:p.isBridgeNetwork)?{bridgeFrom:p.shortName,bridgeTo:s,bridgeFromChainId:p.chainId,bridgeProvider:"lifi"}:{}}},c=await z.current.createPayment(a);if(!(()=>{if(!(null==i?void 0:i.isStillCurrent))return!0;try{return!!i.isStillCurrent()}catch{return!1}})()){const e=new Error("Your payment quote changed while you were switching networks or tokens. Please try again.");throw e.code="STALE_ATTEMPT",e}const l={...c.payment,__coinleyAttemptId:(null==i?void 0:i.attemptId)??null,__coinleySelectionSnapshot:(null==i?void 0:i.selectionSnapshot)??null};return v(l),sm.trackPaymentCreated(null==(t=c.payment)?void 0:t.id,e.amount,p.shortName,f.symbol),lm.trackPaymentCreated(null==(n=c.payment)?void 0:n.id,e.amount,p.shortName,f.symbol),o("confirm"),l}catch(wU){if("STALE_ATTEMPT"===(null==wU?void 0:wU.code))throw wU;S(wU.message),sm.trackError("payment_creation_failed",wU.message,{amount:e.amount,network:null==p?void 0:p.shortName,token:null==f?void 0:f.symbol}),lm.trackError("payment_creation_failed",wU.message,{amount:e.amount,network:null==p?void 0:p.shortName,token:null==f?void 0:f.symbol})}finally{x(!1)}},failPayment:async(e="Payment cancelled by user",t="failed")=>{if(null==w?void 0:w.id)try{await z.current.failPayment(w.id,e,t)}catch(n){}},resetState:()=>{o("method"),m(null),g(null),b(null),v(null),S(""),I(!1),F(null),Q("wallet"),P(!1),R(null)},resetTransactionState:()=>{S(""),I(!1),F(null),o("confirm")},isDepositSupported:()=>{if(!p)return!1;const e=parseInt(p.chainId);return[8453,56,42161,137,10,43114,143,59144,534352,130].includes(e)},createDepositPayment:async e=>{var t,n,i;const r=(null==e?void 0:e.__coinleyAttemptMeta)||null;try{x(!0),S("");const s=parseFloat(e.amount);if(!s||s<=0||isNaN(s))throw new Error("Invalid payment amount. Please ensure the order total is greater than zero before proceeding.");if(!e.network){if(![8453,56,42161,137,10,43114,143,59144,534352,130].includes(parseInt(null==p?void 0:p.chainId)))throw new Error(`Deposit address payments not supported on ${(null==p?void 0:p.name)||"this network"}. Use wallet payment instead.`)}const a=(null==(t=e.metadata)?void 0:t.debugId)||`deposit-sdk-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,c={amount:e.amount,currency:e.currency||f.symbol,network:e.network||p.shortName,customerEmail:e.customerEmail,callbackUrl:e.callbackUrl,...e.expiresIn?{expiresIn:e.expiresIn}:{},metadata:{...e.metadata,debugId:a,merchantWalletAddresses:e.merchantWalletAddresses,paymentMethod:"deposit_address",selectedNetwork:p.shortName,selectedToken:f.symbol}};if((null==w?void 0:w.id)&&!(null==w?void 0:w.isDepositPayment)){const e=w.__coinleyAttemptId??null;(!(null==r?void 0:r.attemptId)||!e||e===r.attemptId)&&(c.existingPaymentId=w.id)}const l=await z.current.createDepositPayment(c);if(!l.success)throw new Error(l.error||"Failed to create deposit payment");if(!(()=>{if(!(null==r?void 0:r.isStillCurrent))return!0;try{return!!r.isStillCurrent()}catch{return!1}})()){const e=new Error("Your payment quote changed while you were switching networks or tokens. Please try again.");throw e.code="STALE_ATTEMPT",e}const u={...l.payment,isDepositPayment:!0,__coinleyAttemptId:(null==r?void 0:r.attemptId)??null,__coinleySelectionSnapshot:(null==r?void 0:r.selectionSnapshot)??null};return v(u),Q("deposit"),sm.trackPaymentCreated(null==(n=l.payment)?void 0:n.id,e.amount,p.shortName,f.symbol),lm.trackPaymentCreated(null==(i=l.payment)?void 0:i.id,e.amount,p.shortName,f.symbol),o("confirm"),u}catch(wU){if("STALE_ATTEMPT"===(null==wU?void 0:wU.code))throw wU;throw S(wU.message),sm.trackError("deposit_payment_creation_failed",wU.message,{amount:e.amount,network:null==p?void 0:p.shortName,token:null==f?void 0:f.symbol}),lm.trackError("deposit_payment_creation_failed",wU.message,{amount:e.amount,network:null==p?void 0:p.shortName,token:null==f?void 0:f.symbol}),wU}finally{x(!1)}},resetDepositPayment:()=>{v(e=>{if(null==e?void 0:e.isDepositPayment){const{isDepositPayment:t,depositAddress:n,expiresAt:i,requiredConfirmations:r,...o}=e;return o}return e})},isSwapRequired:()=>!!f&&(!0===f.isSwapToken||!isStablecoin(f.symbol)),getMerchantStablecoin:e=>{const t=null==e?void 0:e.shortName;if(!t)return null;const n=h.find(e=>{var n;return"USDC"===e.symbol&&(null==(n=e.Network)?void 0:n.shortName)===t&&!e.isSwapToken});if(n)return n;return h.find(e=>{var n;return"USDT"===e.symbol&&(null==(n=e.Network)?void 0:n.shortName)===t&&!e.isSwapToken})||null},api:z.current}},Tw=["https://solana-mainnet.g.alchemy.com/v2/YWG990wOlIikc1tU7-WWTepfU8d1f4dp","https://solana-mainnet.g.alchemy.com/v2/qtIcCe_-8t4rIWktnWJm0","https://api.mainnet-beta.solana.com","https://solana-api.projectserum.com","https://rpc.ankr.com/solana"],Lw="solana-mainnet",Pw="Solana",Ow={PHANTOM:{name:"Phantom",id:"phantom",icon:"https://phantom.app/favicon.ico",downloadUrl:"https://phantom.app/",deepLink:"https://phantom.app/ul/browse/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa",firefox:"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/",ios:"https://apps.apple.com/us/app/phantom-solana-wallet/id1598432977",android:"https://play.google.com/store/apps/details?id=app.phantom"}},SOLFLARE:{name:"Solflare",id:"solflare",icon:"https://solflare.com/favicon.ico",downloadUrl:"https://solflare.com/",deepLink:"https://solflare.com/ul/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/solflare-wallet/bhhhlbepdkbapadjdnnojkbgioiodbic",firefox:"https://addons.mozilla.org/en-US/firefox/addon/solflare-wallet/",ios:"https://apps.apple.com/us/app/solflare/id1580902717",android:"https://play.google.com/store/apps/details?id=com.solflare.mobile"}},BACKPACK:{name:"Backpack",id:"backpack",icon:"https://backpack.app/favicon.ico",downloadUrl:"https://backpack.app/",deepLink:"https://backpack.app/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/backpack/aflkmfhebedbjioipglgcbcmnbpgliof",ios:"https://apps.apple.com/us/app/backpack-crypto-wallet/id6448811949"}},TRUST_WALLET:{name:"Trust Wallet",id:"trust",icon:"https://trustwallet.com/favicon.ico",downloadUrl:"https://trustwallet.com/",deepLink:"https://link.trustwallet.com/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph",ios:"https://apps.apple.com/app/trust-crypto-bitcoin-wallet/id1288339409",android:"https://play.google.com/store/apps/details?id=com.wallet.crypto.trustapp"}},MAGIC_EDEN:{name:"Magic Eden",id:"magiceden",icon:"https://wallet.magiceden.io/favicon.ico",downloadUrl:"https://wallet.magiceden.io/",deepLink:"https://wallet.magiceden.io/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/magic-eden-wallet/mkpegjkblkkefacfnmkajcjmabijhclg",ios:"https://apps.apple.com/app/magic-eden-wallet/id6449729293",android:"https://play.google.com/store/apps/details?id=io.magiceden.wallet"}}},Rw="evm",zw="solana",qw={...Aw},Yw=Object.fromEntries(dw.map(e=>[e.id,60])),Kw=e=>"number"==typeof e?e:"string"==typeof e?e.startsWith("0x")?parseInt(e,16):parseInt(e,10):1,Hw=e=>qw[e]||1,Vw=e=>(e=>{var t;if(!e)return!1;const n=e.toString().toLowerCase();return["solana","solana-mainnet","103"].includes(n)||n===Lw||(null==(t=Pw)?void 0:t.toLowerCase())===n})(e)?zw:Rw,jw=(e,t,n=!1)=>{if(!e||"string"!=typeof e)throw new Error(`Missing ${t} address`);if(!e.startsWith("0x"))throw new Error(`Invalid ${t} address format: must start with 0x`);if(42!==e.length)throw new Error(`Invalid ${t} address length: expected 42 characters, got ${e.length}`);if("0x0000000000000000000000000000000000000000"===e&&!n)throw new Error(`Invalid ${t} address: cannot be zero address`)},Zw=e=>{const t=(e=>{jw(e.token,"token"),jw(e.recipient1,"recipient1"),jw(e.recipient2,"recipient2");const t=0n===BigInt(e.recipient3Percentage||0);if(jw(e.recipient3,"recipient3",t),!e.paymentId||"string"!=typeof e.paymentId||0===e.paymentId.length)throw new Error("Invalid payment ID: must be a non-empty string");let n,i,r,o;try{n=BigInt(e.amount||0),i=BigInt(e.recipient1Percentage||0),r=BigInt(e.recipient2Percentage||0),o=BigInt(e.recipient3Percentage||0)}catch(a){throw new Error("Invalid numeric values: cannot convert to BigInt")}if(n<=0n)throw new Error(`Invalid amount: ${e.amount} (must be greater than 0)`);const s=i+r+o;if(10000n!==s)throw new Error(`Invalid percentages: total is ${s} but must equal 10000 basis points (100%). Individual: ${i}, ${r}, ${o}`);return{amount:n,percentage1:i,percentage2:r,percentage3:o}})(e);return{token:e.token,amount:t.amount,paymentId:e.paymentId,recipient1:e.recipient1,recipient2:e.recipient2,recipient3:e.recipient3,recipient1Percentage:t.percentage1,recipient2Percentage:t.percentage2,recipient3Percentage:t.percentage3}},Xw=[{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}],Gw=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}],Ww=e=>{var t,n;const i=(null==(t=null==e?void 0:e.message)?void 0:t.toLowerCase())||(null==(n=null==e?void 0:e.toString())?void 0:n.toLowerCase())||"",r=(null==e?void 0:e.code)||(null==e?void 0:e.reason)||"";return i.includes("user rejected")||i.includes("user denied")||i.includes("user cancelled")||i.includes("cancelled by user")||i.includes("rejected by user")||i.includes("rejected the request")||4001===r||"ACTION_REJECTED"===r?"user_rejected":i.includes("insufficient funds")||i.includes("insufficient balance")||i.includes("insufficient eth")||i.includes("insufficient matic")||i.includes("insufficient bnb")||-32e3===r?"insufficient_funds":i.includes("wrong network")||i.includes("unsupported network")||i.includes("chain mismatch")||4902===r?"wrong_network":i.includes("wallet not connected")||i.includes("no provider")||i.includes("wallet disconnected")||4900===r?"wallet_disconnected":i.includes("no routes found")||i.includes("unable to find a bridge route")||i.includes("failed to get bridge quote")?"no_route":i.includes("jupiter swap failed")||i.includes("jupiter quote failed")||i.includes("could not determine swap rate")||i.includes("swap failed")?"swap_failed":i.includes("blockhash not found")||i.includes("block height exceeded")||i.includes("blockhash has expired")?"blockhash_expired":i.includes("simulation failed")||i.includes("transaction failed on-chain")?"simulation_failed":i.includes("confirmation timed out")||i.includes("swap confirmation timed out")?"confirmation_timeout":i.includes("network error")||i.includes("rpc error")||i.includes("connection failed")||i.includes("timeout")||i.includes("request failed")?"network_error":i.includes("gas estimation failed")||i.includes("execution reverted")||i.includes("out of gas")?"gas_error":i.includes("approve")&&i.includes("failed")?"approval_failed":i.includes("transaction failed")||i.includes("revert")||i.includes("contract call failed")||i.includes("bridge transaction failed")?"transaction_failed":i.includes("popup")||i.includes("blocked")?"popup_blocked":i.includes("rate limit")||i.includes("too many requests")?"rate_limited":i.includes("payment not yet confirmed")||i.includes("not yet confirmed on-chain")||i.includes("payment not found on-chain")||i.includes("please complete the payment")?"payment_pending":i.includes("deep link")||i.includes("app not installed")||i.includes("wallet app")?"mobile_wallet_error":"unknown_error"},Jw={user_rejected:{message:"Payment cancelled.",suggestion:'Tap "Pay Now" when you\'re ready.'},insufficient_funds:{message:"Payment failed. Insufficient balance.",suggestion:"Please check your wallet balance and try again."},wallet_disconnected:{message:"Wallet disconnected.",suggestion:"Please reconnect your wallet and try again."},wrong_network:{message:"Please switch networks in your wallet.",suggestion:"Your wallet should prompt you to switch."},_default:{message:"Something went wrong. Please try again.",suggestion:"If this keeps happening, try a different token or wallet."}},_w=e=>{const t=Ww(e),n=Jw[t]||Jw._default;return{type:t,message:n.message,suggestion:n.suggestion,_internal:(null==e?void 0:e.message)||"Unknown error"}},$w=(e,t="")=>({timestamp:(new Date).toISOString(),context:t,type:Ww(e),technical:{message:(null==e?void 0:e.message)||"Unknown error",code:null==e?void 0:e.code,reason:null==e?void 0:e.reason,name:null==e?void 0:e.name}}),ev=async(e,t)=>{try{const n=await u.estimateFeesPerGas(e,{chainId:t}),i=120n,r=100n;return{maxFeePerGas:n.maxFeePerGas?n.maxFeePerGas*i/r:void 0,maxPriorityFeePerGas:n.maxPriorityFeePerGas?n.maxPriorityFeePerGas*i/r:void 0}}catch(gd){return{}}},tv=(e,t,i,r,s,a)=>{const[l,d]=n.useState("idle"),[h,A]=n.useState(""),[p,m]=n.useState(null),[f,g]=n.useState(null),{data:y,isPending:b,error:w,sendTransaction:v}=c.useSendTransaction(),{isLoading:k,isSuccess:x}=c.useWaitForTransactionReceipt({hash:y}),C=(e,t)=>{I(e,t,{background:!0}).catch(e=>{console.error("[processFinalPayment] Background finalization failed:",e)})},S=async(n=null)=>{var s,c;const l=n||e;if(!r||!(null==l?void 0:l.contractCall))throw new Error("Missing wallet connection or payment data");const h=l.contractCall;if(!h.contractAddress)throw new Error("PaymentSplitter contract data missing from payment response");if((null==a?void 0:a.ensureCorrectNetwork)&&i){if(!(await a.ensureCorrectNetwork(i)))throw new Error("Network verification failed. Please ensure you are on the correct network.")}if(!t.contractAddress)throw new Error("Native token transactions not yet supported with PaymentSplitter. Please use ERC-20 tokens.");{const e=t.decimals||6,n=h.approvalAmount||Math.floor(l.totalAmount*Math.pow(10,e));try{let s,a="unknown";try{s=await u.readContract(bw,{address:h.tokenAddress,abi:Gw,functionName:"balanceOf",args:[r]}),a="wallet-rpc"}catch(p){const e=(null==i?void 0:i.chainId)||(null==i?void 0:i.id);if(!e)throw p;{const t=(e=>{const t=mw(e),n=t?[`https://${t.alchemySlug}.g.alchemy.com/v2/${uw}`]:null;if(!t||!n)return null;const i=n.map(e=>o.http(e,{timeout:1e4,retryCount:1}));return o.createPublicClient({chain:t,transport:o.fallback(i)})})(Kw(e));if(!t)throw p;try{s=await t.readContract({address:h.tokenAddress,abi:Gw,functionName:"balanceOf",args:[r]}),a="fallback-rpc"}catch(f){throw p}}}const c=BigInt(n);if(s<c){const n=`Insufficient ${t.symbol} balance. You have ${(Number(s)/Math.pow(10,e)).toFixed(6)} ${t.symbol} but need ${(Number(c)/Math.pow(10,e)).toFixed(6)} ${t.symbol}`;throw new Error(n)}}catch(y){if(y.message.includes("Insufficient"))throw y}d("approve"),window.coinleyPendingSplitPayment={contractCall:h,selectedToken:t,paymentData:l,selectedNetwork:i};try{const e="0xdac17f958d2ee523a2206206994597c13d831ec7"===h.tokenAddress.toLowerCase()||"USDT"===t.symbol.toUpperCase();let s,a=o.erc20Abi;e&&(a=Xw);try{s=BigInt(n)}catch(b){throw new Error(`Invalid amount value: ${n}`)}let c=0n,A=0;const p=3;for(;A<p;)try{c=await u.readContract(bw,{address:h.tokenAddress,abi:o.erc20Abi,functionName:"allowance",args:[r,h.contractAddress]});break}catch(w){A++,A<p?await new Promise(e=>setTimeout(e,2e3)):c=0n}if(c>=s){d("splitPayment");const e=await B();return e&&C(e,l),e}if(e&&c>0n){const e=await ev(bw,i.chainId),t=await u.writeContract(bw,{address:h.tokenAddress,abi:o.erc20Abi,functionName:"approve",args:[h.contractAddress,0n],...e});await u.waitForTransactionReceipt(bw,{hash:t,confirmations:1,timeout:12e4})}const f=await ev(bw,i.chainId),y=await u.writeContract(bw,{address:h.tokenAddress,abi:o.erc20Abi,functionName:"approve",args:[h.contractAddress,s],...f});m(y),g(y);await u.waitForTransactionReceipt(bw,{hash:y,confirmations:1,timeout:12e4});await new Promise(e=>setTimeout(e,3e3));let k=0;const x=3;let S=!1;for(;k<x&&!S;){try{if(await u.readContract(bw,{address:h.tokenAddress,abi:o.erc20Abi,functionName:"allowance",args:[r,h.contractAddress]})>=s){S=!0;break}k<x-1&&await new Promise(e=>setTimeout(e,2e3))}catch(v){k<x-1&&await new Promise(e=>setTimeout(e,2e3))}k++}const I=await B();return I&&C(I,l),I}catch(gd){$w(gd,"approve_transaction");const t=_w(gd);if(A(t),d("idle"),window.coinleyPendingSplitPayment=null,m(null),(null==(s=gd.message)?void 0:s.includes("User rejected"))||(null==(c=gd.message)?void 0:c.includes("User denied"))||4001===gd.code)throw new Error("Transaction was cancelled by user");const n=gd.message||"Unknown error";if(n.includes("PaymentSplitter")||n.includes("verification")||n.includes("processing"))throw new Error(`Payment verification failed: ${n}`);if(n.includes("splitPayment")||n.includes("split payment"))throw new Error(`Payment transaction failed: ${n}`);throw new Error(`Approve failed: ${n}`)}}},B=async()=>{var e,t,n,i,r;try{d("splitPayment");const c=window.coinleyPendingSplitPayment;if(!c)throw new Error("Missing split payment data");const{contractCall:l,selectedToken:h,paymentData:A,selectedNetwork:p}=c,f=p.chainId||10,g=await s.getContractInfo(f),{abi:y}=g,b=Zw(l.params);Kw(f);try{const{request:e}=await u.simulateContract(bw,{address:l.contractAddress,abi:y,functionName:"splitPayment",args:[b]})}catch(o){const r=o.data||(null==(e=o.cause)?void 0:e.data);r&&("string"==typeof r&&r.startsWith("0x08c379a0")||"string"==typeof r&&r.startsWith("0x4e487b71"));o.reason||(null==(t=o.cause)?void 0:t.reason)||(null==(n=o.cause)?void 0:n.shortMessage)||(null==(i=o.data)||i.message)}const w=await ev(bw,f),v=3;let k;for(let e=0;e<=v;e++)try{k=await u.writeContract(bw,{address:l.contractAddress,abi:y,functionName:"splitPayment",args:[b],...w});break}catch(a){const t=(null==(r=a.message)?void 0:r.toLowerCase())||"",n=t.includes("rate limit")||t.includes("too many requests")||t.includes("retry in")||t.includes("call rate limit exhausted"),i=t.includes("internal json-rpc error")||t.includes("-32603")||t.includes("nonce")||t.includes("network request failed")||t.includes("timeout");if(e===v||!(n||i))throw a;const o=n?12e3:3e3*(e+1);await new Promise(e=>setTimeout(e,o))}return m(k),d("processing"),window.coinleyPendingSplitPayment=null,k}catch(gd){$w(gd,"split_payment_transaction");const t=_w(gd);throw A(t),d("idle"),window.coinleyPendingSplitPayment=null,m(null),gd}},I=async(n,o=null,a={})=>{var c;const l=o||e,u=!0===(null==a?void 0:a.background);try{if(u||d("processing"),f&&n===f)throw console.error("🛑 [processFinalPayment] BLOCKED: Attempted to send approve hash to backend!",{approveHash:f,transactionHash:n}),new Error("Invalid transaction: approve hash cannot be used as payment hash. The splitPayment transaction may have failed.");if(!s||!s.processPayment)throw new Error("API instance not available or missing processPayment method");u||await new Promise(e=>setTimeout(e,4e3));const e=3;let o=null;for(let a=0;a<e;a++)try{if(a>0){const e=5e3*a;await new Promise(t=>setTimeout(t,e))}const c=await s.processPayment(l.id,n,i.shortName,r);if(c&&!1!==c.success)return u||d("success"),sm.trackPaymentSuccess(l.id,l.amount,null==i?void 0:i.shortName,null==t?void 0:t.symbol,n),lm.trackPaymentSuccess(l.id,l.amount,null==i?void 0:i.shortName,null==t?void 0:t.symbol,n),c;o=new Error((null==c?void 0:c.error)||(null==c?void 0:c.message)||"Payment verification failed");const h=o.message.toLowerCase(),A=h.includes("not sent to")||h.includes("did not emit");if(!(!A&&(h.includes("not yet")||h.includes("not found")||h.includes("verification failed")))||a===e-1)throw o}catch(h){o=h;const t=(null==(c=h.message)?void 0:c.toLowerCase())||"",n=t.includes("not sent to")||t.includes("did not emit");if(!(!n&&(t.includes("not yet")||t.includes("not found")||t.includes("verification failed")||t.includes("timeout")||t.includes("network")))||a===e-1)throw o}throw o||new Error("Payment verification failed after retries")}catch(gd){console.error("❌ [processFinalPayment] Error occurred:",gd),console.error("❌ [processFinalPayment] Error details:",{message:gd.message,stack:gd.stack,name:gd.name});const n=$w(gd,"final_payment_processing");console.error("❌ [processFinalPayment] Formatted error log:",n);const r=_w(gd);throw console.error("❌ [processFinalPayment] User-friendly error:",r),u||(A(r),d("error")),sm.trackPaymentFailed(null==l?void 0:l.id,null==l?void 0:l.amount,null==i?void 0:i.shortName,null==t?void 0:t.symbol,r),lm.trackPaymentFailed(null==l?void 0:l.id,null==l?void 0:l.amount,null==i?void 0:i.shortName,null==t?void 0:t.symbol,r),gd}};return{transactionStep:l,transactionError:h,currentTransactionHash:p,txPending:b,isConfirming:k,isConfirmed:x,executePaymentTransaction:S,executeBridgeAndPay:async(e,t,n,i,r)=>{try{d("bridging"),null==r||r("bridging","Bridging tokens to destination chain...");const o=await e.executeBridge(t,n,(e,t)=>{null==r||r(e,t)});if(!o.success)throw new Error(o.error||"Bridge transaction failed");if(d("switching"),null==r||r("switching","Switching to destination network..."),(null==a?void 0:a.ensureCorrectNetwork)&&i){if(!(await a.ensureCorrectNetwork(i)))throw new Error("Failed to switch to destination network after bridge. Please switch manually and retry.")}await new Promise(e=>setTimeout(e,2e3)),null==r||r("paying","Processing payment on destination chain...");return await S()}catch(gd){console.error("[BridgeAndPay] Failed:",gd);const t=_w(gd);throw A(t),d("idle"),gd}},executeSwapToDeposit:async(e,t,n,i,r,o)=>{try{d("swapping");const a=t.isSwap&&!t.isSameChain?"swap & bridge":"swap";null==i||i("swapping",`Swapping ${t.originTokenSymbol} → ${t.destTokenSymbol}...`);const c=r?{...t,paymentId:r}:t,l=await e.executeBridge(c,n,(e,t)=>{null==i||i(e,t)});if(!l.success)throw new Error(l.error||`${a} transaction failed`);if(m(l.txHash),r&&o){null==i||i("verifying","Verifying deposit on server..."),d("verifying");const e=60;let n=!1,a=null;for(let t=0;t<e;t++){try{const e=await o.getDepositStatus(r),s=null==e?void 0:e.payment,c=`${(null==s?void 0:s.status)||"unknown"}:${(null==s?void 0:s.detectedAt)?"detected":"undetected"}`;if((c!==a||0===t||(null==s?void 0:s.detectedAt)||"completed"===(null==s?void 0:s.status)||"swept"===(null==s?void 0:s.status)||"sweeping"===(null==s?void 0:s.status)||"failed"===(null==s?void 0:s.status)||"expired"===(null==s?void 0:s.status)||(t+1)%10==0)&&(a=c),(null==s?void 0:s.detectedAt)||"completed"===(null==s?void 0:s.status)||"swept"===(null==s?void 0:s.status)||"sweeping"===(null==s?void 0:s.status)){n=!0,null==i||i("verified","Deposit confirmed by server!");break}if("failed"===(null==s?void 0:s.status)||"expired"===(null==s?void 0:s.status))throw new Error(`Payment ${s.status}. Please contact support.`)}catch(s){if(s.message.includes("Payment")&&(s.message.includes("failed")||s.message.includes("expired")))throw s}null==i||i("verifying",`Verifying deposit... (${t+1}/${e})`),await new Promise(e=>setTimeout(e,2e3))}if(!n)return console.warn("[SwapToDeposit] Server verification timed out, entering processing state:",{debugId:null==t?void 0:t.debugId,paymentId:r,txHash:l.txHash}),d("settlement_pending"),null==i||i("processing","Payment sent. Settlement is still being confirmed."),{success:!1,pendingSettlement:!0,txHash:l.txHash,paymentId:r}}return null==i||i("completed","Payment complete!"),d("idle"),l}catch(gd){console.error("[SwapToDeposit] Failed:",gd);const t=_w(gd);throw A(t),d("idle"),gd}},executeSplitPayment:B,processFinalPayment:I,resetTransaction:()=>{d("idle"),A(""),m(null),g(null),window.coinleyPendingSplitPayment=null},setTransactionError:A,setTransactionStep:d}},nv=BigInt(0),iv=BigInt(1);function rv(e,t=""){if("boolean"!=typeof e){throw new Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e)}return e}function ov(e,t,n=""){const i=Tf(e),r=null==e?void 0:e.length,o=void 0!==t;if(!i||o&&r!==t){throw new Error((n&&`"${n}" `)+"expected Uint8Array"+(o?` of length ${t}`:"")+", got "+(i?`length=${r}`:"type="+typeof e))}return e}function sv(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function av(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?nv:BigInt("0x"+e)}function cv(e){return av(Xf(e))}function lv(e){return Pf(e),av(Xf(Uint8Array.from(e).reverse()))}function uv(e,t){return ng(e.toString(16).padStart(2*t,"0"))}function dv(e,t){return uv(e,t).reverse()}function hv(e,t,n){let i;if("string"==typeof t)try{i=ng(t)}catch(o){throw new Error(e+" must be hex string or Uint8Array, cause: "+o)}else{if(!Tf(t))throw new Error(e+" must be hex string or Uint8Array");i=Uint8Array.from(t)}const r=i.length;if("number"==typeof n&&r!==n)throw new Error(e+" of length "+n+" expected, got "+r);return i}function Av(e){return Uint8Array.from(e)}const pv=e=>"bigint"==typeof e&&nv<=e;function mv(e,t,n,i){if(!function(e,t,n){return pv(e)&&pv(t)&&pv(n)&&t<=e&&e<n}(t,n,i))throw new Error("expected valid "+e+": "+n+" <= n < "+i+", got "+t)}function fv(e){let t;for(t=0;e>nv;e>>=iv,t+=1);return t}const gv=e=>(iv<<BigInt(e))-iv;function yv(e,t,n={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");function i(t,n,i){const r=e[t];if(i&&void 0===r)return;const o=typeof r;if(o!==n||null===r)throw new Error(`param "${t}" is invalid: expected ${n}, got ${o}`)}Object.entries(t).forEach(([e,t])=>i(e,t,!1)),Object.entries(n).forEach(([e,t])=>i(e,t,!0))}function bv(e){const t=new WeakMap;return(n,...i)=>{const r=t.get(n);if(void 0!==r)return r;const o=e(n,...i);return t.set(n,o),o}}
10
+ !function(e){const t=f,n=S,i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},e.INSPECT_MAX_BYTES=50;const r=2147483647;e.kMaxLength=r;const{Uint8Array:o,ArrayBuffer:s,SharedArrayBuffer:a}=globalThis;function c(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new o(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return u(e,t,n)}function u(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let i=c(n);const r=i.write(e,t);r!==n&&(i=i.slice(0,r));return i}(e,t);if(s.isView(e))return function(e){if(_(e,o)){const t=new o(e);return p(t.buffer,t.byteOffset,t.byteLength)}return A(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(_(e,s)||e&&_(e.buffer,s))return p(e,t,n);if(void 0!==a&&(_(e,a)||e&&_(e.buffer,a)))return p(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return l.from(i,t,n);const r=function(e){if(l.isBuffer(e)){const t=0|m(e.length),n=c(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||$(e.length)?c(0):A(e);if("Buffer"===e.type&&Array.isArray(e.data))return A(e.data)}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return d(e),c(e<0?0:0|m(e))}function A(e){const t=e.length<0?0:0|m(e.length),n=c(t);for(let i=0;i<t;i+=1)n[i]=255&e[i];return n}function p(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===t&&void 0===n?new o(e):void 0===n?new o(e,t):new o(e,t,n),Object.setPrototypeOf(i,l.prototype),i}function m(e){if(e>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(s.isView(e)||_(e,s))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;let r=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(r)return i?-1:G(e).length;t=(""+t).toLowerCase(),r=!0}}function y(e,t,n){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,n);case"utf8":case"utf-8":return M(this,t,n);case"ascii":return Q(this,t,n);case"latin1":case"binary":return U(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function b(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function w(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),$(n=+n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:v(e,t,n,i,r);if("number"==typeof t)return t&=255,"function"==typeof o.prototype.indexOf?r?o.prototype.indexOf.call(e,t,n):o.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,i,r){let o,s=1,a=e.length,c=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(r){let i=-1;for(o=n;o<a;o++)if(l(e,o)===l(t,-1===i?0:o-i)){if(-1===i&&(i=o),o-i+1===c)return i*s}else-1!==i&&(o-=o-i),i=-1}else for(n+c>a&&(n=a-c),o=n;o>=0;o--){let n=!0;for(let i=0;i<c;i++)if(l(e,o+i)!==l(t,i)){n=!1;break}if(n)return o}return-1}function k(e,t,n,i){n=Number(n)||0;const r=e.length-n;i?(i=Number(i))>r&&(i=r):i=r;const o=t.length;let s;for(i>o/2&&(i=o/2),s=0;s<i;++s){const i=parseInt(t.substr(2*s,2),16);if($(i))return s;e[n+s]=i}return s}function x(e,t,n,i){return J(G(t,e.length-n),e,n,i)}function C(e,t,n,i){return J(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,i)}function B(e,t,n,i){return J(W(t),e,n,i)}function I(e,t,n,i){return J(function(e,t){let n,i,r;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),i=n>>8,r=n%256,o.push(r),o.push(i);return o}(t,e.length-n),e,n,i)}function E(e,n,i){return 0===n&&i===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,i))}function M(e,t,n){n=Math.min(e.length,n);const i=[];let r=t;for(;r<n;){const t=e[r];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(r+s<=n){let n,i,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:n=e[r+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(o=c));break;case 3:n=e[r+1],i=e[r+2],128==(192&n)&&128==(192&i)&&(c=(15&t)<<12|(63&n)<<6|63&i,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:n=e[r+1],i=e[r+2],a=e[r+3],128==(192&n)&&128==(192&i)&&128==(192&a)&&(c=(15&t)<<18|(63&n)<<12|(63&i)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),r+=s}return function(e){const t=e.length;if(t<=D)return String.fromCharCode.apply(String,e);let n="",i=0;for(;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=D));return n}(i)}l.TYPED_ARRAY_SUPPORT=function(){try{const e=new o(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,o.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,n){return u(e,t,n)},Object.setPrototypeOf(l.prototype,o.prototype),Object.setPrototypeOf(l,o),l.alloc=function(e,t,n){return function(e,t,n){return d(e),e<=0?c(e):void 0!==t?"string"==typeof n?c(e).fill(t,n):c(e).fill(t):c(e)}(e,t,n)},l.allocUnsafe=function(e){return h(e)},l.allocUnsafeSlow=function(e){return h(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(_(e,o)&&(e=l.from(e,e.offset,e.byteLength)),_(t,o)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,i=t.length;for(let r=0,o=Math.min(n,i);r<o;++r)if(e[r]!==t[r]){n=e[r],i=t[r];break}return n<i?-1:i<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const i=l.allocUnsafe(t);let r=0;for(n=0;n<e.length;++n){let t=e[n];if(_(t,o))r+t.length>i.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(i,r)):o.prototype.set.call(i,t,r);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(i,r)}r+=t.length}return i},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?M(this,0,e):y.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let t="";const n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},i&&(l.prototype[i]=l.prototype.inspect),l.prototype.compare=function(e,t,n,i,r){if(_(e,o)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;if(this===e)return 0;let s=(r>>>=0)-(i>>>=0),a=(n>>>=0)-(t>>>=0);const c=Math.min(s,a),u=this.slice(i,r),d=e.slice(t,n);for(let o=0;o<c;++o)if(u[o]!==d[o]){s=u[o],a=d[o];break}return s<a?-1:a<s?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return w(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return w(this,e,t,n,!1)},l.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}const r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return k(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":case"latin1":case"binary":return C(this,e,t,n);case"base64":return B(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const D=4096;function Q(e,t,n){let i="";n=Math.min(e.length,n);for(let r=t;r<n;++r)i+=String.fromCharCode(127&e[r]);return i}function U(e,t,n){let i="";n=Math.min(e.length,n);for(let r=t;r<n;++r)i+=String.fromCharCode(e[r]);return i}function F(e,t,n){const i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);let r="";for(let o=t;o<n;++o)r+=ee[e[o]];return r}function N(e,t,n){const i=e.slice(t,n);let r="";for(let o=0;o<i.length-1;o+=2)r+=String.fromCharCode(i[o]+256*i[o+1]);return r}function T(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,n,i,r,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function P(e,t,n,i,r){V(t,i,r,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,n}function O(e,t,n,i,r){V(t,i,r,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=s,s>>=8,e[n+2]=s,s>>=8,e[n+1]=s,s>>=8,e[n]=s,n+8}function R(e,t,n,i,r,o){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function z(e,t,i,r,o){return t=+t,i>>>=0,o||R(e,0,i,4),n.write(e,t,i,r,23,4),i+4}function q(e,t,i,r,o){return t=+t,i>>>=0,o||R(e,0,i,8),n.write(e,t,i,r,52,8),i+8}l.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const i=this.subarray(e,t);return Object.setPrototypeOf(i,l.prototype),i},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);let i=this[e],r=1,o=0;for(;++o<t&&(r*=256);)i+=this[e+o]*r;return i},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);let i=this[e+--t],r=1;for(;t>0&&(r*=256);)i+=this[e+--t]*r;return i},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=te(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);const i=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,r=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(i)+(BigInt(r)<<BigInt(32))}),l.prototype.readBigUInt64BE=te(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);const i=t*2**24+65536*this[++e]+256*this[++e]+this[++e],r=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(i)<<BigInt(32))+BigInt(r)}),l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);let i=this[e],r=1,o=0;for(;++o<t&&(r*=256);)i+=this[e+o]*r;return r*=128,i>=r&&(i-=Math.pow(2,8*t)),i},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);let i=t,r=1,o=this[e+--i];for(;i>0&&(r*=256);)o+=this[e+--i]*r;return r*=128,o>=r&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=te(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);const i=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),l.prototype.readBigInt64BE=te(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Z(e,this.length-8);const i=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)}),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),n.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t>>>=0,n>>>=0,!i){L(this,e,t,n,Math.pow(2,8*n)-1,0)}let r=1,o=0;for(this[t]=255&e;++o<n&&(r*=256);)this[t+o]=e/r&255;return t+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t>>>=0,n>>>=0,!i){L(this,e,t,n,Math.pow(2,8*n)-1,0)}let r=n-1,o=1;for(this[t+r]=255&e;--r>=0&&(o*=256);)this[t+r]=e/o&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=te(function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=te(function(e,t=0){return O(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*n-1);L(this,e,t,n,i-1,-i)}let r=0,o=1,s=0;for(this[t]=255&e;++r<n&&(o*=256);)e<0&&0===s&&0!==this[t+r-1]&&(s=1),this[t+r]=(e/o|0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*n-1);L(this,e,t,n,i-1,-i)}let r=n-1,o=1,s=0;for(this[t+r]=255&e;--r>=0&&(o*=256);)e<0&&0===s&&0!==this[t+r+1]&&(s=1),this[t+r]=(e/o|0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=te(function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=te(function(e,t=0){return O(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeFloatLE=function(e,t,n){return z(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return z(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return q(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return q(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,i){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);const r=i-n;return this===e&&"function"==typeof o.prototype.copyWithin?this.copyWithin(t,n,i):o.prototype.set.call(e,this.subarray(n,i),t),r},l.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!l.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){const t=e.charCodeAt(0);("utf8"===i&&t<128||"latin1"===i)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let r;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(r=t;r<n;++r)this[r]=e;else{const o=l.isBuffer(e)?e:l.from(e,i),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(r=0;r<n-t;++r)this[r+t]=o[r%s]}return this};const Y={};function K(e,t,n){Y[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function H(e){let t="",n=e.length;const i="-"===e[0]?1:0;for(;n>=i+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function V(e,t,n,i,r,o){if(e>n||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`,new Y.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){j(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||Z(t,e.length-(n+1))}(i,r,o)}function j(e,t){if("number"!=typeof e)throw new Y.ERR_INVALID_ARG_TYPE(t,"number",e)}function Z(e,t,n){if(Math.floor(e)!==e)throw j(e,n),new Y.ERR_OUT_OF_RANGE("offset","an integer",e);if(t<0)throw new Y.ERR_BUFFER_OUT_OF_BOUNDS;throw new Y.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}K("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),K("ERR_OUT_OF_RANGE",function(e,t,n){let i=`The value of "${e}" is out of range.`,r=n;return Number.isInteger(n)&&Math.abs(n)>2**32?r=H(String(n)):"bigint"==typeof n&&(r=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(r=H(r)),r+="n"),i+=` It must be ${t}. Received ${r}`,i},RangeError);const X=/[^+/0-9A-Za-z-_]/g;function G(e,t){let n;t=t||1/0;const i=e.length;let r=null;const o=[];for(let s=0;s<i;++s){if(n=e.charCodeAt(s),n>55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(t-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function W(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,n,i){let r;for(r=0;r<i&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function _(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function $(e){return e!=e}const ee=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const i=16*n;for(let r=0;r<16;++r)t[i+r]=e[n]+e[r]}return t}();function te(e){return"undefined"==typeof BigInt?ne:e}function ne(){throw new Error("BigInt not supported")}}(m);const B=m.Buffer,I=m.Blob,E=m.BlobOptions,M=m.Buffer,D=m.File,Q=m.FileOptions,U=m.INSPECT_MAX_BYTES,F=m.SlowBuffer,N=m.TranscodeEncoding,T=m.atob,L=m.btoa,P=m.constants,O=m.isAscii,R=m.isUtf8,z=m.kMaxLength,q=m.kStringMaxLength,Y=m.resolveObjectURL,K=m.transcode,H=Object.freeze(Object.defineProperty({__proto__:null,Blob:I,BlobOptions:E,Buffer:M,File:D,FileOptions:Q,INSPECT_MAX_BYTES:U,SlowBuffer:F,TranscodeEncoding:N,atob:T,btoa:L,constants:P,default:B,isAscii:O,isUtf8:R,kMaxLength:z,kStringMaxLength:q,resolveObjectURL:Y,transcode:K},Symbol.toStringTag,{value:"Module"})),V=n.lazy(()=>Promise.resolve().then(()=>tU)),j=e=>t.jsx(n.Suspense,{fallback:null,children:t.jsx(V,{...e})}),Z=n.createContext(null),X=n.forwardRef(({customerEmail:e="",merchantName:t="",onSuccess:i,onError:r,onClose:o,theme:s="light",autoOpen:a=!1,testMode:c=!1,debug:l=!1,merchantWalletAddresses:u={}},d)=>{const h=n.useContext(Z);if(!h)throw new Error("CoinleyCheckout must be used within a CoinleyProvider");const{openPayment:A,closePayment:p}=h,m=t=>{try{if(!t.amount||t.amount<=0)throw new Error("Amount must be greater than 0");const n={...t,customerEmail:t.customerEmail||e,merchantWalletAddresses:{...u,...t.merchantWalletAddresses},metadata:{...t.metadata,testMode:c,checkoutVersion:"1.0.0"}};A(n,{onSuccess:i,onError:r,onClose:o})}catch(gd){r&&r(gd)}},f=()=>{p()};return n.useImperativeHandle(d,()=>({open:m,close:f})),null});X.displayName="CoinleyCheckout";const G=n.lazy(()=>Promise.resolve().then(()=>sU));class W{constructor(e="https://payment.coinley.io/"){this.basePaymentUrl=e.endsWith("/")?e:e+"/"}generatePaymentURL(e){const{merchant:t,amount:n,productAmount:i,platformFee:r,networkFee:o,token:s="USDC",network:a="Ethereum Mainnet",merchantAddress:c}=e;if(!t)throw new Error("Merchant name is required");if(!n)throw new Error("Amount is required");if(!c)throw new Error("Merchant address (smart contract) is required");const l=i||.95*n,u=r||.03*n,d=o||.02*n,h=new URLSearchParams({merchant:t,amount:n.toString(),productAmount:l.toString(),platformFee:u.toString(),networkFee:d.toString(),token:s,network:a,merchantAddress:c});return this.basePaymentUrl+"?"+h.toString()}async generateQRCode(e,t={}){const{width:n=300,margin:i=2,colorDark:o="#7c3aed",colorLight:s="#ffffff"}=t;try{const t=this.generatePaymentURL(e);return{qrCodeDataURL:await r.toDataURL(t,{width:n,margin:i,color:{dark:o,light:s}}),paymentURL:t,paymentData:{...e,qrCodeUrl:t}}}catch(gd){throw new Error(`Failed to generate QR code: ${gd.message}`)}}async generateQRCodeToCanvas(e,t,n={}){const{width:i=300,margin:o=2,colorDark:s="#7c3aed",colorLight:a="#ffffff"}=n;try{const n=this.generatePaymentURL(e);return await r.toCanvas(t,n,{width:i,margin:o,color:{dark:s,light:a}}),n}catch(gd){throw new Error(`Failed to generate QR code to canvas: ${gd.message}`)}}validatePaymentData(e){const t=[],n=[];e.merchant||t.push("Merchant name is required"),(!e.amount||e.amount<=0)&&t.push("Valid amount is required"),e.merchantAddress||t.push("Merchant address (smart contract) is required"),e.merchantAddress&&!/^0x[a-fA-F0-9]{40}$/.test(e.merchantAddress)&&t.push("Invalid Ethereum address format for merchantAddress"),e.amount>1e4&&n.push("Large payment amount detected");return(e.platformFee||0)+(e.networkFee||0)>.1*e.amount&&n.push("High fees detected (>10% of total amount)"),{isValid:0===t.length,errors:t,warnings:n}}async createPaymentQR(e){const{merchantName:t,amount:n,productAmount:i,platformFee:r,networkFee:o,token:s,network:a,merchantWalletAddresses:c,selectedNetwork:l="ethereum",...u}=e,d={merchant:t||"Coinley Merchant",amount:n,productAmount:i,platformFee:r,networkFee:o,token:s||"USDC",network:a||"Ethereum Mainnet",merchantAddress:(null==c?void 0:c[l])||(null==c?void 0:c.ethereum)||(null==c?void 0:c.splitPaymentContract),...u},h=this.validatePaymentData(d);if(!h.isValid)throw new Error(`Payment validation failed: ${h.errors.join(", ")}`);return{...await this.generateQRCode(d),validation:h,instructions:{userAction:"Scan this QR code with your mobile wallet to pay",expectedFlow:"QR Scan → Payment Screen → Wallet Connect → Split Payment → Confirmation",supportedWallets:["MetaMask","Trust Wallet","Coinbase Wallet","WalletConnect compatible wallets"]}}}}const J=new W;function _(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $,ee,te={exports:{}},ne=te.exports={};function ie(){throw new Error("setTimeout has not been defined")}function re(){throw new Error("clearTimeout has not been defined")}function oe(e){if($===setTimeout)return setTimeout(e,0);if(($===ie||!$)&&setTimeout)return $=setTimeout,setTimeout(e,0);try{return $(e,0)}catch(t){try{return $.call(null,e,0)}catch(n){return $.call(this,e,0)}}}!function(){try{$="function"==typeof setTimeout?setTimeout:ie}catch(e){$=ie}try{ee="function"==typeof clearTimeout?clearTimeout:re}catch(e){ee=re}}();var se,ae=[],ce=!1,le=-1;function ue(){ce&&se&&(ce=!1,se.length?ae=se.concat(ae):le=-1,ae.length&&de())}function de(){if(!ce){var e=oe(ue);ce=!0;for(var t=ae.length;t;){for(se=ae,ae=[];++le<t;)se&&se[le].run();le=-1,t=ae.length}se=null,ce=!1,function(e){if(ee===clearTimeout)return clearTimeout(e);if((ee===re||!ee)&&clearTimeout)return ee=clearTimeout,clearTimeout(e);try{return ee(e)}catch(t){try{return ee.call(null,e)}catch(n){return ee.call(this,e)}}}(e)}}function he(e,t){this.fun=e,this.array=t}function Ae(){}ne.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];ae.push(new he(e,t)),1!==ae.length||ce||oe(de)},he.prototype.run=function(){this.fun.apply(null,this.array)},ne.title="browser",ne.browser=!0,ne.env={},ne.argv=[],ne.version="",ne.versions={},ne.on=Ae,ne.addListener=Ae,ne.once=Ae,ne.off=Ae,ne.removeListener=Ae,ne.removeAllListeners=Ae,ne.emit=Ae,ne.prependListener=Ae,ne.prependOnceListener=Ae,ne.listeners=function(e){return[]},ne.binding=function(e){throw new Error("process.binding is not supported")},ne.cwd=function(){return"/"},ne.chdir=function(e){throw new Error("process.chdir is not supported")},ne.umask=function(){return 0};const pe=_(te.exports);var me;if("undefined"==typeof window){var fe={hostname:""};me={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:fe,referrer:""},screen:{width:0,height:0},location:fe,addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(){},CustomEvent:function(){}}}else me=window;function ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function ye(e,t,n,i,r,o,s){try{var a=e[o](s),c=a.value}catch(gd){return void n(gd)}a.done?t(c):Promise.resolve(c).then(i,r)}function be(e){return function(){var t=this,n=arguments;return new Promise(function(i,r){var o=e.apply(t,n);function s(e){ye(o,i,r,s,a,"next",e)}function a(e){ye(o,i,r,s,a,"throw",e)}s(void 0)})}}function we(e,t,n){return(we=De()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&Ie(r,n.prototype),r}).apply(null,arguments)}function ve(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}function ke(){return ke=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ke.apply(this,arguments)}function xe(e){return(xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ce(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ie(e,t)}function Se(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function Be(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}function Ie(e,t){return(Ie=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ee(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function Me(e){var t="function"==typeof Map?new Map:void 0;return Me=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return we(e,arguments,xe(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ie(i,e)},Me(e)}function De(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(De=function(){return!!e})()}function Qe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ge(e,t):void 0}}(e))||t){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ue(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function Fe(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var Ne,Te=Object.defineProperty,Le=function(e,t,n){return function(e,t,n){return t in e?Te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":Ee(t))?t+"":t,n)},Pe=Object.defineProperty,Oe=function(e,t,n){return function(e,t,n){return t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":Ee(t))?t+"":t,n)},Re=function(e){return e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e}(Re||{}),ze={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},qe={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ye={};function Ke(e){if(Ye[e])return Ye[e];var t=globalThis[e],n=t.prototype,i=e in ze?ze[e]:void 0,r=Boolean(i&&i.every(function(e){var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))})),o=e in qe?qe[e]:void 0,s=Boolean(o&&o.every(function(e){var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(r&&s&&!globalThis.Zone)return Ye[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var c=a.contentWindow;if(!c)return t.prototype;var l=c[e].prototype;return document.body.removeChild(a),l?Ye[e]=l:n}catch(u){return n}}var He={};function Ve(e,t,n){var i,r=e+"."+String(n);if(He[r])return He[r].call(t);var o=Ke(e),s=null==(i=Object.getOwnPropertyDescriptor(o,n))?void 0:i.get;return s?(He[r]=s,s.call(t)):t[n]}var je={};function Ze(e,t,n){var i=e+"."+String(n);if(je[i])return je[i].bind(t);var r=Ke(e)[n];return"function"!=typeof r?t[n]:(je[i]=r,r.bind(t))}var Xe={childNodes:function(e){return Ve("Node",e,"childNodes")},parentNode:function(e){return Ve("Node",e,"parentNode")},parentElement:function(e){return Ve("Node",e,"parentElement")},textContent:function(e){return Ve("Node",e,"textContent")},contains:function(e,t){return Ze("Node",e,"contains")(t)},getRootNode:function(e){return Ze("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ve("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ve("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ve("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ve("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Ke("MutationObserver").constructor},patch:function(e,t,n){try{if(!(t in e))return function(){};var i=e[t],r=n(i);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=r,function(){e[t]=i}}catch(o){return function(){}}}};function Ge(e){return e.nodeType===e.ELEMENT_NODE}function We(e){var t=e&&"host"in e&&"mode"in e&&Xe.host(e)||null;return Boolean(t&&"shadowRoot"in t&&Xe.shadowRoot(t)===e)}function Je(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function _e(e){try{var t=e.rules||e.cssRules;if(!t)return null;var n=e.href;!n&&e.ownerNode&&e.ownerNode.ownerDocument&&(n=e.ownerNode.ownerDocument.location.href);var i=Array.from(t,function(e){return $e(e,n)}).join("");return(r=i).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r}catch(gd){return null}var r}function $e(e,t){if(function(e){return"styleSheet"in e}(e)){var n;try{n=_e(e.styleSheet)||function(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer("+e.layerName+")"),e.supportsText&&n.push("supports("+e.supportsText+")"),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(gd){n=e.cssText}return e.styleSheet.href?ut(n,e.styleSheet.href):n}var i,r=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,r=r.replace(i,"$1\\$2")),t?ut(r,t):r}var et=function(){function e(){Oe(this,"idNodeMap",new Map),Oe(this,"nodeMetaMap",new WeakMap)}var t=e.prototype;return t.getId=function(e){var t;if(!e)return-1;var n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-1},t.getNode=function(e){return this.idNodeMap.get(e)||null},t.getIds=function(){return Array.from(this.idNodeMap.keys())},t.getMeta=function(e){return this.nodeMetaMap.get(e)||null},t.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},t.has=function(e){return this.idNodeMap.has(e)},t.hasNode=function(e){return this.nodeMetaMap.has(e)},t.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},t.replace=function(e,t){var n=this.getNode(e);if(n){var i=this.nodeMetaMap.get(n);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)},t.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function tt(e){var t=e.element,n=e.maskInputOptions,i=e.tagName,r=e.type,o=e.value,s=e.maskInputFn,a=o||"",c=r&&nt(r);return(n[i.toLowerCase()]||c&&n[c])&&(a=s?s(a,t):"*".repeat(a.length)),a}function nt(e){return e.toLowerCase()}var it="__rrweb_original__";function rt(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?nt(t):null}function ot(e,t){var n;try{n=new URL(e,null!=t?t:window.location.href)}catch(o){return null}var i,r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!=(i=null==r?void 0:r[1])?i:null}var st=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,at=/^(?:[a-z+]+:)?\/\//i,ct=/^www\..*/i,lt=/^(data:)([^,]*),(.*)/i;function ut(e,t){return(e||"").replace(st,function(e,n,i,r,o,s){var a,c=i||o||s,l=n||r||"";if(!c)return e;if(at.test(c)||ct.test(c))return"url("+l+c+l+")";if(lt.test(c))return"url("+l+c+l+")";if("/"===c[0])return"url("+l+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+c)+l+")";var u=t.split("/"),d=c.split("/");u.pop();for(var h,A=Qe(d);!(h=A()).done;){var p=h.value;"."!==p&&(".."===p?u.pop():u.push(p))}return"url("+l+u.join("/")+l+")"})}function dt(e,t){return void 0===t&&(t=!1),t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function ht(e,t){return function(e,t,n){void 0===n&&(n=!1);var i=Array.from(t.childNodes),r=[],o=0;if(i.length>1&&e&&"string"==typeof e)for(var s=dt(e,n),a=s.length/e.length,c=1;c<i.length;c++)if(i[c].textContent&&"string"==typeof i[c].textContent){for(var l=dt(i[c].textContent,n),u=3;u<l.length&&(l[u].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,u),1));u++);for(;u<l.length;u++){var d=l.substring(0,u),h=s.split(d),A=-1;if(2===h.length)A=h[0].length;else if(h.length>2&&""===h[0]&&""!==i[c-1].textContent)A=s.indexOf(d,1);else if(1===h.length){if(d=d.substring(0,d.length-1),(h=s.split(d)).length<=1)return r.push(e),r;u=101}else u===l.length-1&&(A=s.indexOf(d));if(h.length>=2&&u>100){var p=i[c-1].textContent;if(p&&"string"==typeof p){var m=dt(p).length;A=s.indexOf(d,m)}-1===A&&(A=h[0].length)}if(-1!==A){for(var f=Math.floor(A/a);f>0&&f<e.length;){if((o+=1)>50*i.length)return r.push(e),r;var g=dt(e.substring(0,f),n);if(g.length===A){r.push(e.substring(0,f)),e=e.substring(f),s=s.substring(A);break}g.length<A?f+=Math.max(1,Math.floor((A-g.length)/a)):f-=Math.max(1,Math.floor((g.length-A)*a))}break}}}return r.push(e),r}(e,t).join("/* rr_split */")}var At,pt,mt=1,ft=new RegExp("[^a-z0-9-_:]");function gt(){return mt++}var yt=/^[^ \t\n\r\u000c]+/,bt=/^[, \t\n\r\u000c]+/;var wt=new WeakMap;function vt(e,t){return t&&""!==t.trim()?xt(e,t):t}function kt(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function xt(e,t){var n=wt.get(e);if(n||(n=e.createElement("a"),wt.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function Ct(e,t,n,i){return i?"src"===n||"href"===n&&("use"!==t||"#"!==i[0])||"xlink:href"===n&&"#"!==i[0]?vt(e,i):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function i(e){var i,r=e.exec(t.substring(n));return r?(i=r[0],n+=i.length,i):""}for(var r=[];i(bt),!(n>=t.length);){var o=i(yt);if(","===o.slice(-1))o=vt(e,o.substring(0,o.length-1)),r.push(o);else{var s="";o=vt(e,o);for(var a=!1;;){var c=t.charAt(n);if(""===c){r.push((o+s).trim());break}if(a)")"===c&&(a=!1);else{if(","===c){n+=1,r.push((o+s).trim());break}"("===c&&(a=!0)}s+=c,n+=1}}}return r.join(", ")}(e,i):"style"===n?ut(i,xt(e)):"object"===t&&"data"===n?vt(e,i):i:vt(e,i):i}function St(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function Bt(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&Bt(Xe.parentNode(e),t,n);for(var i=e.classList.length;i--;){var r=e.classList[i];if(t.test(r))return!0}return!!n&&Bt(Xe.parentNode(e),t,n)}function It(e,t,n,i){var r;if(Ge(e)){if(r=e,!Xe.childNodes(r).length)return!1}else{if(null===Xe.parentElement(e))return!1;r=Xe.parentElement(e)}try{if("string"==typeof t){if(i){if(r.closest("."+t))return!0}else if(r.classList.contains(t))return!0}else if(Bt(r,t,i))return!0;if(n)if(i){if(r.closest(n))return!0}else if(r.matches(n))return!0}catch(o){}return!1}function Et(e,t){var n=t.doc,i=t.mirror,r=t.blockClass,o=t.blockSelector,s=t.needsMask,a=t.inlineStylesheet,c=t.maskInputOptions,l=void 0===c?{}:c,u=t.maskTextFn,d=t.maskInputFn,h=t.dataURLOptions,A=void 0===h?{}:h,p=t.inlineImages,m=t.recordCanvas,f=t.keepIframeSrcFn,g=t.newlyAddedElement,y=void 0!==g&&g,b=t.cssCaptured,w=void 0!==b&&b,v=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,i);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Re.Document,childNodes:[],compatMode:e.compatMode}:{type:Re.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Re.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){for(var n,i=t.doc,r=t.blockClass,o=t.blockSelector,s=t.inlineStylesheet,a=t.maskInputOptions,c=void 0===a?{}:a,l=t.maskInputFn,u=t.dataURLOptions,d=void 0===u?{}:u,h=t.inlineImages,A=t.recordCanvas,p=t.keepIframeSrcFn,m=t.newlyAddedElement,f=void 0!==m&&m,g=t.rootId,y=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;){var r=e.classList[i];if(t.test(r))return!0}if(n)return e.matches(n)}catch(o){}return!1}(e,r,o),b=function(e){if(Se(e,HTMLFormElement))return"form";var t=nt(e.tagName);return ft.test(t)?"div":t}(e),w={},v=e.attributes.length,k=0;k<v;k++){var x=e.attributes[k];St(b,x.name,x.value)||(w[x.name]=Ct(i,b,nt(x.name),x.value))}if("link"===b&&s){var C=Array.from(i.styleSheets).find(function(t){return t.href===e.href}),S=null;C&&(S=_e(C)),S&&(delete w.rel,delete w.href,w._cssText=S)}if("style"===b&&e.sheet){var B=_e(e.sheet);B&&(e.childNodes.length>1&&(B=ht(B,e)),w._cssText=B)}if("input"===b||"textarea"===b||"select"===b){var I=e.value,E=e.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&I?w.value=tt({element:e,type:rt(e),tagName:b,value:I,maskInputOptions:c,maskInputFn:l}):E&&(w.checked=E)}"option"===b&&(e.selected&&!c.select?w.selected=!0:delete w.selected);"dialog"===b&&e.open&&(w.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===b&&A)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var i=0;i<e.height;i+=50){var r=t.getImageData,o=it in r?r[it]:r;if(new Uint32Array(o.call(t,n,i,Math.min(50,e.width-n),Math.min(50,e.height-i)).data.buffer).some(function(e){return 0!==e}))return!1}return!0})(e)||(w.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var M=e.toDataURL(d.type,d.quality),D=i.createElement("canvas");D.width=e.width,D.height=e.height,M!==D.toDataURL(d.type,d.quality)&&(w.rr_dataURL=M)}if("img"===b&&h){At||(At=i.createElement("canvas"),pt=At.getContext("2d"));var Q=e,U=Q.currentSrc||Q.getAttribute("src")||"<unknown-src>",F=Q.crossOrigin,N=function(){Q.removeEventListener("load",N);try{At.width=Q.naturalWidth,At.height=Q.naturalHeight,pt.drawImage(Q,0,0),w.rr_dataURL=At.toDataURL(d.type,d.quality)}catch(e){if("anonymous"!==Q.crossOrigin)return Q.crossOrigin="anonymous",void(Q.complete&&0!==Q.naturalWidth?N():Q.addEventListener("load",N));console.warn("Cannot inline img src="+U+"! Error: "+e)}"anonymous"===Q.crossOrigin&&(F?w.crossOrigin=F:Q.removeAttribute("crossorigin"))};Q.complete&&0!==Q.naturalWidth?N():Q.addEventListener("load",N)}if("audio"===b||"video"===b){var T=w;T.rr_mediaState=e.paused?"paused":"played",T.rr_mediaCurrentTime=e.currentTime,T.rr_mediaPlaybackRate=e.playbackRate,T.rr_mediaMuted=e.muted,T.rr_mediaLoop=e.loop,T.rr_mediaVolume=e.volume}f||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop));if(y){var L=e.getBoundingClientRect(),P=L.width,O=L.height;w={class:w.class,rr_width:P+"px",rr_height:O+"px"}}"iframe"!==b||p(w.src)||(e.contentDocument||(w.rr_src=w.src),delete w.src);try{customElements.get(b)&&(n=!0)}catch(R){}return{type:Re.Element,tagName:b,attributes:w,childNodes:[],isSVG:kt(e)||void 0,needBlock:y,rootId:g,isCustom:n}}(e,{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:d,dataURLOptions:A,inlineImages:p,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:y,rootId:v});case e.TEXT_NODE:return function(e,t){var n=t.needsMask,i=t.maskTextFn,r=t.rootId,o=t.cssCaptured,s=Xe.parentNode(e),a=s&&s.tagName,c="",l="STYLE"===a||void 0,u="SCRIPT"===a||void 0;u?c="SCRIPT_PLACEHOLDER":o||(c=Xe.textContent(e),l&&c&&(c=ut(c,xt(t.doc))));!l&&!u&&c&&n&&(c=i?i(c,Xe.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:Re.Text,textContent:c||"",rootId:r}}(e,{doc:n,needsMask:s,maskTextFn:u,rootId:v,cssCaptured:w});case e.CDATA_SECTION_NODE:return{type:Re.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:Re.Comment,textContent:Xe.textContent(e)||"",rootId:v};default:return!1}}function Mt(e){return null==e?"":e.toLowerCase()}function Dt(e,t){var n=t.doc,i=t.mirror,r=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,c=t.skipChild,l=void 0!==c&&c,u=t.inlineStylesheet,d=void 0===u||u,h=t.maskInputOptions,A=void 0===h?{}:h,p=t.maskTextFn,m=t.maskInputFn,f=t.slimDOMOptions,g=t.dataURLOptions,y=void 0===g?{}:g,b=t.inlineImages,w=void 0!==b&&b,v=t.recordCanvas,k=void 0!==v&&v,x=t.onSerialize,C=t.onIframeLoad,S=t.iframeLoadTimeout,B=void 0===S?5e3:S,I=t.onStylesheetLoad,E=t.stylesheetLoadTimeout,M=void 0===E?5e3:E,D=t.keepIframeSrcFn,Q=void 0===D?function(){return!1}:D,U=t.newlyAddedElement,F=void 0!==U&&U,N=t.cssCaptured,T=void 0!==N&&N,L=t.needsMask,P=t.preserveWhiteSpace,O=void 0===P||P;L||(L=It(e,s,a,void 0===L));var R,z=Et(e,{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:L,inlineStylesheet:d,maskInputOptions:A,maskTextFn:p,maskInputFn:m,dataURLOptions:y,inlineImages:w,recordCanvas:k,keepIframeSrcFn:Q,newlyAddedElement:F,cssCaptured:T});if(!z)return console.warn(e,"not serialized"),null;R=i.hasNode(e)?i.getId(e):function(e,t){if(t.comment&&e.type===Re.Comment)return!0;if(e.type===Re.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===ot(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Mt(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Mt(e.attributes.name)||"icon"===Mt(e.attributes.rel)||"apple-touch-icon"===Mt(e.attributes.rel)||"shortcut icon"===Mt(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Mt(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Mt(e.attributes.property).match(/^(og|twitter|fb):/)||Mt(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Mt(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Mt(e.attributes.name)||"googlebot"===Mt(e.attributes.name)||"bingbot"===Mt(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Mt(e.attributes.name)||"generator"===Mt(e.attributes.name)||"framework"===Mt(e.attributes.name)||"publisher"===Mt(e.attributes.name)||"progid"===Mt(e.attributes.name)||Mt(e.attributes.property).match(/^article:/)||Mt(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Mt(e.attributes.name)||"yandex-verification"===Mt(e.attributes.name)||"csrf-token"===Mt(e.attributes.name)||"p:domain_verify"===Mt(e.attributes.name)||"verify-v1"===Mt(e.attributes.name)||"verification"===Mt(e.attributes.name)||"shopify-checkout-api-token"===Mt(e.attributes.name)))return!0}}return!1}(z,f)||!O&&z.type===Re.Text&&!z.textContent.replace(/^\s+|\s+$/gm,"").length?-2:gt();var q=Object.assign(z,{id:R});if(i.add(e,q),-2===R)return null;x&&x(e);var Y=!l;if(q.type===Re.Element){Y=Y&&!q.needBlock,delete q.needBlock;var K=Xe.shadowRoot(e);K&&Je(K)&&(q.isShadowHost=!0)}if((q.type===Re.Document||q.type===Re.Element)&&Y){f.headWhitespace&&q.type===Re.Element&&"head"===q.tagName&&(O=!1);var H={doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:L,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:d,maskInputOptions:A,maskTextFn:p,maskInputFn:m,slimDOMOptions:f,dataURLOptions:y,inlineImages:w,recordCanvas:k,preserveWhiteSpace:O,onSerialize:x,onIframeLoad:C,iframeLoadTimeout:B,onStylesheetLoad:I,stylesheetLoadTimeout:M,keepIframeSrcFn:Q,cssCaptured:!1};if(q.type===Re.Element&&"textarea"===q.tagName&&void 0!==q.attributes.value);else{q.type===Re.Element&&void 0!==q.attributes._cssText&&"string"==typeof q.attributes._cssText&&(H.cssCaptured=!0);for(var V,j=Qe(Array.from(Xe.childNodes(e)));!(V=j()).done;){var Z=Dt(V.value,H);Z&&q.childNodes.push(Z)}}var X=null;if(Ge(e)&&(X=Xe.shadowRoot(e)))for(var G,W=Qe(Array.from(Xe.childNodes(X)));!(G=W()).done;){var J=Dt(G.value,H);J&&(Je(X)&&(J.isShadow=!0),q.childNodes.push(J))}}var _=Xe.parentNode(e);return _&&We(_)&&Je(_)&&(q.isShadow=!0),q.type===Re.Element&&"iframe"===q.tagName&&function(e,t,n){var i=e.contentWindow;if(i){var r,o=!1;try{r=i.document.readyState}catch(gd){return}if("complete"===r){var s="about:blank";if(i.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()})}}}(e,function(){var t=e.contentDocument;if(t&&C){var n=Dt(t,{doc:t,mirror:i,blockClass:r,blockSelector:o,needsMask:L,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:A,maskTextFn:p,maskInputFn:m,slimDOMOptions:f,dataURLOptions:y,inlineImages:w,recordCanvas:k,preserveWhiteSpace:O,onSerialize:x,onIframeLoad:C,iframeLoadTimeout:B,onStylesheetLoad:I,stylesheetLoadTimeout:M,keepIframeSrcFn:Q});n&&C(e,n)}},B),q.type===Re.Element&&"link"===q.tagName&&"string"==typeof q.attributes.rel&&("stylesheet"===q.attributes.rel||"preload"===q.attributes.rel&&"string"==typeof q.attributes.href&&"css"===ot(q.attributes.href))&&function(e,t,n){var i,r=!1;try{i=e.sheet}catch(gd){return}if(!i){var o=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(o),r=!0,t()})}}(e,function(){if(I){var t=Dt(e,{doc:n,mirror:i,blockClass:r,blockSelector:o,needsMask:L,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:A,maskTextFn:p,maskInputFn:m,slimDOMOptions:f,dataURLOptions:y,inlineImages:w,recordCanvas:k,preserveWhiteSpace:O,onSerialize:x,onIframeLoad:C,iframeLoadTimeout:B,onStylesheetLoad:I,stylesheetLoadTimeout:M,keepIframeSrcFn:Q});t&&I(e,t)}},M),q}function Qt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ut(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return Se(this,e)?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})}),n}var Ft={exports:{}},Nt=String,Tt=function(){return{isColorSupported:!1,reset:Nt,bold:Nt,dim:Nt,italic:Nt,underline:Nt,inverse:Nt,hidden:Nt,strikethrough:Nt,black:Nt,red:Nt,green:Nt,yellow:Nt,blue:Nt,magenta:Nt,cyan:Nt,white:Nt,gray:Nt,bgBlack:Nt,bgRed:Nt,bgGreen:Nt,bgYellow:Nt,bgBlue:Nt,bgMagenta:Nt,bgCyan:Nt,bgWhite:Nt}};Ft.exports=Tt(),Ft.exports.createColors=Tt;var Lt=Ft.exports,Pt=Ut(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),Ot=Lt,Rt=Pt,zt=function(e){function t(n,i,r,o,s,a){var c;return(c=e.call(this,n)||this).name="CssSyntaxError",c.reason=n,s&&(c.file=s),o&&(c.source=o),a&&(c.plugin=a),void 0!==i&&void 0!==r&&("number"==typeof i?(c.line=i,c.column=r):(c.line=i.line,c.column=i.column,c.endLine=r.line,c.endColumn=r.column)),c.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(c,t),c}Ce(t,e);var n=t.prototype;return n.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},n.showSourceCode=function(e){var t=this;if(!this.source)return"";var n=this.source;null==e&&(e=Ot.isColorSupported),Rt&&e&&(n=Rt(n));var i,r,o=n.split(/\r?\n/),s=Math.max(this.line-3,0),a=Math.min(this.line+2,o.length),c=String(a).length;if(e){var l=Ot.createColors(!0),u=l.bold,d=l.gray,h=l.red;i=function(e){return u(h(e))},r=function(e){return d(e)}}else i=r=function(e){return e};return o.slice(s,a).map(function(e,n){var o=s+1+n,a=" "+(" "+o).slice(-c)+" | ";if(o===t.line){var l=r(a.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return i(">")+r(a)+e+"\n "+l+i("^")}return" "+r(a)+e}).join("\n")},n.toString=function(){var e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e},t}(Me(Error)),qt=zt;zt.default=zt;var Yt={};Yt.isClean=Symbol("isClean"),Yt.my=Symbol("my");var Kt={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};var Ht=function(){function e(e){this.builder=e}var t=e.prototype;return t.atrule=function(e,t){var n="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:i&&(n+=" "),e.nodes)this.block(e,n+i);else{var r=(e.raws.between||"")+(t?";":"");this.builder(n+i+r,e)}},t.beforeAfter=function(e,t){var n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");for(var i=e.parent,r=0;i&&"root"!==i.type;)r+=1,i=i.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var s=0;s<r;s++)n+=o}return n},t.block=function(e,t){var n,i=this.raw(e,"between","beforeOpen");this.builder(t+i+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")},t.body=function(e){for(var t=e.nodes.length-1;t>0&&"comment"===e.nodes[t].type;)t-=1;for(var n=this.raw(e,"semicolon"),i=0;i<e.nodes.length;i++){var r=e.nodes[i],o=this.raw(r,"before");o&&this.builder(o),this.stringify(r,t!==i||n)}},t.comment=function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)},t.decl=function(e,t){var n=this.raw(e,"between","colon"),i=e.prop+n+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)},t.document=function(e){this.body(e)},t.raw=function(e,t,n){var i;if(n||(n=t),t&&void 0!==(i=e.raws[t]))return i;var r=e.parent;if("before"===n){if(!r||"root"===r.type&&r.first===e)return"";if(r&&"document"===r.type)return""}if(!r)return Kt[n];var o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);var s,a="raw"+((s=n)[0].toUpperCase()+s.slice(1));return this[a]?i=this[a](o,e):o.walk(function(e){if(void 0!==(i=e.raws[t]))return!1}),void 0===i&&(i=Kt[n]),o.rawCache[n]=i,i},t.rawBeforeClose=function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t},t.rawBeforeComment=function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n},t.rawBeforeDecl=function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n},t.rawBeforeOpen=function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t},t.rawBeforeRule=function(e){var t;return e.walk(function(n){if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return(t=n.raws.before).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t},t.rawColon=function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t},t.rawEmptyBody=function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t},t.rawIndent=function(e){return e.raws.indent?e.raws.indent:(e.walk(function(n){var i=n.parent;if(i&&i!==e&&i.parent&&i.parent===e&&void 0!==n.raws.before){var r=n.raws.before.split("\n");return t=(t=r[r.length-1]).replace(/\S/g,""),!1}}),t);var t},t.rawSemicolon=function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t},t.rawValue=function(e,t){var n=e[t],i=e.raws[t];return i&&i.value===n?i.raw:n},t.root=function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)},t.rule=function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")},t.stringify=function(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)},e}(),Vt=Ht;Ht.default=Ht;var jt=Vt;function Zt(e,t){new jt(t).stringify(e)}var Xt=Zt;Zt.default=Zt;var Gt=Yt.isClean,Wt=Yt.my,Jt=qt,_t=Vt,$t=Xt;function en(e,t){var n=new e.constructor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&"proxyCache"!==i){var r=e[i],o=void 0===r?"undefined":Ee(r);"parent"===i&&"object"===o?t&&(n[i]=t):"source"===i?n[i]=r:Array.isArray(r)?n[i]=r.map(function(e){return en(e,n)}):("object"===o&&null!==r&&(r=en(r)),n[i]=r)}return n}var tn=function(){function e(e){for(var t in void 0===e&&(e={}),this.raws={},this[Gt]=!1,this[Wt]=!0,e)if("nodes"===t){this.nodes=[];for(var n,i=Qe(e[t]);!(n=i()).done;){var r=n.value;"function"==typeof r.clone?this.append(r.clone()):this.append(r)}}else this[t]=e[t]}var t=e.prototype;return t.addToError=function(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){var t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,"$&"+t.input.from+":"+t.start.line+":"+t.start.column+"$&")}return e},t.after=function(e){return this.parent.insertAfter(this,e),this},t.assign=function(e){for(var t in void 0===e&&(e={}),e)this[t]=e[t];return this},t.before=function(e){return this.parent.insertBefore(this,e),this},t.cleanRaws=function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between},t.clone=function(e){void 0===e&&(e={});var t=en(this);for(var n in e)t[n]=e[n];return t},t.cloneAfter=function(e){void 0===e&&(e={});var t=this.clone(e);return this.parent.insertAfter(this,t),t},t.cloneBefore=function(e){void 0===e&&(e={});var t=this.clone(e);return this.parent.insertBefore(this,t),t},t.error=function(e,t){if(void 0===t&&(t={}),this.source){var n=this.rangeBy(t),i=n.end,r=n.start;return this.source.input.error(e,{column:r.column,line:r.line},{column:i.column,line:i.line},t)}return new Jt(e)},t.getProxyProcessor=function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}},t.markDirty=function(){if(this[Gt]){this[Gt]=!1;for(var e=this;e=e.parent;)e[Gt]=!1}},t.next=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e+1]}},t.positionBy=function(e,t){var n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){var i=(t=this.toString()).indexOf(e.word);-1!==i&&(n=this.positionInside(i,t))}return n},t.positionInside=function(e,t){for(var n=t||this.toString(),i=this.source.start.column,r=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?(i=1,r+=1):i+=1;return{column:i,line:r}},t.prev=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e-1]}},t.rangeBy=function(e){var t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){var i=this.toString(),r=i.indexOf(e.word);-1!==r&&(t=this.positionInside(r,i),n=this.positionInside(r+e.word.length,i))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}},t.raw=function(e,t){return(new _t).raw(this,e,t)},t.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},t.replaceWith=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(this.parent){for(var i,r=this,o=!1,s=Qe(t);!(i=s()).done;){var a=i.value;a===this?o=!0:o?(this.parent.insertAfter(r,a),r=a):this.parent.insertBefore(r,a)}o||this.remove()}return this},t.root=function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e},t.toJSON=function(e,t){var n={},i=null==t;t=t||new Map;var r=0;for(var o in this)if(Object.prototype.hasOwnProperty.call(this,o)&&"parent"!==o&&"proxyCache"!==o){var s=this[o];if(Array.isArray(s))n[o]=s.map(function(e){return"object"===(void 0===e?"undefined":Ee(e))&&e.toJSON?e.toJSON(null,t):e});else if("object"===(void 0===s?"undefined":Ee(s))&&s.toJSON)n[o]=s.toJSON(null,t);else if("source"===o){var a=t.get(s.input);null==a&&(a=r,t.set(s.input,r),r++),n[o]={end:s.end,inputId:a,start:s.start}}else n[o]=s}return i&&(n.inputs=[].concat(t.keys()).map(function(e){return e.toJSON()})),n},t.toProxy=function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache},t.toString=function(e){void 0===e&&(e=$t),e.stringify&&(e=e.stringify);var t="";return e(this,function(e){t+=e}),t},t.warn=function(e,t,n){var i={node:this};for(var r in n)i[r]=n[r];return e.warn(t,i)},ve(e,[{key:"proxyOf",get:function(){return this}}]),e}(),nn=tn;tn.default=tn;var rn=function(e){function t(t){var n;return t&&void 0!==t.value&&"string"!=typeof t.value&&(t=ke({},t,{value:String(t.value)})),(n=e.call(this,t)||this).type="decl",n}return Ce(t,e),ve(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),t}(nn),on=rn;rn.default=rn;var sn=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},an=Pt.SourceMapConsumer,cn=Pt.SourceMapGenerator,ln=Pt.existsSync,un=Pt.readFileSync,dn=Pt.dirname,hn=Pt.join;var An=function(){function e(e,t){if(!1!==t.map){this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");var n=t.map?t.map.prev:void 0,i=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=dn(this.mapFile)),i&&(this.text=i)}}var t=e.prototype;return t.consumer=function(){return this.consumerCache||(this.consumerCache=new an(this.text)),this.consumerCache},t.decodeInline=function(e){var t;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),B?B.from(t,"base64").toString():window.atob(t);var n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)},t.getAnnotationURL=function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()},t.isMap=function(e){return"object"===(void 0===e?"undefined":Ee(e))&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))},t.loadAnnotation=function(e){var t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(t){var n=e.lastIndexOf(t.pop()),i=e.indexOf("*/",n);n>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,i)))}},t.loadFile=function(e){if(this.root=dn(e),ln(e))return this.mapFile=e,un(e,"utf-8").toString().trim()},t.loadMap=function(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(Se(t,an))return cn.fromSourceMap(t).toString();if(Se(t,cn))return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){var i=this.loadFile(n);if(!i)throw new Error("Unable to load previous source map: "+n.toString());return i}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){var r=this.annotation;return e&&(r=hn(dn(e),r)),this.loadFile(r)}}},t.startWith=function(e,t){return!!e&&e.substr(0,t.length)===t},t.withContent=function(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},e}(),pn=An;An.default=An;var mn=Pt.SourceMapConsumer,fn=Pt.SourceMapGenerator,gn=Pt.fileURLToPath,yn=Pt.pathToFileURL,bn=Pt.isAbsolute,wn=Pt.resolve,vn=sn,kn=Pt,xn=qt,Cn=pn,Sn=Symbol("fromOffsetCache"),Bn=Boolean(mn&&fn),In=Boolean(wn&&bn),En=function(){function e(e,t){if(void 0===t&&(t={}),null==e||"object"===(void 0===e?"undefined":Ee(e))&&!e.toString)throw new Error("PostCSS received "+e+" instead of CSS string");if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!In||/^\w+:\/\//.test(t.from)||bn(t.from)?this.file=t.from:this.file=wn(t.from)),In&&Bn){var n=new Cn(this.css,t);if(n.text){this.map=n;var i=n.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+vn(6)+">"),this.map&&(this.map.file=this.from)}var t=e.prototype;return t.error=function(e,t,n,i){var r,o,s;if(void 0===i&&(i={}),t&&"object"===(void 0===t?"undefined":Ee(t))){var a=t,c=n;if("number"==typeof a.offset){var l=this.fromOffset(a.offset);t=l.line,n=l.col}else t=a.line,n=a.column;if("number"==typeof c.offset){var u=this.fromOffset(c.offset);o=u.line,s=u.col}else o=c.line,s=c.column}else if(!n){var d=this.fromOffset(t);t=d.line,n=d.col}var h=this.origin(t,n,o,s);return(r=h?new xn(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,i.plugin):new xn(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:s,line:o},this.css,this.file,i.plugin)).input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(yn&&(r.input.url=yn(this.file).toString()),r.input.file=this.file),r},t.fromOffset=function(e){var t;if(this[Sn])t=this[Sn];else{var n=this.css.split("\n");t=new Array(n.length);for(var i=0,r=0,o=n.length;r<o;r++)t[r]=i,i+=n[r].length+1;this[Sn]=t}var s=0;if(e>=t[t.length-1])s=t.length-1;else for(var a,c=t.length-2;s<c;)if(e<t[a=s+(c-s>>1)])c=a-1;else{if(!(e>=t[a+1])){s=a;break}s=a+1}return{col:e-t[s]+1,line:s+1}},t.mapResolve=function(e){return/^\w+:\/\//.test(e)?e:wn(this.map.consumer().sourceRoot||this.map.root||".",e)},t.origin=function(e,t,n,i){if(!this.map)return!1;var r,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(r=s.originalPositionFor({column:i,line:n})),o=bn(a.source)?yn(a.source):new URL(a.source,this.map.consumer().sourceRoot||yn(this.map.mapFile));var c={column:a.column,endColumn:r&&r.column,endLine:r&&r.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!gn)throw new Error("file: protocol is not available in this PostCSS build");c.file=gn(o)}var l=s.sourceContentFor(a.source);return l&&(c.source=l),c},t.toJSON=function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var i=n[t];null!=this[i]&&(e[i]=this[i])}return this.map&&(e.map=ke({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e},ve(e,[{key:"from",get:function(){return this.file||this.id}}]),e}(),Mn=En;En.default=En,kn&&kn.registerInput&&kn.registerInput(En);var Dn=Pt.SourceMapConsumer,Qn=Pt.SourceMapGenerator,Un=Pt.dirname,Fn=Pt.relative,Nn=Pt.resolve,Tn=Pt.sep,Ln=Pt.pathToFileURL,Pn=Mn,On=Boolean(Dn&&Qn),Rn=Boolean(Un&&Nn&&Fn&&Tn),zn=function(){function e(e,t,n,i){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}var t=e.prototype;return t.addAnnotation=function(){var e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";var t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"},t.applyPrevMaps=function(){for(var e,t=Qe(this.previous());!(e=t()).done;){var n=e.value,i=this.toUrl(this.path(n.file)),r=n.root||Un(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new Dn(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,i,this.toUrl(this.path(r)))}},t.clearAnnotation=function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;t>=0;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))},t.generate=function(){if(this.clearAnnotation(),Rn&&On&&this.isMap())return this.generateMap();var e="";return this.stringify(this.root,function(t){e+=t}),[e]},t.generateMap=function(){if(this.root)this.generateString();else if(1===this.previous().length){var e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Qn.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Qn({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},t.generateString=function(){var e=this;this.css="",this.map=new Qn({file:this.outputFile(),ignoreInvalidMapping:!0});var t,n,i=1,r=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(a,c,l){if(e.css+=a,c&&"end"!==l&&(s.generated.line=i,s.generated.column=r-1,c.source&&c.source.start?(s.source=e.sourcePath(c),s.original.line=c.source.start.line,s.original.column=c.source.start.column-1,e.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,e.map.addMapping(s))),(t=a.match(/\n/g))?(i+=t.length,n=a.lastIndexOf("\n"),r=a.length-n):r+=a.length,c&&"start"!==l){var u=c.parent||{raws:{}};("decl"===c.type||"atrule"===c.type&&!c.nodes)&&c===u.last&&!u.raws.semicolon||(c.source&&c.source.end?(s.source=e.sourcePath(c),s.original.line=c.source.end.line,s.original.column=c.source.end.column-1,s.generated.line=i,s.generated.column=r-2,e.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=i,s.generated.column=r-1,e.map.addMapping(s)))}})},t.isAnnotation=function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))},t.isInline=function(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))},t.isMap=function(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0},t.isSourcesContent=function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})},t.outputFile=function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"},t.path=function(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;var n=this.opts.to?Un(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=Un(Nn(n,this.mapOpts.annotation)));var i=Fn(n,e);return this.memoizedPaths.set(e,i),i},t.previous=function(){var e=this;if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(function(t){if(t.source&&t.source.input.map){var n=t.source.input.map;e.previousMaps.includes(n)||e.previousMaps.push(n)}});else{var t=new Pn(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps},t.setSourcesContent=function(){var e=this,t={};if(this.root)this.root.walk(function(n){if(n.source){var i=n.source.input.from;if(i&&!t[i]){t[i]=!0;var r=e.usesFileUrls?e.toFileUrl(i):e.toUrl(e.path(i));e.map.setSourceContent(r,n.source.input.css)}}});else if(this.css){var n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}},t.sourcePath=function(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))},t.toBase64=function(e){return B?B.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))},t.toFileUrl=function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(Ln){var n=Ln(e).toString();return this.memoizedFileURLs.set(e,n),n}throw new Error("`map.absolute` option is not available in this PostCSS build")},t.toUrl=function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===Tn&&(e=e.replace(/\\/g,"/"));var n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n},e}(),qn=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="comment",n}return Ce(t,e),t}(nn),Yn=qn;qn.default=qn;var Kn,Hn,Vn,jn,Zn=Yt.isClean,Xn=Yt.my,Gn=on,Wn=Yn;function Jn(e){return e.map(function(e){return e.nodes&&(e.nodes=Jn(e.nodes)),delete e.source,e})}function _n(e){if(e[Zn]=!1,e.proxyOf.nodes)for(var t,n=Qe(e.proxyOf.nodes);!(t=n()).done;){_n(t.value)}}var $n=function(e){function t(){return e.apply(this,arguments)||this}Ce(t,e);var n=t.prototype;return n.append=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var i,r=Qe(t);!(i=r()).done;)for(var o,s=i.value,a=Qe(this.normalize(s,this.last));!(o=a()).done;){var c=o.value;this.proxyOf.nodes.push(c)}return this.markDirty(),this},n.cleanRaws=function(t){if(e.prototype.cleanRaws.call(this,t),this.nodes)for(var n,i=Qe(this.nodes);!(n=i()).done;){n.value.cleanRaws(t)}},n.each=function(e){if(this.proxyOf.nodes){for(var t,n,i=this.getIterator();this.indexes[i]<this.proxyOf.nodes.length&&(t=this.indexes[i],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[i]+=1;return delete this.indexes[i],n}},n.every=function(e){return this.nodes.every(e)},n.getIterator=function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e},n.getProxyProcessor=function(){return{get:function(e,t){return"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];var o;return(o=e)[t].apply(o,[].concat(i.map(function(e){return"function"==typeof e?function(t,n){return e(t.toProxy(),n)}:e})))}:"every"===t||"some"===t?function(n){return e[t](function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return n.apply(void 0,[].concat([e.toProxy()],i))})}:"root"===t?function(){return e.root().toProxy()}:"nodes"===t?e.nodes.map(function(e){return e.toProxy()}):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]},set:function(e,t,n){return e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}},n.index=function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))},n.insertAfter=function(e,t){var n,i=this.index(e),r=this.normalize(t,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(var o,s=Qe(r);!(o=s()).done;){var a=o.value;this.proxyOf.nodes.splice(i+1,0,a)}for(var c in this.indexes)i<(n=this.indexes[c])&&(this.indexes[c]=n+r.length);return this.markDirty(),this},n.insertBefore=function(e,t){var n,i=this.index(e),r=0===i&&"prepend",o=this.normalize(t,this.proxyOf.nodes[i],r).reverse();i=this.index(e);for(var s,a=Qe(o);!(s=a()).done;){var c=s.value;this.proxyOf.nodes.splice(i,0,c)}for(var l in this.indexes)i<=(n=this.indexes[l])&&(this.indexes[l]=n+o.length);return this.markDirty(),this},n.normalize=function(e,n){var i=this;if("string"==typeof e)e=Jn(Kn(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r,o=Qe(e=e.slice(0));!(r=o()).done;){var s=r.value;s.parent&&s.parent.removeChild(s,"ignore")}else if("root"===e.type&&"document"!==this.type)for(var a,c=Qe(e=e.nodes.slice(0));!(a=c()).done;){var l=a.value;l.parent&&l.parent.removeChild(l,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new Gn(e)]}else if(e.selector)e=[new Hn(e)];else if(e.name)e=[new Vn(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new Wn(e)]}return e.map(function(e){return e[Xn]||t.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[Zn]&&_n(e),void 0===e.raws.before&&n&&void 0!==n.raws.before&&(e.raws.before=n.raws.before.replace(/\S/g,"")),e.parent=i.proxyOf,e})},n.prepend=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var i,r=Qe(t=t.reverse());!(i=r()).done;){for(var o,s=i.value,a=this.normalize(s,this.first,"prepend").reverse(),c=Qe(a);!(o=c()).done;){var l=o.value;this.proxyOf.nodes.unshift(l)}for(var u in this.indexes)this.indexes[u]=this.indexes[u]+a.length}return this.markDirty(),this},n.push=function(e){return e.parent=this,this.proxyOf.nodes.push(e),this},n.removeAll=function(){for(var e,t=Qe(this.proxyOf.nodes);!(e=t()).done;){e.value.parent=void 0}return this.proxyOf.nodes=[],this.markDirty(),this},n.removeChild=function(e){var t;for(var n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this},n.replaceValues=function(e,t,n){return n||(n=t,t={}),this.walkDecls(function(i){t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,n))}),this.markDirty(),this},n.some=function(e){return this.nodes.some(e)},n.walk=function(e){return this.each(function(t,n){var i;try{i=e(t,n)}catch(r){throw t.addToError(r)}return!1!==i&&t.walk&&(i=t.walk(e)),i})},n.walkAtRules=function(e,t){return t?Se(e,RegExp)?this.walk(function(n,i){if("atrule"===n.type&&e.test(n.name))return t(n,i)}):this.walk(function(n,i){if("atrule"===n.type&&n.name===e)return t(n,i)}):(t=e,this.walk(function(e,n){if("atrule"===e.type)return t(e,n)}))},n.walkComments=function(e){return this.walk(function(t,n){if("comment"===t.type)return e(t,n)})},n.walkDecls=function(e,t){return t?Se(e,RegExp)?this.walk(function(n,i){if("decl"===n.type&&e.test(n.prop))return t(n,i)}):this.walk(function(n,i){if("decl"===n.type&&n.prop===e)return t(n,i)}):(t=e,this.walk(function(e,n){if("decl"===e.type)return t(e,n)}))},n.walkRules=function(e,t){return t?Se(e,RegExp)?this.walk(function(n,i){if("rule"===n.type&&e.test(n.selector))return t(n,i)}):this.walk(function(n,i){if("rule"===n.type&&n.selector===e)return t(n,i)}):(t=e,this.walk(function(e,n){if("rule"===e.type)return t(e,n)}))},ve(t,[{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}]),t}(nn);$n.registerParse=function(e){Kn=e},$n.registerRule=function(e){Hn=e},$n.registerAtRule=function(e){Vn=e},$n.registerRoot=function(e){jn=e};var ei=$n;$n.default=$n,$n.rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,Vn.prototype):"rule"===e.type?Object.setPrototypeOf(e,Hn.prototype):"decl"===e.type?Object.setPrototypeOf(e,Gn.prototype):"comment"===e.type?Object.setPrototypeOf(e,Wn.prototype):"root"===e.type&&Object.setPrototypeOf(e,jn.prototype),e[Xn]=!0,e.nodes&&e.nodes.forEach(function(e){$n.rebuild(e)})};var ti,ni,ii=function(e){function t(t){var n;return(n=e.call(this,ke({type:"document"},t))||this).nodes||(n.nodes=[]),n}return Ce(t,e),t.prototype.toResult=function(e){return void 0===e&&(e={}),new ti(new ni,this,e).stringify()},t}(ei);ii.registerLazyResult=function(e){ti=e},ii.registerProcessor=function(e){ni=e};var ri=ii;ii.default=ii;var oi=function(){function e(e,t){if(void 0===t&&(t={}),this.type="warning",this.text=e,t.node&&t.node.source){var n=t.node.rangeBy(t);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(var i in t)this[i]=t[i]}return e.prototype.toString=function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text},e}(),si=oi;oi.default=oi;var ai=si,ci=function(){function e(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}var t=e.prototype;return t.toString=function(){return this.css},t.warn=function(e,t){void 0===t&&(t={}),t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);var n=new ai(e,t);return this.messages.push(n),n},t.warnings=function(){return this.messages.filter(function(e){return"warning"===e.type})},ve(e,[{key:"content",get:function(){return this.css}}]),e}(),li=ci;ci.default=ci;var ui="'".charCodeAt(0),di='"'.charCodeAt(0),hi="\\".charCodeAt(0),Ai="/".charCodeAt(0),pi="\n".charCodeAt(0),mi=" ".charCodeAt(0),fi="\f".charCodeAt(0),gi="\t".charCodeAt(0),yi="\r".charCodeAt(0),bi="[".charCodeAt(0),wi="]".charCodeAt(0),vi="(".charCodeAt(0),ki=")".charCodeAt(0),xi="{".charCodeAt(0),Ci="}".charCodeAt(0),Si=";".charCodeAt(0),Bi="*".charCodeAt(0),Ii=":".charCodeAt(0),Ei="@".charCodeAt(0),Mi=/[\t\n\f\r "#'()/;[\\\]{}]/g,Di=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Qi=/.[\r\n"'(/\\]/,Ui=/[\da-f]/i,Fi=ei,Ni=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="atrule",n}Ce(t,e);var n=t.prototype;return n.append=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r;return this.proxyOf.nodes||(this.nodes=[]),(r=e.prototype.append).call.apply(r,[].concat([this],n))},n.prepend=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r;return this.proxyOf.nodes||(this.nodes=[]),(r=e.prototype.prepend).call.apply(r,[].concat([this],n))},t}(Fi),Ti=Ni;Ni.default=Ni,Fi.registerAtRule(Ni);var Li,Pi,Oi=ei,Ri=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="root",n.nodes||(n.nodes=[]),n}Ce(t,e);var n=t.prototype;return n.normalize=function(t,n,i){var r=e.prototype.normalize.call(this,t);if(n)if("prepend"===i)this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(var o,s=Qe(r);!(o=s()).done;){o.value.raws.before=n.raws.before}return r},n.removeChild=function(t,n){var i=this.index(t);return!n&&0===i&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),e.prototype.removeChild.call(this,t)},n.toResult=function(e){return void 0===e&&(e={}),new Li(new Pi,this,e).stringify()},t}(Oi);Ri.registerLazyResult=function(e){Li=e},Ri.registerProcessor=function(e){Pi=e};var zi=Ri;Ri.default=Ri,Oi.registerRoot(Ri);var qi={comma:function(e){return qi.split(e,[","],!0)},space:function(e){return qi.split(e,[" ","\n","\t"])},split:function(e,t,n){for(var i,r=[],o="",s=!1,a=0,c=!1,l="",u=!1,d=Qe(e);!(i=d()).done;){var h=i.value;u?u=!1:"\\"===h?u=!0:c?h===l&&(c=!1):'"'===h||"'"===h?(c=!0,l=h):"("===h?a+=1:")"===h?a>0&&(a-=1):0===a&&t.includes(h)&&(s=!0),s?(""!==o&&r.push(o.trim()),o="",s=!1):o+=h}return(n||""!==o)&&r.push(o.trim()),r}},Yi=qi;qi.default=qi;var Ki=ei,Hi=Yi,Vi=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="rule",n.nodes||(n.nodes=[]),n}return Ce(t,e),ve(t,[{key:"selectors",get:function(){return Hi.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}}]),t}(Ki),ji=Vi;Vi.default=Vi,Ki.registerRule(Vi);var Zi=on,Xi=function(e,t){void 0===t&&(t={});var n,i,r,o,s,a,c,l,u,d,h=e.css.valueOf(),A=t.ignoreErrors,p=h.length,m=0,f=[],g=[];function y(t){throw e.error("Unclosed "+t,m)}return{back:function(e){g.push(e)},endOfFile:function(){return 0===g.length&&m>=p},nextToken:function(e){if(g.length)return g.pop();if(!(m>=p)){var t=!!e&&e.ignoreUnclosed;switch(n=h.charCodeAt(m)){case pi:case mi:case gi:case yi:case fi:i=m;do{i+=1,n=h.charCodeAt(i)}while(n===mi||n===pi||n===gi||n===yi||n===fi);d=["space",h.slice(m,i)],m=i-1;break;case bi:case wi:case xi:case Ci:case Ii:case Si:case ki:var b=String.fromCharCode(n);d=[b,b,m];break;case vi:if(l=f.length?f.pop()[1]:"",u=h.charCodeAt(m+1),"url"===l&&u!==ui&&u!==di&&u!==mi&&u!==pi&&u!==gi&&u!==fi&&u!==yi){i=m;do{if(a=!1,-1===(i=h.indexOf(")",i+1))){if(A||t){i=m;break}y("bracket")}for(c=i;h.charCodeAt(c-1)===hi;)c-=1,a=!a}while(a);d=["brackets",h.slice(m,i+1),m,i],m=i}else i=h.indexOf(")",m+1),o=h.slice(m,i+1),-1===i||Qi.test(o)?d=["(","(",m]:(d=["brackets",o,m,i],m=i);break;case ui:case di:r=n===ui?"'":'"',i=m;do{if(a=!1,-1===(i=h.indexOf(r,i+1))){if(A||t){i=m+1;break}y("string")}for(c=i;h.charCodeAt(c-1)===hi;)c-=1,a=!a}while(a);d=["string",h.slice(m,i+1),m,i],m=i;break;case Ei:Mi.lastIndex=m+1,Mi.test(h),i=0===Mi.lastIndex?h.length-1:Mi.lastIndex-2,d=["at-word",h.slice(m,i+1),m,i],m=i;break;case hi:for(i=m,s=!0;h.charCodeAt(i+1)===hi;)i+=1,s=!s;if(n=h.charCodeAt(i+1),s&&n!==Ai&&n!==mi&&n!==pi&&n!==gi&&n!==yi&&n!==fi&&(i+=1,Ui.test(h.charAt(i)))){for(;Ui.test(h.charAt(i+1));)i+=1;h.charCodeAt(i+1)===mi&&(i+=1)}d=["word",h.slice(m,i+1),m,i],m=i;break;default:n===Ai&&h.charCodeAt(m+1)===Bi?(0===(i=h.indexOf("*/",m+2)+1)&&(A||t?i=h.length:y("comment")),d=["comment",h.slice(m,i+1),m,i],m=i):(Di.lastIndex=m+1,Di.test(h),i=0===Di.lastIndex?h.length-1:Di.lastIndex-2,d=["word",h.slice(m,i+1),m,i],f.push(d),m=i)}return m++,d}},position:function(){return m}}},Gi=Yn,Wi=Ti,Ji=zi,_i=ji,$i={empty:!0,space:!0};var er=function(){function e(e){this.input=e,this.root=new Ji,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}var t=e.prototype;return t.atrule=function(e){var t,n,i,r=new Wi;r.name=e[1].slice(1),""===r.name&&this.unnamedAtrule(r,e),this.init(r,e[2]);for(var o=!1,s=!1,a=[],c=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){r.source.end=this.getPosition(e[2]),r.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(n=a[i=a.length-1];n&&"space"===n[0];)n=a[--i];n&&(r.source.end=this.getPosition(n[3]||n[2]),r.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(r.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(r,"params",a),o&&(e=a[a.length-1],r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),s&&(r.nodes=[],this.current=r)},t.checkMissedSemicolon=function(e){var t=this.colon(e);if(!1!==t){for(var n,i=0,r=t-1;r>=0&&("space"===(n=e[r])[0]||2!==(i+=1));r--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}},t.colon=function(e){for(var t,n,i,r,o=0,s=Qe(e.entries());!(r=s()).done;){var a=r.value,c=a[0];if("("===(n=(t=a[1])[0])&&(o+=1),")"===n&&(o-=1),0===o&&":"===n){if(i){if("word"===i[0]&&"progid"===i[1])continue;return c}this.doubleColon(t)}i=t}return!1},t.comment=function(e){var t=new Gi;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;var n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{var i=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}},t.createTokenizer=function(){this.tokenizer=Xi(this.input)},t.decl=function(e,t){var n=new Zi;this.init(n,e[0][2]);var i,r=e[e.length-1];for(";"===r[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(r[3]||r[2]||function(e){for(var t=e.length-1;t>=0;t--){var n=e[t],i=n[3]||n[2];if(i)return i}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(i=e.shift())[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var s,a=[];e.length&&("space"===(s=e[0][0])||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(var c=e.length-1;c>=0;c--){if("!important"===(i=e[c])[1].toLowerCase()){n.important=!0;var l=this.stringFrom(e,c);" !important"!==(l=this.spacesFromEnd(e)+l)&&(n.raws.important=l);break}if("important"===i[1].toLowerCase()){for(var u=e.slice(0),d="",h=c;h>0;h--){var A=u[h][0];if(0===d.trim().indexOf("!")&&"space"!==A)break;d=u.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=u)}if("space"!==i[0]&&"comment"!==i[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=a.map(function(e){return e[1]}).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)},t.doubleColon=function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})},t.emptyRule=function(e){var t=new _i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t},t.end=function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)},t.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())},t.freeSemicolon=function(e){if(this.spaces+=e[1],this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}},t.getPosition=function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}},t.init=function(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)},t.other=function(e){for(var t=!1,n=null,i=!1,r=null,o=[],s=e[1].startsWith("--"),a=[],c=e;c;){if(n=c[0],a.push(c),"("===n||"["===n)r||(r=c),o.push("("===n?")":"]");else if(s&&i&&"{"===n)r||(r=c),o.push("}");else if(0===o.length){if(";"===n){if(i)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(i=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(r=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(r),t&&i){if(!s)for(;a.length&&("space"===(c=a[a.length-1][0])||"comment"===c);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)},t.parse=function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()},t.precheckMissedSemicolon=function(){},t.raw=function(e,t,n,i){for(var r,o,s,a,c=n.length,l="",u=!0,d=0;d<c;d+=1)"space"!==(o=(r=n[d])[0])||d!==c-1||i?"comment"===o?(a=n[d-1]?n[d-1][0]:"empty",s=n[d+1]?n[d+1][0]:"empty",$i[a]||$i[s]||","===l.slice(-1)?u=!1:l+=r[1]):l+=r[1]:u=!1;if(!u){var h=n.reduce(function(e,t){return e+t[1]},"");e.raws[t]={raw:h,value:l}}e[t]=l},t.rule=function(e){e.pop();var t=new _i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t},t.spacesAndCommentsFromEnd=function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n},t.spacesAndCommentsFromStart=function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n},t.spacesFromEnd=function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t},t.stringFrom=function(e,t){for(var n="",i=t;i<e.length;i++)n+=e[i][1];return e.splice(t,e.length-t),n},t.unclosedBlock=function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)},t.unclosedBracket=function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})},t.unexpectedClose=function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})},t.unknownWord=function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})},t.unnamedAtrule=function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})},e}(),tr=ei,nr=er,ir=Mn;function rr(e,t){var n=new ir(e,t),i=new nr(n);try{i.parse()}catch(r){throw r}return i.root}var or=rr;rr.default=rr,tr.registerParse(rr);var sr=Yt.isClean,ar=Yt.my,cr=zn,lr=Xt,ur=ei,dr=ri,hr=li,Ar=or,pr=zi,mr={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},fr={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},gr={Once:!0,postcssPlugin:!0,prepare:!0};function yr(e){return"object"===(void 0===e?"undefined":Ee(e))&&"function"==typeof e.then}function br(e){var t=!1,n=mr[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function wr(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:br(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function vr(e){return e[sr]=!1,e.nodes&&e.nodes.forEach(function(e){return vr(e)}),e}var kr={},xr=function(){function e(t,n,i){var r,o=this;if(this.stringified=!1,this.processed=!1,"object"!==(void 0===n?"undefined":Ee(n))||null===n||"root"!==n.type&&"document"!==n.type)if(Se(n,e)||Se(n,hr))r=vr(n.root),n.map&&(void 0===i.map&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=n.map);else{var s=Ar;i.syntax&&(s=i.syntax.parse),i.parser&&(s=i.parser),s.parse&&(s=s.parse);try{r=s(n,i)}catch(gd){this.processed=!0,this.error=gd}r&&!r[ar]&&ur.rebuild(r)}else r=vr(n);this.result=new hr(t,r,i),this.helpers=ke({},kr,{postcss:kr,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===(void 0===e?"undefined":Ee(e))&&e.prepare?ke({},e,e.prepare(o.result)):e})}var t=e.prototype;return t.async=function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.getAsyncError=function(){throw new Error("Use process(css).then(cb) to work with async plugins")},t.handleError=function(e,t){var n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(n.postcssVersion){0}}else e.plugin=n.postcssPlugin,e.setMessage()}catch(i){console&&console.error&&console.error(i)}return e},t.prepareVisitors=function(){var e=this;this.listeners={};for(var t,n=function(t,n,i){e.listeners[n]||(e.listeners[n]=[]),e.listeners[n].push([t,i])},i=Qe(this.plugins);!(t=i()).done;){var r=t.value;if("object"===(void 0===r?"undefined":Ee(r)))for(var o in r){if(!fr[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event "+o+" in "+r.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!gr[o])if("object"===Ee(r[o]))for(var s in r[o])n(r,"*"===s?o:o+"-"+s.toLowerCase(),r[o][s]);else"function"==typeof r[o]&&n(r,o,r[o])}}this.hasListener=Object.keys(this.listeners).length>0},t.runAsync=function(){var e=this;return be(function(){var t,n,i,r,o,s,a,c,l,u,d,h;return Ue(this,function(A){switch(A.label){case 0:e.plugin=0,t=0,A.label=1;case 1:if(!(t<e.plugins.length))return[3,6];if(n=e.plugins[t],!yr(i=e.runOnRoot(n)))return[3,5];A.label=2;case 2:return A.trys.push([2,4,,5]),[4,i];case 3:return A.sent(),[3,5];case 4:throw r=A.sent(),e.handleError(r);case 5:return t++,[3,1];case 6:if(e.prepareVisitors(),!e.hasListener)return[3,18];o=e.result.root,A.label=7;case 7:if(o[sr])return[3,14];o[sr]=!0,s=[wr(o)],A.label=8;case 8:if(!(s.length>0))return[3,13];if(!yr(a=e.visitTick(s)))return[3,12];A.label=9;case 9:return A.trys.push([9,11,,12]),[4,a];case 10:return A.sent(),[3,12];case 11:throw c=A.sent(),l=s[s.length-1].node,e.handleError(c,l);case 12:return[3,8];case 13:return[3,7];case 14:if(!e.listeners.OnceExit)return[3,18];u=function(){var t,n,i,r,s;return Ue(this,function(a){switch(a.label){case 0:t=h.value,n=t[0],i=t[1],e.result.lastPlugin=n,a.label=1;case 1:return a.trys.push([1,6,,7]),"document"!==o.type?[3,3]:(r=o.nodes.map(function(t){return i(t,e.helpers)}),[4,Promise.all(r)]);case 2:return a.sent(),[3,5];case 3:return[4,i(o,e.helpers)];case 4:a.sent(),a.label=5;case 5:return[3,7];case 6:throw s=a.sent(),e.handleError(s);case 7:return[2]}})},d=Qe(e.listeners.OnceExit),A.label=15;case 15:return(h=d()).done?[3,18]:[5,Fe(u())];case 16:A.sent(),A.label=17;case 17:return[3,15];case 18:return e.processed=!0,[2,e.stringify()]}})})()},t.runOnRoot=function(e){var t=this;this.result.lastPlugin=e;try{if("object"===(void 0===e?"undefined":Ee(e))&&e.Once){if("document"===this.result.root.type){var n=this.result.root.nodes.map(function(n){return e.Once(n,t.helpers)});return yr(n[0])?Promise.all(n):n}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(gd){throw this.handleError(gd)}},t.stringify=function(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts,t=lr;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);var n=new cr(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result},t.sync=function(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e,t=Qe(this.plugins);!(e=t()).done;){var n=e.value;if(yr(this.runOnRoot(n)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var i=this.result.root;!i[sr];)i[sr]=!0,this.walkSync(i);if(this.listeners.OnceExit)if("document"===i.type)for(var r,o=Qe(i.nodes);!(r=o()).done;){var s=r.value;this.visitSync(this.listeners.OnceExit,s)}else this.visitSync(this.listeners.OnceExit,i)}return this.result},t.then=function(e,t){return this.async().then(e,t)},t.toString=function(){return this.css},t.visitSync=function(e,t){for(var n,i=Qe(e);!(n=i()).done;){var r=n.value,o=r[0],s=r[1];this.result.lastPlugin=o;var a=void 0;try{a=s(t,this.helpers)}catch(c){throw this.handleError(c,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(yr(a))throw this.getAsyncError()}},t.visitTick=function(e){var t=e[e.length-1],n=t.node,i=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(i.length>0&&t.visitorIndex<i.length){var r=i[t.visitorIndex],o=r[0],s=r[1];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return s(n.toProxy(),this.helpers)}catch(d){throw this.handleError(d,n)}}if(0!==t.iterator){for(var a,c=t.iterator;a=n.nodes[n.indexes[c]];)if(n.indexes[c]+=1,!a[sr])return a[sr]=!0,void e.push(wr(a));t.iterator=0,delete n.indexes[c]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[sr]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}e.pop()}else e.pop()},t.walkSync=function(e){var t=this;e[sr]=!0;for(var n,i=Qe(br(e));!(n=i()).done;){var r=n.value;if(0===r)e.nodes&&e.each(function(e){e[sr]||t.walkSync(e)});else{var o=this.listeners[r];if(o&&this.visitSync(o,e.toProxy()))return}}},t.warnings=function(){return this.sync().warnings()},ve(e,[{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}]),e}();xr.registerPostcss=function(e){kr=e};var Cr=xr;xr.default=xr,pr.registerLazyResult(xr),dr.registerLazyResult(xr);var Sr=zn,Br=Xt,Ir=or,Er=li,Mr=function(){function e(e,t,n){var i;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;var r=Br;this.result=new Er(this._processor,i,this._opts),this.result.css=t;var o=this;Object.defineProperty(this.result,"root",{get:function(){return o.root}});var s=new Sr(r,i,this._opts,t);if(s.isMap()){var a=s.generate(),c=a[0],l=a[1];c&&(this.result.css=c),l&&(this.result.map=l)}else s.clearAnnotation(),this.result.css=s.css}var t=e.prototype;return t.async=function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.sync=function(){if(this.error)throw this.error;return this.result},t.then=function(e,t){return this.async().then(e,t)},t.toString=function(){return this._css},t.warnings=function(){return[]},ve(e,[{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=Ir;try{e=t(this._css,this._opts)}catch(gd){this.error=gd}if(this.error)throw this.error;return this._root=e,e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),e}(),Dr=Mr;Mr.default=Mr;var Qr=Dr,Ur=Cr,Fr=ri,Nr=zi,Tr=function(){function e(e){void 0===e&&(e=[]),this.version="8.4.38",this.plugins=this.normalize(e)}var t=e.prototype;return t.normalize=function(e){for(var t,n=[],i=Qe(e);!(t=i()).done;){var r=t.value;if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"===(void 0===r?"undefined":Ee(r))&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if("object"===(void 0===r?"undefined":Ee(r))&&r.postcssPlugin)n.push(r);else if("function"==typeof r)n.push(r);else if("object"!==(void 0===r?"undefined":Ee(r))||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin")}return n},t.process=function(e,t){return void 0===t&&(t={}),this.plugins.length||t.parser||t.stringifier||t.syntax?new Ur(this,e,t):new Qr(this,e,t)},t.use=function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this},e}(),Lr=Tr;Tr.default=Tr,Nr.registerProcessor(Tr),Fr.registerProcessor(Tr);var Pr=on,Or=pn,Rr=Yn,zr=Ti,qr=Mn,Yr=zi,Kr=ji;function Hr(e,t){if(Array.isArray(e))return e.map(function(e){return Hr(e)});var n=e.inputs,i=Be(e,["inputs"]);if(n){t=[];for(var r,o=Qe(n);!(r=o()).done;){var s=ke({},r.value,{__proto__:qr.prototype});s.map&&(s.map=ke({},s.map,{__proto__:Or.prototype})),t.push(s)}}if(i.nodes&&(i.nodes=e.nodes.map(function(e){return Hr(e,t)})),i.source){var a=i.source,c=a.inputId,l=Be(a,["inputId"]);i.source=l,null!=c&&(i.source.input=t[c])}if("root"===i.type)return new Yr(i);if("decl"===i.type)return new Pr(i);if("rule"===i.type)return new Kr(i);if("comment"===i.type)return new Rr(i);if("atrule"===i.type)return new zr(i);throw new Error("Unknown node type: "+e.type)}var Vr=Hr;Hr.default=Hr;var jr=qt,Zr=on,Xr=Cr,Gr=ei,Wr=Lr,Jr=Xt,_r=Vr,$r=ri,eo=si,to=Yn,no=Ti,io=li,ro=Mn,oo=or,so=Yi,ao=ji,co=zi,lo=nn;function uo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new Wr(t)}uo.plugin=function(e,t){var n,i=!1;function r(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];console&&console.warn&&!i&&(i=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),pe.env.LANG&&pe.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));var s=t.apply(void 0,[].concat(r));return s.postcssPlugin=e,s.postcssVersion=(new Wr).version,s}return Object.defineProperty(r,"postcss",{get:function(){return n||(n=r()),n}}),r.process=function(e,t,n){return uo([r(n)]).process(e,t)},r},uo.stringify=Jr,uo.parse=oo,uo.fromJSON=_r,uo.list=so,uo.comment=function(e){return new to(e)},uo.atRule=function(e){return new no(e)},uo.decl=function(e){return new Zr(e)},uo.rule=function(e){return new ao(e)},uo.root=function(e){return new co(e)},uo.document=function(e){return new $r(e)},uo.CssSyntaxError=jr,uo.Declaration=Zr,uo.Container=Gr,uo.Processor=Wr,uo.Document=$r,uo.Comment=to,uo.Warning=eo,uo.AtRule=no,uo.Result=io,uo.Input=ro,uo.Rule=ao,uo.Root=co,uo.Node=lo,Xr.registerPostcss(uo);var ho=uo;uo.default=uo;var Ao=Qt(ho);Ao.stringify,Ao.fromJSON,Ao.plugin,Ao.parse,Ao.list,Ao.document,Ao.comment,Ao.atRule,Ao.rule,Ao.decl,Ao.root,Ao.CssSyntaxError,Ao.Declaration,Ao.Container,Ao.Processor,Ao.Document,Ao.Comment,Ao.Warning,Ao.AtRule,Ao.Result,Ao.Input,Ao.Rule,Ao.Root,Ao.Node;var po=Object.defineProperty,mo=function(e,t,n){return function(e,t,n){return t in e?po(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":Ee(t))?t+"":t,n)};function fo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function go(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return Se(this,e)?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})}),n}var yo={exports:{}},bo=String,wo=function(){return{isColorSupported:!1,reset:bo,bold:bo,dim:bo,italic:bo,underline:bo,inverse:bo,hidden:bo,strikethrough:bo,black:bo,red:bo,green:bo,yellow:bo,blue:bo,magenta:bo,cyan:bo,white:bo,gray:bo,bgBlack:bo,bgRed:bo,bgGreen:bo,bgYellow:bo,bgBlue:bo,bgMagenta:bo,bgCyan:bo,bgWhite:bo}};yo.exports=wo(),yo.exports.createColors=wo;var vo=yo.exports,ko=go(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),xo=vo,Co=ko,So=function(e){function t(n,i,r,o,s,a){var c;return(c=e.call(this,n)||this).name="CssSyntaxError",c.reason=n,s&&(c.file=s),o&&(c.source=o),a&&(c.plugin=a),void 0!==i&&void 0!==r&&("number"==typeof i?(c.line=i,c.column=r):(c.line=i.line,c.column=i.column,c.endLine=r.line,c.endColumn=r.column)),c.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(c,t),c}Ce(t,e);var n=t.prototype;return n.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},n.showSourceCode=function(e){var t=this;if(!this.source)return"";var n=this.source;null==e&&(e=xo.isColorSupported),Co&&e&&(n=Co(n));var i,r,o=n.split(/\r?\n/),s=Math.max(this.line-3,0),a=Math.min(this.line+2,o.length),c=String(a).length;if(e){var l=xo.createColors(!0),u=l.bold,d=l.gray,h=l.red;i=function(e){return u(h(e))},r=function(e){return d(e)}}else i=r=function(e){return e};return o.slice(s,a).map(function(e,n){var o=s+1+n,a=" "+(" "+o).slice(-c)+" | ";if(o===t.line){var l=r(a.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return i(">")+r(a)+e+"\n "+l+i("^")}return" "+r(a)+e}).join("\n")},n.toString=function(){var e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e},t}(Me(Error)),Bo=So;So.default=So;var Io={};Io.isClean=Symbol("isClean"),Io.my=Symbol("my");var Eo={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};var Mo=function(){function e(e){this.builder=e}var t=e.prototype;return t.atrule=function(e,t){var n="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:i&&(n+=" "),e.nodes)this.block(e,n+i);else{var r=(e.raws.between||"")+(t?";":"");this.builder(n+i+r,e)}},t.beforeAfter=function(e,t){var n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");for(var i=e.parent,r=0;i&&"root"!==i.type;)r+=1,i=i.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var s=0;s<r;s++)n+=o}return n},t.block=function(e,t){var n,i=this.raw(e,"between","beforeOpen");this.builder(t+i+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")},t.body=function(e){for(var t=e.nodes.length-1;t>0&&"comment"===e.nodes[t].type;)t-=1;for(var n=this.raw(e,"semicolon"),i=0;i<e.nodes.length;i++){var r=e.nodes[i],o=this.raw(r,"before");o&&this.builder(o),this.stringify(r,t!==i||n)}},t.comment=function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)},t.decl=function(e,t){var n=this.raw(e,"between","colon"),i=e.prop+n+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)},t.document=function(e){this.body(e)},t.raw=function(e,t,n){var i;if(n||(n=t),t&&void 0!==(i=e.raws[t]))return i;var r=e.parent;if("before"===n){if(!r||"root"===r.type&&r.first===e)return"";if(r&&"document"===r.type)return""}if(!r)return Eo[n];var o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);var s,a="raw"+((s=n)[0].toUpperCase()+s.slice(1));return this[a]?i=this[a](o,e):o.walk(function(e){if(void 0!==(i=e.raws[t]))return!1}),void 0===i&&(i=Eo[n]),o.rawCache[n]=i,i},t.rawBeforeClose=function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t},t.rawBeforeComment=function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n},t.rawBeforeDecl=function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n},t.rawBeforeOpen=function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t},t.rawBeforeRule=function(e){var t;return e.walk(function(n){if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return(t=n.raws.before).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t},t.rawColon=function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t},t.rawEmptyBody=function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t},t.rawIndent=function(e){return e.raws.indent?e.raws.indent:(e.walk(function(n){var i=n.parent;if(i&&i!==e&&i.parent&&i.parent===e&&void 0!==n.raws.before){var r=n.raws.before.split("\n");return t=(t=r[r.length-1]).replace(/\S/g,""),!1}}),t);var t},t.rawSemicolon=function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t},t.rawValue=function(e,t){var n=e[t],i=e.raws[t];return i&&i.value===n?i.raw:n},t.root=function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)},t.rule=function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")},t.stringify=function(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)},e}(),Do=Mo;Mo.default=Mo;var Qo=Do;function Uo(e,t){new Qo(t).stringify(e)}var Fo=Uo;Uo.default=Uo;var No=Io.isClean,To=Io.my,Lo=Bo,Po=Do,Oo=Fo;function Ro(e,t){var n=new e.constructor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&"proxyCache"!==i){var r=e[i],o=void 0===r?"undefined":Ee(r);"parent"===i&&"object"===o?t&&(n[i]=t):"source"===i?n[i]=r:Array.isArray(r)?n[i]=r.map(function(e){return Ro(e,n)}):("object"===o&&null!==r&&(r=Ro(r)),n[i]=r)}return n}var zo=function(){function e(e){for(var t in void 0===e&&(e={}),this.raws={},this[No]=!1,this[To]=!0,e)if("nodes"===t){this.nodes=[];for(var n,i=Qe(e[t]);!(n=i()).done;){var r=n.value;"function"==typeof r.clone?this.append(r.clone()):this.append(r)}}else this[t]=e[t]}var t=e.prototype;return t.addToError=function(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){var t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,"$&"+t.input.from+":"+t.start.line+":"+t.start.column+"$&")}return e},t.after=function(e){return this.parent.insertAfter(this,e),this},t.assign=function(e){for(var t in void 0===e&&(e={}),e)this[t]=e[t];return this},t.before=function(e){return this.parent.insertBefore(this,e),this},t.cleanRaws=function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between},t.clone=function(e){void 0===e&&(e={});var t=Ro(this);for(var n in e)t[n]=e[n];return t},t.cloneAfter=function(e){void 0===e&&(e={});var t=this.clone(e);return this.parent.insertAfter(this,t),t},t.cloneBefore=function(e){void 0===e&&(e={});var t=this.clone(e);return this.parent.insertBefore(this,t),t},t.error=function(e,t){if(void 0===t&&(t={}),this.source){var n=this.rangeBy(t),i=n.end,r=n.start;return this.source.input.error(e,{column:r.column,line:r.line},{column:i.column,line:i.line},t)}return new Lo(e)},t.getProxyProcessor=function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}},t.markDirty=function(){if(this[No]){this[No]=!1;for(var e=this;e=e.parent;)e[No]=!1}},t.next=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e+1]}},t.positionBy=function(e,t){var n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){var i=(t=this.toString()).indexOf(e.word);-1!==i&&(n=this.positionInside(i,t))}return n},t.positionInside=function(e,t){for(var n=t||this.toString(),i=this.source.start.column,r=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?(i=1,r+=1):i+=1;return{column:i,line:r}},t.prev=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e-1]}},t.rangeBy=function(e){var t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){var i=this.toString(),r=i.indexOf(e.word);-1!==r&&(t=this.positionInside(r,i),n=this.positionInside(r+e.word.length,i))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}},t.raw=function(e,t){return(new Po).raw(this,e,t)},t.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},t.replaceWith=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(this.parent){for(var i,r=this,o=!1,s=Qe(t);!(i=s()).done;){var a=i.value;a===this?o=!0:o?(this.parent.insertAfter(r,a),r=a):this.parent.insertBefore(r,a)}o||this.remove()}return this},t.root=function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e},t.toJSON=function(e,t){var n={},i=null==t;t=t||new Map;var r=0;for(var o in this)if(Object.prototype.hasOwnProperty.call(this,o)&&"parent"!==o&&"proxyCache"!==o){var s=this[o];if(Array.isArray(s))n[o]=s.map(function(e){return"object"===(void 0===e?"undefined":Ee(e))&&e.toJSON?e.toJSON(null,t):e});else if("object"===(void 0===s?"undefined":Ee(s))&&s.toJSON)n[o]=s.toJSON(null,t);else if("source"===o){var a=t.get(s.input);null==a&&(a=r,t.set(s.input,r),r++),n[o]={end:s.end,inputId:a,start:s.start}}else n[o]=s}return i&&(n.inputs=[].concat(t.keys()).map(function(e){return e.toJSON()})),n},t.toProxy=function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache},t.toString=function(e){void 0===e&&(e=Oo),e.stringify&&(e=e.stringify);var t="";return e(this,function(e){t+=e}),t},t.warn=function(e,t,n){var i={node:this};for(var r in n)i[r]=n[r];return e.warn(t,i)},ve(e,[{key:"proxyOf",get:function(){return this}}]),e}(),qo=zo;zo.default=zo;var Yo=function(e){function t(t){var n;return t&&void 0!==t.value&&"string"!=typeof t.value&&(t=ke({},t,{value:String(t.value)})),(n=e.call(this,t)||this).type="decl",n}return Ce(t,e),ve(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),t}(qo),Ko=Yo;Yo.default=Yo;var Ho=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},Vo=ko.SourceMapConsumer,jo=ko.SourceMapGenerator,Zo=ko.existsSync,Xo=ko.readFileSync,Go=ko.dirname,Wo=ko.join;var Jo=function(){function e(e,t){if(!1!==t.map){this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");var n=t.map?t.map.prev:void 0,i=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Go(this.mapFile)),i&&(this.text=i)}}var t=e.prototype;return t.consumer=function(){return this.consumerCache||(this.consumerCache=new Vo(this.text)),this.consumerCache},t.decodeInline=function(e){var t;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),B?B.from(t,"base64").toString():window.atob(t);var n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)},t.getAnnotationURL=function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()},t.isMap=function(e){return"object"===(void 0===e?"undefined":Ee(e))&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))},t.loadAnnotation=function(e){var t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(t){var n=e.lastIndexOf(t.pop()),i=e.indexOf("*/",n);n>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,i)))}},t.loadFile=function(e){if(this.root=Go(e),Zo(e))return this.mapFile=e,Xo(e,"utf-8").toString().trim()},t.loadMap=function(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(Se(t,Vo))return jo.fromSourceMap(t).toString();if(Se(t,jo))return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){var i=this.loadFile(n);if(!i)throw new Error("Unable to load previous source map: "+n.toString());return i}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){var r=this.annotation;return e&&(r=Wo(Go(e),r)),this.loadFile(r)}}},t.startWith=function(e,t){return!!e&&e.substr(0,t.length)===t},t.withContent=function(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},e}(),_o=Jo;Jo.default=Jo;var $o=ko.SourceMapConsumer,es=ko.SourceMapGenerator,ts=ko.fileURLToPath,ns=ko.pathToFileURL,is=ko.isAbsolute,rs=ko.resolve,os=Ho,ss=ko,as=Bo,cs=_o,ls=Symbol("fromOffsetCache"),us=Boolean($o&&es),ds=Boolean(rs&&is),hs=function(){function e(e,t){if(void 0===t&&(t={}),null==e||"object"===(void 0===e?"undefined":Ee(e))&&!e.toString)throw new Error("PostCSS received "+e+" instead of CSS string");if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!ds||/^\w+:\/\//.test(t.from)||is(t.from)?this.file=t.from:this.file=rs(t.from)),ds&&us){var n=new cs(this.css,t);if(n.text){this.map=n;var i=n.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+os(6)+">"),this.map&&(this.map.file=this.from)}var t=e.prototype;return t.error=function(e,t,n,i){var r,o,s;if(void 0===i&&(i={}),t&&"object"===(void 0===t?"undefined":Ee(t))){var a=t,c=n;if("number"==typeof a.offset){var l=this.fromOffset(a.offset);t=l.line,n=l.col}else t=a.line,n=a.column;if("number"==typeof c.offset){var u=this.fromOffset(c.offset);o=u.line,s=u.col}else o=c.line,s=c.column}else if(!n){var d=this.fromOffset(t);t=d.line,n=d.col}var h=this.origin(t,n,o,s);return(r=h?new as(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,i.plugin):new as(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:s,line:o},this.css,this.file,i.plugin)).input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(ns&&(r.input.url=ns(this.file).toString()),r.input.file=this.file),r},t.fromOffset=function(e){var t;if(this[ls])t=this[ls];else{var n=this.css.split("\n");t=new Array(n.length);for(var i=0,r=0,o=n.length;r<o;r++)t[r]=i,i+=n[r].length+1;this[ls]=t}var s=0;if(e>=t[t.length-1])s=t.length-1;else for(var a,c=t.length-2;s<c;)if(e<t[a=s+(c-s>>1)])c=a-1;else{if(!(e>=t[a+1])){s=a;break}s=a+1}return{col:e-t[s]+1,line:s+1}},t.mapResolve=function(e){return/^\w+:\/\//.test(e)?e:rs(this.map.consumer().sourceRoot||this.map.root||".",e)},t.origin=function(e,t,n,i){if(!this.map)return!1;var r,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(r=s.originalPositionFor({column:i,line:n})),o=is(a.source)?ns(a.source):new URL(a.source,this.map.consumer().sourceRoot||ns(this.map.mapFile));var c={column:a.column,endColumn:r&&r.column,endLine:r&&r.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!ts)throw new Error("file: protocol is not available in this PostCSS build");c.file=ts(o)}var l=s.sourceContentFor(a.source);return l&&(c.source=l),c},t.toJSON=function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var i=n[t];null!=this[i]&&(e[i]=this[i])}return this.map&&(e.map=ke({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e},ve(e,[{key:"from",get:function(){return this.file||this.id}}]),e}(),As=hs;hs.default=hs,ss&&ss.registerInput&&ss.registerInput(hs);var ps=ko.SourceMapConsumer,ms=ko.SourceMapGenerator,fs=ko.dirname,gs=ko.relative,ys=ko.resolve,bs=ko.sep,ws=ko.pathToFileURL,vs=As,ks=Boolean(ps&&ms),xs=Boolean(fs&&ys&&gs&&bs),Cs=function(){function e(e,t,n,i){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}var t=e.prototype;return t.addAnnotation=function(){var e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";var t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"},t.applyPrevMaps=function(){for(var e,t=Qe(this.previous());!(e=t()).done;){var n=e.value,i=this.toUrl(this.path(n.file)),r=n.root||fs(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new ps(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,i,this.toUrl(this.path(r)))}},t.clearAnnotation=function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;t>=0;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))},t.generate=function(){if(this.clearAnnotation(),xs&&ks&&this.isMap())return this.generateMap();var e="";return this.stringify(this.root,function(t){e+=t}),[e]},t.generateMap=function(){if(this.root)this.generateString();else if(1===this.previous().length){var e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ms.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new ms({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},t.generateString=function(){var e=this;this.css="",this.map=new ms({file:this.outputFile(),ignoreInvalidMapping:!0});var t,n,i=1,r=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(a,c,l){if(e.css+=a,c&&"end"!==l&&(s.generated.line=i,s.generated.column=r-1,c.source&&c.source.start?(s.source=e.sourcePath(c),s.original.line=c.source.start.line,s.original.column=c.source.start.column-1,e.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,e.map.addMapping(s))),(t=a.match(/\n/g))?(i+=t.length,n=a.lastIndexOf("\n"),r=a.length-n):r+=a.length,c&&"start"!==l){var u=c.parent||{raws:{}};("decl"===c.type||"atrule"===c.type&&!c.nodes)&&c===u.last&&!u.raws.semicolon||(c.source&&c.source.end?(s.source=e.sourcePath(c),s.original.line=c.source.end.line,s.original.column=c.source.end.column-1,s.generated.line=i,s.generated.column=r-2,e.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=i,s.generated.column=r-1,e.map.addMapping(s)))}})},t.isAnnotation=function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))},t.isInline=function(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))},t.isMap=function(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0},t.isSourcesContent=function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})},t.outputFile=function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"},t.path=function(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;var n=this.opts.to?fs(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=fs(ys(n,this.mapOpts.annotation)));var i=gs(n,e);return this.memoizedPaths.set(e,i),i},t.previous=function(){var e=this;if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(function(t){if(t.source&&t.source.input.map){var n=t.source.input.map;e.previousMaps.includes(n)||e.previousMaps.push(n)}});else{var t=new vs(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps},t.setSourcesContent=function(){var e=this,t={};if(this.root)this.root.walk(function(n){if(n.source){var i=n.source.input.from;if(i&&!t[i]){t[i]=!0;var r=e.usesFileUrls?e.toFileUrl(i):e.toUrl(e.path(i));e.map.setSourceContent(r,n.source.input.css)}}});else if(this.css){var n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}},t.sourcePath=function(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))},t.toBase64=function(e){return B?B.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))},t.toFileUrl=function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(ws){var n=ws(e).toString();return this.memoizedFileURLs.set(e,n),n}throw new Error("`map.absolute` option is not available in this PostCSS build")},t.toUrl=function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===bs&&(e=e.replace(/\\/g,"/"));var n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n},e}(),Ss=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="comment",n}return Ce(t,e),t}(qo),Bs=Ss;Ss.default=Ss;var Is,Es,Ms,Ds,Qs=Io.isClean,Us=Io.my,Fs=Ko,Ns=Bs;function Ts(e){return e.map(function(e){return e.nodes&&(e.nodes=Ts(e.nodes)),delete e.source,e})}function Ls(e){if(e[Qs]=!1,e.proxyOf.nodes)for(var t,n=Qe(e.proxyOf.nodes);!(t=n()).done;){Ls(t.value)}}var Ps=function(e){function t(){return e.apply(this,arguments)||this}Ce(t,e);var n=t.prototype;return n.append=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var i,r=Qe(t);!(i=r()).done;)for(var o,s=i.value,a=Qe(this.normalize(s,this.last));!(o=a()).done;){var c=o.value;this.proxyOf.nodes.push(c)}return this.markDirty(),this},n.cleanRaws=function(t){if(e.prototype.cleanRaws.call(this,t),this.nodes)for(var n,i=Qe(this.nodes);!(n=i()).done;){n.value.cleanRaws(t)}},n.each=function(e){if(this.proxyOf.nodes){for(var t,n,i=this.getIterator();this.indexes[i]<this.proxyOf.nodes.length&&(t=this.indexes[i],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[i]+=1;return delete this.indexes[i],n}},n.every=function(e){return this.nodes.every(e)},n.getIterator=function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e},n.getProxyProcessor=function(){return{get:function(e,t){return"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];var o;return(o=e)[t].apply(o,[].concat(i.map(function(e){return"function"==typeof e?function(t,n){return e(t.toProxy(),n)}:e})))}:"every"===t||"some"===t?function(n){return e[t](function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return n.apply(void 0,[].concat([e.toProxy()],i))})}:"root"===t?function(){return e.root().toProxy()}:"nodes"===t?e.nodes.map(function(e){return e.toProxy()}):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]},set:function(e,t,n){return e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}},n.index=function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))},n.insertAfter=function(e,t){var n,i=this.index(e),r=this.normalize(t,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(var o,s=Qe(r);!(o=s()).done;){var a=o.value;this.proxyOf.nodes.splice(i+1,0,a)}for(var c in this.indexes)i<(n=this.indexes[c])&&(this.indexes[c]=n+r.length);return this.markDirty(),this},n.insertBefore=function(e,t){var n,i=this.index(e),r=0===i&&"prepend",o=this.normalize(t,this.proxyOf.nodes[i],r).reverse();i=this.index(e);for(var s,a=Qe(o);!(s=a()).done;){var c=s.value;this.proxyOf.nodes.splice(i,0,c)}for(var l in this.indexes)i<=(n=this.indexes[l])&&(this.indexes[l]=n+o.length);return this.markDirty(),this},n.normalize=function(e,n){var i=this;if("string"==typeof e)e=Ts(Is(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r,o=Qe(e=e.slice(0));!(r=o()).done;){var s=r.value;s.parent&&s.parent.removeChild(s,"ignore")}else if("root"===e.type&&"document"!==this.type)for(var a,c=Qe(e=e.nodes.slice(0));!(a=c()).done;){var l=a.value;l.parent&&l.parent.removeChild(l,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new Fs(e)]}else if(e.selector)e=[new Es(e)];else if(e.name)e=[new Ms(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new Ns(e)]}return e.map(function(e){return e[Us]||t.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[Qs]&&Ls(e),void 0===e.raws.before&&n&&void 0!==n.raws.before&&(e.raws.before=n.raws.before.replace(/\S/g,"")),e.parent=i.proxyOf,e})},n.prepend=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var i,r=Qe(t=t.reverse());!(i=r()).done;){for(var o,s=i.value,a=this.normalize(s,this.first,"prepend").reverse(),c=Qe(a);!(o=c()).done;){var l=o.value;this.proxyOf.nodes.unshift(l)}for(var u in this.indexes)this.indexes[u]=this.indexes[u]+a.length}return this.markDirty(),this},n.push=function(e){return e.parent=this,this.proxyOf.nodes.push(e),this},n.removeAll=function(){for(var e,t=Qe(this.proxyOf.nodes);!(e=t()).done;){e.value.parent=void 0}return this.proxyOf.nodes=[],this.markDirty(),this},n.removeChild=function(e){var t;for(var n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this},n.replaceValues=function(e,t,n){return n||(n=t,t={}),this.walkDecls(function(i){t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,n))}),this.markDirty(),this},n.some=function(e){return this.nodes.some(e)},n.walk=function(e){return this.each(function(t,n){var i;try{i=e(t,n)}catch(r){throw t.addToError(r)}return!1!==i&&t.walk&&(i=t.walk(e)),i})},n.walkAtRules=function(e,t){return t?Se(e,RegExp)?this.walk(function(n,i){if("atrule"===n.type&&e.test(n.name))return t(n,i)}):this.walk(function(n,i){if("atrule"===n.type&&n.name===e)return t(n,i)}):(t=e,this.walk(function(e,n){if("atrule"===e.type)return t(e,n)}))},n.walkComments=function(e){return this.walk(function(t,n){if("comment"===t.type)return e(t,n)})},n.walkDecls=function(e,t){return t?Se(e,RegExp)?this.walk(function(n,i){if("decl"===n.type&&e.test(n.prop))return t(n,i)}):this.walk(function(n,i){if("decl"===n.type&&n.prop===e)return t(n,i)}):(t=e,this.walk(function(e,n){if("decl"===e.type)return t(e,n)}))},n.walkRules=function(e,t){return t?Se(e,RegExp)?this.walk(function(n,i){if("rule"===n.type&&e.test(n.selector))return t(n,i)}):this.walk(function(n,i){if("rule"===n.type&&n.selector===e)return t(n,i)}):(t=e,this.walk(function(e,n){if("rule"===e.type)return t(e,n)}))},ve(t,[{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}]),t}(qo);Ps.registerParse=function(e){Is=e},Ps.registerRule=function(e){Es=e},Ps.registerAtRule=function(e){Ms=e},Ps.registerRoot=function(e){Ds=e};var Os=Ps;Ps.default=Ps,Ps.rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,Ms.prototype):"rule"===e.type?Object.setPrototypeOf(e,Es.prototype):"decl"===e.type?Object.setPrototypeOf(e,Fs.prototype):"comment"===e.type?Object.setPrototypeOf(e,Ns.prototype):"root"===e.type&&Object.setPrototypeOf(e,Ds.prototype),e[Us]=!0,e.nodes&&e.nodes.forEach(function(e){Ps.rebuild(e)})};var Rs,zs,qs=function(e){function t(t){var n;return(n=e.call(this,ke({type:"document"},t))||this).nodes||(n.nodes=[]),n}return Ce(t,e),t.prototype.toResult=function(e){return void 0===e&&(e={}),new Rs(new zs,this,e).stringify()},t}(Os);qs.registerLazyResult=function(e){Rs=e},qs.registerProcessor=function(e){zs=e};var Ys=qs;qs.default=qs;var Ks=function(){function e(e,t){if(void 0===t&&(t={}),this.type="warning",this.text=e,t.node&&t.node.source){var n=t.node.rangeBy(t);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(var i in t)this[i]=t[i]}return e.prototype.toString=function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text},e}(),Hs=Ks;Ks.default=Ks;var Vs=Hs,js=function(){function e(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}var t=e.prototype;return t.toString=function(){return this.css},t.warn=function(e,t){void 0===t&&(t={}),t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);var n=new Vs(e,t);return this.messages.push(n),n},t.warnings=function(){return this.messages.filter(function(e){return"warning"===e.type})},ve(e,[{key:"content",get:function(){return this.css}}]),e}(),Zs=js;js.default=js;var Xs="'".charCodeAt(0),Gs='"'.charCodeAt(0),Ws="\\".charCodeAt(0),Js="/".charCodeAt(0),_s="\n".charCodeAt(0),$s=" ".charCodeAt(0),ea="\f".charCodeAt(0),ta="\t".charCodeAt(0),na="\r".charCodeAt(0),ia="[".charCodeAt(0),ra="]".charCodeAt(0),oa="(".charCodeAt(0),sa=")".charCodeAt(0),aa="{".charCodeAt(0),ca="}".charCodeAt(0),la=";".charCodeAt(0),ua="*".charCodeAt(0),da=":".charCodeAt(0),ha="@".charCodeAt(0),Aa=/[\t\n\f\r "#'()/;[\\\]{}]/g,pa=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,ma=/.[\r\n"'(/\\]/,fa=/[\da-f]/i,ga=Os,ya=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="atrule",n}Ce(t,e);var n=t.prototype;return n.append=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r;return this.proxyOf.nodes||(this.nodes=[]),(r=e.prototype.append).call.apply(r,[].concat([this],n))},n.prepend=function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r;return this.proxyOf.nodes||(this.nodes=[]),(r=e.prototype.prepend).call.apply(r,[].concat([this],n))},t}(ga),ba=ya;ya.default=ya,ga.registerAtRule(ya);var wa,va,ka=Os,xa=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="root",n.nodes||(n.nodes=[]),n}Ce(t,e);var n=t.prototype;return n.normalize=function(t,n,i){var r=e.prototype.normalize.call(this,t);if(n)if("prepend"===i)this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(var o,s=Qe(r);!(o=s()).done;){o.value.raws.before=n.raws.before}return r},n.removeChild=function(t,n){var i=this.index(t);return!n&&0===i&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),e.prototype.removeChild.call(this,t)},n.toResult=function(e){return void 0===e&&(e={}),new wa(new va,this,e).stringify()},t}(ka);xa.registerLazyResult=function(e){wa=e},xa.registerProcessor=function(e){va=e};var Ca=xa;xa.default=xa,ka.registerRoot(xa);var Sa={comma:function(e){return Sa.split(e,[","],!0)},space:function(e){return Sa.split(e,[" ","\n","\t"])},split:function(e,t,n){for(var i,r=[],o="",s=!1,a=0,c=!1,l="",u=!1,d=Qe(e);!(i=d()).done;){var h=i.value;u?u=!1:"\\"===h?u=!0:c?h===l&&(c=!1):'"'===h||"'"===h?(c=!0,l=h):"("===h?a+=1:")"===h?a>0&&(a-=1):0===a&&t.includes(h)&&(s=!0),s?(""!==o&&r.push(o.trim()),o="",s=!1):o+=h}return(n||""!==o)&&r.push(o.trim()),r}},Ba=Sa;Sa.default=Sa;var Ia=Os,Ea=Ba,Ma=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="rule",n.nodes||(n.nodes=[]),n}return Ce(t,e),ve(t,[{key:"selectors",get:function(){return Ea.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}}]),t}(Ia),Da=Ma;Ma.default=Ma,Ia.registerRule(Ma);var Qa=Ko,Ua=function(e,t){void 0===t&&(t={});var n,i,r,o,s,a,c,l,u,d,h=e.css.valueOf(),A=t.ignoreErrors,p=h.length,m=0,f=[],g=[];function y(t){throw e.error("Unclosed "+t,m)}return{back:function(e){g.push(e)},endOfFile:function(){return 0===g.length&&m>=p},nextToken:function(e){if(g.length)return g.pop();if(!(m>=p)){var t=!!e&&e.ignoreUnclosed;switch(n=h.charCodeAt(m)){case _s:case $s:case ta:case na:case ea:i=m;do{i+=1,n=h.charCodeAt(i)}while(n===$s||n===_s||n===ta||n===na||n===ea);d=["space",h.slice(m,i)],m=i-1;break;case ia:case ra:case aa:case ca:case da:case la:case sa:var b=String.fromCharCode(n);d=[b,b,m];break;case oa:if(l=f.length?f.pop()[1]:"",u=h.charCodeAt(m+1),"url"===l&&u!==Xs&&u!==Gs&&u!==$s&&u!==_s&&u!==ta&&u!==ea&&u!==na){i=m;do{if(a=!1,-1===(i=h.indexOf(")",i+1))){if(A||t){i=m;break}y("bracket")}for(c=i;h.charCodeAt(c-1)===Ws;)c-=1,a=!a}while(a);d=["brackets",h.slice(m,i+1),m,i],m=i}else i=h.indexOf(")",m+1),o=h.slice(m,i+1),-1===i||ma.test(o)?d=["(","(",m]:(d=["brackets",o,m,i],m=i);break;case Xs:case Gs:r=n===Xs?"'":'"',i=m;do{if(a=!1,-1===(i=h.indexOf(r,i+1))){if(A||t){i=m+1;break}y("string")}for(c=i;h.charCodeAt(c-1)===Ws;)c-=1,a=!a}while(a);d=["string",h.slice(m,i+1),m,i],m=i;break;case ha:Aa.lastIndex=m+1,Aa.test(h),i=0===Aa.lastIndex?h.length-1:Aa.lastIndex-2,d=["at-word",h.slice(m,i+1),m,i],m=i;break;case Ws:for(i=m,s=!0;h.charCodeAt(i+1)===Ws;)i+=1,s=!s;if(n=h.charCodeAt(i+1),s&&n!==Js&&n!==$s&&n!==_s&&n!==ta&&n!==na&&n!==ea&&(i+=1,fa.test(h.charAt(i)))){for(;fa.test(h.charAt(i+1));)i+=1;h.charCodeAt(i+1)===$s&&(i+=1)}d=["word",h.slice(m,i+1),m,i],m=i;break;default:n===Js&&h.charCodeAt(m+1)===ua?(0===(i=h.indexOf("*/",m+2)+1)&&(A||t?i=h.length:y("comment")),d=["comment",h.slice(m,i+1),m,i],m=i):(pa.lastIndex=m+1,pa.test(h),i=0===pa.lastIndex?h.length-1:pa.lastIndex-2,d=["word",h.slice(m,i+1),m,i],f.push(d),m=i)}return m++,d}},position:function(){return m}}},Fa=Bs,Na=ba,Ta=Ca,La=Da,Pa={empty:!0,space:!0};var Oa=function(){function e(e){this.input=e,this.root=new Ta,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}var t=e.prototype;return t.atrule=function(e){var t,n,i,r=new Na;r.name=e[1].slice(1),""===r.name&&this.unnamedAtrule(r,e),this.init(r,e[2]);for(var o=!1,s=!1,a=[],c=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){r.source.end=this.getPosition(e[2]),r.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(n=a[i=a.length-1];n&&"space"===n[0];)n=a[--i];n&&(r.source.end=this.getPosition(n[3]||n[2]),r.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(r.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(r,"params",a),o&&(e=a[a.length-1],r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),s&&(r.nodes=[],this.current=r)},t.checkMissedSemicolon=function(e){var t=this.colon(e);if(!1!==t){for(var n,i=0,r=t-1;r>=0&&("space"===(n=e[r])[0]||2!==(i+=1));r--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}},t.colon=function(e){for(var t,n,i,r,o=0,s=Qe(e.entries());!(r=s()).done;){var a=r.value,c=a[0];if("("===(n=(t=a[1])[0])&&(o+=1),")"===n&&(o-=1),0===o&&":"===n){if(i){if("word"===i[0]&&"progid"===i[1])continue;return c}this.doubleColon(t)}i=t}return!1},t.comment=function(e){var t=new Fa;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;var n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{var i=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}},t.createTokenizer=function(){this.tokenizer=Ua(this.input)},t.decl=function(e,t){var n=new Qa;this.init(n,e[0][2]);var i,r=e[e.length-1];for(";"===r[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(r[3]||r[2]||function(e){for(var t=e.length-1;t>=0;t--){var n=e[t],i=n[3]||n[2];if(i)return i}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(i=e.shift())[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var s,a=[];e.length&&("space"===(s=e[0][0])||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(var c=e.length-1;c>=0;c--){if("!important"===(i=e[c])[1].toLowerCase()){n.important=!0;var l=this.stringFrom(e,c);" !important"!==(l=this.spacesFromEnd(e)+l)&&(n.raws.important=l);break}if("important"===i[1].toLowerCase()){for(var u=e.slice(0),d="",h=c;h>0;h--){var A=u[h][0];if(0===d.trim().indexOf("!")&&"space"!==A)break;d=u.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=u)}if("space"!==i[0]&&"comment"!==i[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=a.map(function(e){return e[1]}).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)},t.doubleColon=function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})},t.emptyRule=function(e){var t=new La;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t},t.end=function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)},t.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())},t.freeSemicolon=function(e){if(this.spaces+=e[1],this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}},t.getPosition=function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}},t.init=function(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)},t.other=function(e){for(var t=!1,n=null,i=!1,r=null,o=[],s=e[1].startsWith("--"),a=[],c=e;c;){if(n=c[0],a.push(c),"("===n||"["===n)r||(r=c),o.push("("===n?")":"]");else if(s&&i&&"{"===n)r||(r=c),o.push("}");else if(0===o.length){if(";"===n){if(i)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(i=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(r=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(r),t&&i){if(!s)for(;a.length&&("space"===(c=a[a.length-1][0])||"comment"===c);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)},t.parse=function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()},t.precheckMissedSemicolon=function(){},t.raw=function(e,t,n,i){for(var r,o,s,a,c=n.length,l="",u=!0,d=0;d<c;d+=1)"space"!==(o=(r=n[d])[0])||d!==c-1||i?"comment"===o?(a=n[d-1]?n[d-1][0]:"empty",s=n[d+1]?n[d+1][0]:"empty",Pa[a]||Pa[s]||","===l.slice(-1)?u=!1:l+=r[1]):l+=r[1]:u=!1;if(!u){var h=n.reduce(function(e,t){return e+t[1]},"");e.raws[t]={raw:h,value:l}}e[t]=l},t.rule=function(e){e.pop();var t=new La;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t},t.spacesAndCommentsFromEnd=function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n},t.spacesAndCommentsFromStart=function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n},t.spacesFromEnd=function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t},t.stringFrom=function(e,t){for(var n="",i=t;i<e.length;i++)n+=e[i][1];return e.splice(t,e.length-t),n},t.unclosedBlock=function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)},t.unclosedBracket=function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})},t.unexpectedClose=function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})},t.unknownWord=function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})},t.unnamedAtrule=function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})},e}(),Ra=Os,za=Oa,qa=As;function Ya(e,t){var n=new qa(e,t),i=new za(n);try{i.parse()}catch(r){throw r}return i.root}var Ka=Ya;Ya.default=Ya,Ra.registerParse(Ya);var Ha=Io.isClean,Va=Io.my,ja=Cs,Za=Fo,Xa=Os,Ga=Ys,Wa=Zs,Ja=Ka,_a=Ca,$a={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ec={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},tc={Once:!0,postcssPlugin:!0,prepare:!0};function nc(e){return"object"===(void 0===e?"undefined":Ee(e))&&"function"==typeof e.then}function ic(e){var t=!1,n=$a[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function rc(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:ic(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function oc(e){return e[Ha]=!1,e.nodes&&e.nodes.forEach(function(e){return oc(e)}),e}var sc={},ac=function(){function e(t,n,i){var r,o=this;if(this.stringified=!1,this.processed=!1,"object"!==(void 0===n?"undefined":Ee(n))||null===n||"root"!==n.type&&"document"!==n.type)if(Se(n,e)||Se(n,Wa))r=oc(n.root),n.map&&(void 0===i.map&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=n.map);else{var s=Ja;i.syntax&&(s=i.syntax.parse),i.parser&&(s=i.parser),s.parse&&(s=s.parse);try{r=s(n,i)}catch(gd){this.processed=!0,this.error=gd}r&&!r[Va]&&Xa.rebuild(r)}else r=oc(n);this.result=new Wa(t,r,i),this.helpers=ke({},sc,{postcss:sc,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===(void 0===e?"undefined":Ee(e))&&e.prepare?ke({},e,e.prepare(o.result)):e})}var t=e.prototype;return t.async=function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.getAsyncError=function(){throw new Error("Use process(css).then(cb) to work with async plugins")},t.handleError=function(e,t){var n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(n.postcssVersion){0}}else e.plugin=n.postcssPlugin,e.setMessage()}catch(i){console&&console.error&&console.error(i)}return e},t.prepareVisitors=function(){var e=this;this.listeners={};for(var t,n=function(t,n,i){e.listeners[n]||(e.listeners[n]=[]),e.listeners[n].push([t,i])},i=Qe(this.plugins);!(t=i()).done;){var r=t.value;if("object"===(void 0===r?"undefined":Ee(r)))for(var o in r){if(!ec[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event "+o+" in "+r.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!tc[o])if("object"===Ee(r[o]))for(var s in r[o])n(r,"*"===s?o:o+"-"+s.toLowerCase(),r[o][s]);else"function"==typeof r[o]&&n(r,o,r[o])}}this.hasListener=Object.keys(this.listeners).length>0},t.runAsync=function(){var e=this;return be(function(){var t,n,i,r,o,s,a,c,l,u,d,h;return Ue(this,function(A){switch(A.label){case 0:e.plugin=0,t=0,A.label=1;case 1:if(!(t<e.plugins.length))return[3,6];if(n=e.plugins[t],!nc(i=e.runOnRoot(n)))return[3,5];A.label=2;case 2:return A.trys.push([2,4,,5]),[4,i];case 3:return A.sent(),[3,5];case 4:throw r=A.sent(),e.handleError(r);case 5:return t++,[3,1];case 6:if(e.prepareVisitors(),!e.hasListener)return[3,18];o=e.result.root,A.label=7;case 7:if(o[Ha])return[3,14];o[Ha]=!0,s=[rc(o)],A.label=8;case 8:if(!(s.length>0))return[3,13];if(!nc(a=e.visitTick(s)))return[3,12];A.label=9;case 9:return A.trys.push([9,11,,12]),[4,a];case 10:return A.sent(),[3,12];case 11:throw c=A.sent(),l=s[s.length-1].node,e.handleError(c,l);case 12:return[3,8];case 13:return[3,7];case 14:if(!e.listeners.OnceExit)return[3,18];u=function(){var t,n,i,r,s;return Ue(this,function(a){switch(a.label){case 0:t=h.value,n=t[0],i=t[1],e.result.lastPlugin=n,a.label=1;case 1:return a.trys.push([1,6,,7]),"document"!==o.type?[3,3]:(r=o.nodes.map(function(t){return i(t,e.helpers)}),[4,Promise.all(r)]);case 2:return a.sent(),[3,5];case 3:return[4,i(o,e.helpers)];case 4:a.sent(),a.label=5;case 5:return[3,7];case 6:throw s=a.sent(),e.handleError(s);case 7:return[2]}})},d=Qe(e.listeners.OnceExit),A.label=15;case 15:return(h=d()).done?[3,18]:[5,Fe(u())];case 16:A.sent(),A.label=17;case 17:return[3,15];case 18:return e.processed=!0,[2,e.stringify()]}})})()},t.runOnRoot=function(e){var t=this;this.result.lastPlugin=e;try{if("object"===(void 0===e?"undefined":Ee(e))&&e.Once){if("document"===this.result.root.type){var n=this.result.root.nodes.map(function(n){return e.Once(n,t.helpers)});return nc(n[0])?Promise.all(n):n}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(gd){throw this.handleError(gd)}},t.stringify=function(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts,t=Za;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);var n=new ja(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result},t.sync=function(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e,t=Qe(this.plugins);!(e=t()).done;){var n=e.value;if(nc(this.runOnRoot(n)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var i=this.result.root;!i[Ha];)i[Ha]=!0,this.walkSync(i);if(this.listeners.OnceExit)if("document"===i.type)for(var r,o=Qe(i.nodes);!(r=o()).done;){var s=r.value;this.visitSync(this.listeners.OnceExit,s)}else this.visitSync(this.listeners.OnceExit,i)}return this.result},t.then=function(e,t){return this.async().then(e,t)},t.toString=function(){return this.css},t.visitSync=function(e,t){for(var n,i=Qe(e);!(n=i()).done;){var r=n.value,o=r[0],s=r[1];this.result.lastPlugin=o;var a=void 0;try{a=s(t,this.helpers)}catch(c){throw this.handleError(c,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(nc(a))throw this.getAsyncError()}},t.visitTick=function(e){var t=e[e.length-1],n=t.node,i=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(i.length>0&&t.visitorIndex<i.length){var r=i[t.visitorIndex],o=r[0],s=r[1];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return s(n.toProxy(),this.helpers)}catch(d){throw this.handleError(d,n)}}if(0!==t.iterator){for(var a,c=t.iterator;a=n.nodes[n.indexes[c]];)if(n.indexes[c]+=1,!a[Ha])return a[Ha]=!0,void e.push(rc(a));t.iterator=0,delete n.indexes[c]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[Ha]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}e.pop()}else e.pop()},t.walkSync=function(e){var t=this;e[Ha]=!0;for(var n,i=Qe(ic(e));!(n=i()).done;){var r=n.value;if(0===r)e.nodes&&e.each(function(e){e[Ha]||t.walkSync(e)});else{var o=this.listeners[r];if(o&&this.visitSync(o,e.toProxy()))return}}},t.warnings=function(){return this.sync().warnings()},ve(e,[{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}]),e}();ac.registerPostcss=function(e){sc=e};var cc=ac;ac.default=ac,_a.registerLazyResult(ac),Ga.registerLazyResult(ac);var lc=Cs,uc=Fo,dc=Ka,hc=Zs,Ac=function(){function e(e,t,n){var i;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;var r=uc;this.result=new hc(this._processor,i,this._opts),this.result.css=t;var o=this;Object.defineProperty(this.result,"root",{get:function(){return o.root}});var s=new lc(r,i,this._opts,t);if(s.isMap()){var a=s.generate(),c=a[0],l=a[1];c&&(this.result.css=c),l&&(this.result.map=l)}else s.clearAnnotation(),this.result.css=s.css}var t=e.prototype;return t.async=function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.sync=function(){if(this.error)throw this.error;return this.result},t.then=function(e,t){return this.async().then(e,t)},t.toString=function(){return this._css},t.warnings=function(){return[]},ve(e,[{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=dc;try{e=t(this._css,this._opts)}catch(gd){this.error=gd}if(this.error)throw this.error;return this._root=e,e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),e}(),pc=Ac;Ac.default=Ac;var mc=pc,fc=cc,gc=Ys,yc=Ca,bc=function(){function e(e){void 0===e&&(e=[]),this.version="8.4.38",this.plugins=this.normalize(e)}var t=e.prototype;return t.normalize=function(e){for(var t,n=[],i=Qe(e);!(t=i()).done;){var r=t.value;if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"===(void 0===r?"undefined":Ee(r))&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if("object"===(void 0===r?"undefined":Ee(r))&&r.postcssPlugin)n.push(r);else if("function"==typeof r)n.push(r);else if("object"!==(void 0===r?"undefined":Ee(r))||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin")}return n},t.process=function(e,t){return void 0===t&&(t={}),this.plugins.length||t.parser||t.stringifier||t.syntax?new fc(this,e,t):new mc(this,e,t)},t.use=function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this},e}(),wc=bc;bc.default=bc,yc.registerProcessor(bc),gc.registerProcessor(bc);var vc=Ko,kc=_o,xc=Bs,Cc=ba,Sc=As,Bc=Ca,Ic=Da;function Ec(e,t){if(Array.isArray(e))return e.map(function(e){return Ec(e)});var n=e.inputs,i=Be(e,["inputs"]);if(n){t=[];for(var r,o=Qe(n);!(r=o()).done;){var s=ke({},r.value,{__proto__:Sc.prototype});s.map&&(s.map=ke({},s.map,{__proto__:kc.prototype})),t.push(s)}}if(i.nodes&&(i.nodes=e.nodes.map(function(e){return Ec(e,t)})),i.source){var a=i.source,c=a.inputId,l=Be(a,["inputId"]);i.source=l,null!=c&&(i.source.input=t[c])}if("root"===i.type)return new Bc(i);if("decl"===i.type)return new vc(i);if("rule"===i.type)return new Ic(i);if("comment"===i.type)return new xc(i);if("atrule"===i.type)return new Cc(i);throw new Error("Unknown node type: "+e.type)}var Mc=Ec;Ec.default=Ec;var Dc=Bo,Qc=Ko,Uc=cc,Fc=Os,Nc=wc,Tc=Fo,Lc=Mc,Pc=Ys,Oc=Hs,Rc=Bs,zc=ba,qc=Zs,Yc=As,Kc=Ka,Hc=Ba,Vc=Da,jc=Ca,Zc=qo;function Xc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new Nc(t)}Xc.plugin=function(e,t){var n,i=!1;function r(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];console&&console.warn&&!i&&(i=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),pe.env.LANG&&pe.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));var s=t.apply(void 0,[].concat(r));return s.postcssPlugin=e,s.postcssVersion=(new Nc).version,s}return Object.defineProperty(r,"postcss",{get:function(){return n||(n=r()),n}}),r.process=function(e,t,n){return Xc([r(n)]).process(e,t)},r},Xc.stringify=Tc,Xc.parse=Kc,Xc.fromJSON=Lc,Xc.list=Hc,Xc.comment=function(e){return new Rc(e)},Xc.atRule=function(e){return new zc(e)},Xc.decl=function(e){return new Qc(e)},Xc.rule=function(e){return new Vc(e)},Xc.root=function(e){return new jc(e)},Xc.document=function(e){return new Pc(e)},Xc.CssSyntaxError=Dc,Xc.Declaration=Qc,Xc.Container=Fc,Xc.Processor=Nc,Xc.Document=Pc,Xc.Comment=Rc,Xc.Warning=Oc,Xc.AtRule=zc,Xc.Result=qc,Xc.Input=Yc,Xc.Rule=Vc,Xc.Root=jc,Xc.Node=Zc,Uc.registerPostcss(Xc);var Gc=Xc;Xc.default=Xc;var Wc=fo(Gc);Wc.stringify,Wc.fromJSON,Wc.plugin,Wc.parse,Wc.list,Wc.document,Wc.comment,Wc.atRule,Wc.rule,Wc.decl,Wc.root,Wc.CssSyntaxError,Wc.Declaration,Wc.Container,Wc.Processor,Wc.Document,Wc.Comment,Wc.Warning,Wc.AtRule,Wc.Result,Wc.Input,Wc.Rule,Wc.Root,Wc.Node;var Jc=function(){function e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];mo(this,"parentElement",null),mo(this,"parentNode",null),mo(this,"ownerDocument"),mo(this,"firstChild",null),mo(this,"lastChild",null),mo(this,"previousSibling",null),mo(this,"nextSibling",null),mo(this,"ELEMENT_NODE",1),mo(this,"TEXT_NODE",3),mo(this,"nodeType"),mo(this,"nodeName"),mo(this,"RRNodeType")}var t=e.prototype;return t.contains=function(t){if(!Se(t,e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1},t.appendChild=function(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")},t.insertBefore=function(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")},t.removeChild=function(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")},t.toString=function(){return"RRNode"},ve(e,[{key:"childNodes",get:function(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}}]),e}(),_c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},$c={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},el={};function tl(e){if(el[e])return el[e];var t=globalThis[e],n=t.prototype,i=e in _c?_c[e]:void 0,r=Boolean(i&&i.every(function(e){var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))})),o=e in $c?$c[e]:void 0,s=Boolean(o&&o.every(function(e){var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(r&&s&&!globalThis.Zone)return el[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var c=a.contentWindow;if(!c)return t.prototype;var l=c[e].prototype;return document.body.removeChild(a),l?el[e]=l:n}catch(u){return n}}var nl={};function il(e,t,n){var i,r=e+"."+String(n);if(nl[r])return nl[r].call(t);var o=tl(e),s=null==(i=Object.getOwnPropertyDescriptor(o,n))?void 0:i.get;return s?(nl[r]=s,s.call(t)):t[n]}var rl={};function ol(e,t,n){var i=e+"."+String(n);if(rl[i])return rl[i].bind(t);var r=tl(e)[n];return"function"!=typeof r?t[n]:(rl[i]=r,r.bind(t))}function sl(){return tl("MutationObserver").constructor}function al(e,t,n){try{if(!(t in e))return function(){};var i=e[t],r=n(i);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=r,function(){e[t]=i}}catch(o){return function(){}}}var cl={childNodes:function(e){return il("Node",e,"childNodes")},parentNode:function(e){return il("Node",e,"parentNode")},parentElement:function(e){return il("Node",e,"parentElement")},textContent:function(e){return il("Node",e,"textContent")},contains:function(e,t){return ol("Node",e,"contains")(t)},getRootNode:function(e){return ol("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?il("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?il("Element",e,"shadowRoot"):null},querySelector:function(e,t){return il("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return il("Element",e,"querySelectorAll")(t)},mutationObserver:sl,patch:al};function ll(e,t,n){void 0===n&&(n=document);var i={capture:!0,passive:!0};return n.addEventListener(e,t,i),function(){return n.removeEventListener(e,t,i)}}var ul="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",dl={map:{},getId:function(){return console.error(ul),-1},getNode:function(){return console.error(ul),null},removeNodeFromMap:function(){console.error(ul)},has:function(){return console.error(ul),!1},reset:function(){console.error(ul)}};function hl(e,t,n){void 0===n&&(n={});var i=null,r=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var c=Date.now();r||!1!==n.leading||(r=c);var l=t-(c-r),u=this;l<=0||l>t?(i&&(clearTimeout(i),i=null),r=c,e.apply(u,s)):i||!1===n.trailing||(i=setTimeout(function(){r=!1===n.leading?0:Date.now(),i=null,e.apply(u,s)},l))}}function Al(e,t,n,i,r){void 0===r&&(r=window);var o=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,i?n:{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return Al(e,t,o||{},!0)}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(dl=new Proxy(dl,{get:function(e,t,n){return"map"===t&&console.error(ul),Reflect.get(e,t,n)}}));var pl=Date.now;function ml(e){var t,n,i,r,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=cl.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=cl.parentElement(o.body))?void 0:i.scrollTop)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollTop)||0}}function fl(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function gl(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function yl(e){return e?e.nodeType===e.ELEMENT_NODE?e:cl.parentElement(e):null}function bl(e,t,n,i){if(!e)return!1;var r=yl(e);if(!r)return!1;try{if("string"==typeof t){if(r.classList.contains(t))return!0;if(i&&null!==r.closest("."+t))return!0}else if(Bt(r,t,i))return!0}catch(o){}if(n){if(r.matches(n))return!0;if(i&&null!==r.closest(n))return!0}return!1}function wl(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)}function vl(e,t){if(We(e))return!1;var n=t.getId(e);if(!t.has(n))return!0;var i=cl.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||vl(i,t))}function kl(e){return Boolean(e.changedTouches)}function xl(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Cl(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Sl(e){return!!e&&(Se(e,Jc)&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(cl.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(pl=function(){return(new Date).getTime()});var Bl=function(){function e(){Le(this,"id",1),Le(this,"styleIDMap",new WeakMap),Le(this,"idStyleMap",new Map)}var t=e.prototype;return t.getId=function(e){var t;return null!=(t=this.styleIDMap.get(e))?t:-1},t.has=function(e){return this.styleIDMap.has(e)},t.add=function(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n},t.getStyle=function(e){return this.idStyleMap.get(e)||null},t.reset=function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1},t.generateId=function(){return this.id++},e}();function Il(e){var t,n=null;return"getRootNode"in e&&(null==(t=cl.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&cl.host(cl.getRootNode(e))&&(n=cl.host(cl.getRootNode(e))),n}function El(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=Il(n);)n=t;return n}(e);return cl.contains(t,n)}function Ml(e){var t=e.ownerDocument;return!!t&&(cl.contains(t,e)||El(e))}var Dl=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(Dl||{}),Ql=function(e){return e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e}(Ql||{}),Ul=function(e){return e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e}(Ul||{}),Fl=function(e){return e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e}(Fl||{}),Nl=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(Nl||{}),Tl=function(e){return e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e}(Tl||{}),Ll=function(e){return e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e}(Ll||{});function Pl(e){return"__ln"in e}var Ol,Rl=function(){function e(){Le(this,"length",0),Le(this,"head",null),Le(this,"tail",null)}var t=e.prototype;return t.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},t.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Pl(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Pl(e.nextSibling)&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++},t.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)},e}(),zl=function(e,t){return e+"@"+t},ql=function(){function e(){var e=this;Le(this,"frozen",!1),Le(this,"locked",!1),Le(this,"texts",[]),Le(this,"attributes",[]),Le(this,"attributeMap",new WeakMap),Le(this,"removes",[]),Le(this,"mapRemoves",[]),Le(this,"movedMap",{}),Le(this,"addedSet",new Set),Le(this,"movedSet",new Set),Le(this,"droppedSet",new Set),Le(this,"removesSubTreeCache",new Set),Le(this,"mutationCb"),Le(this,"blockClass"),Le(this,"blockSelector"),Le(this,"maskTextClass"),Le(this,"maskTextSelector"),Le(this,"inlineStylesheet"),Le(this,"maskInputOptions"),Le(this,"maskTextFn"),Le(this,"maskInputFn"),Le(this,"keepIframeSrcFn"),Le(this,"recordCanvas"),Le(this,"inlineImages"),Le(this,"slimDOMOptions"),Le(this,"dataURLOptions"),Le(this,"doc"),Le(this,"mirror"),Le(this,"iframeManager"),Le(this,"stylesheetManager"),Le(this,"shadowDomManager"),Le(this,"canvasManager"),Le(this,"processedNodeManager"),Le(this,"unattachedDoc"),Le(this,"processMutations",function(t){t.forEach(e.processMutation),e.emit()}),Le(this,"emit",function(){if(!e.frozen&&!e.locked){for(var t=[],n=new Set,i=new Rl,r=function(t){for(var n=t,i=-2;-2===i;)i=(n=n&&n.nextSibling)&&e.mirror.getId(n);return i},o=function(o){var s=cl.parentNode(o);if(s&&Ml(o)){var a=!1;if(o.nodeType===Node.TEXT_NODE){var c=s.tagName;if("TEXTAREA"===c)return;"STYLE"===c&&e.addedSet.has(s)&&(a=!0)}var l=We(s)?e.mirror.getId(Il(o)):e.mirror.getId(s),u=r(o);if(-1===l||-1===u)return i.addNode(o);var d=Dt(o,{doc:e.doc,mirror:e.mirror,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,dataURLOptions:e.dataURLOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(t){xl(t,e.mirror)&&e.iframeManager.addIframe(t),Cl(t,e.mirror)&&e.stylesheetManager.trackLinkElement(t),Sl(o)&&e.shadowDomManager.addShadowRoot(cl.shadowRoot(o),e.doc)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:function(t,n){e.stylesheetManager.attachLinkElement(t,n)},cssCaptured:a});d&&(t.push({parentId:l,nextId:u,node:d}),n.add(d.id))}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());for(var s,a=Qe(e.movedSet);!(s=a()).done;){var c=s.value;Kl(e.removesSubTreeCache,c,e.mirror)&&!e.movedSet.has(cl.parentNode(c))||o(c)}for(var l,u=Qe(e.addedSet);!(l=u()).done;){var d=l.value;Hl(e.droppedSet,d)||Kl(e.removesSubTreeCache,d,e.mirror)?Hl(e.movedSet,d)?o(d):e.droppedSet.add(d):o(d)}for(var h=null;i.length;){var A=null;if(h){var p=e.mirror.getId(cl.parentNode(h.value)),m=r(h.value);-1!==p&&-1!==m&&(A=h)}if(!A)for(var f=i.tail;f;){var g=f;if(f=f.previous,g){var y=e.mirror.getId(cl.parentNode(g.value));if(-1===r(g.value))continue;if(-1!==y){A=g;break}var b=g.value,w=cl.parentNode(b);if(w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var v=cl.host(w);if(-1!==e.mirror.getId(v)){A=g;break}}}}if(!A){for(;i.head;)i.removeNode(i.head.value);break}h=A.previous,i.removeNode(A.value),o(A.value)}var k={texts:e.texts.map(function(t){var n=t.node,i=cl.parentNode(n);return i&&"TEXTAREA"===i.tagName&&e.genTextAreaValueMutation(i),{id:e.mirror.getId(n),value:t.value}}).filter(function(e){return!n.has(e.id)}).filter(function(t){return e.mirror.has(t.id)}),attributes:e.attributes.map(function(t){var n=t.attributes;if("string"==typeof n.style){var i=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);i.length<n.style.length&&(i+r).split("var(").length===n.style.split("var(").length&&(n.style=t.styleDiff)}return{id:e.mirror.getId(t.node),attributes:n}}).filter(function(e){return!n.has(e.id)}).filter(function(t){return e.mirror.has(t.id)}),removes:e.removes,adds:t};(k.texts.length||k.attributes.length||k.removes.length||k.adds.length)&&(e.texts=[],e.attributes=[],e.attributeMap=new WeakMap,e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.removesSubTreeCache=new Set,e.movedMap={},e.mutationCb(k))}}),Le(this,"genTextAreaValueMutation",function(t){var n=e.attributeMap.get(t);n||(n={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},e.attributes.push(n),e.attributeMap.set(t,n));var i=Array.from(cl.childNodes(t),function(e){return cl.textContent(e)||""}).join("");n.attributes.value=tt({element:t,maskInputOptions:e.maskInputOptions,tagName:t.tagName,type:rt(t),value:i,maskInputFn:e.maskInputFn})}),Le(this,"processMutation",function(t){if(!wl(t.target,e.mirror,e.slimDOMOptions))switch(t.type){case"characterData":var n=cl.textContent(t.target);bl(t.target,e.blockClass,e.blockSelector,!1)||n===t.oldValue||e.texts.push({value:It(t.target,e.maskTextClass,e.maskTextSelector,!0)&&n?e.maskTextFn?e.maskTextFn(n,yl(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break;case"attributes":var i=t.target,r=t.attributeName,o=t.target.getAttribute(r);if("value"===r){var s=rt(i);o=tt({element:i,maskInputOptions:e.maskInputOptions,tagName:i.tagName,type:s,value:o,maskInputFn:e.maskInputFn})}if(bl(t.target,e.blockClass,e.blockSelector,!1)||o===t.oldValue)return;var a=e.attributeMap.get(t.target);if("IFRAME"===i.tagName&&"src"===r&&!e.keepIframeSrcFn(o)){if(i.contentDocument)return;r="rr_src"}if(a||(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},e.attributes.push(a),e.attributeMap.set(t.target,a)),"type"===r&&"INPUT"===i.tagName&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!St(i.tagName,r))if(a.attributes[r]=Ct(e.doc,nt(i.tagName),nt(r),o),"style"===r){if(!e.unattachedDoc)try{e.unattachedDoc=document.implementation.createHTMLDocument()}catch(g){e.unattachedDoc=e.doc}var c=e.unattachedDoc.createElement("span");t.oldValue&&c.setAttribute("style",t.oldValue);for(var l,u=Qe(Array.from(i.style));!(l=u()).done;){var d=l.value,h=i.style.getPropertyValue(d),A=i.style.getPropertyPriority(d);h!==c.style.getPropertyValue(d)||A!==c.style.getPropertyPriority(d)?a.styleDiff[d]=""===A?h:[h,A]:a._unchangedStyles[d]=[h,A]}for(var p,m=Qe(Array.from(c.style));!(p=m()).done;){var f=p.value;""===i.style.getPropertyValue(f)&&(a.styleDiff[f]=!1)}}else"open"===r&&"DIALOG"===i.tagName&&(i.matches("dialog:modal")?a.attributes.rr_open_mode="modal":a.attributes.rr_open_mode="non-modal");break;case"childList":if(bl(t.target,e.blockClass,e.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void e.genTextAreaValueMutation(t.target);t.addedNodes.forEach(function(n){return e.genAdds(n,t.target)}),t.removedNodes.forEach(function(n){var i=e.mirror.getId(n),r=We(t.target)?e.mirror.getId(cl.host(t.target)):e.mirror.getId(t.target);bl(t.target,e.blockClass,e.blockSelector,!1)||wl(n,e.mirror,e.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(n,e.mirror)||(e.addedSet.has(n)?(Yl(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===i||vl(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[zl(i,r)]?Yl(e.movedSet,n):(e.removes.push({parentId:r,id:i,isShadow:!(!We(t.target)||!Je(t.target))||void 0}),function(e,t){var n=[e];for(;n.length;){var i=n.pop();t.has(i)||(t.add(i),cl.childNodes(i).forEach(function(e){return n.push(e)}))}}(n,e.removesSubTreeCache))),e.mapRemoves.push(n))})}}),Le(this,"genAdds",function(t,n){if(!e.processedNodeManager.inOtherBuffer(t,e)&&!e.addedSet.has(t)&&!e.movedSet.has(t)){if(e.mirror.hasNode(t)){if(wl(t,e.mirror,e.slimDOMOptions))return;e.movedSet.add(t);var i=null;n&&e.mirror.hasNode(n)&&(i=e.mirror.getId(n)),i&&-1!==i&&(e.movedMap[zl(e.mirror.getId(t),i)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);bl(t,e.blockClass,e.blockSelector,!1)||(cl.childNodes(t).forEach(function(t){return e.genAdds(t)}),Sl(t)&&cl.childNodes(cl.shadowRoot(t)).forEach(function(n){e.processedNodeManager.add(n,e),e.genAdds(n,t)}))}})}var t=e.prototype;return t.init=function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(function(n){t[n]=e[n]})},t.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},t.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},t.isFrozen=function(){return this.frozen},t.lock=function(){this.locked=!0,this.canvasManager.lock()},t.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},t.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function Yl(e,t){e.delete(t),cl.childNodes(t).forEach(function(t){return Yl(e,t)})}function Kl(e,t,n){return 0!==e.size&&function(e,t){var n=cl.parentNode(t);return!!n&&e.has(n)}(e,t)}function Hl(e,t){return 0!==e.size&&Vl(e,t)}function Vl(e,t){var n=cl.parentNode(t);return!!n&&(!!e.has(n)||Vl(e,n))}var jl=function(e){if(!Ol)return e;return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];try{return e.apply(void 0,[].concat(n))}catch(gd){if(Ol&&!0===Ol(gd))return;throw gd}}},Zl=[];function Xl(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(n){}return e&&e.target}function Gl(e,t){var n=new ql;Zl.push(n),n.init(e);var i=new(sl())(jl(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Wl(e){var t=e.mouseInteractionCb,n=e.doc,i=e.mirror,r=e.blockClass,o=e.blockSelector,s=e.sampling;if(!1===s.mouseInteraction)return function(){};var a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,c=[],l=null;return Object.keys(Ul).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]}).forEach(function(e){var s=nt(e),a=function(e){return function(n){var s=Xl(n);if(!bl(s,r,o,!0)){var a=null,c=e;if("pointerType"in n){switch(n.pointerType){case"mouse":a=Fl.Mouse;break;case"touch":a=Fl.Touch;break;case"pen":a=Fl.Pen}a===Fl.Touch?Ul[e]===Ul.MouseDown?c="TouchStart":Ul[e]===Ul.MouseUp&&(c="TouchEnd"):Fl.Pen}else kl(n)&&(a=Fl.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Fl.Touch||c.startsWith("Mouse")&&a===Fl.Mouse)&&(a=null)):Ul[e]===Ul.Click&&(a=l,l=null);var u=kl(n)?n.changedTouches[0]:n;if(u){var d=i.getId(s),h=u.clientX,A=u.clientY;jl(t)(ke({type:Ul[c],id:d,x:h,y:A},null!==a&&{pointerType:a}))}}}}(e);if(window.PointerEvent)switch(Ul[e]){case Ul.MouseDown:case Ul.MouseUp:s=s.replace("mouse","pointer");break;case Ul.TouchStart:case Ul.TouchEnd:return}c.push(ll(s,a,n))}),jl(function(){c.forEach(function(e){return e()})})}function Jl(e){var t=e.scrollCb,n=e.doc,i=e.mirror,r=e.blockClass,o=e.blockSelector,s=e.sampling;return ll("scroll",jl(hl(jl(function(e){var s=Xl(e);if(s&&!bl(s,r,o,!0)){var a=i.getId(s);if(s===n&&n.defaultView){var c=ml(n.defaultView);t({id:a,x:c.left,y:c.top})}else t({id:a,x:s.scrollLeft,y:s.scrollTop})}}),s.scroll||100)),n)}var _l=["INPUT","TEXTAREA","SELECT"],$l=new WeakMap;function eu(e){return function(e,t){if(ru("CSSGroupingRule")&&Se(e.parentRule,CSSGroupingRule)||ru("CSSMediaRule")&&Se(e.parentRule,CSSMediaRule)||ru("CSSSupportsRule")&&Se(e.parentRule,CSSSupportsRule)||ru("CSSConditionRule")&&Se(e.parentRule,CSSConditionRule)){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var i=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(i)}return t}(e,[])}function tu(e,t,n){var i,r;return e?(e.ownerNode?i=t.getId(e.ownerNode):r=n.getId(e),{styleId:r,id:i}):{}}function nu(e,t){var n,i,r,o=e.mirror,s=e.stylesheetManager,a=null;a="#document"===t.nodeName?o.getId(t):o.getId(cl.host(t));var c="#document"===t.nodeName?null==(n=t.defaultView)?void 0:n.Document:null==(r=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:r.ShadowRoot,l=(null==c?void 0:c.prototype)?Object.getOwnPropertyDescriptor(null==c?void 0:c.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&c&&l?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:function(){var e;return null==(e=l.get)?void 0:e.call(this)},set:function(e){var t,n=null==(t=l.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{s.adoptStyleSheets(e,a)}catch(i){}return n}}),jl(function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):function(){}}function iu(e,t){void 0===t&&(t={});var n,i=e.doc.defaultView;if(!i)return function(){};!function(e,t){var n=e.mutationCb,i=e.mousemoveCb,r=e.mouseInteractionCb,o=e.scrollCb,s=e.viewportResizeCb,a=e.inputCb,c=e.mediaInteractionCb,l=e.styleSheetRuleCb,u=e.styleDeclarationCb,d=e.canvasMutationCb,h=e.fontCb,A=e.selectionCb,p=e.customElementCb;e.mutationCb=function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];var o;t.mutation&&(o=t).mutation.apply(o,[].concat(i)),n.apply(void 0,[].concat(i))},e.mousemoveCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o;t.mousemove&&(o=t).mousemove.apply(o,[].concat(n)),i.apply(void 0,[].concat(n))},e.mouseInteractionCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var o;t.mouseInteraction&&(o=t).mouseInteraction.apply(o,[].concat(n)),r.apply(void 0,[].concat(n))},e.scrollCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.scroll&&(r=t).scroll.apply(r,[].concat(n)),o.apply(void 0,[].concat(n))},e.viewportResizeCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.viewportResize&&(r=t).viewportResize.apply(r,[].concat(n)),s.apply(void 0,[].concat(n))},e.inputCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.input&&(r=t).input.apply(r,[].concat(n)),a.apply(void 0,[].concat(n))},e.mediaInteractionCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.mediaInteaction&&(r=t).mediaInteaction.apply(r,[].concat(n)),c.apply(void 0,[].concat(n))},e.styleSheetRuleCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.styleSheetRule&&(r=t).styleSheetRule.apply(r,[].concat(n)),l.apply(void 0,[].concat(n))},e.styleDeclarationCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.styleDeclaration&&(r=t).styleDeclaration.apply(r,[].concat(n)),u.apply(void 0,[].concat(n))},e.canvasMutationCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.canvasMutation&&(r=t).canvasMutation.apply(r,[].concat(n)),d.apply(void 0,[].concat(n))},e.fontCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.font&&(r=t).font.apply(r,[].concat(n)),h.apply(void 0,[].concat(n))},e.selectionCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.selection&&(r=t).selection.apply(r,[].concat(n)),A.apply(void 0,[].concat(n))},e.customElementCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r;t.customElement&&(r=t).customElement.apply(r,[].concat(n)),p.apply(void 0,[].concat(n))}}(e,t),e.recordDOM&&(n=Gl(e,e.doc));var r,o,s,a,c,l=function(e){var t=e.mousemoveCb,n=e.sampling,i=e.doc,r=e.mirror;if(!1===n.mousemove)return function(){};var o,s="number"==typeof n.mousemove?n.mousemove:50,a="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,c=[],l=hl(jl(function(e){var n=Date.now()-o;t(c.map(function(e){return e.timeOffset-=n,e}),e),c=[],o=null}),a),u=jl(hl(jl(function(e){var t=Xl(e),n=kl(e)?e.changedTouches[0]:e,i=n.clientX,s=n.clientY;o||(o=pl()),c.push({x:i,y:s,id:r.getId(t),timeOffset:pl()-o}),l("undefined"!=typeof DragEvent&&Se(e,DragEvent)?Ql.Drag:Se(e,MouseEvent)?Ql.MouseMove:Ql.TouchMove)}),s,{trailing:!1})),d=[ll("mousemove",u,i),ll("touchmove",u,i),ll("drag",u,i)];return jl(function(){d.forEach(function(e){return e()})})}(e),u=Wl(e),d=Jl(e),h=(r={win:i},o=e.viewportResizeCb,s=r.win,a=-1,c=-1,ll("resize",jl(hl(jl(function(){var e=fl(),t=gl();a===e&&c===t||(o({width:Number(t),height:Number(e)}),a=e,c=t)}),200)),s)),A=function(e){var t=e.inputCb,n=e.doc,i=e.mirror,r=e.blockClass,o=e.blockSelector,s=e.ignoreClass,a=e.ignoreSelector,c=e.maskInputOptions,l=e.maskInputFn,u=e.sampling,d=e.userTriggeredOnInput;function h(e){var t=Xl(e),i=e.isTrusted,u=t&&t.tagName;if(t&&"OPTION"===u&&(t=cl.parentElement(t)),t&&u&&!(_l.indexOf(u)<0)&&!bl(t,r,o,!0)&&!(t.classList.contains(s)||a&&t.matches(a))){var h=t.value,p=!1,m=rt(t)||"";"radio"===m||"checkbox"===m?p=t.checked:(c[u.toLowerCase()]||c[m])&&(h=tt({element:t,maskInputOptions:c,tagName:u,type:m,value:h,maskInputFn:l})),A(t,d?{text:h,isChecked:p,userTriggered:i}:{text:h,isChecked:p});var f=t.name;"radio"===m&&f&&p&&n.querySelectorAll('input[type="radio"][name="'+f+'"]').forEach(function(e){if(e!==t){var n=e.value;A(e,d?{text:n,isChecked:!p,userTriggered:!1}:{text:n,isChecked:!p})}})}}function A(e,n){var r=$l.get(e);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){$l.set(e,n);var o=i.getId(e);jl(t)(ke({},n,{id:o}))}}var p=("last"===u.input?["change"]:["input","change"]).map(function(e){return ll(e,jl(h),n)}),m=n.defaultView;if(!m)return function(){p.forEach(function(e){return e()})};var f,g=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&(f=p).push.apply(f,[].concat(y.map(function(e){return Al(e[0],e[1],{set:function(){jl(h)({target:this,isTrusted:!1})}},!1,m)}))),jl(function(){p.forEach(function(e){return e()})})}(e),p=function(e){var t=e.mediaInteractionCb,n=e.blockClass,i=e.blockSelector,r=e.mirror,o=e.sampling,s=e.doc,a=jl(function(e){return hl(jl(function(o){var s=Xl(o);if(s&&!bl(s,n,i,!0)){var a=s.currentTime,c=s.volume,l=s.muted,u=s.playbackRate,d=s.loop;t({type:e,id:r.getId(s),currentTime:a,volume:c,muted:l,playbackRate:u,loop:d})}}),o.media||500)}),c=[ll("play",a(Tl.Play),s),ll("pause",a(Tl.Pause),s),ll("seeked",a(Tl.Seeked),s),ll("volumechange",a(Tl.VolumeChange),s),ll("ratechange",a(Tl.RateChange),s)];return jl(function(){c.forEach(function(e){return e()})})}(e),m=function(){},f=function(){},g=function(){},y=function(){};e.recordDOM&&(m=function(e,t){var n=e.styleSheetRuleCb,i=e.mirror,r=e.stylesheetManager,o=t.win;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return function(){};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:jl(function(e,t,o){var s=o[0],a=o[1],c=tu(t,i,r.styleMirror),l=c.id,u=c.styleId;return(l&&-1!==l||u&&-1!==u)&&n({id:l,styleId:u,adds:[{rule:s,index:a}]}),e.apply(t,o)})}),o.CSSStyleSheet.prototype.addRule=function(e,t,n){void 0===n&&(n=this.cssRules.length);var i=e+" { "+t+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};var a,c,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:jl(function(e,t,o){var s=o[0],a=tu(t,i,r.styleMirror),c=a.id,l=a.styleId;return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,removes:[{index:s}]}),e.apply(t,o)})}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:jl(function(e,t,o){var s=o[0],a=tu(t,i,r.styleMirror),c=a.id,l=a.styleId;return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,replace:s}),e.apply(t,o)})})),o.CSSStyleSheet.prototype.replaceSync&&(c=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:jl(function(e,t,o){var s=o[0],a=tu(t,i,r.styleMirror),c=a.id,l=a.styleId;return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,replaceSync:s}),e.apply(t,o)})}));var u={};ou("CSSGroupingRule")?u.CSSGroupingRule=o.CSSGroupingRule:(ou("CSSMediaRule")&&(u.CSSMediaRule=o.CSSMediaRule),ou("CSSConditionRule")&&(u.CSSConditionRule=o.CSSConditionRule),ou("CSSSupportsRule")&&(u.CSSSupportsRule=o.CSSSupportsRule));var d={};return Object.entries(u).forEach(function(e){var t=e[0],o=e[1];d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:jl(function(e,t,o){var s=o[0],a=o[1],c=tu(t.parentStyleSheet,i,r.styleMirror),l=c.id,u=c.styleId;return(l&&-1!==l||u&&-1!==u)&&n({id:l,styleId:u,adds:[{rule:s,index:[].concat(eu(t),[a||0])}]}),e.apply(t,o)})}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:jl(function(e,t,o){var s=o[0],a=tu(t.parentStyleSheet,i,r.styleMirror),c=a.id,l=a.styleId;return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,removes:[{index:[].concat(eu(t),[s])}]}),e.apply(t,o)})})}),jl(function(){o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=l,a&&(o.CSSStyleSheet.prototype.replace=a),c&&(o.CSSStyleSheet.prototype.replaceSync=c),Object.entries(u).forEach(function(e){var t=e[0],n=e[1];n.prototype.insertRule=d[t].insertRule,n.prototype.deleteRule=d[t].deleteRule})})}(e,{win:i}),f=nu(e,e.doc),g=function(e,t){var n=e.styleDeclarationCb,i=e.mirror,r=e.ignoreCSSAttributes,o=e.stylesheetManager,s=t.win,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:jl(function(e,t,s){var c,l=s[0],u=s[1],d=s[2];if(r.has(l))return a.apply(t,[l,u,d]);var h=tu(null==(c=t.parentRule)?void 0:c.parentStyleSheet,i,o.styleMirror),A=h.id,p=h.styleId;return(A&&-1!==A||p&&-1!==p)&&n({id:A,styleId:p,set:{property:l,value:u,priority:d},index:eu(t.parentRule)}),e.apply(t,s)})});var c=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(c,{apply:jl(function(e,t,s){var a,l=s[0];if(r.has(l))return c.apply(t,[l]);var u=tu(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,o.styleMirror),d=u.id,h=u.styleId;return(d&&-1!==d||h&&-1!==h)&&n({id:d,styleId:h,remove:{property:l},index:eu(t.parentRule)}),e.apply(t,s)})}),jl(function(){s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=c})}(e,{win:i}),e.collectFonts&&(y=function(e){var t=e.fontCb,n=e.doc,i=n.defaultView;if(!i)return function(){};var r=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(e,t,n){var i=new s(e,t,n);return o.set(i,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var a=al(n.fonts,"add",function(e){return function(n){return setTimeout(jl(function(){var e=o.get(n);e&&(t(e),o.delete(n))}),0),e.apply(this,[n])}});return r.push(function(){i.FontFace=s}),r.push(a),jl(function(){r.forEach(function(e){return e()})})}(e)));for(var b,w=function(e){var t=e.doc,n=e.mirror,i=e.blockClass,r=e.blockSelector,o=e.selectionCb,s=!0,a=jl(function(){var e=t.getSelection();if(!(!e||s&&(null==e?void 0:e.isCollapsed))){s=e.isCollapsed||!1;for(var a=[],c=e.rangeCount||0,l=0;l<c;l++){var u=e.getRangeAt(l),d=u.startContainer,h=u.startOffset,A=u.endContainer,p=u.endOffset;bl(d,i,r,!0)||bl(A,i,r,!0)||a.push({start:n.getId(d),startOffset:h,end:n.getId(A),endOffset:p})}o({ranges:a})}});return a(),ll("selectionchange",a)}(e),v=function(e){var t=e.doc,n=e.customElementCb,i=t.defaultView;return i&&i.customElements?al(i.customElements,"define",function(e){return function(t,i,r){try{n({define:{name:t}})}catch(o){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,i,r])}}):function(){}}(e),k=[],x=Qe(e.plugins);!(b=x()).done;){var C=b.value;k.push(C.observer(C.callback,i,C.options))}return jl(function(){Zl.forEach(function(e){return e.reset()}),null==n||n.disconnect(),l(),u(),d(),h(),A(),p(),m(),f(),g(),y(),w(),v(),k.forEach(function(e){return e()})})}function ru(e){return void 0!==window[e]}function ou(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var su=function(){function e(e){Le(this,"iframeIdToRemoteIdMap",new WeakMap),Le(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}var t=e.prototype;return t.getId=function(e,t,n,i){var r=n||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e),s=r.get(t);return s||(s=this.generateIdFn(),r.set(t,s),o.set(s,t)),s},t.getIds=function(e,t){var n=this,i=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(function(t){return n.getId(e,t,i,r)})},t.getRemoteId=function(e,t,n){var i=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var r=i.get(t);return r||-1},t.getRemoteIds=function(e,t){var n=this,i=this.getRemoteIdToIdMap(e);return t.map(function(t){return n.getRemoteId(e,t,i)})},t.reset=function(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)},t.getIdToRemoteIdMap=function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t},t.getRemoteIdToIdMap=function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t},e}(),au=function(){function e(e){Le(this,"iframes",new WeakMap),Le(this,"crossOriginIframeMap",new WeakMap),Le(this,"crossOriginIframeMirror",new su(gt)),Le(this,"crossOriginIframeStyleMirror"),Le(this,"crossOriginIframeRootIdMap",new WeakMap),Le(this,"mirror"),Le(this,"mutationCb"),Le(this,"wrappedEmit"),Le(this,"loadListener"),Le(this,"stylesheetManager"),Le(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new su(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}var t=e.prototype;return t.addIframe=function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)},t.addLoadListener=function(e){this.loadListener=e},t.attachIframe=function(e,t){var n,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))},t.handleMessage=function(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var i=this.transformCrossOriginEvent(n,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}},t.transformCrossOriginEvent=function(e,t){var n,i=this;switch(t.type){case Dl.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:Dl.IncrementalSnapshot,data:{source:Ql.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Dl.Meta:case Dl.Load:case Dl.DomContentLoaded:return!1;case Dl.Plugin:return t;case Dl.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Dl.IncrementalSnapshot:switch(t.data.source){case Ql.Mutation:return t.data.adds.forEach(function(t){i.replaceIds(t,e,["parentId","nextId","previousId"]),i.replaceIdOnNode(t.node,e);var n=i.crossOriginIframeRootIdMap.get(e);n&&i.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(function(t){i.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(function(t){i.replaceIds(t,e,["id"])}),t.data.texts.forEach(function(t){i.replaceIds(t,e,["id"])}),t;case Ql.Drag:case Ql.TouchMove:case Ql.MouseMove:return t.data.positions.forEach(function(t){i.replaceIds(t,e,["id"])}),t;case Ql.ViewportResize:return!1;case Ql.MediaInteraction:case Ql.MouseInteraction:case Ql.Scroll:case Ql.CanvasMutation:case Ql.Input:return this.replaceIds(t.data,e,["id"]),t;case Ql.StyleSheetRule:case Ql.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Ql.Font:return t;case Ql.Selection:return t.data.ranges.forEach(function(t){i.replaceIds(t,e,["start","end"])}),t;case Ql.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach(function(t){i.replaceStyleIds(t,e,["styleId"])}),t}}return!1},t.replace=function(e,t,n,i){for(var r,o=Qe(i);!(r=o()).done;){var s=r.value;(Array.isArray(t[s])||"number"==typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(n,t[s]):t[s]=e.getId(n,t[s]))}return t},t.replaceIds=function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)},t.replaceStyleIds=function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)},t.replaceIdOnNode=function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(function(e){n.replaceIdOnNode(e,t)})},t.patchRootIdOnNode=function(e,t){var n=this;e.type===Ll.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(function(e){n.patchRootIdOnNode(e,t)})},e}(),cu=function(){function e(e){Le(this,"shadowDoms",new WeakSet),Le(this,"mutationCb"),Le(this,"scrollCb"),Le(this,"bypassOptions"),Le(this,"mirror"),Le(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}var t=e.prototype;return t.init=function(){this.reset(),this.patchAttachShadow(Element,document)},t.addShadowRoot=function(e,t){var n=this;if(Je(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var i=Gl(ke({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(function(){return i.disconnect()}),this.restoreHandlers.push(Jl(ke({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&n.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,n.mirror.getId(cl.host(e))),n.restoreHandlers.push(nu({mirror:n.mirror,stylesheetManager:n.bypassOptions.stylesheetManager},e))},0)}},t.observeAttachShadow=function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)},t.patchAttachShadow=function(e,t){var n=this;this.restoreHandlers.push(al(e.prototype,"attachShadow",function(e){return function(i){var r=e.call(this,i),o=cl.shadowRoot(this);return o&&Ml(this)&&n.addShadowRoot(o,t),r}}))},t.reset=function(){this.restoreHandlers.forEach(function(e){try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet},e}(),lu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",uu="undefined"==typeof Uint8Array?[]:new Uint8Array(256),du=0;du<64;du++)uu[lu.charCodeAt(du)]=du;var hu=new Map;var Au=function(e,t,n){if(e&&(fu(e,t)||"object"===(void 0===e?"undefined":Ee(e)))){var i=function(e,t){var n=hu.get(e);return n||(n=new Map,hu.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),r=i.indexOf(e);return-1===r&&(r=i.length,i.push(e)),r}};function pu(e,t,n){if(Se(e,Array))return e.map(function(e){return pu(e,t,n)});if(null===e)return e;if(Se(e,Float32Array)||Se(e,Float64Array)||Se(e,Int32Array)||Se(e,Uint32Array)||Se(e,Uint8Array)||Se(e,Uint16Array)||Se(e,Int16Array)||Se(e,Int8Array)||Se(e,Uint8ClampedArray))return{rr_type:e.constructor.name,args:[Object.values(e)]};if(Se(e,ArrayBuffer))return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),i=n.length,r="";for(t=0;t<i;t+=3)r+=lu[n[t]>>2],r+=lu[(3&n[t])<<4|n[t+1]>>4],r+=lu[(15&n[t+1])<<2|n[t+2]>>6],r+=lu[63&n[t+2]];return i%3==2?r=r.substring(0,r.length-1)+"=":i%3==1&&(r=r.substring(0,r.length-2)+"=="),r}(e)};if(Se(e,DataView))return{rr_type:e.constructor.name,args:[pu(e.buffer,t,n),e.byteOffset,e.byteLength]};if(Se(e,HTMLImageElement))return{rr_type:e.constructor.name,src:e.src};if(Se(e,HTMLCanvasElement)){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return Se(e,ImageData)?{rr_type:e.constructor.name,args:[pu(e.data,t,n),e.width,e.height]}:fu(e,t)||"object"===(void 0===e?"undefined":Ee(e))?{rr_type:e.constructor.name,index:Au(e,t,n)}:e}var mu=function(e,t,n){return e.map(function(e){return pu(e,t,n)})},fu=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(function(e){return"function"==typeof t[e]});return Boolean(n.find(function(n){return Se(e,t[n])}))};function gu(e,t,n,i){var r=[];try{var o=al(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!bl(this,t,n,!0)){var c=function(e){return"experimental-webgl"===e?"webgl":e}(r);if("__context"in this||(this.__context=c),i&&["webgl","webgl2"].includes(c))if(s[0]&&"object"===Ee(s[0])){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[].concat([r],s))}});r.push(o)}catch(s){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){r.forEach(function(e){return e()})}}function yu(e,t,n,i,r,o){for(var s,a=function(){var a=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return"continue";try{if("function"!=typeof e[a])return"continue";var l=al(e,a,function(e){return function(){for(var s=arguments.length,c=new Array(s),l=0;l<s;l++)c[l]=arguments[l];var u=e.apply(this,c);if(Au(u,o,this),"tagName"in this.canvas&&!bl(this.canvas,i,r,!0)){var d=mu(c,o,this),h={type:t,property:a,args:d};n(this.canvas,h)}return u}});c.push(l)}catch(d){var u=Al(e,a,{set:function(e){n(this.canvas,{type:t,property:a,args:[e],setter:!0})}});c.push(u)}},c=[],l=Qe(Object.getOwnPropertyNames(e));!(s=l()).done;)a();return c}var bu,wu="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",vu="undefined"!=typeof window&&window.Blob&&new Blob([(bu=wu,Uint8Array.from(atob(bu),function(e){return e.charCodeAt(0)}))],{type:"text/javascript;charset=utf-8"});function ku(e){var t;try{if(!(t=vu&&(window.URL||window.webkitURL).createObjectURL(vu)))throw"";var n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",function(){(window.URL||window.webkitURL).revokeObjectURL(t)}),n}catch(i){return new Worker("data:text/javascript;base64,"+wu,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var xu,Cu,Su,Bu=function(){function e(e){var t=this;Le(this,"pendingCanvasMutations",new Map),Le(this,"rafStamps",{latestId:0,invokeId:null}),Le(this,"mirror"),Le(this,"mutationCb"),Le(this,"resetObservers"),Le(this,"frozen",!1),Le(this,"locked",!1),Le(this,"processMutation",function(e,n){!(t.rafStamps.invokeId&&t.rafStamps.latestId!==t.rafStamps.invokeId)&&t.rafStamps.invokeId||(t.rafStamps.invokeId=t.rafStamps.latestId),t.pendingCanvasMutations.has(e)||t.pendingCanvasMutations.set(e,[]),t.pendingCanvasMutations.get(e).push(n)});var n=e.sampling,i=void 0===n?"all":n,r=e.win,o=e.blockClass,s=e.blockSelector,a=e.recordCanvas,c=e.dataURLOptions;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&"all"===i&&this.initCanvasMutationObserver(r,o,s),a&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,o,s,{dataURLOptions:c})}var t=e.prototype;return t.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},t.freeze=function(){this.frozen=!0},t.unfreeze=function(){this.frozen=!1},t.lock=function(){this.locked=!0},t.unlock=function(){this.locked=!1},t.initCanvasFPSObserver=function(e,t,n,i,r){var o=this,s=gu(t,n,i,!0),a=new Map,c=new ku;c.onmessage=function(e){var t=e.data.id;if(a.set(t,!1),"base64"in e.data){var n=e.data,i=n.base64,r=n.type,s=n.width,c=n.height;o.mutationCb({id:t,type:Nl["2D"],commands:[{property:"clearRect",args:[0,0,s,c]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i}],type:r}]},0,0]}]})}};var l,u=1e3/e,d=0,h=function(e){if(d&&e-d<u)l=requestAnimationFrame(h);else{d=e;var s,A=o;(s=[],t.document.querySelectorAll("canvas").forEach(function(e){bl(e,n,i,!0)||s.push(e)}),s).forEach(be(function(e){var t,n,i,o;return Ue(this,function(s){switch(s.label){case 0:return n=A.mirror.getId(e),a.get(n)?[2]:0===e.width||0===e.height?[2]:(a.set(n,!0),["webgl","webgl2"].includes(e.__context)&&(i=e.getContext(e.__context),!1===(null==(t=null==i?void 0:i.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)),[4,createImageBitmap(e)]);case 1:return o=s.sent(),c.postMessage({id:n,bitmap:o,width:e.width,height:e.height,dataURLOptions:r.dataURLOptions},[o]),[2]}})})),l=requestAnimationFrame(h)}};l=requestAnimationFrame(h),this.resetObservers=function(){s(),cancelAnimationFrame(l)}},t.initCanvasMutationObserver=function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=gu(e,t,n,!1),r=function(e,t,n,i){for(var r,o=function(){var o=r.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return"continue";var a=al(t.CanvasRenderingContext2D.prototype,o,function(r){return function(){for(var s=this,a=arguments.length,c=new Array(a),l=0;l<a;l++)c[l]=arguments[l];return bl(this.canvas,n,i,!0)||setTimeout(function(){var n=mu(c,t,s);e(s.canvas,{type:Nl["2D"],property:o,args:n})},0),r.apply(this,c)}});s.push(a)}catch(l){var c=Al(t.CanvasRenderingContext2D.prototype,o,{set:function(t){e(this.canvas,{type:Nl["2D"],property:o,args:[t],setter:!0})}});s.push(c)}},s=[],a=Qe(Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype));!(r=a()).done;)o();return function(){s.forEach(function(e){return e()})}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,i){var r,o,s=[];return(r=s).push.apply(r,[].concat(yu(t.WebGLRenderingContext.prototype,Nl.WebGL,e,n,i,t))),void 0!==t.WebGL2RenderingContext&&(o=s).push.apply(o,[].concat(yu(t.WebGL2RenderingContext.prototype,Nl.WebGL2,e,n,i,t))),function(){s.forEach(function(e){return e()})}}(this.processMutation.bind(this),e,t,n);this.resetObservers=function(){i(),r(),o()}},t.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},t.startRAFTimestamping=function(){var e=this,t=function(n){e.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)},t.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach(function(t,n){var i=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,i)}),requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},t.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var i=n.map(function(e){return e.type,Be(e,["type"])}),r=n[0].type;this.mutationCb({id:t,type:r,commands:i}),this.pendingCanvasMutations.delete(e)}}},e}(),Iu=function(){function e(e){Le(this,"trackedLinkElements",new WeakSet),Le(this,"mutationCb"),Le(this,"adoptedStyleSheetCb"),Le(this,"styleMirror",new Bl),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}var t=e.prototype;return t.attachLinkElement=function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)},t.trackLinkElement=function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))},t.adoptStyleSheets=function(e,t){var n,i=function(){var e=r.value,t=void 0;n.styleMirror.has(e)?t=n.styleMirror.getId(e):(t=n.styleMirror.add(e),s.push({styleId:t,rules:Array.from(e.rules||CSSRule,function(t,n){return{rule:$e(t,e.href),index:n}})})),o.styleIds.push(t)};if(0!==e.length){for(var r,o={id:t,styleIds:[]},s=[],a=Qe(e);!(r=a()).done;)n=this,i();s.length>0&&(o.styles=s),this.adoptedStyleSheetCb(o)}},t.reset=function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet},t.trackStylesheetInLinkElement=function(e){},e}(),Eu=function(){function e(){Le(this,"nodeMap",new WeakMap),Le(this,"active",!1)}var t=e.prototype;return t.inOtherBuffer=function(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some(function(e){return e!==t})},t.add=function(e,t){var n=this;this.active||(this.active=!0,requestAnimationFrame(function(){n.nodeMap=new WeakMap,n.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))},t.destroy=function(){},e}(),Mu=!1;try{if(2!==Array.from([1],function(e){return 2*e})[0]){var Du=document.createElement("iframe");document.body.appendChild(Du),Array.from=(null==(Ne=Du.contentWindow)?void 0:Ne.Array.from)||Array.from,document.body.removeChild(Du)}}catch(wU){}var Qu,Uu,Fu=new et;function Nu(e){void 0===e&&(e={});var t=e.emit,n=e.checkoutEveryNms,i=e.checkoutEveryNth,r=e.blockClass,o=void 0===r?"rr-block":r,s=e.blockSelector,a=void 0===s?null:s,c=e.ignoreClass,l=void 0===c?"rr-ignore":c,u=e.ignoreSelector,d=void 0===u?null:u,h=e.maskTextClass,A=void 0===h?"rr-mask":h,p=e.maskTextSelector,m=void 0===p?null:p,f=e.inlineStylesheet,g=void 0===f||f,y=e.maskAllInputs,b=e.maskInputOptions,w=e.slimDOMOptions,v=e.maskInputFn,k=e.maskTextFn,x=e.hooks,C=e.packFn,S=e.sampling,B=void 0===S?{}:S,I=e.dataURLOptions,E=void 0===I?{}:I,M=e.mousemoveWait,D=e.recordDOM,Q=void 0===D||D,U=e.recordCanvas,F=void 0!==U&&U,N=e.recordCrossOriginIframes,T=void 0!==N&&N,L=e.recordAfter,P=void 0===L?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":L,O=e.userTriggeredOnInput,R=void 0!==O&&O,z=e.collectFonts,q=void 0!==z&&z,Y=e.inlineImages,K=void 0!==Y&&Y,H=e.plugins,V=e.keepIframeSrcFn,j=void 0===V?function(){return!1}:V,Z=e.ignoreCSSAttributes,X=void 0===Z?new Set([]):Z,G=e.errorHandler;Ol=G;var W=!T||window.parent===window,J=!1;if(!W)try{window.parent.document&&(J=!1)}catch(ge){J=!0}if(W&&!t)throw new Error("emit function is required");if(!W&&!J)return function(){};void 0!==M&&void 0===B.mousemove&&(B.mousemove=M),Fu.reset();var _,$,ee=!0===y?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0,hidden:!0}:void 0!==b?b:{password:!0},te=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w,headTitleMutations:"all"===w}:w||{};void 0===_&&(_=window),"NodeList"in _&&!_.NodeList.prototype.forEach&&(_.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in _&&!_.DOMTokenList.prototype.forEach&&(_.DOMTokenList.prototype.forEach=Array.prototype.forEach);var ne=0,ie=function(e){for(var t,n=Qe(H||[]);!(t=n()).done;){var i=t.value;i.eventProcessor&&(e=i.eventProcessor(e))}return C&&!J&&(e=C(e)),e};xu=function(e,r){var o,s=e;if(s.timestamp=pl(),!(null==(o=Zl[0])?void 0:o.isFrozen())||s.type===Dl.FullSnapshot||s.type===Dl.IncrementalSnapshot&&s.data.source===Ql.Mutation||Zl.forEach(function(e){return e.unfreeze()}),W)null==t||t(ie(s),r);else if(J){var a={type:"rrweb",event:ie(s),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(s.type===Dl.FullSnapshot)$=s,ne=0;else if(s.type===Dl.IncrementalSnapshot){if(s.data.source===Ql.Mutation&&s.data.isAttachIframe)return;ne++;var c=i&&ne>=i,l=n&&s.timestamp-$.timestamp>n;(c||l)&&Cu(!0)}};for(var re,oe=function(e){xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.Mutation},e)})},se=function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.Scroll},e)})},ae=function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.CanvasMutation},e)})},ce=new Iu({mutationCb:oe,adoptedStyleSheetCb:function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.AdoptedStyleSheet},e)})}}),le=new au({mirror:Fu,mutationCb:oe,stylesheetManager:ce,recordCrossOriginIframes:T,wrappedEmit:xu}),ue=Qe(H||[]);!(re=ue()).done;){var de=re.value;de.getMirror&&de.getMirror({nodeMirror:Fu,crossOriginIframeMirror:le.crossOriginIframeMirror,crossOriginIframeStyleMirror:le.crossOriginIframeStyleMirror})}var he=new Eu;Su=new Bu({recordCanvas:F,mutationCb:ae,win:window,blockClass:o,blockSelector:a,mirror:Fu,sampling:B.canvas,dataURLOptions:E});var Ae=new cu({mutationCb:oe,scrollCb:se,bypassOptions:{blockClass:o,blockSelector:a,maskTextClass:A,maskTextSelector:m,inlineStylesheet:g,maskInputOptions:ee,dataURLOptions:E,maskTextFn:k,maskInputFn:v,recordCanvas:F,inlineImages:K,sampling:B,slimDOMOptions:te,iframeManager:le,stylesheetManager:ce,canvasManager:Su,keepIframeSrcFn:j,processedNodeManager:he},mirror:Fu});Cu=function(e){if(void 0===e&&(e=!1),Q){xu({type:Dl.Meta,data:{href:window.location.href,width:gl(),height:fl()}},e),ce.reset(),Ae.init(),Zl.forEach(function(e){return e.lock()});var t=function(e,t){var n=t||{},i=n.mirror,r=void 0===i?new et:i,o=n.blockClass,s=void 0===o?"rr-block":o,a=n.blockSelector,c=void 0===a?null:a,l=n.maskTextClass,u=void 0===l?"rr-mask":l,d=n.maskTextSelector,h=void 0===d?null:d,A=n.inlineStylesheet,p=void 0===A||A,m=n.inlineImages,f=void 0!==m&&m,g=n.recordCanvas,y=void 0!==g&&g,b=n.maskAllInputs,w=void 0!==b&&b,v=n.maskTextFn,k=n.maskInputFn,x=n.slimDOM,C=void 0!==x&&x,S=n.dataURLOptions,B=n.preserveWhiteSpace,I=n.onSerialize,E=n.onIframeLoad,M=n.iframeLoadTimeout,D=n.onStylesheetLoad,Q=n.stylesheetLoadTimeout,U=n.keepIframeSrcFn;return Dt(e,{doc:e,mirror:r,blockClass:s,blockSelector:c,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===w?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0,hidden:!0}:!1===w?{password:!0}:w,maskTextFn:v,maskInputFn:k,slimDOMOptions:!0===C||"all"===C?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===C,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===C?{}:C,dataURLOptions:S,inlineImages:f,recordCanvas:y,preserveWhiteSpace:B,onSerialize:I,onIframeLoad:E,iframeLoadTimeout:M,onStylesheetLoad:D,stylesheetLoadTimeout:Q,keepIframeSrcFn:void 0===U?function(){return!1}:U,newlyAddedElement:!1})}(document,{mirror:Fu,blockClass:o,blockSelector:a,maskTextClass:A,maskTextSelector:m,inlineStylesheet:g,maskAllInputs:ee,maskTextFn:k,maskInputFn:v,slimDOM:te,dataURLOptions:E,recordCanvas:F,inlineImages:K,onSerialize:function(e){xl(e,Fu)&&le.addIframe(e),Cl(e,Fu)&&ce.trackLinkElement(e),Sl(e)&&Ae.addShadowRoot(cl.shadowRoot(e),document)},onIframeLoad:function(e,t){le.attachIframe(e,t),Ae.observeAttachShadow(e)},onStylesheetLoad:function(e,t){ce.attachLinkElement(e,t)},keepIframeSrcFn:j});if(!t)return console.warn("Failed to snapshot the document");xu({type:Dl.FullSnapshot,data:{node:t,initialOffset:ml(window)}},e),Zl.forEach(function(e){return e.unlock()}),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ce.adoptStyleSheets(document.adoptedStyleSheets,Fu.getId(document))}};try{var pe=[],me=function(e){var t;return jl(iu)({mutationCb:oe,mousemoveCb:function(e,t){return xu({type:Dl.IncrementalSnapshot,data:{source:t,positions:e}})},mouseInteractionCb:function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.MouseInteraction},e)})},scrollCb:se,viewportResizeCb:function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.ViewportResize},e)})},inputCb:function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.Input},e)})},mediaInteractionCb:function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.MediaInteraction},e)})},styleSheetRuleCb:function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.StyleSheetRule},e)})},styleDeclarationCb:function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.StyleDeclaration},e)})},canvasMutationCb:ae,fontCb:function(e){return xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.Font},e)})},selectionCb:function(e){xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.Selection},e)})},customElementCb:function(e){xu({type:Dl.IncrementalSnapshot,data:ke({source:Ql.CustomElement},e)})},blockClass:o,ignoreClass:l,ignoreSelector:d,maskTextClass:A,maskTextSelector:m,maskInputOptions:ee,inlineStylesheet:g,sampling:B,recordDOM:Q,recordCanvas:F,inlineImages:K,userTriggeredOnInput:R,collectFonts:q,doc:e,maskInputFn:v,maskTextFn:k,keepIframeSrcFn:j,blockSelector:a,slimDOMOptions:te,dataURLOptions:E,mirror:Fu,iframeManager:le,stylesheetManager:ce,shadowDomManager:Ae,processedNodeManager:he,canvasManager:Su,ignoreCSSAttributes:X,plugins:(null==(t=null==H?void 0:H.filter(function(e){return e.observer}))?void 0:t.map(function(e){return{observer:e.observer,options:e.options,callback:function(t){return xu({type:Dl.Plugin,data:{plugin:e.name,payload:t}})}}}))||[]},x)};le.addLoadListener(function(e){try{pe.push(me(e.contentDocument))}catch(gd){console.warn(gd)}});var fe=function(){Cu(),pe.push(me(document)),Mu=!0};return"interactive"===document.readyState||"complete"===document.readyState?fe():(pe.push(ll("DOMContentLoaded",function(){xu({type:Dl.DomContentLoaded,data:{}}),"DOMContentLoaded"===P&&fe()})),pe.push(ll("load",function(){xu({type:Dl.Load,data:{}}),"load"===P&&fe()},window))),function(){pe.forEach(function(e){try{e()}catch(gd){String(gd).toLowerCase().includes("cross-origin")||console.warn(gd)}}),he.destroy(),Mu=!1,Ol=void 0}}catch(gd){console.warn(gd)}}Nu.addCustomEvent=function(e,t){if(!Mu)throw new Error("please add custom event after start recording");xu({type:Dl.Custom,data:{tag:e,payload:t}})},Nu.freezePage=function(){Zl.forEach(function(e){return e.freeze()})},Nu.takeFullSnapshot=function(e){if(!Mu)throw new Error("please take full snapshot after start recording");Cu(e)},Nu.mirror=Fu,(Uu=Qu||(Qu={}))[Uu.NotStarted=0]="NotStarted",Uu[Uu.Running=1]="Running",Uu[Uu.Stopped=2]="Stopped",Nu.addCustomEvent,Nu.freezePage,Nu.takeFullSnapshot;var Tu=Object.defineProperty,Lu=function(e,t,n){return function(e,t,n){return t in e?Tu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":Ee(t))?t+"":t,n)};var Pu=function(){function e(e){Lu(this,"fileName"),Lu(this,"functionName"),Lu(this,"lineNumber"),Lu(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}return e.prototype.toString=function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t},e}(),Ou=/(^|@)\S+:\d+/,Ru=/^\s*at .*(\S+:\d+|\(native\))/m,zu=/^(eval@)?(\[native code])?$/,qu={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Ru)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Ru)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),r=this.extractLocation(n?n[1]:i.pop()),o=i.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0];return new Pu({functionName:o,fileName:s,lineNumber:r[1],columnNumber:r[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(zu)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Pu({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),i=n&&n[1]?n[1]:void 0,r=this.extractLocation(e.replace(t,""));return new Pu({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),i=[],r=2,o=n.length;r<o;r+=2){var s=t.exec(n[r]);s&&i.push(new Pu({fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),i=[],r=0,o=n.length;r<o;r+=2){var s=t.exec(n[r]);s&&i.push(new Pu({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Ou)&&!e.match(/^Error created at/)},this).map(function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Pu({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Yu(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var i=e.parentElement,r=[];if(i.children&&i.children.length>0)for(var o=0;o<i.children.length;o++){var s=i.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===n&&r.push(s)}r.length>1&&(n+=":eq("+r.indexOf(e)+")"),t=n+(t?">"+t:""),e=i}return t}function Ku(e){return"[object Object]"===Object.prototype.toString.call(e)}function Hu(e,t){if(0===t)return!0;for(var n,i=Qe(Object.keys(e));!(n=i()).done;){var r=n.value;if(Ku(e[r])&&Hu(e[r],t-1))return!0}return!1}function Vu(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var i=[],r=[];return JSON.stringify(e,function(e,t){if(i.length>0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?r.splice(o,1/0,e):r.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Ku(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ku(e)&&Hu(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=t.slice(0,n.stringLengthLimit)+"...");return t}(t);if("bigint"===(void 0===t?"undefined":Ee(t)))return t.toString()+"n";if(Se(t,Event)){var s={};for(var a in t){var c=t[a];Array.isArray(c)?s[a]=Yu(c.length?c[0]:null):s[a]=c}return s}return Se(t,Node)?Se(t,HTMLElement)?t?t.outerHTML:"":t.nodeName:Se(t,Error)?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t})}var ju={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Zu(e,t,n){var i,r=n?Object.assign({},ju,n):ju,o=r.logger;if(!o)return function(){};i="string"==typeof o?t[o]:o;var s=0,a=!1,c=[];if(r.level.includes("error")){var l=function(t){var n=t.message,i=t.error,o=qu.parse(i).map(function(e){return e.toString()}),s=[Vu(n,r.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",l),c.push(function(){t.removeEventListener("error",l)});var u=function(t){var n,i;Se(t.reason,Error)?i=[Vu("Uncaught (in promise) "+(n=t.reason).name+": "+n.message,r.stringifyOptions)]:(n=new Error,i=[Vu("Uncaught (in promise)",r.stringifyOptions),Vu(t.reason,r.stringifyOptions)]);var o=qu.parse(n).map(function(e){return e.toString()});e({level:"error",trace:o,payload:i})};t.addEventListener("unhandledrejection",u),c.push(function(){t.removeEventListener("unhandledrejection",u)})}for(var d,h=Qe(r.level);!(d=h()).done;){var A=d.value;c.push(p(i,A))}return function(){c.forEach(function(e){return e()})};function p(t,n){var i=this;return t[n]?function(e,t,n){try{if(!(t in e))return function(){};var i=e[t],r=n(i);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=r,function(){e[t]=i}}catch(o){return function(){}}}(t,n,function(t){var o=i;return function(){for(var i=arguments.length,c=new Array(i),l=0;l<i;l++)c[l]=arguments[l];if(t.apply(o,c),!("assert"===n&&c[0]||a)){a=!0;try{var u=qu.parse(new Error).map(function(e){return e.toString()}).splice(1),d=("assert"===n?c.slice(1):c).map(function(e){return Vu(e,r.stringifyOptions)});++s<r.lengthThreshold?e({level:n,trace:u,payload:d}):s===r.lengthThreshold&&e({level:"warn",trace:[],payload:[Vu("The number of log records reached the threshold.")]})}catch(gd){t.apply(void 0,[].concat(["rrweb logger error:",gd],c))}finally{a=!1}}}}):function(){}}}var Xu,Gu,Wu,Ju=me.setImmediate,_u=Object.prototype.toString,$u=void 0!==Ju?function(e){return Ju(e)}:setTimeout;try{Object.defineProperty({},"x",{}),Xu=function(e,t,n,i){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:!1!==i})}}catch(wU){Xu=function(e,t,n){return e[t]=n,e}}function ed(e,t){Wu.add(e,t),Gu||(Gu=$u(Wu.drain))}function td(e){var t,n=typeof e;return null===e||"object"!==n&&"function"!==n||(t=e.then),"function"==typeof t&&t}function nd(){for(var e=0;e<this.chain.length;e++)id(this,1===this.state?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function id(e,t,n){var i,r;try{!1===t?n.reject(e.msg):(i=!0===t?e.msg:t.call(void 0,e.msg))===n.promise?n.reject(TypeError("Promise-chain cycle")):(r=td(i))?r.call(i,n.resolve,n.reject):n.resolve(i)}catch(wU){n.reject(wU)}}function rd(e){var t,n=this;if(!n.triggered){n.triggered=!0,n.def&&(n=n.def);try{(t=td(e))?ed(function(){var i=new ad(n);try{t.call(e,function(){rd.apply(i,arguments)},function(){od.apply(i,arguments)})}catch(wU){od.call(i,wU)}}):(n.msg=e,n.state=1,n.chain.length>0&&ed(nd,n))}catch(wU){od.call(new ad(n),wU)}}}function od(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&ed(nd,t))}function sd(e,t,n,i){for(var r=0;r<t.length;r++)(function(r){e.resolve(t[r]).then(function(e){n(r,e)},i)})(r)}function ad(e){this.def=e,this.triggered=!1}function cd(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function ld(e){if("function"!=typeof e)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var t=new cd(this);this.then=function(e,n){var i={success:"function"!=typeof e||e,failure:"function"==typeof n&&n};return i.promise=new this.constructor(function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");i.resolve=e,i.reject=t}),t.chain.push(i),0!==t.state&&ed(nd,t),i.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){rd.call(t,e)},function(e){od.call(t,e)})}catch(wU){od.call(t,wU)}}Wu=function(){var e,t,n;function i(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(r,o){n=new i(r,o),t?t.next=n:e=n,t=n,n=void 0},drain:function(){var n=e;for(e=t=Gu=void 0;n;)n.fn.call(n.self),n=n.next}}}();var ud,dd=Xu({},"constructor",ld,!1);ld.prototype=dd,Xu(dd,"__NPO__",0,!1),Xu(ld,"resolve",function(e){return e&&"object"==typeof e&&1===e.__NPO__?e:new this(function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");t(e)})}),Xu(ld,"reject",function(e){return new this(function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");n(e)})}),Xu(ld,"all",function(e){var t=this;return"[object Array]"!==_u.call(e)?t.reject(TypeError("Not an array")):0===e.length?t.resolve([]):new t(function(n,i){if("function"!=typeof n||"function"!=typeof i)throw TypeError("Not a function");var r=e.length,o=Array(r),s=0;sd(t,e,function(e,t){o[e]=t,++s===r&&n(o)},i)})}),Xu(ld,"race",function(e){var t=this;return"[object Array]"!==_u.call(e)?t.reject(TypeError("Not an array")):new t(function(n,i){if("function"!=typeof n||"function"!=typeof i)throw TypeError("Not a function");sd(t,e,function(e,t){n(t)},i)})}),ud="undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")?Promise:ld;var hd,Ad,pd,md,fd,gd,yd,bd,wd,vd,kd={DEBUG:!1,LIB_VERSION:"2.73.0"},xd=864e5,Cd=8e3,Sd=Array.prototype,Bd=Function.prototype,Id=Object.prototype,Ed=Sd.slice,Md=Id.toString,Dd=Id.hasOwnProperty,Qd=me.console,Ud=me.navigator,Fd=me.document,Nd=me.opera,Td=me.screen,Ld=Ud.userAgent,Pd=Bd.bind,Od=Sd.forEach,Rd=Sd.indexOf,zd=Sd.map,qd=Array.isArray,Yd={},Kd={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},Hd={log:function(){if(kd.DEBUG&&!Kd.isUndefined(Qd)&&Qd)try{Qd.log.apply(Qd,arguments)}catch(wU){Kd.each(arguments,function(e){Qd.log(e)})}},warn:function(){if(kd.DEBUG&&!Kd.isUndefined(Qd)&&Qd){var e=["Mixpanel warning:"].concat(Kd.toArray(arguments));try{Qd.warn.apply(Qd,e)}catch(wU){Kd.each(e,function(e){Qd.warn(e)})}}},error:function(){if(kd.DEBUG&&!Kd.isUndefined(Qd)&&Qd){var e=["Mixpanel error:"].concat(Kd.toArray(arguments));try{Qd.error.apply(Qd,e)}catch(wU){Kd.each(e,function(e){Qd.error(e)})}}},critical:function(){if(!Kd.isUndefined(Qd)&&Qd){var e=["Mixpanel error:"].concat(Kd.toArray(arguments));try{Qd.error.apply(Qd,e)}catch(wU){Kd.each(e,function(e){Qd.error(e)})}}}},Vd=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(Hd,arguments)}},jd=function(e){return{log:Vd(Hd.log,e),error:Vd(Hd.error,e),critical:Vd(Hd.critical,e)}},Zd=function(e){return function(){try{return e.apply(this,arguments)}catch(t){Hd.critical("Implementation error. Please turn on debug and contact support@mixpanel.com."),kd.DEBUG&&Hd.critical(t)}}},Xd=function(e){var t=e.prototype;for(var n in t)"function"==typeof t[n]&&(t[n]=Zd(t[n]))};Kd.bind=function(e,t){var n,i;if(Pd&&e.bind===Pd)return Pd.apply(e,Ed.call(arguments,1));if(!Kd.isFunction(e))throw new TypeError;return n=Ed.call(arguments,2),i=function(){if(!(this instanceof i))return e.apply(t,n.concat(Ed.call(arguments)));var r={};r.prototype=e.prototype;var o=new r;r.prototype=null;var s=e.apply(o,n.concat(Ed.call(arguments)));return Object(s)===s?s:o},i},Kd.each=function(e,t,n){if(null!=e)if(Od&&e.forEach===Od)e.forEach(t,n);else if(e.length===+e.length){for(var i=0,r=e.length;i<r;i++)if(i in e&&t.call(n,e[i],i,e)===Yd)return}else for(var o in e)if(Dd.call(e,o)&&t.call(n,e[o],o,e)===Yd)return},Kd.extend=function(e){return Kd.each(Ed.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},Kd.isArray=qd||function(e){return"[object Array]"===Md.call(e)},Kd.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(t){return!1}},Kd.isArguments=function(e){return!(!e||!Dd.call(e,"callee"))},Kd.toArray=function(e){return e?e.toArray?e.toArray():Kd.isArray(e)||Kd.isArguments(e)?Ed.call(e):Kd.values(e):[]},Kd.map=function(e,t,n){if(zd&&e.map===zd)return e.map(t,n);var i=[];return Kd.each(e,function(e){i.push(t.call(n,e))}),i},Kd.keys=function(e){var t=[];return null===e||Kd.each(e,function(e,n){t[t.length]=n}),t},Kd.values=function(e){var t=[];return null===e||Kd.each(e,function(e){t[t.length]=e}),t},Kd.include=function(e,t){var n=!1;return null===e?n:Rd&&e.indexOf===Rd?-1!=e.indexOf(t):(Kd.each(e,function(e){if(n||(n=e===t))return Yd}),n)},Kd.includes=function(e,t){return-1!==e.indexOf(t)},Kd.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},Kd.isObject=function(e){return e===Object(e)&&!Kd.isArray(e)},Kd.isEmptyObject=function(e){if(Kd.isObject(e)){for(var t in e)if(Dd.call(e,t))return!1;return!0}return!1},Kd.isUndefined=function(e){return void 0===e},Kd.isString=function(e){return"[object String]"==Md.call(e)},Kd.isDate=function(e){return"[object Date]"==Md.call(e)},Kd.isNumber=function(e){return"[object Number]"==Md.call(e)},Kd.isElement=function(e){return!(!e||1!==e.nodeType)},Kd.encodeDates=function(e){return Kd.each(e,function(t,n){Kd.isDate(t)?e[n]=Kd.formatDate(t):Kd.isObject(t)&&(e[n]=Kd.encodeDates(t))}),e},Kd.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Kd.formatDate=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},Kd.strip_empty_properties=function(e){var t={};return Kd.each(e,function(e,n){Kd.isString(e)&&e.length>0&&(t[n]=e)}),t},Kd.truncate=function(e,t){var n;return"string"==typeof e?n=e.slice(0,t):Kd.isArray(e)?(n=[],Kd.each(e,function(e){n.push(Kd.truncate(e,t))})):Kd.isObject(e)?(n={},Kd.each(e,function(e,i){n[i]=Kd.truncate(e,t)})):n=e,n},Kd.JSONEncode=function(){return function(e){var t=function(e){var t=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,function(e){var t=n[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'},n=function(e,i){var r="",o=0,s="",a="",c=0,l=r,u=[],d=i[e];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(e)),typeof d){case"string":return t(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(r+=" ",u=[],"[object Array]"===Md.apply(d)){for(c=d.length,o=0;o<c;o+=1)u[o]=n(o,d)||"null";return a=0===u.length?"[]":r?"[\n"+r+u.join(",\n"+r)+"\n"+l+"]":"["+u.join(",")+"]",r=l,a}for(s in d)Dd.call(d,s)&&(a=n(s,d))&&u.push(t(s)+(r?": ":":")+a);return a=0===u.length?"{}":r?"{"+u.join(",")+l+"}":"{"+u.join(",")+"}",r=l,a}};return n("",{"":e})}}(),Kd.JSONDecode=(fd={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},gd=function(e){var t=new SyntaxError(e);throw t.at=hd,t.text=pd,t},yd=function(e){return e&&e!==Ad&&gd("Expected '"+e+"' instead of '"+Ad+"'"),Ad=pd.charAt(hd),hd+=1,Ad},bd=function(){var e,t="";for("-"===Ad&&(t="-",yd("-"));Ad>="0"&&Ad<="9";)t+=Ad,yd();if("."===Ad)for(t+=".";yd()&&Ad>="0"&&Ad<="9";)t+=Ad;if("e"===Ad||"E"===Ad)for(t+=Ad,yd(),"-"!==Ad&&"+"!==Ad||(t+=Ad,yd());Ad>="0"&&Ad<="9";)t+=Ad,yd();if(e=+t,isFinite(e))return e;gd("Bad number")},wd=function(){var e,t,n,i="";if('"'===Ad)for(;yd();){if('"'===Ad)return yd(),i;if("\\"===Ad)if(yd(),"u"===Ad){for(n=0,t=0;t<4&&(e=parseInt(yd(),16),isFinite(e));t+=1)n=16*n+e;i+=String.fromCharCode(n)}else{if("string"!=typeof fd[Ad])break;i+=fd[Ad]}else i+=Ad}gd("Bad string")},vd=function(){for(;Ad&&Ad<=" ";)yd()},md=function(){switch(vd(),Ad){case"{":return function(){var e,t={};if("{"===Ad){if(yd("{"),vd(),"}"===Ad)return yd("}"),t;for(;Ad;){if(e=wd(),vd(),yd(":"),Object.hasOwnProperty.call(t,e)&&gd('Duplicate key "'+e+'"'),t[e]=md(),vd(),"}"===Ad)return yd("}"),t;yd(","),vd()}}gd("Bad object")}();case"[":return function(){var e=[];if("["===Ad){if(yd("["),vd(),"]"===Ad)return yd("]"),e;for(;Ad;){if(e.push(md()),vd(),"]"===Ad)return yd("]"),e;yd(","),vd()}}gd("Bad array")}();case'"':return wd();case"-":return bd();default:return Ad>="0"&&Ad<="9"?bd():function(){switch(Ad){case"t":return yd("t"),yd("r"),yd("u"),yd("e"),!0;case"f":return yd("f"),yd("a"),yd("l"),yd("s"),yd("e"),!1;case"n":return yd("n"),yd("u"),yd("l"),yd("l"),null}gd('Unexpected "'+Ad+'"')}()}},function(e){var t;return pd=e,hd=0,Ad=" ",t=md(),vd(),Ad&&gd("Syntax error"),t}),Kd.base64Encode=function(e){var t,n,i,r,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,c=0,l="",u=[];if(!e)return e;e=Kd.utf8Encode(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,i=o>>6&63,r=63&o,u[c++]=s.charAt(t)+s.charAt(n)+s.charAt(i)+s.charAt(r)}while(a<e.length);switch(l=u.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l},Kd.utf8Encode=function(e){var t,n,i,r,o="";for(t=n=0,i=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,r=0;r<i;r++){var s=e.charCodeAt(r),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(n>t&&(o+=e.substring(t,n)),o+=a,t=n=r+1)}return n>t&&(o+=e.substring(t,e.length)),o},Kd.UUID=function(){try{return me.crypto.randomUUID()}catch(wU){for(var e=new Array(36),t=0;t<36;t++)e[t]=Math.floor(16*Math.random());return e[14]=4,e[19]=e[19]&=-5,e[19]=e[19]|=8,e[8]=e[13]=e[18]=e[23]="-",Kd.map(e,function(e){return e.toString(16)}).join("")}};var Gd=["ahrefsbot","ahrefssiteaudit","amazonbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandex","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];Kd.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<Gd.length;t++)if(-1!==e.indexOf(Gd[t]))return!0;return!1},Kd.HTTPBuildQuery=function(e,t){var n,i,r=[];return Kd.isUndefined(t)&&(t="&"),Kd.each(e,function(e,t){n=encodeURIComponent(e.toString()),i=encodeURIComponent(t),r[r.length]=i+"="+n}),r.join(t)},Kd.getQueryParam=function(e,t){t=t.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var n=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);if(null===n||n&&"string"!=typeof n[1]&&n[1].length)return"";var i=n[1];try{i=decodeURIComponent(i)}catch(wU){Hd.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},Kd.cookie={get:function(e){for(var t=e+"=",n=Fd.cookie.split(";"),i=0;i<n.length;i++){for(var r=n[i];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}return null},parse:function(e){var t;try{t=Kd.JSONDecode(Kd.cookie.get(e))||{}}catch(wU){}return t},set_seconds:function(e,t,n,i,r,o,s){var a="",c="",l="";if(s)a="; domain="+s;else if(i){var u=ah(Fd.location.hostname);a=u?"; domain=."+u:""}if(n){var d=new Date;d.setTime(d.getTime()+1e3*n),c="; expires="+d.toGMTString()}o&&(r=!0,l="; SameSite=None"),r&&(l+="; secure"),Fd.cookie=e+"="+encodeURIComponent(t)+c+"; path=/"+a+l},set:function(e,t,n,i,r,o,s){var a="",c="",l="";if(s)a="; domain="+s;else if(i){var u=ah(Fd.location.hostname);a=u?"; domain=."+u:""}if(n){var d=new Date;d.setTime(d.getTime()+24*n*60*60*1e3),c="; expires="+d.toGMTString()}o&&(r=!0,l="; SameSite=None"),r&&(l+="; secure");var h=e+"="+encodeURIComponent(t)+c+"; path=/"+a+l;return Fd.cookie=h,h},remove:function(e,t,n){Kd.cookie.set(e,"",-1,t,!1,!1,n)}};var Wd=function(e){var t=!0;try{var n="__mplss_"+rh(8);e.setItem(n,"xyz"),"xyz"!==e.getItem(n)&&(t=!1),e.removeItem(n)}catch(wU){t=!1}return t},Jd=null,_d=function(e,t){return null===Jd||t?Jd=Wd(e||me.localStorage):Jd},$d=null;function eh(e,t,n){var i=function(e){Hd.error(t+" error: "+e)};return{is_supported:function(i){var r=n(e,i);return r||Hd.error(t+" unsupported"),r},error:i,get:function(t){try{return e.getItem(t)}catch(wU){i(wU)}return null},parse:function(t){try{return Kd.JSONDecode(e.getItem(t))||{}}catch(wU){}return null},set:function(t,n){try{e.setItem(t,n)}catch(wU){i(wU)}},remove:function(t){try{e.removeItem(t)}catch(wU){i(wU)}}}}Kd.localStorage=eh(me.localStorage,"localStorage",_d),Kd.sessionStorage=eh(me.sessionStorage,"sessionStorage",function(e,t){return null===$d||t?$d=Wd(e||me.sessionStorage):$d}),Kd.register_event=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,i,r,o){if(t)if(t.addEventListener&&!r)t.addEventListener(n,i,!!o);else{var s="on"+n,a=t[s];t[s]=function(t,n,i){var r=function(r){if(r=r||e(me.event)){var o,s,a=!0;return Kd.isFunction(i)&&(o=i(r)),s=n.call(t,r),!1!==o&&!1!==s||(a=!1),a}};return r}(t,i,a)}else Hd.error("No valid element provided to register_event")}}();var th=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');Kd.dom_query=function(){function e(e){return e.all?e.all:e.getElementsByTagName("*")}var t=/[\t\r\n]/g;function n(e,n){var i=" "+n+" ";return(" "+e.className+" ").replace(t," ").indexOf(i)>=0}function i(t){if(!Fd.getElementsByTagName)return[];var i,r,o,s,a,c,l,u,d,h,A=t.split(" "),p=[Fd];for(c=0;c<A.length;c++)if((i=A[c].replace(/^\s+/,"").replace(/\s+$/,"")).indexOf("#")>-1){o=(r=i.split("#"))[0];var m=r[1],f=Fd.getElementById(m);if(!f||o&&f.nodeName.toLowerCase()!=o)return[];p=[f]}else if(i.indexOf(".")>-1){o=(r=i.split("."))[0];var g=r[1];for(o||(o="*"),s=[],a=0,l=0;l<p.length;l++)for(d="*"==o?e(p[l]):p[l].getElementsByTagName(o),u=0;u<d.length;u++)s[a++]=d[u];for(p=[],h=0,l=0;l<s.length;l++)s[l].className&&Kd.isString(s[l].className)&&n(s[l],g)&&(p[h++]=s[l])}else{var y=i.match(th);if(y){o=y[1];var b,w=y[2],v=y[3],k=y[4];for(o||(o="*"),s=[],a=0,l=0;l<p.length;l++)for(d="*"==o?e(p[l]):p[l].getElementsByTagName(o),u=0;u<d.length;u++)s[a++]=d[u];switch(p=[],h=0,v){case"=":b=function(e){return e.getAttribute(w)==k};break;case"~":b=function(e){return e.getAttribute(w).match(new RegExp("\\b"+k+"\\b"))};break;case"|":b=function(e){return e.getAttribute(w).match(new RegExp("^"+k+"-?"))};break;case"^":b=function(e){return 0===e.getAttribute(w).indexOf(k)};break;case"$":b=function(e){return e.getAttribute(w).lastIndexOf(k)==e.getAttribute(w).length-k.length};break;case"*":b=function(e){return e.getAttribute(w).indexOf(k)>-1};break;default:b=function(e){return e.getAttribute(w)}}for(p=[],h=0,l=0;l<s.length;l++)b(s[l])&&(p[h++]=s[l])}else{for(o=i,s=[],a=0,l=0;l<p.length;l++)for(d=p[l].getElementsByTagName(o),u=0;u<d.length;u++)s[a++]=d[u];p=s}}return p}return function(e){return Kd.isElement(e)?[e]:Kd.isObject(e)&&!Kd.isUndefined(e.length)?e:i.call(this,e)}}();var nh=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],ih=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];Kd.info={campaignParams:function(e){var t="",n={};return Kd.each(nh,function(i){(t=Kd.getQueryParam(Fd.URL,i)).length?n[i]=t:void 0!==e&&(n[i]=e)}),n},clickParams:function(){var e="",t={};return Kd.each(ih,function(n){(e=Kd.getQueryParam(Fd.URL,n)).length&&(t[n]=e)}),t},marketingParams:function(){return Kd.extend(Kd.info.campaignParams(),Kd.info.clickParams())},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=Kd.info.searchEngine(e),n="yahoo"!=t?"q":"p",i={};if(null!==t){i.$search_engine=t;var r=Kd.getQueryParam(e,n);r.length&&(i.mp_keyword=r)}return i},browser:function(e,t,n){return t=t||"",n||Kd.includes(e," OPR/")?Kd.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":Kd.includes(e,"IEMobile")||Kd.includes(e,"WPDesktop")?"Internet Explorer Mobile":Kd.includes(e,"SamsungBrowser/")?"Samsung Internet":Kd.includes(e,"Edge")||Kd.includes(e,"Edg/")?"Microsoft Edge":Kd.includes(e,"FBIOS")?"Facebook Mobile":Kd.includes(e,"Whale/")?"Whale Browser":Kd.includes(e,"Chrome")?"Chrome":Kd.includes(e,"CriOS")?"Chrome iOS":Kd.includes(e,"UCWEB")||Kd.includes(e,"UCBrowser")?"UC Browser":Kd.includes(e,"FxiOS")?"Firefox iOS":Kd.includes(t,"Apple")?Kd.includes(e,"Mobile")?"Mobile Safari":"Safari":Kd.includes(e,"Android")?"Android Mobile":Kd.includes(e,"Konqueror")?"Konqueror":Kd.includes(e,"Firefox")?"Firefox":Kd.includes(e,"MSIE")||Kd.includes(e,"Trident/")?"Internet Explorer":Kd.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/,"Whale Browser":/Whale\/(\d+(\.\d+)?)/}[Kd.info.browser(e,t,n)];if(void 0===i)return null;var r=e.match(i);return r?parseFloat(r[r.length-2]):null},os:function(){var e=Ld;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return me.location.href},properties:function(e){return"object"!=typeof e&&(e={}),Kd.extend(Kd.strip_empty_properties({$os:Kd.info.os(),$browser:Kd.info.browser(Ld,Ud.vendor,Nd),$referrer:Fd.referrer,$referring_domain:Kd.info.referringDomain(Fd.referrer),$device:Kd.info.device(Ld)}),{$current_url:Kd.info.currentUrl(),$browser_version:Kd.info.browserVersion(Ld,Ud.vendor,Nd),$screen_height:Td.height,$screen_width:Td.width,mp_lib:"web",$lib_version:kd.LIB_VERSION,$insert_id:rh(),time:Kd.timestamp()/1e3},Kd.strip_empty_properties(e))},people_properties:function(){return Kd.extend(Kd.strip_empty_properties({$os:Kd.info.os(),$browser:Kd.info.browser(Ld,Ud.vendor,Nd)}),{$browser_version:Kd.info.browserVersion(Ld,Ud.vendor,Nd)})},mpPageViewProperties:function(){return Kd.strip_empty_properties({current_page_title:Fd.title,current_domain:me.location.hostname,current_url_path:me.location.pathname,current_url_protocol:me.location.protocol,current_url_search:me.location.search})}};var rh=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},oh=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,sh=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,ah=function(e){var t=sh,n=e.split("."),i=n[n.length-1];(i.length>4||"com"===i||"org"===i)&&(t=oh);var r=e.match(t);return r?r[0]:""},ch=function(){},lh=null,uh=null;"undefined"!=typeof JSON&&(lh=JSON.stringify,uh=JSON.parse),lh=lh||Kd.JSONEncode,uh=uh||Kd.JSONDecode;Kd.info=Kd.info,Kd.info.browser=Kd.info.browser,Kd.info.browserVersion=Kd.info.browserVersion,Kd.info.device=Kd.info.device,Kd.info.properties=Kd.info.properties,Kd.isBlockedUA=Kd.isBlockedUA,Kd.isEmptyObject=Kd.isEmptyObject,Kd.isObject=Kd.isObject,Kd.JSONDecode=Kd.JSONDecode,Kd.JSONEncode=Kd.JSONEncode,Kd.toArray=Kd.toArray,Kd.NPO=ld;var dh="mixpanelRecordingEvents",hh="mixpanelRecordingRegistry",Ah=[dh,hh],ph=function(e){this.dbPromise=null,this.storeName=e};ph.prototype._openDb=function(){return new ud(function(e,t){var n=me.indexedDB.open("mixpanelBrowserDb",1);n.onerror=function(){t(n.error)},n.onsuccess=function(){e(n.result)},n.onupgradeneeded=function(e){var t=e.target.result;Ah.forEach(function(e){t.createObjectStore(e)})}})},ph.prototype.init=function(){return me.indexedDB?(this.dbPromise||(this.dbPromise=this._openDb()),this.dbPromise.then(function(e){return e instanceof me.IDBDatabase?ud.resolve():ud.reject(e)})):ud.reject("indexedDB is not supported in this browser")},ph.prototype.isInitialized=function(){return!!this.dbPromise},ph.prototype.makeTransaction=function(e,t){var n=this.storeName,i=function(i){return new ud(function(r,o){var s=i.transaction(n,e);s.oncomplete=function(){r(s)},s.onabort=s.onerror=function(){o(s.error)},t(s.objectStore(n))})};return this.dbPromise.then(i).catch(function(e){return e&&"InvalidStateError"===e.name?(this.dbPromise=this._openDb(),this.dbPromise.then(i)):ud.reject(e)}.bind(this))},ph.prototype.setItem=function(e,t){return this.makeTransaction("readwrite",function(n){n.put(t,e)})},ph.prototype.getItem=function(e){var t;return this.makeTransaction("readonly",function(n){t=n.get(e)}).then(function(){return t.result})},ph.prototype.removeItem=function(e){return this.makeTransaction("readwrite",function(t){t.delete(e)})},ph.prototype.getAll=function(){var e;return this.makeTransaction("readonly",function(t){e=t.getAll()}).then(function(){return e.result})};function mh(e,t){Bh(!0,e,t)}function fh(e,t){Bh(!1,e,t)}function gh(e,t){return"1"===Sh(e,t)}function yh(e,t){if(function(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||me,n=t.navigator||{},i=!1;return Kd.each([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],function(e){Kd.includes([!0,1,"1","yes"],e)&&(i=!0)}),i}(t))return Hd.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var n="0"===Sh(e,t);return n&&Hd.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function bh(e){return Ih(e,function(e){return this.get_config(e)})}function wh(e){return Ih(e,function(e){return this._get_config(e)})}function vh(e){return Ih(e,function(e){return this._get_config(e)})}function kh(e,t){xh(t=t||{}).remove(Ch(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function xh(e){return"localStorage"===(e=e||{}).persistenceType?Kd.localStorage:Kd.cookie}function Ch(e,t){return((t=t||{}).persistencePrefix||"__mp_opt_in_out_")+e}function Sh(e,t){return xh(t).get(Ch(e,t))}function Bh(e,t,n){Kd.isString(t)&&t.length?(xh(n=n||{}).set(Ch(t,n),e?1:0,Kd.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})):Hd.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function Ih(e,t){return function(){var n=!1;try{var i=t.call(this,"token"),r=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),s=t.call(this,"opt_out_tracking_cookie_prefix"),a=t.call(this,"window");i&&(n=yh(i,{ignoreDnt:r,persistenceType:o,persistencePrefix:s,window:a}))}catch(wU){Hd.error("Unexpected error when checking tracking opt-out status: "+wU)}if(!n)return e.apply(this,arguments);var c=arguments[arguments.length-1];"function"==typeof c&&c(0)}}var Eh=jd("lock"),Mh=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||me.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3,this.promiseImpl=t.promiseImpl||ud};Mh.prototype.withLock=function(e,t){return new(0,this.promiseImpl)(Kd.bind(function(n,i){var r=t||(new Date).getTime()+"|"+Math.random(),o=(new Date).getTime(),s=this.storageKey,a=this.pollIntervalMS,c=this.timeoutMS,l=this.storage,u=s+":X",d=s+":Y",h=s+":Z",A=function(e){if((new Date).getTime()-o>c)return Eh.error("Timeout waiting for mutex on "+s+"; clearing lock. ["+r+"]"),l.removeItem(h),l.removeItem(d),void f();setTimeout(function(){try{e()}catch(wU){i(wU)}},a*(Math.random()+.1))},p=function(e,t){e()?t():A(function(){p(e,t)})},m=function(){var e=l.getItem(d);return(!e||e===r)&&(l.setItem(d,r),l.getItem(d)===r||(_d(l,!0)||i(new Error("localStorage support dropped while acquiring lock")),!1))},f=function(){l.setItem(u,r),p(m,function(){l.getItem(u)!==r?A(function(){l.getItem(d)===r?p(function(){return!l.getItem(h)},g):f()}):g()})},g=function(){l.setItem(h,"1");var t=function(){l.removeItem(h),l.getItem(d)===r&&l.removeItem(d),l.getItem(u)===r&&l.removeItem(u)};e().then(function(e){t(),n(e)}).catch(function(e){t(),i(e)})};try{if(!_d(l,!0))throw new Error("localStorage support check failed");f()}catch(wU){i(wU)}},this))};var Dh=function(e){this.storage=e||me.localStorage};Dh.prototype.init=function(){return ud.resolve()},Dh.prototype.isInitialized=function(){return!0},Dh.prototype.setItem=function(e,t){return new ud(Kd.bind(function(n,i){try{this.storage.setItem(e,lh(t))}catch(r){i(r)}n()},this))},Dh.prototype.getItem=function(e){return new ud(Kd.bind(function(t,n){var i;try{i=uh(this.storage.getItem(e))}catch(r){n(r)}t(i)},this))},Dh.prototype.removeItem=function(e){return new ud(Kd.bind(function(t,n){try{this.storage.removeItem(e)}catch(i){n(i)}t()},this))};var Qh=jd("batch"),Uh=function(e,t){var n,i,r,o;t=t||{},this.storageKey=e,this.usePersistence=t.usePersistence,this.usePersistence&&(this.queueStorage=t.queueStorage||new Dh,this.lock=new Mh(e,{storage:t.sharedLockStorage||me.localStorage,timeoutMS:t.sharedLockTimeoutMS})),this.reportError=t.errorReporter||Kd.bind(Qh.error,Qh),this.pid=t.pid||null,this.memQueue=[],this.initialized=!1,t.enqueueThrottleMs?this.enqueuePersisted=(n=Kd.bind(this._enqueuePersisted,this),i=t.enqueueThrottleMs,r=null,o=[],function(e){var t=this;return o.push(e),r||(r=new ud(function(e){setTimeout(function(){var i=n.apply(t,[o]);r=null,o=[],e(i)},i)})),r}):this.enqueuePersisted=Kd.bind(function(e){return this._enqueuePersisted([e])},this)};Uh.prototype.ensureInit=function(){return this.initialized||!this.usePersistence?ud.resolve():this.queueStorage.init().then(Kd.bind(function(){this.initialized=!0},this)).catch(Kd.bind(function(e){this.reportError("Error initializing queue persistence. Disabling persistence",e),this.initialized=!0,this.usePersistence=!1},this))},Uh.prototype.enqueue=function(e,t){var n={id:rh(),flushAfter:(new Date).getTime()+2*t,payload:e};return this.usePersistence?this.enqueuePersisted(n):(this.memQueue.push(n),ud.resolve(!0))},Uh.prototype._enqueuePersisted=function(e){var t=Kd.bind(function(){return this.ensureInit().then(Kd.bind(function(){return this.readFromStorage()},this)).then(Kd.bind(function(t){return this.saveToStorage(t.concat(e))},this)).then(Kd.bind(function(t){return t&&(this.memQueue=this.memQueue.concat(e)),t},this)).catch(Kd.bind(function(t){return this.reportError("Error enqueueing items",t,e),!1},this))},this);return this.lock.withLock(t,this.pid).catch(Kd.bind(function(e){return this.reportError("Error acquiring storage lock",e),!1},this))},Uh.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);return this.usePersistence&&t.length<e?this.ensureInit().then(Kd.bind(function(){return this.readFromStorage()},this)).then(Kd.bind(function(n){if(n.length){var i={};Kd.each(t,function(e){i[e.id]=!0});for(var r=0;r<n.length;r++){var o=n[r];if((new Date).getTime()>o.flushAfter&&!i[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}return t},this)):ud.resolve(t)};var Fh=function(e,t){var n=[];return Kd.each(e,function(e){e.id&&!t[e.id]&&n.push(e)}),n};Uh.prototype.removeItemsByID=function(e){var t={};if(Kd.each(e,function(e){t[e]=!0}),this.memQueue=Fh(this.memQueue,t),this.usePersistence){var n=Kd.bind(function(){return this.ensureInit().then(Kd.bind(function(){return this.readFromStorage()},this)).then(Kd.bind(function(e){return e=Fh(e,t),this.saveToStorage(e)},this)).then(Kd.bind(function(){return this.readFromStorage()},this)).then(Kd.bind(function(e){for(var n=0;n<e.length;n++){var i=e[n];if(i.id&&t[i.id])throw new Error("Item not removed from storage")}return!0},this)).catch(Kd.bind(function(t){return this.reportError("Error removing items",t,e),!1},this))},this);return this.lock.withLock(n,this.pid).catch(Kd.bind(function(e){return this.reportError("Error acquiring storage lock",e),!_d(this.lock.storage,!0)&&n().then(Kd.bind(function(e){return e||this.queueStorage.removeItem(this.storageKey).then(function(){return e})},this)).catch(Kd.bind(function(e){return this.reportError("Error clearing queue",e),!1},this))},this))}return ud.resolve(!0)};var Nh=function(e,t){var n=[];return Kd.each(e,function(e){var i=e.id;if(i in t){var r=t[i];null!==r&&(e.payload=r,n.push(e))}else n.push(e)}),n};Uh.prototype.updatePayloads=function(e){return this.memQueue=Nh(this.memQueue,e),this.usePersistence?this.lock.withLock(Kd.bind(function(){return this.ensureInit().then(Kd.bind(function(){return this.readFromStorage()},this)).then(Kd.bind(function(t){return t=Nh(t,e),this.saveToStorage(t)},this)).catch(Kd.bind(function(t){return this.reportError("Error updating items",e,t),!1},this))},this),this.pid).catch(Kd.bind(function(e){return this.reportError("Error acquiring storage lock",e),!1},this)):ud.resolve(!0)},Uh.prototype.readFromStorage=function(){return this.ensureInit().then(Kd.bind(function(){return this.queueStorage.getItem(this.storageKey)},this)).then(Kd.bind(function(e){return e&&(Kd.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null)),e||[]},this)).catch(Kd.bind(function(e){return this.reportError("Error retrieving queue",e),[]},this))},Uh.prototype.saveToStorage=function(e){return this.ensureInit().then(Kd.bind(function(){return this.queueStorage.setItem(this.storageKey,e)},this)).then(function(){return!0}).catch(Kd.bind(function(e){return this.reportError("Error saving queue",e),!1},this))},Uh.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(Kd.bind(function(){return this.queueStorage.removeItem(this.storageKey)},this)):ud.resolve()};var Th=jd("batch"),Lh=function(e,t){this.errorReporter=t.errorReporter,this.queue=new Uh(e,{errorReporter:Kd.bind(this.reportError,this),queueStorage:t.queueStorage,sharedLockStorage:t.sharedLockStorage,sharedLockTimeoutMS:t.sharedLockTimeoutMS,usePersistence:t.usePersistence,enqueueThrottleMs:t.enqueueThrottleMs}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=t.flushOnlyOnInterval||!1,this._flushPromise=null};Lh.prototype.enqueue=function(e){return this.queue.enqueue(e,this.flushInterval)},Lh.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},Lh.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},Lh.prototype.clear=function(){return this.queue.clear()},Lh.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},Lh.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},Lh.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(Kd.bind(function(){this.stopped||(this._flushPromise=this.flush())},this),this.flushInterval))},Lh.prototype.sendRequestPromise=function(e,t){return new ud(Kd.bind(function(n){this.sendRequest(e,t,n)},this))},Lh.prototype.flush=function(e){if(this.requestInProgress)return Th.log("Flush: Request already in progress"),ud.resolve();this.requestInProgress=!0,e=e||{};var t=this.libConfig.batch_request_timeout_ms,n=(new Date).getTime(),i=this.batchSize;return this.queue.fillBatch(i).then(Kd.bind(function(r){var o=r.length===i,s=[],a={};if(Kd.each(r,function(e){var t=e.payload;if(this.beforeSendHook&&!e.orphaned&&(t=this.beforeSendHook(t)),t){t.event&&t.properties&&(t.properties=Kd.extend({},t.properties,{mp_sent_by_lib_version:kd.LIB_VERSION}));var n=!0,i=e.id;i?(this.itemIdsSentSuccessfully[i]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:e,batchSize:r.length,timesSent:this.itemIdsSentSuccessfully[i]}),n=!1):this.reportError("[dupe] found item with no ID",{item:e}),n&&s.push(t)}a[e.id]=t},this),s.length<1)return this.requestInProgress=!1,this.resetFlush(),ud.resolve();var c=Kd.bind(function(){return this.queue.removeItemsByID(Kd.map(r,function(e){return e.id})).then(Kd.bind(function(e){return Kd.each(r,Kd.bind(function(e){var t=e.id;t?(this.itemIdsSentSuccessfully[t]=this.itemIdsSentSuccessfully[t]||0,this.itemIdsSentSuccessfully[t]++,this.itemIdsSentSuccessfully[t]>5&&this.reportError("[dupe] item ID sent too many times",{item:e,batchSize:r.length,timesSent:this.itemIdsSentSuccessfully[t]})):this.reportError("[dupe] found item with no ID while removing",{item:e})},this)),e?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!o?(this.resetFlush(),ud.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),ud.resolve())},this))},this),l=Kd.bind(function(o){this.requestInProgress=!1;try{if(e.unloading)return this.queue.updatePayloads(a);if(Kd.isObject(o)&&"timeout"===o.error&&(new Date).getTime()-n>=t)return this.reportError("Network timeout; retrying"),this.flush();if(Kd.isObject(o)&&(o.httpStatusCode>=500||429===o.httpStatusCode||o.httpStatusCode<=0&&(u=me.navigator.onLine,!Kd.isUndefined(u)&&!u)||"timeout"===o.error)){var s=2*this.flushInterval;return o.retryAfter&&(s=1e3*parseInt(o.retryAfter,10)||s),s=Math.min(6e5,s),this.reportError("Error; retry in "+s+" ms"),this.scheduleFlush(s),ud.resolve()}if(Kd.isObject(o)&&413===o.httpStatusCode){if(r.length>1){var l=Math.max(1,Math.floor(i/2));return this.batchSize=Math.min(this.batchSize,l,r.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),ud.resolve()}return this.reportError("Single-event request too large; dropping",r),this.resetBatchSize(),c()}return c()}catch(wU){this.reportError("Error handling API response",wU),this.resetFlush()}var u},this),u={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};return e.unloading&&(u.transport="sendBeacon"),Th.log("MIXPANEL REQUEST:",s),this.sendRequestPromise(s,u).then(l)},this)).catch(Kd.bind(function(e){this.reportError("Error flushing request queue",e),this.resetFlush()},this))},Lh.prototype.reportError=function(e,t){if(Th.error.apply(Th.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(n){Th.error(n)}};var Ph=function(e){var t=Date.now();return!e||t>e.maxExpires||t>e.idleExpires},Oh=jd("recorder"),Rh=me.CompressionStream,zh={batch_size:1e3,batch_flush_interval_ms:1e4,batch_request_timeout_ms:9e4,batch_autostart:!0},qh=new Set([Ql.MouseMove,Ql.MouseInteraction,Ql.Scroll,Ql.ViewportResize,Ql.Input,Ql.TouchMove,Ql.MediaInteraction,Ql.Drag,Ql.Selection]);var Yh=function(e){this._mixpanel=e.mixpanelInstance,this._onIdleTimeout=e.onIdleTimeout||ch,this._onMaxLengthReached=e.onMaxLengthReached||ch,this._onBatchSent=e.onBatchSent||ch,this._rrwebRecord=e.rrwebRecord||null,this._stopRecording=null,this.replayId=e.replayId,this.batchStartUrl=e.batchStartUrl||null,this.replayStartUrl=e.replayStartUrl||null,this.idleExpires=e.idleExpires||null,this.maxExpires=e.maxExpires||null,this.replayStartTime=e.replayStartTime||null,this.lastEventTimestamp=e.lastEventTimestamp||null,this.seqNo=e.seqNo||0,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=xd,this.recordMinMs=0;var t=_d(e.sharedLockStorage,!0)&&!this.getConfig("disable_persistence");this.batcherKey="__mprec_"+this.getConfig("name")+"_"+this.getConfig("token")+"_"+this.replayId,this.queueStorage=new ph(dh),this.batcher=new Lh(this.batcherKey,{errorReporter:this.reportError.bind(this),flushOnlyOnInterval:!0,libConfig:zh,sendRequestFunc:this.flushEventsWithOptOut.bind(this),queueStorage:this.queueStorage,sharedLockStorage:e.sharedLockStorage,usePersistence:t,stopAllBatchingFunc:this.stopRecording.bind(this),enqueueThrottleMs:250,sharedLockTimeoutMS:1e4})};Yh.prototype.getUserIdInfo=function(){if(this.finalFlushUserIdInfo)return this.finalFlushUserIdInfo;var e={distinct_id:String(this._mixpanel.get_distinct_id())},t=this._mixpanel.get_property("$device_id");t&&(e.$device_id=t);var n=this._mixpanel.get_property("$user_id");return n&&(e.$user_id=n),e},Yh.prototype.unloadPersistedData=function(){return this.batcher.stop(),this.queueStorage.init().catch(function(){this.reportError("Error initializing IndexedDB storage for unloading persisted data.")}.bind(this)).then(function(){return this.getDurationMs()<this._getRecordMinMs()?this.queueStorage.removeItem(this.batcherKey):this.batcher.flush().then(function(){return this.queueStorage.removeItem(this.batcherKey)}.bind(this))}.bind(this))},Yh.prototype.getConfig=function(e){return this._mixpanel.get_config(e)},Yh.prototype.get_config=function(e){return this.getConfig(e)},Yh.prototype.startRecording=function(e){if(null!==this._rrwebRecord)if(null===this._stopRecording){this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>xd&&(this.recordMaxMs=xd,Oh.critical("record_max_ms cannot be greater than "+xd+"ms. Capping value.")),this.maxExpires||(this.maxExpires=(new Date).getTime()+this.recordMaxMs),this.recordMinMs=this._getRecordMinMs(),this.replayStartTime||(this.replayStartTime=(new Date).getTime(),this.batchStartUrl=Kd.info.currentUrl(),this.replayStartUrl=Kd.info.currentUrl()),e||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var t=function(){clearTimeout(this.idleTimeoutId);var e=this.getConfig("record_idle_timeout_ms");this.idleTimeoutId=setTimeout(this._onIdleTimeout,e),this.idleExpires=(new Date).getTime()+e}.bind(this);t();var n,i=this.getConfig("record_block_selector");""!==i&&null!==i||(i=void 0);try{this._stopRecording=this._rrwebRecord({emit:function(e){this.idleExpires&&this.idleExpires<e.timestamp?this._onIdleTimeout():(function(e){return e.type===Dl.IncrementalSnapshot&&qh.has(e.data.source)}(e)&&(this.batcher.stopped&&(new Date).getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),t()),this.__enqueuePromise=this.batcher.enqueue(e),(null===this.lastEventTimestamp||e.timestamp>this.lastEventTimestamp)&&(this.lastEventTimestamp=e.timestamp))}.bind(this),blockClass:this.getConfig("record_block_class"),blockSelector:i,collectFonts:this.getConfig("record_collect_fonts"),dataURLOptions:{type:"image/webp",quality:.6},maskAllInputs:!0,maskTextClass:this.getConfig("record_mask_text_class"),maskTextSelector:this.getConfig("record_mask_text_selector"),recordCanvas:this.getConfig("record_canvas"),sampling:{canvas:15},plugins:this.getConfig("record_console")?[(n={stringifyOptions:{stringLengthLimit:1e3,numOfKeysLimit:50,depthOfLimit:2}},{name:"rrweb/console@1",observer:Zu,options:n})]:[]})}catch(wU){this.reportError("Unexpected error when starting rrweb recording.",wU)}if("function"!=typeof this._stopRecording)return this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,void this.stopRecording();var r=this.maxExpires-(new Date).getTime();this.maxTimeoutId=setTimeout(this._onMaxLengthReached.bind(this),r)}else Oh.log("Recording already in progress, skipping startRecording.");else this.reportError("rrweb record function not provided. ")},Yh.prototype.stopRecording=function(e){if(this.finalFlushUserIdInfo=this.getUserIdInfo(),!this.isRrwebStopped()){try{this._stopRecording()}catch(wU){this.reportError("Error with rrweb stopRecording",wU)}this._stopRecording=null}var t;return this.batcher.stopped?t=this.batcher.clear():e||(t=this.batcher.flush()),this.batcher.stop(),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId),t},Yh.prototype.isRrwebStopped=function(){return null===this._stopRecording},Yh.prototype.flushEventsWithOptOut=function(e,t,n){var i=function(e){0===e&&(this.stopRecording(),n({error:"Tracking has been opted out, stopping recording."}))}.bind(this);this._flushEvents(e,t,n,i)},Yh.prototype.serialize=function(){var e;try{e=this._mixpanel.get_tab_id()}catch(t){this.reportError("Error getting tab ID for serialization ",t),e=null}return{replayId:this.replayId,seqNo:this.seqNo,replayStartTime:this.replayStartTime,batchStartUrl:this.batchStartUrl,replayStartUrl:this.replayStartUrl,lastEventTimestamp:this.lastEventTimestamp,idleExpires:this.idleExpires,maxExpires:this.maxExpires,tabId:e}},Yh.deserialize=function(e,t){return new Yh(Kd.extend({},t,{replayId:e.replayId,batchStartUrl:e.batchStartUrl,replayStartUrl:e.replayStartUrl,idleExpires:e.idleExpires,maxExpires:e.maxExpires,replayStartTime:e.replayStartTime,lastEventTimestamp:e.lastEventTimestamp,seqNo:e.seqNo,sharedLockStorage:t.sharedLockStorage}))},Yh.prototype._sendRequest=function(e,t,n,i){var r=function(t,n){200===t.status&&this.replayId===e&&(this.seqNo++,this.batchStartUrl=Kd.info.currentUrl()),this._onBatchSent(),i({status:0,httpStatusCode:t.status,responseBody:n,retryAfter:t.headers.get("Retry-After")})}.bind(this),o=this._mixpanel.get_api_host&&this._mixpanel.get_api_host("record")||this.getConfig("api_host");me.fetch(o+"/"+this.getConfig("api_routes").record+"?"+new URLSearchParams(t),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getConfig("token")+":"),"Content-Type":"application/octet-stream"},body:n}).then(function(e){e.json().then(function(t){r(e,t)}).catch(function(e){i({error:e})})}).catch(function(e){i({error:e,httpStatusCode:0})})},Yh.prototype._flushEvents=bh(function(e,t,n){var i=e.length;if(i>0){for(var r=this.replayId,o=1/0,s=-1/0,a=!1,c=0;c<i;c++)o=Math.min(o,e[c].timestamp),s=Math.max(s,e[c].timestamp),e[c].type===Dl.FullSnapshot&&(a=!0);if(0===this.seqNo){if(!a)return n({error:"First batch does not contain a full snapshot. Aborting recording."}),void this.stopRecording(!0);this.replayStartTime=o}else this.replayStartTime||(this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=o);var l=s-this.replayStartTime,u={$current_url:this.batchStartUrl,$lib_version:kd.LIB_VERSION,batch_start_time:o/1e3,mp_lib:"web",replay_id:r,replay_length_ms:l,replay_start_time:this.replayStartTime/1e3,replay_start_url:this.replayStartUrl,seq:this.seqNo},d=JSON.stringify(e);if(Object.assign(u,this.getUserIdInfo()),function(e,t,n){if(!me.CompressionStream)return!1;var i=Kd.info.browser(e,t,n),r=Kd.info.browserVersion(e,t,n);return!(("Safari"===i||"Mobile Safari"===i)&&r>=16.4&&r<16.6)}(Ld,Ud.vendor,Nd)){var h=new Blob([d],{type:"application/json"}).stream().pipeThrough(new Rh("gzip"));new Response(h).blob().then(function(e){u.format="gzip",this._sendRequest(r,u,e,n)}.bind(this))}else u.format="body",this._sendRequest(r,u,d,n)}}),Yh.prototype.reportError=function(e,t){Oh.error.apply(Oh.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.getConfig("error_reporter")(e,t)}catch(n){Oh.error(n)}},Yh.prototype.getDurationMs=function(){return null===this.replayStartTime?0:null===this.lastEventTimestamp?(new Date).getTime()-this.replayStartTime:this.lastEventTimestamp-this.replayStartTime},Yh.prototype._getRecordMinMs=function(){var e=this.getConfig("record_min_ms");return e>Cd?(Oh.critical("record_min_ms cannot be greater than 8000ms. Capping value."),Cd):e};var Kh=function(e){this.idb=new ph(hh),this.errorReporter=e.errorReporter,this.mixpanelInstance=e.mixpanelInstance,this.sharedLockStorage=e.sharedLockStorage};Kh.prototype.isPersistenceEnabled=function(){return!this.mixpanelInstance.get_config("disable_persistence")},Kh.prototype.handleError=function(e){this.errorReporter("IndexedDB error: ",e)},Kh.prototype.setActiveRecording=function(e){if(!this.isPersistenceEnabled())return ud.resolve();var t=e.tabId;return t?this.idb.init().then(function(){return this.idb.setItem(t,e)}.bind(this)).catch(this.handleError.bind(this)):(console.warn("No tab ID is set, cannot persist recording metadata."),ud.resolve())},Kh.prototype.getActiveRecording=function(){return this.isPersistenceEnabled()?this.idb.init().then(function(){return this.idb.getItem(this.mixpanelInstance.get_tab_id())}.bind(this)).then(function(e){return Ph(e)?null:e}.bind(this)).catch(this.handleError.bind(this)):ud.resolve(null)},Kh.prototype.clearActiveRecording=function(){return this.isPersistenceEnabled()?this.markActiveRecordingExpired():this.deleteActiveRecording()},Kh.prototype.markActiveRecordingExpired=function(){return this.getActiveRecording().then(function(e){if(e)return e.maxExpires=0,this.setActiveRecording(e)}.bind(this)).catch(this.handleError.bind(this))},Kh.prototype.deleteActiveRecording=function(){return this.idb.isInitialized()?this.idb.removeItem(this.mixpanelInstance.get_tab_id()).catch(this.handleError.bind(this)):ud.resolve()},Kh.prototype.flushInactiveRecordings=function(){return this.isPersistenceEnabled()?this.idb.init().then(function(){return this.idb.getAll()}.bind(this)).then(function(e){var t=e.filter(function(e){return Ph(e)}).map(function(e){return Yh.deserialize(e,{mixpanelInstance:this.mixpanelInstance,sharedLockStorage:this.sharedLockStorage}).unloadPersistedData().then(function(){return this.idb.removeItem(e.tabId)}.bind(this)).catch(this.handleError.bind(this))}.bind(this));return ud.all(t)}.bind(this)).catch(this.handleError.bind(this)):ud.resolve([])};var Hh=jd("recorder"),Vh=function(e,t,n){this.mixpanelInstance=e,this.rrwebRecord=t||Nu,this.sharedLockStorage=n,this.recordingRegistry=new Kh({mixpanelInstance:this.mixpanelInstance,errorReporter:Hh.error,sharedLockStorage:n}),this._flushInactivePromise=this.recordingRegistry.flushInactiveRecordings(),this.activeRecording=null,this.stopRecordingInProgress=!1};Vh.prototype.startRecording=function(e){if(e=e||{},!this.activeRecording||this.activeRecording.isRrwebStopped()){var t=function(){Hh.log("Idle timeout reached, restarting recording."),this.resetRecording()}.bind(this),n=function(){Hh.log("Max recording length reached, stopping recording."),this.resetRecording()}.bind(this),i=function(){this.recordingRegistry.setActiveRecording(this.activeRecording.serialize()),this.__flushPromise=this.activeRecording.batcher._flushPromise}.bind(this),r={mixpanelInstance:this.mixpanelInstance,onBatchSent:i,onIdleTimeout:t,onMaxLengthReached:n,replayId:Kd.UUID(),rrwebRecord:this.rrwebRecord,sharedLockStorage:this.sharedLockStorage};return e.activeSerializedRecording?this.activeRecording=Yh.deserialize(e.activeSerializedRecording,r):this.activeRecording=new Yh(r),this.activeRecording.startRecording(e.shouldStopBatcher),this.recordingRegistry.setActiveRecording(this.activeRecording.serialize())}Hh.log("Recording already in progress, skipping startRecording.")},Vh.prototype.stopRecording=function(){return this.stopRecordingInProgress=!0,this._stopCurrentRecording(!1,!0).then(function(){return this.recordingRegistry.clearActiveRecording()}.bind(this)).then(function(){this.stopRecordingInProgress=!1}.bind(this))},Vh.prototype.pauseRecording=function(){return this._stopCurrentRecording(!1)},Vh.prototype._stopCurrentRecording=function(e,t){if(this.activeRecording){var n=this.activeRecording.stopRecording(e);return t&&(this.activeRecording=null),n}return ud.resolve()},Vh.prototype.resumeRecording=function(e){return this.activeRecording&&this.activeRecording.isRrwebStopped()?(this.activeRecording.startRecording(!1),ud.resolve(null)):this.recordingRegistry.getActiveRecording().then(function(t){return t&&!this.stopRecordingInProgress?this.startRecording({activeSerializedRecording:t}):e?this.startRecording({shouldStopBatcher:!1}):(Hh.log("No resumable recording found."),null)}.bind(this))},Vh.prototype.resetRecording=function(){this.stopRecording(),this.startRecording({shouldStopBatcher:!0})},Vh.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(Vh.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),me.__mp_recorder=Vh;var jh="change",Zh="click",Xh="hashchange",Gh="load",Wh="mp_locationchange",Jh="popstate",_h="scrollend",$h="scroll",eA="submit",tA="visibilitychange",nA=["clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","x","y"],iA=["mp-include"],rA=["mp-no-track"],oA=rA.concat(["mp-sensitive"]),sA=["aria-label","aria-labelledby","aria-describedby","href","name","role","title","type"],aA={button:!0,checkbox:!0,combobox:!0,grid:!0,link:!0,listbox:!0,menu:!0,menubar:!0,menuitem:!0,menuitemcheckbox:!0,menuitemradio:!0,navigation:!0,option:!0,radio:!0,radiogroup:!0,searchbox:!0,slider:!0,spinbutton:!0,switch:!0,tab:!0,tablist:!0,textbox:!0,tree:!0,treegrid:!0,treeitem:!0},cA={base:!0,head:!0,html:!0,link:!0,meta:!0,script:!0,style:!0,title:!0,br:!0,hr:!0,wbr:!0,noscript:!0,picture:!0,source:!0,template:!0,track:!0},lA={article:!0,div:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,p:!0,section:!0,span:!0},uA=["onclick","onmousedown","onmouseup","onpointerdown","onpointerup","ontouchend","ontouchstart"],dA=jd("autocapture");function hA(e){for(var t={},n=AA(e).split(" "),i=0;i<n.length;i++){var r=n[i];r&&(t[r]=!0)}return t}function AA(e){switch(typeof e.className){case"string":return e.className;case"object":return e.className.baseVal||e.getAttribute("class")||"";default:return""}}function pA(e){if(e.previousElementSibling)return e.previousElementSibling;do{e=e.previousSibling}while(e&&!wA(e));return e}function mA(e,t,n,i,r,o){var s={$classes:AA(e).split(" "),$tag_name:e.tagName.toLowerCase()},a=e.id;a&&(s.$id=a),xA(e,t,r,o)&&Kd.each(sA.concat(i),function(t){if(e.hasAttribute(t)&&!n[t]){var i=e.getAttribute(t);CA(i)&&(s["$attr-"+t]=i)}});for(var c=1,l=1,u=e;u=pA(u);)c++,u.tagName===e.tagName&&l++;return s.$nth_child=c,s.$nth_of_type=l,s}function fA(e,t){var n=t.allowElementCallback,i=t.allowSelectors||[],r=t.blockAttrs||[],o=t.blockElementCallback,s=t.blockSelectors||[],a=t.captureTextContent||!1,c=t.captureExtraAttrs||[],l=t.capturedForHeatMap||!1,u={};Kd.each(r,function(e){u[e]=!0});var d=null,h=void 0===e.target?e.srcElement:e.target;if(kA(h)&&(h=h.parentNode),function(e,t){if(!e||vA(e,"html")||!wA(e))return!1;switch(e.tagName.toLowerCase()){case"form":return t.type===eA;case"input":return-1===["button","submit"].indexOf(e.getAttribute("type"))?t.type===jh:t.type===Zh;case"select":case"textarea":return t.type===jh;default:return t.type===Zh}}(h,e)&&yA(h,e,n,i)&&!bA(h,e,o,s)){for(var A=[h],p=h;p.parentNode&&!vA(p,"body");)A.push(p.parentNode),p=p.parentNode;var m,f=[],g=!1;if(Kd.each(A,function(t){var r=xA(t,e,n,i);u.href||"a"!==t.tagName.toLowerCase()||(m=t.getAttribute("href"),m=r&&CA(m)&&m),bA(t,e,o,s)&&(g=!0),f.push(mA(t,e,u,c,n,i))},this),!g){var y=Fd.documentElement;if(d={$event_type:e.type,$host:me.location.host,$pathname:me.location.pathname,$elements:f,$el_attr__href:m,$viewportHeight:Math.max(y.clientHeight,me.innerHeight||0),$viewportWidth:Math.max(y.clientWidth,me.innerWidth||0),$pageHeight:Fd.body.offsetHeight||0,$pageWidth:Fd.body.offsetWidth||0},Kd.each(c,function(e){if(!u[e]&&h.hasAttribute(e)){var t=h.getAttribute(e);CA(t)&&(d["$el_attr__"+e]=t)}}),a&&(b=gA(h,e,n,i))&&b.length&&(d.$el_text=b),e.type===Zh&&(Kd.each(nA,function(t){t in e&&(d["$"+t]=e[t])}),l&&(d.$captured_for_heatmap=!0),h=function(e){for(var t=e.target,n=e.composedPath(),i=0;i<n.length;i++){var r=n[i];if(vA(r,"a")||vA(r,"button")||vA(r,"input")||vA(r,"select")||r.getAttribute&&"button"===r.getAttribute("role")){t=r;break}if(r===t)break}return t}(e)),a){var b=gA(h,e,n,i);b&&b.length&&(d.$el_text=b)}if(h){if(!yA(h,e,n,i)||bA(h,e,o,s))return null;var w=mA(h,e,u,c,n,i);d.$target=w,d.$el_classes=w.$classes,Kd.extend(d,Kd.strip_empty_properties({$el_id:w.$id,$el_tag_name:w.$tag_name}))}}}return d}function gA(e,t,n,i){var r="";return xA(e,t,n,i)&&e.childNodes&&e.childNodes.length&&Kd.each(e.childNodes,function(e){kA(e)&&e.textContent&&(r+=Kd.trim(e.textContent).split(/(\s+)/).filter(CA).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),Kd.trim(r)}function yA(e,t,n,i){if(n)try{if(!n(e,t))return!1}catch(wU){return dA.critical("Error while checking element in allowElementCallback",wU),!1}if(!i.length)return!0;for(var r=0;r<i.length;r++){var o=i[r];try{if(e.matches(o))return!0}catch(wU){dA.critical("Error while checking selector: "+o,wU)}}return!1}function bA(e,t,n,i){var r;if(n)try{if(n(e,t))return!0}catch(wU){return dA.critical("Error while checking element in blockElementCallback",wU),!0}if(i&&i.length)for(r=0;r<i.length;r++){var o=i[r];try{if(e.matches(o))return!0}catch(wU){dA.critical("Error while checking selector: "+o,wU)}}var s=hA(e);for(r=0;r<rA.length;r++)if(s[rA[r]])return!0;return!1}function wA(e){return e&&1===e.nodeType}function vA(e,t){return e&&e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function kA(e){return e&&3===e.nodeType}function xA(e,t,n,i){var r;if(!yA(e,t,n,i))return!1;for(var o=e;o.parentNode&&!vA(o,"body");o=o.parentNode){var s=hA(o);for(r=0;r<oA.length;r++)if(s[oA[r]])return!1}var a=hA(e);for(r=0;r<iA.length;r++)if(a[iA[r]])return!0;if(vA(e,"input")||vA(e,"select")||vA(e,"textarea")||"true"===e.getAttribute("contenteditable"))return!1;var c=e.type||"";if("string"==typeof c)switch(c.toLowerCase()){case"hidden":case"password":return!1}var l=e.name||e.id||"";if("string"==typeof l){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(l.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function CA(e){if(null===e||Kd.isUndefined(e))return!1;if("string"==typeof e){e=Kd.trim(e);if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0}function SA(e){var t="onscrollend"in me,n=Zd(e),i=_h;if(!t){var r=null;n=Zd(function(){clearTimeout(r),r=setTimeout(e,100)}),i=$h}return{listener:n,eventType:i}}function BA(e){var t=e.tagName.toLowerCase();return"button"===t||"input"===t||"select"===t||"textarea"===t||"details"===t||"dialog"===t||(!!e.isContentEditable||(!!(e.onclick||e.onmousedown||e.onmouseup||e.ontouchstart||e.ontouchend)||(!!function(e){for(var t=0;t<uA.length;t++)if(e.hasAttribute(uA[t]))return!0;return!1}(e)||(!!function(e){var t=e.getAttribute("role");if(!t)return!1;var n=t.trim().split(/\s+/)[0].toLowerCase();return aA[n]}(e)||(!("a"!==t||!e.hasAttribute("href"))||!!e.hasAttribute("tabindex"))))))}function IA(e){if(!e||!e.tagName)return!0;var t=e.tagName.toLowerCase();if(cA[t])return!0;if(BA(e))return!1;for(var n=e.parentElement,i=0;n&&i<5;){if(BA(n))return!1;if(n.getRootNode&&n.getRootNode()!==Fd){var r=n.getRootNode();if(r.host&&BA(r.host))return!1}n=n.parentElement,i++}return!!lA[t]}function EA(e){return"composedPath"in e?e.composedPath():[]}function MA(e){var t=EA(e);return t&&t.length>0?t[0]:e.target||e.srcElement}function DA(){this.clicks=[]}function QA(e,t){this.changeCallback=e||function(){},this.observerConfig=t,this.observedShadowRoots=null,this.shadowObservers=[]}DA.prototype.isRageClick=function(e,t){var n=(t=t||{}).threshold_px||30,i=t.timeout_ms||1e3,r=t.click_count||4;if(t.interactive_elements_only||false){var o=MA(e);if(!o||IA(o))return!1}var s=Date.now(),a=e.pageX,c=e.pageY,l=this.clicks[this.clicks.length-1];if(l&&s-l.timestamp<i&&Math.sqrt(Math.pow(a-l.x,2)+Math.pow(c-l.y,2))<n){if(this.clicks.push({x:a,y:c,timestamp:s}),this.clicks.length>=r)return this.clicks=[],!0}else this.clicks=[{x:a,y:c,timestamp:s}];return!1},QA.prototype.getEventTarget=function(e){if(this.observedShadowRoots)return MA(e)},QA.prototype.observeFromEvent=function(e){if(this.observedShadowRoots)for(var t=EA(e),n=0;n<t.length;n++){var i=t[n];i&&i.shadowRoot&&this.observeShadowRoot(i.shadowRoot)}},QA.prototype.observeShadowRoot=function(e){if(this.observedShadowRoots&&!this.observedShadowRoots.has(e)){var t=this;try{this.observedShadowRoots.add(e);var n=new window.MutationObserver(function(){t.changeCallback()});n.observe(e,this.observerConfig),this.shadowObservers.push(n)}catch(i){dA.critical("Error while observing shadow root",i)}}},QA.prototype.start=function(){this.observedShadowRoots||("undefined"!=typeof WeakSet?this.observedShadowRoots=new WeakSet:dA.critical("Shadow DOM observation unavailable: WeakSet not supported"))},QA.prototype.stop=function(){if(this.observedShadowRoots){for(var e=0;e<this.shadowObservers.length;e++)try{this.shadowObservers[e].disconnect()}catch(t){dA.critical("Error while disconnecting shadow DOM observer",t)}this.shadowObservers=[],this.observedShadowRoots=null}};var UA=[jh,"input",eA,"select","toggle"],FA=[_h],NA=[Xh],TA={characterData:!0,childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","hidden","checked","selected","value","display","visibility"]};function LA(e){this.eventListeners=[],this.mutationObserver=null,this.shadowDOMObserver=null,this.isTracking=!1,this.lastChangeEventTimestamp=0,this.pendingClicks=[],this.onDeadClickCallback=e,this.processingActive=!1,this.processingTimeout=null}LA.prototype.addClick=function(e){var t=this.shadowDOMObserver&&this.shadowDOMObserver.getEventTarget(e);return t||(t=e.target||e.srcElement),!(!t||IA(t))&&(this.shadowDOMObserver&&this.shadowDOMObserver.observeFromEvent(e),this.pendingClicks.push({element:t,event:e,timestamp:Date.now()}),!0)},LA.prototype.trackClick=function(e,t){if(!this.isTracking)return!1;var n=this.addClick(e);return n&&this.triggerProcessing(t),n},LA.prototype.getDeadClicks=function(e){if(0===this.pendingClicks.length)return[];var t=e.timeout_ms,n=Date.now(),i=this.pendingClicks.slice();this.pendingClicks=[];for(var r=[],o=0;o<i.length;o++){var s=i[o];n-s.timestamp>=t?this.hasChangesAfter(s.timestamp)||r.push(s):this.pendingClicks.push(s)}return r},LA.prototype.hasChangesAfter=function(e){return this.lastChangeEventTimestamp>=e-100},LA.prototype.recordChangeEvent=function(){this.lastChangeEventTimestamp=Date.now()},LA.prototype.triggerProcessing=function(e){this.processingActive||(this.processingActive=!0,this.processRecursively(e))},LA.prototype.processRecursively=function(e){if(this.isTracking&&this.onDeadClickCallback){var t=e.timeout_ms,n=this;this.processingTimeout=setTimeout(function(){if(n.processingActive){for(var t=n.getDeadClicks(e),i=0;i<t.length;i++)n.onDeadClickCallback(t[i].event);n.pendingClicks.length>0?n.processRecursively(e):n.processingActive=!1}},t)}else this.processingActive=!1},LA.prototype.startTracking=function(){if(!this.isTracking){this.isTracking=!0;var e=this;UA.forEach(function(t){var n=function(){e.recordChangeEvent()};document.addEventListener(t,n,{capture:!0,passive:!0}),e.eventListeners.push({target:document,event:t,handler:n,options:{capture:!0,passive:!0}})}),NA.forEach(function(t){var n=function(){e.recordChangeEvent()};window.addEventListener(t,n),e.eventListeners.push({target:window,event:t,handler:n})}),FA.forEach(function(t){var n=function(){e.recordChangeEvent()};window.addEventListener(t,n,{passive:!0}),e.eventListeners.push({target:window,event:t,handler:n,options:{passive:!0}})});var t=function(){e.recordChangeEvent()};if(document.addEventListener("selectionchange",t),e.eventListeners.push({target:document,event:"selectionchange",handler:t}),window.MutationObserver)try{this.mutationObserver=new window.MutationObserver(function(){e.recordChangeEvent()}),this.mutationObserver.observe(document.body||document.documentElement,TA)}catch(n){dA.critical("Error while setting up mutation observer",n)}if(window.customElements)try{this.shadowDOMObserver=new QA(function(){e.recordChangeEvent()},TA),this.shadowDOMObserver.start()}catch(n){dA.critical("Error while setting up shadow DOM observer",n),this.shadowDOMObserver=null}}},LA.prototype.stopTracking=function(){if(this.isTracking){this.isTracking=!1,this.pendingClicks=[],this.lastChangeEventTimestamp=0,this.processingActive=!1,this.processingTimeout&&(clearTimeout(this.processingTimeout),this.processingTimeout=null);for(var e=0;e<this.eventListeners.length;e++){var t=this.eventListeners[e];try{t.target.removeEventListener(t.event,t.handler,t.options)}catch(n){dA.critical("Error while removing event listener",n)}}if(this.eventListeners=[],this.mutationObserver){try{this.mutationObserver.disconnect()}catch(n){dA.critical("Error while disconnecting mutation observer",n)}this.mutationObserver=null}if(this.shadowDOMObserver){try{this.shadowDOMObserver.stop()}catch(n){dA.critical("Error while stopping shadow DOM observer",n)}this.shadowDOMObserver=null}}};var PA="autocapture",OA="full-url",RA="allow_selectors",zA="allow_url_regexes",qA="block_attrs",YA="block_element_callback",KA="block_selectors",HA="block_url_regexes",VA="capture_extra_attrs",jA="capture_text_content",ZA="scroll_capture_all",XA="scroll_depth_percent_checkpoints",GA="click",WA="dead_click",JA="input",_A="pageview",$A="rage_click",ep="scroll",tp="page_leave",np="submit",ip={};ip[RA]=[],ip[zA]=[],ip[qA]=[],ip[YA]=null,ip[KA]=[],ip[HA]=[],ip[VA]=[],ip[jA]=!1,ip[ZA]=!1,ip[XA]=[25,50,75,100],ip[GA]=!0,ip[WA]=!0,ip[JA]=!0,ip[_A]=OA,ip[$A]=!0,ip[ep]=!0,ip[tp]=!1,ip[np]=!0;var rp={$mp_autocapture:!0},op="$mp_click",sp="$mp_dead_click",ap="$mp_rage_click",cp=function(e){this.mp=e,this.maxScrollViewDepth=0,this.hasTrackedScrollSession=!1,this.previousScrollHeight=0};cp.prototype.init=function(){!function(){try{return!!Fd.createElement("div").matches}catch(wU){return!1}}()?dA.critical("Autocapture unavailable: missing required DOM APIs"):(this.initPageListeners(),this.initPageviewTracking(),this.initClickTracking(),this.initDeadClickTracking(),this.initInputTracking(),this.initScrollTracking(),this.initSubmitTracking(),this.initRageClickTracking(),this.initPageLeaveTracking())},cp.prototype.getFullConfig=function(){var e=this.mp.get_config(PA);return e?Kd.isObject(e)?Kd.extend({},ip,e):ip:{}},cp.prototype.getConfig=function(e){return this.getFullConfig()[e]},cp.prototype.currentUrlBlocked=function(){var e,t=Kd.info.currentUrl(),n=this.getConfig(zA)||[];if(n.length){var i=!1;for(e=0;e<n.length;e++){var r=n[e];try{if(t.match(r)){i=!0;break}}catch(wU){return dA.critical("Error while checking block URL regex: "+r,wU),!0}}if(!i)return!0}var o=this.getConfig(HA)||[];if(!o||!o.length)return!1;for(e=0;e<o.length;e++)try{if(t.match(o[e]))return!0}catch(wU){return dA.critical("Error while checking block URL regex: "+o[e],wU),!0}return!1},cp.prototype.pageviewTrackingConfig=function(){return this.mp.get_config(PA)?this.getConfig(_A):this.mp.get_config("track_pageview")},cp.prototype.trackDomEvent=function(e,t){if(!this.currentUrlBlocked()){var n=this.mp.is_recording_heatmap_data()&&(t===op&&!this.getConfig(GA)||t===ap&&!this._getClickTrackingConfig($A)||t===sp&&!this._getClickTrackingConfig(WA)),i=fA(e,{allowElementCallback:this.getConfig("allow_element_callback"),allowSelectors:this.getConfig(RA),blockAttrs:this.getConfig(qA),blockElementCallback:this.getConfig(YA),blockSelectors:this.getConfig(KA),captureExtraAttrs:this.getConfig(VA),captureTextContent:this.getConfig(jA),capturedForHeatMap:n});i&&(Kd.extend(i,rp),this.mp.track(t,i))}},cp.prototype.initPageListeners=function(){if(me.removeEventListener(Jh,this.listenerPopstate),me.removeEventListener(Xh,this.listenerHashchange),this.pageviewTrackingConfig()||this.getConfig(tp)||this.mp.get_config("record_heatmap_data")){this.listenerPopstate=function(){me.dispatchEvent(new Event(Wh))},this.listenerHashchange=function(){me.dispatchEvent(new Event(Wh))},me.addEventListener(Jh,this.listenerPopstate),me.addEventListener(Xh,this.listenerHashchange);var e=me.history.pushState;"function"==typeof e&&(me.history.pushState=function(t,n,i){e.call(me.history,t,n,i),me.dispatchEvent(new Event(Wh))});var t=me.history.replaceState;"function"==typeof t&&(me.history.replaceState=function(e,n,i){t.call(me.history,e,n,i),me.dispatchEvent(new Event(Wh))})}},cp.prototype._getClickTrackingConfig=function(e){var t=this.getConfig(e);return t?!0===t?{}:"object"==typeof t?t:{}:null},cp.prototype._trackPageLeave=function(e,t,n){if(!this.hasTrackedScrollSession&&(this.getConfig(tp)||this.mp.is_recording_heatmap_data())){this.hasTrackedScrollSession=!0;var i=Math.max(Fd.documentElement.clientHeight,me.innerHeight||0),r=Math.round(Math.max(this.maxScrollViewDepth-i,0)/(n-i)*100),o=Math.round(i/n*100);n<=i&&(r=100,o=100);var s=Kd.extend({$max_scroll_view_depth:this.maxScrollViewDepth,$max_scroll_percentage:r,$fold_line_percentage:o,$scroll_height:n,$event_type:e.type,$current_url:t||Kd.info.currentUrl(),$viewportHeight:i,$viewportWidth:Math.max(Fd.documentElement.clientWidth,me.innerWidth||0),$captured_for_heatmap:this.mp.is_recording_heatmap_data()},rp);this.mp.track("$mp_page_leave",s,{transport:"sendBeacon"})}},cp.prototype._initScrollDepthTracking=function(){if(me.removeEventListener($h,this.listenerScrollDepth),me.removeEventListener(_h,this.listenerScrollDepth),this.mp.get_config("record_heatmap_data")){dA.log("Initializing scroll depth tracking"),this.maxScrollViewDepth=Math.max(Fd.documentElement.clientHeight,me.innerHeight||0);var e=SA(function(){if(!this.currentUrlBlocked()){var e=Math.max(Fd.documentElement.clientHeight,me.innerHeight||0)+me.scrollY;e>this.maxScrollViewDepth&&(this.maxScrollViewDepth=e),this.previousScrollHeight=Fd.body.scrollHeight}}.bind(this));this.listenerScrollDepth=e.listener,me.addEventListener(e.eventType,this.listenerScrollDepth)}},cp.prototype.initClickTracking=function(){me.removeEventListener(Zh,this.listenerClick),(this.getConfig(GA)||this.mp.get_config("record_heatmap_data"))&&(dA.log("Initializing click tracking"),this.listenerClick=function(e){(this.getConfig(GA)||this.mp.is_recording_heatmap_data())&&this.trackDomEvent(e,op)}.bind(this),me.addEventListener(Zh,this.listenerClick))},cp.prototype.initDeadClickTracking=function(){this._getClickTrackingConfig(WA)||this.mp.get_config("record_heatmap_data")?(dA.log("Initializing dead click tracking"),this._deadClickTracker||(this._deadClickTracker=new LA(function(e){this.trackDomEvent(e,sp)}.bind(this)),this._deadClickTracker.startTracking()),this.listenerDeadClick||(this.listenerDeadClick=function(e){var t=this._getClickTrackingConfig(WA);if((t||this.mp.is_recording_heatmap_data())&&!this.currentUrlBlocked()){var n=t||{};n.timeout_ms||(n.timeout_ms=500),this._deadClickTracker.trackClick(e,n)}}.bind(this),me.addEventListener(Zh,this.listenerDeadClick))):this.stopDeadClickTracking()},cp.prototype.initInputTracking=function(){me.removeEventListener(jh,this.listenerChange),this.getConfig(JA)&&(dA.log("Initializing input tracking"),this.listenerChange=function(e){this.getConfig(JA)&&this.trackDomEvent(e,"$mp_input_change")}.bind(this),me.addEventListener(jh,this.listenerChange))},cp.prototype.initPageviewTracking=function(){if(me.removeEventListener(Wh,this.listenerLocationchange),this.pageviewTrackingConfig()){dA.log("Initializing pageview tracking");var e="",t=!1;this.currentUrlBlocked()||(t=this.mp.track_pageview(rp)),t&&(e=Kd.info.currentUrl()),this.listenerLocationchange=Zd(function(){if(!this.currentUrlBlocked()){var t=Kd.info.currentUrl(),n=!1,i=t.split("#")[0].split("?")[0]!==e.split("#")[0].split("?")[0],r=this.pageviewTrackingConfig();if(r===OA?n=t!==e:"url-with-path-and-query-string"===r?n=t.split("#")[0]!==e.split("#")[0]:"url-with-path"===r&&(n=i),n)this.mp.track_pageview(rp)&&(e=t),i&&(this.lastScrollCheckpoint=0,dA.log("Path change: re-initializing scroll depth checkpoints"))}}.bind(this)),me.addEventListener(Wh,this.listenerLocationchange)}},cp.prototype.initRageClickTracking=function(){me.removeEventListener(Zh,this.listenerRageClick),(this._getClickTrackingConfig($A)||this.mp.get_config("record_heatmap_data"))&&(dA.log("Initializing rage click tracking"),this._rageClickTracker||(this._rageClickTracker=new DA),this.listenerRageClick=function(e){var t=this._getClickTrackingConfig($A);(t||this.mp.is_recording_heatmap_data())&&(this.currentUrlBlocked()||this._rageClickTracker.isRageClick(e,t)&&this.trackDomEvent(e,ap))}.bind(this),me.addEventListener(Zh,this.listenerRageClick))},cp.prototype.initScrollTracking=function(){if(me.removeEventListener(_h,this.listenerScroll),me.removeEventListener($h,this.listenerScroll),this.getConfig(ep)){dA.log("Initializing scroll tracking"),this.lastScrollCheckpoint=0;var e=SA(function(){if(this.getConfig(ep)&&!this.currentUrlBlocked()){var e=this.getConfig(ZA),t=(this.getConfig(XA)||[]).slice().sort(function(e,t){return e-t}),n=me.scrollY,i=Kd.extend({$scroll_top:n},rp);try{var r=Fd.body.scrollHeight,o=Math.round(n/(r-me.innerHeight)*100);if(i.$scroll_height=r,i.$scroll_percentage=o,o>this.lastScrollCheckpoint)for(var s=0;s<t.length;s++){var a=t[s];o>=a&&this.lastScrollCheckpoint<a&&(i.$scroll_checkpoint=a,this.lastScrollCheckpoint=a,e=!0)}}catch(wU){dA.critical("Error while calculating scroll percentage",wU)}e&&this.mp.track("$mp_scroll",i)}}.bind(this));this.listenerScroll=e.listener,me.addEventListener(e.eventType,this.listenerScroll)}},cp.prototype.initSubmitTracking=function(){me.removeEventListener(eA,this.listenerSubmit),this.getConfig(np)&&(dA.log("Initializing submit tracking"),this.listenerSubmit=function(e){this.getConfig(np)&&this.trackDomEvent(e,"$mp_submit")}.bind(this),me.addEventListener(eA,this.listenerSubmit))},cp.prototype.initPageLeaveTracking=function(){if(Fd.removeEventListener(tA,this.listenerPageLeaveVisibilitychange),me.removeEventListener(Wh,this.listenerPageLeaveLocationchange),me.removeEventListener(Gh,this.listenerPageLoad),this.getConfig(tp)||this.mp.get_config("record_heatmap_data")){dA.log("Initializing page visibility tracking."),this._initScrollDepthTracking();var e=Kd.info.currentUrl();this.listenerPageLoad=function(){this.previousScrollHeight=Fd.body.scrollHeight}.bind(this),me.addEventListener(Gh,this.listenerPageLoad),this.listenerPageLeaveLocationchange=Zd(function(t){if(!this.currentUrlBlocked()){var n=Kd.info.currentUrl();n!==e&&(this._trackPageLeave(t,e,this.previousScrollHeight),e=n,this.maxScrollViewDepth=Math.max(Fd.documentElement.clientHeight,me.innerHeight||0),this.previousScrollHeight=Fd.body.scrollHeight,this.hasTrackedScrollSession=!1)}}.bind(this)),me.addEventListener(Wh,this.listenerPageLeaveLocationchange),this.listenerPageLeaveVisibilitychange=function(t){Fd.hidden&&this._trackPageLeave(t,e,this.previousScrollHeight)}.bind(this),Fd.addEventListener(tA,this.listenerPageLeaveVisibilitychange)}},cp.prototype.stopDeadClickTracking=function(){this.listenerDeadClick&&(me.removeEventListener(Zh,this.listenerDeadClick),this.listenerDeadClick=null),this._deadClickTracker&&(this._deadClickTracker.stopTracking(),this._deadClickTracker=null)},Xd(cp);var lp=jd("flags"),up="flags",dp="context",hp={};hp[dp]={};var Ap=function(e){this.fetch=me.fetch,this.getFullApiRoute=e.getFullApiRoute,this.getMpConfig=e.getConfigFunc,this.setMpConfig=e.setConfigFunc,this.getMpProperty=e.getPropertyFunc,this.track=e.trackingFunc};Ap.prototype.init=function(){this.minApisSupported()?(this.flags=null,this.fetchFlags(),this.trackedFeatures=new Set):lp.critical("Feature Flags unavailable: missing minimum required APIs")},Ap.prototype.getFullConfig=function(){var e=this.getMpConfig(up);return e?Kd.isObject(e)?Kd.extend({},hp,e):hp:{}},Ap.prototype.getConfig=function(e){return this.getFullConfig()[e]},Ap.prototype.isSystemEnabled=function(){return!!this.getMpConfig(up)},Ap.prototype.updateContext=function(e,t){if(!this.isSystemEnabled())return lp.critical("Feature Flags not enabled, cannot update context"),Promise.resolve();var n=this.getMpConfig(up);Kd.isObject(n)||(n={});var i=t&&t.replace?{}:this.getConfig(dp);return n[dp]=Kd.extend({},i,e),this.setMpConfig(up,n),this.fetchFlags()},Ap.prototype.areFlagsReady=function(){return this.isSystemEnabled()||lp.error("Feature Flags not enabled"),!!this.flags},Ap.prototype.fetchFlags=function(){if(!this.isSystemEnabled())return Promise.resolve();var e=this.getMpProperty("distinct_id"),t=this.getMpProperty("$device_id"),n="00-"+Kd.UUID().replace(/-/g,"")+"-"+Kd.UUID().replace(/-/g,"").substring(0,16)+"-01";lp.log("Fetching flags for distinct ID: "+e);var i=Kd.extend({distinct_id:e,device_id:t},this.getConfig(dp)),r=new URLSearchParams;r.set("context",JSON.stringify(i)),r.set("token",this.getMpConfig("token")),r.set("mp_lib","web"),r.set("$lib_version",kd.LIB_VERSION);var o=this.getFullApiRoute()+"?"+r.toString();return this._fetchInProgressStartTime=Date.now(),this.fetchPromise=this.fetch.call(me,o,{method:"GET",headers:{Authorization:"Basic "+btoa(this.getMpConfig("token")+":"),traceparent:n}}).then(function(e){return this.markFetchComplete(),e.json().then(function(e){var t=e.flags;if(!t)throw new Error("No flags in API response");var i=new Map;Kd.each(t,function(e,t){i.set(t,{key:e.variant_key,value:e.variant_value,experiment_id:e.experiment_id,is_experiment_active:e.is_experiment_active,is_qa_tester:e.is_qa_tester})}),this.flags=i,this._traceparent=n}.bind(this)).catch(function(e){this.markFetchComplete(),lp.error(e)}.bind(this))}.bind(this)).catch(function(e){this.markFetchComplete(),lp.error(e)}.bind(this)),this.fetchPromise},Ap.prototype.markFetchComplete=function(){this._fetchInProgressStartTime?(this._fetchStartTime=this._fetchInProgressStartTime,this._fetchCompleteTime=Date.now(),this._fetchLatency=this._fetchCompleteTime-this._fetchStartTime,this._fetchInProgressStartTime=null):lp.error("Fetch in progress started time not set, cannot mark fetch complete")},Ap.prototype.getVariant=function(e,t){return this.fetchPromise?this.fetchPromise.then(function(){return this.getVariantSync(e,t)}.bind(this)).catch(function(e){return lp.error(e),t}):new Promise(function(e){lp.critical("Feature Flags not initialized"),e(t)})},Ap.prototype.getVariantSync=function(e,t){if(!this.areFlagsReady())return lp.log("Flags not loaded yet"),t;var n=this.flags.get(e);return n?(this.trackFeatureCheck(e,n),n):(lp.log('No flag found: "'+e+'"'),t)},Ap.prototype.getVariantValue=function(e,t){return this.getVariant(e,{value:t}).then(function(e){return e.value}).catch(function(e){return lp.error(e),t})},Ap.prototype.getFeatureData=function(e,t){return lp.critical("mixpanel.flags.get_feature_data() is deprecated and will be removed in a future release. Use mixpanel.flags.get_variant_value() instead."),this.getVariantValue(e,t)},Ap.prototype.getVariantValueSync=function(e,t){return this.getVariantSync(e,{value:t}).value},Ap.prototype.isEnabled=function(e,t){return this.getVariantValue(e).then(function(){return this.isEnabledSync(e,t)}.bind(this)).catch(function(e){return lp.error(e),t})},Ap.prototype.isEnabledSync=function(e,t){t=t||!1;var n=this.getVariantValueSync(e,t);return!0!==n&&!1!==n&&(lp.error('Feature flag "'+e+'" value: '+n+" is not a boolean; returning fallback value: "+t),n=t),n},Ap.prototype.trackFeatureCheck=function(e,t){if(!this.trackedFeatures.has(e)){this.trackedFeatures.add(e);var n={"Experiment name":e,"Variant name":t.key,$experiment_type:"feature_flag","Variant fetch start time":new Date(this._fetchStartTime).toISOString(),"Variant fetch complete time":new Date(this._fetchCompleteTime).toISOString(),"Variant fetch latency (ms)":this._fetchLatency,"Variant fetch traceparent":this._traceparent};"undefined"!==t.experiment_id&&(n.$experiment_id=t.experiment_id),"undefined"!==t.is_experiment_active&&(n.$is_experiment_active=t.is_experiment_active),"undefined"!==t.is_qa_tester&&(n.$is_qa_tester=t.is_qa_tester),this.track("$experiment_started",n)}},Ap.prototype.minApisSupported=function(){return!!this.fetch&&"undefined"!=typeof Promise&&"undefined"!=typeof Map&&"undefined"!=typeof Set},Xd(Ap),Ap.prototype.are_flags_ready=Ap.prototype.areFlagsReady,Ap.prototype.get_variant=Ap.prototype.getVariant,Ap.prototype.get_variant_sync=Ap.prototype.getVariantSync,Ap.prototype.get_variant_value=Ap.prototype.getVariantValue,Ap.prototype.get_variant_value_sync=Ap.prototype.getVariantValueSync,Ap.prototype.is_enabled=Ap.prototype.isEnabled,Ap.prototype.is_enabled_sync=Ap.prototype.isEnabledSync,Ap.prototype.update_context=Ap.prototype.updateContext,Ap.prototype.get_feature_data=Ap.prototype.getFeatureData;var pp=function(){};pp.prototype.create_properties=function(){},pp.prototype.event_handler=function(){},pp.prototype.after_track_handler=function(){},pp.prototype.init=function(e){return this.mp=e,this},pp.prototype.track=function(e,t,n,i){var r=this,o=Kd.dom_query(e);if(0!==o.length)return Kd.each(o,function(e){Kd.register_event(e,this.override_event,function(e){var o={},s=r.create_properties(n,this),a=r.mp.get_config("track_links_timeout");r.event_handler(e,this,o),window.setTimeout(r.track_callback(i,s,o,!0),a),r.mp.track(t,s,r.track_callback(i,s,o))})},this),!0;Hd.error("The DOM query ("+e+") returned 0 elements")},pp.prototype.track_callback=function(e,t,n,i){i=i||!1;var r=this;return function(){n.callback_fired||(n.callback_fired=!0,e&&!1===e(i,t)||r.after_track_handler(t,n,i))}},pp.prototype.create_properties=function(e,t){return"function"==typeof e?e(t):Kd.extend({},e)};var mp=function(){this.override_event="click"};Kd.inherit(mp,pp),mp.prototype.create_properties=function(e,t){var n=mp.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},mp.prototype.event_handler=function(e,t,n){n.new_tab=2===e.which||e.metaKey||e.ctrlKey||"_blank"===t.target,n.href=t.href,n.new_tab||e.preventDefault()},mp.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout(function(){window.location=t.href},0)};var fp=function(){this.override_event="submit"};Kd.inherit(fp,pp),fp.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()},fp.prototype.after_track_handler=function(e,t){setTimeout(function(){t.element.submit()},0)};var gp="$set",yp="$set_once",bp="$unset",wp="$add",vp="$append",kp="$union",xp="$remove",Cp={set_action:function(e,t){var n={},i={};return Kd.isObject(e)?Kd.each(e,function(e,t){this._is_reserved_property(t)||(i[t]=e)},this):i[e]=t,n[gp]=i,n},unset_action:function(e){var t={},n=[];return Kd.isArray(e)||(e=[e]),Kd.each(e,function(e){this._is_reserved_property(e)||n.push(e)},this),t[bp]=n,t},set_once_action:function(e,t){var n={},i={};return Kd.isObject(e)?Kd.each(e,function(e,t){this._is_reserved_property(t)||(i[t]=e)},this):i[e]=t,n[yp]=i,n},union_action:function(e,t){var n={},i={};return Kd.isObject(e)?Kd.each(e,function(e,t){this._is_reserved_property(t)||(i[t]=Kd.isArray(e)?e:[e])},this):i[e]=Kd.isArray(t)?t:[t],n[kp]=i,n},append_action:function(e,t){var n={},i={};return Kd.isObject(e)?Kd.each(e,function(e,t){this._is_reserved_property(t)||(i[t]=e)},this):i[e]=t,n[vp]=i,n},remove_action:function(e,t){var n={},i={};return Kd.isObject(e)?Kd.each(e,function(e,t){this._is_reserved_property(t)||(i[t]=e)},this):i[e]=t,n[xp]=i,n},delete_action:function(){var e={$delete:""};return e}},Sp=function(){};Kd.extend(Sp.prototype,Cp),Sp.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n},Sp.prototype.set=vh(function(e,t,n){var i=this.set_action(e,t);return Kd.isObject(e)&&(n=t),this._send_request(i,n)}),Sp.prototype.set_once=vh(function(e,t,n){var i=this.set_once_action(e,t);return Kd.isObject(e)&&(n=t),this._send_request(i,n)}),Sp.prototype.unset=vh(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)}),Sp.prototype.union=vh(function(e,t,n){Kd.isObject(e)&&(n=t);var i=this.union_action(e,t);return this._send_request(i,n)}),Sp.prototype.delete=vh(function(e){var t=this.delete_action();return this._send_request(t,e)}),Sp.prototype.remove=vh(function(e,t,n){var i=this.remove_action(e,t);return this._send_request(i,n)}),Sp.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var n=Kd.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._mixpanel.get_api_host("groups")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},t)},Sp.prototype._is_reserved_property=function(e){return"$group_key"===e||"$group_id"===e},Sp.prototype._get_config=function(e){return this._mixpanel.get_config(e)},Sp.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},Sp.prototype.remove=Sp.prototype.remove,Sp.prototype.set=Sp.prototype.set,Sp.prototype.set_once=Sp.prototype.set_once,Sp.prototype.union=Sp.prototype.union,Sp.prototype.unset=Sp.prototype.unset,Sp.prototype.toString=Sp.prototype.toString;var Bp=function(){};Kd.extend(Bp.prototype,Cp),Bp.prototype._init=function(e){this._mixpanel=e},Bp.prototype.set=wh(function(e,t,n){var i=this.set_action(e,t);return Kd.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),i[gp]=Kd.extend({},Kd.info.people_properties(),i[gp]),this._send_request(i,n)}),Bp.prototype.set_once=wh(function(e,t,n){var i=this.set_once_action(e,t);return Kd.isObject(e)&&(n=t),this._send_request(i,n)}),Bp.prototype.unset=wh(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)}),Bp.prototype.increment=wh(function(e,t,n){var i={},r={};return Kd.isObject(e)?(Kd.each(e,function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void Hd.error("Invalid increment value passed to mixpanel.people.increment - must be a number");r[t]=e}},this),n=t):(Kd.isUndefined(t)&&(t=1),r[e]=t),i[wp]=r,this._send_request(i,n)}),Bp.prototype.append=wh(function(e,t,n){Kd.isObject(e)&&(n=t);var i=this.append_action(e,t);return this._send_request(i,n)}),Bp.prototype.remove=wh(function(e,t,n){Kd.isObject(e)&&(n=t);var i=this.remove_action(e,t);return this._send_request(i,n)}),Bp.prototype.union=wh(function(e,t,n){Kd.isObject(e)&&(n=t);var i=this.union_action(e,t);return this._send_request(i,n)}),Bp.prototype.track_charge=wh(function(){Hd.error("mixpanel.people.track_charge() is deprecated and no longer has any effect.")}),Bp.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},Bp.prototype.delete_user=function(){if(this._identify_called()){var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)}Hd.error("mixpanel.people.delete_user() requires you to call identify() first")},Bp.prototype.toString=function(){return this._mixpanel.toString()+".people"},Bp.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),i=this._mixpanel.get_property("$user_id"),r=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),i&&(e.$user_id=i),r&&(e.$had_persisted_distinct_id=r);var o=Kd.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._mixpanel.get_api_host("people")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),Kd.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),Kd.truncate(o,255))},Bp.prototype._get_config=function(e){return this._mixpanel.get_config(e)},Bp.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},Bp.prototype._enqueue=function(e){gp in e?this._mixpanel.persistence._add_to_people_queue(gp,e):yp in e?this._mixpanel.persistence._add_to_people_queue(yp,e):bp in e?this._mixpanel.persistence._add_to_people_queue(bp,e):wp in e?this._mixpanel.persistence._add_to_people_queue(wp,e):vp in e?this._mixpanel.persistence._add_to_people_queue(vp,e):xp in e?this._mixpanel.persistence._add_to_people_queue(xp,e):kp in e?this._mixpanel.persistence._add_to_people_queue(kp,e):Hd.error("Invalid call to _enqueue():",e)},Bp.prototype._flush_one_queue=function(e,t,n,i){var r=this,o=Kd.extend({},this._mixpanel.persistence.load_queue(e)),s=o;Kd.isUndefined(o)||!Kd.isObject(o)||Kd.isEmptyObject(o)||(r._mixpanel.persistence._pop_from_people_queue(e,o),r._mixpanel.persistence.save(),i&&(s=i(o)),t.call(r,s,function(t,i){0===t&&r._mixpanel.persistence._add_to_people_queue(e,o),Kd.isUndefined(n)||n(t,i)}))},Bp.prototype._flush=function(e,t,n,i,r,o,s){var a=this;this._flush_one_queue(gp,this.set,e),this._flush_one_queue(yp,this.set_once,i),this._flush_one_queue(bp,this.unset,o,function(e){return Kd.keys(e)}),this._flush_one_queue(wp,this.increment,t),this._flush_one_queue(kp,this.union,r);var c=this._mixpanel.persistence.load_queue(vp);if(!Kd.isUndefined(c)&&Kd.isArray(c)&&c.length)for(var l,u=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(vp,l),Kd.isUndefined(n)||n(e,t)},d=c.length-1;d>=0;d--)c=this._mixpanel.persistence.load_queue(vp),l=c.pop(),a._mixpanel.persistence.save(),Kd.isEmptyObject(l)||a.append(l,u);var h=this._mixpanel.persistence.load_queue(xp);if(!Kd.isUndefined(h)&&Kd.isArray(h)&&h.length)for(var A,p=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(xp,A),Kd.isUndefined(s)||s(e,t)},m=h.length-1;m>=0;m--)h=this._mixpanel.persistence.load_queue(xp),A=h.pop(),a._mixpanel.persistence.save(),Kd.isEmptyObject(A)||a.remove(A,p)},Bp.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},Bp.prototype.set=Bp.prototype.set,Bp.prototype.set_once=Bp.prototype.set_once,Bp.prototype.unset=Bp.prototype.unset,Bp.prototype.increment=Bp.prototype.increment,Bp.prototype.append=Bp.prototype.append,Bp.prototype.remove=Bp.prototype.remove,Bp.prototype.union=Bp.prototype.union,Bp.prototype.track_charge=Bp.prototype.track_charge,Bp.prototype.clear_charges=Bp.prototype.clear_charges,Bp.prototype.delete_user=Bp.prototype.delete_user,Bp.prototype.toString=Bp.prototype.toString;var Ip,Ep="__mps",Mp="__mpso",Dp="__mpus",Qp="__mpa",Up="__mpap",Fp="__mpr",Np="__mpu",Tp="$people_distinct_id",Lp="__alias",Pp="__timers",Op=[Ep,Mp,Dp,Qp,Up,Fp,Np,Tp,Lp,Pp],Rp=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;"cookie"!==t&&"localStorage"!==t&&(Hd.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&Kd.localStorage.is_supported()?this.storage=Kd.localStorage:this.storage=Kd.cookie,this.load(),this.update_config(e),this.upgrade(),this.save()};Rp.prototype.properties=function(){var e={};return this.load(),Kd.each(this.props,function(t,n){Kd.include(Op,n)||(e[n]=t)}),e},Rp.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Kd.extend({},e))}},Rp.prototype.upgrade=function(){var e,t;this.storage===Kd.localStorage?(e=Kd.cookie.parse(this.name),Kd.cookie.remove(this.name),Kd.cookie.remove(this.name,!0),e&&this.register_once(e)):this.storage===Kd.cookie&&(t=Kd.localStorage.parse(this.name),Kd.localStorage.remove(this.name),t&&this.register_once(t))},Rp.prototype.save=function(){this.disabled||this.storage.set(this.name,lh(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},Rp.prototype.load_prop=function(e){return this.load(),this.props[e]},Rp.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},Rp.prototype.clear=function(){this.remove(),this.props={}},Rp.prototype.register_once=function(e,t,n){return!!Kd.isObject(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n,this.load(),Kd.each(e,function(e,n){this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e)},this),this.save(),!0)},Rp.prototype.register=function(e,t){return!!Kd.isObject(e)&&(this.expire_days=void 0===t?this.default_expiry:t,this.load(),Kd.extend(this.props,e),this.save(),!0)},Rp.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())},Rp.prototype.update_search_keyword=function(e){this.register(Kd.info.searchInfo(e))},Rp.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:Kd.info.referringDomain(e)||"$direct"},"")},Rp.prototype.get_referrer_info=function(){return Kd.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Rp.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},Rp.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},Rp.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},Rp.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},Rp.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},Rp.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Rp.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},Rp.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),i=t[e],r=this._get_or_create_queue(gp),o=this._get_or_create_queue(yp),s=this._get_or_create_queue(bp),a=this._get_or_create_queue(wp),c=this._get_or_create_queue(kp),l=this._get_or_create_queue(xp,[]),u=this._get_or_create_queue(vp,[]);n===Ep?(Kd.extend(r,i),this._pop_from_people_queue(wp,i),this._pop_from_people_queue(kp,i),this._pop_from_people_queue(bp,i)):n===Mp?(Kd.each(i,function(e,t){t in o||(o[t]=e)}),this._pop_from_people_queue(bp,i)):n===Dp?Kd.each(i,function(e){Kd.each([r,o,a,c],function(t){e in t&&delete t[e]}),Kd.each(u,function(t){e in t&&delete t[e]}),s[e]=!0}):n===Qp?(Kd.each(i,function(e,t){t in r?r[t]+=e:(t in a||(a[t]=0),a[t]+=e)},this),this._pop_from_people_queue(bp,i)):n===Np?(Kd.each(i,function(e,t){Kd.isArray(e)&&(t in c||(c[t]=[]),Kd.each(e,function(e){Kd.include(c[t],e)||c[t].push(e)}))}),this._pop_from_people_queue(bp,i)):n===Fp?(l.push(i),this._pop_from_people_queue(vp,i)):n===Up&&(u.push(i),this._pop_from_people_queue(bp,i)),Hd.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),Hd.log(t),this.save()},Rp.prototype._pop_from_people_queue=function(e,t){var n=this.props[this._get_queue_key(e)];Kd.isUndefined(n)||Kd.each(t,function(t,i){e===vp||e===xp?Kd.each(n,function(e){e[i]===t&&delete e[i]}):delete n[i]},this)},Rp.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))},Rp.prototype._get_queue_key=function(e){return e===gp?Ep:e===yp?Mp:e===bp?Dp:e===wp?Qp:e===vp?Up:e===xp?Fp:e===kp?Np:void Hd.error("Invalid queue:",e)},Rp.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=Kd.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},Rp.prototype.set_event_timer=function(e,t){var n=this.load_prop(Pp)||{};n[e]=t,this.props[Pp]=n,this.save()},Rp.prototype.remove_event_timer=function(e){var t=(this.load_prop(Pp)||{})[e];return Kd.isUndefined(t)||(delete this.props[Pp][e],this.save()),t};var zp,qp=function(e,t){throw new Error(e+" not available in this build.")},Yp="mixpanel",Kp="base64",Hp="$device:",Vp=me.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,jp=!Vp&&-1===Ld.indexOf("MSIE")&&-1===Ld.indexOf("Mozilla"),Zp=null;Ud.sendBeacon&&(Zp=function(){return Ud.sendBeacon.apply(Ud,arguments)});var Xp={track:"track/",engage:"engage/",groups:"groups/",record:"record/",flags:"flags/"},Gp={api_host:"https://api-js.mixpanel.com",api_hosts:{},api_routes:Xp,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",api_payload_format:Kp,app_host:"https://mixpanel.com",autocapture:!1,cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:ch,flags:!1,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:ch,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video, audio",record_canvas:!1,record_collect_fonts:!1,record_console:!0,record_heatmap_data:!1,record_idle_timeout_ms:18e5,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:xd,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},Wp=!1,Jp=function(){},_p=function(e,t,n){var i,r=n===Yp?zp:zp[n];if(r&&0===Ip)i=r;else{if(r&&!Kd.isArray(r))return void Hd.error("You have already initialized "+n);i=new Jp}if(i._cached_groups={},i._init(e,t,n),i.people=new Bp,i.people._init(i),!i.get_config("skip_first_touch_marketing")){var o=Kd.info.campaignParams(null),s={},a=!1;Kd.each(o,function(e,t){s["initial_"+t]=e,e&&(a=!0)}),a&&i.people.set_once(s)}kd.DEBUG=kd.DEBUG||i.get_config("debug");var c=0===Ip?"module":"snippet";return me.dispatchEvent(new me.CustomEvent("$mp_sdk_to_extension_event",{detail:{instance:i,source:c,token:e,name:n,info:Kd.info}})),!Kd.isUndefined(r)&&Kd.isArray(r)&&(i._execute_array.call(i.people,r.people),i._execute_array(r)),i};Jp.prototype.init=function(e,t,n){if(Kd.isUndefined(n))this.report_error("You must name your new library: init(token, config, name)");else{if(n!==Yp){var i=_p(e,t,n);return zp[n]=i,i._loaded(),i}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},Jp.prototype._init=function(e,t,n){t=t||{},this.__loaded=!0,this.config={};var i={};"api_payload_format"in t||(t.api_host||Gp.api_host).match(/\.mixpanel\.com/)&&(i.api_payload_format="json");if(this.hooks={},this.set_config(Kd.extend({},Gp,i,t,{name:n,token:e,callback_fn:(n===Yp?n:Yp+"."+n)+"._jsc"})),this._jsc=ch,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests)if(Kd.localStorage.is_supported(!0)&&Vp){if(this.init_batchers(),Zp&&me.addEventListener){var r=Kd.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);me.addEventListener("pagehide",function(e){e.persisted&&r()}),me.addEventListener("visibilitychange",function(){"hidden"===Fd.visibilityState&&r()})}}else this._batch_requests=!1,Hd.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),Kd.each(this.get_batcher_configs(),function(e){Hd.log("Clearing batch queue "+e.queue_key),Kd.localStorage.remove(e.queue_key)});this.persistence=this.cookie=new Rp(this.config),this.unpersisted_superprops={},this._gdpr_init();var o=Kd.UUID();this.get_distinct_id()||this.register_once({distinct_id:Hp+o,$device_id:o},""),this.flags=new Ap({getFullApiRoute:Kd.bind(function(){return this.get_api_host("flags")+"/"+this.get_config("api_routes").flags},this),getConfigFunc:Kd.bind(this.get_config,this),setConfigFunc:Kd.bind(this.set_config,this),getPropertyFunc:Kd.bind(this.get_property,this),trackingFunc:Kd.bind(this.track,this)}),this.flags.init(),this.flags=this.flags,this.autocapture=new cp(this),this.autocapture.init(),this._init_tab_id(),this._check_and_start_session_recording()},Jp.prototype._init_tab_id=function(){if(this.get_config("disable_persistence"))Hd.log("Tab ID initialization skipped due to disable_persistence config");else if(Kd.sessionStorage.is_supported())try{var e=this.get_config("name")+"_"+this.get_config("token"),t="mp_tab_id_"+e,n="mp_gen_new_tab_id_"+e;!Kd.sessionStorage.get(n)&&Kd.sessionStorage.get(t)||Kd.sessionStorage.set(t,"$tab-"+Kd.UUID()),Kd.sessionStorage.set(n,"1"),this.tab_id=Kd.sessionStorage.get(t),me.addEventListener("beforeunload",function(){Kd.sessionStorage.remove(n)})}catch(wU){this.report_error("Error initializing tab id",wU)}else this.report_error("Session storage is not supported, cannot keep track of unique tab ID.")},Jp.prototype.get_tab_id=function(){return this.tab_id||null},Jp.prototype._should_load_recorder=function(){if(this.get_config("disable_persistence"))return Hd.log("Load recorder check skipped due to disable_persistence config"),Promise.resolve(!1);var e=new ph(hh),t=this.get_tab_id();return e.init().then(function(){return e.getAll()}).then(function(e){for(var n=0;n<e.length;n++)if(Ph(e[n])||e[n].tabId===t)return!0;return!1}).catch(Kd.bind(function(e){this.report_error("Error checking recording registry",e)},this))},Jp.prototype._check_and_start_session_recording=bh(function(e){if(me.MutationObserver){var t=Kd.bind(function(e){var t=Kd.bind(function(){this._recorder=this._recorder||new me.__mp_recorder(this),this._recorder.resumeRecording(e)},this);Kd.isUndefined(me.__mp_recorder)?qp(this.get_config("recorder_src"),t):t()},this),n=this.get_config("record_sessions_percent")>0&&100*Math.random()<=this.get_config("record_sessions_percent");e||n?t(!0):this._should_load_recorder().then(function(e){e&&t(!1)})}else Hd.critical("Browser does not support MutationObserver; skipping session recording")}),Jp.prototype.start_session_recording=function(){this._check_and_start_session_recording(!0)},Jp.prototype.stop_session_recording=function(){return this._recorder?this._recorder.stopRecording():Promise.resolve()},Jp.prototype.pause_session_recording=function(){return this._recorder?this._recorder.pauseRecording():Promise.resolve()},Jp.prototype.resume_session_recording=function(){return this._recorder?this._recorder.resumeRecording():Promise.resolve()},Jp.prototype.is_recording_heatmap_data=function(){return this._get_session_replay_id()&&this.get_config("record_heatmap_data")},Jp.prototype.get_session_recording_properties=function(){var e={},t=this._get_session_replay_id();return t&&(e.$mp_replay_id=t),e},Jp.prototype.get_session_replay_url=function(){var e=null,t=this._get_session_replay_id();t&&(e="https://mixpanel.com/projects/replay-redirect?"+Kd.HTTPBuildQuery({replay_id:t,distinct_id:this.get_distinct_id(),token:this.get_config("token")}));return e},Jp.prototype._get_session_replay_id=function(){var e=null;return this._recorder&&(e=this._recorder.replayId),e||null},Jp.prototype.__get_recorder=function(){return this._recorder},Jp.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var e=Kd.info.campaignParams(null);Kd.each(e,function(e,t){this.unregister(t)}.bind(this))}},Jp.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(Fd.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(Kd.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(Fd.referrer)},Jp.prototype._dom_loaded=function(){Kd.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),this.has_opted_out_tracking()||Kd.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue},Jp.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!Wp)return this.__dom_loaded_queue.push([e,t]),!1;var n=(new e).init(this);return n.track.apply(n,t)},Jp.prototype._prepare_callback=function(e,t){if(Kd.isUndefined(e))return null;if(Vp){return function(n){e(n,t)}}var n=this._jsc,i=""+Math.floor(1e8*Math.random()),r=this.get_config("callback_fn")+"["+i+"]";return n[i]=function(r){delete n[i],e(r,t)},r},Jp.prototype._send_request=function(e,t,n,i){var r=!0;if(jp)return this.__request_queue.push(arguments),r;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;i||!Kd.isFunction(n)&&"string"!=typeof n||(i=n,n=null),n=Kd.extend(o,n||{}),Vp||(n.method="GET");var a="POST"===n.method,c=Zp&&a&&"sendbeacon"===n.transport.toLowerCase(),l=n.verbose;t.verbose&&(l=!0),this.get_config("test")&&(t.test=1),l&&(t.verbose=1),this.get_config("img")&&(t.img=1),Vp||(i?t.callback=i:(l||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),a&&(s="data="+encodeURIComponent(t.data),delete t.data),Kd.extend(t,this.get_config("api_extra_query_params")),e+="?"+Kd.HTTPBuildQuery(t);var u=this;if("img"in t){var d=Fd.createElement("img");d.src=e,Fd.body.appendChild(d)}else if(c){try{r=Zp(e,s)}catch(g){u.report_error(g),r=!1}try{i&&i(r?1:0)}catch(g){u.report_error(g)}}else if(Vp)try{var h=new XMLHttpRequest;h.open(n.method,e,!0);var A=this.get_config("xhr_headers");if(a&&(A["Content-Type"]="application/x-www-form-urlencoded"),Kd.each(A,function(e,t){h.setRequestHeader(t,e)}),n.timeout_ms&&void 0!==h.timeout){h.timeout=n.timeout_ms;var p=(new Date).getTime()}h.withCredentials=!0,h.onreadystatechange=function(){var e;if(4===h.readyState)if(200===h.status){if(i)if(l){var t;try{t=Kd.JSONDecode(h.responseText)}catch(g){if(u.report_error(g),!n.ignore_json_errors)return;t=h.responseText}i(t)}else i(Number(h.responseText))}else if(e=h.timeout&&!h.status&&(new Date).getTime()-p>=h.timeout?"timeout":"Bad HTTP status: "+h.status+" "+h.statusText,u.report_error(e),i)if(l){var r=h.responseHeaders||{};i({status:0,httpStatusCode:h.status,error:e,retryAfter:r["Retry-After"]})}else i(0)},h.send(s)}catch(g){u.report_error(g),r=!1}else{var m=Fd.createElement("script");m.type="text/javascript",m.async=!0,m.defer=!0,m.src=e;var f=Fd.getElementsByTagName("script")[0];f.parentNode.insertBefore(m,f)}return r},Jp.prototype._execute_array=function(e){var t,n=[],i=[],r=[];Kd.each(e,function(e){e&&(t=e[0],Kd.isArray(t)?r.push(e):"function"==typeof e?e.call(this):Kd.isArray(e)&&"alias"===t?n.push(e):Kd.isArray(e)&&-1!==t.indexOf("track")&&"function"==typeof this[t]?r.push(e):i.push(e))},this);var o=function(e,t){Kd.each(e,function(e){if(Kd.isArray(e[0])){var n=t;Kd.each(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};o(n,this),o(i,this),o(r,this)},Jp.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},Jp.prototype.get_batcher_configs=function(){var e="__mpq_"+this.get_config("token");return this._batcher_configs=this._batcher_configs||{events:{type:"events",api_name:"track",queue_key:e+"_ev"},people:{type:"people",api_name:"engage",queue_key:e+"_pp"},groups:{type:"groups",api_name:"groups",queue_key:e+"_gr"}},this._batcher_configs},Jp.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=Kd.bind(function(e){return new Lh(e.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:Kd.bind(function(t,n,i){var r=this.get_config("api_routes");this._send_request(this.get_api_host(e.api_name)+"/"+r[e.api_name],this._encode_data_for_request(t),n,this._prepare_callback(i,t))},this),beforeSendHook:Kd.bind(function(t){var n=this._run_hook("before_send_"+e.type,t);return n?n[0]:null},this),stopAllBatchingFunc:Kd.bind(this.stop_batch_senders,this),usePersistence:!0})},this),t=this.get_batcher_configs();this.request_batchers={events:e(t.events),people:e(t.people),groups:e(t.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},Jp.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,Kd.each(this.request_batchers,function(e){e.start()}))},Jp.prototype.stop_batch_senders=function(){this._batch_requests=!1,Kd.each(this.request_batchers,function(e){e.stop(),e.clear()})},Jp.prototype.push=function(e){this._execute_array([e])},Jp.prototype.disable=function(e){void 0===e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},Jp.prototype._encode_data_for_request=function(e){var t=lh(e);return this.get_config("api_payload_format")===Kp&&(t=Kd.base64Encode(t)),{data:t}},Jp.prototype._track_or_batch=function(e,t){var n=Kd.truncate(e.data,255),i=e.endpoint,r=e.batcher,o=e.should_send_immediately,s=e.send_request_options||{};t=t||ch;var a=!0,c=Kd.bind(function(){return s.skip_hooks||(n=this._run_hook("before_send_"+e.type,n))&&(n=n[0]),n?(Hd.log("MIXPANEL REQUEST:"),Hd.log(n),this._send_request(i,this._encode_data_for_request(n),s,this._prepare_callback(t,n))):null},this);return this._batch_requests&&!o?r.enqueue(n).then(function(e){e?t(1,n):c()}):a=c(),a&&n},Jp.prototype.track=bh(function(e,t,n,i){var r;if(!n||!n.skip_hooks){if(null===(r=this._run_hook("before_track",e,t)))return;e=r[0],t=r[1]}i||"function"!=typeof n||(i=n,n=null);var o=(n=n||{}).transport;o&&(n.transport=o);var s=n.send_immediately;if("function"!=typeof i&&(i=ch),Kd.isUndefined(e))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(e)){(t=Kd.extend({},t)).token=this.get_config("token");var a=this.persistence.remove_event_timer(e);if(!Kd.isUndefined(a)){var c=(new Date).getTime()-a;t.$duration=parseFloat((c/1e3).toFixed(3))}this._set_default_superprops();var l=this.get_config("track_marketing")?Kd.info.marketingParams():{};t=Kd.extend({},Kd.info.properties({mp_loader:this.get_config("mp_loader")}),l,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),t);var u=this.get_config("property_blacklist");Kd.isArray(u)?Kd.each(u,function(e){delete t[e]}):this.report_error("Invalid value for property_blacklist config: "+u);var d={event:e,properties:t};return r=this._track_or_batch({type:"events",data:d,endpoint:this.get_api_host("events")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:s,send_request_options:n},i)}i(0)}}),Jp.prototype.set_group=bh(function(e,t,n){Kd.isArray(t)||(t=[t]);var i={};return i[e]=t,this.register(i),this.people.set(e,t,n)}),Jp.prototype.add_group=bh(function(e,t,n){var i=this.get_property(e),r={};return void 0===i?(r[e]=[t],this.register(r)):-1===i.indexOf(t)&&(i.push(t),r[e]=i,this.register(r)),this.people.union(e,t,n)}),Jp.prototype.remove_group=bh(function(e,t,n){var i=this.get_property(e);if(void 0!==i){var r=i.indexOf(t);r>-1&&(i.splice(r,1),this.register({group_key:i})),0===i.length&&this.unregister(e)}return this.people.remove(e,t,n)}),Jp.prototype.track_with_groups=bh(function(e,t,n,i){var r=Kd.extend({},t||{});return Kd.each(n,function(e,t){null!=e&&(r[t]=e)}),this.track(e,r,i)}),Jp.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},Jp.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},Jp.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),i=this._cached_groups[n];return void 0!==i&&i._group_key===e&&i._group_id===t||((i=new Sp)._init(this,e,t),this._cached_groups[n]=i),i},Jp.prototype.track_pageview=bh(function(e,t){"object"!=typeof e&&(e={});var n=(t=t||{}).event_name||"$mp_web_page_view",i=Kd.extend(Kd.info.mpPageViewProperties(),Kd.info.campaignParams(),Kd.info.clickParams()),r=Kd.extend({},i,e);return this.track(n,r)}),Jp.prototype.track_links=function(){return this._track_dom.call(this,mp,arguments)},Jp.prototype.track_forms=function(){return this._track_dom.call(this,fp,arguments)},Jp.prototype.time_event=function(e){Kd.isUndefined(e)?this.report_error("No event name provided to mixpanel.time_event"):this._event_is_disabled(e)||this.persistence.set_event_timer(e,(new Date).getTime())};var $p={persistent:!0},em=function(e){var t;return t=Kd.isObject(e)?e:Kd.isUndefined(e)?{}:{days:e},Kd.extend({},$p,t)};Jp.prototype.register=function(e,t){var n=this._run_hook("before_register",e,t);if(null!==n){e=n[0],t=n[1];var i=em(t);i.persistent?this.persistence.register(e,i.days):Kd.extend(this.unpersisted_superprops,e)}},Jp.prototype.register_once=function(e,t,n){var i=this._run_hook("before_register_once",e,t,n);if(null!==i){e=i[0],t=i[1],n=i[2];var r=em(n);r.persistent?this.persistence.register_once(e,t,r.days):(void 0===t&&(t="None"),Kd.each(e,function(e,n){this.unpersisted_superprops.hasOwnProperty(n)&&this.unpersisted_superprops[n]!==t||(this.unpersisted_superprops[n]=e)},this))}},Jp.prototype.unregister=function(e,t){var n=this._run_hook("before_unregister",e,t);null!==n&&(e=n[0],t=n[1],(t=em(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e])},Jp.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},Jp.prototype.identify=function(e,t,n,i,r,o,s,a){var c=this._run_hook("before_identify",e);if(null===c)return-1;e=c[0];var l=this.get_distinct_id();if(e&&l!==e){if("string"==typeof e&&0===e.indexOf(Hp))return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var u=l;this.register_once({$had_persisted_distinct_id:!0,$device_id:u},"")}e!==l&&e!==this.get_property(Lp)&&(this.unregister(Lp),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,i,r,o,s,a),e!==l&&this.track("$identify",{distinct_id:e,$anon_distinct_id:l},{skip_hooks:!0}),e!==l&&this.flags.fetchFlags()},Jp.prototype.reset=function(){this.stop_session_recording(),this.persistence.clear(),this._flags.identify_called=!1;var e=Kd.UUID();this.register_once({distinct_id:Hp+e,$device_id:e},""),this._check_and_start_session_recording()},Jp.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},Jp.prototype.alias=function(e,t){if(e===this.get_property(Tp))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return Kd.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Lp,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},function(){n.identify(e)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},Jp.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},Jp.prototype.set_config=function(e){Kd.isObject(e)&&(Kd.extend(this.config,e),e.batch_size&&Kd.each(this.request_batchers,function(e){e.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),kd.DEBUG=kd.DEBUG||this.get_config("debug"),("autocapture"in e||"record_heatmap_data"in e)&&this.autocapture&&this.autocapture.init(),Kd.isObject(e.hooks)&&(this.hooks={},Kd.each(e.hooks,function(e,t){if(Kd.isFunction(e))this.hooks[t]=[e];else if(Kd.isArray(e)){this.hooks[t]=[];for(var n=0;n<e.length;n++)Kd.isFunction(e[n])||Hd.critical("Invalid hook added. Hook is not a function"),this.hooks[t].push(e[n])}else Hd.critical("Invalid hooks added. Ensure that the hook values passed into config.hooks are functions or arrays of functions.")},this)))},Jp.prototype.get_config=function(e){return this.config[e]},Jp.prototype._run_hook=function(e){var t=Ed.call(arguments,1);return Kd.each(this.hooks[e],function(n){if(null===t)return null;var i=n.apply(this,t);void 0===i?(this.report_error(e+" hook did not return a valid value"),t=null):(Kd.isArray(i)||(i=[i]),t.splice.apply(t,[0,i.length].concat(i)))},this),t},Jp.prototype.get_property=function(e){return this.persistence.load_prop([e])},Jp.prototype.get_api_host=function(e){return this.get_config("api_hosts")[e]||this.get_config("api_host")},Jp.prototype.toString=function(){var e=this.get_config("name");return e!==Yp&&(e=Yp+"."+e),e},Jp.prototype._event_is_disabled=function(e){return Kd.isBlockedUA(Ld)||this._flags.disable_all_events||Kd.include(this.__disabled_events,e)},Jp.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&Kd.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_tracking()||!this.get_config("opt_out_tracking_by_default")&&!Kd.cookie.get("mp_optout")||(Kd.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},Jp.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t),t?(this.stop_batch_senders(),this.stop_session_recording()):this._batchers_were_started&&this.start_batch_senders()},Jp.prototype._gdpr_call_func=function(e,t){return t=Kd.extend({track:Kd.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),Kd.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})},Jp.prototype.opt_in_tracking=function(e){e=Kd.extend({enable_persistence:!0},e),this._gdpr_call_func(mh,e),this._gdpr_update_persistence(e)},Jp.prototype.opt_out_tracking=function(e){(e=Kd.extend({clear_persistence:!0,delete_user:!0},e)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(fh,e),this._gdpr_update_persistence(e)},Jp.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(gh,e)},Jp.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(yh,e)},Jp.prototype.clear_opt_in_out_tracking=function(e){e=Kd.extend({enable_persistence:!0},e),this._gdpr_call_func(kh,e),this._gdpr_update_persistence(e)},Jp.prototype.report_error=function(e,t){Hd.error.apply(Hd.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){Hd.error(n)}},Jp.prototype.add_hook=function(e,t){this.hooks[e]||(this.hooks[e]=[]),this.hooks[e].push(t)},Jp.prototype.remove_hook=function(e,t){var n;this.hooks[e]&&(-1!==(n=this.hooks[e].indexOf(t))?this.hooks[e].splice(n,1):Hd.log("remove_hook failed. Matching hook was not found"))},Jp.prototype.init=Jp.prototype.init,Jp.prototype.reset=Jp.prototype.reset,Jp.prototype.disable=Jp.prototype.disable,Jp.prototype.time_event=Jp.prototype.time_event,Jp.prototype.track=Jp.prototype.track,Jp.prototype.track_links=Jp.prototype.track_links,Jp.prototype.track_forms=Jp.prototype.track_forms,Jp.prototype.track_pageview=Jp.prototype.track_pageview,Jp.prototype.register=Jp.prototype.register,Jp.prototype.register_once=Jp.prototype.register_once,Jp.prototype.unregister=Jp.prototype.unregister,Jp.prototype.identify=Jp.prototype.identify,Jp.prototype.alias=Jp.prototype.alias,Jp.prototype.name_tag=Jp.prototype.name_tag,Jp.prototype.set_config=Jp.prototype.set_config,Jp.prototype.get_config=Jp.prototype.get_config,Jp.prototype.get_api_host=Jp.prototype.get_api_host,Jp.prototype.get_property=Jp.prototype.get_property,Jp.prototype.get_distinct_id=Jp.prototype.get_distinct_id,Jp.prototype.toString=Jp.prototype.toString,Jp.prototype.opt_out_tracking=Jp.prototype.opt_out_tracking,Jp.prototype.opt_in_tracking=Jp.prototype.opt_in_tracking,Jp.prototype.has_opted_out_tracking=Jp.prototype.has_opted_out_tracking,Jp.prototype.has_opted_in_tracking=Jp.prototype.has_opted_in_tracking,Jp.prototype.clear_opt_in_out_tracking=Jp.prototype.clear_opt_in_out_tracking,Jp.prototype.get_group=Jp.prototype.get_group,Jp.prototype.set_group=Jp.prototype.set_group,Jp.prototype.add_group=Jp.prototype.add_group,Jp.prototype.remove_group=Jp.prototype.remove_group,Jp.prototype.add_hook=Jp.prototype.add_hook,Jp.prototype.remove_hook=Jp.prototype.remove_hook,Jp.prototype.track_with_groups=Jp.prototype.track_with_groups,Jp.prototype.start_batch_senders=Jp.prototype.start_batch_senders,Jp.prototype.stop_batch_senders=Jp.prototype.stop_batch_senders,Jp.prototype.start_session_recording=Jp.prototype.start_session_recording,Jp.prototype.stop_session_recording=Jp.prototype.stop_session_recording,Jp.prototype.pause_session_recording=Jp.prototype.pause_session_recording,Jp.prototype.resume_session_recording=Jp.prototype.resume_session_recording,Jp.prototype.get_session_recording_properties=Jp.prototype.get_session_recording_properties,Jp.prototype.get_session_replay_url=Jp.prototype.get_session_replay_url,Jp.prototype.get_tab_id=Jp.prototype.get_tab_id,Jp.prototype.DEFAULT_API_ROUTES=Xp,Jp.prototype.__get_recorder=Jp.prototype.__get_recorder,Rp.prototype.properties=Rp.prototype.properties,Rp.prototype.update_search_keyword=Rp.prototype.update_search_keyword,Rp.prototype.update_referrer_info=Rp.prototype.update_referrer_info,Rp.prototype.get_cross_subdomain=Rp.prototype.get_cross_subdomain,Rp.prototype.clear=Rp.prototype.clear;var tm={},nm=function(){zp.init=function(e,t,n){if(n)return zp[n]||(zp[n]=tm[n]=_p(e,t,n),zp[n]._loaded()),zp[n];var i=zp;tm[Yp]?i=tm[Yp]:e&&((i=_p(e,t,Yp))._loaded(),tm[Yp]=i),zp=i,1===Ip&&(me[Yp]=zp),Kd.each(tm,function(e,t){t!==Yp&&(zp[t]=e)}),zp._=Kd}};var im=(qp=function(e,t){t()},Ip=0,zp=new Jp,nm(),zp.init(),function(){function e(){e.done||(e.done=!0,Wp=!0,jp=!1,Kd.each(tm,function(e){e._dom_loaded()}))}if(Fd.addEventListener)"complete"===Fd.readyState?e():Fd.addEventListener("DOMContentLoaded",e,!1);else if(Fd.attachEvent){Fd.attachEvent("onreadystatechange",e);var t=!1;try{t=null===me.frameElement}catch(n){}Fd.documentElement.doScroll&&t&&function t(){try{Fd.documentElement.doScroll("left")}catch(n){return void setTimeout(t,1)}e()}()}Kd.register_event(me,"load",e,!0)}(),zp);let rm=!1;const om=()=>{rm||(im.init("c9fdb235976ef567b15bcb07bad264f3",{debug:!1,track_pageview:!1,persistence:"localStorage"}),rm=!0)},sm={init:()=>{om()},track:(e,t={})=>{rm||om(),im.track(e,{source:"coinley-sdk",...t,timestamp:(new Date).toISOString()})},trackModalOpened:(e,t)=>{sm.track("SDK Modal Opened",{merchant_name:e,amount:t})},trackModalClosed:(e="user_closed")=>{sm.track("SDK Modal Closed",{reason:e})},trackNetworkSelected:(e,t)=>{sm.track("Network Selected",{network:e,merchant_name:t})},trackTokenSelected:(e,t,n)=>{sm.track("Token Selected",{token:e,network:t,merchant_name:n})},trackWalletConnectStarted:e=>{sm.track("Wallet Connect Started",{wallet_type:e})},trackWalletConnected:(e,t,n)=>{sm.track("Wallet Connected",{wallet_type:e,wallet_address:(null==t?void 0:t.slice(0,10))+"...",network:n})},trackWalletConnectionFailed:(e,t)=>{sm.track("Wallet Connection Failed",{wallet_type:e,error:(null==t?void 0:t.message)||t})},trackWalletDisconnected:()=>{sm.track("Wallet Disconnected")},trackPaymentCreated:(e,t,n,i)=>{sm.track("Payment Created",{payment_id:e,amount:t,network:n,token:i})},trackPaymentApprovalStarted:(e,t)=>{sm.track("Payment Approval Started",{payment_id:e,amount:t})},trackPaymentApproved:(e,t)=>{sm.track("Payment Approved",{payment_id:e,amount:t})},trackPaymentExecutionStarted:(e,t)=>{sm.track("Payment Execution Started",{payment_id:e,amount:t})},trackPaymentSuccess:(e,t,n,i,r)=>{sm.track("Payment Success",{payment_id:e,amount:t,network:n,token:i,transaction_hash:r})},trackPaymentFailed:(e,t,n,i,r)=>{sm.track("Payment Failed",{payment_id:e,amount:t,network:n,token:i,error:(null==r?void 0:r.message)||r})},trackPaymentCancelled:(e,t)=>{sm.track("Payment Cancelled",{payment_id:e,stage:t})},trackError:(e,t,n={})=>{sm.track("SDK Error",{error_type:e,error_message:t,...n})},trackNetworkSwitchRequested:(e,t)=>{sm.track("Network Switch Requested",{from_network:e,to_network:t})},trackNetworkSwitchSuccess:e=>{sm.track("Network Switch Success",{network:e})},trackNetworkSwitchFailed:(e,t)=>{sm.track("Network Switch Failed",{network:e,error:(null==t?void 0:t.message)||t})}};let am=!1;const cm=(e,t)=>{"undefined"!=typeof window&&window.clarity&&window.clarity("set",e,t)},lm={init:e=>((e="v0r7eqoiy1")=>{var t,n,i,r,o,s,a;am||"undefined"==typeof window||(t=window,n=document,r="script",o=e,t[i="clarity"]=t[i]||function(){(t[i].q=t[i].q||[]).push(arguments)},(s=n.createElement(r)).async=1,s.src="https://www.clarity.ms/tag/"+o,(a=n.getElementsByTagName(r)[0]).parentNode.insertBefore(s,a),am=!0)})(e),trackModalOpened:(e,t)=>{cm("event","modal_opened"),cm("merchant",e||"unknown"),cm("amount",String(t||0))},trackModalClosed:e=>{cm("event","modal_closed"),cm("close_reason",e||"unknown")},trackNetworkSelected:(e,t)=>{cm("event","network_selected"),cm("network",e||"unknown")},trackTokenSelected:(e,t,n)=>{cm("event","token_selected"),cm("token",e||"unknown"),cm("network",t||"unknown")},trackPaymentCreated:(e,t,n,i)=>{cm("event","payment_created"),cm("payment_id",e||"unknown"),cm("network",n||"unknown"),cm("token",i||"unknown")},trackPaymentSuccess:(e,t,n,i,r)=>{cm("event","payment_success"),cm("payment_id",e||"unknown"),cm("network",n||"unknown"),cm("token",i||"unknown")},trackPaymentFailed:(e,t,n,i,r)=>{cm("event","payment_failed"),cm("payment_id",e||"unknown"),cm("error",String(r||"unknown").substring(0,100))},trackError:(e,t,n)=>{cm("event","error"),cm("error_type",e||"unknown"),cm("error_message",String(t||"").substring(0,100))},identify:(e,t)=>((e,t)=>{"undefined"!=typeof window&&window.clarity&&window.clarity("identify",e,t)})(e,t)},um={USD:{id:2781,symbol:"USD",name:"US Dollar",sign:"$"},NGN:{id:2819,symbol:"NGN",name:"Nigerian Naira",sign:"₦"},GHS:{id:2796,symbol:"GHS",name:"Ghana Cedis",sign:"GH₵"},ZAR:{id:2812,symbol:"ZAR",name:"South African Rand",sign:"R"},EUR:{id:2790,symbol:"EUR",name:"Euro",sign:"€"},GBP:{id:2791,symbol:"GBP",name:"British Pound",sign:"£"}};let dm={rates:{},timestamp:0,TTL:3e5};const hm=e=>e&&um.hasOwnProperty(e.toUpperCase()),Am=e=>e&&um[e.toUpperCase()]||null,pm=async()=>{var e,t;const n=Date.now();if(dm.timestamp&&n-dm.timestamp<dm.TTL)return dm.rates;try{const i=Object.keys(um).filter(e=>"USD"!==e),r=await fetch(`https://pro-api.coinmarketcap.com/v2/tools/price-conversion?amount=1&symbol=USD&convert=${i.join(",")}`,{headers:{"X-CMC_PRO_API_KEY":"fa1c508f6c3649f082a2bb1ad7962d60",Accept:"application/json"}});if(!r.ok)throw new Error(`CoinMarketCap API error: ${r.status}`);const o=await r.json();if(0!==(null==(e=o.status)?void 0:e.error_code))throw new Error((null==(t=o.status)?void 0:t.error_message)||"Unknown API error");const s={USD:1};if(o.data&&o.data[0]&&o.data[0].quote)for(const e of i)o.data[0].quote[e]&&(s[e]=o.data[0].quote[e].price);return dm={rates:s,timestamp:n,TTL:dm.TTL},s}catch(gd){if(console.error("[CurrencyConversion] Failed to fetch rates:",gd),Object.keys(dm.rates).length>0)return console.warn("[CurrencyConversion] Using stale cached rates"),dm.rates;const t={USD:1,NGN:1550,GHS:15.5,ZAR:18.5,EUR:.92,GBP:.79};return console.warn("[CurrencyConversion] Using fallback rates:",t),t}},mm=async(e,t)=>{const n=(null==t?void 0:t.toUpperCase())||"USD";if("USD"===n)return{usdAmount:parseFloat(e),rate:1,fromCurrency:"USD"};if(!hm(n))throw new Error(`Unsupported currency: ${n}. Supported: ${Object.keys(um).join(", ")}`);const i=(await pm())[n];if(!i)throw new Error(`Exchange rate not available for ${n}`);const r=parseFloat(e)/i;return{usdAmount:Math.round(100*r)/100,rate:i,fromCurrency:n}},fm=(e,t)=>{const n=(null==t?void 0:t.toUpperCase())||"USD",i=Am(n);if(!i)return`${e} ${n}`;const r=new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}).format(e);return`${i.sign}${r}`},gm=async()=>{try{return await pm(),!0}catch(gd){return console.error("[CurrencyConversion] Prefetch failed:",gd),!1}},ym={};function bm(e,t,n,i){if(!e||"object"!=typeof e)return{valid:!1,error:"Invalid payload"};if(!t||"string"!=typeof t)return{valid:!1,error:"Missing signature"};if(!n)return{valid:!1,error:"Missing timestamp"};if(!i||i.length<32)return{valid:!1,error:"Webhook secret must be at least 32 characters"};const r="string"==typeof n?parseInt(n,10):n;if(isNaN(r))return{valid:!1,error:"Invalid timestamp"};if(Date.now()-r>3e5)return{valid:!1,error:"Webhook timestamp too old (potential replay attack)"};const o={...e,timestamp:parseInt(r)},s=JSON.stringify(o,Object.keys(o).sort()),a=ym.createHmac("sha256",i).update(s).digest("hex"),c=t.startsWith("sha256=")?t.slice(7):t;try{const e=B.from(c,"hex"),t=B.from(a,"hex");if(e.length!==t.length)return{valid:!1,error:"Invalid webhook signature"};if(!ym.timingSafeEqual(e,t))return{valid:!1,error:"Invalid webhook signature"}}catch{return{valid:!1,error:"Invalid webhook signature"}}return{valid:!0}}"undefined"!=typeof window&&(window.Buffer=M),"undefined"!=typeof globalThis&&(globalThis.Buffer=M);const wm={formatAmount:(e,t=2)=>e.toFixed(t),truncateAddress:(e,t=6,n=4)=>e?e.length<=t+n?e:`${e.slice(0,t)}...${e.slice(-n)}`:"",isValidAddress:(e,t)=>{if(!e)return!1;switch(t.toLowerCase()){case"ethereum":case"bsc":case"polygon":return/^0x[a-fA-F0-9]{40}$/.test(e);case"tron":return/^T[a-zA-Z0-9]{33}$/.test(e);case"solana":return/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(e);default:return e.length>0}},copyToClipboard:async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}};class vm extends Error{constructor(e,t){super(e),this.name="CoinleyError",this.code=t}}const km={react:"\nimport { CoinleyProvider, CoinleyCheckout } from 'coinley-test';\n\n// New recommended way - using publicKey only\n<CoinleyProvider\n publicKey=\"pk_your-public-key\"\n apiUrl=\"https://api.coinley.io\"\n>\n <CoinleyCheckout\n ref={checkoutRef}\n onSuccess={({ paymentId, transactionHash, senderAddress, network, currency, paymentDetails }) => {\n console.log('Payment successful!');\n console.log('Payment ID:', paymentId);\n console.log('Transaction Hash:', transactionHash);\n console.log('Sender Address:', senderAddress); // Wallet address that made the payment\n console.log('Network:', network); // e.g., 'ethereum', 'bsc', 'polygon'\n console.log('Currency:', currency); // e.g., 'USDT', 'USDC'\n console.log('Full Details:', paymentDetails);\n }}\n onError={(error) => console.error('Error:', error)}\n onClose={() => console.log('Closed')}\n />\n</CoinleyProvider>\n\n// Legacy way (still supported) - using apiKey + apiSecret\n<CoinleyProvider\n apiKey=\"your-api-key\"\n apiSecret=\"your-api-secret\"\n apiUrl=\"https://api.coinley.io\"\n>\n ...\n</CoinleyProvider>\n ",vanilla:'\n\x3c!-- Include via CDN --\x3e\n<script src="https://unpkg.com/coinley-test@latest/vanilla"><\/script>\n<link rel="stylesheet" href="https://unpkg.com/coinley-test@latest/vanilla/style.css">\n\n<script>\n// New recommended way - using publicKey only\nconst coinley = new CoinleyVanilla({\n publicKey: "pk_your-public-key",\n apiUrl: "https://api.coinley.io",\n theme: "light"\n});\n\n// Legacy way (still supported)\nconst coinleyLegacy = new CoinleyVanilla({\n apiKey: "your-api-key",\n apiSecret: "your-api-secret",\n apiUrl: "https://api.coinley.io",\n theme: "light"\n});\n\n// Use in checkout\ncoinley.open({\n amount: 100,\n currency: "USD", // Supported: USD, EUR, NGN, GHS, ZAR\n customerEmail: "customer@example.com",\n merchantName: "Your Store",\n merchantWalletAddresses: {\n ethereum: "0x...",\n bsc: "0x..."\n }\n}, {\n onSuccess: ({ paymentId, transactionHash, senderAddress, network, currency, paymentDetails }) => {\n console.log(\'Payment successful!\');\n console.log(\'Sender Address:\', senderAddress); // Wallet that made the payment\n console.log(\'Network:\', network); // e.g., \'ethereum\', \'bsc\'\n console.log(\'Currency:\', currency); // e.g., \'USDT\', \'USDC\'\n },\n onError: (error) => console.error(\'Error:\', error),\n onClose: () => console.log(\'Closed\')\n});\n<\/script>\n '};function xm(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};return Object.assign(t,{extend:function e(t){return n=>{const i="function"==typeof n?n(t):n,r={...t,...i};return Object.assign(r,{extend:e(r)})}}(t)})}const Cm="2.54.6";let Sm={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Cm}`};class Bm extends Error{constructor(e,t={}){var n;const i=t.cause instanceof Bm?t.cause.details:(null==(r=t.cause)?void 0:r.message)?t.cause.message:t.details;var r;const o=t.cause instanceof Bm&&t.cause.docsPath||t.docsPath,s=null==(n=Sm.getDocsUrl)?void 0:n.call(Sm,{...t,docsPath:o});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...i?[`Details: ${i}`]:[],...Sm.version?[`Version: ${Sm.version}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=i,this.docsPath=o,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=Cm}walk(e){return Im(this,e)}}function Im(e,t){return(null==t?void 0:t(e))?e:e&&"object"==typeof e&&"cause"in e&&void 0!==e.cause?Im(e.cause,t):t?null:e}class Em extends Bm{constructor({max:e,min:t,signed:n,size:i,value:r}){super(`Number "${r}" is not in safe ${i?`${8*i}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class Mm extends Bm{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function Dm(e,{strict:t=!0}={}){return!!e&&("string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")))}function Qm(e){return Dm(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function Um(e,{dir:t="left"}={}){let n="string"==typeof e?e.replace("0x",""):e,i=0;for(let r=0;r<n.length-1&&"0"===n["left"===t?r:n.length-r-1].toString();r++)i++;return n="left"===t?n.slice(i):n.slice(0,n.length-i),"string"==typeof e?(1===n.length&&"right"===t&&(n=`${n}0`),`0x${n.length%2==1?`0${n}`:n}`):n}class Fm extends Bm{constructor({offset:e,position:t,size:n}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}class Nm extends Bm{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function Tm(e,{dir:t,size:n=32}={}){return"string"==typeof e?function(e,{dir:t,size:n=32}={}){if(null===n)return e;const i=e.replace("0x","");if(i.length>2*n)throw new Nm({size:Math.ceil(i.length/2),targetSize:n,type:"hex"});return`0x${i["right"===t?"padEnd":"padStart"](2*n,"0")}`}(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new Nm({size:e.length,targetSize:n,type:"bytes"});const i=new Uint8Array(n);for(let r=0;r<n;r++){const o="right"===t;i[o?r:n-r-1]=e[o?r:e.length-r-1]}return i}(e,{dir:t,size:n})}const Lm=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Pm(e,t={}){return"number"==typeof e||"bigint"==typeof e?Rm(e,t):"string"==typeof e?function(e,t={}){const n=zm.encode(e);return Om(n,t)}(e,t):"boolean"==typeof e?function(e,t={}){const n=`0x${Number(e)}`;if("number"==typeof t.size)return Zm(n,{size:t.size}),Tm(n,{size:t.size});return n}(e,t):Om(e,t)}function Om(e,t={}){let n="";for(let r=0;r<e.length;r++)n+=Lm[e[r]];const i=`0x${n}`;return"number"==typeof t.size?(Zm(i,{size:t.size}),Tm(i,{dir:"right",size:t.size})):i}function Rm(e,t={}){const{signed:n,size:i}=t,r=BigInt(e);let o;i?o=n?(1n<<8n*BigInt(i)-1n)-1n:2n**(8n*BigInt(i))-1n:"number"==typeof e&&(o=BigInt(Number.MAX_SAFE_INTEGER));const s="bigint"==typeof o&&n?-o-1n:0;if(o&&r>o||r<s){const t="bigint"==typeof e?"n":"";throw new Em({max:o?`${o}${t}`:void 0,min:`${s}${t}`,signed:n,size:i,value:`${e}${t}`})}const a=`0x${(n&&r<0?(1n<<BigInt(8*i))+BigInt(r):r).toString(16)}`;return i?Tm(a,{size:i}):a}const zm=new TextEncoder;const qm=new TextEncoder;function Ym(e,t={}){return"number"==typeof e||"bigint"==typeof e?function(e,t){const n=Rm(e,t);return Vm(n)}(e,t):"boolean"==typeof e?function(e,t={}){const n=new Uint8Array(1);if(n[0]=Number(e),"number"==typeof t.size)return Zm(n,{size:t.size}),Tm(n,{size:t.size});return n}(e,t):Dm(e)?Vm(e,t):jm(e,t)}const Km={zero:48,nine:57,A:65,F:70,a:97,f:102};function Hm(e){return e>=Km.zero&&e<=Km.nine?e-Km.zero:e>=Km.A&&e<=Km.F?e-(Km.A-10):e>=Km.a&&e<=Km.f?e-(Km.a-10):void 0}function Vm(e,t={}){let n=e;t.size&&(Zm(n,{size:t.size}),n=Tm(n,{dir:"right",size:t.size}));let i=n.slice(2);i.length%2&&(i=`0${i}`);const r=i.length/2,o=new Uint8Array(r);for(let s=0,a=0;s<r;s++){const e=Hm(i.charCodeAt(a++)),t=Hm(i.charCodeAt(a++));if(void 0===e||void 0===t)throw new Bm(`Invalid byte sequence ("${i[a-2]}${i[a-1]}" in "${i}").`);o[s]=16*e+t}return o}function jm(e,t={}){const n=qm.encode(e);return"number"==typeof t.size?(Zm(n,{size:t.size}),Tm(n,{dir:"right",size:t.size})):n}function Zm(e,{size:t}){if(Qm(e)>t)throw new Mm({givenSize:Qm(e),maxSize:t})}function Xm(e,t={}){const{signed:n}=t;t.size&&Zm(e,{size:t.size});const i=BigInt(e);if(!n)return i;const r=(e.length-2)/2;return i<=(1n<<8n*BigInt(r)-1n)-1n?i:i-BigInt(`0x${"f".padStart(2*r,"f")}`)-1n}function Gm(e,t={}){const n=Xm(e,t),i=Number(n);if(!Number.isSafeInteger(i))throw new Em({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${n}n`});return i}function Wm(e,t){return({exclude:n,format:i})=>({exclude:n,format:(e,r)=>{const o=t(e,r);if(n)for(const t of n)delete o[t];return{...o,...i(e,r)}},type:e})}const Jm={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function _m(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,...null!=e.blockTimestamp&&{blockTimestamp:BigInt(e.blockTimestamp)},chainId:e.chainId?Gm(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?Gm(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Jm[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=e.authorizationList.map(e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if("bigint"==typeof n.v){if(0n===n.v||27n===n.v)return 0;if(1n===n.v||28n===n.v)return 1;if(n.v>=35n)return n.v%2n==0n?1:0}})(),"legacy"===n.type&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),"eip2930"===n.type&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),"eip1559"===n.type&&delete n.maxFeePerBlobGas,n}const $m=Wm("transaction",_m);function ef(e,t){const n=(e.transactions??[]).map(e=>"string"==typeof e?e:_m(e));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const tf=Wm("block",ef);function nf(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):null===e.blockTimestamp?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const rf={"0x0":"reverted","0x1":"success"};function of(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(e=>nf(e)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Gm(e.transactionIndex):null,status:e.status?rf[e.status]:null,type:e.type?Jm[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const sf=Wm("transactionReceipt",of),af={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function cf(e,t){const n={};return void 0!==e.authorizationList&&(n.authorizationList=e.authorizationList.map(e=>({address:e.address,r:e.r?Rm(BigInt(e.r)):e.r,s:e.s?Rm(BigInt(e.s)):e.s,chainId:Rm(e.chainId),nonce:Rm(e.nonce),...void 0!==e.yParity?{yParity:Rm(e.yParity)}:{},...void 0!==e.v&&void 0===e.yParity?{v:Rm(e.v)}:{}}))),void 0!==e.accessList&&(n.accessList=e.accessList),void 0!==e.blobVersionedHashes&&(n.blobVersionedHashes=e.blobVersionedHashes),void 0!==e.blobs&&("string"!=typeof e.blobs[0]?n.blobs=e.blobs.map(e=>Om(e)):n.blobs=e.blobs),void 0!==e.data&&(n.data=e.data),e.account&&(n.from=e.account.address),void 0!==e.from&&(n.from=e.from),void 0!==e.gas&&(n.gas=Rm(e.gas)),void 0!==e.gasPrice&&(n.gasPrice=Rm(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(n.maxFeePerBlobGas=Rm(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(n.maxFeePerGas=Rm(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(n.maxPriorityFeePerGas=Rm(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(n.nonce=Rm(e.nonce)),void 0!==e.to&&(n.to=e.to),void 0!==e.type&&(n.type=af[e.type]),void 0!==e.value&&(n.value=Rm(e.value)),n}const lf=Wm("transactionRequest",cf);const uf=2n**256n-1n,df=50000n,hf=2097120n,Af={block:tf({format(e){var t;const n=null==(t=e.transactions)?void 0:t.map(e=>{var t;if("string"==typeof e)return e;const n=null==(t=Af.transaction)?void 0:t.format(e);return"0x71"===n.typeHex?n.type="eip712":"0xff"===n.typeHex&&(n.type="priority"),n});return{l1BatchNumber:e.l1BatchNumber?Xm(e.l1BatchNumber):null,l1BatchTimestamp:e.l1BatchTimestamp?Xm(e.l1BatchTimestamp):null,transactions:n}}}),transaction:$m({format(e){const t={};return"0x71"===e.type?t.type="eip712":"0xff"===e.type&&(t.type="priority"),{...t,l1BatchNumber:e.l1BatchNumber?Xm(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?Xm(e.l1BatchTxIndex):null}}}),transactionReceipt:sf({format:e=>({l1BatchNumber:e.l1BatchNumber?Xm(e.l1BatchNumber):null,l1BatchTxIndex:e.l1BatchTxIndex?Xm(e.l1BatchTxIndex):null,logs:e.logs.map(e=>({...nf(e),l1BatchNumber:e.l1BatchNumber?Xm(e.l1BatchNumber):null,transactionLogIndex:Gm(e.transactionLogIndex),logType:e.logType})),l2ToL1Logs:e.l2ToL1Logs.map(e=>({blockNumber:Xm(e.blockHash),blockHash:e.blockHash,l1BatchNumber:e.l1BatchNumber?Xm(e.l1BatchNumber):null,transactionIndex:Xm(e.transactionIndex),shardId:Xm(e.shardId),isService:e.isService,sender:e.sender,key:e.key,value:e.value,transactionHash:e.transactionHash,logIndex:Xm(e.logIndex)}))})}),transactionRequest:lf({exclude:["customSignature","factoryDeps","gasPerPubdata","paymaster","paymasterInput"],format:e=>e.gasPerPubdata||e.paymaster&&e.paymasterInput||e.factoryDeps||e.customSignature?{eip712Meta:{...e.gasPerPubdata?{gasPerPubdata:Pm(e.gasPerPubdata)}:{gasPerPubdata:Pm(df)},...e.paymaster&&e.paymasterInput?{paymasterParams:{paymaster:e.paymaster,paymasterInput:Array.from(Vm(e.paymasterInput))}}:{},...e.factoryDeps?{factoryDeps:e.factoryDeps.map(e=>Array.from(Vm(e)))}:{},...e.customSignature?{customSignature:Array.from(Vm(e.customSignature))}:{}},type:"0x71"}:{}})};function pf(e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}class mf extends Bm{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class ff extends Bm{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class gf extends Bm{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const yf={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new gf({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new ff({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new mf({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new mf({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function bf(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(yf);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function wf(e,t="hex"){const n=vf(e),i=bf(new Uint8Array(n.length));return n.encode(i),"hex"===t?Om(i.bytes):i.bytes}function vf(e){return Array.isArray(e)?function(e){const t=e.reduce((e,t)=>e+t.length,0),n=kf(t);return{length:t<=55?1+t:1+n+t,encode(i){t<=55?i.pushByte(192+t):(i.pushByte(247+n),1===n?i.pushUint8(t):2===n?i.pushUint16(t):3===n?i.pushUint24(t):i.pushUint32(t));for(const{encode:t}of e)t(i)}}}(e.map(e=>vf(e))):function(e){const t="string"==typeof e?Vm(e):e,n=kf(t.length),i=1===t.length&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length;return{length:i,encode(e){1===t.length&&t[0]<128?e.pushBytes(t):t.length<=55?(e.pushByte(128+t.length),e.pushBytes(t)):(e.pushByte(183+n),1===n?e.pushUint8(t.length):2===n?e.pushUint16(t.length):3===n?e.pushUint24(t.length):e.pushUint32(t.length),e.pushBytes(t))}}}(e)}function kf(e){if(e<256)return 1;if(e<65536)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new Bm("Length is too large.")}const xf={gwei:9,wei:18},Cf={ether:-9,wei:9};function Sf(e,t){let n=e.toString();const i=n.startsWith("-");i&&(n=n.slice(1)),n=n.padStart(t,"0");let[r,o]=[n.slice(0,n.length-t),n.slice(n.length-t)];return o=o.replace(/(0+)$/,""),`${i?"-":""}${r||"0"}${o?`.${o}`:""}`}function Bf(e,t="wei"){return Sf(e,xf[t])}function If(e,t="wei"){return Sf(e,Cf[t])}function Ef(e){const t=Object.entries(e).map(([e,t])=>void 0===t||!1===t?null:[e,t]).filter(Boolean),n=t.reduce((e,[t])=>Math.max(e,t.length),0);return t.map(([e,t])=>` ${`${e}:`.padEnd(n+1)} ${t}`).join("\n")}class Mf extends Bm{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class Df extends Bm{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Ef(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class Qf extends Bm{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}function Uf(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),i="string"==typeof e.blobs[0]?e.blobs.map(e=>Vm(e)):e.blobs,r=[];for(const o of i)r.push(Uint8Array.from(t.blobToKzgCommitment(o)));return"bytes"===n?r:r.map(e=>Om(e))}function Ff(e){const{kzg:t}=e,n=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),i="string"==typeof e.blobs[0]?e.blobs.map(e=>Vm(e)):e.blobs,r="string"==typeof e.commitments[0]?e.commitments.map(e=>Vm(e)):e.commitments,o=[];for(let s=0;s<i.length;s++){const e=i[s],n=r[s];o.push(Uint8Array.from(t.computeBlobKzgProof(e,n)))}return"bytes"===n?o:o.map(e=>Om(e))}const Nf="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;
11
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Tf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function Lf(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Pf(e,...t){if(!Tf(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Of(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");Lf(e.outputLen),Lf(e.blockLen)}function Rf(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function zf(e,t){Pf(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function qf(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Yf(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Kf(e,t){return e<<32-t|e>>>t}function Hf(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const Vf=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])()?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=Hf(e[t]);return e},jf=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),Zf=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Xf(e){if(Pf(e),jf)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=Zf[e[n]];return t}const Gf=48,Wf=57,Jf=65,_f=70,$f=97,eg=102;function tg(e){return e>=Gf&&e<=Wf?e-Gf:e>=Jf&&e<=_f?e-(Jf-10):e>=$f&&e<=eg?e-($f-10):void 0}function ng(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(jf)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(n);for(let r=0,o=0;r<n;r++,o+=2){const t=tg(e.charCodeAt(o)),n=tg(e.charCodeAt(o+1));if(void 0===t||void 0===n){const t=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+o)}i[r]=16*t+n}return i}function ig(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}(e)),Pf(e),e}function rg(...e){let t=0;for(let i=0;i<e.length;i++){const n=e[i];Pf(n),t+=n.length}const n=new Uint8Array(t);for(let i=0,r=0;i<e.length;i++){const t=e[i];n.set(t,r),r+=t.length}return n}class og{}function sg(e){const t=t=>e().update(ig(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function ag(e=32){if(Nf&&"function"==typeof Nf.getRandomValues)return Nf.getRandomValues(new Uint8Array(e));if(Nf&&"function"==typeof Nf.randomBytes)return Uint8Array.from(Nf.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}function cg(e,t,n){return e&t^~e&n}function lg(e,t,n){return e&t^e&n^t&n}class ug extends og{constructor(e,t,n,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(e),this.view=Yf(this.buffer)}update(e){Rf(this),Pf(e=ig(e));const{view:t,buffer:n,blockLen:i}=this,r=e.length;for(let o=0;o<r;){const s=Math.min(i-this.pos,r-o);if(s===i){const t=Yf(e);for(;i<=r-o;o+=i)this.process(t,o);continue}n.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Rf(this),zf(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:i,isLE:r}=this;let{pos:o}=this;t[o++]=128,qf(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(n,0),o=0);for(let u=o;u<i;u++)t[u]=0;!function(e,t,n,i){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,n,i);const r=BigInt(32),o=BigInt(4294967295),s=Number(n>>r&o),a=Number(n&o),c=i?4:0,l=i?0:4;e.setUint32(t+c,s,i),e.setUint32(t+l,a,i)}(n,i-8,BigInt(8*this.length),r),this.process(n,0);const s=Yf(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;u<c;u++)s.setUint32(4*u,l[u],r)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:i,finished:r,destroyed:o,pos:s}=this;return e.destroyed=o,e.finished=r,e.length=i,e.pos=s,i%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}}const dg=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),hg=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Ag=BigInt(2**32-1),pg=BigInt(32);function mg(e,t=!1){return t?{h:Number(e&Ag),l:Number(e>>pg&Ag)}:{h:0|Number(e>>pg&Ag),l:0|Number(e&Ag)}}function fg(e,t=!1){const n=e.length;let i=new Uint32Array(n),r=new Uint32Array(n);for(let o=0;o<n;o++){const{h:n,l:s}=mg(e[o],t);[i[o],r[o]]=[n,s]}return[i,r]}const gg=(e,t,n)=>e>>>n,yg=(e,t,n)=>e<<32-n|t>>>n,bg=(e,t,n)=>e>>>n|t<<32-n,wg=(e,t,n)=>e<<32-n|t>>>n,vg=(e,t,n)=>e<<64-n|t>>>n-32,kg=(e,t,n)=>e>>>n-32|t<<64-n;function xg(e,t,n,i){const r=(t>>>0)+(i>>>0);return{h:e+n+(r/2**32|0)|0,l:0|r}}const Cg=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),Sg=(e,t,n,i)=>t+n+i+(e/2**32|0)|0,Bg=(e,t,n,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0),Ig=(e,t,n,i,r)=>t+n+i+r+(e/2**32|0)|0,Eg=(e,t,n,i,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0)+(r>>>0),Mg=(e,t,n,i,r,o)=>t+n+i+r+o+(e/2**32|0)|0,Dg=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Qg=new Uint32Array(64);class Ug extends ug{constructor(e=32){super(64,e,8,!1),this.A=0|dg[0],this.B=0|dg[1],this.C=0|dg[2],this.D=0|dg[3],this.E=0|dg[4],this.F=0|dg[5],this.G=0|dg[6],this.H=0|dg[7]}get(){const{A:e,B:t,C:n,D:i,E:r,F:o,G:s,H:a}=this;return[e,t,n,i,r,o,s,a]}set(e,t,n,i,r,o,s,a){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|i,this.E=0|r,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let u=0;u<16;u++,t+=4)Qg[u]=e.getUint32(t,!1);for(let u=16;u<64;u++){const e=Qg[u-15],t=Qg[u-2],n=Kf(e,7)^Kf(e,18)^e>>>3,i=Kf(t,17)^Kf(t,19)^t>>>10;Qg[u]=i+Qg[u-7]+n+Qg[u-16]|0}let{A:n,B:i,C:r,D:o,E:s,F:a,G:c,H:l}=this;for(let u=0;u<64;u++){const e=l+(Kf(s,6)^Kf(s,11)^Kf(s,25))+cg(s,a,c)+Dg[u]+Qg[u]|0,t=(Kf(n,2)^Kf(n,13)^Kf(n,22))+lg(n,i,r)|0;l=c,c=a,a=s,s=o+e|0,o=r,r=i,i=n,n=e+t|0}n=n+this.A|0,i=i+this.B|0,r=r+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,i,r,o,s,a,c,l)}roundClean(){qf(Qg)}destroy(){this.set(0,0,0,0,0,0,0,0),qf(this.buffer)}}const Fg=(()=>fg(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),Ng=(()=>Fg[0])(),Tg=(()=>Fg[1])(),Lg=new Uint32Array(80),Pg=new Uint32Array(80);class Og extends ug{constructor(e=64){super(128,e,16,!1),this.Ah=0|hg[0],this.Al=0|hg[1],this.Bh=0|hg[2],this.Bl=0|hg[3],this.Ch=0|hg[4],this.Cl=0|hg[5],this.Dh=0|hg[6],this.Dl=0|hg[7],this.Eh=0|hg[8],this.El=0|hg[9],this.Fh=0|hg[10],this.Fl=0|hg[11],this.Gh=0|hg[12],this.Gl=0|hg[13],this.Hh=0|hg[14],this.Hl=0|hg[15]}get(){const{Ah:e,Al:t,Bh:n,Bl:i,Ch:r,Cl:o,Dh:s,Dl:a,Eh:c,El:l,Fh:u,Fl:d,Gh:h,Gl:A,Hh:p,Hl:m}=this;return[e,t,n,i,r,o,s,a,c,l,u,d,h,A,p,m]}set(e,t,n,i,r,o,s,a,c,l,u,d,h,A,p,m){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|i,this.Ch=0|r,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|l,this.Fh=0|u,this.Fl=0|d,this.Gh=0|h,this.Gl=0|A,this.Hh=0|p,this.Hl=0|m}process(e,t){for(let y=0;y<16;y++,t+=4)Lg[y]=e.getUint32(t),Pg[y]=e.getUint32(t+=4);for(let y=16;y<80;y++){const e=0|Lg[y-15],t=0|Pg[y-15],n=bg(e,t,1)^bg(e,t,8)^gg(e,0,7),i=wg(e,t,1)^wg(e,t,8)^yg(e,t,7),r=0|Lg[y-2],o=0|Pg[y-2],s=bg(r,o,19)^vg(r,o,61)^gg(r,0,6),a=wg(r,o,19)^kg(r,o,61)^yg(r,o,6),c=Bg(i,a,Pg[y-7],Pg[y-16]),l=Ig(c,n,s,Lg[y-7],Lg[y-16]);Lg[y]=0|l,Pg[y]=0|c}let{Ah:n,Al:i,Bh:r,Bl:o,Ch:s,Cl:a,Dh:c,Dl:l,Eh:u,El:d,Fh:h,Fl:A,Gh:p,Gl:m,Hh:f,Hl:g}=this;for(let y=0;y<80;y++){const e=bg(u,d,14)^bg(u,d,18)^vg(u,d,41),t=wg(u,d,14)^wg(u,d,18)^kg(u,d,41),b=u&h^~u&p,w=Eg(g,t,d&A^~d&m,Tg[y],Pg[y]),v=Mg(w,f,e,b,Ng[y],Lg[y]),k=0|w,x=bg(n,i,28)^vg(n,i,34)^vg(n,i,39),C=wg(n,i,28)^kg(n,i,34)^kg(n,i,39),S=n&r^n&s^r&s,B=i&o^i&a^o&a;f=0|p,g=0|m,p=0|h,m=0|A,h=0|u,A=0|d,({h:u,l:d}=xg(0|c,0|l,0|v,0|k)),c=0|s,l=0|a,s=0|r,a=0|o,r=0|n,o=0|i;const I=Cg(k,C,B);n=Sg(I,v,x,S),i=0|I}({h:n,l:i}=xg(0|this.Ah,0|this.Al,0|n,0|i)),({h:r,l:o}=xg(0|this.Bh,0|this.Bl,0|r,0|o)),({h:s,l:a}=xg(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:l}=xg(0|this.Dh,0|this.Dl,0|c,0|l)),({h:u,l:d}=xg(0|this.Eh,0|this.El,0|u,0|d)),({h:h,l:A}=xg(0|this.Fh,0|this.Fl,0|h,0|A)),({h:p,l:m}=xg(0|this.Gh,0|this.Gl,0|p,0|m)),({h:f,l:g}=xg(0|this.Hh,0|this.Hl,0|f,0|g)),this.set(n,i,r,o,s,a,c,l,u,d,h,A,p,m,f,g)}roundClean(){qf(Lg,Pg)}destroy(){qf(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Rg=sg(()=>new Ug),zg=sg(()=>new Og),qg=Rg;function Yg(e,t){const n=t||"hex",i=qg(Dm(e,{strict:!1})?Ym(e):e);return"bytes"===n?i:Pm(i)}function Kg(e){const{commitment:t,version:n=1}=e,i=e.to??("string"==typeof t?"hex":"bytes"),r=Yg(t,"bytes");return r.set([n],0),"bytes"===i?r:Om(r)}const Hg=4096,Vg=131072,jg=761855;class Zg extends Bm{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`],name:"BlobSizeTooLargeError"})}}class Xg extends Bm{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class Gg extends Bm{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`],name:"InvalidVersionedHashSizeError"})}}class Wg extends Bm{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:["Expected: 1",`Received: ${t}`],name:"InvalidVersionedHashVersionError"})}}function Jg(e){const{data:t,kzg:n,to:i}=e,r=e.blobs??function(e){const t=e.to??("string"==typeof e.data?"hex":"bytes"),n="string"==typeof e.data?Vm(e.data):e.data,i=Qm(n);if(!i)throw new Xg;if(i>jg)throw new Zg({maxSize:jg,size:i});const r=[];let o=!0,s=0;for(;o;){const e=bf(new Uint8Array(Vg));let t=0;for(;t<Hg;){const i=n.slice(s,s+31);if(e.pushByte(0),e.pushBytes(i),i.length<31){e.pushByte(128),o=!1;break}t++,s+=31}r.push(e)}return"bytes"===t?r.map(e=>e.bytes):r.map(e=>Om(e.bytes))}({data:t,to:i}),o=e.commitments??Uf({blobs:r,kzg:n,to:i}),s=e.proofs??Ff({blobs:r,commitments:o,kzg:n,to:i}),a=[];for(let c=0;c<r.length;c++)a.push({blob:r[c],commitment:o[c],proof:s[c]});return a}class _g extends Bm{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class $g extends Bm{constructor({chainId:e}){super("number"==typeof e?`Chain ID "${e}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}class ey extends Bm{constructor({cause:e,message:t}={}){var n;const i=null==(n=null==t?void 0:t.replace("execution reverted: ",""))?void 0:n.replace("execution reverted","");super(`Execution reverted ${i?`with reason: ${i}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(ey,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(ey,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class ty extends Bm{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${If(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(ty,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class ny extends Bm{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${If(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(ny,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class iy extends Bm{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(iy,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class ry extends Bm{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join("\n"),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(ry,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class oy extends Bm{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(oy,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class sy extends Bm{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join("\n"),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(sy,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class ay extends Bm{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(ay,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class cy extends Bm{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(cy,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class ly extends Bm{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(ly,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class uy extends Bm{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${If(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${If(n)} gwei`:""}).`].join("\n"),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(uy,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class dy extends Bm{constructor({cause:e}){super(`An error occurred while executing: ${null==e?void 0:e.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}class hy extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&(super.delete(e),super.set(e,t)),t}set(e,t){if(super.has(e)&&super.delete(e),super.set(e,t),this.maxSize&&this.size>this.maxSize){const e=super.keys().next().value;void 0!==e&&super.delete(e)}return this}}const Ay=BigInt(0),py=BigInt(1),my=BigInt(2),fy=BigInt(7),gy=BigInt(256),yy=BigInt(113),by=[],wy=[],vy=[];for(let vU=0,kU=py,xU=1,CU=0;vU<24;vU++){[xU,CU]=[CU,(2*xU+3*CU)%5],by.push(2*(5*CU+xU)),wy.push((vU+1)*(vU+2)/2%64);let e=Ay;for(let t=0;t<7;t++)kU=(kU<<py^(kU>>fy)*yy)%gy,kU&my&&(e^=py<<(py<<BigInt(t))-py);vy.push(e)}const ky=fg(vy,!0),xy=ky[0],Cy=ky[1],Sy=(e,t,n)=>n>32?((e,t,n)=>t<<n-32|e>>>64-n)(e,t,n):((e,t,n)=>e<<n|t>>>32-n)(e,t,n),By=(e,t,n)=>n>32?((e,t,n)=>e<<n-32|t>>>64-n)(e,t,n):((e,t,n)=>t<<n|e>>>32-n)(e,t,n);class Iy extends og{constructor(e,t,n,i=!1,r=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=i,this.rounds=r,Lf(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");var o;this.state=new Uint8Array(200),this.state32=(o=this.state,new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4)))}clone(){return this._cloneInto()}keccak(){Vf(this.state32),function(e,t=24){const n=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const t=(i+8)%10,r=(i+2)%10,o=n[r],s=n[r+1],a=Sy(o,s,1)^n[t],c=By(o,s,1)^n[t+1];for(let n=0;n<50;n+=10)e[i+n]^=a,e[i+n+1]^=c}let t=e[2],r=e[3];for(let n=0;n<24;n++){const i=wy[n],o=Sy(t,r,i),s=By(t,r,i),a=by[n];t=e[a],r=e[a+1],e[a]=o,e[a+1]=s}for(let i=0;i<50;i+=10){for(let t=0;t<10;t++)n[t]=e[i+t];for(let t=0;t<10;t++)e[i+t]^=~n[(t+2)%10]&n[(t+4)%10]}e[0]^=xy[i],e[1]^=Cy[i]}qf(n)}(this.state32,this.rounds),Vf(this.state32),this.posOut=0,this.pos=0}update(e){Rf(this),Pf(e=ig(e));const{blockLen:t,state:n}=this,i=e.length;for(let r=0;r<i;){const o=Math.min(t-this.pos,i-r);for(let t=0;t<o;t++)n[this.pos++]^=e[r++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:n,blockLen:i}=this;e[n]^=t,128&t&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Rf(this,!1),Pf(e),this.finish();const t=this.state,{blockLen:n}=this;for(let i=0,r=e.length;i<r;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,r-i);e.set(t.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Lf(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(zf(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,qf(this.state)}_cloneInto(e){const{blockLen:t,suffix:n,outputLen:i,rounds:r,enableXOF:o}=this;return e||(e=new Iy(t,n,i,o,r)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=r,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Ey=(()=>{return e=1,t=136,n=32,sg(()=>new Iy(t,e,n));var e,t,n})();const My=new hy(8192);function Dy(e,t){if(My.has(`${e}.${t}`))return My.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),i=function(e){return Ey(Dm(e,{strict:!1})?Ym(e):e)}(jm(n)),r=n.split("");for(let s=0;s<40;s+=2)i[s>>1]>>4>=8&&r[s]&&(r[s]=r[s].toUpperCase()),(15&i[s>>1])>=8&&r[s+1]&&(r[s+1]=r[s+1].toUpperCase());const o=`0x${r.join("")}`;return My.set(`${e}.${t}`,o),o}const Qy=/^0x[a-fA-F0-9]{40}$/,Uy=new hy(8192);function Fy(e,t){const{strict:n=!0}=t??{},i=`${e}.${n}`;if(Uy.has(i))return Uy.get(i);const r=!(!Qy.test(e)||e.toLowerCase()!==e&&n&&Dy(e)!==e);return Uy.set(i,r),r}function Ny(e,t,n,{strict:i}={}){return Dm(e,{strict:!1})?function(e,t,n,{strict:i}={}){const r=`0x${e.replace("0x","").slice(2*t,2*n)}`;i&&Ty(r,t,n);return r}(e,t,n,{strict:i}):function(e,t,n,{strict:i}={}){const r=e.slice(t,n);i&&Ty(r,t,n);return r}(e,t,n,{strict:i})}function Ty(e,t,n){if(Qm(e)!==n-t)throw new Fm({offset:n,position:"end",size:Qm(e)})}function Ly(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:i,to:r}=e;if(t<=0)throw new $g({chainId:t});if(r&&!Fy(r))throw new _g({address:r});if(i&&i>uf)throw new ty({maxFeePerGas:i});if(n&&i&&n>i)throw new uy({maxFeePerGas:i,maxPriorityFeePerGas:n})}function Py(e){if(!e||0===e.length)return[];const t=[];for(let n=0;n<e.length;n++){const{address:i,storageKeys:r}=e[n];for(let e=0;e<r.length;e++)if(r[e].length-2!=64)throw new Qf({storageKey:r[e]});if(!Fy(i,{strict:!1}))throw new _g({address:i});t.push([i,r])}return t}function Oy(e,t){const n=function(e){if(e.type)return e.type;if(void 0!==e.authorizationList)return"eip7702";if(void 0!==e.blobs||void 0!==e.blobVersionedHashes||void 0!==e.maxFeePerBlobGas||void 0!==e.sidecars)return"eip4844";if(void 0!==e.maxFeePerGas||void 0!==e.maxPriorityFeePerGas)return"eip1559";if(void 0!==e.gasPrice)return void 0!==e.accessList?"eip2930":"legacy";throw new Df({transaction:e})}(e);return"eip1559"===n?function(e,t){const{chainId:n,gas:i,nonce:r,to:o,value:s,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:l,data:u}=e;Ly(e);const d=Py(l),h=[Rm(n),r?Rm(r):"0x",c?Rm(c):"0x",a?Rm(a):"0x",i?Rm(i):"0x",o??"0x",s?Rm(s):"0x",u??"0x",d,...Ry(e,t)];return pf(["0x02",wf(h)])}(e,t):"eip2930"===n?function(e,t){const{chainId:n,gas:i,data:r,nonce:o,to:s,value:a,accessList:c,gasPrice:l}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:i,maxFeePerGas:r,to:o}=e;if(t<=0)throw new $g({chainId:t});if(o&&!Fy(o))throw new _g({address:o});if(n||r)throw new Bm("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(i&&i>uf)throw new ty({maxFeePerGas:i})}(e);const u=Py(c),d=[Rm(n),o?Rm(o):"0x",l?Rm(l):"0x",i?Rm(i):"0x",s??"0x",a?Rm(a):"0x",r??"0x",u,...Ry(e,t)];return pf(["0x01",wf(d)])}(e,t):"eip4844"===n?function(e,t){const{chainId:n,gas:i,nonce:r,to:o,value:s,maxFeePerBlobGas:a,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;!function(e){const{blobVersionedHashes:t}=e;if(t){if(0===t.length)throw new Xg;for(const e of t){const t=Qm(e),n=Gm(Ny(e,0,1));if(32!==t)throw new Gg({hash:e,size:t});if(1!==n)throw new Wg({hash:e,version:n})}}Ly(e)}(e);let h=e.blobVersionedHashes,A=e.sidecars;if(e.blobs&&(void 0===h||void 0===A)){const t="string"==typeof e.blobs[0]?e.blobs:e.blobs.map(e=>Om(e)),n=e.kzg,i=Uf({blobs:t,kzg:n});if(void 0===h&&(h=function(e){const{commitments:t,version:n}=e,i=e.to??("string"==typeof t[0]?"hex":"bytes"),r=[];for(const o of t)r.push(Kg({commitment:o,to:i,version:n}));return r}({commitments:i})),void 0===A){A=Jg({blobs:t,commitments:i,proofs:Ff({blobs:t,commitments:i,kzg:n})})}}const p=Py(u),m=[Rm(n),r?Rm(r):"0x",l?Rm(l):"0x",c?Rm(c):"0x",i?Rm(i):"0x",o??"0x",s?Rm(s):"0x",d??"0x",p,a?Rm(a):"0x",h??[],...Ry(e,t)],f=[],g=[],y=[];if(A)for(let b=0;b<A.length;b++){const{blob:e,commitment:t,proof:n}=A[b];f.push(e),g.push(t),y.push(n)}return pf(["0x03",wf(A?[m,f,g,y]:m)])}(e,t):"eip7702"===n?function(e,t){const{authorizationList:n,chainId:i,gas:r,nonce:o,to:s,value:a,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;!function(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:e}=n,t=n.address;if(!Fy(t))throw new _g({address:t});if(e<0)throw new $g({chainId:e})}Ly(e)}(e);const h=Py(u),A=function(e){if(!e||0===e.length)return[];const t=[];for(const n of e){const{chainId:e,nonce:i,...r}=n,o=n.address;t.push([e?Pm(e):"0x",o,i?Pm(i):"0x",...Ry({},r)])}return t}(n);return pf(["0x04",wf([Rm(i),o?Rm(o):"0x",l?Rm(l):"0x",c?Rm(c):"0x",r?Rm(r):"0x",s??"0x",a?Rm(a):"0x",d??"0x",h,A,...Ry(e,t)])])}(e,t):function(e,t){const{chainId:n=0,gas:i,data:r,nonce:o,to:s,value:a,gasPrice:c}=e;!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:i,maxFeePerGas:r,to:o}=e;if(o&&!Fy(o))throw new _g({address:o});if(void 0!==t&&t<=0)throw new $g({chainId:t});if(n||r)throw new Bm("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(i&&i>uf)throw new ty({maxFeePerGas:i})}(e);let l=[o?Rm(o):"0x",c?Rm(c):"0x",i?Rm(i):"0x",s??"0x",a?Rm(a):"0x",r??"0x"];if(t){const e=(()=>{if(t.v>=35n){return(t.v-35n)/2n>0?t.v:27n+(35n===t.v?0n:1n)}if(n>0)return BigInt(2*n)+BigInt(35n+t.v-27n);const e=27n+(27n===t.v?0n:1n);if(t.v!==e)throw new Mf({v:t.v});return e})(),i=Um(t.r),r=Um(t.s);l=[...l,Rm(e),"0x00"===i?"0x":i,"0x00"===r?"0x":r]}else n>0&&(l=[...l,Rm(n),"0x","0x"]);return wf(l)}(e,t)}function Ry(e,t){const n=t??e,{v:i,yParity:r}=n;if(void 0===n.r)return[];if(void 0===n.s)return[];if(void 0===i&&void 0===r)return[];const o=Um(n.r),s=Um(n.s);return["number"==typeof r?r?Rm(1):"0x":0n===i?"0x":1n===i?Rm(1):27n===i?"0x":Rm(1),"0x00"===o?"0x":o,"0x00"===s?"0x":s]}class zy extends Bm{constructor(){super(["Transaction is not an EIP712 transaction.","","Transaction must:",' - include `type: "eip712"`'," - include one of the following: `customSignature`, `paymaster`, `paymasterInput`, `gasPerPubdata`, `factoryDeps`"].join("\n"),{name:"InvalidEip712TransactionError"})}}function qy(e){return"eip712"===e.type||!!("customSignature"in e&&e.customSignature||"paymaster"in e&&e.paymaster||"paymasterInput"in e&&e.paymasterInput||"gasPerPubdata"in e&&"bigint"==typeof e.gasPerPubdata||"factoryDeps"in e&&e.factoryDeps)}function Yy(e){const{chainId:t,to:n,from:i,paymaster:r,paymasterInput:o}=e;if(!qy(e))throw new zy;if(!t||t<=0)throw new $g({chainId:t});if(n&&!Fy(n))throw new _g({address:n});if(i&&!Fy(i))throw new _g({address:i});if(r&&!Fy(r))throw new _g({address:r});if(r&&!o)throw new Bm("`paymasterInput` must be provided when `paymaster` is defined");if(!r&&o)throw new Bm("`paymaster` must be provided when `paymasterInput` is defined")}const Ky={transaction:function(e,t){return qy(e)?function(e){const{chainId:t,gas:n,nonce:i,to:r,from:o,value:s,maxFeePerGas:a,maxPriorityFeePerGas:c,customSignature:l,factoryDeps:u,paymaster:d,paymasterInput:h,gasPerPubdata:A,data:p}=e;Yy(e);const m=[i?Pm(i):"0x",c?Pm(c):"0x",a?Pm(a):"0x",n?Pm(n):"0x",r??"0x",s?Pm(s):"0x",p??"0x",Pm(t),Pm(""),Pm(""),Pm(t),o??"0x",Pm(A||df),u??[],l??"0x",d&&h?[d,h]:[]];return pf(["0x71",wf(m)])}(e):Oy(e,t)}};class Hy extends Bm{constructor({givenLength:e,maxBytecodeSize:t}){super(`Bytecode cannot be longer than ${t} bytes. Given length: ${e}`,{name:"BytecodeLengthExceedsMaxSizeError"})}}class Vy extends Bm{constructor({givenLengthInWords:e}){super(`Bytecode length in 32-byte words must be odd. Given length in words: ${e}`,{name:"BytecodeLengthInWordsMustBeOddError"})}}class jy extends Bm{constructor({givenLength:e}){super(`The bytecode length in bytes must be divisible by 32. Given length: ${e}`,{name:"BytecodeLengthMustBeDivisibleBy32Error"})}}const Zy={blockTime:1e3,formatters:Af,serializers:Ky,custom:{getEip712Domain:e=>{Yy(e);const t=function(e){const{gas:t,nonce:n,to:i,from:r,value:o,maxFeePerGas:s,maxPriorityFeePerGas:a,factoryDeps:c,paymaster:l,paymasterInput:u,gasPerPubdata:d,data:h}=e;return{txType:113n,from:BigInt(r),to:i?BigInt(i):0n,gasLimit:t??0n,gasPerPubdataByteLimit:d??df,maxFeePerGas:s??0n,maxPriorityFeePerGas:a??0n,paymaster:l?BigInt(l):0n,nonce:n?BigInt(n):0n,value:o??0n,data:h??"0x",factoryDeps:(null==c?void 0:c.map(e=>Pm(function(e){const t=Ym(e);if(t.length%32!=0)throw new jy({givenLength:t.length});if(t.length>hf)throw new Hy({givenLength:t.length,maxBytecodeSize:hf});const n=Ym(Yg(t)),i=t.length/32;if(i%2==0)throw new Vy({givenLengthInWords:i});const r=Tm(Ym(i),{size:2}),o=new Uint8Array([1,0]);return n.set(o,0),n.set(r,2),n}(e))))??[],paymasterInput:u||"0x"}}(e);return{domain:{name:"zkSync",version:"2",chainId:e.chainId},types:{Transaction:[{name:"txType",type:"uint256"},{name:"from",type:"uint256"},{name:"to",type:"uint256"},{name:"gasLimit",type:"uint256"},{name:"gasPerPubdataByteLimit",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymaster",type:"uint256"},{name:"nonce",type:"uint256"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"factoryDeps",type:"bytes32[]"},{name:"paymasterInput",type:"bytes"}]},primaryType:"Transaction",message:t}}}},Xy=xm({...Zy,blockTime:200,id:2741,name:"Abstract",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://api.mainnet.abs.xyz"],webSocket:["wss://api.mainnet.abs.xyz/ws"]}},blockExplorers:{default:{name:"Etherscan",url:"https://abscan.org"},native:{name:"Abstract Explorer",url:"https://explorer.mainnet.abs.xyz"}},contracts:{multicall3:{address:"0xAa4De41dba0Ca5dCBb288b7cC6b708F3aaC759E7",blockCreated:5288},erc6492Verifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:5263}}}),Gy={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}};function Wy(e,t){return function(e){return"deposit"===e.type||void 0!==e.sourceHash}(e)?function(e){!function(e){const{from:t,to:n}=e;if(t&&!Fy(t))throw new _g({address:t});if(n&&!Fy(n))throw new _g({address:n})}(e);const{sourceHash:t,data:n,from:i,gas:r,isSystemTx:o,mint:s,to:a,value:c}=e,l=[t,i,a??"0x",s?Pm(s):"0x",c?Pm(c):"0x",r?Pm(r):"0x",o?"0x1":"0x",n??"0x"];return pf(["0x7e",wf(l)])}(e):Oy(e,t)}const Jy={blockTime:2e3,contracts:Gy,formatters:{block:tf({format(e){var t;return{transactions:null==(t=e.transactions)?void 0:t.map(e=>{if("string"==typeof e)return e;const t=_m(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?Xm(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}),stateRoot:e.stateRoot}}}),transaction:$m({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?Xm(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:sf({format:e=>({l1GasPrice:e.l1GasPrice?Xm(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?Xm(e.l1GasUsed):null,l1Fee:e.l1Fee?Xm(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})},serializers:{transaction:Wy}},_y=xm({id:33139,name:"ApeChain",nativeCurrency:{name:"ApeCoin",symbol:"APE",decimals:18},rpcUrls:{default:{http:["https://rpc.apechain.com/http"],webSocket:["wss://rpc.apechain.com/ws"]}},blockExplorers:{default:{name:"Apescan",url:"https://apescan.io",apiUrl:"https://api.apescan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:20889}},sourceId:42161}),$y=xm({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:250,rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),eb=xm({id:592,name:"Astar",network:"astar-mainnet",nativeCurrency:{name:"Astar",symbol:"ASTR",decimals:18},rpcUrls:{default:{http:["https://astar.api.onfinality.io/public"]}},blockExplorers:{default:{name:"Astar Subscan",url:"https://astar.subscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:761794}},testnet:!1}),tb=xm({id:43114,name:"Avalanche",blockTime:1700,nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://snowtrace.io",apiUrl:"https://api.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11907934}}}),nb=1,ib=xm({...Jy,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...Jy.contracts,disputeGameFactory:{[nb]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[nb]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[nb]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[nb]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:1}),rb=xm({id:80094,name:"Berachain",blockTime:2e3,nativeCurrency:{decimals:18,name:"BERA Token",symbol:"BERA"},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:0},ensRegistry:{address:"0x5b22280886a2f5e09a49bea7e320eab0e5320e28",blockCreated:877007},ensUniversalResolver:{address:"0x4D41762915F83c76EcaF6776d9b08076aA32b492",blockCreated:9310021}},rpcUrls:{default:{http:["https://rpc.berachain.com"]}},blockExplorers:{default:{name:"Berascan",url:"https://berascan.com"}},ensTlds:[".bera"],testnet:!1}),ob=1,sb=xm({...Jy,id:81457,name:"Blast",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.blast.io"]}},blockExplorers:{default:{name:"Blastscan",url:"https://blastscan.io",apiUrl:"https://api.blastscan.io/api"}},contracts:{...Jy.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:212929},l2OutputOracle:{[ob]:{address:"0x826D1B0D4111Ad9146Eb8941D7Ca2B6a44215c76",blockCreated:19300358}},portal:{[ob]:{address:"0x0Ec68c5B10F21EFFb74f2A5C61DFe6b08C0Db6Cb",blockCreated:19300357}},l1StandardBridge:{[ob]:{address:"0x697402166Fbf2F22E970df8a6486Ef171dbfc524",blockCreated:19300360}}},sourceId:1}),ab=xm({id:3637,name:"Botanix",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:18},rpcUrls:{default:{http:["https://rpc.botanixlabs.com"],webSocket:["wss://rpc.botanixlabs.com/ws"]}},blockExplorers:{default:{name:"Botanixscan",url:"https://botanixscan.io"}}}),cb=xm({id:56,name:"BNB Smart Chain",blockTime:750,nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://56.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"BscScan",url:"https://bscscan.com",apiUrl:"https://api.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}}),lb={estimateFeesPerGas:async e=>{var t;if(!(null==(t=e.request)?void 0:t.feeCurrency))return null;const[n,i]=await Promise.all([ub(e.client,e.request.feeCurrency),db(e.client,e.request.feeCurrency)]);return{maxFeePerGas:e.multiply(n-i)+i,maxPriorityFeePerGas:i}}};async function ub(e,t){const n=await e.request({method:"eth_gasPrice",params:[t]});return BigInt(n)}async function db(e,t){const n=await e.request({method:"eth_maxPriorityFeePerGas",params:[t]});return BigInt(n)}function hb(e){return 0===e||0n===e||null==e||"0"===e||""===e||"string"==typeof e&&("0x"===Um(e).toLowerCase()||"0x00"===Um(e).toLowerCase())}function Ab(e){return!hb(e)}function pb(e){return"cip64"===e.type||function(e){return void 0!==e.maxFeePerGas&&void 0!==e.maxPriorityFeePerGas}(e)&&Ab(e.feeCurrency)}const mb={transaction:function(e,t){return pb(e)?function(e,t){!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:i,maxFeePerGas:r,to:o,feeCurrency:s}=e;if(t<=0)throw new $g({chainId:t});if(o&&!Fy(o))throw new _g({address:o});if(i)throw new Bm("`gasPrice` is not a valid CIP-64 Transaction attribute.");if(Ab(r)&&r>fb)throw new ty({maxFeePerGas:r});if(Ab(n)&&Ab(r)&&n>r)throw new uy({maxFeePerGas:r,maxPriorityFeePerGas:n});if(Ab(s)&&!Fy(s))throw new Bm("`feeCurrency` MUST be a token address for CIP-64 transactions.");if(hb(s))throw new Bm("`feeCurrency` must be provided for CIP-64 transactions.")}(e);const{chainId:n,gas:i,nonce:r,to:o,value:s,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:l,feeCurrency:u,data:d}=e,h=[Pm(n),r?Pm(r):"0x",c?Pm(c):"0x",a?Pm(a):"0x",i?Pm(i):"0x",o??"0x",s?Pm(s):"0x",d??"0x",Py(l),u,...Ry(e,t)];return pf(["0x7b",wf(h)])}(e,t):Wy(e,t)}};const fb=uf;const gb=xm({...{blockTime:1e3,contracts:Gy,formatters:{block:tf({format(e){var t;return{transactions:null==(t=e.transactions)?void 0:t.map(e=>{if("string"==typeof e)return e;return{..._m(e),...e.gatewayFee?{gatewayFee:Xm(e.gatewayFee),gatewayFeeRecipient:e.gatewayFeeRecipient}:{},feeCurrency:e.feeCurrency}})}}}),transaction:$m({format(e){if("0x7e"===e.type)return{isSystemTx:e.isSystemTx,mint:e.mint?Xm(e.mint):void 0,sourceHash:e.sourceHash,type:"deposit"};const t={feeCurrency:e.feeCurrency};return"0x7b"===e.type?t.type="cip64":("0x7c"===e.type&&(t.type="cip42"),t.gatewayFee=e.gatewayFee?Xm(e.gatewayFee):null,t.gatewayFeeRecipient=e.gatewayFeeRecipient),t}}),transactionRequest:lf({format(e){const t={};return e.feeCurrency&&(t.feeCurrency=e.feeCurrency),pb(e)&&(t.type="0x7b"),t}})},serializers:mb,fees:lb},id:42220,name:"Celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://celoscan.io",apiUrl:"https://api.celoscan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:13112599}},testnet:!1}),yb=xm({id:4158,name:"CrossFi Mainnet",nativeCurrency:{decimals:18,name:"CrossFi",symbol:"XFI"},rpcUrls:{default:{http:["https://rpc.mainnet.ms"]}},blockExplorers:{default:{name:"CrossFi Blockchain Explorer",url:"https://xfiscan.com"}},testnet:!1}),bb=xm({id:747,name:"Flow EVM Mainnet",nativeCurrency:{decimals:18,name:"Flow",symbol:"FLOW"},rpcUrls:{default:{http:["https://mainnet.evm.nodes.onflow.org"]}},blockExplorers:{default:{name:"Mainnet Explorer",url:"https://evm.flowscan.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6205}},blockTime:800}),wb=xm({id:63157,name:"Geist Mainnet",nativeCurrency:{decimals:18,name:"Aavegotchi GHST Token",symbol:"GHST"},rpcUrls:{default:{http:["https://geist-mainnet.g.alchemy.com/public"]}},blockExplorers:{default:{name:"Blockscout",url:"https://geist-mainnet.explorer.alchemy.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:660735}}}),vb=xm({id:100,name:"Gnosis",nativeCurrency:{decimals:18,name:"xDAI",symbol:"XDAI"},blockTime:5e3,rpcUrls:{default:{http:["https://rpc.gnosischain.com"],webSocket:["wss://rpc.gnosischain.com/wss"]}},blockExplorers:{default:{name:"Gnosisscan",url:"https://gnosisscan.io",apiUrl:"https://api.gnosisscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:21022491}}}),kb=xm({id:999,name:"HyperEVM",nativeCurrency:{name:"HYPE",symbol:"HYPE",decimals:18},blockExplorers:{default:{name:"HyperEVMScan",url:"https://hyperevmscan.io"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:13051}},rpcUrls:{default:{http:["https://rpc.hyperliquid.xyz/evm"]}},testnet:!1}),xb=1,Cb=xm({...Jy,id:57073,name:"Ink",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc-gel.inkonchain.com","https://rpc-qnd.inkonchain.com"],webSocket:["wss://rpc-gel.inkonchain.com","wss://rpc-qnd.inkonchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.inkonchain.com",apiUrl:"https://explorer.inkonchain.com/api/v2"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:0},...Jy.contracts,disputeGameFactory:{[xb]:{address:"0x10d7b35078d3baabb96dd45a9143b94be65b12cd"}},portal:{[xb]:{address:"0x5d66c1782664115999c47c9fa5cd031f495d3e4f"}},l1StandardBridge:{[xb]:{address:"0x88ff1e5b602916615391f55854588efcbb7663f0"}}},testnet:!1,sourceId:1}),Sb=xm({id:232,name:"Lens",nativeCurrency:{name:"GHO",symbol:"GHO",decimals:18},rpcUrls:{default:{http:["https://rpc.lens.xyz"]}},blockExplorers:{default:{name:"Lens Block Explorer",url:"https://explorer.lens.xyz",apiUrl:"https://explorer.lens.xyz/api"}}});function Bb(e){return"string"==typeof e?{address:e,type:"json-rpc"}:e}class Ib extends Bm{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join("\n"),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}function Eb(e){return e.reduce((e,{slot:t,value:n})=>`${e} ${t}: ${n}\n`,"")}class Mb extends Bm{constructor(e,{account:t,docsPath:n,chain:i,data:r,gas:o,gasPrice:s,maxFeePerGas:a,maxPriorityFeePerGas:c,nonce:l,to:u,value:d,stateOverride:h}){var A;const p=t?Bb(t):void 0;let m=Ef({from:null==p?void 0:p.address,to:u,value:void 0!==d&&`${Bf(d)} ${(null==(A=null==i?void 0:i.nativeCurrency)?void 0:A.symbol)||"ETH"}`,data:r,gas:o,gasPrice:void 0!==s&&`${If(s)} gwei`,maxFeePerGas:void 0!==a&&`${If(a)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${If(c)} gwei`,nonce:l});h&&(m+=`\n${function(e){return e.reduce((e,{address:t,...n})=>{let i=`${e} ${t}:\n`;return n.nonce&&(i+=` nonce: ${n.nonce}\n`),n.balance&&(i+=` balance: ${n.balance}\n`),n.code&&(i+=` code: ${n.code}\n`),n.state&&(i+=" state:\n",i+=Eb(n.state)),n.stateDiff&&(i+=" stateDiff:\n",i+=Eb(n.stateDiff)),i}," State Override:\n").slice(0,-1)}(h)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",m].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}function Db(e,{docsPath:t,...n}){const i=(()=>{const t=function(e,t){const n=(e.details||"").toLowerCase(),i=e instanceof Bm?e.walk(e=>(null==e?void 0:e.code)===ey.code):e;return i instanceof Bm?new ey({cause:e,message:i.details}):ey.nodeMessage.test(n)?new ey({cause:e,message:e.details}):ty.nodeMessage.test(n)?new ty({cause:e,maxFeePerGas:null==t?void 0:t.maxFeePerGas}):ny.nodeMessage.test(n)?new ny({cause:e,maxFeePerGas:null==t?void 0:t.maxFeePerGas}):iy.nodeMessage.test(n)?new iy({cause:e,nonce:null==t?void 0:t.nonce}):ry.nodeMessage.test(n)?new ry({cause:e,nonce:null==t?void 0:t.nonce}):oy.nodeMessage.test(n)?new oy({cause:e,nonce:null==t?void 0:t.nonce}):sy.nodeMessage.test(n)?new sy({cause:e}):ay.nodeMessage.test(n)?new ay({cause:e,gas:null==t?void 0:t.gas}):cy.nodeMessage.test(n)?new cy({cause:e,gas:null==t?void 0:t.gas}):ly.nodeMessage.test(n)?new ly({cause:e}):uy.nodeMessage.test(n)?new uy({cause:e,maxFeePerGas:null==t?void 0:t.maxFeePerGas,maxPriorityFeePerGas:null==t?void 0:t.maxPriorityFeePerGas}):new dy({cause:e})}(e,n);return t instanceof dy?e:t})();return new Mb(i,{docsPath:t,...n})}function Qb(e,{format:t}){if(!t)return{};const n={};return function t(i){const r=Object.keys(i);for(const o of r)o in e&&(n[o]=e[o]),i[o]&&"object"==typeof i[o]&&!Array.isArray(i[o])&&t(i[o])}(t(e||{})),n}async function Ub(e,t){var n,i,r;const{account:o=e.account}=t;if(!o)throw new Ib;const s=Bb(o);try{const{accessList:o,blockNumber:a,blockTag:c,data:l,gas:u,gasPrice:d,maxFeePerGas:h,maxPriorityFeePerGas:A,nonce:p,to:m,value:f,...g}=t,y=("bigint"==typeof a?Rm(a):void 0)||c;!function(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:i,to:r}=e,o=t?Bb(t):void 0;if(o&&!Fy(o.address))throw new _g({address:o.address});if(r&&!Fy(r))throw new _g({address:r});if(n&&n>uf)throw new ty({maxFeePerGas:n});if(i&&n&&i>n)throw new uy({maxFeePerGas:n,maxPriorityFeePerGas:i})}(t);const b=null==(r=null==(i=null==(n=e.chain)?void 0:n.formatters)?void 0:i.transactionRequest)?void 0:r.format,w=(b||cf)({...Qb(g,{format:b}),account:s,accessList:o,data:l,gas:u,gasPrice:d,maxFeePerGas:h,maxPriorityFeePerGas:A,nonce:p,to:m,value:f},"estimateGas"),{baseFeePerGas:v,gasLimit:k,priorityFeePerGas:x}=await e.request({method:"linea_estimateGas",params:y?[w,y]:[w]});return{baseFeePerGas:BigInt(v),gasLimit:BigInt(k),priorityFeePerGas:BigInt(x)}}catch(wU){throw Db(wU,{...t,account:s,chain:e.chain})}}async function Fb({client:e,multiply:t,request:n,type:i}){try{const r=await Ub(e,{...n,account:null==n?void 0:n.account}),{priorityFeePerGas:o}=r,s=t(BigInt(r.baseFeePerGas))+o;return"legacy"===i?{gasPrice:s}:{maxFeePerGas:s,maxPriorityFeePerGas:o}}catch{return null}}const Nb=xm({...{fees:{estimateFeesPerGas:Fb,async maxPriorityFeePerGas({block:e,client:t,request:n}){const i=await Fb({block:e,client:t,multiply:e=>e,request:n,type:"eip1559"});return(null==i?void 0:i.maxPriorityFeePerGas)?i.maxPriorityFeePerGas:null}}},id:59144,name:"Linea Mainnet",blockTime:2e3,nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build",apiUrl:"https://api.lineascan.build/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:42},ensRegistry:{address:"0x50130b669B28C339991d8676FA73CF122a121267",blockCreated:6682888},ensUniversalResolver:{address:"0x4D41762915F83c76EcaF6776d9b08076aA32b492",blockCreated:22222151}},ensTlds:[".linea.eth"],testnet:!1}),Tb=xm({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),Lb=xm({id:5e3,name:"Mantle",nativeCurrency:{decimals:18,name:"MNT",symbol:"MNT"},rpcUrls:{default:{http:["https://rpc.mantle.xyz"]}},blockExplorers:{default:{name:"Mantle Explorer",url:"https://mantlescan.xyz/",apiUrl:"https://api.mantlescan.xyz/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:304717}}}),Pb=xm({id:1088,name:"Metis",nativeCurrency:{decimals:18,name:"Metis",symbol:"METIS"},rpcUrls:{default:{http:["https://metis.rpc.hypersync.xyz","https://metis-pokt.nodies.app","https://api.blockeden.xyz/metis/67nCBdZQSH9z3YqDDjdm","https://metis-andromeda.rpc.thirdweb.com","https://metis-andromeda.gateway.tenderly.co","https://metis.api.onfinality.io/public","https://andromeda.metis.io/?owner=1088","https://metis-mainnet.public.blastapi.io"],webSocket:["wss://metis-rpc.publicnode.com","wss://metis.drpc.org"]}},blockExplorers:{default:{name:"Metis Explorer",url:"https://explorer.metis.io",apiUrl:"https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:2338552}}}),Ob=xm({id:143,name:"Monad",blockTime:400,nativeCurrency:{name:"Monad",symbol:"MON",decimals:18},rpcUrls:{default:{http:["https://rpc.monad.xyz","https://rpc1.monad.xyz"],webSocket:["wss://rpc.monad.xyz","wss://rpc1.monad.xyz"]}},blockExplorers:{default:{name:"Monadscan",url:"https://monadscan.com",apiUrl:"https://api.etherscan.io/v2/api?chainid=143"},monadvision:{name:"MonadVision",url:"https://monadvision.com"}},testnet:!1,contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:9248132}}}),Rb=56,zb=xm({id:204,name:"opBNB",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:{default:{http:["https://opbnb-mainnet-rpc.bnbchain.org"]}},blockExplorers:{default:{name:"opBNB (BSCScan)",url:"https://opbnb.bscscan.com",apiUrl:"https://api-opbnb.bscscan.com/api"}},contracts:{...Jy.contracts,multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:512881},l2OutputOracle:{[Rb]:{address:"0x153CAB79f4767E2ff862C94aa49573294B13D169"}},portal:{[Rb]:{address:"0x1876EA7702C0ad0C6A2ae6036DE7733edfBca519"}},l1StandardBridge:{[Rb]:{address:"0xF05F0e4362859c3331Cb9395CBC201E3Fa6757Ea"}}},sourceId:56}),qb=1,Yb=xm({...Jy,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...Jy.contracts,disputeGameFactory:{[qb]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[qb]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[qb]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[qb]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:1}),Kb=xm({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon.drpc.org"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),Hb=xm({id:1101,name:"Polygon zkEVM",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://zkevm-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://zkevm.polygonscan.com",apiUrl:"https://api-zkevm.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:57746}}}),Vb=xm({id:30,name:"Rootstock Mainnet",network:"rootstock",nativeCurrency:{decimals:18,name:"Rootstock Bitcoin",symbol:"RBTC"},rpcUrls:{default:{http:["https://public-node.rsk.co"]}},blockExplorers:{default:{name:"RSK Explorer",url:"https://explorer.rsk.co"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:4249540}}}),jb=xm({id:534352,name:"Scroll",blockTime:3e3,nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.scroll.io"],webSocket:["wss://wss-rpc.scroll.io/ws"]}},blockExplorers:{default:{name:"Scrollscan",url:"https://scrollscan.com",apiUrl:"https://api.scrollscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14}},testnet:!1}),Zb=xm({id:1329,name:"Sei Network",nativeCurrency:{name:"Sei",symbol:"SEI",decimals:18},rpcUrls:{default:{http:["https://evm-rpc.sei-apis.com/"],webSocket:["wss://evm-ws.sei-apis.com/"]}},blockExplorers:{default:{name:"Seiscan",url:"https://seiscan.io",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"}}}),Xb=1,Gb=xm({...Jy,id:360,name:"Shape",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.shape.network"]}},blockExplorers:{default:{name:"shapescan",url:"https://shapescan.xyz",apiUrl:"https://shapescan.xyz/api"}},contracts:{...Jy.contracts,l2OutputOracle:{[Xb]:{address:"0x6Ef8c69CfE4635d866e3E02732068022c06e724D",blockCreated:20369940}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1},portal:{[Xb]:{address:"0xEB06fFa16011B5628BaB98E29776361c83741dd3",blockCreated:20369933}},l1StandardBridge:{[Xb]:{address:"0x62Edd5f4930Ea92dCa3fB81689bDD9b9d076b57B",blockCreated:20369935}}},sourceId:1}),Wb=1,Jb=xm({...Jy,id:1868,name:"Soneium Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.soneium.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://soneium.blockscout.com",apiUrl:"https://soneium.blockscout.com/api"}},contracts:{...Jy.contracts,disputeGameFactory:{[Wb]:{address:"0x512a3d2c7a43bd9261d2b8e8c9c70d4bd4d503c0"}},l2OutputOracle:{[Wb]:{address:"0x0000000000000000000000000000000000000000"}},portal:{[Wb]:{address:"0x88e529a6ccd302c948689cd5156c83d4614fae92",blockCreated:7061266}},l1StandardBridge:{[Wb]:{address:"0xeb9bf100225c214efc3e7c651ebbadcf85177607",blockCreated:7061266}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1}},sourceId:1}),_b=xm({id:146,name:"Sonic",blockTime:630,nativeCurrency:{decimals:18,name:"Sonic",symbol:"S"},rpcUrls:{default:{http:["https://rpc.soniclabs.com"]}},blockExplorers:{default:{name:"Sonic Explorer",url:"https://sonicscan.org"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:60}},testnet:!1}),$b=xm({id:1514,name:"Story",nativeCurrency:{decimals:18,name:"IP Token",symbol:"IP"},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:340998},ensRegistry:{address:"0x5dc881dda4e4a8d312be3544ad13118d1a04cb17",blockCreated:648924},ensUniversalResolver:{address:"0xddfb18888a9466688235887dec2a10c4f5effee9",blockCreated:649114}},rpcUrls:{default:{http:["https://mainnet.storyrpc.io"]}},blockExplorers:{default:{name:"Story explorer",url:"https://storyscan.io",apiUrl:"https://storyscan.io/api/v2"}},ensTlds:[".ip"],testnet:!1}),ew=1,tw=xm({...Jy,id:5330,name:"Superseed",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.superseed.xyz"]}},blockExplorers:{default:{name:"Superseed Explorer",url:"https://explorer.superseed.xyz",apiUrl:"https://explorer.superseed.xyz/api/v2"}},contracts:{...Jy.contracts,disputeGameFactory:{[ew]:{address:"0x8b097CF1f9BbD9cbFD0DD561858a1FCbC8857Be0",blockCreated:20737481}},l2OutputOracle:{[ew]:{address:"0x693A0F8854F458D282DE3C5b69E8eE5EEE8aA949",blockCreated:20737481}},portal:{[ew]:{address:"0x2c2150aa5c75A24fB93d4fD2F2a895D618054f07",blockCreated:20737481}},l1StandardBridge:{[ew]:{address:"0x8b0576E39F1233679109F9b40cFcC2a7E0901Ede",blockCreated:20737481}},multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11"}},sourceId:1});class nw extends og{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Of(e);const n=ig(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,r=new Uint8Array(i);r.set(n.length>i?e.create().update(n).digest():n);for(let o=0;o<r.length;o++)r[o]^=54;this.iHash.update(r),this.oHash=e.create();for(let o=0;o<r.length;o++)r[o]^=106;this.oHash.update(r),qf(r)}update(e){return Rf(this),this.iHash.update(e),this}digestInto(e){Rf(this),Pf(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:i,destroyed:r,blockLen:o,outputLen:s}=this;return e.finished=i,e.destroyed=r,e.blockLen=o,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const iw=(e,t,n)=>new nw(e,t).update(n).digest();iw.create=(e,t)=>new nw(e,t);const rw=1,ow=xm({...Jy,id:130,name:"Unichain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:1e3,rpcUrls:{default:{http:["https://mainnet.unichain.org/"]}},blockExplorers:{default:{name:"Uniscan",url:"https://uniscan.xyz",apiUrl:"https://api.uniscan.xyz/api"}},contracts:{...Jy.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0},disputeGameFactory:{[rw]:{address:"0x2F12d621a16e2d3285929C9996f478508951dFe4"}},portal:{[rw]:{address:"0x0bd48f6B86a26D3a217d0Fa6FfE2B491B956A7a2"}},l1StandardBridge:{[rw]:{address:"0x81014F44b0a345033bB2b3B21C7a1A308B35fEeA"}}},sourceId:1}),sw=1,aw=xm({...Jy,id:480,name:"World Chain",network:"worldchain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://worldchain-mainnet.g.alchemy.com/public"]}},blockExplorers:{default:{name:"Worldscan",url:"https://worldscan.org",apiUrl:"https://api.worldscan.org/api"},blockscout:{name:"Blockscout",url:"https://worldchain-mainnet.explorer.alchemy.com",apiUrl:"https://worldchain-mainnet.explorer.alchemy.com/api"}},contracts:{...Jy.contracts,multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:0},disputeGameFactory:{[sw]:{address:"0x069c4c579671f8c120b1327a73217D01Ea2EC5ea"}},l2OutputOracle:{[sw]:{address:"0x19A6d1E9034596196295CF148509796978343c5D"}},portal:{[sw]:{address:"0xd5ec14a83B7d95BE1E2Ac12523e2dEE12Cbeea6C"}},l1StandardBridge:{[sw]:{address:"0x470458C91978D2d929704489Ad730DC3E3001113"}}},testnet:!1,sourceId:1}),cw=xm({id:7e3,name:"ZetaChain",nativeCurrency:{decimals:18,name:"Zeta",symbol:"ZETA"},rpcUrls:{default:{http:["https://zetachain-evm.blockpi.network/v1/rpc/public"]}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:1632781}},blockExplorers:{default:{name:"ZetaScan",url:"https://zetascan.com"}},testnet:!1}),lw=xm({...Zy,blockTime:200,id:324,name:"ZKsync Era",network:"zksync-era",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.era.zksync.io"],webSocket:["wss://mainnet.era.zksync.io/ws"]}},blockExplorers:{default:{name:"ZKsync Explorer",url:"https://explorer.zksync.io/",apiUrl:"https://block-explorer-api.mainnet.zksync.io/api"}},contracts:{multicall3:{address:"0xF9cda624FBC7e059355ce98a31693d299FACd963",blockCreated:3908235},erc6492Verifier:{address:"0xfB688330379976DA81eB64Fe4BF50d7401763B9C",blockCreated:45659388}}}),uw="YWG990wOlIikc1tU7-WWTepfU8d1f4dp",dw=[{chain:Tb,shortName:"ethereum",displayName:"Ethereum",alchemySlug:"eth-mainnet"},{chain:Yb,shortName:"optimism",displayName:"Optimism",alchemySlug:"opt-mainnet"},{chain:cb,shortName:"bsc",displayName:"BNB Smart Chain",alchemySlug:"bnb-mainnet"},{chain:vb,shortName:"gnosis",displayName:"Gnosis",alchemySlug:"gnosis-mainnet"},{chain:ow,shortName:"unichain",displayName:"Unichain",alchemySlug:"unichain-mainnet"},{chain:Kb,shortName:"polygon",displayName:"Polygon",alchemySlug:"polygon-mainnet"},{chain:Ob,shortName:"monad",displayName:"Monad",alchemySlug:"monad-mainnet"},{chain:_b,shortName:"sonic",displayName:"Sonic",alchemySlug:"sonic-mainnet"},{chain:zb,shortName:"opbnb",displayName:"opBNB",alchemySlug:"opbnb-mainnet"},{chain:Sb,shortName:"lens",displayName:"Lens",alchemySlug:"lens-mainnet"},{chain:Gb,shortName:"shape",displayName:"Shape",alchemySlug:"shape-mainnet"},{chain:aw,shortName:"worldchain",displayName:"World Chain",alchemySlug:"worldchain-mainnet"},{chain:bb,shortName:"flow",displayName:"Flow EVM",alchemySlug:"flow-mainnet"},{chain:kb,shortName:"hyperliquid",displayName:"Hyperliquid",alchemySlug:"hyperliquid-mainnet"},{chain:Pb,shortName:"metis",displayName:"Metis",alchemySlug:"metis-mainnet"},{chain:Hb,shortName:"polygon-zkevm",displayName:"Polygon zkEVM",alchemySlug:"polygonzkevm-mainnet"},{chain:Zb,shortName:"sei",displayName:"Sei",alchemySlug:"sei-mainnet"},{chain:$b,shortName:"story",displayName:"Story",alchemySlug:"story-mainnet"},{chain:Jb,shortName:"soneium",displayName:"Soneium",alchemySlug:"soneium-mainnet"},{chain:Xy,shortName:"abstract",displayName:"Abstract",alchemySlug:"abstract-mainnet"},{chain:ab,shortName:"botanix",displayName:"Botanix",alchemySlug:"botanix-mainnet"},{chain:yb,shortName:"crossfi",displayName:"CrossFi",alchemySlug:"crossfi-mainnet"},{chain:Lb,shortName:"mantle",displayName:"Mantle",alchemySlug:"mantle-mainnet"},{chain:tw,shortName:"superseed",displayName:"Superseed",alchemySlug:"superseed-mainnet"},{chain:cw,shortName:"zetachain",displayName:"ZetaChain",alchemySlug:"zetachain-mainnet"},{chain:ib,shortName:"base",displayName:"Base",alchemySlug:"base-mainnet"},{chain:_y,shortName:"apechain",displayName:"ApeChain",alchemySlug:"apechain-mainnet"},{chain:$y,shortName:"arbitrum",displayName:"Arbitrum",alchemySlug:"arb-mainnet"},{chain:gb,shortName:"celo",displayName:"Celo",alchemySlug:"celo-mainnet"},{chain:tb,shortName:"avalanche",displayName:"Avalanche C-Chain",alchemySlug:"avax-mainnet"},{chain:jb,shortName:"scroll",displayName:"Scroll",alchemySlug:"scroll-mainnet"},{chain:Cb,shortName:"ink",displayName:"Ink",alchemySlug:"ink-mainnet"},{chain:Nb,shortName:"linea",displayName:"Linea",alchemySlug:"linea-mainnet"},{chain:wb,shortName:"geist",displayName:"Geist",alchemySlug:"geist-mainnet"},{chain:rb,shortName:"berachain",displayName:"Berachain",alchemySlug:"berachain-mainnet"},{chain:sb,shortName:"blast",displayName:"Blast",alchemySlug:"blast-mainnet"},{chain:eb,shortName:"astar",displayName:"Astar",alchemySlug:"astar-mainnet"},{chain:lw,shortName:"zksync",displayName:"zkSync",alchemySlug:"zksync-mainnet"},{chain:Vb,shortName:"rootstock",displayName:"Rootstock",alchemySlug:"rootstock-mainnet"},{chain:o.defineChain({id:69e3,name:"AnimeChain",nativeCurrency:{name:"Animecoin",symbol:"ANIME",decimals:18},rpcUrls:{default:{http:[`https://anime-mainnet.g.alchemy.com/v2/${uw}`]}},blockExplorers:{default:{name:"AnimeChain Explorer",url:"https://explorer.anime.xyz"}}}),shortName:"anime",displayName:"AnimeChain",alchemySlug:"anime-mainnet"}].map(({chain:e,shortName:t,displayName:n,alchemySlug:i})=>({...e,shortName:t,displayName:n,alchemySlug:i}));dw.map(e=>e.id);const hw=Object.fromEntries(dw.map(e=>[e.id,e.alchemySlug])),Aw=Object.fromEntries(dw.map(e=>[e.shortName,e.id])),pw=(Object.fromEntries(dw.map(e=>[e.shortName,e.displayName])),Object.fromEntries(dw.map(e=>[e.id,e])));Object.fromEntries(dw.map(e=>[e.shortName,e]));const mw=e=>{const t="string"==typeof e?parseInt(e,10):e;return pw[t]||null},fw="https://coinley.io/logo.png",gw={timeout:15e3,retryCount:2,retryDelay:1e3},yw=Object.fromEntries(dw.map(e=>[e.id,u.fallback([u.http(`https://${e.alchemySlug}.g.alchemy.com/v2/${uw}`,gw),u.http(`https://${e.alchemySlug}.g.alchemy.com/v2/qtIcCe_-8t4rIWktnWJm0`,gw)])])),bw=u.createConfig({chains:dw,connectors:[h.injected(),h.metaMask({dappMetadata:{name:"Coinley Payment",icon:fw}}),h.coinbaseWallet({appName:"Coinley Payment",appLogoUrl:fw}),h.walletConnect({projectId:"1d05a3403626aae7674102b52350de60",metadata:{name:"Coinley Payment",description:"Crypto Payment Gateway",url:"undefined"!=typeof window?window.location.origin:"https://coinley.io",icons:["https://coinley.io/logo.png"]},showQrModal:!0})],transports:yw});let ww=class{constructor(e,t,n=null){this.baseURL=e.endsWith("/")?e.slice(0,-1):e,t&&t.startsWith("pk_")?(this.publicKey=t,this.apiKey=null,this.apiSecret=null):(this.publicKey=null,this.apiKey=t,this.apiSecret=n)}async request(e,t={}){const n=`${this.baseURL}${e}`,i={"Content-Type":"application/json",...t.headers};this.publicKey?i["X-Public-Key"]=this.publicKey:(i["X-API-Key"]=this.apiKey,i["X-API-Secret"]=this.apiSecret);const r=t.timeout||6e4,o=new AbortController,s=setTimeout(()=>o.abort(),r);try{const e=await fetch(n,{...t,headers:i,signal:o.signal});if(clearTimeout(s),!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error||`HTTP ${e.status}`)}return e.json()}catch(gd){if(clearTimeout(s),"AbortError"===gd.name)throw new Error(`Request timeout after ${r/1e3}s: ${e}`);throw gd}}async getNetworks(){try{return await this.request("/api/networks")}catch(gd){return{networks:[{id:"1",name:"Ethereum",shortName:"ethereum",chainId:"0x1",type:"ethereum"},{id:"56",name:"BSC",shortName:"bsc",chainId:"0x38",type:"bsc"},{id:"137",name:"Polygon",shortName:"polygon",chainId:"0x89",type:"polygon"},{id:"42161",name:"Arbitrum",shortName:"arbitrum",chainId:"0xa4b1",type:"arbitrum"},{id:"10",name:"Optimism",shortName:"optimism",chainId:"0xa",type:"optimism"},{id:"43114",name:"Avalanche",shortName:"avalanche",chainId:"0xa86a",type:"avalanche"}]}}}async getPayableNetworks(){try{return await this.request("/api/networks/payable")}catch(gd){return this.getNetworks()}}async getTokens(){try{return await this.request("/api/networks/stablecoins")}catch(gd){return{stablecoins:[{id:"1",name:"Tether USD",symbol:"USDT",contractAddress:"0xdAC17F958D2ee523a2206206994597C13D831ec7",decimals:6,networkId:"1",Network:{shortName:"ethereum",name:"Ethereum"}},{id:"2",name:"USD Coin",symbol:"USDC",contractAddress:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",decimals:6,networkId:"1",Network:{shortName:"ethereum",name:"Ethereum"}},{id:"3",name:"Tether USD",symbol:"USDT",contractAddress:"0x55d398326f99059fF775485246999027B3197955",decimals:18,networkId:"56",Network:{shortName:"bsc",name:"BSC"}},{id:"4",name:"USD Coin",symbol:"USDC",contractAddress:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",decimals:18,networkId:"56",Network:{shortName:"bsc",name:"BSC"}},{id:"5",name:"Tether USD",symbol:"USDT",contractAddress:"0xc2132D05D31c914a87c6611C10748AEb04B58e8F",decimals:6,networkId:"137",Network:{shortName:"polygon",name:"Polygon"}},{id:"6",name:"USD Coin",symbol:"USDC",contractAddress:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",decimals:6,networkId:"137",Network:{shortName:"polygon",name:"Polygon"}},{id:"7",name:"Tether USD",symbol:"USDT",contractAddress:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",decimals:6,networkId:"42161",Network:{shortName:"arbitrum",name:"Arbitrum"}},{id:"8",name:"USD Coin",symbol:"USDC",contractAddress:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",decimals:6,networkId:"42161",Network:{shortName:"arbitrum",name:"Arbitrum"}},{id:"9",name:"Tether USD",symbol:"USDT",contractAddress:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",decimals:6,networkId:"10",Network:{shortName:"optimism",name:"Optimism"}},{id:"10",name:"USD Coin",symbol:"USDC",contractAddress:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",decimals:6,networkId:"10",Network:{shortName:"optimism",name:"Optimism"}},{id:"11",name:"Tether USD",symbol:"USDT",contractAddress:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",decimals:6,networkId:"43114",Network:{shortName:"avalanche",name:"Avalanche"}},{id:"12",name:"USD Coin",symbol:"USDC",contractAddress:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",decimals:6,networkId:"43114",Network:{shortName:"avalanche",name:"Avalanche"}},{id:"13",name:"Tether USD",symbol:"USDT",contractAddress:"0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e",decimals:6,networkId:"42220",Network:{shortName:"celo",name:"Celo"}},{id:"14",name:"USD Coin",symbol:"USDC",contractAddress:"0xcebA9300f2b948710d2653dD7B07f33A8B32118C",decimals:6,networkId:"42220",Network:{shortName:"celo",name:"Celo"}},{id:"15",name:"Tether USD",symbol:"USDT",contractAddress:"0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2",decimals:6,networkId:"8453",Network:{shortName:"base",name:"Base"}},{id:"16",name:"USD Coin",symbol:"USDC",contractAddress:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",decimals:6,networkId:"8453",Network:{shortName:"base",name:"Base"}}]}}}async getPayableTokens(){try{return await this.request("/api/networks/payable/stablecoins")}catch(gd){return this.getTokens()}}async createPayment(e){return await this.request("/api/payments/create",{method:"POST",body:JSON.stringify(e)})}async verifyQRPayment(e){return await this.request("/api/payments/verify-qr",{method:"POST",body:JSON.stringify({paymentId:e})})}async checkPaymentStatus(e){return await this.request(`/api/payments/status/${e}`)}async getContractInfo(e){try{const t=await this.request(`/api/payments/contract/${e}`);if(!t.success)throw new Error("Contract not supported on this network");return t.contractInfo}catch(gd){throw new Error(gd.message||"Failed to get contract information")}}async processPayment(e,t,n,i){try{return await this.request("/api/payments/process",{method:"POST",body:JSON.stringify({paymentId:e,transactionHash:t,network:n,senderAddress:i}),timeout:9e4})}catch(gd){throw console.error("❌ [API] processPayment error:",gd),console.error("❌ [API] processPayment error details:",{message:gd.message,name:gd.name,stack:gd.stack}),gd}}async failPayment(e,t="Payment cancelled by user",n="failed"){return await this.request("/api/payments/fail",{method:"POST",body:JSON.stringify({paymentId:e,reason:t,status:n})})}async getSupportedDepositChains(){try{return await this.request("/api/deposits/supported-chains")}catch(gd){return console.warn("Failed to get supported deposit chains:",gd.message),{success:!0,chains:[{chainId:8453,name:"Base",confirmations:5},{chainId:56,name:"BSC",confirmations:10},{chainId:42161,name:"Arbitrum",confirmations:10},{chainId:137,name:"Polygon",confirmations:15},{chainId:10,name:"Optimism",confirmations:5},{chainId:43114,name:"Avalanche",confirmations:10},{chainId:143,name:"Monad",confirmations:5}]}}}async createDepositPayment(e){return await this.request("/api/deposits/create",{method:"POST",body:JSON.stringify(e)})}async getDepositStatus(e){return await this.request(`/api/deposits/status/${e}`)}async getDepositBalance(e){return await this.request(`/api/deposits/balance/${e}`)}async requestDepositRefund(e,t){return await this.request(`/api/deposits/refund-request/${e}`,{method:"POST",body:JSON.stringify({refundAddress:t})})}async getBridgeRoute(e){return(await this.request("/api/bridge/quote",{method:"POST",body:JSON.stringify(e),timeout:45e3})).route}async getBridgeTokens(e){const t=new URLSearchParams({chainId:String(e)}).toString();return(await this.request(`/api/bridge/tokens?${t}`,{timeout:3e4})).tokens||[]}async getBridgeStatusV2(e){const t=new URLSearchParams(e).toString();return(await this.request(`/api/bridge/status?${t}`,{timeout:2e4})).status}async trackBridge(e){return await this.request("/api/bridge/track",{method:"POST",body:JSON.stringify(e),timeout:2e4})}async getCrossChainSources(){var e;const t=await this.request("/api/payments/cross-chain/sources");return Array.isArray(t)?t:Array.isArray(null==t?void 0:t.sources)?t.sources:Array.isArray(null==(e=null==t?void 0:t.data)?void 0:e.sources)?t.data.sources:[]}async createCrossChainPayment(e){return await this.request("/api/payments/cross-chain/create",{method:"POST",body:JSON.stringify(e)})}async getCrossChainStatus(e){return await this.request(`/api/payments/cross-chain/status/${e}`)}isDepositSupported(e){return[8453,56,42161,137,10,43114,143,59144,534352,130].includes(parseInt(e))}};const vw="https://li.quest/v1",kw=["base","arbitrum","optimism","polygon","bsc","avalanche"],xw={1:"ethereum",10:"optimism",56:"bsc",100:"gnosis",130:"unichain",137:"polygon",143:"monad",146:"sonic",324:"zksync",480:"world-chain",747:"flow-evm",999:"hyperliquid",1088:"metis",1329:"sei",1868:"soneium",2741:"abstract",5e3:"mantle",8453:"base",33139:"apechain",42161:"arbitrum",42170:"arbitrum-nova",42220:"celo",43114:"avalanche",57073:"ink",59144:"linea",80094:"berachain",81457:"blast",534352:"scroll"},Cw="0x0000000000000000000000000000000000000000",Sw={1:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",8453:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",42161:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",137:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",10:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",56:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",43114:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",42220:"0xcebA9300f2b948710d2653dD7B07f33A8B32118C"},Bw={1:"0xdAC17F958D2ee523a2206206994597C13D831ec7",8453:"0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2",42161:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",137:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",56:"0x55d398326f99059fF775485246999027B3197955"},Iw=(e,t=6)=>e?{address:e,decimals:t}:null,Ew=e=>({usdc:Iw(Sw[e]),usdt:Iw(Bw[e])}),Mw=e=>{if(!e||0===e.length)return null;for(const t of kw){const n=e.find(e=>{var n;return(null==(n=e.shortName)?void 0:n.toLowerCase())===t});if(n)return n}return e[0]},Dw=(e,t="USDC")=>"USDT"===t.toUpperCase()?Bw[e]||null:Sw[e]||null,Qw=0x416edef1601be,Uw={SOL:"11111111111111111111111111111111",USDC:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",USDT:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"},Fw=(e,t)=>{var n,i;const r=null==e?void 0:e.toUpperCase();return t?"USDC"===r?(null==(n=t.usdc)?void 0:n.address)||null:"USDT"===r&&(null==(i=t.usdt)?void 0:i.address)||null:null},Nw=(e,t,i)=>{const[r,o]=n.useState("method"),[s,a]=n.useState([]),[c,l]=n.useState([]),[u,d]=n.useState([]),[h,A]=n.useState([]),[p,m]=n.useState(null),[f,g]=n.useState(null),[y,b]=n.useState(null),[w,v]=n.useState(null),[k,x]=n.useState(!1),[C,S]=n.useState(""),[B,I]=n.useState(!1),[E,M]=n.useState("Processing transaction..."),[D,Q]=n.useState("deposit"),[U,F]=n.useState(null),[N,T]=n.useState([]),[L,P]=n.useState(!1),[O,R]=n.useState(null),z=n.useRef(new ww(e,t,i)),q=async e=>{try{const t=new Set(e.filter(e=>e.chainId&&"solana"!==e.shortName&&"solana"!==e.chainType).map(e=>parseInt(e.chainId)));if(0===t.size)return;const n=Mw(e);if(!n)return;const i=parseInt(n.chainId),r=Ew(i),o=Object.entries(xw).filter(([e])=>{const n=parseInt(e,10);if(!n)return!1;if(t.has(n))return!1;const i=Ew(n);return!(!i.usdc&&!i.usdt)}).map(([e,t])=>{const i=parseInt(e,10),o=Ew(i);return{id:`bridge-${i}`,name:t||`Chain ${i}`,shortName:t||`chain-${i}`,chainId:i,chainType:"evm",isBridgeNetwork:!0,bridgeDestination:{...n,bridgeTokens:r},bridgeTokens:o,logo:null}});T(o)}catch(t){console.warn("[PaymentFlow] Bridge network loading failed:",t.message),T([])}};return{currentStep:r,networks:s,merchantNetworks:c,tokens:u,merchantTokens:h,selectedNetwork:p,selectedToken:f,paymentMethod:y,paymentData:w,loading:k,error:C,processing:B,processingMessage:E,paymentType:D,actualTransactionHash:U,bridgeNetworks:N,isBridgePayment:L,bridgeDestination:O,setIsBridgePayment:P,setBridgeDestination:R,setCurrentStep:o,setSelectedNetwork:m,setSelectedToken:g,setPaymentMethod:b,setPaymentData:v,setError:S,setProcessing:I,setProcessingMessage:M,setPaymentType:Q,setActualTransactionHash:F,loadData:async()=>{try{x(!0),S("");const[e,t,n,i]=await Promise.all([z.current.getNetworks(),z.current.getTokens(),z.current.getPayableNetworks?z.current.getPayableNetworks():z.current.getNetworks(),z.current.getPayableTokens?z.current.getPayableTokens():z.current.getTokens()]),r=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test("undefined"!=typeof navigator?navigator.userAgent:""),o=(e=[])=>e.reduce((e,t)=>{if("tron"===t.shortName||"algorand"===t.shortName)return e;if("arbitrum-nova"===t.shortName||42170===parseInt(t.chainId))return e;const n="solana"===t.shortName||"solana"===t.chainType;if(n&&r)return e;if(!(n||t.chainId&&null!==t.chainId))return e;const i=n?`solana-${t.shortName}`:`${t.chainId}-${t.shortName}`;return e.some(e=>("solana"===e.shortName||"solana"===e.chainType?`solana-${e.shortName}`:`${e.chainId}-${e.shortName}`)===i)||e.push(t),e},[]),s=o(n.networks||e.networks||[]),c=o(e.networks||[]),u=(e=[])=>e.reduce((e,t)=>{var n,i,o,s,a,c,l;if(!["USDC","USDT","SOL"].includes(t.symbol))return e;if("tron"===(null==(n=t.Network)?void 0:n.shortName)||"algorand"===(null==(i=t.Network)?void 0:i.shortName))return e;if("arbitrum-nova"===(null==(o=t.Network)?void 0:o.shortName)||42170===parseInt(null==(s=t.Network)?void 0:s.chainId))return e;if(("solana"===(null==(a=t.Network)?void 0:a.shortName)||"solana"===(null==(c=t.Network)?void 0:c.chainType))&&r)return e;const u=`${t.symbol}-${(null==(l=t.Network)?void 0:l.shortName)||t.networkId}`;return e.some(e=>{var t;return`${e.symbol}-${(null==(t=e.Network)?void 0:t.shortName)||e.networkId}`===u})||e.push(t),e},[]),h=u(i.stablecoins||t.stablecoins||[]),p=u(t.stablecoins||[]);a(s),l(c),d(h),A(p),q(c)}catch(wU){S("Failed to load payment options. Using fallback data.")}finally{x(!1)}},createPayment:async e=>{var t,n;const i=(null==e?void 0:e.__coinleyAttemptMeta)||null;try{x(!0),S("");const r=parseFloat(e.amount);if(!r||r<=0||isNaN(r))throw new Error("Invalid payment amount. Please ensure the order total is greater than zero before proceeding.");const s=(null==p?void 0:p.isBridgeNetwork)&&(null==p?void 0:p.bridgeDestination)?p.bridgeDestination.shortName:p.shortName,a={amount:e.amount,currency:f.symbol,network:s,customerEmail:e.customerEmail,callbackUrl:e.callbackUrl,metadata:{...e.metadata,merchantWalletAddresses:e.merchantWalletAddresses,paymentMethod:y,selectedNetwork:s,selectedToken:f.symbol,wagmiEnabled:!0,...(null==p?void 0:p.isBridgeNetwork)?{bridgeFrom:p.shortName,bridgeTo:s,bridgeFromChainId:p.chainId,bridgeProvider:"lifi"}:{}}},c=await z.current.createPayment(a);if(!(()=>{if(!(null==i?void 0:i.isStillCurrent))return!0;try{return!!i.isStillCurrent()}catch{return!1}})()){const e=new Error("Your payment quote changed while you were switching networks or tokens. Please try again.");throw e.code="STALE_ATTEMPT",e}const l={...c.payment,__coinleyAttemptId:(null==i?void 0:i.attemptId)??null,__coinleySelectionSnapshot:(null==i?void 0:i.selectionSnapshot)??null};return v(l),sm.trackPaymentCreated(null==(t=c.payment)?void 0:t.id,e.amount,p.shortName,f.symbol),lm.trackPaymentCreated(null==(n=c.payment)?void 0:n.id,e.amount,p.shortName,f.symbol),o("confirm"),l}catch(wU){if("STALE_ATTEMPT"===(null==wU?void 0:wU.code))throw wU;S(wU.message),sm.trackError("payment_creation_failed",wU.message,{amount:e.amount,network:null==p?void 0:p.shortName,token:null==f?void 0:f.symbol}),lm.trackError("payment_creation_failed",wU.message,{amount:e.amount,network:null==p?void 0:p.shortName,token:null==f?void 0:f.symbol})}finally{x(!1)}},failPayment:async(e="Payment cancelled by user",t="failed")=>{if(null==w?void 0:w.id)try{await z.current.failPayment(w.id,e,t)}catch(n){}},resetState:()=>{o("method"),m(null),g(null),b(null),v(null),S(""),I(!1),F(null),Q("wallet"),P(!1),R(null)},resetTransactionState:()=>{S(""),I(!1),F(null),o("confirm")},isDepositSupported:()=>{if(!p)return!1;const e=parseInt(p.chainId);return[8453,56,42161,137,10,43114,143,59144,534352,130].includes(e)},createDepositPayment:async e=>{var t,n,i;const r=(null==e?void 0:e.__coinleyAttemptMeta)||null;try{x(!0),S("");const s=parseFloat(e.amount);if(!s||s<=0||isNaN(s))throw new Error("Invalid payment amount. Please ensure the order total is greater than zero before proceeding.");if(!e.network){if(![8453,56,42161,137,10,43114,143,59144,534352,130].includes(parseInt(null==p?void 0:p.chainId)))throw new Error(`Deposit address payments not supported on ${(null==p?void 0:p.name)||"this network"}. Use wallet payment instead.`)}const a=(null==(t=e.metadata)?void 0:t.debugId)||`deposit-sdk-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,c={amount:e.amount,currency:e.currency||f.symbol,network:e.network||p.shortName,customerEmail:e.customerEmail,callbackUrl:e.callbackUrl,...e.expiresIn?{expiresIn:e.expiresIn}:{},metadata:{...e.metadata,debugId:a,merchantWalletAddresses:e.merchantWalletAddresses,paymentMethod:"deposit_address",selectedNetwork:p.shortName,selectedToken:f.symbol}};if((null==w?void 0:w.id)&&!(null==w?void 0:w.isDepositPayment)){const e=w.__coinleyAttemptId??null;(!(null==r?void 0:r.attemptId)||!e||e===r.attemptId)&&(c.existingPaymentId=w.id)}const l=await z.current.createDepositPayment(c);if(!l.success)throw new Error(l.error||"Failed to create deposit payment");if(!(()=>{if(!(null==r?void 0:r.isStillCurrent))return!0;try{return!!r.isStillCurrent()}catch{return!1}})()){const e=new Error("Your payment quote changed while you were switching networks or tokens. Please try again.");throw e.code="STALE_ATTEMPT",e}const u={...l.payment,isDepositPayment:!0,__coinleyAttemptId:(null==r?void 0:r.attemptId)??null,__coinleySelectionSnapshot:(null==r?void 0:r.selectionSnapshot)??null};return v(u),Q("deposit"),sm.trackPaymentCreated(null==(n=l.payment)?void 0:n.id,e.amount,p.shortName,f.symbol),lm.trackPaymentCreated(null==(i=l.payment)?void 0:i.id,e.amount,p.shortName,f.symbol),o("confirm"),u}catch(wU){if("STALE_ATTEMPT"===(null==wU?void 0:wU.code))throw wU;throw S(wU.message),sm.trackError("deposit_payment_creation_failed",wU.message,{amount:e.amount,network:null==p?void 0:p.shortName,token:null==f?void 0:f.symbol}),lm.trackError("deposit_payment_creation_failed",wU.message,{amount:e.amount,network:null==p?void 0:p.shortName,token:null==f?void 0:f.symbol}),wU}finally{x(!1)}},resetDepositPayment:()=>{v(e=>{if(null==e?void 0:e.isDepositPayment){const{isDepositPayment:t,depositAddress:n,expiresAt:i,requiredConfirmations:r,...o}=e;return o}return e})},isSwapRequired:()=>!!f&&(!0===f.isSwapToken||!isStablecoin(f.symbol)),getMerchantStablecoin:e=>{const t=null==e?void 0:e.shortName;if(!t)return null;const n=h.find(e=>{var n;return"USDC"===e.symbol&&(null==(n=e.Network)?void 0:n.shortName)===t&&!e.isSwapToken});if(n)return n;return h.find(e=>{var n;return"USDT"===e.symbol&&(null==(n=e.Network)?void 0:n.shortName)===t&&!e.isSwapToken})||null},api:z.current}},Tw=["https://solana-mainnet.g.alchemy.com/v2/YWG990wOlIikc1tU7-WWTepfU8d1f4dp","https://solana-mainnet.g.alchemy.com/v2/qtIcCe_-8t4rIWktnWJm0","https://api.mainnet-beta.solana.com","https://solana-api.projectserum.com","https://rpc.ankr.com/solana"],Lw="solana-mainnet",Pw="Solana",Ow={PHANTOM:{name:"Phantom",id:"phantom",icon:"https://phantom.app/favicon.ico",downloadUrl:"https://phantom.app/",deepLink:"https://phantom.app/ul/browse/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa",firefox:"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/",ios:"https://apps.apple.com/us/app/phantom-solana-wallet/id1598432977",android:"https://play.google.com/store/apps/details?id=app.phantom"}},SOLFLARE:{name:"Solflare",id:"solflare",icon:"https://solflare.com/favicon.ico",downloadUrl:"https://solflare.com/",deepLink:"https://solflare.com/ul/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/solflare-wallet/bhhhlbepdkbapadjdnnojkbgioiodbic",firefox:"https://addons.mozilla.org/en-US/firefox/addon/solflare-wallet/",ios:"https://apps.apple.com/us/app/solflare/id1580902717",android:"https://play.google.com/store/apps/details?id=com.solflare.mobile"}},BACKPACK:{name:"Backpack",id:"backpack",icon:"https://backpack.app/favicon.ico",downloadUrl:"https://backpack.app/",deepLink:"https://backpack.app/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/backpack/aflkmfhebedbjioipglgcbcmnbpgliof",ios:"https://apps.apple.com/us/app/backpack-crypto-wallet/id6448811949"}},TRUST_WALLET:{name:"Trust Wallet",id:"trust",icon:"https://trustwallet.com/favicon.ico",downloadUrl:"https://trustwallet.com/",deepLink:"https://link.trustwallet.com/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph",ios:"https://apps.apple.com/app/trust-crypto-bitcoin-wallet/id1288339409",android:"https://play.google.com/store/apps/details?id=com.wallet.crypto.trustapp"}},MAGIC_EDEN:{name:"Magic Eden",id:"magiceden",icon:"https://wallet.magiceden.io/favicon.ico",downloadUrl:"https://wallet.magiceden.io/",deepLink:"https://wallet.magiceden.io/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/magic-eden-wallet/mkpegjkblkkefacfnmkajcjmabijhclg",ios:"https://apps.apple.com/app/magic-eden-wallet/id6449729293",android:"https://play.google.com/store/apps/details?id=io.magiceden.wallet"}}},Rw="evm",zw="solana",qw={...Aw},Yw=Object.fromEntries(dw.map(e=>[e.id,60])),Kw=e=>"number"==typeof e?e:"string"==typeof e?e.startsWith("0x")?parseInt(e,16):parseInt(e,10):1,Hw=e=>qw[e]||1,Vw=e=>(e=>{var t;if(!e)return!1;const n=e.toString().toLowerCase();return["solana","solana-mainnet","103"].includes(n)||n===Lw||(null==(t=Pw)?void 0:t.toLowerCase())===n})(e)?zw:Rw,jw=(e,t,n=!1)=>{if(!e||"string"!=typeof e)throw new Error(`Missing ${t} address`);if(!e.startsWith("0x"))throw new Error(`Invalid ${t} address format: must start with 0x`);if(42!==e.length)throw new Error(`Invalid ${t} address length: expected 42 characters, got ${e.length}`);if("0x0000000000000000000000000000000000000000"===e&&!n)throw new Error(`Invalid ${t} address: cannot be zero address`)},Zw=e=>{const t=(e=>{jw(e.token,"token"),jw(e.recipient1,"recipient1"),jw(e.recipient2,"recipient2");const t=0n===BigInt(e.recipient3Percentage||0);if(jw(e.recipient3,"recipient3",t),!e.paymentId||"string"!=typeof e.paymentId||0===e.paymentId.length)throw new Error("Invalid payment ID: must be a non-empty string");let n,i,r,o;try{n=BigInt(e.amount||0),i=BigInt(e.recipient1Percentage||0),r=BigInt(e.recipient2Percentage||0),o=BigInt(e.recipient3Percentage||0)}catch(a){throw new Error("Invalid numeric values: cannot convert to BigInt")}if(n<=0n)throw new Error(`Invalid amount: ${e.amount} (must be greater than 0)`);const s=i+r+o;if(10000n!==s)throw new Error(`Invalid percentages: total is ${s} but must equal 10000 basis points (100%). Individual: ${i}, ${r}, ${o}`);return{amount:n,percentage1:i,percentage2:r,percentage3:o}})(e);return{token:e.token,amount:t.amount,paymentId:e.paymentId,recipient1:e.recipient1,recipient2:e.recipient2,recipient3:e.recipient3,recipient1Percentage:t.percentage1,recipient2Percentage:t.percentage2,recipient3Percentage:t.percentage3}},Xw=[{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}],Gw=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}],Ww=e=>{var t,n;const i=(null==(t=null==e?void 0:e.message)?void 0:t.toLowerCase())||(null==(n=null==e?void 0:e.toString())?void 0:n.toLowerCase())||"",r=(null==e?void 0:e.code)||(null==e?void 0:e.reason)||"";return i.includes("user rejected")||i.includes("user denied")||i.includes("user cancelled")||i.includes("cancelled by user")||i.includes("rejected by user")||i.includes("rejected the request")||4001===r||"ACTION_REJECTED"===r?"user_rejected":i.includes("insufficient funds")||i.includes("insufficient balance")||i.includes("insufficient eth")||i.includes("insufficient matic")||i.includes("insufficient bnb")||-32e3===r?"insufficient_funds":i.includes("wrong network")||i.includes("unsupported network")||i.includes("chain mismatch")||4902===r?"wrong_network":i.includes("wallet not connected")||i.includes("no provider")||i.includes("wallet disconnected")||4900===r?"wallet_disconnected":i.includes("no routes found")||i.includes("unable to find a bridge route")||i.includes("failed to get bridge quote")?"no_route":i.includes("jupiter swap failed")||i.includes("jupiter quote failed")||i.includes("could not determine swap rate")||i.includes("swap failed")?"swap_failed":i.includes("blockhash not found")||i.includes("block height exceeded")||i.includes("blockhash has expired")?"blockhash_expired":i.includes("simulation failed")||i.includes("transaction failed on-chain")?"simulation_failed":i.includes("confirmation timed out")||i.includes("swap confirmation timed out")?"confirmation_timeout":i.includes("network error")||i.includes("rpc error")||i.includes("connection failed")||i.includes("timeout")||i.includes("request failed")?"network_error":i.includes("gas estimation failed")||i.includes("execution reverted")||i.includes("out of gas")?"gas_error":i.includes("approve")&&i.includes("failed")?"approval_failed":i.includes("transaction failed")||i.includes("revert")||i.includes("contract call failed")||i.includes("bridge transaction failed")?"transaction_failed":i.includes("popup")||i.includes("blocked")?"popup_blocked":i.includes("rate limit")||i.includes("too many requests")?"rate_limited":i.includes("payment not yet confirmed")||i.includes("not yet confirmed on-chain")||i.includes("payment not found on-chain")||i.includes("please complete the payment")?"payment_pending":i.includes("deep link")||i.includes("app not installed")||i.includes("wallet app")?"mobile_wallet_error":"unknown_error"},Jw={user_rejected:{message:"Payment cancelled.",suggestion:'Tap "Pay Now" when you\'re ready.'},insufficient_funds:{message:"Payment failed. Insufficient balance.",suggestion:"Please check your wallet balance and try again."},wallet_disconnected:{message:"Wallet disconnected.",suggestion:"Please reconnect your wallet and try again."},wrong_network:{message:"Please switch networks in your wallet.",suggestion:"Your wallet should prompt you to switch."},_default:{message:"Something went wrong. Please try again.",suggestion:"If this keeps happening, try a different token or wallet."}},_w=e=>{const t=Ww(e),n=Jw[t]||Jw._default;return{type:t,message:n.message,suggestion:n.suggestion,_internal:(null==e?void 0:e.message)||"Unknown error"}},$w=(e,t="")=>({timestamp:(new Date).toISOString(),context:t,type:Ww(e),technical:{message:(null==e?void 0:e.message)||"Unknown error",code:null==e?void 0:e.code,reason:null==e?void 0:e.reason,name:null==e?void 0:e.name}}),ev=async(e,t)=>{try{const n=await u.estimateFeesPerGas(e,{chainId:t}),i=120n,r=100n;return{maxFeePerGas:n.maxFeePerGas?n.maxFeePerGas*i/r:void 0,maxPriorityFeePerGas:n.maxPriorityFeePerGas?n.maxPriorityFeePerGas*i/r:void 0}}catch(gd){return{}}},tv=(e,t,i,r,s,a)=>{const[l,d]=n.useState("idle"),[h,A]=n.useState(""),[p,m]=n.useState(null),[f,g]=n.useState(null),{data:y,isPending:b,error:w,sendTransaction:v}=c.useSendTransaction(),{isLoading:k,isSuccess:x}=c.useWaitForTransactionReceipt({hash:y}),C=(e,t)=>{I(e,t,{background:!0}).catch(e=>{console.error("[processFinalPayment] Background finalization failed:",e)})},S=async(n=null)=>{var s,c;const l=n||e;if(!r||!(null==l?void 0:l.contractCall))throw new Error("Missing wallet connection or payment data");const h=l.contractCall;if(!h.contractAddress)throw new Error("PaymentSplitter contract data missing from payment response");if((null==a?void 0:a.ensureCorrectNetwork)&&i){if(!(await a.ensureCorrectNetwork(i)))throw new Error("Network verification failed. Please ensure you are on the correct network.")}if(!t.contractAddress)throw new Error("Native token transactions not yet supported with PaymentSplitter. Please use ERC-20 tokens.");{const e=t.decimals||6,n=h.approvalAmount||Math.floor(l.totalAmount*Math.pow(10,e));try{let s,a="unknown";try{s=await u.readContract(bw,{address:h.tokenAddress,abi:Gw,functionName:"balanceOf",args:[r]}),a="wallet-rpc"}catch(p){const e=(null==i?void 0:i.chainId)||(null==i?void 0:i.id);if(!e)throw p;{const t=(e=>{const t=mw(e),n=t?[`https://${t.alchemySlug}.g.alchemy.com/v2/${uw}`]:null;if(!t||!n)return null;const i=n.map(e=>o.http(e,{timeout:1e4,retryCount:1}));return o.createPublicClient({chain:t,transport:o.fallback(i)})})(Kw(e));if(!t)throw p;try{s=await t.readContract({address:h.tokenAddress,abi:Gw,functionName:"balanceOf",args:[r]}),a="fallback-rpc"}catch(f){throw p}}}const c=BigInt(n);if(s<c){const n=`Insufficient ${t.symbol} balance. You have ${(Number(s)/Math.pow(10,e)).toFixed(6)} ${t.symbol} but need ${(Number(c)/Math.pow(10,e)).toFixed(6)} ${t.symbol}`;throw new Error(n)}}catch(y){if(y.message.includes("Insufficient"))throw y}d("approve"),window.coinleyPendingSplitPayment={contractCall:h,selectedToken:t,paymentData:l,selectedNetwork:i};try{const e="0xdac17f958d2ee523a2206206994597c13d831ec7"===h.tokenAddress.toLowerCase()||"USDT"===t.symbol.toUpperCase();let s,a=o.erc20Abi;e&&(a=Xw);try{s=BigInt(n)}catch(b){throw new Error(`Invalid amount value: ${n}`)}let c=0n,A=0;const p=3;for(;A<p;)try{c=await u.readContract(bw,{address:h.tokenAddress,abi:o.erc20Abi,functionName:"allowance",args:[r,h.contractAddress]});break}catch(w){A++,A<p?await new Promise(e=>setTimeout(e,2e3)):c=0n}if(c>=s){d("splitPayment");const e=await B();return e&&C(e,l),e}if(e&&c>0n){const e=await ev(bw,i.chainId),t=await u.writeContract(bw,{address:h.tokenAddress,abi:o.erc20Abi,functionName:"approve",args:[h.contractAddress,0n],...e});await u.waitForTransactionReceipt(bw,{hash:t,confirmations:1,timeout:12e4})}const f=await ev(bw,i.chainId),y=await u.writeContract(bw,{address:h.tokenAddress,abi:o.erc20Abi,functionName:"approve",args:[h.contractAddress,s],...f});m(y),g(y);await u.waitForTransactionReceipt(bw,{hash:y,confirmations:1,timeout:12e4});await new Promise(e=>setTimeout(e,3e3));let k=0;const x=3;let S=!1;for(;k<x&&!S;){try{if(await u.readContract(bw,{address:h.tokenAddress,abi:o.erc20Abi,functionName:"allowance",args:[r,h.contractAddress]})>=s){S=!0;break}k<x-1&&await new Promise(e=>setTimeout(e,2e3))}catch(v){k<x-1&&await new Promise(e=>setTimeout(e,2e3))}k++}const I=await B();return I&&C(I,l),I}catch(gd){$w(gd,"approve_transaction");const t=_w(gd);if(A(t),d("idle"),window.coinleyPendingSplitPayment=null,m(null),(null==(s=gd.message)?void 0:s.includes("User rejected"))||(null==(c=gd.message)?void 0:c.includes("User denied"))||4001===gd.code)throw new Error("Transaction was cancelled by user");const n=gd.message||"Unknown error";if(n.includes("PaymentSplitter")||n.includes("verification")||n.includes("processing"))throw new Error(`Payment verification failed: ${n}`);if(n.includes("splitPayment")||n.includes("split payment"))throw new Error(`Payment transaction failed: ${n}`);throw new Error(`Approve failed: ${n}`)}}},B=async()=>{var e,t,n,i,r;try{d("splitPayment");const c=window.coinleyPendingSplitPayment;if(!c)throw new Error("Missing split payment data");const{contractCall:l,selectedToken:h,paymentData:A,selectedNetwork:p}=c,f=p.chainId||10,g=await s.getContractInfo(f),{abi:y}=g,b=Zw(l.params);Kw(f);try{const{request:e}=await u.simulateContract(bw,{address:l.contractAddress,abi:y,functionName:"splitPayment",args:[b]})}catch(o){const r=o.data||(null==(e=o.cause)?void 0:e.data);r&&("string"==typeof r&&r.startsWith("0x08c379a0")||"string"==typeof r&&r.startsWith("0x4e487b71"));o.reason||(null==(t=o.cause)?void 0:t.reason)||(null==(n=o.cause)?void 0:n.shortMessage)||(null==(i=o.data)||i.message)}const w=await ev(bw,f),v=3;let k;for(let e=0;e<=v;e++)try{k=await u.writeContract(bw,{address:l.contractAddress,abi:y,functionName:"splitPayment",args:[b],...w});break}catch(a){const t=(null==(r=a.message)?void 0:r.toLowerCase())||"",n=t.includes("rate limit")||t.includes("too many requests")||t.includes("retry in")||t.includes("call rate limit exhausted"),i=t.includes("internal json-rpc error")||t.includes("-32603")||t.includes("nonce")||t.includes("network request failed")||t.includes("timeout");if(e===v||!(n||i))throw a;const o=n?12e3:3e3*(e+1);await new Promise(e=>setTimeout(e,o))}return m(k),d("processing"),window.coinleyPendingSplitPayment=null,k}catch(gd){$w(gd,"split_payment_transaction");const t=_w(gd);throw A(t),d("idle"),window.coinleyPendingSplitPayment=null,m(null),gd}},I=async(n,o=null,a={})=>{var c;const l=o||e,u=!0===(null==a?void 0:a.background);try{if(u||d("processing"),f&&n===f)throw console.error("🛑 [processFinalPayment] BLOCKED: Attempted to send approve hash to backend!",{approveHash:f,transactionHash:n}),new Error("Invalid transaction: approve hash cannot be used as payment hash. The splitPayment transaction may have failed.");if(!s||!s.processPayment)throw new Error("API instance not available or missing processPayment method");u||await new Promise(e=>setTimeout(e,4e3));const e=3;let o=null;for(let a=0;a<e;a++)try{if(a>0){const e=5e3*a;await new Promise(t=>setTimeout(t,e))}const c=await s.processPayment(l.id,n,i.shortName,r);if(c&&!1!==c.success)return u||d("success"),sm.trackPaymentSuccess(l.id,l.amount,null==i?void 0:i.shortName,null==t?void 0:t.symbol,n),lm.trackPaymentSuccess(l.id,l.amount,null==i?void 0:i.shortName,null==t?void 0:t.symbol,n),c;o=new Error((null==c?void 0:c.error)||(null==c?void 0:c.message)||"Payment verification failed");const h=o.message.toLowerCase(),A=h.includes("not sent to")||h.includes("did not emit");if(!(!A&&(h.includes("not yet")||h.includes("not found")||h.includes("verification failed")))||a===e-1)throw o}catch(h){o=h;const t=(null==(c=h.message)?void 0:c.toLowerCase())||"",n=t.includes("not sent to")||t.includes("did not emit");if(!(!n&&(t.includes("not yet")||t.includes("not found")||t.includes("verification failed")||t.includes("timeout")||t.includes("network")))||a===e-1)throw o}throw o||new Error("Payment verification failed after retries")}catch(gd){console.error("❌ [processFinalPayment] Error occurred:",gd),console.error("❌ [processFinalPayment] Error details:",{message:gd.message,stack:gd.stack,name:gd.name});const n=$w(gd,"final_payment_processing");console.error("❌ [processFinalPayment] Formatted error log:",n);const r=_w(gd);throw console.error("❌ [processFinalPayment] User-friendly error:",r),u||(A(r),d("error")),sm.trackPaymentFailed(null==l?void 0:l.id,null==l?void 0:l.amount,null==i?void 0:i.shortName,null==t?void 0:t.symbol,r),lm.trackPaymentFailed(null==l?void 0:l.id,null==l?void 0:l.amount,null==i?void 0:i.shortName,null==t?void 0:t.symbol,r),gd}};return{transactionStep:l,transactionError:h,currentTransactionHash:p,txPending:b,isConfirming:k,isConfirmed:x,executePaymentTransaction:S,executeBridgeAndPay:async(e,t,n,i,r)=>{try{d("bridging"),null==r||r("bridging","Bridging tokens to destination chain...");const o=await e.executeBridge(t,n,(e,t)=>{null==r||r(e,t)});if(!o.success)throw new Error(o.error||"Bridge transaction failed");if(d("switching"),null==r||r("switching","Switching to destination network..."),(null==a?void 0:a.ensureCorrectNetwork)&&i){if(!(await a.ensureCorrectNetwork(i)))throw new Error("Failed to switch to destination network after bridge. Please switch manually and retry.")}await new Promise(e=>setTimeout(e,2e3)),null==r||r("paying","Processing payment on destination chain...");return await S()}catch(gd){console.error("[BridgeAndPay] Failed:",gd);const t=_w(gd);throw A(t),d("idle"),gd}},executeSwapToDeposit:async(e,t,n,i,r,o)=>{try{d("swapping");const a=t.isSwap&&!t.isSameChain?"swap & bridge":"swap";null==i||i("swapping",`Swapping ${t.originTokenSymbol} → ${t.destTokenSymbol}...`);const c=r?{...t,paymentId:r}:t,l=await e.executeBridge(c,n,(e,t)=>{null==i||i(e,t)});if(!l.success)throw new Error(l.error||`${a} transaction failed`);if(m(l.txHash),r&&o){null==i||i("verifying","Verifying deposit on server..."),d("verifying");const e=60;let n=!1,a=null;for(let t=0;t<e;t++){try{const e=await o.getDepositStatus(r),s=null==e?void 0:e.payment,c=`${(null==s?void 0:s.status)||"unknown"}:${(null==s?void 0:s.detectedAt)?"detected":"undetected"}`;if((c!==a||0===t||(null==s?void 0:s.detectedAt)||"completed"===(null==s?void 0:s.status)||"swept"===(null==s?void 0:s.status)||"sweeping"===(null==s?void 0:s.status)||"failed"===(null==s?void 0:s.status)||"expired"===(null==s?void 0:s.status)||(t+1)%10==0)&&(a=c),(null==s?void 0:s.detectedAt)||"completed"===(null==s?void 0:s.status)||"swept"===(null==s?void 0:s.status)||"sweeping"===(null==s?void 0:s.status)){n=!0,null==i||i("verified","Deposit confirmed by server!");break}if("failed"===(null==s?void 0:s.status)||"expired"===(null==s?void 0:s.status))throw new Error(`Payment ${s.status}. Please contact support.`)}catch(s){if(s.message.includes("Payment")&&(s.message.includes("failed")||s.message.includes("expired")))throw s}null==i||i("verifying",`Verifying deposit... (${t+1}/${e})`),await new Promise(e=>setTimeout(e,2e3))}if(!n)return console.warn("[SwapToDeposit] Server verification timed out, entering processing state:",{debugId:null==t?void 0:t.debugId,paymentId:r,txHash:l.txHash}),d("settlement_pending"),null==i||i("processing","Payment sent. Settlement is still being confirmed."),{success:!1,pendingSettlement:!0,txHash:l.txHash,paymentId:r}}return null==i||i("completed","Payment complete!"),d("idle"),l}catch(gd){console.error("[SwapToDeposit] Failed:",gd);const t=_w(gd);throw A(t),d("idle"),gd}},executeSplitPayment:B,processFinalPayment:I,resetTransaction:()=>{d("idle"),A(""),m(null),g(null),window.coinleyPendingSplitPayment=null},setTransactionError:A,setTransactionStep:d}},nv=BigInt(0),iv=BigInt(1);function rv(e,t=""){if("boolean"!=typeof e){throw new Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e)}return e}function ov(e,t,n=""){const i=Tf(e),r=null==e?void 0:e.length,o=void 0!==t;if(!i||o&&r!==t){throw new Error((n&&`"${n}" `)+"expected Uint8Array"+(o?` of length ${t}`:"")+", got "+(i?`length=${r}`:"type="+typeof e))}return e}function sv(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function av(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?nv:BigInt("0x"+e)}function cv(e){return av(Xf(e))}function lv(e){return Pf(e),av(Xf(Uint8Array.from(e).reverse()))}function uv(e,t){return ng(e.toString(16).padStart(2*t,"0"))}function dv(e,t){return uv(e,t).reverse()}function hv(e,t,n){let i;if("string"==typeof t)try{i=ng(t)}catch(o){throw new Error(e+" must be hex string or Uint8Array, cause: "+o)}else{if(!Tf(t))throw new Error(e+" must be hex string or Uint8Array");i=Uint8Array.from(t)}const r=i.length;if("number"==typeof n&&r!==n)throw new Error(e+" of length "+n+" expected, got "+r);return i}function Av(e){return Uint8Array.from(e)}const pv=e=>"bigint"==typeof e&&nv<=e;function mv(e,t,n,i){if(!function(e,t,n){return pv(e)&&pv(t)&&pv(n)&&t<=e&&e<n}(t,n,i))throw new Error("expected valid "+e+": "+n+" <= n < "+i+", got "+t)}function fv(e){let t;for(t=0;e>nv;e>>=iv,t+=1);return t}const gv=e=>(iv<<BigInt(e))-iv;function yv(e,t,n={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");function i(t,n,i){const r=e[t];if(i&&void 0===r)return;const o=typeof r;if(o!==n||null===r)throw new Error(`param "${t}" is invalid: expected ${n}, got ${o}`)}Object.entries(t).forEach(([e,t])=>i(e,t,!1)),Object.entries(n).forEach(([e,t])=>i(e,t,!0))}function bv(e){const t=new WeakMap;return(n,...i)=>{const r=t.get(n);if(void 0!==r)return r;const o=e(n,...i);return t.set(n,o),o}}
12
12
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const wv=BigInt(0),vv=BigInt(1),kv=BigInt(2),xv=BigInt(3),Cv=BigInt(4),Sv=BigInt(5),Bv=BigInt(7),Iv=BigInt(8),Ev=BigInt(9),Mv=BigInt(16);function Dv(e,t){const n=e%t;return n>=wv?n:t+n}function Qv(e,t,n){let i=e;for(;t-- >wv;)i*=i,i%=n;return i}function Uv(e,t){if(e===wv)throw new Error("invert: expected non-zero number");if(t<=wv)throw new Error("invert: expected positive modulus, got "+t);let n=Dv(e,t),i=t,r=wv,o=vv;for(;n!==wv;){const e=i%n,t=r-o*(i/n);i=n,n=e,r=o,o=t}if(i!==vv)throw new Error("invert: does not exist");return Dv(r,t)}function Fv(e,t,n){if(!e.eql(e.sqr(t),n))throw new Error("Cannot find square root")}function Nv(e,t){const n=(e.ORDER+vv)/Cv,i=e.pow(t,n);return Fv(e,i,t),i}function Tv(e,t){const n=(e.ORDER-Sv)/Iv,i=e.mul(t,kv),r=e.pow(i,n),o=e.mul(t,r),s=e.mul(e.mul(o,kv),r),a=e.mul(o,e.sub(s,e.ONE));return Fv(e,a,t),a}function Lv(e){if(e<xv)throw new Error("sqrt is not defined for small field");let t=e-vv,n=0;for(;t%kv===wv;)t/=kv,n++;let i=kv;const r=Yv(e);for(;1===zv(r,i);)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===n)return Nv;let o=r.pow(i,t);const s=(t+vv)/kv;return function(e,i){if(e.is0(i))return i;if(1!==zv(e,i))throw new Error("Cannot find square root");let r=n,a=e.mul(e.ONE,o),c=e.pow(i,t),l=e.pow(i,s);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,n=e.sqr(c);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===r)throw new Error("Cannot find square root");const i=vv<<BigInt(r-t-1),o=e.pow(a,i);r=t,a=e.sqr(o),c=e.mul(c,a),l=e.mul(l,o)}return l}}function Pv(e){return e%Cv===xv?Nv:e%Iv===Sv?Tv:e%Mv===Ev?function(e){const t=Yv(e),n=Lv(e),i=n(t,t.neg(t.ONE)),r=n(t,i),o=n(t,t.neg(i)),s=(e+Bv)/Mv;return(e,t)=>{let n=e.pow(t,s),a=e.mul(n,i);const c=e.mul(n,r),l=e.mul(n,o),u=e.eql(e.sqr(a),t),d=e.eql(e.sqr(c),t);n=e.cmov(n,a,u),a=e.cmov(l,c,d);const h=e.eql(e.sqr(a),t),A=e.cmov(n,a,h);return Fv(e,A,t),A}}(e):Lv(e)}const Ov=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Rv(e,t,n=!1){const i=new Array(t.length).fill(n?e.ZERO:void 0),r=t.reduce((t,n,r)=>e.is0(n)?t:(i[r]=t,e.mul(t,n)),e.ONE),o=e.inv(r);return t.reduceRight((t,n,r)=>e.is0(n)?t:(i[r]=e.mul(t,i[r]),e.mul(t,n)),o),i}function zv(e,t){const n=(e.ORDER-vv)/kv,i=e.pow(t,n),r=e.eql(i,e.ONE),o=e.eql(i,e.ZERO),s=e.eql(i,e.neg(e.ONE));if(!r&&!o&&!s)throw new Error("invalid Legendre symbol result");return r?1:o?0:-1}function qv(e,t){void 0!==t&&Lf(t);const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function Yv(e,t,n=!1,i={}){if(e<=wv)throw new Error("invalid field: expected ORDER > 0, got "+e);let r,o,s,a=!1;if("object"==typeof t&&null!=t){if(i.sqrt||n)throw new Error("cannot specify opts in two arguments");const e=t;e.BITS&&(r=e.BITS),e.sqrt&&(o=e.sqrt),"boolean"==typeof e.isLE&&(n=e.isLE),"boolean"==typeof e.modFromBytes&&(a=e.modFromBytes),s=e.allowedLengths}else"number"==typeof t&&(r=t),i.sqrt&&(o=i.sqrt);const{nBitLength:c,nByteLength:l}=qv(e,r);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const d=Object.freeze({ORDER:e,isLE:n,BITS:c,BYTES:l,MASK:gv(c),ZERO:wv,ONE:vv,allowedLengths:s,create:t=>Dv(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return wv<=t&&t<e},is0:e=>e===wv,isValidNot0:e=>!d.is0(e)&&d.isValid(e),isOdd:e=>(e&vv)===vv,neg:t=>Dv(-t,e),eql:(e,t)=>e===t,sqr:t=>Dv(t*t,e),add:(t,n)=>Dv(t+n,e),sub:(t,n)=>Dv(t-n,e),mul:(t,n)=>Dv(t*n,e),pow:(e,t)=>function(e,t,n){if(n<wv)throw new Error("invalid exponent, negatives unsupported");if(n===wv)return e.ONE;if(n===vv)return t;let i=e.ONE,r=t;for(;n>wv;)n&vv&&(i=e.mul(i,r)),r=e.sqr(r),n>>=vv;return i}(d,e,t),div:(t,n)=>Dv(t*Uv(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Uv(t,e),sqrt:o||(t=>(u||(u=Pv(e)),u(d,t))),toBytes:e=>n?dv(e,l):uv(e,l),fromBytes:(t,i=!0)=>{if(s){if(!s.includes(t.length)||t.length>l)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+t.length);const e=new Uint8Array(l);e.set(t,n?0:e.length-t.length),t=e}if(t.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+t.length);let r=n?lv(t):cv(t);if(a&&(r=Dv(r,e)),!i&&!d.isValid(r))throw new Error("invalid field element: outside of range 0..ORDER");return r},invertBatch:e=>Rv(d,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(d)}function Kv(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Hv(e){const t=Kv(e);return t+Math.ceil(t/2)}
13
13
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
14
14
  const Vv=BigInt(0),jv=BigInt(1);function Zv(e,t){const n=t.negate();return e?n:t}function Xv(e,t){const n=Rv(e.Fp,t.map(e=>e.Z));return t.map((t,i)=>e.fromAffine(t.toAffine(n[i])))}function Gv(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Wv(e,t){Gv(e,t);const n=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:gv(e),maxNumber:n,shiftBy:BigInt(e)}}function Jv(e,t,n){const{windowSize:i,mask:r,maxNumber:o,shiftBy:s}=n;let a=Number(e&r),c=e>>s;a>i&&(a-=o,c+=jv);const l=t*i;return{nextN:c,offset:l+Math.abs(a)-1,isZero:0===a,isNeg:a<0,isNegF:t%2!=0,offsetF:l}}const _v=new WeakMap,$v=new WeakMap;function ek(e){return $v.get(e)||1}function tk(e){if(e!==Vv)throw new Error("invalid wNAF")}class nk{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,n=this.ZERO){let i=e;for(;t>Vv;)t&jv&&(n=n.add(i)),i=i.double(),t>>=jv;return n}precomputeWindow(e,t){const{windows:n,windowSize:i}=Wv(t,this.bits),r=[];let o=e,s=o;for(let a=0;a<n;a++){s=o,r.push(s);for(let e=1;e<i;e++)s=s.add(o),r.push(s);o=s.double()}return r}wNAF(e,t,n){if(!this.Fn.isValid(n))throw new Error("invalid scalar");let i=this.ZERO,r=this.BASE;const o=Wv(e,this.bits);for(let s=0;s<o.windows;s++){const{nextN:e,offset:a,isZero:c,isNeg:l,isNegF:u,offsetF:d}=Jv(n,s,o);n=e,c?r=r.add(Zv(u,t[d])):i=i.add(Zv(l,t[a]))}return tk(n),{p:i,f:r}}wNAFUnsafe(e,t,n,i=this.ZERO){const r=Wv(e,this.bits);for(let o=0;o<r.windows&&n!==Vv;o++){const{nextN:e,offset:s,isZero:a,isNeg:c}=Jv(n,o,r);if(n=e,!a){const e=t[s];i=i.add(c?e.negate():e)}}return tk(n),i}getPrecomputes(e,t,n){let i=_v.get(t);return i||(i=this.precomputeWindow(t,e),1!==e&&("function"==typeof n&&(i=n(i)),_v.set(t,i))),i}cached(e,t,n){const i=ek(e);return this.wNAF(i,this.getPrecomputes(i,e,n),t)}unsafe(e,t,n,i){const r=ek(e);return 1===r?this._unsafeLadder(e,t,i):this.wNAFUnsafe(r,this.getPrecomputes(r,e,n),t,i)}createCache(e,t){Gv(t,this.bits),$v.set(e,t),_v.delete(e)}hasCache(e){return 1!==ek(e)}}function ik(e,t,n,i){!function(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,n)=>{if(!(e instanceof t))throw new Error("invalid point at index "+n)})}(n,e),function(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,n)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+n)})}(i,t);const r=n.length,o=i.length;if(r!==o)throw new Error("arrays of points and scalars must have equal length");const s=e.ZERO,a=fv(BigInt(r));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const l=gv(c),u=new Array(Number(l)+1).fill(s);let d=s;for(let h=Math.floor((t.BITS-1)/c)*c;h>=0;h-=c){u.fill(s);for(let t=0;t<o;t++){const e=i[t],r=Number(e>>BigInt(h)&l);u[r]=u[r].add(n[t])}let e=s;for(let t=u.length-1,n=s;t>0;t--)n=n.add(u[t]),e=e.add(n);if(d=d.add(e),0!==h)for(let t=0;t<c;t++)d=d.double()}return d}function rk(e,t,n){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return function(e){yv(e,Ov.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"}))}(t),t}return Yv(e,{isLE:n})}function ok(e,t,n={},i){if(void 0===i&&(i="edwards"===e),!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const a of["p","n","h"]){const e=t[a];if(!("bigint"==typeof e&&e>Vv))throw new Error(`CURVE.${a} must be positive bigint`)}const r=rk(t.p,n.Fp,i),o=rk(t.n,n.Fn,i),s=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const a of s)if(!r.isValid(t[a]))throw new Error(`CURVE.${a} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:r,Fn:o}}