function mn(s,t){return function(){return s.apply(t,arguments)}}const{toString:Xs}=Object.prototype,{getPrototypeOf:bt}=Object,{iterator:$e,toStringTag:gn}=Symbol,Je=(s=>t=>{const i=Xs.call(t);return s[i]||(s[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Y=s=>(s=s.toLowerCase(),t=>Je(t)===s),Xe=s=>t=>typeof t===s,{isArray:be}=Array,ge=Xe("undefined");function ke(s){return s!==null&&!ge(s)&&s.constructor!==null&&!ge(s.constructor)&&V(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const bn=Y("ArrayBuffer");function Ws(s){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(s):t=s&&s.buffer&&bn(s.buffer),t}const Vs=Xe("string"),V=Xe("function"),yn=Xe("number"),Ee=s=>s!==null&&typeof s=="object",Ks=s=>s===!0||s===!1,qe=s=>{if(Je(s)!=="object")return!1;const t=bt(s);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(gn in s)&&!($e in s)},Gs=s=>{if(!Ee(s)||ke(s))return!1;try{return Object.keys(s).length===0&&Object.getPrototypeOf(s)===Object.prototype}catch{return!1}},Qs=Y("Date"),Ys=Y("File"),Zs=Y("Blob"),ei=Y("FileList"),ti=s=>Ee(s)&&V(s.pipe),ni=s=>{let t;return s&&(typeof FormData=="function"&&s instanceof FormData||V(s.append)&&((t=Je(s))==="formdata"||t==="object"&&V(s.toString)&&s.toString()==="[object FormData]"))},ri=Y("URLSearchParams"),[si,ii,oi,ai]=["ReadableStream","Request","Response","Headers"].map(Y),ci=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function xe(s,t,{allOwnKeys:i=!1}={}){if(s===null||typeof s>"u")return;let o,c;if(typeof s!="object"&&(s=[s]),be(s))for(o=0,c=s.length;o0;)if(c=i[o],t===c.toLowerCase())return c;return null}const le=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,wn=s=>!ge(s)&&s!==le;function ft(){const{caseless:s,skipUndefined:t}=wn(this)&&this||{},i={},o=(c,l)=>{const h=s&&vn(i,l)||l;qe(i[h])&&qe(c)?i[h]=ft(i[h],c):qe(c)?i[h]=ft({},c):be(c)?i[h]=c.slice():(!t||!ge(c))&&(i[h]=c)};for(let c=0,l=arguments.length;c(xe(t,(c,l)=>{i&&V(c)?s[l]=mn(c,i):s[l]=c},{allOwnKeys:o}),s),hi=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),li=(s,t,i,o)=>{s.prototype=Object.create(t.prototype,o),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:t.prototype}),i&&Object.assign(s.prototype,i)},di=(s,t,i,o)=>{let c,l,h;const p={};if(t=t||{},s==null)return t;do{for(c=Object.getOwnPropertyNames(s),l=c.length;l-- >0;)h=c[l],(!o||o(h,s,t))&&!p[h]&&(t[h]=s[h],p[h]=!0);s=i!==!1&&bt(s)}while(s&&(!i||i(s,t))&&s!==Object.prototype);return t},fi=(s,t,i)=>{s=String(s),(i===void 0||i>s.length)&&(i=s.length),i-=t.length;const o=s.indexOf(t,i);return o!==-1&&o===i},pi=s=>{if(!s)return null;if(be(s))return s;let t=s.length;if(!yn(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=s[t];return i},mi=(s=>t=>s&&t instanceof s)(typeof Uint8Array<"u"&&bt(Uint8Array)),gi=(s,t)=>{const o=(s&&s[$e]).call(s);let c;for(;(c=o.next())&&!c.done;){const l=c.value;t.call(s,l[0],l[1])}},bi=(s,t)=>{let i;const o=[];for(;(i=s.exec(t))!==null;)o.push(i);return o},yi=Y("HTMLFormElement"),vi=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,o,c){return o.toUpperCase()+c}),Gt=(({hasOwnProperty:s})=>(t,i)=>s.call(t,i))(Object.prototype),wi=Y("RegExp"),Sn=(s,t)=>{const i=Object.getOwnPropertyDescriptors(s),o={};xe(i,(c,l)=>{let h;(h=t(c,l,s))!==!1&&(o[l]=h||c)}),Object.defineProperties(s,o)},Si=s=>{Sn(s,(t,i)=>{if(V(s)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const o=s[i];if(V(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},_i=(s,t)=>{const i={},o=c=>{c.forEach(l=>{i[l]=!0})};return be(s)?o(s):o(String(s).split(t)),i},Ci=()=>{},Ti=(s,t)=>s!=null&&Number.isFinite(s=+s)?s:t;function ki(s){return!!(s&&V(s.append)&&s[gn]==="FormData"&&s[$e])}const Ei=s=>{const t=new Array(10),i=(o,c)=>{if(Ee(o)){if(t.indexOf(o)>=0)return;if(ke(o))return o;if(!("toJSON"in o)){t[c]=o;const l=be(o)?[]:{};return xe(o,(h,p)=>{const y=i(h,c+1);!ge(y)&&(l[p]=y)}),t[c]=void 0,l}}return o};return i(s,0)},xi=Y("AsyncFunction"),Ri=s=>s&&(Ee(s)||V(s))&&V(s.then)&&V(s.catch),_n=((s,t)=>s?setImmediate:t?((i,o)=>(le.addEventListener("message",({source:c,data:l})=>{c===le&&l===i&&o.length&&o.shift()()},!1),c=>{o.push(c),le.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",V(le.postMessage)),Pi=typeof queueMicrotask<"u"?queueMicrotask.bind(le):typeof process<"u"&&process.nextTick||_n,Oi=s=>s!=null&&V(s[$e]),d={isArray:be,isArrayBuffer:bn,isBuffer:ke,isFormData:ni,isArrayBufferView:Ws,isString:Vs,isNumber:yn,isBoolean:Ks,isObject:Ee,isPlainObject:qe,isEmptyObject:Gs,isReadableStream:si,isRequest:ii,isResponse:oi,isHeaders:ai,isUndefined:ge,isDate:Qs,isFile:Ys,isBlob:Zs,isRegExp:wi,isFunction:V,isStream:ti,isURLSearchParams:ri,isTypedArray:mi,isFileList:ei,forEach:xe,merge:ft,extend:ui,trim:ci,stripBOM:hi,inherits:li,toFlatObject:di,kindOf:Je,kindOfTest:Y,endsWith:fi,toArray:pi,forEachEntry:gi,matchAll:bi,isHTMLForm:yi,hasOwnProperty:Gt,hasOwnProp:Gt,reduceDescriptors:Sn,freezeMethods:Si,toObjectSet:_i,toCamelCase:vi,noop:Ci,toFiniteNumber:Ti,findKey:vn,global:le,isContextDefined:wn,isSpecCompliantForm:ki,toJSONObject:Ei,isAsyncFn:xi,isThenable:Ri,setImmediate:_n,asap:Pi,isIterable:Oi};function A(s,t,i,o,c){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),o&&(this.request=o),c&&(this.response=c,this.status=c.status?c.status:null)}d.inherits(A,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:d.toJSONObject(this.config),code:this.code,status:this.status}}});const Cn=A.prototype,Tn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(s=>{Tn[s]={value:s}});Object.defineProperties(A,Tn);Object.defineProperty(Cn,"isAxiosError",{value:!0});A.from=(s,t,i,o,c,l)=>{const h=Object.create(Cn);d.toFlatObject(s,h,function(g){return g!==Error.prototype},w=>w!=="isAxiosError");const p=s&&s.message?s.message:"Error",y=t==null&&s?s.code:t;return A.call(h,p,y,i,o,c),s&&h.cause==null&&Object.defineProperty(h,"cause",{value:s,configurable:!0}),h.name=s&&s.name||"Error",l&&Object.assign(h,l),h};const Ai=null;function pt(s){return d.isPlainObject(s)||d.isArray(s)}function kn(s){return d.endsWith(s,"[]")?s.slice(0,-2):s}function Qt(s,t,i){return s?s.concat(t).map(function(c,l){return c=kn(c),!i&&l?"["+c+"]":c}).join(i?".":""):t}function Li(s){return d.isArray(s)&&!s.some(pt)}const Ni=d.toFlatObject(d,{},null,function(t){return/^is[A-Z]/.test(t)});function We(s,t,i){if(!d.isObject(s))throw new TypeError("target must be an object");t=t||new FormData,i=d.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,f){return!d.isUndefined(f[v])});const o=i.metaTokens,c=i.visitor||g,l=i.dots,h=i.indexes,y=(i.Blob||typeof Blob<"u"&&Blob)&&d.isSpecCompliantForm(t);if(!d.isFunction(c))throw new TypeError("visitor must be a function");function w(b){if(b===null)return"";if(d.isDate(b))return b.toISOString();if(d.isBoolean(b))return b.toString();if(!y&&d.isBlob(b))throw new A("Blob is not supported. Use a Buffer instead.");return d.isArrayBuffer(b)||d.isTypedArray(b)?y&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function g(b,v,f){let S=b;if(b&&!f&&typeof b=="object"){if(d.endsWith(v,"{}"))v=o?v:v.slice(0,-2),b=JSON.stringify(b);else if(d.isArray(b)&&Li(b)||(d.isFileList(b)||d.endsWith(v,"[]"))&&(S=d.toArray(b)))return v=kn(v),S.forEach(function(R,N){!(d.isUndefined(R)||R===null)&&t.append(h===!0?Qt([v],N,l):h===null?v:v+"[]",w(R))}),!1}return pt(b)?!0:(t.append(Qt(f,v,l),w(b)),!1)}const C=[],T=Object.assign(Ni,{defaultVisitor:g,convertValue:w,isVisitable:pt});function x(b,v){if(!d.isUndefined(b)){if(C.indexOf(b)!==-1)throw Error("Circular reference detected in "+v.join("."));C.push(b),d.forEach(b,function(S,E){(!(d.isUndefined(S)||S===null)&&c.call(t,S,d.isString(E)?E.trim():E,v,T))===!0&&x(S,v?v.concat(E):[E])}),C.pop()}}if(!d.isObject(s))throw new TypeError("data must be an object");return x(s),t}function Yt(s){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function yt(s,t){this._pairs=[],s&&We(s,this,t)}const En=yt.prototype;En.append=function(t,i){this._pairs.push([t,i])};En.toString=function(t){const i=t?function(o){return t.call(this,o,Yt)}:Yt;return this._pairs.map(function(c){return i(c[0])+"="+i(c[1])},"").join("&")};function Ii(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function xn(s,t,i){if(!t)return s;const o=i&&i.encode||Ii;d.isFunction(i)&&(i={serialize:i});const c=i&&i.serialize;let l;if(c?l=c(t,i):l=d.isURLSearchParams(t)?t.toString():new yt(t,i).toString(o),l){const h=s.indexOf("#");h!==-1&&(s=s.slice(0,h)),s+=(s.indexOf("?")===-1?"?":"&")+l}return s}class Zt{constructor(){this.handlers=[]}use(t,i,o){return this.handlers.push({fulfilled:t,rejected:i,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){d.forEach(this.handlers,function(o){o!==null&&t(o)})}}const Rn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ji=typeof URLSearchParams<"u"?URLSearchParams:yt,Ui=typeof FormData<"u"?FormData:null,Di=typeof Blob<"u"?Blob:null,Fi={isBrowser:!0,classes:{URLSearchParams:ji,FormData:Ui,Blob:Di},protocols:["http","https","file","blob","url","data"]},vt=typeof window<"u"&&typeof document<"u",mt=typeof navigator=="object"&&navigator||void 0,qi=vt&&(!mt||["ReactNative","NativeScript","NS"].indexOf(mt.product)<0),Bi=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Hi=vt&&window.location.href||"http://localhost",Mi=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:vt,hasStandardBrowserEnv:qi,hasStandardBrowserWebWorkerEnv:Bi,navigator:mt,origin:Hi},Symbol.toStringTag,{value:"Module"})),$={...Mi,...Fi};function zi(s,t){return We(s,new $.classes.URLSearchParams,{visitor:function(i,o,c,l){return $.isNode&&d.isBuffer(i)?(this.append(o,i.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...t})}function $i(s){return d.matchAll(/\w+|\[(\w*)]/g,s).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Ji(s){const t={},i=Object.keys(s);let o;const c=i.length;let l;for(o=0;o=i.length;return h=!h&&d.isArray(c)?c.length:h,y?(d.hasOwnProp(c,h)?c[h]=[c[h],o]:c[h]=o,!p):((!c[h]||!d.isObject(c[h]))&&(c[h]=[]),t(i,o,c[h],l)&&d.isArray(c[h])&&(c[h]=Ji(c[h])),!p)}if(d.isFormData(s)&&d.isFunction(s.entries)){const i={};return d.forEachEntry(s,(o,c)=>{t($i(o),c,i,0)}),i}return null}function Xi(s,t,i){if(d.isString(s))try{return(t||JSON.parse)(s),d.trim(s)}catch(o){if(o.name!=="SyntaxError")throw o}return(i||JSON.stringify)(s)}const Re={transitional:Rn,adapter:["xhr","http","fetch"],transformRequest:[function(t,i){const o=i.getContentType()||"",c=o.indexOf("application/json")>-1,l=d.isObject(t);if(l&&d.isHTMLForm(t)&&(t=new FormData(t)),d.isFormData(t))return c?JSON.stringify(Pn(t)):t;if(d.isArrayBuffer(t)||d.isBuffer(t)||d.isStream(t)||d.isFile(t)||d.isBlob(t)||d.isReadableStream(t))return t;if(d.isArrayBufferView(t))return t.buffer;if(d.isURLSearchParams(t))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let p;if(l){if(o.indexOf("application/x-www-form-urlencoded")>-1)return zi(t,this.formSerializer).toString();if((p=d.isFileList(t))||o.indexOf("multipart/form-data")>-1){const y=this.env&&this.env.FormData;return We(p?{"files[]":t}:t,y&&new y,this.formSerializer)}}return l||c?(i.setContentType("application/json",!1),Xi(t)):t}],transformResponse:[function(t){const i=this.transitional||Re.transitional,o=i&&i.forcedJSONParsing,c=this.responseType==="json";if(d.isResponse(t)||d.isReadableStream(t))return t;if(t&&d.isString(t)&&(o&&!this.responseType||c)){const h=!(i&&i.silentJSONParsing)&&c;try{return JSON.parse(t,this.parseReviver)}catch(p){if(h)throw p.name==="SyntaxError"?A.from(p,A.ERR_BAD_RESPONSE,this,null,this.response):p}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$.classes.FormData,Blob:$.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};d.forEach(["delete","get","head","post","put","patch"],s=>{Re.headers[s]={}});const Wi=d.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Vi=s=>{const t={};let i,o,c;return s&&s.split(` `).forEach(function(h){c=h.indexOf(":"),i=h.substring(0,c).trim().toLowerCase(),o=h.substring(c+1).trim(),!(!i||t[i]&&Wi[i])&&(i==="set-cookie"?t[i]?t[i].push(o):t[i]=[o]:t[i]=t[i]?t[i]+", "+o:o)}),t},en=Symbol("internals");function Te(s){return s&&String(s).trim().toLowerCase()}function Be(s){return s===!1||s==null?s:d.isArray(s)?s.map(Be):String(s)}function Ki(s){const t=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=i.exec(s);)t[o[1]]=o[2];return t}const Gi=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function ut(s,t,i,o,c){if(d.isFunction(o))return o.call(this,t,i);if(c&&(t=i),!!d.isString(t)){if(d.isString(o))return t.indexOf(o)!==-1;if(d.isRegExp(o))return o.test(t)}}function Qi(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,i,o)=>i.toUpperCase()+o)}function Yi(s,t){const i=d.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(s,o+i,{value:function(c,l,h){return this[o].call(this,t,c,l,h)},configurable:!0})})}let K=class{constructor(t){t&&this.set(t)}set(t,i,o){const c=this;function l(p,y,w){const g=Te(y);if(!g)throw new Error("header name must be a non-empty string");const C=d.findKey(c,g);(!C||c[C]===void 0||w===!0||w===void 0&&c[C]!==!1)&&(c[C||y]=Be(p))}const h=(p,y)=>d.forEach(p,(w,g)=>l(w,g,y));if(d.isPlainObject(t)||t instanceof this.constructor)h(t,i);else if(d.isString(t)&&(t=t.trim())&&!Gi(t))h(Vi(t),i);else if(d.isObject(t)&&d.isIterable(t)){let p={},y,w;for(const g of t){if(!d.isArray(g))throw TypeError("Object iterator must return a key-value pair");p[w=g[0]]=(y=p[w])?d.isArray(y)?[...y,g[1]]:[y,g[1]]:g[1]}h(p,i)}else t!=null&&l(i,t,o);return this}get(t,i){if(t=Te(t),t){const o=d.findKey(this,t);if(o){const c=this[o];if(!i)return c;if(i===!0)return Ki(c);if(d.isFunction(i))return i.call(this,c,o);if(d.isRegExp(i))return i.exec(c);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,i){if(t=Te(t),t){const o=d.findKey(this,t);return!!(o&&this[o]!==void 0&&(!i||ut(this,this[o],o,i)))}return!1}delete(t,i){const o=this;let c=!1;function l(h){if(h=Te(h),h){const p=d.findKey(o,h);p&&(!i||ut(o,o[p],p,i))&&(delete o[p],c=!0)}}return d.isArray(t)?t.forEach(l):l(t),c}clear(t){const i=Object.keys(this);let o=i.length,c=!1;for(;o--;){const l=i[o];(!t||ut(this,this[l],l,t,!0))&&(delete this[l],c=!0)}return c}normalize(t){const i=this,o={};return d.forEach(this,(c,l)=>{const h=d.findKey(o,l);if(h){i[h]=Be(c),delete i[l];return}const p=t?Qi(l):String(l).trim();p!==l&&delete i[l],i[p]=Be(c),o[p]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const i=Object.create(null);return d.forEach(this,(o,c)=>{o!=null&&o!==!1&&(i[c]=t&&d.isArray(o)?o.join(", "):o)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,i])=>t+": "+i).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...i){const o=new this(t);return i.forEach(c=>o.set(c)),o}static accessor(t){const o=(this[en]=this[en]={accessors:{}}).accessors,c=this.prototype;function l(h){const p=Te(h);o[p]||(Yi(c,h),o[p]=!0)}return d.isArray(t)?t.forEach(l):l(t),this}};K.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);d.reduceDescriptors(K.prototype,({value:s},t)=>{let i=t[0].toUpperCase()+t.slice(1);return{get:()=>s,set(o){this[i]=o}}});d.freezeMethods(K);function ht(s,t){const i=this||Re,o=t||i,c=K.from(o.headers);let l=o.data;return d.forEach(s,function(p){l=p.call(i,l,c.normalize(),t?t.status:void 0)}),c.normalize(),l}function On(s){return!!(s&&s.__CANCEL__)}function ye(s,t,i){A.call(this,s??"canceled",A.ERR_CANCELED,t,i),this.name="CanceledError"}d.inherits(ye,A,{__CANCEL__:!0});function An(s,t,i){const o=i.config.validateStatus;!i.status||!o||o(i.status)?s(i):t(new A("Request failed with status code "+i.status,[A.ERR_BAD_REQUEST,A.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function Zi(s){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return t&&t[1]||""}function eo(s,t){s=s||10;const i=new Array(s),o=new Array(s);let c=0,l=0,h;return t=t!==void 0?t:1e3,function(y){const w=Date.now(),g=o[l];h||(h=w),i[c]=y,o[c]=w;let C=l,T=0;for(;C!==c;)T+=i[C++],C=C%s;if(c=(c+1)%s,c===l&&(l=(l+1)%s),w-h{i=g,c=null,l&&(clearTimeout(l),l=null),s(...w)};return[(...w)=>{const g=Date.now(),C=g-i;C>=o?h(w,g):(c=w,l||(l=setTimeout(()=>{l=null,h(c)},o-C)))},()=>c&&h(c)]}const Me=(s,t,i=3)=>{let o=0;const c=eo(50,250);return to(l=>{const h=l.loaded,p=l.lengthComputable?l.total:void 0,y=h-o,w=c(y),g=h<=p;o=h;const C={loaded:h,total:p,progress:p?h/p:void 0,bytes:y,rate:w||void 0,estimated:w&&p&&g?(p-h)/w:void 0,event:l,lengthComputable:p!=null,[t?"download":"upload"]:!0};s(C)},i)},tn=(s,t)=>{const i=s!=null;return[o=>t[0]({lengthComputable:i,total:s,loaded:o}),t[1]]},nn=s=>(...t)=>d.asap(()=>s(...t)),no=$.hasStandardBrowserEnv?((s,t)=>i=>(i=new URL(i,$.origin),s.protocol===i.protocol&&s.host===i.host&&(t||s.port===i.port)))(new URL($.origin),$.navigator&&/(msie|trident)/i.test($.navigator.userAgent)):()=>!0,ro=$.hasStandardBrowserEnv?{write(s,t,i,o,c,l,h){if(typeof document>"u")return;const p=[`${s}=${encodeURIComponent(t)}`];d.isNumber(i)&&p.push(`expires=${new Date(i).toUTCString()}`),d.isString(o)&&p.push(`path=${o}`),d.isString(c)&&p.push(`domain=${c}`),l===!0&&p.push("secure"),d.isString(h)&&p.push(`SameSite=${h}`),document.cookie=p.join("; ")},read(s){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+s+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(s){this.write(s,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function so(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function io(s,t){return t?s.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):s}function Ln(s,t,i){let o=!so(t);return s&&(o||i==!1)?io(s,t):t}const rn=s=>s instanceof K?{...s}:s;function fe(s,t){t=t||{};const i={};function o(w,g,C,T){return d.isPlainObject(w)&&d.isPlainObject(g)?d.merge.call({caseless:T},w,g):d.isPlainObject(g)?d.merge({},g):d.isArray(g)?g.slice():g}function c(w,g,C,T){if(d.isUndefined(g)){if(!d.isUndefined(w))return o(void 0,w,C,T)}else return o(w,g,C,T)}function l(w,g){if(!d.isUndefined(g))return o(void 0,g)}function h(w,g){if(d.isUndefined(g)){if(!d.isUndefined(w))return o(void 0,w)}else return o(void 0,g)}function p(w,g,C){if(C in t)return o(w,g);if(C in s)return o(void 0,w)}const y={url:l,method:l,data:l,baseURL:h,transformRequest:h,transformResponse:h,paramsSerializer:h,timeout:h,timeoutMessage:h,withCredentials:h,withXSRFToken:h,adapter:h,responseType:h,xsrfCookieName:h,xsrfHeaderName:h,onUploadProgress:h,onDownloadProgress:h,decompress:h,maxContentLength:h,maxBodyLength:h,beforeRedirect:h,transport:h,httpAgent:h,httpsAgent:h,cancelToken:h,socketPath:h,responseEncoding:h,validateStatus:p,headers:(w,g,C)=>c(rn(w),rn(g),C,!0)};return d.forEach(Object.keys({...s,...t}),function(g){const C=y[g]||c,T=C(s[g],t[g],g);d.isUndefined(T)&&C!==p||(i[g]=T)}),i}const Nn=s=>{const t=fe({},s);let{data:i,withXSRFToken:o,xsrfHeaderName:c,xsrfCookieName:l,headers:h,auth:p}=t;if(t.headers=h=K.from(h),t.url=xn(Ln(t.baseURL,t.url,t.allowAbsoluteUrls),s.params,s.paramsSerializer),p&&h.set("Authorization","Basic "+btoa((p.username||"")+":"+(p.password?unescape(encodeURIComponent(p.password)):""))),d.isFormData(i)){if($.hasStandardBrowserEnv||$.hasStandardBrowserWebWorkerEnv)h.setContentType(void 0);else if(d.isFunction(i.getHeaders)){const y=i.getHeaders(),w=["content-type","content-length"];Object.entries(y).forEach(([g,C])=>{w.includes(g.toLowerCase())&&h.set(g,C)})}}if($.hasStandardBrowserEnv&&(o&&d.isFunction(o)&&(o=o(t)),o||o!==!1&&no(t.url))){const y=c&&l&&ro.read(l);y&&h.set(c,y)}return t},oo=typeof XMLHttpRequest<"u",ao=oo&&function(s){return new Promise(function(i,o){const c=Nn(s);let l=c.data;const h=K.from(c.headers).normalize();let{responseType:p,onUploadProgress:y,onDownloadProgress:w}=c,g,C,T,x,b;function v(){x&&x(),b&&b(),c.cancelToken&&c.cancelToken.unsubscribe(g),c.signal&&c.signal.removeEventListener("abort",g)}let f=new XMLHttpRequest;f.open(c.method.toUpperCase(),c.url,!0),f.timeout=c.timeout;function S(){if(!f)return;const R=K.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),j={data:!p||p==="text"||p==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:R,config:s,request:f};An(function(D){i(D),v()},function(D){o(D),v()},j),f=null}"onloadend"in f?f.onloadend=S:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(S)},f.onabort=function(){f&&(o(new A("Request aborted",A.ECONNABORTED,s,f)),f=null)},f.onerror=function(N){const j=N&&N.message?N.message:"Network Error",B=new A(j,A.ERR_NETWORK,s,f);B.event=N||null,o(B),f=null},f.ontimeout=function(){let N=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded";const j=c.transitional||Rn;c.timeoutErrorMessage&&(N=c.timeoutErrorMessage),o(new A(N,j.clarifyTimeoutError?A.ETIMEDOUT:A.ECONNABORTED,s,f)),f=null},l===void 0&&h.setContentType(null),"setRequestHeader"in f&&d.forEach(h.toJSON(),function(N,j){f.setRequestHeader(j,N)}),d.isUndefined(c.withCredentials)||(f.withCredentials=!!c.withCredentials),p&&p!=="json"&&(f.responseType=c.responseType),w&&([T,b]=Me(w,!0),f.addEventListener("progress",T)),y&&f.upload&&([C,x]=Me(y),f.upload.addEventListener("progress",C),f.upload.addEventListener("loadend",x)),(c.cancelToken||c.signal)&&(g=R=>{f&&(o(!R||R.type?new ye(null,s,f):R),f.abort(),f=null)},c.cancelToken&&c.cancelToken.subscribe(g),c.signal&&(c.signal.aborted?g():c.signal.addEventListener("abort",g)));const E=Zi(c.url);if(E&&$.protocols.indexOf(E)===-1){o(new A("Unsupported protocol "+E+":",A.ERR_BAD_REQUEST,s));return}f.send(l||null)})},co=(s,t)=>{const{length:i}=s=s?s.filter(Boolean):[];if(t||i){let o=new AbortController,c;const l=function(w){if(!c){c=!0,p();const g=w instanceof Error?w:this.reason;o.abort(g instanceof A?g:new ye(g instanceof Error?g.message:g))}};let h=t&&setTimeout(()=>{h=null,l(new A(`timeout ${t} of ms exceeded`,A.ETIMEDOUT))},t);const p=()=>{s&&(h&&clearTimeout(h),h=null,s.forEach(w=>{w.unsubscribe?w.unsubscribe(l):w.removeEventListener("abort",l)}),s=null)};s.forEach(w=>w.addEventListener("abort",l));const{signal:y}=o;return y.unsubscribe=()=>d.asap(p),y}},uo=function*(s,t){let i=s.byteLength;if(i{const c=ho(s,t);let l=0,h,p=y=>{h||(h=!0,o&&o(y))};return new ReadableStream({async pull(y){try{const{done:w,value:g}=await c.next();if(w){p(),y.close();return}let C=g.byteLength;if(i){let T=l+=C;i(T)}y.enqueue(new Uint8Array(g))}catch(w){throw p(w),w}},cancel(y){return p(y),c.return()}},{highWaterMark:2})},on=64*1024,{isFunction:De}=d,fo=(({Request:s,Response:t})=>({Request:s,Response:t}))(d.global),{ReadableStream:an,TextEncoder:cn}=d.global,un=(s,...t)=>{try{return!!s(...t)}catch{return!1}},po=s=>{s=d.merge.call({skipUndefined:!0},fo,s);const{fetch:t,Request:i,Response:o}=s,c=t?De(t):typeof fetch=="function",l=De(i),h=De(o);if(!c)return!1;const p=c&&De(an),y=c&&(typeof cn=="function"?(b=>v=>b.encode(v))(new cn):async b=>new Uint8Array(await new i(b).arrayBuffer())),w=l&&p&&un(()=>{let b=!1;const v=new i($.origin,{body:new an,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!v}),g=h&&p&&un(()=>d.isReadableStream(new o("").body)),C={stream:g&&(b=>b.body)};c&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!C[b]&&(C[b]=(v,f)=>{let S=v&&v[b];if(S)return S.call(v);throw new A(`Response type '${b}' is not supported`,A.ERR_NOT_SUPPORT,f)})});const T=async b=>{if(b==null)return 0;if(d.isBlob(b))return b.size;if(d.isSpecCompliantForm(b))return(await new i($.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(d.isArrayBufferView(b)||d.isArrayBuffer(b))return b.byteLength;if(d.isURLSearchParams(b)&&(b=b+""),d.isString(b))return(await y(b)).byteLength},x=async(b,v)=>{const f=d.toFiniteNumber(b.getContentLength());return f??T(v)};return async b=>{let{url:v,method:f,data:S,signal:E,cancelToken:R,timeout:N,onDownloadProgress:j,onUploadProgress:B,responseType:D,headers:z,withCredentials:J="same-origin",fetchOptions:Q}=Nn(b),Pe=t||fetch;D=D?(D+"").toLowerCase():"text";let Z=co([E,R&&R.toAbortSignal()],N),ee=null;const se=Z&&Z.unsubscribe&&(()=>{Z.unsubscribe()});let Oe;try{if(B&&w&&f!=="get"&&f!=="head"&&(Oe=await x(z,S))!==0){let ne=new i(v,{method:"POST",body:S,duplex:"half"}),X;if(d.isFormData(S)&&(X=ne.headers.get("content-type"))&&z.setContentType(X),ne.body){const[we,pe]=tn(Oe,Me(nn(B)));S=sn(ne.body,on,we,pe)}}d.isString(J)||(J=J?"include":"omit");const G=l&&"credentials"in i.prototype,Ae={...Q,signal:Z,method:f.toUpperCase(),headers:z.normalize().toJSON(),body:S,duplex:"half",credentials:G?J:void 0};ee=l&&new i(v,Ae);let te=await(l?Pe(ee,Q):Pe(v,Ae));const ve=g&&(D==="stream"||D==="response");if(g&&(j||ve&&se)){const ne={};["status","statusText","headers"].forEach(H=>{ne[H]=te[H]});const X=d.toFiniteNumber(te.headers.get("content-length")),[we,pe]=j&&tn(X,Me(nn(j),!0))||[];te=new o(sn(te.body,on,we,()=>{pe&&pe(),se&&se()}),ne)}D=D||"text";let Ke=await C[d.findKey(C,D)||"text"](te,b);return!ve&&se&&se(),await new Promise((ne,X)=>{An(ne,X,{data:Ke,headers:K.from(te.headers),status:te.status,statusText:te.statusText,config:b,request:ee})})}catch(G){throw se&&se(),G&&G.name==="TypeError"&&/Load failed|fetch/i.test(G.message)?Object.assign(new A("Network Error",A.ERR_NETWORK,b,ee),{cause:G.cause||G}):A.from(G,G&&G.code,b,ee)}}},mo=new Map,In=s=>{let t=s&&s.env||{};const{fetch:i,Request:o,Response:c}=t,l=[o,c,i];let h=l.length,p=h,y,w,g=mo;for(;p--;)y=l[p],w=g.get(y),w===void 0&&g.set(y,w=p?new Map:po(t)),g=w;return w};In();const wt={http:Ai,xhr:ao,fetch:{get:In}};d.forEach(wt,(s,t)=>{if(s){try{Object.defineProperty(s,"name",{value:t})}catch{}Object.defineProperty(s,"adapterName",{value:t})}});const hn=s=>`- ${s}`,go=s=>d.isFunction(s)||s===null||s===!1;function bo(s,t){s=d.isArray(s)?s:[s];const{length:i}=s;let o,c;const l={};for(let h=0;h`adapter ${y} `+(w===!1?"is not supported by the environment":"is not available in the build"));let p=i?h.length>1?`since : `+h.map(hn).join(` `):" "+hn(h[0]):"as no adapter specified";throw new A("There is no suitable adapter to dispatch the request "+p,"ERR_NOT_SUPPORT")}return c}const jn={getAdapter:bo,adapters:wt};function lt(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new ye(null,s)}function ln(s){return lt(s),s.headers=K.from(s.headers),s.data=ht.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),jn.getAdapter(s.adapter||Re.adapter,s)(s).then(function(o){return lt(s),o.data=ht.call(s,s.transformResponse,o),o.headers=K.from(o.headers),o},function(o){return On(o)||(lt(s),o&&o.response&&(o.response.data=ht.call(s,s.transformResponse,o.response),o.response.headers=K.from(o.response.headers))),Promise.reject(o)})}const Un="1.13.2",Ve={};["object","boolean","number","function","string","symbol"].forEach((s,t)=>{Ve[s]=function(o){return typeof o===s||"a"+(t<1?"n ":" ")+s}});const dn={};Ve.transitional=function(t,i,o){function c(l,h){return"[Axios v"+Un+"] Transitional option '"+l+"'"+h+(o?". "+o:"")}return(l,h,p)=>{if(t===!1)throw new A(c(h," has been removed"+(i?" in "+i:"")),A.ERR_DEPRECATED);return i&&!dn[h]&&(dn[h]=!0,console.warn(c(h," has been deprecated since v"+i+" and will be removed in the near future"))),t?t(l,h,p):!0}};Ve.spelling=function(t){return(i,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function yo(s,t,i){if(typeof s!="object")throw new A("options must be an object",A.ERR_BAD_OPTION_VALUE);const o=Object.keys(s);let c=o.length;for(;c-- >0;){const l=o[c],h=t[l];if(h){const p=s[l],y=p===void 0||h(p,l,s);if(y!==!0)throw new A("option "+l+" must be "+y,A.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new A("Unknown option "+l,A.ERR_BAD_OPTION)}}const He={assertOptions:yo,validators:Ve},re=He.validators;let de=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Zt,response:new Zt}}async request(t,i){try{return await this._request(t,i)}catch(o){if(o instanceof Error){let c={};Error.captureStackTrace?Error.captureStackTrace(c):c=new Error;const l=c.stack?c.stack.replace(/^.+\n/,""):"";try{o.stack?l&&!String(o.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(o.stack+=` `+l):o.stack=l}catch{}}throw o}}_request(t,i){typeof t=="string"?(i=i||{},i.url=t):i=t||{},i=fe(this.defaults,i);const{transitional:o,paramsSerializer:c,headers:l}=i;o!==void 0&&He.assertOptions(o,{silentJSONParsing:re.transitional(re.boolean),forcedJSONParsing:re.transitional(re.boolean),clarifyTimeoutError:re.transitional(re.boolean)},!1),c!=null&&(d.isFunction(c)?i.paramsSerializer={serialize:c}:He.assertOptions(c,{encode:re.function,serialize:re.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),He.assertOptions(i,{baseUrl:re.spelling("baseURL"),withXsrfToken:re.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let h=l&&d.merge(l.common,l[i.method]);l&&d.forEach(["delete","get","head","post","put","patch","common"],b=>{delete l[b]}),i.headers=K.concat(h,l);const p=[];let y=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(i)===!1||(y=y&&v.synchronous,p.unshift(v.fulfilled,v.rejected))});const w=[];this.interceptors.response.forEach(function(v){w.push(v.fulfilled,v.rejected)});let g,C=0,T;if(!y){const b=[ln.bind(this),void 0];for(b.unshift(...p),b.push(...w),T=b.length,g=Promise.resolve(i);C{if(!o._listeners)return;let l=o._listeners.length;for(;l-- >0;)o._listeners[l](c);o._listeners=null}),this.promise.then=c=>{let l;const h=new Promise(p=>{o.subscribe(p),l=p}).then(c);return h.cancel=function(){o.unsubscribe(l)},h},t(function(l,h,p){o.reason||(o.reason=new ye(l,h,p),i(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const i=this._listeners.indexOf(t);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const t=new AbortController,i=o=>{t.abort(o)};return this.subscribe(i),t.signal.unsubscribe=()=>this.unsubscribe(i),t.signal}static source(){let t;return{token:new Dn(function(c){t=c}),cancel:t}}};function wo(s){return function(i){return s.apply(null,i)}}function So(s){return d.isObject(s)&&s.isAxiosError===!0}const gt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(gt).forEach(([s,t])=>{gt[t]=s});function Fn(s){const t=new de(s),i=mn(de.prototype.request,t);return d.extend(i,de.prototype,t,{allOwnKeys:!0}),d.extend(i,t,null,{allOwnKeys:!0}),i.create=function(c){return Fn(fe(s,c))},i}const F=Fn(Re);F.Axios=de;F.CanceledError=ye;F.CancelToken=vo;F.isCancel=On;F.VERSION=Un;F.toFormData=We;F.AxiosError=A;F.Cancel=F.CanceledError;F.all=function(t){return Promise.all(t)};F.spread=wo;F.isAxiosError=So;F.mergeConfig=fe;F.AxiosHeaders=K;F.formToJSON=s=>Pn(d.isHTMLForm(s)?new FormData(s):s);F.getAdapter=jn.getAdapter;F.HttpStatusCode=gt;F.default=F;const{Axios:Fo,AxiosError:qo,CanceledError:Bo,isCancel:Ho,CancelToken:Mo,VERSION:zo,all:$o,Cancel:Jo,isAxiosError:Xo,spread:Wo,toFormData:Vo,AxiosHeaders:Ko,HttpStatusCode:Go,formToJSON:Qo,getAdapter:Yo,mergeConfig:Zo}=F;class St{constructor(){this.notificationCreatedEvent=".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated"}listenForWhisper(t,i){return this.listen(".client-"+t,i)}notification(t){return this.listen(this.notificationCreatedEvent,t)}stopListeningForNotification(t){return this.stopListening(this.notificationCreatedEvent,t)}stopListeningForWhisper(t,i){return this.stopListening(".client-"+t,i)}}class qn{constructor(t){this.namespace=t}format(t){return[".","\\"].includes(t.charAt(0))?t.substring(1):(this.namespace&&(t=this.namespace+"."+t),t.replace(/\./g,"\\"))}setNamespace(t){this.namespace=t}}function _o(s){try{new s}catch(t){if(t instanceof Error&&t.message.includes("is not a constructor"))return!1}return!0}class _t extends St{constructor(t,i,o){super(),this.name=i,this.pusher=t,this.options=o,this.eventFormatter=new qn(this.options.namespace),this.subscribe()}subscribe(){this.subscription=this.pusher.subscribe(this.name)}unsubscribe(){this.pusher.unsubscribe(this.name)}listen(t,i){return this.on(this.eventFormatter.format(t),i),this}listenToAll(t){return this.subscription.bind_global((i,o)=>{if(i.startsWith("pusher:"))return;let c=String(this.options.namespace??"").replace(/\./g,"\\"),l=i.startsWith(c)?i.substring(c.length+1):"."+i;t(l,o)}),this}stopListening(t,i){return i?this.subscription.unbind(this.eventFormatter.format(t),i):this.subscription.unbind(this.eventFormatter.format(t)),this}stopListeningToAll(t){return t?this.subscription.unbind_global(t):this.subscription.unbind_global(),this}subscribed(t){return this.on("pusher:subscription_succeeded",()=>{t()}),this}error(t){return this.on("pusher:subscription_error",i=>{t(i)}),this}on(t,i){return this.subscription.bind(t,i),this}}class Bn extends _t{whisper(t,i){return this.pusher.channels.channels[this.name].trigger(`client-${t}`,i),this}}class Co extends _t{whisper(t,i){return this.pusher.channels.channels[this.name].trigger(`client-${t}`,i),this}}class To extends Bn{here(t){return this.on("pusher:subscription_succeeded",i=>{t(Object.keys(i.members).map(o=>i.members[o]))}),this}joining(t){return this.on("pusher:member_added",i=>{t(i.info)}),this}whisper(t,i){return this.pusher.channels.channels[this.name].trigger(`client-${t}`,i),this}leaving(t){return this.on("pusher:member_removed",i=>{t(i.info)}),this}}class Hn extends St{constructor(t,i,o){super(),this.events={},this.listeners={},this.name=i,this.socket=t,this.options=o,this.eventFormatter=new qn(this.options.namespace),this.subscribe()}subscribe(){this.socket.emit("subscribe",{channel:this.name,auth:this.options.auth||{}})}unsubscribe(){this.unbind(),this.socket.emit("unsubscribe",{channel:this.name,auth:this.options.auth||{}})}listen(t,i){return this.on(this.eventFormatter.format(t),i),this}stopListening(t,i){return this.unbindEvent(this.eventFormatter.format(t),i),this}subscribed(t){return this.on("connect",i=>{t(i)}),this}error(t){return this}on(t,i){return this.listeners[t]=this.listeners[t]||[],this.events[t]||(this.events[t]=(o,c)=>{this.name===o&&this.listeners[t]&&this.listeners[t].forEach(l=>l(c))},this.socket.on(t,this.events[t])),this.listeners[t].push(i),this}unbind(){Object.keys(this.events).forEach(t=>{this.unbindEvent(t)})}unbindEvent(t,i){this.listeners[t]=this.listeners[t]||[],i&&(this.listeners[t]=this.listeners[t].filter(o=>o!==i)),(!i||this.listeners[t].length===0)&&(this.events[t]&&(this.socket.removeListener(t,this.events[t]),delete this.events[t]),delete this.listeners[t])}}class Mn extends Hn{whisper(t,i){return this.socket.emit("client event",{channel:this.name,event:`client-${t}`,data:i}),this}}class ko extends Mn{here(t){return this.on("presence:subscribed",i=>{t(i.map(o=>o.user_info))}),this}joining(t){return this.on("presence:joining",i=>t(i.user_info)),this}whisper(t,i){return this.socket.emit("client event",{channel:this.name,event:`client-${t}`,data:i}),this}leaving(t){return this.on("presence:leaving",i=>t(i.user_info)),this}}class ze extends St{subscribe(){}unsubscribe(){}listen(t,i){return this}listenToAll(t){return this}stopListening(t,i){return this}subscribed(t){return this}error(t){return this}on(t,i){return this}}class zn extends ze{whisper(t,i){return this}}class Eo extends ze{whisper(t,i){return this}}class xo extends zn{here(t){return this}joining(t){return this}whisper(t,i){return this}leaving(t){return this}}const $n=class Jn{constructor(t){this.setOptions(t),this.connect()}setOptions(t){this.options={...Jn._defaultOptions,...t,broadcaster:t.broadcaster};let i=this.csrfToken();i&&(this.options.auth.headers["X-CSRF-TOKEN"]=i,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=i),i=this.options.bearerToken,i&&(this.options.auth.headers.Authorization="Bearer "+i,this.options.userAuthentication.headers.Authorization="Bearer "+i)}csrfToken(){var t,i;return typeof window<"u"&&(t=window.Laravel)!=null&&t.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"?((i=document.querySelector('meta[name="csrf-token"]'))==null?void 0:i.getAttribute("content"))??null:null}};$n._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"};let Ct=$n;class Fe extends Ct{constructor(){super(...arguments),this.channels={}}connect(){if(typeof this.options.client<"u")this.pusher=this.options.client;else if(this.options.Pusher)this.pusher=new this.options.Pusher(this.options.key,this.options);else if(typeof window<"u"&&typeof window.Pusher<"u")this.pusher=new window.Pusher(this.options.key,this.options);else throw new Error("Pusher client not found. Should be globally available or passed via options.client")}signin(){this.pusher.signin()}listen(t,i,o){return this.channel(t).listen(i,o)}channel(t){return this.channels[t]||(this.channels[t]=new _t(this.pusher,t,this.options)),this.channels[t]}privateChannel(t){return this.channels["private-"+t]||(this.channels["private-"+t]=new Bn(this.pusher,"private-"+t,this.options)),this.channels["private-"+t]}encryptedPrivateChannel(t){return this.channels["private-encrypted-"+t]||(this.channels["private-encrypted-"+t]=new Co(this.pusher,"private-encrypted-"+t,this.options)),this.channels["private-encrypted-"+t]}presenceChannel(t){return this.channels["presence-"+t]||(this.channels["presence-"+t]=new To(this.pusher,"presence-"+t,this.options)),this.channels["presence-"+t]}leave(t){[t,"private-"+t,"private-encrypted-"+t,"presence-"+t].forEach(i=>{this.leaveChannel(i)})}leaveChannel(t){this.channels[t]&&(this.channels[t].unsubscribe(),delete this.channels[t])}socketId(){return this.pusher.connection.socket_id}connectionStatus(){const t=this.pusher.connection.state;switch(t){case"connected":case"connecting":return t;case"failed":case"unavailable":return"failed";default:return"disconnected"}}onConnectionChange(t){const i=()=>{t(this.connectionStatus())},o=["state_change","connected","disconnected"];return o.forEach(c=>{this.pusher.connection.bind(c,i)}),()=>{o.forEach(c=>{this.pusher.connection.unbind(c,i)})}}disconnect(){this.pusher.disconnect()}}class Ro extends Ct{constructor(){super(...arguments),this.channels={}}connect(){let t=this.getSocketIO();this.socket=t(this.options.host??void 0,this.options),this.socket.io.on("reconnect",()=>{Object.values(this.channels).forEach(i=>{i.subscribe()})})}getSocketIO(){if(typeof this.options.client<"u")return this.options.client;if(typeof window<"u"&&typeof window.io<"u")return window.io;throw new Error("Socket.io client not found. Should be globally available or passed via options.client")}listen(t,i,o){return this.channel(t).listen(i,o)}channel(t){return this.channels[t]||(this.channels[t]=new Hn(this.socket,t,this.options)),this.channels[t]}privateChannel(t){return this.channels["private-"+t]||(this.channels["private-"+t]=new Mn(this.socket,"private-"+t,this.options)),this.channels["private-"+t]}presenceChannel(t){return this.channels["presence-"+t]||(this.channels["presence-"+t]=new ko(this.socket,"presence-"+t,this.options)),this.channels["presence-"+t]}leave(t){[t,"private-"+t,"presence-"+t].forEach(i=>{this.leaveChannel(i)})}leaveChannel(t){this.channels[t]&&(this.channels[t].unsubscribe(),delete this.channels[t])}socketId(){return this.socket.id}connectionStatus(){return this.socket.connected?"connected":this.socket.io._reconnecting?"reconnecting":this.socket.id!==void 0?"disconnected":"connecting"}onConnectionChange(t){const i=()=>{t(this.connectionStatus())},o=["connect","disconnect","connect_error","reconnect_attempt","reconnect","reconnect_error","reconnect_failed"];return o.forEach(c=>{this.socket.on(c,i)}),()=>{o.forEach(c=>{this.socket.off(c,i)})}}disconnect(){this.socket.disconnect()}}class fn extends Ct{constructor(){super(...arguments),this.channels={}}connect(){}listen(t,i,o){return new ze}channel(t){return new ze}privateChannel(t){return new zn}encryptedPrivateChannel(t){return new Eo}presenceChannel(t){return new xo}leave(t){}leaveChannel(t){}socketId(){return"fake-socket-id"}connectionStatus(){return"connected"}onConnectionChange(t){return()=>{}}disconnect(){}}class Po{constructor(t){this.options=t,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()}channel(t){return this.connector.channel(t)}connect(){if(this.options.broadcaster==="reverb")this.connector=new Fe({...this.options,cluster:""});else if(this.options.broadcaster==="pusher")this.connector=new Fe(this.options);else if(this.options.broadcaster==="ably")this.connector=new Fe({...this.options,cluster:"",broadcaster:"pusher"});else if(this.options.broadcaster==="socket.io")this.connector=new Ro(this.options);else if(this.options.broadcaster==="null")this.connector=new fn(this.options);else if(typeof this.options.broadcaster=="function"&&_o(this.options.broadcaster))this.connector=new this.options.broadcaster(this.options);else throw new Error(`Broadcaster ${typeof this.options.broadcaster} ${String(this.options.broadcaster)} is not supported.`)}disconnect(){this.connector.disconnect()}join(t){return this.connector.presenceChannel(t)}leave(t){this.connector.leave(t)}leaveChannel(t){this.connector.leaveChannel(t)}leaveAllChannels(){for(const t in this.connector.channels)this.leaveChannel(t)}listen(t,i,o){return this.connector.listen(t,i,o)}private(t){return this.connector.privateChannel(t)}encryptedPrivate(t){if(this.connectorSupportsEncryptedPrivateChannels(this.connector))return this.connector.encryptedPrivateChannel(t);throw new Error(`Broadcaster ${typeof this.options.broadcaster} ${String(this.options.broadcaster)} does not support encrypted private channels.`)}connectorSupportsEncryptedPrivateChannels(t){return t instanceof Fe||t instanceof fn}socketId(){return this.connector.socketId()}connectionStatus(){return this.connector.connectionStatus()}registerInterceptors(){typeof Vue<"u"&&Vue!=null&&Vue.http&&this.registerVueRequestInterceptor(),typeof axios=="function"&&this.registerAxiosRequestInterceptor(),typeof jQuery=="function"&&this.registerjQueryAjaxSetup(),typeof Turbo=="object"&&this.registerTurboRequestInterceptor()}registerVueRequestInterceptor(){Vue.http.interceptors.push((t,i)=>{this.socketId()&&t.headers.set("X-Socket-ID",this.socketId()),i()})}registerAxiosRequestInterceptor(){axios.interceptors.request.use(t=>(this.socketId()&&(t.headers["X-Socket-Id"]=this.socketId()),t))}registerjQueryAjaxSetup(){typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter((t,i,o)=>{this.socketId()&&o.setRequestHeader("X-Socket-Id",this.socketId())})}registerTurboRequestInterceptor(){document.addEventListener("turbo:before-fetch-request",t=>{t.detail.fetchOptions.headers["X-Socket-Id"]=this.socketId()})}}function Oo(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var dt={exports:{}};var pn;function Ao(){return pn||(pn=1,(function(s,t){(function(o,c){s.exports=c()})(window,function(){return(function(i){var o={};function c(l){if(o[l])return o[l].exports;var h=o[l]={i:l,l:!1,exports:{}};return i[l].call(h.exports,h,h.exports,c),h.l=!0,h.exports}return c.m=i,c.c=o,c.d=function(l,h,p){c.o(l,h)||Object.defineProperty(l,h,{enumerable:!0,get:p})},c.r=function(l){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})},c.t=function(l,h){if(h&1&&(l=c(l)),h&8||h&4&&typeof l=="object"&&l&&l.__esModule)return l;var p=Object.create(null);if(c.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:l}),h&2&&typeof l!="string")for(var y in l)c.d(p,y,(function(w){return l[w]}).bind(null,y));return p},c.n=function(l){var h=l&&l.__esModule?function(){return l.default}:function(){return l};return c.d(h,"a",h),h},c.o=function(l,h){return Object.prototype.hasOwnProperty.call(l,h)},c.p="",c(c.s=2)})([(function(i,o,c){var l=this&&this.__extends||(function(){var v=function(f,S){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,R){E.__proto__=R}||function(E,R){for(var N in R)R.hasOwnProperty(N)&&(E[N]=R[N])},v(f,S)};return function(f,S){v(f,S);function E(){this.constructor=f}f.prototype=S===null?Object.create(S):(E.prototype=S.prototype,new E)}})();Object.defineProperty(o,"__esModule",{value:!0});var h=256,p=(function(){function v(f){f===void 0&&(f="="),this._paddingCharacter=f}return v.prototype.encodedLength=function(f){return this._paddingCharacter?(f+2)/3*4|0:(f*8+5)/6|0},v.prototype.encode=function(f){for(var S="",E=0;E>>18&63),S+=this._encodeByte(R>>>12&63),S+=this._encodeByte(R>>>6&63),S+=this._encodeByte(R>>>0&63)}var N=f.length-E;if(N>0){var R=f[E]<<16|(N===2?f[E+1]<<8:0);S+=this._encodeByte(R>>>18&63),S+=this._encodeByte(R>>>12&63),N===2?S+=this._encodeByte(R>>>6&63):S+=this._paddingCharacter||"",S+=this._paddingCharacter||""}return S},v.prototype.maxDecodedLength=function(f){return this._paddingCharacter?f/4*3|0:(f*6+7)/8|0},v.prototype.decodedLength=function(f){return this.maxDecodedLength(f.length-this._getPaddingLength(f))},v.prototype.decode=function(f){if(f.length===0)return new Uint8Array(0);for(var S=this._getPaddingLength(f),E=f.length-S,R=new Uint8Array(this.maxDecodedLength(E)),N=0,j=0,B=0,D=0,z=0,J=0,Q=0;j>>4,R[N++]=z<<4|J>>>2,R[N++]=J<<6|Q,B|=D&h,B|=z&h,B|=J&h,B|=Q&h;if(j>>4,B|=D&h,B|=z&h),j>>2,B|=J&h),j>>8&6,S+=51-f>>>8&-75,S+=61-f>>>8&-15,S+=62-f>>>8&3,String.fromCharCode(S)},v.prototype._decodeChar=function(f){var S=h;return S+=(42-f&f-44)>>>8&-h+f-43+62,S+=(46-f&f-48)>>>8&-h+f-47+63,S+=(47-f&f-58)>>>8&-h+f-48+52,S+=(64-f&f-91)>>>8&-h+f-65+0,S+=(96-f&f-123)>>>8&-h+f-97+26,S},v.prototype._getPaddingLength=function(f){var S=0;if(this._paddingCharacter){for(var E=f.length-1;E>=0&&f[E]===this._paddingCharacter;E--)S++;if(f.length<4||S>2)throw new Error("Base64Coder: incorrect padding")}return S},v})();o.Coder=p;var y=new p;function w(v){return y.encode(v)}o.encode=w;function g(v){return y.decode(v)}o.decode=g;var C=(function(v){l(f,v);function f(){return v!==null&&v.apply(this,arguments)||this}return f.prototype._encodeByte=function(S){var E=S;return E+=65,E+=25-S>>>8&6,E+=51-S>>>8&-75,E+=61-S>>>8&-13,E+=62-S>>>8&49,String.fromCharCode(E)},f.prototype._decodeChar=function(S){var E=h;return E+=(44-S&S-46)>>>8&-h+S-45+62,E+=(94-S&S-96)>>>8&-h+S-95+63,E+=(47-S&S-58)>>>8&-h+S-48+52,E+=(64-S&S-91)>>>8&-h+S-65+0,E+=(96-S&S-123)>>>8&-h+S-97+26,E},f})(p);o.URLSafeCoder=C;var T=new C;function x(v){return T.encode(v)}o.encodeURLSafe=x;function b(v){return T.decode(v)}o.decodeURLSafe=b,o.encodedLength=function(v){return y.encodedLength(v)},o.maxDecodedLength=function(v){return y.maxDecodedLength(v)},o.decodedLength=function(v){return y.decodedLength(v)}}),(function(i,o,c){Object.defineProperty(o,"__esModule",{value:!0});var l="utf8: invalid string",h="utf8: invalid source encoding";function p(g){for(var C=new Uint8Array(y(g)),T=0,x=0;x>6,C[T++]=128|b&63):b<55296?(C[T++]=224|b>>12,C[T++]=128|b>>6&63,C[T++]=128|b&63):(x++,b=(b&1023)<<10,b|=g.charCodeAt(x)&1023,b+=65536,C[T++]=240|b>>18,C[T++]=128|b>>12&63,C[T++]=128|b>>6&63,C[T++]=128|b&63)}return C}o.encode=p;function y(g){for(var C=0,T=0;T=g.length-1)throw new Error(l);T++,C+=4}else throw new Error(l)}return C}o.encodedLength=y;function w(g){for(var C=[],T=0;T=g.length)throw new Error(h);var v=g[++T];if((v&192)!==128)throw new Error(h);x=(x&31)<<6|v&63,b=128}else if(x<240){if(T>=g.length-1)throw new Error(h);var v=g[++T],f=g[++T];if((v&192)!==128||(f&192)!==128)throw new Error(h);x=(x&15)<<12|(v&63)<<6|f&63,b=2048}else if(x<248){if(T>=g.length-2)throw new Error(h);var v=g[++T],f=g[++T],S=g[++T];if((v&192)!==128||(f&192)!==128||(S&192)!==128)throw new Error(h);x=(x&15)<<18|(v&63)<<12|(f&63)<<6|S&63,b=65536}else throw new Error(h);if(x=55296&&x<=57343)throw new Error(h);if(x>=65536){if(x>1114111)throw new Error(h);x-=65536,C.push(String.fromCharCode(55296|x>>10)),x=56320|x&1023}}C.push(String.fromCharCode(x))}return C.join("")}o.decode=w}),(function(i,o,c){i.exports=c(3).default}),(function(i,o,c){c.r(o);class l{constructor(e,n){this.lastId=0,this.prefix=e,this.name=n}create(e){this.lastId++;var n=this.lastId,a=this.prefix+n,u=this.name+"["+n+"]",m=!1,_=function(){m||(e.apply(null,arguments),m=!0)};return this[n]=_,{number:n,id:a,name:u,callback:_}}remove(e){delete this[e.number]}}var h=new l("_pusher_script_","Pusher.ScriptReceivers"),p={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:""},y=p;class w{constructor(e){this.options=e,this.receivers=e.receivers||h,this.loading={}}load(e,n,a){var u=this;if(u.loading[e]&&u.loading[e].length>0)u.loading[e].push(a);else{u.loading[e]=[a];var m=O.createScriptRequest(u.getPath(e,n)),_=u.receivers.create(function(k){if(u.receivers.remove(_),u.loading[e]){var P=u.loading[e];delete u.loading[e];for(var L=function(q){q||m.cleanup()},I=0;I>>6)+Z(128|e&63):Z(224|e>>>12&15)+Z(128|e>>>6&63)+Z(128|e&63)},Oe=function(r){return r.replace(/[^\x00-\x7F]/g,se)},G=function(r){var e=[0,2,1][r.length%3],n=r.charCodeAt(0)<<16|(r.length>1?r.charCodeAt(1):0)<<8|(r.length>2?r.charCodeAt(2):0),a=[ee.charAt(n>>>18),ee.charAt(n>>>12&63),e>=2?"=":ee.charAt(n>>>6&63),e>=1?"=":ee.charAt(n&63)];return a.join("")},Ae=window.btoa||function(r){return r.replace(/[\s\S]{1,3}/g,G)};class te{constructor(e,n,a,u){this.clear=n,this.timer=e(()=>{this.timer&&(this.timer=u(this.timer))},a)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var ve=te;function Ke(r){window.clearTimeout(r)}function ne(r){window.clearInterval(r)}class X extends ve{constructor(e,n){super(setTimeout,Ke,e,function(a){return n(),null})}}class we extends ve{constructor(e,n){super(setInterval,ne,e,function(a){return n(),a})}}var pe={now(){return Date.now?Date.now():new Date().valueOf()},defer(r){return new X(0,r)},method(r,...e){var n=Array.prototype.slice.call(arguments,1);return function(a){return a[r].apply(a,n.concat(arguments))}}},H=pe;function W(r,...e){for(var n=0;n{window.console&&window.console.log&&window.console.log(e)}}debug(...e){this.log(this.globalLog,e)}warn(...e){this.log(this.globalLogWarn,e)}error(...e){this.log(this.globalLogError,e)}globalLogWarn(e){window.console&&window.console.warn?window.console.warn(e):this.globalLog(e)}globalLogError(e){window.console&&window.console.error?window.console.error(e):this.globalLogWarn(e)}log(e,...n){var a=Xn.apply(this,arguments);ot.log?ot.log(a):ot.logToConsole&&e.bind(this)(a)}}var U=new er,tr=function(r,e,n,a,u){(n.headers!==void 0||n.headersProvider!=null)&&U.warn(`To send headers with the ${a.toString()} request, you must use AJAX, rather than JSONP.`);var m=r.nextAuthCallbackID.toString();r.nextAuthCallbackID++;var _=r.getDocument(),k=_.createElement("script");r.auth_callbacks[m]=function(I){u(null,I)};var P="Pusher.auth_callbacks['"+m+"']";k.src=n.endpoint+"?callback="+encodeURIComponent(P)+"&"+e;var L=_.getElementsByTagName("head")[0]||_.documentElement;L.insertBefore(k,L.firstChild)},nr=tr;class rr{constructor(e){this.src=e}send(e){var n=this,a="Error loading "+n.src;n.script=document.createElement("script"),n.script.id=e.id,n.script.src=n.src,n.script.type="text/javascript",n.script.charset="UTF-8",n.script.addEventListener?(n.script.onerror=function(){e.callback(a)},n.script.onload=function(){e.callback(null)}):n.script.onreadystatechange=function(){(n.script.readyState==="loaded"||n.script.readyState==="complete")&&e.callback(null)},n.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(n.errorScript=document.createElement("script"),n.errorScript.id=e.id+"_error",n.errorScript.text=e.name+"('"+a+"');",n.script.async=n.errorScript.async=!1):n.script.async=!0;var u=document.getElementsByTagName("head")[0];u.insertBefore(n.script,u.firstChild),n.errorScript&&u.insertBefore(n.errorScript,n.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class sr{constructor(e,n){this.url=e,this.data=n}send(e){if(!this.request){var n=Yn(this.data),a=this.url+"/"+e.number+"?"+n;this.request=O.createScriptRequest(a),this.request.send(e)}}cleanup(){this.request&&this.request.cleanup()}}var ir=function(r,e){return function(n,a){var u="http"+(e?"s":"")+"://",m=u+(r.host||r.options.host)+r.options.path,_=O.createJSONPRequest(m,n),k=O.ScriptReceivers.create(function(P,L){h.remove(k),_.cleanup(),L&&L.host&&(r.host=L.host),a&&a(P,L)});_.send(k)}},or={name:"jsonp",getAgent:ir},ar=or;function Ge(r,e,n){var a=r+(e.useTLS?"s":""),u=e.useTLS?e.hostTLS:e.hostNonTLS;return a+"://"+u+n}function Qe(r,e){var n="/app/"+r,a="?protocol="+y.PROTOCOL+"&client=js&version="+y.VERSION+(e?"&"+e:"");return n+a}var cr={getInitial:function(r,e){var n=(e.httpPath||"")+Qe(r,"flash=false");return Ge("ws",e,n)}},ur={getInitial:function(r,e){var n=(e.httpPath||"/pusher")+Qe(r);return Ge("http",e,n)}},hr={getInitial:function(r,e){return Ge("http",e,e.httpPath||"/pusher")},getPath:function(r,e){return Qe(r)}};class lr{constructor(){this._callbacks={}}get(e){return this._callbacks[Ye(e)]}add(e,n,a){var u=Ye(e);this._callbacks[u]=this._callbacks[u]||[],this._callbacks[u].push({fn:n,context:a})}remove(e,n,a){if(!e&&!n&&!a){this._callbacks={};return}var u=e?[Ye(e)]:kt(this._callbacks);n||a?this.removeCallback(u,n,a):this.removeAllCallbacks(u)}removeCallback(e,n,a){Se(e,function(u){this._callbacks[u]=xt(this._callbacks[u]||[],function(m){return n&&n!==m.fn||a&&a!==m.context}),this._callbacks[u].length===0&&delete this._callbacks[u]},this)}removeAllCallbacks(e){Se(e,function(n){delete this._callbacks[n]},this)}}function Ye(r){return"_"+r}class oe{constructor(e){this.callbacks=new lr,this.global_callbacks=[],this.failThrough=e}bind(e,n,a){return this.callbacks.add(e,n,a),this}bind_global(e){return this.global_callbacks.push(e),this}unbind(e,n,a){return this.callbacks.remove(e,n,a),this}unbind_global(e){return e?(this.global_callbacks=xt(this.global_callbacks||[],n=>n!==e),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(e,n,a){for(var u=0;u0)for(var u=0;u{this.onError(n),this.changeState("closed")}),!1}return this.bindListeners(),U.debug("Connecting",{transport:this.name,url:e}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(e){return this.state==="open"?(H.defer(()=>{this.socket&&this.socket.send(e)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(e){this.emit("error",{type:"WebSocketError",error:e}),this.timeline.error(this.buildTimelineMessage({error:e.toString()}))}onClose(e){e?this.changeState("closed",{code:e.code,reason:e.reason,wasClean:e.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(e){this.emit("message",e)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=e=>{this.onError(e)},this.socket.onclose=e=>{this.onClose(e)},this.socket.onmessage=e=>{this.onMessage(e)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(e,n){this.state=e,this.timeline.info(this.buildTimelineMessage({state:e,params:n})),this.emit(e,n)}buildTimelineMessage(e){return W({cid:this.id},e)}}class me{constructor(e){this.hooks=e}isSupported(e){return this.hooks.isSupported(e)}createConnection(e,n,a,u){return new dr(this.hooks,e,n,a,u)}}var fr=new me({urls:cr,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!O.getWebSocketAPI()},isSupported:function(){return!!O.getWebSocketAPI()},getSocket:function(r){return O.createWebSocket(r)}}),Ot={urls:ur,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},At=W({getSocket:function(r){return O.HTTPFactory.createStreamingSocket(r)}},Ot),Lt=W({getSocket:function(r){return O.HTTPFactory.createPollingSocket(r)}},Ot),Nt={isSupported:function(){return O.isXHRSupported()}},pr=new me(W({},At,Nt)),mr=new me(W({},Lt,Nt)),gr={ws:fr,xhr_streaming:pr,xhr_polling:mr},Ne=gr,br=new me({file:"sockjs",urls:hr,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(r,e){return new window.SockJS(r,null,{js_path:C.getPath("sockjs",{useTLS:e.useTLS}),ignore_null_origin:e.ignoreNullOrigin})},beforeOpen:function(r,e){r.send(JSON.stringify({path:e}))}}),It={isSupported:function(r){var e=O.isXDRSupported(r.useTLS);return e}},yr=new me(W({},At,It)),vr=new me(W({},Lt,It));Ne.xdr_streaming=yr,Ne.xdr_polling=vr,Ne.sockjs=br;var wr=Ne;class Sr extends oe{constructor(){super();var e=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){e.emit("online")},!1),window.addEventListener("offline",function(){e.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var _r=new Sr;class Cr{constructor(e,n,a){this.manager=e,this.transport=n,this.minPingDelay=a.minPingDelay,this.maxPingDelay=a.maxPingDelay,this.pingDelay=void 0}createConnection(e,n,a,u){u=W({},u,{activityTimeout:this.pingDelay});var m=this.transport.createConnection(e,n,a,u),_=null,k=function(){m.unbind("open",k),m.bind("closed",P),_=H.now()},P=L=>{if(m.unbind("closed",P),L.code===1002||L.code===1003)this.manager.reportDeath();else if(!L.wasClean&&_){var I=H.now()-_;I<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(I/2,this.minPingDelay))}};return m.bind("open",k),m}isSupported(e){return this.manager.isAlive()&&this.transport.isSupported(e)}}const jt={decodeMessage:function(r){try{var e=JSON.parse(r.data),n=e.data;if(typeof n=="string")try{n=JSON.parse(e.data)}catch{}var a={event:e.event,channel:e.channel,data:n};return e.user_id&&(a.user_id=e.user_id),a}catch(u){throw{type:"MessageParseError",error:u,data:r.data}}},encodeMessage:function(r){return JSON.stringify(r)},processHandshake:function(r){var e=jt.decodeMessage(r);if(e.event==="pusher:connection_established"){if(!e.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:e.data.socket_id,activityTimeout:e.data.activity_timeout*1e3}}else{if(e.event==="pusher:error")return{action:this.getCloseAction(e.data),error:this.getCloseError(e.data)};throw"Invalid handshake"}},getCloseAction:function(r){return r.code<4e3?r.code>=1002&&r.code<=1004?"backoff":null:r.code===4e3?"tls_only":r.code<4100?"refused":r.code<4200?"backoff":r.code<4300?"retry":"refused"},getCloseError:function(r){return r.code!==1e3&&r.code!==1001?{type:"PusherError",data:{code:r.code,message:r.reason||r.message}}:null}};var ce=jt;class Tr extends oe{constructor(e,n){super(),this.id=e,this.transport=n,this.activityTimeout=n.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(e){return this.transport.send(e)}send_event(e,n,a){var u={event:e,data:n};return a&&(u.channel=a),U.debug("Event sent",u),this.send(ce.encodeMessage(u))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var e={message:a=>{var u;try{u=ce.decodeMessage(a)}catch(m){this.emit("error",{type:"MessageParseError",error:m,data:a.data})}if(u!==void 0){switch(U.debug("Event recd",u),u.event){case"pusher:error":this.emit("error",{type:"PusherError",data:u.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",u)}},activity:()=>{this.emit("activity")},error:a=>{this.emit("error",a)},closed:a=>{n(),a&&a.code&&this.handleCloseEvent(a),this.transport=null,this.emit("closed")}},n=()=>{ie(e,(a,u)=>{this.transport.unbind(u,a)})};ie(e,(a,u)=>{this.transport.bind(u,a)})}handleCloseEvent(e){var n=ce.getCloseAction(e),a=ce.getCloseError(e);a&&this.emit("error",a),n&&this.emit(n,{action:n,error:a})}}class kr{constructor(e,n){this.transport=e,this.callback=n,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=e=>{this.unbindListeners();var n;try{n=ce.processHandshake(e)}catch(a){this.finish("error",{error:a}),this.transport.close();return}n.action==="connected"?this.finish("connected",{connection:new Tr(n.id,this.transport),activityTimeout:n.activityTimeout}):(this.finish(n.action,{error:n.error}),this.transport.close())},this.onClosed=e=>{this.unbindListeners();var n=ce.getCloseAction(e)||"backoff",a=ce.getCloseError(e);this.finish(n,{error:a})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(e,n){this.callback(W({transport:this.transport,action:e},n))}}class Er{constructor(e,n){this.timeline=e,this.options=n||{}}send(e,n){this.timeline.isEmpty()||this.timeline.send(O.TimelineTransport.getAgent(this,e),n)}}class Ze extends oe{constructor(e,n){super(function(a,u){U.debug("No callbacks on "+e+" for "+a)}),this.name=e,this.pusher=n,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(e,n){return n(null,{auth:""})}trigger(e,n){if(e.indexOf("client-")!==0)throw new f("Event '"+e+"' does not start with 'client-'");if(!this.subscribed){var a=b.buildLogSuffix("triggeringClientEvents");U.warn(`Client event triggered before channel 'subscription_succeeded' event . ${a}`)}return this.pusher.send_event(e,n,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(e){var n=e.event,a=e.data;if(n==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(e);else if(n==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(e);else if(n.indexOf("pusher_internal:")!==0){var u={};this.emit(n,a,u)}}handleSubscriptionSucceededEvent(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",e.data)}handleSubscriptionCountEvent(e){e.data.subscription_count&&(this.subscriptionCount=e.data.subscription_count),this.emit("pusher:subscription_count",e.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(e,n)=>{e?(this.subscriptionPending=!1,U.error(e.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:e.message},e instanceof z?{status:e.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:n.auth,channel_data:n.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class et extends Ze{authorize(e,n){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:e},n)}}class xr{constructor(){this.reset()}get(e){return Object.prototype.hasOwnProperty.call(this.members,e)?{id:e,info:this.members[e]}:null}each(e){ie(this.members,(n,a)=>{e(this.get(a))})}setMyID(e){this.myID=e}onSubscription(e){this.members=e.presence.hash,this.count=e.presence.count,this.me=this.get(this.myID)}addMember(e){return this.get(e.user_id)===null&&this.count++,this.members[e.user_id]=e.user_info,this.get(e.user_id)}removeMember(e){var n=this.get(e.user_id);return n&&(delete this.members[e.user_id],this.count--),n}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var Rr=function(r,e,n,a){function u(m){return m instanceof n?m:new n(function(_){_(m)})}return new(n||(n=Promise))(function(m,_){function k(I){try{L(a.next(I))}catch(q){_(q)}}function P(I){try{L(a.throw(I))}catch(q){_(q)}}function L(I){I.done?m(I.value):u(I.value).then(k,P)}L((a=a.apply(r,e||[])).next())})};class Pr extends et{constructor(e,n){super(e,n),this.members=new xr}authorize(e,n){super.authorize(e,(a,u)=>Rr(this,void 0,void 0,function*(){if(!a)if(u=u,u.channel_data!=null){var m=JSON.parse(u.channel_data);this.members.setMyID(m.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let _=b.buildLogSuffix("authorizationEndpoint");U.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${_}, or the user should be signed in.`),n("Invalid auth response");return}n(a,u)}))}handleEvent(e){var n=e.event;if(n.indexOf("pusher_internal:")===0)this.handleInternalEvent(e);else{var a=e.data,u={};e.user_id&&(u.user_id=e.user_id),this.emit(n,a,u)}}handleInternalEvent(e){var n=e.event,a=e.data;switch(n){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(e);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(e);break;case"pusher_internal:member_added":var u=this.members.addMember(a);this.emit("pusher:member_added",u);break;case"pusher_internal:member_removed":var m=this.members.removeMember(a);m&&this.emit("pusher:member_removed",m);break}}handleSubscriptionSucceededEvent(e){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(e.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var Or=c(1),tt=c(0);class Ar extends et{constructor(e,n,a){super(e,n),this.key=null,this.nacl=a}authorize(e,n){super.authorize(e,(a,u)=>{if(a){n(a,u);return}let m=u.shared_secret;if(!m){n(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(tt.decode)(m),delete u.shared_secret,n(null,u)})}trigger(e,n){throw new j("Client events are not currently supported for encrypted channels")}handleEvent(e){var n=e.event,a=e.data;if(n.indexOf("pusher_internal:")===0||n.indexOf("pusher:")===0){super.handleEvent(e);return}this.handleEncryptedEvent(n,a)}handleEncryptedEvent(e,n){if(!this.key){U.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!n.ciphertext||!n.nonce){U.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+n);return}let a=Object(tt.decode)(n.ciphertext);if(a.length{if(_){U.error(`Failed to make a request to the authEndpoint: ${k}. Unable to fetch new key, so dropping encrypted event`);return}if(m=this.nacl.secretbox.open(a,u,this.key),m===null){U.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(e,this.getDataToEmit(m))});return}this.emit(e,this.getDataToEmit(m))}getDataToEmit(e){let n=Object(Or.decode)(e);try{return JSON.parse(n)}catch{return n}}}class Lr extends oe{constructor(e,n){super(),this.state="initialized",this.connection=null,this.key=e,this.options=n,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var a=O.getNetwork();a.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),a.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(e){return this.connection?this.connection.send(e):!1}send_event(e,n,a){return this.connection?this.connection.send_event(e,n,a):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var e=(n,a)=>{n?this.runner=this.strategy.connect(0,e):a.action==="error"?(this.emit("error",{type:"HandshakeError",error:a.error}),this.timeline.error({handshakeError:a.error})):(this.abortConnecting(),this.handshakeCallbacks[a.action](a))};this.runner=this.strategy.connect(0,e)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var e=this.abandonConnection();e.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(e){this.timeline.info({action:"retry",delay:e}),e>0&&this.emit("connecting_in",Math.round(e/1e3)),this.retryTimer=new X(e||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new X(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new X(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new X(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(e){return W({},e,{message:n=>{this.resetActivityCheck(),this.emit("message",n)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:n=>{this.emit("error",n)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(e){return W({},e,{connected:n=>{this.activityTimeout=Math.min(this.options.activityTimeout,n.activityTimeout,n.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(n.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let e=n=>a=>{a.error&&this.emit("error",{type:"WebSocketError",error:a.error}),n(a)};return{tls_only:e(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:e(()=>{this.disconnect()}),backoff:e(()=>{this.retryIn(1e3)}),retry:e(()=>{this.retryIn(0)})}}setConnection(e){this.connection=e;for(var n in this.connectionCallbacks)this.connection.bind(n,this.connectionCallbacks[n]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var e in this.connectionCallbacks)this.connection.unbind(e,this.connectionCallbacks[e]);var n=this.connection;return this.connection=null,n}}updateState(e,n){var a=this.state;if(this.state=e,a!==e){var u=e;u==="connected"&&(u+=" with new socket ID "+n.socket_id),U.debug("State changed",a+" -> "+u),this.timeline.info({state:e,params:n}),this.emit("state_change",{previous:a,current:e}),this.emit(e,n)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class Nr{constructor(){this.channels={}}add(e,n){return this.channels[e]||(this.channels[e]=Ir(e,n)),this.channels[e]}all(){return Wn(this.channels)}find(e){return this.channels[e]}remove(e){var n=this.channels[e];return delete this.channels[e],n}disconnect(){ie(this.channels,function(e){e.disconnect()})}}function Ir(r,e){if(r.indexOf("private-encrypted-")===0){if(e.config.nacl)return ae.createEncryptedChannel(r,e,e.config.nacl);let n="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",a=b.buildLogSuffix("encryptedChannelSupport");throw new j(`${n}. ${a}`)}else{if(r.indexOf("private-")===0)return ae.createPrivateChannel(r,e);if(r.indexOf("presence-")===0)return ae.createPresenceChannel(r,e);if(r.indexOf("#")===0)throw new S('Cannot create a channel with name "'+r+'".');return ae.createChannel(r,e)}}var jr={createChannels(){return new Nr},createConnectionManager(r,e){return new Lr(r,e)},createChannel(r,e){return new Ze(r,e)},createPrivateChannel(r,e){return new et(r,e)},createPresenceChannel(r,e){return new Pr(r,e)},createEncryptedChannel(r,e,n){return new Ar(r,e,n)},createTimelineSender(r,e){return new Er(r,e)},createHandshake(r,e){return new kr(r,e)},createAssistantToTheTransportManager(r,e,n){return new Cr(r,e,n)}},ae=jr;class Ut{constructor(e){this.options=e||{},this.livesLeft=this.options.lives||1/0}getAssistant(e){return ae.createAssistantToTheTransportManager(this,e,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class ue{constructor(e,n){this.strategies=e,this.loop=!!n.loop,this.failFast=!!n.failFast,this.timeout=n.timeout,this.timeoutLimit=n.timeoutLimit}isSupported(){return Pt(this.strategies,H.method("isSupported"))}connect(e,n){var a=this.strategies,u=0,m=this.timeout,_=null,k=(P,L)=>{L?n(null,L):(u=u+1,this.loop&&(u=u%a.length),u0&&(m=new X(a.timeout,function(){_.abort(),u(!0)})),_=e.connect(n,function(k,P){k&&m&&m.isRunning()&&!a.failFast||(m&&m.ensureAborted(),u(k,P))}),{abort:function(){m&&m.ensureAborted(),_.abort()},forceMinPriority:function(k){_.forceMinPriority(k)}}}}class nt{constructor(e){this.strategies=e}isSupported(){return Pt(this.strategies,H.method("isSupported"))}connect(e,n){return Ur(this.strategies,e,function(a,u){return function(m,_){if(u[a].error=m,m){Dr(u)&&n(!0);return}Se(u,function(k){k.forceMinPriority(_.transport.priority)}),n(null,_)}})}}function Ur(r,e,n){var a=Et(r,function(u,m,_,k){return u.connect(e,n(m,k))});return{abort:function(){Se(a,Fr)},forceMinPriority:function(u){Se(a,function(m){m.forceMinPriority(u)})}}}function Dr(r){return Gn(r,function(e){return!!e.error})}function Fr(r){!r.error&&!r.aborted&&(r.abort(),r.aborted=!0)}class qr{constructor(e,n,a){this.strategy=e,this.transports=n,this.ttl=a.ttl||1800*1e3,this.usingTLS=a.useTLS,this.timeline=a.timeline}isSupported(){return this.strategy.isSupported()}connect(e,n){var a=this.usingTLS,u=Br(a),m=u&&u.cacheSkipCount?u.cacheSkipCount:0,_=[this.strategy];if(u&&u.timestamp+this.ttl>=H.now()){var k=this.transports[u.transport];k&&(["ws","wss"].includes(u.transport)||m>3?(this.timeline.info({cached:!0,transport:u.transport,latency:u.latency}),_.push(new ue([k],{timeout:u.latency*2+1e3,failFast:!0}))):m++)}var P=H.now(),L=_.pop().connect(e,function I(q,Ue){q?(Dt(a),_.length>0?(P=H.now(),L=_.pop().connect(e,I)):n(q)):(Hr(a,Ue.transport.name,H.now()-P,m),n(null,Ue))});return{abort:function(){L.abort()},forceMinPriority:function(I){e=I,L&&L.forceMinPriority(I)}}}}function rt(r){return"pusherTransport"+(r?"TLS":"NonTLS")}function Br(r){var e=O.getLocalStorage();if(e)try{var n=e[rt(r)];if(n)return JSON.parse(n)}catch{Dt(r)}return null}function Hr(r,e,n,a){var u=O.getLocalStorage();if(u)try{u[rt(r)]=Le({timestamp:H.now(),transport:e,latency:n,cacheSkipCount:a})}catch{}}function Dt(r){var e=O.getLocalStorage();if(e)try{delete e[rt(r)]}catch{}}class Ie{constructor(e,{delay:n}){this.strategy=e,this.options={delay:n}}isSupported(){return this.strategy.isSupported()}connect(e,n){var a=this.strategy,u,m=new X(this.options.delay,function(){u=a.connect(e,n)});return{abort:function(){m.ensureAborted(),u&&u.abort()},forceMinPriority:function(_){e=_,u&&u.forceMinPriority(_)}}}}class _e{constructor(e,n,a){this.test=e,this.trueBranch=n,this.falseBranch=a}isSupported(){var e=this.test()?this.trueBranch:this.falseBranch;return e.isSupported()}connect(e,n){var a=this.test()?this.trueBranch:this.falseBranch;return a.connect(e,n)}}class Mr{constructor(e){this.strategy=e}isSupported(){return this.strategy.isSupported()}connect(e,n){var a=this.strategy.connect(e,function(u,m){m&&a.abort(),n(u,m)});return a}}function Ce(r){return function(){return r.isSupported()}}var zr=function(r,e,n){var a={};function u(Vt,Ms,zs,$s,Js){var Kt=n(r,Vt,Ms,zs,$s,Js);return a[Vt]=Kt,Kt}var m=Object.assign({},e,{hostNonTLS:r.wsHost+":"+r.wsPort,hostTLS:r.wsHost+":"+r.wssPort,httpPath:r.wsPath}),_=Object.assign({},m,{useTLS:!0}),k=Object.assign({},e,{hostNonTLS:r.httpHost+":"+r.httpPort,hostTLS:r.httpHost+":"+r.httpsPort,httpPath:r.httpPath}),P={loop:!0,timeout:15e3,timeoutLimit:6e4},L=new Ut({minPingDelay:1e4,maxPingDelay:r.activityTimeout}),I=new Ut({lives:2,minPingDelay:1e4,maxPingDelay:r.activityTimeout}),q=u("ws","ws",3,m,L),Ue=u("wss","ws",3,_,L),Ds=u("sockjs","sockjs",1,k),Mt=u("xhr_streaming","xhr_streaming",1,k,I),Fs=u("xdr_streaming","xdr_streaming",1,k,I),zt=u("xhr_polling","xhr_polling",1,k),qs=u("xdr_polling","xdr_polling",1,k),$t=new ue([q],P),Bs=new ue([Ue],P),Hs=new ue([Ds],P),Jt=new ue([new _e(Ce(Mt),Mt,Fs)],P),Xt=new ue([new _e(Ce(zt),zt,qs)],P),Wt=new ue([new _e(Ce(Jt),new nt([Jt,new Ie(Xt,{delay:4e3})]),Xt)],P),at=new _e(Ce(Wt),Wt,Hs),ct;return e.useTLS?ct=new nt([$t,new Ie(at,{delay:2e3})]):ct=new nt([$t,new Ie(Bs,{delay:2e3}),new Ie(at,{delay:5e3})]),new qr(new Mr(new _e(Ce(q),ct,at)),a,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})},$r=zr,Jr=(function(){var r=this;r.timeline.info(r.buildTimelineMessage({transport:r.name+(r.options.useTLS?"s":"")})),r.hooks.isInitialized()?r.changeState("initialized"):r.hooks.file?(r.changeState("initializing"),C.load(r.hooks.file,{useTLS:r.options.useTLS},function(e,n){r.hooks.isInitialized()?(r.changeState("initialized"),n(!0)):(e&&r.onError(e),r.onClose(),n(!1))})):r.onClose()}),Xr={getRequest:function(r){var e=new window.XDomainRequest;return e.ontimeout=function(){r.emit("error",new E),r.close()},e.onerror=function(n){r.emit("error",n),r.close()},e.onprogress=function(){e.responseText&&e.responseText.length>0&&r.onChunk(200,e.responseText)},e.onload=function(){e.responseText&&e.responseText.length>0&&r.onChunk(200,e.responseText),r.emit("finished",200),r.close()},e},abortRequest:function(r){r.ontimeout=r.onerror=r.onprogress=r.onload=null,r.abort()}},Wr=Xr;const Vr=256*1024;class Kr extends oe{constructor(e,n,a){super(),this.hooks=e,this.method=n,this.url=a}start(e){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},O.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(e)}close(){this.unloader&&(O.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(e,n){for(;;){var a=this.advanceBuffer(n);if(a)this.emit("chunk",{status:e,data:a});else break}this.isBufferTooLong(n)&&this.emit("buffer_too_long")}advanceBuffer(e){var n=e.slice(this.position),a=n.indexOf(` `);return a!==-1?(this.position+=a+1,n.slice(0,a)):null}isBufferTooLong(e){return this.position===e.length&&e.length>Vr}}var st;(function(r){r[r.CONNECTING=0]="CONNECTING",r[r.OPEN=1]="OPEN",r[r.CLOSED=3]="CLOSED"})(st||(st={}));var he=st,Gr=1;class Qr{constructor(e,n){this.hooks=e,this.session=qt(1e3)+"/"+ts(8),this.location=Yr(n),this.readyState=he.CONNECTING,this.openStream()}send(e){return this.sendRaw(JSON.stringify([e]))}ping(){this.hooks.sendHeartbeat(this)}close(e,n){this.onClose(e,n,!0)}sendRaw(e){if(this.readyState===he.OPEN)try{return O.createSocketRequest("POST",Ft(Zr(this.location,this.session))).start(e),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(e,n,a){this.closeStream(),this.readyState=he.CLOSED,this.onclose&&this.onclose({code:e,reason:n,wasClean:a})}onChunk(e){if(e.status===200){this.readyState===he.OPEN&&this.onActivity();var n,a=e.data.slice(0,1);switch(a){case"o":n=JSON.parse(e.data.slice(1)||"{}"),this.onOpen(n);break;case"a":n=JSON.parse(e.data.slice(1)||"[]");for(var u=0;u{this.onChunk(e)}),this.stream.bind("finished",e=>{this.hooks.onFinished(this,e)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(e){H.defer(()=>{this.onError(e),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function Yr(r){var e=/([^\?]*)\/*(\??.*)/.exec(r);return{base:e[1],queryString:e[2]}}function Zr(r,e){return r.base+"/"+e+"/xhr_send"}function Ft(r){var e=r.indexOf("?")===-1?"?":"&";return r+e+"t="+ +new Date+"&n="+Gr++}function es(r,e){var n=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(r);return n[1]+e+n[3]}function qt(r){return O.randomInt(r)}function ts(r){for(var e=[],n=0;n0&&r.onChunk(n.status,n.responseText);break;case 4:n.responseText&&n.responseText.length>0&&r.onChunk(n.status,n.responseText),r.emit("finished",n.status),r.close();break}},n},abortRequest:function(r){r.onreadystatechange=null,r.abort()}},cs=as,us={createStreamingSocket(r){return this.createSocket(ss,r)},createPollingSocket(r){return this.createSocket(os,r)},createSocket(r,e){return new ns(r,e)},createXHR(r,e){return this.createRequest(cs,r,e)},createRequest(r,e,n){return new Kr(r,e,n)}},Bt=us;Bt.createXDR=function(r,e){return this.createRequest(Wr,r,e)};var hs=Bt,ls={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:h,DependenciesReceivers:g,getDefaultStrategy:$r,Transports:wr,transportConnectionInitializer:Jr,HTTPFactory:hs,TimelineTransport:ar,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(r){window.Pusher=r;var e=()=>{this.onDocumentBody(r.ready)};window.JSON?e():C.load("json2",{},e)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:Q,jsonp:nr}},onDocumentBody(r){document.body?r():setTimeout(()=>{this.onDocumentBody(r)},0)},createJSONPRequest(r,e){return new sr(r,e)},createScriptRequest(r){return new rr(r)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var r=this.getXHRAPI();return new r},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return _r},createWebSocket(r){var e=this.getWebSocketAPI();return new e(r)},createSocketRequest(r,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(r,e);if(this.isXDRSupported(e.indexOf("https:")===0))return this.HTTPFactory.createXDR(r,e);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var r=this.getXHRAPI();return!!r&&new r().withCredentials!==void 0},isXDRSupported(r){var e=r?"https:":"http:",n=this.getProtocol();return!!window.XDomainRequest&&n===e},addUnloadListener(r){window.addEventListener!==void 0?window.addEventListener("unload",r,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",r)},removeUnloadListener(r){window.addEventListener!==void 0?window.removeEventListener("unload",r,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",r)},randomInt(r){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*r)}},O=ls,it;(function(r){r[r.ERROR=3]="ERROR",r[r.INFO=6]="INFO",r[r.DEBUG=7]="DEBUG"})(it||(it={}));var je=it;class ds{constructor(e,n,a){this.key=e,this.session=n,this.events=[],this.options=a||{},this.sent=0,this.uniqueID=0}log(e,n){e<=this.options.level&&(this.events.push(W({},n,{timestamp:H.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(e){this.log(je.ERROR,e)}info(e){this.log(je.INFO,e)}debug(e){this.log(je.DEBUG,e)}isEmpty(){return this.events.length===0}send(e,n){var a=W({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],e(a,(u,m)=>{u||this.sent++,n&&n(u,m)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class fs{constructor(e,n,a,u){this.name=e,this.priority=n,this.transport=a,this.options=u||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(e,n){if(this.isSupported()){if(this.priority{a||(I(),m?m.close():u.close())},forceMinPriority:q=>{a||this.priority{var n="socket_id="+encodeURIComponent(r.socketId);for(var a in e.params)n+="&"+encodeURIComponent(a)+"="+encodeURIComponent(e.params[a]);if(e.paramsProvider!=null){let u=e.paramsProvider();for(var a in u)n+="&"+encodeURIComponent(a)+"="+encodeURIComponent(u[a])}return n};var vs=r=>{if(typeof O.getAuthorizers()[r.transport]>"u")throw`'${r.transport}' is not a recognized auth transport`;return(e,n)=>{const a=ys(e,r);O.getAuthorizers()[r.transport](O,a,r,v.UserAuthentication,n)}};const ws=(r,e)=>{var n="socket_id="+encodeURIComponent(r.socketId);n+="&channel_name="+encodeURIComponent(r.channelName);for(var a in e.params)n+="&"+encodeURIComponent(a)+"="+encodeURIComponent(e.params[a]);if(e.paramsProvider!=null){let u=e.paramsProvider();for(var a in u)n+="&"+encodeURIComponent(a)+"="+encodeURIComponent(u[a])}return n};var Ss=r=>{if(typeof O.getAuthorizers()[r.transport]>"u")throw`'${r.transport}' is not a recognized auth transport`;return(e,n)=>{const a=ws(e,r);O.getAuthorizers()[r.transport](O,a,r,v.ChannelAuthorization,n)}};const _s=(r,e,n)=>{const a={authTransport:e.transport,authEndpoint:e.endpoint,auth:{params:e.params,headers:e.headers}};return(u,m)=>{const _=r.channel(u.channelName);n(_,a).authorize(u.socketId,m)}};function Cs(r,e){let n={activityTimeout:r.activityTimeout||y.activityTimeout,cluster:r.cluster,httpPath:r.httpPath||y.httpPath,httpPort:r.httpPort||y.httpPort,httpsPort:r.httpsPort||y.httpsPort,pongTimeout:r.pongTimeout||y.pongTimeout,statsHost:r.statsHost||y.stats_host,unavailableTimeout:r.unavailableTimeout||y.unavailableTimeout,wsPath:r.wsPath||y.wsPath,wsPort:r.wsPort||y.wsPort,wssPort:r.wssPort||y.wssPort,enableStats:Rs(r),httpHost:Ts(r),useTLS:xs(r),wsHost:ks(r),userAuthenticator:Ps(r),channelAuthorizer:As(r,e)};return"disabledTransports"in r&&(n.disabledTransports=r.disabledTransports),"enabledTransports"in r&&(n.enabledTransports=r.enabledTransports),"ignoreNullOrigin"in r&&(n.ignoreNullOrigin=r.ignoreNullOrigin),"timelineParams"in r&&(n.timelineParams=r.timelineParams),"nacl"in r&&(n.nacl=r.nacl),n}function Ts(r){return r.httpHost?r.httpHost:r.cluster?`sockjs-${r.cluster}.pusher.com`:y.httpHost}function ks(r){return r.wsHost?r.wsHost:Es(r.cluster)}function Es(r){return`ws-${r}.pusher.com`}function xs(r){return O.getProtocol()==="https:"?!0:r.forceTLS!==!1}function Rs(r){return"enableStats"in r?r.enableStats:"disableStats"in r?!r.disableStats:!1}function Ps(r){const e=Object.assign(Object.assign({},y.userAuthentication),r.userAuthentication);return"customHandler"in e&&e.customHandler!=null?e.customHandler:vs(e)}function Os(r,e){let n;return"channelAuthorization"in r?n=Object.assign(Object.assign({},y.channelAuthorization),r.channelAuthorization):(n={transport:r.authTransport||y.authTransport,endpoint:r.authEndpoint||y.authEndpoint},"auth"in r&&("params"in r.auth&&(n.params=r.auth.params),"headers"in r.auth&&(n.headers=r.auth.headers)),"authorizer"in r&&(n.customHandler=_s(e,n,r.authorizer))),n}function As(r,e){const n=Os(r,e);return"customHandler"in n&&n.customHandler!=null?n.customHandler:Ss(n)}class Ls extends oe{constructor(e){super(function(n,a){U.debug(`No callbacks on watchlist events for ${n}`)}),this.pusher=e,this.bindWatchlistInternalEvent()}handleEvent(e){e.data.events.forEach(n=>{this.emit(n.name,n)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",e=>{var n=e.event;n==="pusher_internal:watchlist_events"&&this.handleEvent(e)})}}function Ns(){let r,e;return{promise:new Promise((a,u)=>{r=a,e=u}),resolve:r,reject:e}}var Is=Ns;class js extends oe{constructor(e){super(function(n,a){U.debug("No callbacks on user for "+n)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(n,a)=>{if(n){U.warn(`Error during signin: ${n}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:a.auth,user_data:a.user_data})},this.pusher=e,this.pusher.connection.bind("state_change",({previous:n,current:a})=>{n!=="connected"&&a==="connected"&&this._signin(),n==="connected"&&a!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new Ls(e),this.pusher.connection.bind("message",n=>{var a=n.event;a==="pusher:signin_success"&&this._onSigninSuccess(n.data),this.serverToUserChannel&&this.serverToUserChannel.name===n.channel&&this.serverToUserChannel.handleEvent(n)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(e){try{this.user_data=JSON.parse(e.user_data)}catch{U.error(`Failed parsing user data after signin: ${e.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){U.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const e=n=>{n.subscriptionPending&&n.subscriptionCancelled?n.reinstateSubscription():!n.subscriptionPending&&this.pusher.connection.state==="connected"&&n.subscribe()};this.serverToUserChannel=new Ze(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((n,a)=>{n.indexOf("pusher_internal:")===0||n.indexOf("pusher:")===0||this.emit(n,a)}),e(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:e,resolve:n}=Is();e.done=!1;const a=()=>{e.done=!0};e.then(a).catch(a),this.signinDonePromise=e,this._signinDoneResolve=n}}class M{static ready(){M.isReady=!0;for(var e=0,n=M.instances.length;eO.getDefaultStrategy(this.config,u,ms);this.connection=ae.createConnectionManager(this.key,{getStrategy:a,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",u=>{var m=u.event,_=m.indexOf("pusher_internal:")===0;if(u.channel){var k=this.channel(u.channel);k&&k.handleEvent(u)}_||this.global_emitter.emit(u.event,u.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",u=>{U.warn(u)}),M.instances.push(this),this.timeline.info({instances:M.instances.length}),this.user=new js(this),M.isReady&&this.connect()}channel(e){return this.channels.find(e)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var e=this.connection.isUsingTLS(),n=this.timelineSender;this.timelineSenderTimer=new we(6e4,function(){n.send(e)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(e,n,a){return this.global_emitter.bind(e,n,a),this}unbind(e,n,a){return this.global_emitter.unbind(e,n,a),this}bind_global(e){return this.global_emitter.bind_global(e),this}unbind_global(e){return this.global_emitter.unbind_global(e),this}unbind_all(e){return this.global_emitter.unbind_all(),this}subscribeAll(){var e;for(e in this.channels.channels)this.channels.channels.hasOwnProperty(e)&&this.subscribe(e)}subscribe(e){var n=this.channels.add(e,this);return n.subscriptionPending&&n.subscriptionCancelled?n.reinstateSubscription():!n.subscriptionPending&&this.connection.state==="connected"&&n.subscribe(),n}unsubscribe(e){var n=this.channels.find(e);n&&n.subscriptionPending?n.cancelSubscription():(n=this.channels.remove(e),n&&n.subscribed&&n.unsubscribe())}send_event(e,n,a){return this.connection.send_event(e,n,a)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}M.instances=[],M.isReady=!1,M.logToConsole=!1,M.Runtime=O,M.ScriptReceivers=O.ScriptReceivers,M.DependenciesReceivers=O.DependenciesReceivers,M.auth_callbacks=O.auth_callbacks;var ot=o.default=M;function Us(r){if(r==null)throw"You must pass your app key when you instantiate Pusher."}O.setup(M)})])})})(dt)),dt.exports}var Lo=Ao();const No=Oo(Lo);window.Pusher=No;window.Echo=new Po({broadcaster:"reverb",key:void 0,wsHost:void 0,wsPort:80,wssPort:443,forceTLS:!0,enabledTransports:["ws","wss"]});window.axios=F;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";