@simplepay-ai/widget
Version:
SimplePay Payment Widget
8 lines • 5.67 MB
JavaScript
!function(yg){"function"==typeof define&&define.amd?define(yg):yg()}((function(){"use strict";var __defProp2=Object.defineProperty,__typeError=yg=>{throw TypeError(yg)},__defNormalProp2=(yg,vg,xg)=>vg in yg?__defProp2(yg,vg,{enumerable:!0,configurable:!0,writable:!0,value:xg}):yg[vg]=xg,__publicField=(yg,vg,xg)=>__defNormalProp2(yg,"symbol"!=typeof vg?vg+"":vg,xg),__accessCheck=(yg,vg,xg)=>vg.has(yg)||__typeError("Cannot "+xg),__privateGet=(yg,vg,xg)=>(__accessCheck(yg,vg,"read from private field"),xg?xg.call(yg):vg.get(yg)),__privateAdd=(yg,vg,xg)=>vg.has(yg)?__typeError("Cannot add the same private member more than once"):vg instanceof WeakSet?vg.add(yg):vg.set(yg,xg),__privateSet=(yg,vg,xg,Eg)=>(__accessCheck(yg,vg,"write to private field"),Eg?Eg.call(yg,xg):vg.set(yg,xg),xg),__privateMethod=(yg,vg,xg)=>(__accessCheck(yg,vg,"access private method"),xg),__privateWrapper=(yg,vg,xg,Eg)=>({set _(Eg){__privateSet(yg,vg,Eg,xg)},get _(){return __privateGet(yg,vg,Eg)}}),_names,_data,_dataLength,_Writer_instances,writeData_fn,_data2,_offset,_bytesRead,_parent,_maxInflation,_Reader_instances,incrementBytesRead_fn,peekBytes_fn,_r2,_s2,_v2,_networkV,_privateKey,_options,_type,_to,_data3,_nonce,_gasLimit,_gasPrice,_maxPriorityFeePerGas,_maxFeePerGas,_value,_chainId,_sig,_accessList,_maxFeePerBlobGas,_blobVersionedHashes,_kzg,_blobs,_Transaction_instances,getSerialized_fn,_a2,_types,_fullTypes,_encoderCache,_TypedDataEncoder_instances,getEncoder_fn,_b,_offset2,_tokens,_TokenString_instances,subTokenString_fn,_c2,_ParamType_instances,walkAsync_fn,_d2,_AbiCoder_instances,getCoder_fn,_VoidSigner_instances,throwUnsupported_fn,_signingKey,_data4,_checksum,_words,_WordlistOwl_instances,loadWords_fn,_HDNodeWallet_instances,account_fn,_HDNodeWallet_static,fromSeed_fn,_offset3,_tokens2,_TokenString_instances2,subTokenString_fn2,_ParamType_instances2,walkAsync_fn2,_errors,_events,_functions,_abiCoder,_Interface_instances,getFunction_fn,getEvent_fn,_e2,_types2,_fullTypes2,_encoderCache2,_TypedDataEncoder_instances2,getEncoder_fn2,statusCodeToReasonPhrase={202:"Accepted",502:"Bad Gateway",400:"Bad Request",409:"Conflict",100:"Continue",201:"Created",417:"Expectation Failed",424:"Failed Dependency",403:"Forbidden",504:"Gateway Timeout",410:"Gone",505:"HTTP Version Not Supported",418:"I'm a teapot",419:"Insufficient Space on Resource",507:"Insufficient Storage",500:"Internal Server Error",411:"Length Required",423:"Locked",420:"Method Failure",405:"Method Not Allowed",301:"Moved Permanently",302:"Moved Temporarily",207:"Multi-Status",300:"Multiple Choices",511:"Network Authentication Required",204:"No Content",203:"Non Authoritative Information",406:"Not Acceptable",404:"Not Found",501:"Not Implemented",304:"Not Modified",200:"OK",206:"Partial Content",402:"Payment Required",308:"Permanent Redirect",412:"Precondition Failed",428:"Precondition Required",102:"Processing",103:"Early Hints",426:"Upgrade Required",407:"Proxy Authentication Required",431:"Request Header Fields Too Large",408:"Request Timeout",413:"Request Entity Too Large",414:"Request-URI Too Long",416:"Requested Range Not Satisfiable",205:"Reset Content",303:"See Other",503:"Service Unavailable",101:"Switching Protocols",307:"Temporary Redirect",429:"Too Many Requests",401:"Unauthorized",451:"Unavailable For Legal Reasons",422:"Unprocessable Entity",415:"Unsupported Media Type",305:"Use Proxy",421:"Misdirected Request"},StatusCodes,StatusCodes2,AppEnvironment,AppEnvironment2,InvoiceEventType,InvoiceEventType2,InvoiceStatus,InvoiceStatus2,PATScope,PATScope2,TransactionEventType,TransactionEventType2,TransactionStatus,TransactionStatus2,UserAddressType,UserAddressType2,WebhookEventType,WebhookEventType2,UserInvoiceListOrderBy,UserInvoiceListOrderBy2;function getReasonPhrase(yg){var vg=statusCodeToReasonPhrase[yg.toString()];if(!vg)throw new Error("Status code does not exist: "+yg);return vg}StatusCodes2=StatusCodes||(StatusCodes={}),StatusCodes2[StatusCodes2.CONTINUE=100]="CONTINUE",StatusCodes2[StatusCodes2.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",StatusCodes2[StatusCodes2.PROCESSING=102]="PROCESSING",StatusCodes2[StatusCodes2.EARLY_HINTS=103]="EARLY_HINTS",StatusCodes2[StatusCodes2.OK=200]="OK",StatusCodes2[StatusCodes2.CREATED=201]="CREATED",StatusCodes2[StatusCodes2.ACCEPTED=202]="ACCEPTED",StatusCodes2[StatusCodes2.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",StatusCodes2[StatusCodes2.NO_CONTENT=204]="NO_CONTENT",StatusCodes2[StatusCodes2.RESET_CONTENT=205]="RESET_CONTENT",StatusCodes2[StatusCodes2.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",StatusCodes2[StatusCodes2.MULTI_STATUS=207]="MULTI_STATUS",StatusCodes2[StatusCodes2.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",StatusCodes2[StatusCodes2.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",StatusCodes2[StatusCodes2.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",StatusCodes2[StatusCodes2.SEE_OTHER=303]="SEE_OTHER",StatusCodes2[StatusCodes2.NOT_MODIFIED=304]="NOT_MODIFIED",StatusCodes2[StatusCodes2.USE_PROXY=305]="USE_PROXY",StatusCodes2[StatusCodes2.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",StatusCodes2[StatusCodes2.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",StatusCodes2[StatusCodes2.BAD_REQUEST=400]="BAD_REQUEST",StatusCodes2[StatusCodes2.UNAUTHORIZED=401]="UNAUTHORIZED",StatusCodes2[StatusCodes2.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",StatusCodes2[StatusCodes2.FORBIDDEN=403]="FORBIDDEN",StatusCodes2[StatusCodes2.NOT_FOUND=404]="NOT_FOUND",StatusCodes2[StatusCodes2.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",StatusCodes2[StatusCodes2.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",StatusCodes2[StatusCodes2.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",StatusCodes2[StatusCodes2.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",StatusCodes2[StatusCodes2.CONFLICT=409]="CONFLICT",StatusCodes2[StatusCodes2.GONE=410]="GONE",StatusCodes2[StatusCodes2.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",StatusCodes2[StatusCodes2.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",StatusCodes2[StatusCodes2.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",StatusCodes2[StatusCodes2.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",StatusCodes2[StatusCodes2.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",StatusCodes2[StatusCodes2.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",StatusCodes2[StatusCodes2.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",StatusCodes2[StatusCodes2.IM_A_TEAPOT=418]="IM_A_TEAPOT",StatusCodes2[StatusCodes2.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",StatusCodes2[StatusCodes2.METHOD_FAILURE=420]="METHOD_FAILURE",StatusCodes2[StatusCodes2.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",StatusCodes2[StatusCodes2.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",StatusCodes2[StatusCodes2.LOCKED=423]="LOCKED",StatusCodes2[StatusCodes2.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",StatusCodes2[StatusCodes2.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",StatusCodes2[StatusCodes2.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",StatusCodes2[StatusCodes2.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",StatusCodes2[StatusCodes2.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",StatusCodes2[StatusCodes2.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",StatusCodes2[StatusCodes2.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",StatusCodes2[StatusCodes2.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",StatusCodes2[StatusCodes2.BAD_GATEWAY=502]="BAD_GATEWAY",StatusCodes2[StatusCodes2.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",StatusCodes2[StatusCodes2.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",StatusCodes2[StatusCodes2.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",StatusCodes2[StatusCodes2.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",StatusCodes2[StatusCodes2.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED";class HttpError extends Error{constructor(yg){super(getReasonPhrase(yg)),__publicField(this,"code"),this.code=yg,this.name=this.constructor.name}}class ValidationError extends Error{constructor(yg){super("Validation error"),__publicField(this,"errors"),this.errors=yg,this.name=this.constructor.name}}AppEnvironment2=AppEnvironment||(AppEnvironment={}),AppEnvironment2.Development="development",AppEnvironment2.Production="production",InvoiceEventType2=InvoiceEventType||(InvoiceEventType={}),InvoiceEventType2.Created="created",InvoiceEventType2.Success="success",InvoiceEventType2.Canceled="canceled",InvoiceStatus2=InvoiceStatus||(InvoiceStatus={}),InvoiceStatus2.Active="active",InvoiceStatus2.Closed="closed",InvoiceStatus2.Success="success",InvoiceStatus2.Canceled="canceled",PATScope2=PATScope||(PATScope={}),PATScope2.AppRead="app:read",PATScope2.AppWrite="app:write",PATScope2.AppAddressRead="app.address:read",PATScope2.AppAddressWrite="app.address:write",PATScope2.AppCryptocurrencyWrite="app.cryptocurrency:write",PATScope2.InvoiceRead="invoice:read",PATScope2.ProductWrite="product:write",PATScope2.UserBillingRead="user.billing:read",PATScope2.UserInvoiceRead="user.invoice:read",PATScope2.UserPATRead="user.pat:read",PATScope2.UserPATWrite="user.pat:write",TransactionEventType2=TransactionEventType||(TransactionEventType={}),TransactionEventType2.Created="created",TransactionEventType2.Processing="processing",TransactionEventType2.Confirming="confirming",TransactionEventType2.Success="success",TransactionEventType2.Rejected="rejected",TransactionEventType2.Canceled="canceled",TransactionEventType2.Expired="expired",TransactionStatus2=TransactionStatus||(TransactionStatus={}),TransactionStatus2.Created="created",TransactionStatus2.Processing="processing",TransactionStatus2.Confirming="confirming",TransactionStatus2.Success="success",TransactionStatus2.Rejected="rejected",TransactionStatus2.Canceled="canceled",TransactionStatus2.Expired="expired",UserAddressType2=UserAddressType||(UserAddressType={}),UserAddressType2.BTC="BTC",UserAddressType2.EVM="EVM",UserAddressType2.LTC="LTC",UserAddressType2.TRX="TRX",WebhookEventType2=WebhookEventType||(WebhookEventType={}),WebhookEventType2.InvoiceCreated="invoice.created",WebhookEventType2.InvoiceSuccess="invoice.success",WebhookEventType2.InvoiceCanceled="invoice.canceled",WebhookEventType2.TransactionCreated="transaction.created",WebhookEventType2.TransactionProcessing="transaction.processing",WebhookEventType2.TransactionConfirming="transaction.confirming",WebhookEventType2.TransactionSuccess="transaction.success",WebhookEventType2.TransactionRejected="transaction.rejected",WebhookEventType2.TransactionCanceled="transaction.canceled",WebhookEventType2.TransactionExpired="transaction.expired",UserInvoiceListOrderBy2=UserInvoiceListOrderBy||(UserInvoiceListOrderBy={}),UserInvoiceListOrderBy2.Status="status",UserInvoiceListOrderBy2.CreatedAt="created_at";const isObject$j=yg=>"object"==typeof yg&&null!==yg,isObjectCustom$1=yg=>isObject$j(yg)&&!(yg instanceof RegExp)&&!(yg instanceof Error)&&!(yg instanceof Date),mapObjectSkip$1=Symbol("mapObjectSkip"),_mapObject=(yg,vg,xg,Eg=new WeakMap)=>{if(xg={deep:!1,target:{},...xg},Eg.has(yg))return Eg.get(yg);Eg.set(yg,xg.target);const{target:Ig}=xg;delete xg.target;const mapArray=yg=>yg.map((yg=>isObjectCustom$1(yg)?_mapObject(yg,vg,xg,Eg):yg));if(Array.isArray(yg))return mapArray(yg);for(const[Bg,Ng]of Object.entries(yg)){const Wg=vg(Bg,Ng,yg);if(Wg===mapObjectSkip$1)continue;let[Dg,Fg,{shouldRecurse:zg=!0}={}]=Wg;"__proto__"!==Dg&&(xg.deep&&zg&&isObjectCustom$1(Fg)&&(Fg=Array.isArray(Fg)?mapArray(Fg):_mapObject(Fg,vg,xg,Eg)),Ig[Dg]=Fg)}return Ig};function mapObject$2(yg,vg,xg){if(!isObject$j(yg))throw new TypeError(`Expected an object, got \`${yg}\` (${typeof yg})`);return _mapObject(yg,vg,xg)}const UPPERCASE=/[\p{Lu}]/u,LOWERCASE=/[\p{Ll}]/u,LEADING_CAPITAL=/^[\p{Lu}](?![\p{Lu}])/gu,IDENTIFIER=/([\p{Alpha}\p{N}_]|$)/u,SEPARATORS=/[_.\- ]+/,LEADING_SEPARATORS=new RegExp("^"+SEPARATORS.source),SEPARATORS_AND_IDENTIFIER=new RegExp(SEPARATORS.source+IDENTIFIER.source,"gu"),NUMBERS_AND_IDENTIFIER=new RegExp("\\d+"+IDENTIFIER.source,"gu"),preserveCamelCase=(yg,vg,xg,Eg)=>{let Ig=!1,Bg=!1,Ng=!1,Wg=!1;for(let Dg=0;Dg<yg.length;Dg++){const Fg=yg[Dg];Wg=!(Dg>2)||"-"===yg[Dg-3],Ig&&UPPERCASE.test(Fg)?(yg=yg.slice(0,Dg)+"-"+yg.slice(Dg),Ig=!1,Ng=Bg,Bg=!0,Dg++):Bg&&Ng&&LOWERCASE.test(Fg)&&(!Wg||Eg)?(yg=yg.slice(0,Dg-1)+"-"+yg.slice(Dg-1),Ng=Bg,Bg=!1,Ig=!0):(Ig=vg(Fg)===Fg&&xg(Fg)!==Fg,Ng=Bg,Bg=xg(Fg)===Fg&&vg(Fg)!==Fg)}return yg},preserveConsecutiveUppercase=(yg,vg)=>(LEADING_CAPITAL.lastIndex=0,yg.replaceAll(LEADING_CAPITAL,(yg=>vg(yg)))),postProcess=(yg,vg)=>(SEPARATORS_AND_IDENTIFIER.lastIndex=0,NUMBERS_AND_IDENTIFIER.lastIndex=0,yg.replaceAll(NUMBERS_AND_IDENTIFIER,((xg,Eg,Ig)=>["_","-"].includes(yg.charAt(Ig+xg.length))?xg:vg(xg))).replaceAll(SEPARATORS_AND_IDENTIFIER,((yg,xg)=>vg(xg))));function camelCase$2(yg,vg){if("string"!=typeof yg&&!Array.isArray(yg))throw new TypeError("Expected the input to be `string | string[]`");if(vg={pascalCase:!1,preserveConsecutiveUppercase:!1,...vg},0===(yg=Array.isArray(yg)?yg.map((yg=>yg.trim())).filter((yg=>yg.length)).join("-"):yg.trim()).length)return"";const xg=!1===vg.locale?yg=>yg.toLowerCase():yg=>yg.toLocaleLowerCase(vg.locale),Eg=!1===vg.locale?yg=>yg.toUpperCase():yg=>yg.toLocaleUpperCase(vg.locale);if(1===yg.length)return SEPARATORS.test(yg)?"":vg.pascalCase?Eg(yg):xg(yg);return yg!==xg(yg)&&(yg=preserveCamelCase(yg,xg,Eg,vg.preserveConsecutiveUppercase)),yg=yg.replace(LEADING_SEPARATORS,""),yg=vg.preserveConsecutiveUppercase?preserveConsecutiveUppercase(yg,xg):xg(yg),vg.pascalCase&&(yg=Eg(yg.charAt(0))+yg.slice(1)),postProcess(yg,Eg)}class QuickLRU extends Map{constructor(yg={}){if(super(),!(yg.maxSize&&yg.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if("number"==typeof yg.maxAge&&0===yg.maxAge)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=yg.maxSize,this.maxAge=yg.maxAge||Number.POSITIVE_INFINITY,this.onEviction=yg.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(yg){if("function"==typeof this.onEviction)for(const[vg,xg]of yg)this.onEviction(vg,xg.value)}_deleteIfExpired(yg,vg){return"number"==typeof vg.expiry&&vg.expiry<=Date.now()&&("function"==typeof this.onEviction&&this.onEviction(yg,vg.value),this.delete(yg))}_getOrDeleteIfExpired(yg,vg){if(!1===this._deleteIfExpired(yg,vg))return vg.value}_getItemValue(yg,vg){return vg.expiry?this._getOrDeleteIfExpired(yg,vg):vg.value}_peek(yg,vg){const xg=vg.get(yg);return this._getItemValue(yg,xg)}_set(yg,vg){this.cache.set(yg,vg),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(yg,vg){this.oldCache.delete(yg),this._set(yg,vg)}*_entriesAscending(){for(const yg of this.oldCache){const[vg,xg]=yg;if(!this.cache.has(vg)){!1===this._deleteIfExpired(vg,xg)&&(yield yg)}}for(const yg of this.cache){const[vg,xg]=yg;!1===this._deleteIfExpired(vg,xg)&&(yield yg)}}get(yg){if(this.cache.has(yg)){const vg=this.cache.get(yg);return this._getItemValue(yg,vg)}if(this.oldCache.has(yg)){const vg=this.oldCache.get(yg);if(!1===this._deleteIfExpired(yg,vg))return this._moveToRecent(yg,vg),vg.value}}set(yg,vg,{maxAge:xg=this.maxAge}={}){const Eg="number"==typeof xg&&xg!==Number.POSITIVE_INFINITY?Date.now()+xg:void 0;return this.cache.has(yg)?this.cache.set(yg,{value:vg,expiry:Eg}):this._set(yg,{value:vg,expiry:Eg}),this}has(yg){return this.cache.has(yg)?!this._deleteIfExpired(yg,this.cache.get(yg)):!!this.oldCache.has(yg)&&!this._deleteIfExpired(yg,this.oldCache.get(yg))}peek(yg){return this.cache.has(yg)?this._peek(yg,this.cache):this.oldCache.has(yg)?this._peek(yg,this.oldCache):void 0}delete(yg){const vg=this.cache.delete(yg);return vg&&this._size--,this.oldCache.delete(yg)||vg}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(yg){if(!(yg&&yg>0))throw new TypeError("`maxSize` must be a number greater than 0");const vg=[...this._entriesAscending()],xg=vg.length-yg;xg<0?(this.cache=new Map(vg),this.oldCache=new Map,this._size=vg.length):(xg>0&&this._emitEvictions(vg.slice(0,xg)),this.oldCache=new Map(vg.slice(xg)),this.cache=new Map,this._size=0),this.maxSize=yg}*keys(){for(const[yg]of this)yield yg}*values(){for(const[,yg]of this)yield yg}*[Symbol.iterator](){for(const yg of this.cache){const[vg,xg]=yg;!1===this._deleteIfExpired(vg,xg)&&(yield[vg,xg.value])}for(const yg of this.oldCache){const[vg,xg]=yg;if(!this.cache.has(vg)){!1===this._deleteIfExpired(vg,xg)&&(yield[vg,xg.value])}}}*entriesDescending(){let yg=[...this.cache];for(let vg=yg.length-1;vg>=0;--vg){const xg=yg[vg],[Eg,Ig]=xg;!1===this._deleteIfExpired(Eg,Ig)&&(yield[Eg,Ig.value])}yg=[...this.oldCache];for(let vg=yg.length-1;vg>=0;--vg){const xg=yg[vg],[Eg,Ig]=xg;if(!this.cache.has(Eg)){!1===this._deleteIfExpired(Eg,Ig)&&(yield[Eg,Ig.value])}}}*entriesAscending(){for(const[yg,vg]of this._entriesAscending())yield[yg,vg.value]}get size(){if(!this._size)return this.oldCache.size;let yg=0;for(const vg of this.oldCache.keys())this.cache.has(vg)||yg++;return Math.min(this._size+yg,this.maxSize)}entries(){return this.entriesAscending()}forEach(yg,vg=this){for(const[xg,Eg]of this.entriesAscending())yg.call(vg,Eg,xg,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}}const has$3=(yg,vg)=>yg.some((yg=>"string"==typeof yg?yg===vg:(yg.lastIndex=0,yg.test(vg)))),cache$3=new QuickLRU({maxSize:1e5}),isObject$i=yg=>!("object"!=typeof yg||null===yg||yg instanceof RegExp||yg instanceof Error||yg instanceof Date),transform$1=(yg,vg={})=>{if(!isObject$i(yg))return yg;const{exclude:xg,pascalCase:Eg=!1,stopPaths:Ig,deep:Bg=!1,preserveConsecutiveUppercase:Ng=!1}=vg,Wg=new Set(Ig),makeMapper=yg=>(vg,Ig)=>{if(Bg&&isObject$i(Ig)){const xg=void 0===yg?vg:`${yg}.${vg}`;Wg.has(xg)||(Ig=mapObject$2(Ig,makeMapper(xg)))}if(!xg||!has$3(xg,vg)){const yg=Eg?`${vg}_`:vg;if(cache$3.has(yg))vg=cache$3.get(yg);else{const xg=camelCase$2(vg,{pascalCase:Eg,locale:!1,preserveConsecutiveUppercase:Ng});vg.length<100&&cache$3.set(yg,xg),vg=xg}}return[vg,Ig]};return mapObject$2(yg,makeMapper(void 0))};function camelcaseKeys(yg,vg){return Array.isArray(yg)?Object.keys(yg).map((xg=>transform$1(yg[xg],vg))):transform$1(yg,vg)}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs$1(yg){return yg&&yg.__esModule&&Object.prototype.hasOwnProperty.call(yg,"default")?yg.default:yg}function getAugmentedNamespace(yg){if(yg.__esModule)return yg;var vg=yg.default;if("function"==typeof vg){var xg=function a3(){return this instanceof a3?Reflect.construct(vg,arguments,this.constructor):vg.apply(this,arguments)};xg.prototype=vg.prototype}else xg={};return Object.defineProperty(xg,"__esModule",{value:!0}),Object.keys(yg).forEach((function(vg){var Eg=Object.getOwnPropertyDescriptor(yg,vg);Object.defineProperty(xg,vg,Eg.get?Eg:{enumerable:!0,get:function(){return yg[vg]}})})),xg}var mapObj={exports:{}};const isObject$h=yg=>"object"==typeof yg&&null!==yg,mapObjectSkip=Symbol("skip"),isObjectCustom=yg=>isObject$h(yg)&&!(yg instanceof RegExp)&&!(yg instanceof Error)&&!(yg instanceof Date),mapObject=(yg,vg,xg,Eg=new WeakMap)=>{if(xg={deep:!1,target:{},...xg},Eg.has(yg))return Eg.get(yg);Eg.set(yg,xg.target);const{target:Ig}=xg;delete xg.target;const mapArray=yg=>yg.map((yg=>isObjectCustom(yg)?mapObject(yg,vg,xg,Eg):yg));if(Array.isArray(yg))return mapArray(yg);for(const[Bg,Ng]of Object.entries(yg)){const Wg=vg(Bg,Ng,yg);if(Wg===mapObjectSkip)continue;let[Dg,Fg,{shouldRecurse:zg=!0}={}]=Wg;"__proto__"!==Dg&&(xg.deep&&zg&&isObjectCustom(Fg)&&(Fg=Array.isArray(Fg)?mapArray(Fg):mapObject(Fg,vg,xg,Eg)),Ig[Dg]=Fg)}return Ig};mapObj.exports=(yg,vg,xg)=>{if(!isObject$h(yg))throw new TypeError(`Expected an object, got \`${yg}\` (${typeof yg})`);return mapObject(yg,vg,xg)},mapObj.exports.mapObjectSkip=mapObjectSkip;var mapObjExports=mapObj.exports;const mapObject$1=getDefaultExportFromCjs$1(mapObjExports),handlePreserveConsecutiveUppercase=(yg,vg)=>(yg=yg.replace(new RegExp("((?<![\\p{Uppercase_Letter}\\d])[\\p{Uppercase_Letter}\\d](?![\\p{Uppercase_Letter}\\d]))","gu"),(yg=>yg.toLowerCase()))).replace(new RegExp("(\\p{Uppercase_Letter}+)(\\p{Uppercase_Letter}\\p{Lowercase_Letter}+)","gu"),((yg,xg,Eg)=>xg+vg+Eg.toLowerCase()));function decamelize(yg,{separator:vg="_",preserveConsecutiveUppercase:xg=!1}={}){if("string"!=typeof yg||"string"!=typeof vg)throw new TypeError("The `text` and `separator` arguments should be of type `string`");if(yg.length<2)return xg?yg:yg.toLowerCase();const Eg=`$1${vg}$2`,Ig=yg.replace(new RegExp("([\\p{Lowercase_Letter}\\d])(\\p{Uppercase_Letter})","gu"),Eg);return xg?handlePreserveConsecutiveUppercase(Ig,vg):Ig.replace(new RegExp("(\\p{Uppercase_Letter})(\\p{Uppercase_Letter}\\p{Lowercase_Letter}+)","gu"),Eg).toLowerCase()}const has$2=(yg,vg)=>yg.some((yg=>"string"==typeof yg?yg===vg:(yg.lastIndex=0,yg.test(vg)))),cache$2=new QuickLRU({maxSize:1e5}),isObject$g=yg=>!("object"!=typeof yg||null===yg||yg instanceof RegExp||yg instanceof Error||yg instanceof Date),transform=(yg,vg={})=>{if(!isObject$g(yg))return yg;const{separator:xg="_",exclude:Eg,deep:Ig=!1}=vg,makeMapper=yg=>(yg,vg)=>{if(Ig&&isObject$g(vg)&&(vg=mapObject$1(vg,makeMapper())),!Eg||!has$2(Eg,yg)){const vg=`${xg}${yg}`;if(cache$2.has(vg))yg=cache$2.get(vg);else{const Eg=decamelize(yg,{separator:xg});yg.length<100&&cache$2.set(vg,Eg),yg=Eg}}return[yg,vg]};return mapObject$1(yg,makeMapper())};function decamelizeKeys(yg,vg){return Array.isArray(yg)?Object.keys(yg).map((xg=>transform(yg[xg],vg))):transform(yg,vg)}class BaseService{constructor(yg,vg,xg,Eg=null){__publicField(this,"state"),__publicField(this,"fetch"),__publicField(this,"apiBase"),__publicField(this,"apiKey"),__publicField(this,"CSRF_TOKEN_HEADER","X-Csrf-Token"),this.state=yg,this.fetch=vg,this.apiBase=xg,this.apiKey=Eg}async request(yg,vg=null,xg=null){const Eg={};null!=this.state.csrfToken&&(Eg[this.CSRF_TOKEN_HEADER]=this.state.csrfToken);let Ig=null;null!==xg&&(Ig=JSON.stringify(xg),Eg["Content-Type"]="application/json"),null!==this.apiKey&&(Eg.Authorization=`Bearer ${this.apiKey}`);let Bg=this.fetch;"undefined"!=typeof window&&(Bg=this.fetch.bind(window));const Ng=await Bg(`${this.apiBase}${vg||""}`,{credentials:"include",method:yg,headers:Eg,body:Ig});return Ng.headers.has(this.CSRF_TOKEN_HEADER)&&(this.state.csrfToken=Ng.headers.get(this.CSRF_TOKEN_HEADER)),Ng}toSnakeCase(yg){return decamelizeKeys(yg,{deep:!0})}toCamelCase(yg){return camelcaseKeys(yg,{deep:!0})}}class AppService extends BaseService{constructor(yg,vg,xg){super(yg,vg,xg),__publicField(this,"state"),__publicField(this,"fetch"),__publicField(this,"apiBase"),__publicField(this,"cryptocurrency"),this.state=yg,this.fetch=vg,this.apiBase=xg,this.cryptocurrency=new AppCryptocurrencyService(yg,vg,this.apiBase)}async list(){const yg=await this.request("GET","?v=1");if(!yg.ok)throw new HttpError(yg.status);const vg=await yg.json();return this.toCamelCase(vg)}async create(yg){const vg=await this.request("POST","?v=1",this.toSnakeCase(yg));if(!vg.ok&&vg.status!==StatusCodes.BAD_REQUEST)throw new HttpError(vg.status);const xg=this.toCamelCase(await vg.json());if(vg.status===StatusCodes.BAD_REQUEST)throw new ValidationError(xg);return xg}async get(yg){const vg=await this.request("GET",`/${yg}?v=1`);if(!vg.ok)throw new HttpError(vg.status);const xg=await vg.json();return this.toCamelCase(xg)}async update(yg,vg){const xg=await this.request("PUT",`/${yg}?v=1`,this.toSnakeCase(vg));if(!xg.ok&&xg.status!==StatusCodes.BAD_REQUEST)throw new HttpError(xg.status);const Eg=this.toCamelCase(await xg.json());if(xg.status===StatusCodes.BAD_REQUEST)throw new ValidationError(Eg);return Eg}async delete(yg){const vg=await this.request("DELETE",`/${yg}?v=1`);if(!vg.ok)throw new HttpError(vg.status);return!0}}class AppCryptocurrencyService extends BaseService{async update(yg,vg){const xg=await this.request("PUT",`/${yg}/cryptocurrency?v=1`,this.toSnakeCase(vg));if(!xg.ok)throw new HttpError(xg.status);const Eg=await xg.json();return this.toCamelCase(Eg)}}class CurrencyService extends BaseService{async list(){const yg=await this.request("GET","?v=1");if(!yg.ok)throw new HttpError(yg.status);const vg=await yg.json();return this.toCamelCase(vg)}}class CryptocurrencyService extends BaseService{async list(yg={}){const vg=new URLSearchParams;for(const[Ig,Bg]of Object.entries(this.toSnakeCase(yg)))vg.append(Ig,Bg.toString());const xg=await this.request("GET",`?v=1&${vg.toString()}`);if(!xg.ok&&xg.status!==StatusCodes.BAD_REQUEST)throw new HttpError(xg.status);const Eg=this.toCamelCase(await xg.json());if(xg.status===StatusCodes.BAD_REQUEST)throw new ValidationError(Eg);return Eg}}class InvoiceService extends BaseService{async create(yg){const vg=await this.request("POST","?v=2",this.toSnakeCase(yg));if(!vg.ok&&vg.status!==StatusCodes.BAD_REQUEST)throw new HttpError(vg.status);const xg=this.toCamelCase(await vg.json());if(vg.status===StatusCodes.BAD_REQUEST)throw new ValidationError(xg);return xg}async get(yg,vg=!1){const xg=await this.request("GET",`/${yg}?v=2&app=${vg}`);if(!xg.ok)throw new HttpError(xg.status);const Eg=await xg.json();return this.toCamelCase(Eg)}async cancel(yg){const vg=await this.request("DELETE",`/${yg}?v=2`);if(!vg.ok)throw new HttpError(vg.status);const xg=await vg.json();return this.toCamelCase(xg)}async list(yg={}){const vg=new URLSearchParams;for(const[Ig,Bg]of Object.entries(this.toSnakeCase(yg)))vg.append(Ig,Bg.toString());const xg=await this.request("GET",`?v=2&${vg.toString()}`);if(!xg.ok&&xg.status!==StatusCodes.BAD_REQUEST)throw new HttpError(xg.status);const Eg=this.toCamelCase(await xg.json());if(xg.status===StatusCodes.BAD_REQUEST)throw new ValidationError(Eg);return Eg}}class ProductService extends BaseService{async list(yg){const vg=await this.request("GET",`?v=1&app_id=${yg}`);if(!vg.ok)throw new HttpError(vg.status);const xg=await vg.json();return this.toCamelCase(xg)}async get(yg){const vg=await this.request("GET",`/${yg}?v=1`);if(!vg.ok)throw new HttpError(vg.status);const xg=await vg.json();return this.toCamelCase(xg)}}class TransactionService extends BaseService{async create(yg){const vg=await this.request("POST","?v=1",this.toSnakeCase(yg));if(!vg.ok&&vg.status!==StatusCodes.BAD_REQUEST)throw new HttpError(vg.status);const xg=this.toCamelCase(await vg.json());if(vg.status===StatusCodes.BAD_REQUEST)throw new ValidationError(xg);return xg}async get(yg){const vg=await this.request("GET",`/${yg}?v=1`);if(!vg.ok)throw new HttpError(vg.status);const xg=await vg.json();return this.toCamelCase(xg)}async cancel(yg){const vg=await this.request("DELETE",`/${yg}?v=1`);if(!vg.ok)throw new HttpError(vg.status);const xg=await vg.json();return this.toCamelCase(xg)}async list(yg){const vg=new URLSearchParams;for(const[Ig,Bg]of Object.entries(this.toSnakeCase(yg)))vg.append(Ig,Bg.toString());const xg=await this.request("GET",`?v=1&${vg.toString()}`);if(!xg.ok)throw new HttpError(xg.status);const Eg=await xg.json();if(xg.status===StatusCodes.BAD_REQUEST)throw new ValidationError(Eg);return this.toCamelCase(Eg)}}class UserService extends BaseService{constructor(yg,vg,xg){super(yg,vg,xg),__publicField(this,"state"),__publicField(this,"fetch"),__publicField(this,"apiBase"),__publicField(this,"address"),__publicField(this,"billing"),__publicField(this,"invoice"),__publicField(this,"pat"),__publicField(this,"profile"),this.state=yg,this.fetch=vg,this.apiBase=xg,this.address=new UserAddressService(yg,vg,`${this.apiBase}/address`),this.billing=new UserBillingService(yg,vg,`${this.apiBase}/billing`),this.invoice=new UserInvoiceService(yg,vg,`${this.apiBase}/invoice`),this.pat=new UserPATService(yg,vg,`${this.apiBase}/pat`),this.profile=new UserProfileService(yg,vg,`${this.apiBase}/profile`)}}class UserAddressService extends BaseService{async list(){const yg=await this.request("GET","?v=1");if(!yg.ok)throw new HttpError(yg.status);const vg=await yg.json();return this.toCamelCase(vg)}async create(yg){const vg=await this.request("POST","?v=1",this.toSnakeCase(yg));if(!vg.ok&&vg.status!==StatusCodes.BAD_REQUEST)throw new HttpError(vg.status);const xg=this.toCamelCase(await vg.json());if(vg.status===StatusCodes.BAD_REQUEST)throw new ValidationError(xg);return xg}async get(yg){const vg=await this.request("GET",`/${yg}?v=1`);if(!vg.ok)throw new HttpError(vg.status);const xg=await vg.json();return this.toCamelCase(xg)}async update(yg,vg){const xg=await this.request("PUT",`/${yg}?v=1`,this.toSnakeCase(vg));if(!xg.ok&&xg.status!==StatusCodes.BAD_REQUEST)throw new HttpError(xg.status);const Eg=this.toCamelCase(await xg.json());if(xg.status===StatusCodes.BAD_REQUEST)throw new ValidationError(Eg);return Eg}async delete(yg){const vg=await this.request("DELETE",`/${yg}?v=1`);if(!vg.ok)throw new HttpError(vg.status);return!0}}class UserProfileService extends BaseService{async get(){const yg=await this.request("GET","?v=1");if(!yg.ok)throw new HttpError(yg.status);const vg=await yg.json();return this.toCamelCase(vg)}async update(yg){const vg=await this.request("PUT","?v=1",this.toSnakeCase(yg));if(!vg.ok&&vg.status!==StatusCodes.BAD_REQUEST)throw new HttpError(vg.status);const xg=this.toCamelCase(await vg.json());if(vg.status===StatusCodes.BAD_REQUEST)throw new ValidationError(xg);return xg}}class UserBillingService extends BaseService{async list(){const yg=await this.request("GET","?v=1");if(!yg.ok)throw new HttpError(yg.status);return this.toCamelCase(await yg.json())}}class UserInvoiceService extends BaseService{async list(yg={}){const vg=new URLSearchParams;for(const[Ig,Bg]of Object.entries(this.toSnakeCase(yg)))vg.append(Ig,Bg.toString());const xg=await this.request("GET",`?v=1&${vg.toString()}`);if(!xg.ok&&xg.status!==StatusCodes.BAD_REQUEST)throw new HttpError(xg.status);const Eg=this.toCamelCase(await xg.json());if(xg.status===StatusCodes.BAD_REQUEST)throw new ValidationError(Eg);return Eg}async link(yg){const vg=await this.request("POST","?v=1",this.toSnakeCase(yg));if(!vg.ok&&vg.status!==StatusCodes.BAD_REQUEST)throw new HttpError(vg.status);const xg=this.toCamelCase(await vg.json());if(vg.status===StatusCodes.BAD_REQUEST)throw new ValidationError(xg);return xg}}class UserPATService extends BaseService{async list(){const yg=await this.request("GET","?v=1");if(!yg.ok)throw new HttpError(yg.status);const vg=await yg.json();return this.toCamelCase(vg)}async create(yg){const vg=await this.request("POST","?v=1",this.toSnakeCase(yg));if(!vg.ok&&vg.status!==StatusCodes.BAD_REQUEST)throw new HttpError(vg.status);const xg=this.toCamelCase(await vg.json());if(vg.status===StatusCodes.BAD_REQUEST)throw new ValidationError(xg);return xg}async delete(yg){const vg=await this.request("DELETE",`/${yg}?v=1`);if(!vg.ok)throw new HttpError(vg.status);return!0}}class BaseChannel{constructor(yg){__publicField(this,"channel"),this.channel=yg}toCamelCase(yg){return camelcaseKeys(yg,{deep:!0})}}class AppClientInvoiceChannel extends BaseChannel{on(yg,vg){this.channel.bind(yg,(yg=>vg(this.toCamelCase(yg))))}}class InvoiceChannel extends BaseChannel{on(yg,vg){this.channel.bind(yg,(yg=>vg(this.toCamelCase(yg))))}}class InvoiceTransactionChannel extends BaseChannel{on(yg,vg){this.channel.bind(yg,(yg=>vg(this.toCamelCase(yg))))}}class Client{constructor(yg={}){__publicField(this,"app"),__publicField(this,"currency"),__publicField(this,"cryptocurrency"),__publicField(this,"invoice"),__publicField(this,"product"),__publicField(this,"transaction"),__publicField(this,"user"),__publicField(this,"state");const vg=yg.apiBase||"https://api.simplepay.ai",xg=yg.fetch||fetch;this.state={csrfToken:null},this.app=new AppService(this.state,xg,`${vg}/app`),this.currency=new CurrencyService(this.state,xg,`${vg}/currency`),this.cryptocurrency=new CryptocurrencyService(this.state,xg,`${vg}/cryptocurrency`),this.invoice=new InvoiceService(this.state,xg,`${vg}/invoice`,yg.apiKey),this.product=new ProductService(this.state,xg,`${vg}/product`),this.transaction=new TransactionService(this.state,xg,`${vg}/transaction`),this.user=new UserService(this.state,xg,`${vg}/user`)}}var pusher={exports:{}},module;
/*!
* Pusher JavaScript Library v8.4.0
* https://pusher.com/
*
* Copyright 2020, Pusher
* Released under the MIT licence.
*/module=pusher,function webpackUniversalModuleDefinition(yg,vg){module.exports=vg()}(window,(function(){return function(yg){var vg={};function __webpack_require__(xg){if(vg[xg])return vg[xg].exports;var Eg=vg[xg]={i:xg,l:!1,exports:{}};return yg[xg].call(Eg.exports,Eg,Eg.exports,__webpack_require__),Eg.l=!0,Eg.exports}return __webpack_require__.m=yg,__webpack_require__.c=vg,__webpack_require__.d=function(yg,vg,xg){__webpack_require__.o(yg,vg)||Object.defineProperty(yg,vg,{enumerable:!0,get:xg})},__webpack_require__.r=function(yg){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(yg,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(yg,"__esModule",{value:!0})},__webpack_require__.t=function(yg,vg){if(1&vg&&(yg=__webpack_require__(yg)),8&vg)return yg;if(4&vg&&"object"==typeof yg&&yg&&yg.__esModule)return yg;var xg=Object.create(null);if(__webpack_require__.r(xg),Object.defineProperty(xg,"default",{enumerable:!0,value:yg}),2&vg&&"string"!=typeof yg)for(var Eg in yg)__webpack_require__.d(xg,Eg,function(vg){return yg[vg]}.bind(null,Eg));return xg},__webpack_require__.n=function(yg){var vg=yg&&yg.__esModule?function getDefault(){return yg.default}:function getModuleExports(){return yg};return __webpack_require__.d(vg,"a",vg),vg},__webpack_require__.o=function(yg,vg){return Object.prototype.hasOwnProperty.call(yg,vg)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=2)}([function(yg,vg,xg){var Eg=this&&this.__extends||function(){var extendStatics2=function(yg,vg){return(extendStatics2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(yg,vg){yg.__proto__=vg}||function(yg,vg){for(var xg in vg)vg.hasOwnProperty(xg)&&(yg[xg]=vg[xg])})(yg,vg)};return function(yg,vg){function __(){this.constructor=yg}extendStatics2(yg,vg),yg.prototype=null===vg?Object.create(vg):(__.prototype=vg.prototype,new __)}}();Object.defineProperty(vg,"__esModule",{value:!0});var Ig=256,Bg=function(){function Coder3(yg){void 0===yg&&(yg="="),this._paddingCharacter=yg}return Coder3.prototype.encodedLength=function(yg){return this._paddingCharacter?(yg+2)/3*4|0:(8*yg+5)/6|0},Coder3.prototype.encode=function(yg){for(var vg="",xg=0;xg<yg.length-2;xg+=3){var Eg=yg[xg]<<16|yg[xg+1]<<8|yg[xg+2];vg+=this._encodeByte(Eg>>>18&63),vg+=this._encodeByte(Eg>>>12&63),vg+=this._encodeByte(Eg>>>6&63),vg+=this._encodeByte(Eg>>>0&63)}var Ig=yg.length-xg;return Ig>0&&(Eg=yg[xg]<<16|(2===Ig?yg[xg+1]<<8:0),vg+=this._encodeByte(Eg>>>18&63),vg+=this._encodeByte(Eg>>>12&63),vg+=2===Ig?this._encodeByte(Eg>>>6&63):this._paddingCharacter||"",vg+=this._paddingCharacter||""),vg},Coder3.prototype.maxDecodedLength=function(yg){return this._paddingCharacter?yg/4*3|0:(6*yg+7)/8|0},Coder3.prototype.decodedLength=function(yg){return this.maxDecodedLength(yg.length-this._getPaddingLength(yg))},Coder3.prototype.decode=function(yg){if(0===yg.length)return new Uint8Array(0);for(var vg=this._getPaddingLength(yg),xg=yg.length-vg,Eg=new Uint8Array(this.maxDecodedLength(xg)),Bg=0,Ng=0,Wg=0,Dg=0,Fg=0,zg=0,Hg=0;Ng<xg-4;Ng+=4)Dg=this._decodeChar(yg.charCodeAt(Ng+0)),Fg=this._decodeChar(yg.charCodeAt(Ng+1)),zg=this._decodeChar(yg.charCodeAt(Ng+2)),Hg=this._decodeChar(yg.charCodeAt(Ng+3)),Eg[Bg++]=Dg<<2|Fg>>>4,Eg[Bg++]=Fg<<4|zg>>>2,Eg[Bg++]=zg<<6|Hg,Wg|=Dg&Ig,Wg|=Fg&Ig,Wg|=zg&Ig,Wg|=Hg&Ig;if(Ng<xg-1&&(Dg=this._decodeChar(yg.charCodeAt(Ng)),Fg=this._decodeChar(yg.charCodeAt(Ng+1)),Eg[Bg++]=Dg<<2|Fg>>>4,Wg|=Dg&Ig,Wg|=Fg&Ig),Ng<xg-2&&(zg=this._decodeChar(yg.charCodeAt(Ng+2)),Eg[Bg++]=Fg<<4|zg>>>2,Wg|=zg&Ig),Ng<xg-3&&(Hg=this._decodeChar(yg.charCodeAt(Ng+3)),Eg[Bg++]=zg<<6|Hg,Wg|=Hg&Ig),0!==Wg)throw new Error("Base64Coder: incorrect characters for decoding");return Eg},Coder3.prototype._encodeByte=function(yg){var vg=yg;return vg+=65,vg+=25-yg>>>8&6,vg+=51-yg>>>8&-75,vg+=61-yg>>>8&-15,vg+=62-yg>>>8&3,String.fromCharCode(vg)},Coder3.prototype._decodeChar=function(yg){var vg=Ig;return vg+=(42-yg&yg-44)>>>8&-256+yg-43+62,vg+=(46-yg&yg-48)>>>8&-256+yg-47+63,vg+=(47-yg&yg-58)>>>8&-256+yg-48+52,vg+=(64-yg&yg-91)>>>8&-256+yg-65+0,vg+=(96-yg&yg-123)>>>8&-256+yg-97+26},Coder3.prototype._getPaddingLength=function(yg){var vg=0;if(this._paddingCharacter){for(var xg=yg.length-1;xg>=0&&yg[xg]===this._paddingCharacter;xg--)vg++;if(yg.length<4||vg>2)throw new Error("Base64Coder: incorrect padding")}return vg},Coder3}();vg.Coder=Bg;var Ng=new Bg;vg.encode=function encode2(yg){return Ng.encode(yg)},vg.decode=function decode2(yg){return Ng.decode(yg)};var Wg=function(yg){function URLSafeCoder2(){return null!==yg&&yg.apply(this,arguments)||this}return Eg(URLSafeCoder2,yg),URLSafeCoder2.prototype._encodeByte=function(yg){var vg=yg;return vg+=65,vg+=25-yg>>>8&6,vg+=51-yg>>>8&-75,vg+=61-yg>>>8&-13,vg+=62-yg>>>8&49,String.fromCharCode(vg)},URLSafeCoder2.prototype._decodeChar=function(yg){var vg=Ig;return vg+=(44-yg&yg-46)>>>8&-256+yg-45+62,vg+=(94-yg&yg-96)>>>8&-256+yg-95+63,vg+=(47-yg&yg-58)>>>8&-256+yg-48+52,vg+=(64-yg&yg-91)>>>8&-256+yg-65+0,vg+=(96-yg&yg-123)>>>8&-256+yg-97+26},URLSafeCoder2}(Bg);vg.URLSafeCoder=Wg;var Dg=new Wg;vg.encodeURLSafe=function encodeURLSafe(yg){return Dg.encode(yg)},vg.decodeURLSafe=function decodeURLSafe(yg){return Dg.decode(yg)},vg.encodedLength=function(yg){return Ng.encodedLength(yg)},vg.maxDecodedLength=function(yg){return Ng.maxDecodedLength(yg)},vg.decodedLength=function(yg){return Ng.decodedLength(yg)}},function(yg,vg,xg){Object.defineProperty(vg,"__esModule",{value:!0});var Eg="utf8: invalid string",Ig="utf8: invalid source encoding";function encodedLength(yg){for(var vg=0,xg=0;xg<yg.length;xg++){var Ig=yg.charCodeAt(xg);if(Ig<128)vg+=1;else if(Ig<2048)vg+=2;else if(Ig<55296)vg+=3;else{if(!(Ig<=57343))throw new Error(Eg);if(xg>=yg.length-1)throw new Error(Eg);xg++,vg+=4}}return vg}vg.encode=function encode2(yg){for(var vg=new Uint8Array(encodedLength(yg)),xg=0,Eg=0;Eg<yg.length;Eg++){var Ig=yg.charCodeAt(Eg);Ig<128?vg[xg++]=Ig:Ig<2048?(vg[xg++]=192|Ig>>6,vg[xg++]=128|63&Ig):Ig<55296?(vg[xg++]=224|Ig>>12,vg[xg++]=128|Ig>>6&63,vg[xg++]=128|63&Ig):(Eg++,Ig=(1023&Ig)<<10,Ig|=1023&yg.charCodeAt(Eg),Ig+=65536,vg[xg++]=240|Ig>>18,vg[xg++]=128|Ig>>12&63,vg[xg++]=128|Ig>>6&63,vg[xg++]=128|63&Ig)}return vg},vg.encodedLength=encodedLength,vg.decode=function decode2(yg){for(var vg=[],xg=0;xg<yg.length;xg++){var Eg=yg[xg];if(128&Eg){var Bg=void 0;if(Eg<224){if(xg>=yg.length)throw new Error(Ig);if(128!=(192&(Ng=yg[++xg])))throw new Error(Ig);Eg=(31&Eg)<<6|63&Ng,Bg=128}else if(Eg<240){if(xg>=yg.length-1)throw new Error(Ig);var Ng=yg[++xg],Wg=yg[++xg];if(128!=(192&Ng)||128!=(192&Wg))throw new Error(Ig);Eg=(15&Eg)<<12|(63&Ng)<<6|63&Wg,Bg=2048}else{if(!(Eg<248))throw new Error(Ig);if(xg>=yg.length-2)throw new Error(Ig);Ng=yg[++xg],Wg=yg[++xg];var Dg=yg[++xg];if(128!=(192&Ng)||128!=(192&Wg)||128!=(192&Dg))throw new Error(Ig);Eg=(15&Eg)<<18|(63&Ng)<<12|(63&Wg)<<6|63&Dg,Bg=65536}if(Eg<Bg||Eg>=55296&&Eg<=57343)throw new Error(Ig);if(Eg>=65536){if(Eg>1114111)throw new Error(Ig);Eg-=65536,vg.push(String.fromCharCode(55296|Eg>>10)),Eg=56320|1023&Eg}}vg.push(String.fromCharCode(Eg))}return vg.join("")}},function(yg,vg,xg){yg.exports=xg(3).default},function(yg,vg,xg){xg.r(vg);class ScriptReceiverFactory{constructor(yg,vg){this.lastId=0,this.prefix=yg,this.name=vg}create(yg){this.lastId++;var vg=this.lastId,xg=this.prefix+vg,Eg=this.name+"["+vg+"]",Ig=!1,callbackWrapper=function(){Ig||(yg.apply(null,arguments),Ig=!0)};return this[vg]=callbackWrapper,{number:vg,id:xg,name:Eg,callback:callbackWrapper}}remove(yg){delete this[yg.number]}}var Eg=new ScriptReceiverFactory("_pusher_script_","Pusher.ScriptReceivers"),Ig={VERSION:"8.4.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},Bg=new ScriptReceiverFactory("_pusher_dependencies","Pusher.DependenciesReceivers"),Ng=new class dependency_loader_DependencyLoader{constructor(yg){this.options=yg,this.receivers=yg.receivers||Eg,this.loading={}}load(yg,vg,xg){var Eg=this;if(Eg.loading[yg]&&Eg.loading[yg].length>0)Eg.loading[yg].push(xg);else{Eg.loading[yg]=[xg];var Ig=Om.createScriptRequest(Eg.getPath(yg,vg)),Bg=Eg.receivers.create((function(vg){if(Eg.receivers.remove(Bg),Eg.loading[yg]){var xg=Eg.loading[yg];delete Eg.loading[yg];for(var successCallback=function(yg){yg||Ig.cleanup()},Ng=0;Ng<xg.length;Ng++)xg[Ng](vg,successCallback)}}));Ig.send(Bg)}}getRoot(yg){var vg=Om.getDocument().location.protocol;return(yg&&yg.useTLS||"https:"===vg?this.options.cdn_https:this.options.cdn_http).replace(/\/*$/,"")+"/"+this.options.version}getPath(yg,vg){return this.getRoot(vg)+"/"+yg+this.options.suffix+".js"}}({cdn_http:Ig.cdn_http,cdn_https:Ig.cdn_https,version:Ig.VERSION,suffix:Ig.dependency_suffix,receivers:Bg});const Wg={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}};var Dg,Fg,url_store_buildLogSuffix=function(yg){const vg=Wg.urls[yg];if(!vg)return"";let xg;return vg.fullUrl?xg=vg.fullUrl:vg.path&&(xg=Wg.baseUrl+vg.path),xg?`See: ${xg}`:""};(Fg=Dg||(Dg={})).UserAuthentication="user-authentication",Fg.ChannelAuthorization="channel-authorization";class BadEventName extends Error{constructor(yg){super(yg),Object.setPrototypeOf(this,new.target.prototype)}}class BadChannelName extends Error{constructor(yg){super(yg),Object.setPrototypeOf(this,new.target.prototype)}}class RequestTimedOut extends Error{constructor(yg){super(yg),Object.setPrototypeOf(this,new.target.prototype)}}class TransportPriorityTooLow extends Error{constructor(yg){super(yg),Object.setPrototypeOf(this,new.target.prototype)}}class TransportClosed extends Error{constructor(yg){super(yg),Object.setPrototypeOf(this,new.target.prototype)}}class UnsupportedFeature extends Error{constructor(yg){super(yg),Object.setPrototypeOf(this,new.target.prototype)}}class UnsupportedTransport extends Error{constructor(yg){super(yg),Object.setPrototypeOf(this,new.target.prototype)}}class UnsupportedStrategy extends Error{constructor(yg){super(yg),Object.setPrototypeOf(this,new.target.prototype)}}class HTTPAuthError extends Error{constructor(yg,vg){super(vg),this.status=yg,Object.setPrototypeOf(this,new.target.prototype)}}var xhr_auth=function(yg,vg,xg,Eg,Ig){const Bg=Om.createXHR();for(var Ng in Bg.open("POST",xg.endpoint,!0),Bg.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),xg.headers)Bg.setRequestHeader(Ng,xg.headers[Ng]);if(null!=xg.headersProvider){let yg=xg.headersProvider();for(var Ng in yg)Bg.setRequestHeader(Ng,yg[Ng])}return Bg.onreadystatechange=function(){if(4===Bg.readyState)if(200===Bg.status){let yg,vg=!1;try{yg=JSON.parse(Bg.responseText),vg=!0}catch(e2){Ig(new HTTPAuthError(200,`JSON returned from ${Eg.toString()} endpoint was invalid, yet status code was 200. Data was: ${Bg.responseText}`),null)}vg&&Ig(null,yg)}else{let yg="";switch(Eg){case Dg.UserAuthentication:yg=url_store_buildLogSuffix("authenticationEndpoint");break;case Dg.ChannelAuthorization:yg=`Clients must be authorized to join private or presence channels. ${url_store_buildLogSuffix("authorizationEndpoint")}`}Ig(new HTTPAuthError(Bg.status,`Unable to retrieve auth string from ${Eg.toString()} endpoint - received status: ${Bg.status} from ${xg.endpoint}. ${yg}`),null)}},Bg.send(vg),Bg},zg=String.fromCharCode,Hg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cb_utob=function(yg){var vg=yg.charCodeAt(0);return vg<128?yg:vg<2048?zg(192|vg>>>6)+zg(128|63&vg):zg(224|vg>>>12&15)+zg(128|vg>>>6&63)+zg(128|63&vg)},utob=function(yg){return yg.replace(/[^\x00-\x7F]/g,cb_utob)},cb_encode=function(yg){var vg=[0,2,1][yg.length%3],xg=yg.charCodeAt(0)<<16|(yg.length>1?yg.charCodeAt(1):0)<<8|(yg.length>2?yg.charCodeAt(2):0);return[Hg.charAt(xg>>>18),Hg.charAt(xg>>>12&63),vg>=2?"=":Hg.charAt(xg>>>6&63),vg>=1?"=":Hg.charAt(63&xg)].join("")},qg=window.btoa||function(yg){return yg.replace(/[\s\S]{1,3}/g,cb_encode)},Kg=class Timer{constructor(yg,vg,xg,Eg){this.clear=vg,this.timer=yg((()=>{this.timer&&(this.timer=Eg(this.timer))}),xg)}isRunning(){return null!==this.timer}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}};function timers_clearTimeout(yg){window.clearTimeout(yg)}function timers_clearInterval(yg){window.clearInterval(yg)}class timers_OneOffTimer extends Kg{constructor(yg,vg){super(setTimeout,timers_clearTimeout,yg,(function(yg){return vg(),null}))}}class timers_PeriodicTimer extends Kg{constructor(yg,vg){super(setInterval,timers_clearInterval,yg,(function(yg){return vg(),yg}))}}var Gg={now:()=>Date.now?Date.now():(new Date).valueOf(),defer:yg=>new timers_OneOffTimer(0,yg),method(yg,...vg){var xg=Array.prototype.slice.call(arguments,1);return function(vg){return vg[yg].apply(vg,xg.concat(arguments))}}},em=Gg;function extend2(yg,...vg){for(var xg=0;xg<vg.length;xg++){var Eg=vg[xg];for(var Ig in Eg)Eg[Ig]&&Eg[Ig].constructor&&Eg[Ig].constructor===Object?yg[Ig]=extend2(yg[Ig]||{},Eg[Ig]):yg[Ig]=Eg[Ig]}return yg}function stringify2(){for(var yg=["Pusher"],vg=0;vg<arguments.length;vg++)"string"==typeof arguments[vg]?yg.push(arguments[vg]):yg.push(safeJSONStringify(arguments[vg]));return yg.join(" : ")}function arrayIndexOf(yg,vg){var xg=Array.prototype.indexOf;if(null===yg)return-1;if(xg&&yg.indexOf===xg)return yg.indexOf(vg);for(var Eg=0,Ig=yg.length;Eg<Ig;Eg++)if(yg[Eg]===vg)return Eg;return-1}function objectApply(yg,vg){for(var xg in yg)Object.prototype.hasOwnProperty.call(yg,xg)&&vg(yg[xg],xg,yg)}function keys2(yg){var vg=[];return objectApply(yg,(function(yg,xg){vg.push(xg)})),vg}function apply2(yg,vg,xg){for(var Eg=0;Eg<yg.length;Eg++)vg.call(xg||window,yg[Eg],Eg,yg)}function map2(yg,vg){for(var xg=[],Eg=0;Eg<yg.length;Eg++)xg.push(vg(yg[Eg],Eg,yg,xg));return xg}function filter(yg,vg){vg=vg||function(yg){return!!yg};for(var xg=[],Eg=0;Eg<yg.length;Eg++)vg(yg[Eg],Eg,yg,xg)&&xg.push(yg[Eg]);return xg}function filterObject(yg,vg){var xg={};return objectApply(yg,(function(Eg,Ig){(vg&&vg(Eg,Ig,yg,xg)||Boolean(Eg))&&(xg[Ig]=Eg)})),xg}function any2(yg,vg){for(var xg=0;xg<yg.length;xg++)if(vg(yg[xg],xg,yg))return!0;return!1}function encodeParamsObject(yg){return function mapObject2(yg,vg){var xg={};return objectApply(yg,(function(yg,Eg){xg[Eg]=vg(yg)})),xg}(yg,(function(yg){return"object"==typeof yg&&(yg=safeJSONStringify(yg)),encodeURIComponent(function encode2(yg){return qg(utob(yg))}(yg.toString()))}))}function buildQueryString(yg){return map2(function flatten(yg){var vg=[];return objectApply(yg,(function(yg,xg){vg.push([xg,yg])})),vg}(encodeParamsObject(filterObject(yg,(function(yg){return void 0!==yg})))),em.method("join","=")).join("&")}function safeJSONStringify(yg){try{return JSON.stringify(yg)}catch(e2){return JSON.stringify(function decycleObject(yg){var vg=[],xg=[];return function derez(yg,Eg){var Ig,Bg,Ng;switch(typeof yg){case"object":if(!yg)return null;for(Ig=0;Ig<vg.length;Ig+=1)if(vg[Ig]===yg)return{$ref:xg[Ig]};if(vg.push(yg),xg.push(Eg),"[object Array]"===Object.prototype.toString.apply(yg))for(Ng=[],Ig=0;Ig<yg.length;Ig+=1)Ng[Ig]=derez(yg[Ig],Eg+"["+Ig+"]");else for(Bg in Ng={},yg)Object.prototype.hasOwnProperty.call(yg,Bg)&&(Ng[Bg]=derez(yg[Bg],Eg+"["+JSON.stringify(Bg)+"]"));return Ng;case"number":case"string":case"boolean":return yg}}(yg,"$")}(yg))}}var tm=new class logger_Logger{constructor(){this.globalLog=yg=>{window.console&&window.console.log&&window.console.log(yg)}}debug(...yg){this.log(this.globalLog,yg)}warn(...yg){this.log(this.globalLogWarn,yg)}error(...yg){this.log(this.globalLogError,yg)}globalLogWarn(yg){window.console&&window.console.warn?window.console.warn(yg):this.globalLog(yg)}globalLogError(yg){window.console&&window.console.error?window.console.error(yg):this.globalLogWarn(yg)}log(yg,...vg){var xg=stringify2.apply(this,arguments);Fm.log?Fm.log(xg):Fm.logToConsole&&yg.bind(this)(xg)}},jsonp_auth=function(yg,vg,xg,Eg,Ig){void 0===xg.headers&&null==xg.headersProvider||tm.warn(`To send headers with the ${Eg.toString()} request, you must use AJAX, rather than JSONP.`);var Bg=yg.nextAuthCallbackID.toString();yg.nextAuthCallbackID++;var Ng=yg.getDocument(),Wg=Ng.createElement("script");yg.auth_callbacks[Bg]=function(yg){Ig(null,yg)};var Dg="Pusher.auth_callbacks['"+Bg+"']";Wg.src=xg.endpoint+"?callback="+encodeURIComponent(Dg)+"&"+vg;var Fg=Ng.getElementsByTagName("head")[0]||Ng.documentElement;Fg.insertBefore(Wg,Fg.firstChild)};class ScriptRequest{constructor(yg){this.src=yg}send(yg){var vg=this,xg="Error loading "+vg.src;vg.script=document.createElement("script"),vg.script.id=yg.id,vg.script.src=vg.src,vg.script.type="text/javascript",vg.script.charset="UTF-8",vg.script.addEventListener?(vg.script.onerror=function(){yg.callback(xg)},vg.script.onload=function(){yg.callback(null)}):vg.script.onreadystatechange=function(){"loaded"!==vg.script.readyState&&"complete"!==vg.script.readyState||yg.callback(null)},void 0===vg.script.asy