PageSourceSearch

https://smartcomm.ai/build/assets/app-DnElPafO.js

js smartcomm.ai collected 2026-10-05 15:05:42 UTC 268,011 bytes, 16 lines download raw bytes

vendor: 13,052 bytes, lines 1-3
1const Pl="modulepreload",Il=function(e){return"/build/"+e},qi={},Ds=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let g=function(m){return Promise.all(m.map(c=>Promise.resolve(c).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};var o=g;document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),d=h?.nonce||h?.getAttribute("nonce");i=g(n.map(m=>{if(m=Il(m),m in qi)return;qi[m]=!0;const c=m.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${f}`))return;const b=document.createElement("link");if(b.rel=c?"stylesheet":Pl,c||(b.as="script"),b.crossOrigin="",b.href=m,d&&b.setAttribute("nonce",d),document.head.appendChild(b),c)return new Promise((y,_)=>{b.addEventListener("load",y),b.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${m}`)))})}))}function s(h){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=h,window.dispatchEvent(d),!d.defaultPrevented)throw h}return i.then(h=>{for(const d of h||[])d.status==="rejected"&&s(d.reason);return t().catch(s)})};function Fs(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ll}=Object.prototype,{getPrototypeOf:gt}=Object,{iterator:Jt,toStringTag:Ms}=Symbol,_n=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Bt=(e,t)=>{let n=e;const r=[];for(;n!=null&&n!==Object.prototype;){if(r.indexOf(n)!==-1)return!1;if(r.push(n),_n(n,t))return!0;n=gt(n)}return!1},Nl=(e,t)=>e!=null&&Bt(e,t)?e[t]:void 0,Br=(e=>t=>{const n=Ll.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ce=e=>(e=e.toLowerCase(),t=>Br(t)===e),Mn=e=>t=>typeof t===e,{isArray:nt}=Array,bt=Mn("undefined");function yt(e){return e!==null&&!bt(e)&&e.constructor!==null&&!bt(e.constructor)&&we(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $s=Ce("ArrayBuffer");function jl(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$s(e.buffer),t}const Dl=Mn("string"),we=Mn("function"),Us=Mn("number"),wt=e=>e!==null&&typeof e=="object",Fl=e=>e===!0||e===!1,gn=e=>{if(!wt(e))return!1;const t=gt(e);return(t===null||t===Object.prototype||gt(t)===null)&&!Bt(e,Ms)&&!Bt(e,Jt)},Ml=e=>{if(!wt(e)||yt(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},$l=Ce("Date"),Ul=Ce("File"),Bl=e=>!!(e&&typeof e.uri<"u"),ql=e=>e&&typeof e.getParts<"u",Hl=Ce("Blob"),zl=Ce("FileList"),Wl=e=>wt(e)&&we(e.pipe);function Kl(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Hi=Kl(),zi=typeof Hi.FormData<"u"?Hi.FormData:void 0,Jl=e=>{if(!e)return!1;if(zi&&e instanceof zi)return!0;const t=gt(e);if(!t||t===Object.prototype||!we(e.append))return!1;const n=Br(e);return n==="formdata"||n==="object"&&we(e.toString)&&e.toString()==="[object FormData]"},Xl=Ce("URLSearchParams"),[Gl,Vl,Yl,Ql]=["ReadableStream","Request","Response","Headers"].map(Ce),Zl=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Xt(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),nt(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(yt(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let h;for(r=0;r<o;r++)h=s[r],t.call(null,e[h],h,e)}}function Bs(e,t){if(yt(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Ge=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,qs=e=>!bt(e)&&e!==Ge;function vr(...e){const{caseless:t,skipUndefined:n}=qs(this)&&this||{},r={},i=(s,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;const h=t&&typeof o=="string"&&Bs(r,o)||o,d=_n(r,h)?r[h]:void 0;gn(d)&&gn(s)?r[h]=vr(d,s):gn(s)?r[h]=vr({},s):nt(s)?r[h]=s.slice():(!n||!bt(s))&&(r[h]=s)};for(let s=0,o=e.length;s<o;s++){const h=e[s];if(!h||yt(h)||(Xt(h,i),typeof h!="object"||nt(h)))continue;const d=Object.getOwnPropertySymbols(h);for(let g=0;g<d.length;g++){const m=d[g];hu.call(h,m)&&i(h[m],m)}}return r}const eu=(e,t,n,{allOwnKeys:r}={})=>(Xt(t,(i,s)=>{n&&we(i)?Object.defineProperty(e,s,{__proto__:null,value:Fs(i,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{__proto__:null,value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),tu=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),nu=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},ru=(e,t,n,r)=>{let i,s,o;const h={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!r||r(o,e,t))&&!h[o]&&(t[o]=e[o],h[o]=!0);e=n!==!1&&gt(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},iu=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},su=e=>{if(!e)return null;if(nt(e))return e;let t=e.length;if(!Us(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},ou=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&gt(Uint8Array)),au=(e,t)=>{const r=(e&&e[Jt]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},cu=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},lu=Ce("HTMLFormElement"),uu=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),{propertyIsEnumerable:hu}=Object.prototype,du=Ce("RegExp"),Hs=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Xt(n,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(r[s]=o||i)}),Object.defineProperties(e,r)},fu=e=>{Hs(e,(t,n)=>{if(we(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];if(we(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},pu=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return nt(e)?r(e):r(String(e).split(t)),n},mu=()=>{},gu=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function bu(e){return!!(e&&we(e.append)&&e[Ms]==="FormData"&&e[Jt])}const vu=e=>{const t=new WeakSet,n=r=>{if(wt(r)){if(t.has(r))return;if(yt(r))return r;if(!("toJSON"in r)){t.add(r);const i=nt(r)?[]:{};return Xt(r,(s,o)=>{const h=n(s);!bt(h)&&(i[o]=h)}),t.delete(r),i}}return r};return n(e)},yu=Ce("AsyncFunction"),wu=e=>e&&(wt(e)||we(e))&&we(e.then)&&we(e.catch),zs=((e,t)=>e?setImmediate:t?((n,r)=>(Ge.addEventListener("message",({source:i,data:s})=>{i===Ge&&s===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Ge.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",we(Ge.postMessage)),_u=typeof queueMicrotask<"u"?queueMicrotask.bind(Ge):typeof process<"u"&&process.nextTick||zs,Ws=e=>e!=null&&we(e[Jt]),Su=e=>e!=null&&Bt(e,Jt)&&Ws(e),w={isArray:nt,isArrayBuffer:$s,isBuffer:yt,isFormData:Jl,isArrayBufferView:jl,isString:Dl,isNumber:Us,isBoolean:Fl,isObject:wt,isPlainObject:gn,isEmptyObject:Ml,isReadableStream:Gl,isRequest:Vl,isResponse:Yl,isHeaders:Ql,isUndefined:bt,isDate:$l,isFile:Ul,isReactNativeBlob:Bl,isReactNative:ql,isBlob:Hl,isRegExp:du,isFunction:we,isStream:Wl,isURLSearchParams:Xl,isTypedArray:ou,isFileList:zl,forEach:Xt,merge:vr,extend:eu,trim:Zl,stripBOM:tu,inherits:nu,toFlatObject:ru,kindOf:Br,kindOfTest:Ce,endsWith:iu,toArray:su,forEachEntry:au,matchAll:cu,isHTMLForm:lu,hasOwnProperty:_n,hasOwnProp:_n,hasOwnInPrototypeChain:Bt,getSafeProp:Nl,reduceDescriptors:Hs,freezeMethods:fu,toObjectSet:pu,toCamelCase:uu,noop:mu,toFiniteNumber:gu,findKey:Bs,global:Ge,isContextDefined:qs,isSpecCompliantForm:bu,toJSONObject:vu,isAsyncFn:yu,isThenable:wu,setImmediate:zs,asap:_u,isIterable:Ws,isSafeIterable:Su},Tu=w.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"]),Eu=e=>{const t={};let n,r,i;return e&&e.split(`
2`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&Tu[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t};function xu(e){let t=0,n=e.length;for(;t<n;){const r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}for(;n>t;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}const Cu=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),ku=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function qr(e,t){return w.isArray(e)?e.map(n=>qr(n,t)):xu(String(e).replace(t,""))}const Ou=e=>qr(e,Cu),Au=e=>qr(e,ku);function Ks(e){const t=Object.create(null);return w.forEach(e.toJSON(),(n,r)=>{t[r]=Au(n)}),t}const Wi=Symbol("internals");function At(e){return e&&String(e).trim().toLowerCase()}function bn(e){return e===!1||e==null?e:w.isArray(e)?e.map(bn):Ou(String(e))}function Ru(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Pu=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ar(e,t,n,r,i){if(w.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!w.isString(t)){if(w.isString(r))return t.indexOf(r)!==-1;if(w.isRegExp(r))return r.test(t)}}function Iu(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Lu(e,t){const n=w.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(i,s,o){return this[r].call(this,t,i,s,o)},configurable:!0})})}let ve=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(h,d,g){const m=At(d);if(!m)return;const c=w.findKey(i,m);(!c||i[c]===void 0||g===!0||g===void 0&&i[c]!==!1)&&(i[c||d]=bn(h))}const o=(h,d)=>w.forEach(h,(g,m)=>s(g,m,d));if(w.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(w.isString(t)&&(t=t.trim())&&!Pu(t))o(Eu(t),n);else if(w.isObject(t)&&w.isSafeIterable(t)){let h=Object.create(null),d,g;for(const m of t){if(!w.isArray(m))throw new TypeError("Object iterator must return a key-value pair");g=m[0],w.hasOwnProp(h,g)?(d=h[g],h[g]=w.isArray(d)?[...d,m[1]]:[d,m[1]]):h[g]=m[1]}o(h,n)}else t!=null&&s(n,t,r);return this}get(t,n){if(t=At(t),t){const r=w.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return Ru(i);if(w.isFunction(n))return n.call(this,i,r);if(w.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=At(t),t){const r=w.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ar(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=At(o),o){const h=w.findKey(r,o);h&&(!n||ar(r,r[h],h,n))&&(delete r[h],i=!0)}}return w.isArray(t)?t.forEach(s):s(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!t||ar(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,r={};return w.forEach(this,(i,s)=>{const o=w.findKey(r,s);if(o){n[o]=bn(i),delete n[s];return}const h=t?Iu(s):String(s).trim();h!==s&&delete n[s],n[h]=bn(i),r[h]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return w.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&w.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3`)}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,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[Wi]=this[Wi]={accessors:{}}).accessors,i=this.prototype;function s(o){const h=At(o);r[h]||(Lu(i,o),r[h]=!0)}return w.isArray(t)?t.forEach(s):s(t),this}};ve.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);w.reduceDescriptors(ve.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});w.freezeMethods(ve);const Nu="[REDACTED ****]";function ju(e){if(w.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(w.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function Du(e,t){const n=new Set(t.map(s=>String(s).toLowerCase())),r=[],i=s=>{if(s===null||typeof s!="object"||w.isBuffer(s))return s;if(r.indexOf(s)!==-1)return;s instanceof ve&&(s=s.toJSON()),r.push(s);let o;if(w.isArray(s))o=[],s.forEach((h,d)=>{const g=i(h);w.isUndefined(g)||(o[d]=g)});else{if(!w.isPlainObject(s)&&ju(s))return r.pop(),s;o=Object.create(null);for(const[h,d]of Object.entries(s)){const g=n.has(h.toLowerCase())?Nu:i(d);w.isUndefined(g)||(o[h]=g)}}return r.pop(),o};return i(e)}
vendor: 4,089 bytes, line 3
3let I=class Js extends Error{static from(t,n,r,i,s,o){const h=new Js(t.message,n||t.code,r,i,s);return Object.defineProperty(h,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),h.name=t.name,t.status!=null&&h.status==null&&(h.status=t.status),o&&Object.assign(h,o),h}constructor(t,n,r,i,s){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),i&&(this.request=i),s&&(this.response=s,this.status=s.status)}toJSON(){const t=this.config,n=t&&w.hasOwnProp(t,"redact")?t.redact:void 0,r=w.isArray(n)&&n.length>0?Du(t,n):w.toJSONObject(t);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:r,code:this.code,status:this.status}}};I.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";I.ERR_BAD_OPTION="ERR_BAD_OPTION";I.ECONNABORTED="ECONNABORTED";I.ETIMEDOUT="ETIMEDOUT";I.ECONNREFUSED="ECONNREFUSED";I.ERR_NETWORK="ERR_NETWORK";I.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";I.ERR_DEPRECATED="ERR_DEPRECATED";I.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";I.ERR_BAD_REQUEST="ERR_BAD_REQUEST";I.ERR_CANCELED="ERR_CANCELED";I.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";I.ERR_INVALID_URL="ERR_INVALID_URL";I.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Fu=null,Xs=100;function yr(e){return w.isPlainObject(e)||w.isArray(e)}function Gs(e){return w.endsWith(e,"[]")?e.slice(0,-2):e}function cr(e,t,n){return e?e.concat(t).map(function(i,s){return i=Gs(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function Mu(e){return w.isArray(e)&&!e.some(yr)}const $u=w.toFlatObject(w,{},null,function(t){return/^is[A-Z]/.test(t)});function $n(e,t,n){if(!w.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=w.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,x){return!w.isUndefined(x[C])});const r=n.metaTokens,i=n.visitor||y,s=n.dots,o=n.indexes,h=n.Blob||typeof Blob<"u"&&Blob,d=n.maxDepth===void 0?Xs:n.maxDepth,g=h&&w.isSpecCompliantForm(t),m=[];if(!w.isFunction(i))throw new TypeError("visitor must be a function");function c(S){if(S===null)return"";if(w.isDate(S))return S.toISOString();if(w.isBoolean(S))return S.toString();if(!g&&w.isBlob(S))throw new I("Blob is not supported. Use a Buffer instead.");if(w.isArrayBuffer(S)||w.isTypedArray(S)){if(g&&typeof h=="function")return new h([S]);if(typeof Buffer<"u")return Buffer.from(S);throw new I("Blob is not supported. Use a Buffer instead.",I.ERR_NOT_SUPPORT)}return S}function f(S){if(S>d)throw new I("Object is too deeply nested ("+S+" levels). Max depth: "+d,I.ERR_FORM_DATA_DEPTH_EXCEEDED)}function b(S,C){if(d===1/0)return JSON.stringify(S);const x=[];return JSON.stringify(S,function(N,j){if(!w.isObject(j))return j;for(;x.length&&x[x.length-1]!==this;)x.pop();return x.push(j),f(C+x.length-1),j})}function y(S,C,x){let A=S;if(w.isReactNative(t)&&w.isReactNativeBlob(S))return t.append(cr(x,C,s),c(S)),!1;if(S&&!x&&typeof S=="object"){if(w.endsWith(C,"{}"))C=r?C:C.slice(0,-2),S=b(S,1);else if(w.isArray(S)&&Mu(S)||(w.isFileList(S)||w.endsWith(C,"[]"))&&(A=w.toArray(S)))return C=Gs(C),A.forEach(function(j,U){!(w.isUndefined(j)||j===null)&&t.append(o===!0?cr([C],U,s):o===null?C:C+"[]",c(j))}),!1}return yr(S)?!0:(t.append(cr(x,C,s),c(S)),!1)}const _=Object.assign($u,{defaultVisitor:y,convertValue:c,isVisitable:yr});function T(S,C,x=0){if(!w.isUndefined(S)){if(f(x),m.indexOf(S)!==-1)throw new Error("Circular reference detected in "+C.join("."));m.push(S),w.forEach(S,function(N,j){(!(w.isUndefined(N)||N===null)&&i.call(t,N,w.isString(j)?j.trim():j,C,_))===!0&&T(N,C?C.concat(j):[j],x+1)}),m.pop()}}if(!w.isObject(e))throw new TypeError("data must be an object");return T(e),t}function Ki(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(r){return t[r]})}function Hr(e,t){this._pairs=[],e&&$n(e,this,t)}
vendor: 3,738 bytes, line 3
3const Vs=Hr.prototype;Vs.append=function(t,n){this._pairs.push([t,n])};Vs.toString=function(t){const n=t?r=>t.call(this,r,Ki):Ki;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Uu(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ys(e,t,n){if(!t)return e;e=e||"";const r=w.isFunction(n)?{serialize:n}:n,i=w.getSafeProp(r,"encode")||Uu,s=w.getSafeProp(r,"serialize");let o;if(s?o=s(t,r):o=w.isURLSearchParams(t)?t.toString():new Hr(t,r).toString(i),o){const h=e.indexOf("#");h!==-1&&(e=e.slice(0,h)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Ji{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){w.forEach(this.handlers,function(r){r!==null&&t(r)})}}const zr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Bu=typeof URLSearchParams<"u"?URLSearchParams:Hr,qu=typeof FormData<"u"?FormData:null,Hu=typeof Blob<"u"?Blob:null,zu={isBrowser:!0,classes:{URLSearchParams:Bu,FormData:qu,Blob:Hu},protocols:["http","https","file","blob","url","data"]},Wr=typeof window<"u"&&typeof document<"u",wr=typeof navigator=="object"&&navigator||void 0,Wu=Wr&&(!wr||["ReactNative","NativeScript","NS"].indexOf(wr.product)<0),Ku=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ju=Wr&&window.location.href||"http://localhost",Xu=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Wr,hasStandardBrowserEnv:Wu,hasStandardBrowserWebWorkerEnv:Ku,navigator:wr,origin:Ju},Symbol.toStringTag,{value:"Module"})),pe={...Xu,...zu};function Gu(e,t){return $n(e,new pe.classes.URLSearchParams,{visitor:function(n,r,i,s){return pe.isNode&&w.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}const Xi=Xs;function Qs(e){if(e>Xi)throw new I("FormData field is too deeply nested ("+e+" levels). Max depth: "+Xi,I.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Vu(e){const t=[],n=/\w+|\[(\w*)]/g;let r;for(;(r=n.exec(e))!==null;)Qs(t.length),t.push(r[0]==="[]"?"":r[1]||r[0]);return t}function Yu(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}function Zs(e){function t(n,r,i,s){Qs(s);let o=n[s++];if(o==="__proto__")return!0;const h=Number.isFinite(+o),d=s>=n.length;return o=!o&&w.isArray(i)?i.length:o,d?(w.hasOwnProp(i,o)?i[o]=w.isArray(i[o])?i[o].concat(r):[i[o],r]:i[o]=r,!h):((!w.hasOwnProp(i,o)||!w.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&w.isArray(i[o])&&(i[o]=Yu(i[o])),!h)}if(w.isFormData(e)&&w.isFunction(e.entries)){const n={};return w.forEachEntry(e,(r,i)=>{t(Vu(r),i,n,0)}),n}return null}const ht=(e,t)=>e!=null&&w.hasOwnProp(e,t)?e[t]:void 0;function Qu(e,t,n){if(w.isString(e))try{return(t||JSON.parse)(e),w.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Gt={transitional:zr,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=w.isObject(t);if(s&&w.isHTMLForm(t)&&(t=new FormData(t)),w.isFormData(t))return i?JSON.stringify(Zs(t)):t;if(w.isArrayBuffer(t)||w.isBuffer(t)||w.isStream(t)||w.isFile(t)||w.isBlob(t)||w.isReadableStream(t))return t;if(w.isArrayBufferView(t))return t.buffer;if(w.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let h;
vendor: 4,678 bytes, line 3
3if(s){const d=ht(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return Gu(t,d).toString();if((h=w.isFileList(t))||r.indexOf("multipart/form-data")>-1){const g=ht(this,"env"),m=g&&g.FormData;return $n(h?{"files[]":t}:t,m&&new m,d)}}return s||i?(n.setContentType("application/json",!1),Qu(t)):t}],transformResponse:[function(t){const n=ht(this,"transitional")||Gt.transitional,r=n&&n.forcedJSONParsing,i=ht(this,"responseType"),s=i==="json";if(w.isResponse(t)||w.isReadableStream(t))return t;if(t&&w.isString(t)&&(r&&!i||s)){const h=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,ht(this,"parseReviver"))}catch(d){if(h)throw d.name==="SyntaxError"?I.from(d,I.ERR_BAD_RESPONSE,this,null,ht(this,"response")):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pe.classes.FormData,Blob:pe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};w.forEach(["delete","get","head","post","put","patch","query"],e=>{Gt.headers[e]={}});function lr(e,t){const n=this||Gt,r=t||n,i=ve.from(r.headers);let s=r.data;return w.forEach(e,function(h){s=h.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function eo(e){return!!(e&&e.__CANCEL__)}let Vt=class extends I{constructor(t,n,r){super(t??"canceled",I.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function to(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new I("Request failed with status code "+n.status,n.status>=400&&n.status<500?I.ERR_BAD_REQUEST:I.ERR_BAD_RESPONSE,n.config,n.request,n))}function Zu(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function eh(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(d){const g=Date.now(),m=r[s];o||(o=g),n[i]=d,r[i]=g;let c=s,f=0;for(;c!==i;)f+=n[c++],c=c%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),g-o<t)return;const b=m&&g-m;return b?Math.round(f*1e3/b):void 0}}function th(e,t){let n=0,r=1e3/t,i,s;const o=(g,m=Date.now())=>{n=m,i=null,s&&(clearTimeout(s),s=null),e(...g)};return[(...g)=>{const m=Date.now(),c=m-n;c>=r?o(g,m):(i=g,s||(s=setTimeout(()=>{s=null,o(i)},r-c)))},()=>i&&o(i)]}const Sn=(e,t,n=3)=>{let r=0;const i=eh(50,250);return th(s=>{if(!s||typeof s.loaded!="number")return;const o=s.loaded,h=s.lengthComputable?s.total:void 0,d=h!=null?Math.min(o,h):o,g=Math.max(0,d-r),m=i(g);r=Math.max(r,d);const c={loaded:d,total:h,progress:h?d/h:void 0,bytes:g,rate:m||void 0,estimated:m&&h?(h-d)/m:void 0,event:s,lengthComputable:h!=null,[t?"download":"upload"]:!0};e(c)},n)},Gi=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Vi=e=>(...t)=>w.asap(()=>e(...t)),nh=pe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,pe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(pe.origin),pe.navigator&&/(msie|trident)/i.test(pe.navigator.userAgent)):()=>!0,rh=pe.hasStandardBrowserEnv?{write(e,t,n,r,i,s,o){if(typeof document>"u")return;const h=[`${e}=${encodeURIComponent(t)}`];w.isNumber(n)&&h.push(`expires=${new Date(n).toUTCString()}`),w.isString(r)&&h.push(`path=${r}`),w.isString(i)&&h.push(`domain=${i}`),s===!0&&h.push("secure"),w.isString(o)&&h.push(`SameSite=${o}`),document.cookie=h.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const r=t[n].replace(/^\s+/,""),i=r.indexOf("=");if(i!==-1&&r.slice(0,i)===e)try{return decodeURIComponent(r.slice(i+1))}catch{return r.slice(i+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ih(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function sh(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const oh=/^https?:(?!\/\/)/i,ah=/[\t\n\r]/g;function ch(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function lh(e){return ch(e).replace(ah,"")}function Yi(e,t){if(typeof e=="string"&&oh.test(lh(e)))throw new I('Invalid URL: missing "//" after protocol',I.ERR_INVALID_URL,t)}function no(e,t,n,r){Yi(t,r);let i=!ih(t);return e&&(i||n===!1)?(Yi(e,r),sh(e,t)):t}const Qi=e=>e instanceof ve?{...e}:e;function rt(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(m,c,f,b){return w.isPlainObject(m)&&w.isPlainObject(c)?w.merge.call({caseless:b},m,c):w.isPlainObject(c)?w.merge({},c):w.isArray(c)?c.slice():c}
vendor: 1,579 bytes, line 3
3function i(m,c,f,b){if(w.isUndefined(c)){if(!w.isUndefined(m))return r(void 0,m,f,b)}else return r(m,c,f,b)}function s(m,c){if(!w.isUndefined(c))return r(void 0,c)}function o(m,c){if(w.isUndefined(c)){if(!w.isUndefined(m))return r(void 0,m)}else return r(void 0,c)}function h(m){const c=w.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!w.isUndefined(c))if(w.isPlainObject(c)){if(w.hasOwnProp(c,m))return c[m]}else return;const f=w.hasOwnProp(e,"transitional")?e.transitional:void 0;if(w.isPlainObject(f)&&w.hasOwnProp(f,m))return f[m]}function d(m,c,f){if(w.hasOwnProp(t,f))return r(m,c);if(w.hasOwnProp(e,f))return r(void 0,m)}const g={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:d,headers:(m,c,f)=>i(Qi(m),Qi(c),f,!0)};return w.forEach(Object.keys({...e,...t}),function(c){if(c==="__proto__"||c==="constructor"||c==="prototype")return;const f=w.hasOwnProp(g,c)?g[c]:i,b=w.hasOwnProp(e,c)?e[c]:void 0,y=w.hasOwnProp(t,c)?t[c]:void 0,_=f(b,y,c);w.isUndefined(_)&&f!==d||(n[c]=_)}),w.hasOwnProp(t,"validateStatus")&&w.isUndefined(t.validateStatus)&&h("validateStatusUndefinedResolves")===!1&&(w.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.val
vendor: 13,561 bytes, lines 3-5
3idateStatus),n}const uh=["content-type","content-length"];function hh(e,t,n){if(n!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([r,i])=>{uh.includes(r.toLowerCase())&&e.set(r,i)})}const dh=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16)));function ro(e){const t=rt({},e),n=f=>w.hasOwnProp(t,f)?t[f]:void 0,r=n("data");let i=n("withXSRFToken");const s=n("xsrfHeaderName"),o=n("xsrfCookieName");let h=n("headers");const d=n("auth"),g=n("baseURL"),m=n("allowAbsoluteUrls"),c=n("url");if(t.headers=h=ve.from(h),t.url=Ys(no(g,c,m,t),n("params"),n("paramsSerializer")),d){const f=w.getSafeProp(d,"username")||"",b=w.getSafeProp(d,"password")||"";try{h.set("Authorization","Basic "+btoa(f+":"+(b?dh(b):"")))}catch(y){throw I.from(y,I.ERR_BAD_OPTION_VALUE,e)}}if(w.isFormData(r)&&(pe.hasStandardBrowserEnv||pe.hasStandardBrowserWebWorkerEnv||w.isReactNative(r)?h.setContentType(void 0):w.isFunction(r.getHeaders)&&hh(h,r.getHeaders(),n("formDataHeaderPolicy"))),pe.hasStandardBrowserEnv&&(w.isFunction(i)&&(i=i(t)),i===!0||i==null&&nh(t.url))){const b=s&&o&&rh.read(o);b&&h.set(s,b)}return t}const fh=typeof XMLHttpRequest<"u",ph=fh&&function(e){return new Promise(function(n,r){const i=ro(e);let s=i.data;const o=ve.from(i.headers).normalize();let{responseType:h,onUploadProgress:d,onDownloadProgress:g}=i,m,c,f,b,y;function _(){b&&b(),y&&y(),i.cancelToken&&i.cancelToken.unsubscribe(m),i.signal&&i.signal.removeEventListener("abort",m)}let T=new XMLHttpRequest;T.open(i.method.toUpperCase(),i.url,!0),T.timeout=i.timeout;function S(){if(!T)return;const x=ve.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),N={data:!h||h==="text"||h==="json"?T.responseText:T.response,status:T.status,statusText:T.statusText,headers:x,config:e,request:T};to(function(U){n(U),_()},function(U){r(U),_()},N),T=null}"onloadend"in T?T.onloadend=S:T.onreadystatechange=function(){!T||T.readyState!==4||T.status===0&&!(T.responseURL&&T.responseURL.startsWith("file:"))||setTimeout(S)},T.onabort=function(){T&&(r(new I("Request aborted",I.ECONNABORTED,e,T)),_(),T=null)},T.onerror=function(A){const N=A&&A.message?A.message:"Network Error",j=new I(N,I.ERR_NETWORK,e,T);j.event=A||null,r(j),_(),T=null},T.ontimeout=function(){let A=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const N=i.transitional||zr;i.timeoutErrorMessage&&(A=i.timeoutErrorMessage),r(new I(A,N.clarifyTimeoutError?I.ETIMEDOUT:I.ECONNABORTED,e,T)),_(),T=null},s===void 0&&o.setContentType(null),"setRequestHeader"in T&&w.forEach(Ks(o),function(A,N){T.setRequestHeader(N,A)}),w.isUndefined(i.withCredentials)||(T.withCredentials=!!i.withCredentials),h&&h!=="json"&&(T.responseType=i.responseType),g&&([f,y]=Sn(g,!0),T.addEventListener("progress",f)),d&&T.upload&&([c,b]=Sn(d),T.upload.addEventListener("progress",c),T.upload.addEventListener("loadend",b)),(i.cancelToken||i.signal)&&(m=x=>{T&&(r(!x||x.type?new Vt(null,e,T):x),T.abort(),_(),T=null)},i.cancelToken&&i.cancelToken.subscribe(m),i.signal&&(i.signal.aborted?m():i.signal.addEventListener("abort",m)));const C=Zu(i.url);if(C&&!pe.protocols.includes(C)){r(new I("Unsupported protocol "+C+":",I.ERR_BAD_REQUEST,e)),_();return}T.send(s||null)})},mh=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const i=function(d){if(!r){r=!0,o();const g=d instanceof Error?d:this.reason;n.abort(g instanceof I?g:new Vt(g instanceof Error?g.message:g))}};let s=t&&setTimeout(()=>{s=null,i(new I(`timeout of ${t}ms exceeded`,I.ETIMEDOUT))},t);const o=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i,{once:!0}));const{signal:h}=n;return h.unsubscribe=()=>w.asap(o),h},gh=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},bh=async function*(e,t){for await(const n of vh(e))yield*gh(n,t)},vh=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Zi=(e,t,n,r)=>{const i=bh(e,t);let s=0,o,h=d=>{o||(o=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:g,value:m}=await i.next();if(g){h(),d.close();return}let c=m.byteLength;if(n){let f=s+=c;n(f)}d.enqueue(new Uint8Array(m))}catch(g){throw h(g),g}},cancel(d){return h(d),i.return()}},{highWaterMark:2})},Tn=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,yh=(e,t,n)=>t+2<n&&Tn(e.charCodeAt(t+1))&&Tn(e.charCodeAt(t+2));function wh(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let o=r.length;const h=r.length;for(let b=0;b<h;b++)if(r.charCodeAt(b)===37&&b+2<h){const y=r.charCodeAt(b+1),_=r.charCodeAt(b+2);Tn(y)&&Tn(_)&&(o-=2,b+=2)}let d=0,g=h-1;const m=b=>b>=2&&r.charCodeAt(b-2)===37&&r.charCodeAt(b-1)===51&&(r.charCodeAt(b)===68||r.charCodeAt(b)===100);g>=0&&(r.charCodeAt(g)===61?(d++,g--):m(g)&&(d++,g-=3)),d===1&&g>=0&&(r.charCodeAt(g)===61||m(g))&&d++;const f=Math.floor(o/4)*3-(d||0);return f>0?f:0}let s=0;for(let o=0,h=r.length;o<h;o++){const d=r.charCodeAt(o);if(d===37&&yh(r,o,h))s+=1,o+=2;else if(d<128)s+=1;else if(d<2048)s+=2;else if(d>=55296&&d<=56319&&o+1<h){const g=r.charCodeAt(o+1);g>=56320&&g<=57343?(s+=4,o++):s+=3}else s+=3}return s}const Kr="1.18.1",es=64*1024,{isFunction:on}=w,_h=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),ts=e=>{if(!w.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},ns=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Sh=e=>{const t=e.indexOf("://");let n=e;return t!==-1&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},Th=e=>{const t=w.global!==void 0&&w.global!==null?w.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=w.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:i,Request:s,Response:o}=e,h=i?on(i):typeof fetch=="function",d=on(s),g=on(o);if(!h)return!1;const m=h&&on(n),c=h&&(typeof r=="function"?(S=>C=>S.encode(C))(new r):async S=>new Uint8Array(await new s(S).arrayBuffer())),f=d&&m&&ns(()=>{let S=!1;const C=new s(pe.origin,{body:new n,method:"POST",get duplex(){return S=!0,"half"}}),x=C.headers.has("Content-Type");return C.body!=null&&C.body.cancel(),S&&!x}),b=g&&m&&ns(()=>w.isReadableStream(new o("").body)),y={stream:b&&(S=>S.body)};h&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!y[S]&&(y[S]=(C,x)=>{let A=C&&C[S];if(A)return A.call(C);throw new I(`Response type '${S}' is not supported`,I.ERR_NOT_SUPPORT,x)})});const _=async S=>{if(S==null)return 0;if(w.isBlob(S))return S.size;if(w.isSpecCompliantForm(S))return(await new s(pe.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(w.isArrayBufferView(S)||w.isArrayBuffer(S))return S.byteLength;if(w.isURLSearchParams(S)&&(S=S+""),w.isString(S))return(await c(S)).byteLength},T=async(S,C)=>{const x=w.toFiniteNumber(S.getContentLength());return x??_(C)};return async S=>{let{url:C,method:x,data:A,signal:N,cancelToken:j,timeout:U,onDownloadProgress:G,onUploadProgress:ne,responseType:oe,headers:Q,withCredentials:V="same-origin",fetchOptions:z,maxContentLength:E,maxBodyLength:O}=ro(S);const P=w.isNumber(E)&&E>-1,F=w.isNumber(O)&&O>-1,q=H=>w.hasOwnProp(S,H)?S[H]:void 0;let X=i||fetch;oe=oe?(oe+"").toLowerCase():"text";let M=mh([N,j&&j.toAbortSignal()],U),$=null;const K=M&&M.unsubscribe&&(()=>{M.unsubscribe()});let Z,ae=null;const ue=()=>new I("Request body larger than maxBodyLength limit",I.ERR_BAD_REQUEST,S,$);try{let H;const re=q("auth");if(re){const B=w.getSafeProp(re,"username")||"",ge=w.getSafeProp(re,"password")||"";H={username:B,password:ge}}if(Sh(C)){const B=new URL(C,pe.origin);if(!H&&(B.username||B.password)){const ge=ts(B.username),Ae=ts(B.password);H={username:ge,password:Ae}}(B.username||B.password)&&(B.username="",B.password="",C=B.href)}if(H&&(Q.delete("authorization"),Q.set("Authorization","Basic "+btoa(_h((H.username||"")+":"+(H.password||""))))),P&&typeof C=="string"&&C.startsWith("data:")&&wh(C)>E)throw new I("maxContentLength size of "+E+" exceeded",I.ERR_BAD_RESPONSE,S,$);if(F&&x!=="get"&&x!=="head"){const B=await _(A);if(typeof B=="number"&&isFinite(B)&&(Z=B,B>O))throw ue()}const Oe=F&&(w.isReadableStream(A)||w.isStream(A)),ie=(B,ge,Ae)=>Zi(B,es,Re=>{if(F&&Re>O)throw ae=ue();ge&&ge(Re)},Ae);if(f&&x!=="get"&&x!=="head"&&(ne||Oe)){if(Z=Z??await T(Q,A),Z!==0||Oe){let B=new s(C,{method:"POST",body:A,duplex:"half"}),ge;if(w.isFormData(A)&&(ge=B.headers.get("content-type"))&&Q.setContentType(ge),B.body){const[Ae,Re]=ne&&Gi(Z,Sn(Vi(ne)))||[];A=ie(B.body,Ae,Re)}}}else if(Oe&&!d&&m&&x!=="get"&&x!=="head")A=ie(A);else if(Oe&&d&&!f&&x!=="get"&&x!=="head")throw new I("Stream request bodies are not supported by the current fetch implementation",I.ERR_NOT_SUPPORT,S,$);w.isString(V)||(V=V?"include":"omit");const me=d&&"credentials"in s.prototype;if(w.isFormData(A)){const B=Q.getContentType();B&&/^multipart\/form-data/i.test(B)&&!/boundary=/i.test(B)&&Q.delete("content-type")}Q.set("User-Agent","axios/"+Kr,!1);const Qt={...z,signal:M,method:x.toUpperCase(),headers:Ks(Q.normalize()),body:A,duplex:"half",credentials:me?V:void 0};$=d&&new s(C,Qt);let Se=await(d?X($,z):X(C,Qt));const Te=ve.from(Se.headers);if(P){const B=w.toFiniteNumber(Te.getContentLength());if(B!=null&&B>E)throw new I("maxContentLength size of "+E+" exceeded",I.ERR_BAD_RESPONSE,S,$)}const lt=b&&(oe==="stream"||oe==="response");if(b&&Se.body&&(G||P||lt&&K)){const B={};["status","statusText","headers"].forEach(Me=>{B[Me]=Se[Me]});const ge=w.toFiniteNumber(Te.getContentLength()),[Ae,Re]=G&&Gi(ge,Sn(Vi(G),!0))||[];let Ct=0;const Xn=Me=>{if(P&&(Ct=Me,Ct>E))throw new I("maxContentLength size of "+E+" exceeded",I.ERR_BAD_RESPONSE,S,$);Ae&&Ae(Me)};Se=new o(Zi(Se.body,es,Xn,()=>{Re&&Re(),K&&K()}),B)}oe=oe||"text";let Ee=await y[w.findKey(y,oe)||"text"](Se,S);if(P&&!b&&!lt){let B;if(Ee!=null&&(typeof Ee.byteLength=="number"?B=Ee.byteLength:typeof Ee.size=="number"?B=Ee.size:typeof Ee=="string"&&(B=typeof r=="function"?new r().encode(Ee).byteLength:Ee.length)),typeof B=="number"&&B>E)throw new I("maxContentLength size of "+E+" exceeded",I.ERR_BAD_RESPONSE,S,$)}return!lt&&K&&K(),await new Promise((B,ge)=>{to(B,ge,{data:Ee,headers:ve.from(Se.headers),status:Se.status,statusText:Se.statusText,config:S,request:$})})}catch(H){if(K&&K(),M&&M.aborted&&M.reason instanceof I){const re=M.reason;throw re.config=S,$&&(re.request=$),H!==re&&Object.defineProperty(re,"cause",{__proto__:null,value:H,writable:!0,enumerable:!1,configurable:!0}),re}if(ae)throw $&&!ae.request&&(ae.request=$),ae;if(H instanceof I)throw $&&!H.request&&(H.request=$),H;if(H&&H.name==="TypeError"&&/Load failed|fetch/i.test(H.message)){const re=new I("Network Error",I.ERR_NETWORK,S,$,H&&H.response);throw Object.defineProperty(re,"cause",{__proto__:null,value:H.cause||H,writable:!0,enumerable:!1,configurable:!0}),re}throw I.from(H,H&&H.code,S,$,H&&H.response)}}},Eh=new Map,io=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,s=[r,i,n];let o=s.length,h=o,d,g,m=Eh;for(;h--;)d=s[h],g=m.get(d),g===void 0&&m.set(d,g=h?new Map:Th(t)),m=g;return g};io();const Jr={http:Fu,xhr:ph,fetch:{get:io}};w.forEach(Jr,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const rs=e=>`- ${e}`,xh=e=>w.isFunction(e)||e===null||e===!1;function Ch(e,t){e=w.isArray(e)?e:[e];const{length:n}=e;let r,i;const s={};for(let o=0;o<n;o++){r=e[o];let h;if(i=r,!xh(r)&&(i=Jr[(h=String(r)).toLowerCase()],i===void 0))throw new I(`Unknown adapter '${h}'`);if(i&&(w.isFunction(i)||(i=i.get(t))))break;s[h||"#"+o]=i}if(!i){const o=Object.entries(s).map(([d,g])=>`adapter ${d} `+(g===!1?"is not supported by the environment":"is not available in the build"));let h=n?o.length>1?`since :
4`+o.map(rs).join(`
5`):" "+rs(o[0]):"as no adapter specified";throw new I("There is no suitable adapter to dispatch the request "+h,I.ERR_NOT_SUPPORT)}return i}const so={getAdapter:Ch,adapters:Jr};function ur(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Vt(null,e)}function is(e){return ur(e),e.headers=ve.from(e.headers),e.data=lr.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),so.getAdapter(e.adapter||Gt.adapter,e)(e).then(function(r){ur(e),e.response=r;try{r.data=lr.call(e,e.transformResponse,r)}finally{delete e.response}return r.headers=ve.from(r.headers),r},function(r){if(!eo(r)&&(ur(e),r&&r.response)){e.response=r.response;try{r.response.data=lr.call(e,e.transformResponse,r.response)}finally{delete e.response}r.response.headers=ve.from(r.response.headers)}return Promise.reject(r)})}const Un={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Un[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ss={};Un.transitional=function(t,n,r){function i(s,o){return"[Axios v"+Kr+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,h)=>{if(t===!1)throw new I(i(o," has been removed"+(n?" in "+n:"")),I.ERR_DEPRECATED);return n&&!ss[o]&&(ss[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,h):!0}};Un.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};
vendor: 4,648 bytes, lines 5-9
5function kh(e,t,n){if(typeof e!="object"||e===null)throw new I("options must be an object",I.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(o){const h=e[s],d=h===void 0||o(h,s,e);if(d!==!0)throw new I("option "+s+" must be "+d,I.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new I("Unknown option "+s,I.ERR_BAD_OPTION)}}const vn={assertOptions:kh,validators:Un},be=vn.validators;let Ye=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ji,response:new Ji}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=(()=>{if(!i.stack)return"";const o=i.stack.indexOf(`
6`);return o===-1?"":i.stack.slice(o+1)})();try{if(!r.stack)r.stack=s;else if(s){const o=s.indexOf(`
7`),h=o===-1?-1:s.indexOf(`
8`,o+1),d=h===-1?"":s.slice(h+1);String(r.stack).endsWith(d)||(r.stack+=`
9`+s)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=rt(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&vn.assertOptions(r,{silentJSONParsing:be.transitional(be.boolean),forcedJSONParsing:be.transitional(be.boolean),clarifyTimeoutError:be.transitional(be.boolean),legacyInterceptorReqResOrdering:be.transitional(be.boolean),advertiseZstdAcceptEncoding:be.transitional(be.boolean),validateStatusUndefinedResolves:be.transitional(be.boolean)},!1),i!=null&&(w.isFunction(i)?n.paramsSerializer={serialize:i}:vn.assertOptions(i,{encode:be.function,serialize:be.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),vn.assertOptions(n,{baseUrl:be.spelling("baseURL"),withXsrfToken:be.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&w.merge(s.common,s[n.method]);s&&w.forEach(["delete","get","head","post","put","patch","query","common"],y=>{delete s[y]}),n.headers=ve.concat(o,s);const h=[];let d=!0;this.interceptors.request.forEach(function(_){if(typeof _.runWhen=="function"&&_.runWhen(n)===!1)return;d=d&&_.synchronous;const T=n.transitional||zr;T&&T.legacyInterceptorReqResOrdering?h.unshift(_.fulfilled,_.rejected):h.push(_.fulfilled,_.rejected)});const g=[];this.interceptors.response.forEach(function(_){g.push(_.fulfilled,_.rejected)});let m,c=0,f;if(!d){const y=[is.bind(this),void 0];for(y.unshift(...h),y.push(...g),f=y.length,m=Promise.resolve(n);c<f;)m=m.then(y[c++],y[c++]);return m}f=h.length;let b=n;for(;c<f;){const y=h[c++],_=h[c++];try{b=y(b)}catch(T){_.call(this,T);break}}try{m=is.call(this,b)}catch(y){return Promise.reject(y)}for(c=0,f=g.length;c<f;)m=m.then(g[c++],g[c++]);return m}getUri(t){t=rt(this.defaults,t);const n=no(t.baseURL,t.url,t.allowAbsoluteUrls,t);return Ys(n,t.params,t.paramsSerializer)}};w.forEach(["delete","get","head","options"],function(t){Ye.prototype[t]=function(n,r){return this.request(rt(r||{},{method:t,url:n,data:r&&w.hasOwnProp(r,"data")?r.data:void 0}))}});w.forEach(["post","put","patch","query"],function(t){function n(r){return function(s,o,h){return this.request(rt(h||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Ye.prototype[t]=n(),t!=="query"&&(Ye.prototype[t+"Form"]=n(!0))});let Oh=class oo{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(h=>{r.subscribe(h),s=h}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,h){r.reason||(r.reason=new Vt(s,o,h),n(r.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 n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new oo(function(i){t=i}),cancel:t}}};function Ah(e){return function(n){return e.apply(null,n)}}function Rh(e){return w.isObject(e)&&e.isAxiosError===!0}const _r={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,Re
9setContent: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(_r).forEach(([e,t])=>{_r[t]=e});function ao(e){const t=new Ye(e),n=Fs(Ye.prototype.request,t);return w.extend(n,Ye.prototype,t,{allOwnKeys:!0}),w.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return ao(rt(e,i))},n}const le=ao(Gt);le.Axios=Ye;le.CanceledError=Vt;le.CancelToken=Oh;le.isCancel=eo;le.VERSION=Kr;le.toFormData=$n;le.AxiosError=I;le.Cancel=le.CanceledError;le.all=function(t){return Promise.all(t)};le.spread=Ah;le.isAxiosError=Rh;le.mergeConfig=rt;le.AxiosHeaders=ve;le.formToJSON=e=>Zs(w.isHTMLForm(e)?new FormData(e):e);le.getAdapter=so.getAdapter;le.HttpStatusCode=_r;le.default=le;const{Axios:fm,AxiosError:pm,CanceledError:mm,isCancel:gm,CancelToken:bm,VERSION:vm,all:ym,Cancel:wm,isAxiosError:_m,spread:Sm,toFormData:Tm,AxiosHeaders:Em,HttpStatusCode:xm,formToJSON:Cm,getAdapter:km,mergeConfig:Om,create:Am}=le;class Xr{constructor(){this.notificationCreatedEvent=".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated"}listenForWhisper(t,n){return this.listen(".client-"+t,n)}notification(t){return this.listen(this.notificationCreatedEvent,t)}stopListeningForNotification(t){return this.stopListening(this.notificationCreatedEvent,t)}stopListeningForWhisper(t,n){return this.stopListening(".client-"+t,n)}}class co{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 Ph(e){try{return Reflect.construct(String,[],e),!0}catch{return!1}}class Gr extends Xr{constructor(t,n,r){super(),this.name=n,this.pusher=t,this.options=r,this.eventFormatter=new co(this.options.namespace),this.subscribe()}subscribe(){this.subscription=this.pusher.subscribe(this.name)}unsubscribe(){this.pusher.unsubscribe(this.name)}listen(t,n){return this.on(this.eventFormatter.format(t),n),this}listenToAll(t){return this.subscription.bind_global((n,r)=>{if(n.startsWith("pusher:"))return;let i=String(this.options.namespace??"").replace(/\./g,"\\"),s=n.startsWith(i)?n.substring(i.length+1):"."+n;t(s,r)}),this}stopListening(t,n){return n?this.subscription.unbind(this.eventFormatter.format(t),n):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",n=>{t(n)}),this}on(t,n){return this.subscription.bind(t,n),this}}class lo extends Gr{whisper(t,n){return this.pusher.channels.channels[this.name].trigger(`client-${t}`,n),this}}class Ih extends Gr{whisper(t,n){return this.pusher.channels.channels[this.name].trigger(`client-${t}`,n),this}}class Lh extends lo{here(t){return this.on("pusher:subscription_succeeded",n=>{t(Object.keys(n.members).map(r=>n.members[r]))}),this}joining(t){return this.on("pusher:member_added",n=>{t(n.info)}),this}whisper(t,n){return this.pusher.channels.channels[this.name].trigger(`client-${t}`,n),this}leaving(t){return this.on("pusher:member_removed",n=>{t(n.info)}),this}}class uo extends Xr{constructor(t,n,r){super(),this.events={},this.listeners={},this.name=n,this.socket=t,this.options=r,this.eventFormatter=new co(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,n){return this.on(this.eventFormatter.format(t),n),this}stopListening(t,n){return this.unbindEvent(this.eventFormatter.format(t),n),this}subscribed(t){return this.on("connect",n=>{t(n)}),this}error(t){return this}on(t,n){return this.listeners[t]=this.listeners[t]||[],this.events[t]||(this.events[t]=(r,i)=>{this.name===r&&this.listeners[t]&&this.listeners[t].forEach(s=>s(i))},this.socket.on(t,this.events[t])),this.listeners[t].push(n),this}
9unbind(){Object.keys(this.events).forEach(t=>{this.unbindEvent(t)})}unbindEvent(t,n){this.listeners[t]=this.listeners[t]||[],n&&(this.listeners[t]=this.listeners[t].filter(r=>r!==n)),(!n||this.listeners[t].length===0)&&(this.events[t]&&(this.socket.removeListener(t,this.events[t]),delete this.events[t]),delete this.listeners[t])}}class ho extends uo{whisper(t,n){return this.socket.emit("client event",{channel:this.name,event:`client-${t}`,data:n}),this}}class Nh extends ho{here(t){return this.on("presence:subscribed",n=>{t(n.map(r=>r.user_info))}),this}joining(t){return this.on("presence:joining",n=>t(n.user_info)),this}whisper(t,n){return this.socket.emit("client event",{channel:this.name,event:`client-${t}`,data:n}),this}leaving(t){return this.on("presence:leaving",n=>t(n.user_info)),this}}class En extends Xr{subscribe(){}unsubscribe(){}listen(t,n){return this}listenToAll(t){return this}stopListening(t,n){return this}subscribed(t){return this}error(t){return this}on(t,n){return this}}class fo extends En{whisper(t,n){return this}}class jh extends En{whisper(t,n){return this}}class Dh extends fo{here(t){return this}joining(t){return this}whisper(t,n){return this}leaving(t){return this}}const Fn=class Fn{constructor(t){this.setOptions(t),this.connect()}setOptions(t){this.options={...Fn._defaultOptions,...t,broadcaster:t.broadcaster};let n=this.csrfToken();n&&(this.options.auth.headers["X-CSRF-TOKEN"]=n,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=n),n=this.options.bearerToken,n&&(this.options.auth.headers.Authorization="Bearer "+n,this.options.userAuthentication.headers.Authorization="Bearer "+n)}csrfToken(){return typeof window<"u"&&window.Laravel?.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"?document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")??null:null}};Fn._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"};let qt=Fn;class an extends qt{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,n,r){return this.channel(t).listen(n,r)}channel(t){return this.channels[t]||(this.channels[t]=new Gr(this.pusher,t,this.options)),this.channels[t]}privateChannel(t){return this.channels["private-"+t]||(this.channels["private-"+t]=new lo(this.pusher,"private-"+t,this.options)),this.channels["private-"+t]}encryptedPrivateChannel(t){return this.channels["private-encrypted-"+t]||(this.channels["private-encrypted-"+t]=new Ih(this.pusher,"private-encrypted-"+t,this.options)),this.channels["private-encrypted-"+t]}presenceChannel(t){return this.channels["presence-"+t]||(this.channels["presence-"+t]=new Lh(this.pusher,"presence-"+t,this.options)),this.channels["presence-"+t]}leave(t){[t,"private-"+t,"private-encrypted-"+t,"presence-"+t].forEach(n=>{this.leaveChannel(n)})}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 n=()=>{t(this.connectionStatus())},r=["state_change","connected","disconnected"];return r.forEach(i=>{this.pusher.connection.bind(i,n)}),()=>{r.forEach(i=>{this.pusher.connection.unbind(i,n)})}}disconnect(){this.pusher.disconnect()}}class Fh extends qt{constructor(){super(...arguments),this.channels={}}connect(){const t=this.getSocketIO();this.socket=t(this.options.host??void 0,this.options),this.socket.io.on("reconnect",()=>
9{Object.values(this.channels).forEach(n=>{n.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,n,r){return this.channel(t).listen(n,r)}channel(t){return this.channels[t]||(this.channels[t]=new uo(this.socket,t,this.options)),this.channels[t]}privateChannel(t){return this.channels["private-"+t]||(this.channels["private-"+t]=new ho(this.socket,"private-"+t,this.options)),this.channels["private-"+t]}presenceChannel(t){return this.channels["presence-"+t]||(this.channels["presence-"+t]=new Nh(this.socket,"presence-"+t,this.options)),this.channels["presence-"+t]}leave(t){[t,"private-"+t,"presence-"+t].forEach(n=>{this.leaveChannel(n)})}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 n=()=>{t(this.connectionStatus())},r=["connect","disconnect","connect_error","reconnect_attempt","reconnect","reconnect_error","reconnect_failed"];return r.forEach(i=>{this.socket.on(i,n)}),()=>{r.forEach(i=>{this.socket.off(i,n)})}}disconnect(){this.socket.disconnect()}}class os extends qt{constructor(){super(...arguments),this.channels={}}connect(){}listen(t,n,r){return new En}channel(t){return new En}privateChannel(t){return new fo}encryptedPrivateChannel(t){return new jh}presenceChannel(t){return new Dh}leave(t){}leaveChannel(t){}socketId(){return"fake-socket-id"}connectionStatus(){return"connected"}onConnectionChange(t){return()=>{}}disconnect(){}}class Mh{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 an({...this.options,cluster:""});else if(this.options.broadcaster==="pusher")this.connector=new an(this.options);else if(this.options.broadcaster==="ably")this.connector=new an({...this.options,cluster:"",broadcaster:"pusher"});else if(this.options.broadcaster==="socket.io")this.connector=new Fh(this.options);else if(this.options.broadcaster==="null")this.connector=new os(this.options);else if(typeof this.options.broadcaster=="function"&&Ph(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,n,r){return this.connector.listen(t,n,r)}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 an||t instanceof os}socketId(){return this.connector.socketId()}connectionStatus(){return this.connector.connectionStatus()}registerInterceptors(){typeof Vue<"u"&&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,n)=>{this.socketId()&&t.headers.set("X-Socket-ID",this.socketId()),n()})}registerAxiosRequestInterceptor(){axios.interceptors.request.use(t=>(this.socketId()&&(t.headers["X-Socket-Id"]=this.socketId()),t))}registerjQueryAjaxSetup(){typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter((t,
9n,r)=>{this.socketId()&&r.setRequestHeader("X-Socket-Id",this.socketId())})}registerTurboRequestInterceptor(){document.addEventListener("turbo:before-fetch-request",t=>{t.detail.fetchOptions.headers["X-Socket-Id"]=this.socketId()})}}function $h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hr={exports:{}};var as;function Uh(){return as||(as=1,(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var n={594(o,h){var d=this&&this.__extends||(function(){var C=function(x,A){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,j){N.__proto__=j}||function(N,j){for(var U in j)j.hasOwnProperty(U)&&(N[U]=j[U])},C(x,A)};return function(x,A){C(x,A);function N(){this.constructor=x}x.prototype=A===null?Object.create(A):(N.prototype=A.prototype,new N)}})();Object.defineProperty(h,"__esModule",{value:!0});var g=256,m=(function(){function C(x){x===void 0&&(x="="),this._paddingCharacter=x}return C.prototype.encodedLength=function(x){return this._paddingCharacter?(x+2)/3*4|0:(x*8+5)/6|0},C.prototype.encode=function(x){for(var A="",N=0;N<x.length-2;N+=3){var j=x[N]<<16|x[N+1]<<8|x[N+2];A+=this._encodeByte(j>>>18&63),A+=this._encodeByte(j>>>12&63),A+=this._encodeByte(j>>>6&63),A+=this._encodeByte(j>>>0&63)}var U=x.length-N;if(U>0){var j=x[N]<<16|(U===2?x[N+1]<<8:0);A+=this._encodeByte(j>>>18&63),A+=this._encodeByte(j>>>12&63),U===2?A+=this._encodeByte(j>>>6&63):A+=this._paddingCharacter||"",A+=this._paddingCharacter||""}return A},C.prototype.maxDecodedLength=function(x){return this._paddingCharacter?x/4*3|0:(x*6+7)/8|0},C.prototype.decodedLength=function(x){return this.maxDecodedLength(x.length-this._getPaddingLength(x))},C.prototype.decode=function(x){if(x.length===0)return new Uint8Array(0);for(var A=this._getPaddingLength(x),N=x.length-A,j=new Uint8Array(this.maxDecodedLength(N)),U=0,G=0,ne=0,oe=0,Q=0,V=0,z=0;G<N-4;G+=4)oe=this._decodeChar(x.charCodeAt(G+0)),Q=this._decodeChar(x.charCodeAt(G+1)),V=this._decodeChar(x.charCodeAt(G+2)),z=this._decodeChar(x.charCodeAt(G+3)),j[U++]=oe<<2|Q>>>4,j[U++]=Q<<4|V>>>2,j[U++]=V<<6|z,ne|=oe&g,ne|=Q&g,ne|=V&g,ne|=z&g;if(G<N-1&&(oe=this._decodeChar(x.charCodeAt(G)),Q=this._decodeChar(x.charCodeAt(G+1)),j[U++]=oe<<2|Q>>>4,ne|=oe&g,ne|=Q&g),G<N-2&&(V=this._decodeChar(x.charCodeAt(G+2)),j[U++]=Q<<4|V>>>2,ne|=V&g),G<N-3&&(z=this._decodeChar(x.charCodeAt(G+3)),j[U++]=V<<6|z,ne|=z&g),ne!==0)throw new Error("Base64Coder: incorrect characters for decoding");return j},C.prototype._encodeByte=function(x){var A=x;return A+=65,A+=25-x>>>8&6,A+=51-x>>>8&-75,A+=61-x>>>8&-15,A+=62-x>>>8&3,String.fromCharCode(A)},C.prototype._decodeChar=function(x){var A=g;return A+=(42-x&x-44)>>>8&-g+x-43+62,A+=(46-x&x-48)>>>8&-g+x-47+63,A+=(47-x&x-58)>>>8&-g+x-48+52,A+=(64-x&x-91)>>>8&-g+x-65+0,A+=(96-x&x-123)>>>8&-g+x-97+26,A},C.prototype._getPaddingLength=function(x){var A=0;if(this._paddingCharacter){for(var N=x.length-1;N>=0&&x[N]===this._paddingCharacter;N--)A++;if(x.length<4||A>2)throw new Error("Base64Coder: incorrect padding")}return A},C})();h.Coder=m;var c=new m;function f(C){return c.encode(C)}h.encode=f;function b(C){return c.decode(C)}h.decode=b;var y=(function(C){d(x,C);function x(){return C!==null&&C.apply(this,arguments)||this}return x.prototype._encodeByte=function(A){var N=A;return N+=65,N+=25-A>>>8&6,N+=51-A>>>8&-75,N+=61-A>>>8&-13,N+=62-A>>>8&49,String.fromCharCode(N)},x.prototype._decodeChar=function(A){var N=g;return N+=(44-A&A-46)>>>8&-g+A-45+62,N+=(94-A&A-96)>>>8&-g+A-95+63,N+=(47-A&A-58)>>>8&-g+A-48+52,N+=(64-A&A-91)>>>8&-g+A-65+0,N+=(96-A&A-123)>>>8&-g+A-97+26,N},x})(m);h.URLSafeCoder=y;var _=new y;function T(C){return _.encode(C)}h.encodeURLSafe=T;function S(C){return _.decode(C)}h.decodeURLSafe=S,h.encodedLength=function(C){return c.encodedLength(C)},h.maxDecodedLength=function(C){return c.maxDecodedLength(C)},h.decodedLength=function(C){return c.decodedLength(C)}},978(o,h){var d="utf8: invalid source encoding";function g(m){for(var c=[],f=0;f<m.length;f++){var b=m[f];if(b&128){var y=void 0;if(b<224){if(f>=m.length)throw new Error(d);var _=m[++f];if((_&192)!==128)throw new Error(d);b=(b&31)<<6|_&63,y=128}else if(b<240){if(f>=m.length-1)throw new Error(d);var _=m[++f],T=m[++f];if((_&192)!==128||(T&192)!==128)throw new Error(d);b=(b&15)<<12|(_&63)<<6|T&63,y=2048}else if(b<248){if(f>=m.length-2)throw new Error(d);var _=m[++f],T=m[++f],S=m[++f];if((_&192)!==128||(T&192)!==128||(S&192)!==128)throw new Error(d);b=(b&15)<<18|(_&63)<<12|(T&63)<<6|S&63,y=65536}else throw new Error(d);if(b<y||b>=55296&&b<=57343)throw new Error(d);if(b>
9=65536){if(b>1114111)throw new Error(d);b-=65536,c.push(String.fromCharCode(55296|b>>10)),b=56320|b&1023}}c.push(String.fromCharCode(b))}return c.join("")}h.D4=g},721(o,h,d){o.exports=d(207).default},207(o,h,d){d.d(h,{default:()=>rn});class g{constructor(a,l){this.lastId=0,this.prefix=a,this.name=l}create(a){this.lastId++;var l=this.lastId,p=this.prefix+l,v=this.name+"["+l+"]",k=!1,R=function(){k||(a.apply(null,arguments),k=!0)};return this[l]=R,{number:l,id:p,name:v,callback:R}}remove(a){delete this[a.number]}}var m=new g("_pusher_script_","Pusher.ScriptReceivers"),c={VERSION:"8.6.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:""};const f=c;class b{constructor(a){this.options=a,this.receivers=a.receivers||m,this.loading={}}load(a,l,p){var v=this;if(v.loading[a]&&v.loading[a].length>0)v.loading[a].push(p);else{v.loading[a]=[p];var k=J.createScriptRequest(v.getPath(a,l)),R=v.receivers.create(function(D){if(v.receivers.remove(R),v.loading[a]){var W=v.loading[a];delete v.loading[a];for(var Y=function(he){he||k.cleanup()},ee=0;ee<W.length;ee++)W[ee](D,Y)}});k.send(R)}}getRoot(a){var l,p=J.getDocument().location.protocol;return a&&a.useTLS||p==="https:"?l=this.options.cdn_https:l=this.options.cdn_http,l.replace(/\/*$/,"")+"/"+this.options.version}getPath(a,l){return this.getRoot(l)+"/"+a+this.options.suffix+".js"}}var y=new g("_pusher_dependencies","Pusher.DependenciesReceivers"),_=new b({cdn_http:f.cdn_http,cdn_https:f.cdn_https,version:f.VERSION,suffix:f.dependency_suffix,receivers:y});const T={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}},C={buildLogSuffix:function(u){const a="See:",l=T.urls[u];if(!l)return"";let p;return l.fullUrl?p=l.fullUrl:l.path&&(p=T.baseUrl+l.path),p?`${a} ${p}`:""}};var x;(function(u){u.UserAuthentication="user-authentication",u.ChannelAuthorization="channel-authorization"})(x||(x={}));class A extends Error{constructor(a){super(a),Object.setPrototypeOf(this,new.target.prototype)}}class N extends Error{constructor(a){super(a),Object.setPrototypeOf(this,new.target.prototype)}}class j extends Error{constructor(a){super(a),Object.setPrototypeOf(this,new.target.prototype)}}class U extends Error{constructor(a){super(a),Object.setPrototypeOf(this,new.target.prototype)}}class G extends Error{constructor(a){super(a),Object.setPrototypeOf(this,new.target.prototype)}}class ne extends Error{constructor(a){super(a),Object.setPrototypeOf(this,new.target.prototype)}}class oe extends Error{constructor(a){super(a),Object.setPrototypeOf(this,new.target.prototype)}}class Q extends Error{constructor(a){super(a),Object.setPrototypeOf(this,new.target.prototype)}}class V extends Error{constructor(a,l){super(l),this.status=a,Object.setPrototypeOf(this,new.target.prototype)}}const E=function(u,a,l,p,v){const k=J.createXHR();k.open("POST",l.endpoint,!0),k.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var R in l.headers)k.setRequestHeader(R,l.headers[R]);if(l.headersProvider!=null){let D=l.headersProvider();for(var R in D)k.setRequestHeader(R,D[R])}return k.onreadystatechange=function(){if(k.readyState===4)if(k.status===200){let D,W=!1;try{D=JSON.parse(k.responseText),W=!0}catch{v(new V(200,`JSON returned from ${p.toString()}
9 endpoint was invalid, yet status code was 200. Data was: ${k.responseText}`),null)}W&&v(null,D)}else{let D="";switch(p){case x.UserAuthentication:D=C.buildLogSuffix("authenticationEndpoint");break;case x.ChannelAuthorization:D=`Clients must be authorized to join private or presence channels. ${C.buildLogSuffix("authorizationEndpoint")}`;break}v(new V(k.status,`Unable to retrieve auth string from ${p.toString()} endpoint - received status: ${k.status} from ${l.endpoint}. ${D}`),null)}},k.send(a),k};function O(u){return $(X(u))}var P=String.fromCharCode,F="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",q=function(u){var a=u.charCodeAt(0);return a<128?u:a<2048?P(192|a>>>6)+P(128|a&63):P(224|a>>>12&15)+P(128|a>>>6&63)+P(128|a&63)},X=function(u){return u.replace(/[^\x00-\x7F]/g,q)},M=function(u){var a=[0,2,1][u.length%3],l=u.charCodeAt(0)<<16|(u.length>1?u.charCodeAt(1):0)<<8|(u.length>2?u.charCodeAt(2):0),p=[F.charAt(l>>>18),F.charAt(l>>>12&63),a>=2?"=":F.charAt(l>>>6&63),a>=1?"=":F.charAt(l&63)];return p.join("")},$=typeof window<"u"&&window.btoa||function(u){return u.replace(/[\s\S]{1,3}/g,M)};class K{constructor(a,l,p,v){this.clear=l,this.timer=a(()=>{this.timer&&(this.timer=v(this.timer))},p)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}const Z=K;function ae(u){window.clearTimeout(u)}function ue(u){window.clearInterval(u)}class H extends Z{constructor(a,l){super(setTimeout,ae,a,function(p){return l(),null})}}class re extends Z{constructor(a,l){super(setInterval,ue,a,function(p){return l(),p})}}var Oe={now(){return Date.now?Date.now():new Date().valueOf()},defer(u){return new H(0,u)},method(u,...a){var l=Array.prototype.slice.call(arguments,1);return function(p){return p[u].apply(p,l.concat(arguments))}}};const ie=Oe;function me(u,...a){for(var l=0;l<a.length;l++){var p=a[l];for(var v in p)v==="__proto__"||v==="constructor"||v==="prototype"||(p[v]&&p[v].constructor&&p[v].constructor===Object?u[v]=me(u[v]||{},p[v]):u[v]=p[v])}return u}function Qt(){for(var u=["Pusher"],a=0;a<arguments.length;a++)typeof arguments[a]=="string"?u.push(arguments[a]):u.push(Zt(arguments[a]));return u.join(" : ")}function Se(u,a){var l=Array.prototype.indexOf;if(u===null)return-1;if(l&&u.indexOf===l)return u.indexOf(a);for(var p=0,v=u.length;p<v;p++)if(u[p]===a)return p;return-1}function Te(u,a){for(var l in u)Object.prototype.hasOwnProperty.call(u,l)&&a(u[l],l,u)}function lt(u){var a=[];return Te(u,function(l,p){a.push(p)}),a}function Ee(u){var a=[];return Te(u,function(l){a.push(l)}),a}function B(u,a,l){for(var p=0;p<u.length;p++)a.call(l||window,u[p],p,u)}function ge(u,a){for(var l=[],p=0;p<u.length;p++)l.push(a(u[p],p,u,l));return l}function Ae(u,a){var l={};return Te(u,function(p,v){l[v]=a(p)}),l}function Re(u,a){a=a||function(v){return!!v};for(var l=[],p=0;p<u.length;p++)a(u[p],p,u,l)&&l.push(u[p]);return l}function Ct(u,a){var l={};return Te(u,function(p,v){(a&&a(p,v,u,l)||p)&&(l[v]=p)}),l}function Xn(u){var a=[];return Te(u,function(l,p){a.push([p,l])}),a}function Me(u,a){for(var l=0;l<u.length;l++)if(a(u[l],l,u))return!0;return!1}function Fa(u,a){for(var l=0;l<u.length;l++)if(!a(u[l],l,u))return!1;return!0}function Ma(u){return Ae(u,function(a){return a===null?"":(typeof a=="object"&&(a=Zt(a)),encodeURIComponent(O(a.toString())))})}function $a(u){var a=Ct(u,function(p){return p!==void 0}),l=ge(Xn(Ma(a)),ie.method("join","=")).join("&");return l}function Ua(u){var a=[],l=[];return(function p(v,k){var R,D,W;switch(typeof v){case"object":if(!v)return null;for(R=0;R<a.length;R+=1)if(a[R]===v)return{$ref:l[R]};if(a.push(v),l.push(k),Object.prototype.toString.apply(v)==="[object Array]")for(W=[],R=0;R<v.length;R+=1)W[R]=p(v[R],k+"["+R+"]");else{W={};for(D in v)Object.prototype.hasOwnProperty.call(v,D)&&(W[D]=p(v[D],k+"["+JSON.stringify(D)+"]"))}return W;case"number":case"string":case"boolean":return v}})(u,"$")}function Zt(u){try{return JSON.stringify(u)}catch{return JSON.stringify(Ua(u))}}class Ba{constructor(){this.globalLog=a=>{window.console&&window.console.log&&window.console.log(a)}}debug(...a){this.log(this.globalLog,a)}warn(...a){this.log(this.globalLogWarn,a)}error(...a){this.log(this.globalLogError,a)}globalLogWarn(a){window.console&&window.console.warn?window.console.warn(a):this.globalLog(a)}globalLogError(a){window.console&&window.console.error?window.console.error(a):this.globalLogWarn(a)}log(a,...l){var p=Qt.apply(this,arguments);rn.log?rn.log(p):rn.logToConsole&&a.bind(this)(p)}}const se=new Ba;var qa=function(u,a,l,p,v){(l.headers!==void 0||l.headersProvider!=null)&&se.warn(`To send headers with the ${p.toString()} request, you must use AJAX, rather than JSONP.`);var k=u.nextAuthCallbackID.toString();u.nextAuthCallbackID++;var R=u.getDocument(),D=R.createElement("script");u.auth_callbacks[k]=function(ee){v(null,ee)};var W="Pusher.auth_callbacks['"+k+"']";D.src=l.endpoint+"?callback="+encodeURIComponent(W)+"&"+a;var Y=R.getElementsByTagName("head")[0]||R.documentElement;Y.insertBefore(D,Y.firstChild)};const Ha=qa;class za{constructor(a){this.src=a}send(a){var l=this,p="Error loading "+l.src;l.script=document.createElement("script"),l.script.id=a.id,l.script.src=l.src,l.script.type="text/javascript",l.script.charset="UTF-8",l.script.addEventListener?(l.script.onerror=function(){a.callback(p
9)},l.script.onload=function(){a.callback(null)}):l.script.onreadystatechange=function(){(l.script.readyState==="loaded"||l.script.readyState==="complete")&&a.callback(null)},l.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(l.errorScript=document.createElement("script"),l.errorScript.id=a.id+"_error",l.errorScript.text=a.name+"('"+p+"');",l.script.async=l.errorScript.async=!1):l.script.async=!0;var v=document.getElementsByTagName("head")[0];v.insertBefore(l.script,v.firstChild),l.errorScript&&v.insertBefore(l.errorScript,l.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 Wa{constructor(a,l){this.url=a,this.data=l}send(a){if(!this.request){var l=$a(this.data),p=this.url+"/"+a.number+"?"+l;this.request=J.createScriptRequest(p),this.request.send(a)}}cleanup(){this.request&&this.request.cleanup()}}var Ka=function(u,a){return function(l,p){var v="http"+(a?"s":"")+"://",k=v+(u.host||u.options.host)+u.options.path,R=J.createJSONPRequest(k,l),D=J.ScriptReceivers.create(function(W,Y){m.remove(D),R.cleanup(),Y&&Y.host&&(u.host=Y.host),p&&p(W,Y)});R.send(D)}},Ja={name:"jsonp",getAgent:Ka};const Xa=Ja;function Gn(u,a,l){var p=u+(a.useTLS?"s":""),v=a.useTLS?a.hostTLS:a.hostNonTLS;return p+"://"+v+l}function Vn(u,a){var l="/app/"+u,p="?protocol="+f.PROTOCOL+"&client=js&version="+f.VERSION+(a?"&"+a:"");return l+p}var Ga={getInitial:function(u,a){var l=(a.httpPath||"")+Vn(u,"flash=false");return Gn("ws",a,l)}},Va={getInitial:function(u,a){var l=(a.httpPath||"/pusher")+Vn(u);return Gn("http",a,l)}},Ya={getInitial:function(u,a){return Gn("http",a,a.httpPath||"/pusher")},getPath:function(u,a){return Vn(u)}};class Qa{constructor(){this._callbacks={}}get(a){return this._callbacks[Yn(a)]}add(a,l,p){var v=Yn(a);this._callbacks[v]=this._callbacks[v]||[],this._callbacks[v].push({fn:l,context:p})}remove(a,l,p){if(!a&&!l&&!p){this._callbacks={};return}var v=a?[Yn(a)]:lt(this._callbacks);l||p?this.removeCallback(v,l,p):this.removeAllCallbacks(v)}removeCallback(a,l,p){B(a,function(v){this._callbacks[v]=Re(this._callbacks[v]||[],function(k){return l&&l!==k.fn||p&&p!==k.context}),this._callbacks[v].length===0&&delete this._callbacks[v]},this)}removeAllCallbacks(a){B(a,function(l){delete this._callbacks[l]},this)}}function Yn(u){return"_"+u}class Le{constructor(a){this.callbacks=new Qa,this.global_callbacks=[],this.failThrough=a}bind(a,l,p){return this.callbacks.add(a,l,p),this}bind_global(a){return this.global_callbacks.push(a),this}unbind(a,l,p){return this.callbacks.remove(a,l,p),this}unbind_global(a){return a?(this.global_callbacks=Re(this.global_callbacks||[],l=>l!==a),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(a,l,p){for(var v=0;v<this.global_callbacks.length;v++)this.global_callbacks[v](a,l);var k=this.callbacks.get(a),R=[];if(p?R.push(l,p):l&&R.push(l),k&&k.length>0)for(var v=0;v<k.length;v++)k[v].fn.apply(k[v].context||window,R);else this.failThrough&&this.failThrough(a,l);return this}}class Za extends Le{constructor(a,l,p,v,k){super(),this.initialize=J.transportConnectionInitializer,this.hooks=a,this.name=l,this.priority=p,this.key=v,this.options=k,this.state="new",this.timeline=k.timeline,this.activityTimeout=k.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var a=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(a,this.options)}catch(l){return ie.defer(()=>{this.onError(l),this.changeState("closed")}),!1}return this.bindListeners(),se.debug("Connecting",{transport:this.name,url:a}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(a){return this.state==="open"?(ie.defer(()=>{this.socket&&this.socket.send(a)}),!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}
9onError(a){this.emit("error",{type:"WebSocketError",error:a}),this.timeline.error(this.buildTimelineMessage({error:a.toString()}))}onClose(a){a?this.changeState("closed",{code:a.code,reason:a.reason,wasClean:a.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(a){this.emit("message",a)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=a=>{this.onError(a)},this.socket.onclose=a=>{this.onClose(a)},this.socket.onmessage=a=>{this.onMessage(a)},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(a,l){this.state=a,this.timeline.info(this.buildTimelineMessage({state:a,params:l})),this.emit(a,l)}buildTimelineMessage(a){return me({cid:this.id},a)}}class ut{constructor(a){this.hooks=a}isSupported(a){return this.hooks.isSupported(a)}createConnection(a,l,p,v){return new Za(this.hooks,a,l,p,v)}}var ec=new ut({urls:Ga,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!J.getWebSocketAPI()},isSupported:function(){return!!J.getWebSocketAPI()},getSocket:function(u){return J.createWebSocket(u)}}),wi={urls:Va,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},_i=me({getSocket:function(u){return J.HTTPFactory.createStreamingSocket(u)}},wi),Si=me({getSocket:function(u){return J.HTTPFactory.createPollingSocket(u)}},wi),Ti={isSupported:function(){return J.isXHRSupported()}},tc=new ut(me({},_i,Ti)),nc=new ut(me({},Si,Ti)),rc={ws:ec,xhr_streaming:tc,xhr_polling:nc};const en=rc;var ic=new ut({file:"sockjs",urls:Ya,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(u,a){return new window.SockJS(u,null,{js_path:_.getPath("sockjs",{useTLS:a.useTLS}),ignore_null_origin:a.ignoreNullOrigin})},beforeOpen:function(u,a){u.send(JSON.stringify({path:a}))}}),Ei={isSupported:function(u){var a=J.isXDRSupported(u.useTLS);return a}},sc=new ut(me({},_i,Ei)),oc=new ut(me({},Si,Ei));en.xdr_streaming=sc,en.xdr_polling=oc,en.sockjs=ic;const ac=en;class cc extends Le{constructor(){super();var a=this;typeof window<"u"&&window.addEventListener!==void 0&&(window.addEventListener("online",function(){a.emit("online")},!1),window.addEventListener("offline",function(){a.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var lc=new cc;class uc{constructor(a,l,p){this.manager=a,this.transport=l,this.minPingDelay=p.minPingDelay,this.maxPingDelay=p.maxPingDelay,this.pingDelay=void 0}createConnection(a,l,p,v){v=me({},v,{activityTimeout:this.pingDelay});var k=this.transport.createConnection(a,l,p,v),R=null,D=function(){k.unbind("open",D),k.bind("closed",W),R=ie.now()},W=Y=>{if(k.unbind("closed",W),Y.code===1002||Y.code===1003)this.manager.reportDeath();else if(!Y.wasClean&&R){var ee=ie.now()-R;ee<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(ee/2,this.minPingDelay))}};return k.bind("open",D),k}isSupported(a){return this.manager.isAlive()&&this.transport.isSupported(a)}}const xi={decodeMessage:function(u){try{var a=JSON.parse(u.data),l=a.data;if(typeof l=="string")try{l=JSON.parse(a.data)}catch{}var p={event:a.event,channel:a.channel,data:l};return a.user_id&&(p.user_id=a.user_id),p}catch(v){throw{type:"MessageParseError",error:v,data:u.data}}},encodeMessage:function(u){return JSON.stringify(u)},processHandshake:function(u){var a=xi.decodeMessage(u);if(a.event==="pusher:connection_established"){if(!a.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:a.data.socket_id,activityTimeout:a.data.activity_timeout*1e3}}else{if(a.event==="pusher:error")return{action:this.getCloseAction(a.data),error:this.getCloseError(a.data)};throw"Invalid handshake"}},getCloseAction:function(u){return u.code<4e3?u.code>=1002&&u.code<=1004?"backoff":null:u.code===4e3?"tls_only":u.code<4100?"refused":u.code<4200?"backoff":u.code<4300?"retry":"refused"},getCloseError:function(u){return u.code!==1e3&&u.code!==1001?{type:"PusherError",data:{code:u.code,message:u.reason||u.message}}:null}},ze=xi;class hc extends Le{constructor(a,l){super(),this.id=a,this.transport=l,this.activityTimeout=l.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(a){return this.transport.send(a)}send_event(a,l,p){var v={event:a,data:l};return p&&(v.channel=p),se.debug("Event sent",v),this.send(ze.encodeMessage(v))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var a={message:p=>{var v;try{v=ze.decodeMessage(p)}
9catch(k){this.emit("error",{type:"MessageParseError",error:k,data:p.data})}if(v!==void 0){switch(se.debug("Event recd",v),v.event){case"pusher:error":this.emit("error",{type:"PusherError",data:v.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",v)}},activity:()=>{this.emit("activity")},error:p=>{this.emit("error",p)},closed:p=>{l(),p&&p.code&&this.handleCloseEvent(p),this.transport=null,this.emit("closed")}},l=()=>{Te(a,(p,v)=>{this.transport.unbind(v,p)})};Te(a,(p,v)=>{this.transport.bind(v,p)})}handleCloseEvent(a){var l=ze.getCloseAction(a),p=ze.getCloseError(a);p&&this.emit("error",p),l&&this.emit(l,{action:l,error:p})}}class dc{constructor(a,l){this.transport=a,this.callback=l,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=a=>{this.unbindListeners();var l;try{l=ze.processHandshake(a)}catch(p){this.finish("error",{error:p}),this.transport.close();return}l.action==="connected"?this.finish("connected",{connection:new hc(l.id,this.transport),activityTimeout:l.activityTimeout}):(this.finish(l.action,{error:l.error}),this.transport.close())},this.onClosed=a=>{this.unbindListeners();var l=ze.getCloseAction(a)||"backoff",p=ze.getCloseError(a);this.finish(l,{error:p})},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(a,l){this.callback(me({transport:this.transport,action:a},l))}}class fc{constructor(a,l){this.timeline=a,this.options=l||{}}send(a,l){this.timeline.isEmpty()||this.timeline.send(J.TimelineTransport.getAgent(this,a),l)}}class Qn extends Le{constructor(a,l){super(function(p,v){se.debug("No callbacks on "+a+" for "+p)}),this.name=a,this.pusher=l,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(a,l){return l(null,{auth:""})}trigger(a,l){if(a.indexOf("client-")!==0)throw new A("Event '"+a+"' does not start with 'client-'");if(!this.subscribed){var p=C.buildLogSuffix("triggeringClientEvents");se.warn(`Client event triggered before channel 'subscription_succeeded' event . ${p}`)}return this.pusher.send_event(a,l,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(a){var l=a.event,p=a.data;if(l==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(a);else if(l==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(a);else if(l.indexOf("pusher_internal:")!==0){var v={};this.emit(l,p,v)}}handleSubscriptionSucceededEvent(a){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",a.data)}handleSubscriptionCountEvent(a){a.data.subscription_count&&(this.subscriptionCount=a.data.subscription_count),this.emit("pusher:subscription_count",a.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(a,l)=>{a?(this.subscriptionPending=!1,se.error(a.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:a.message},a instanceof V?{status:a.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:l.auth,channel_data:l.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 Zn extends Qn{authorize(a,l){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:a},l)}}class pc{constructor(){this.reset()}get(a){return Object.prototype.hasOwnProperty.call(this.members,a)?{id:a,info:this.members[a]}:null}each(a){Te(this.members,(l,p)=>{a(this.get(p))})}setMyID(a){this.myID=a}onSubscription(a){this.members=a.presence.hash,this.count=a.presence.count,this.me=this.get(this.myID)}addMember(a){return this.get(a.user_id)===null&&this.count++,this.members[a.user_id]=a.user_info,this.get(a.user_id
9)}removeMember(a){var l=this.get(a.user_id);return l&&(delete this.members[a.user_id],this.count--),l}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var mc=function(u,a,l,p){function v(k){return k instanceof l?k:new l(function(R){R(k)})}return new(l||(l=Promise))(function(k,R){function D(ee){try{Y(p.next(ee))}catch(he){R(he)}}function W(ee){try{Y(p.throw(ee))}catch(he){R(he)}}function Y(ee){ee.done?k(ee.value):v(ee.value).then(D,W)}Y((p=p.apply(u,a||[])).next())})};class gc extends Zn{constructor(a,l){super(a,l),this.members=new pc}authorize(a,l){super.authorize(a,(p,v)=>mc(this,void 0,void 0,function*(){if(!p)if(v=v,v.channel_data!=null){var k=JSON.parse(v.channel_data);this.members.setMyID(k.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 R=C.buildLogSuffix("authorizationEndpoint");se.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${R}, or the user should be signed in.`),l("Invalid auth response");return}l(p,v)}))}handleEvent(a){var l=a.event;if(l.indexOf("pusher_internal:")===0)this.handleInternalEvent(a);else{var p=a.data,v={};a.user_id&&(v.user_id=a.user_id),this.emit(l,p,v)}}handleInternalEvent(a){var l=a.event,p=a.data;switch(l){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(a);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(a);break;case"pusher_internal:member_added":var v=this.members.addMember(p);this.emit("pusher:member_added",v);break;case"pusher_internal:member_removed":var k=this.members.removeMember(p);k&&this.emit("pusher:member_removed",k);break}}handleSubscriptionSucceededEvent(a){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(a.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var bc=d(978),er=d(594);class vc extends Zn{constructor(a,l,p){super(a,l),this.key=null,this.nacl=p}authorize(a,l){super.authorize(a,(p,v)=>{if(p){l(p,v);return}let k=v.shared_secret;if(!k){l(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=(0,er.decode)(k),delete v.shared_secret,l(null,v)})}trigger(a,l){throw new ne("Client events are not currently supported for encrypted channels")}handleEvent(a){var l=a.event,p=a.data;if(l.indexOf("pusher_internal:")===0||l.indexOf("pusher:")===0){super.handleEvent(a);return}this.handleEncryptedEvent(l,p)}handleEncryptedEvent(a,l){if(!this.key){se.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!l.ciphertext||!l.nonce){se.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+l);return}let p=(0,er.decode)(l.ciphertext);if(p.length<this.nacl.secretbox.overheadLength){se.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${p.length}`);return}let v=(0,er.decode)(l.nonce);if(v.length<this.nacl.secretbox.nonceLength){se.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${v.length}`);return}let k=this.nacl.secretbox.open(p,v,this.key);if(k===null){se.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(R,D)=>{if(R){se.error(`Failed to make a request to the authEndpoint: ${D}. Unable to fetch new key, so dropping encrypted event`);return}if(k=this.nacl.secretbox.open(p,v,this.key),k===null){se.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(a,this.getDataToEmit(k))});return}this.emit(a,this.getDataToEmit(k))}getDataToEmit(a){let l=(0,bc.D4)(a);try{return JSON.parse(l)}catch{return l}}}class yc extends Le{constructor(a,l){super(),this.state="initialized",this.connection=null,this.key=a,this.options=l,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 p=J.getNetwork();p.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),p.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}switchCluster(a){this.key=a,this.updateStrategy(),this.retryIn(0)}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(a){return this.connection?this.connection.send(a):!1}send_event(a,l,p){return this.connection?this.connection.send_event(a,l,p):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var a=(l,p)=>{l?this.runner=this.strategy.connect(0,a):p.action==="error"?(this.emit
9("error",{type:"HandshakeError",error:p.error}),this.timeline.error({handshakeError:p.error})):(this.abortConnecting(),this.handshakeCallbacks[p.action](p))};this.runner=this.strategy.connect(0,a)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var a=this.abandonConnection();a.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(a){this.timeline.info({action:"retry",delay:a}),a>0&&this.emit("connecting_in",Math.round(a/1e3)),this.retryTimer=new H(a||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new H(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new H(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 H(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(a){return me({},a,{message:l=>{this.resetActivityCheck(),this.emit("message",l)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:l=>{this.emit("error",l)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(a){return me({},a,{connected:l=>{this.activityTimeout=Math.min(this.options.activityTimeout,l.activityTimeout,l.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(l.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let a=l=>p=>{p.error&&this.emit("error",{type:"WebSocketError",error:p.error}),l(p)};return{tls_only:a(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:a(()=>{this.disconnect()}),backoff:a(()=>{this.retryIn(1e3)}),retry:a(()=>{this.retryIn(0)})}}setConnection(a){this.connection=a;for(var l in this.connectionCallbacks)this.connection.bind(l,this.connectionCallbacks[l]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var a in this.connectionCallbacks)this.connection.unbind(a,this.connectionCallbacks[a]);var l=this.connection;return this.connection=null,l}}updateState(a,l){var p=this.state;if(this.state=a,p!==a){var v=a;v==="connected"&&(v+=" with new socket ID "+l.socket_id),se.debug("State changed",p+" -> "+v),this.timeline.info({state:a,params:l}),this.emit("state_change",{previous:p,current:a}),this.emit(a,l)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class wc{constructor(){this.channels={}}add(a,l){return this.channels[a]||(this.channels[a]=_c(a,l)),this.channels[a]}all(){return Ee(this.channels)}find(a){return this.channels[a]}remove(a){var l=this.channels[a];return delete this.channels[a],l}disconnect(){Te(this.channels,function(a){a.disconnect()})}}function _c(u,a){if(u.indexOf("private-encrypted-")===0){if(a.config.nacl)return Ne.createEncryptedChannel(u,a,a.config.nacl);let l="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",p=C.buildLogSuffix("encryptedChannelSupport");throw new ne(`${l}. ${p}`)}else{if(u.indexOf("private-")===0)return Ne.createPrivateChannel(u,a);if(u.indexOf("presence-")===0)return Ne.createPresenceChannel(u,a);if(u.indexOf("#")===0)throw new N('Cannot create a channel with name "'+u+'".');return Ne.createChannel(u,a)}}var Sc={createChannels(){return new wc},createConnectionManager(u,a){return new yc(u,a)},createChannel(u,a){return new Qn(u,a)},createPrivateChannel(u,a){return new Zn(u,a)},createPresenceChannel(u,a){return new gc(u,a)}
9,createEncryptedChannel(u,a,l){return new vc(u,a,l)},createTimelineSender(u,a){return new fc(u,a)},createHandshake(u,a){return new dc(u,a)},createAssistantToTheTransportManager(u,a,l){return new uc(u,a,l)}};const Ne=Sc;class Ci{constructor(a){this.options=a||{},this.livesLeft=this.options.lives||1/0}getAssistant(a){return Ne.createAssistantToTheTransportManager(this,a,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class We{constructor(a,l){this.strategies=a,this.loop=!!l.loop,this.failFast=!!l.failFast,this.timeout=l.timeout,this.timeoutLimit=l.timeoutLimit}isSupported(){return Me(this.strategies,ie.method("isSupported"))}connect(a,l){var p=this.strategies,v=0,k=this.timeout,R=null,D=(W,Y)=>{Y?l(null,Y):(v=v+1,this.loop&&(v=v%p.length),v<p.length?(k&&(k=k*2,this.timeoutLimit&&(k=Math.min(k,this.timeoutLimit))),R=this.tryStrategy(p[v],a,{timeout:k,failFast:this.failFast},D)):l(!0))};return R=this.tryStrategy(p[v],a,{timeout:k,failFast:this.failFast},D),{abort:function(){R.abort()},forceMinPriority:function(W){a=W,R&&R.forceMinPriority(W)}}}tryStrategy(a,l,p,v){var k=null,R=null;return p.timeout>0&&(k=new H(p.timeout,function(){R.abort(),v(!0)})),R=a.connect(l,function(D,W){D&&k&&k.isRunning()&&!p.failFast||(k&&k.ensureAborted(),v(D,W))}),{abort:function(){k&&k.ensureAborted(),R.abort()},forceMinPriority:function(D){R.forceMinPriority(D)}}}}class tr{constructor(a){this.strategies=a}isSupported(){return Me(this.strategies,ie.method("isSupported"))}connect(a,l){return Tc(this.strategies,a,function(p,v){return function(k,R){if(v[p].error=k,k){Ec(v)&&l(!0);return}B(v,function(D){D.forceMinPriority(R.transport.priority)}),l(null,R)}})}}function Tc(u,a,l){var p=ge(u,function(v,k,R,D){return v.connect(a,l(k,D))});return{abort:function(){B(p,xc)},forceMinPriority:function(v){B(p,function(k){k.forceMinPriority(v)})}}}function Ec(u){return Fa(u,function(a){return!!a.error})}function xc(u){!u.error&&!u.aborted&&(u.abort(),u.aborted=!0)}class Cc{constructor(a,l,p){this.strategy=a,this.transports=l,this.ttl=p.ttl||18e5,this.usingTLS=p.useTLS,this.timeline=p.timeline}isSupported(){return this.strategy.isSupported()}connect(a,l){var p=this.usingTLS,v=kc(p),k=v&&v.cacheSkipCount?v.cacheSkipCount:0,R=[this.strategy];if(v&&v.timestamp+this.ttl>=ie.now()){var D=this.transports[v.transport];D&&(["ws","wss"].includes(v.transport)||k>3?(this.timeline.info({cached:!0,transport:v.transport,latency:v.latency}),R.push(new We([D],{timeout:v.latency*2+1e3,failFast:!0}))):k++)}var W=ie.now(),Y=R.pop().connect(a,function ee(he,sn){he?(ki(p),R.length>0?(W=ie.now(),Y=R.pop().connect(a,ee)):l(he)):(Oc(p,sn.transport.name,ie.now()-W,k),l(null,sn))});return{abort:function(){Y.abort()},forceMinPriority:function(ee){a=ee,Y&&Y.forceMinPriority(ee)}}}}function nr(u){return"pusherTransport"+(u?"TLS":"NonTLS")}function kc(u){var a=J.getLocalStorage();if(a)try{var l=a[nr(u)];if(l)return JSON.parse(l)}catch{ki(u)}return null}function Oc(u,a,l,p){var v=J.getLocalStorage();if(v)try{v[nr(u)]=Zt({timestamp:ie.now(),transport:a,latency:l,cacheSkipCount:p})}catch{}}function ki(u){var a=J.getLocalStorage();if(a)try{delete a[nr(u)]}catch{}}class tn{constructor(a,{delay:l}){this.strategy=a,this.options={delay:l}}isSupported(){return this.strategy.isSupported()}connect(a,l){var p=this.strategy,v,k=new H(this.options.delay,function(){v=p.connect(a,l)});return{abort:function(){k.ensureAborted(),v&&v.abort()},forceMinPriority:function(R){a=R,v&&v.forceMinPriority(R)}}}}class kt{constructor(a,l,p){this.test=a,this.trueBranch=l,this.falseBranch=p}isSupported(){var a=this.test()?this.trueBranch:this.falseBranch;return a.isSupported()}connect(a,l){var p=this.test()?this.trueBranch:this.falseBranch;return p.connect(a,l)}}class Ac{constructor(a){this.strategy=a}isSupported(){return this.strategy.isSupported()}connect(a,l){var p=this.strategy.connect(a,function(v,k){k&&p.abort(),l(v,k)});return p}}function Ot(u){return function(){return u.isSupported()}}var Rc=function(u,a,l){var p={};function v(Ui,kl,Ol,Al,Rl){var Bi=l(u,Ui,kl,Ol,Al,Rl);return p[Ui]=Bi,Bi}var k=Object.assign({},a,{hostNonTLS:u.wsHost+":"+u.wsPort,hostTLS:u.wsHost+":"+u.wssPort,httpPath:u.wsPath}),R=Object.assign({},k,{useTLS:!0}),D=Object.assign({},a,{hostNonTLS:u.httpHost+":"+u.httpPort,hostTLS:u.httpHost+":"+u.httpsPort,httpPath:u.httpPath}),W={loop:!0,timeout:15e3,timeoutLimit:6e4},Y=new Ci({minPingDelay:1e4,maxPingDelay:u.activityTimeout}),ee=new Ci({lives:2,minPingDelay:1e4,maxPingDelay:u.activityTimeout}),he=v("ws","ws",3,k,Y),sn=v("wss","ws",3,R,Y),Sl=v("sockjs","sockjs",1,D),Ni=v("xhr_streaming","xhr_streaming",1,D,ee),Tl=v("xdr_streaming","xdr_streaming",1,D,ee),ji=v("xhr_polling","xhr_polling",1,D),El=v("xdr_polling","xdr_polling",1,D),Di=new We([he],W),xl=new We([sn],W),Cl=new We([Sl],W),Fi=new We([new kt(Ot(Ni),Ni,Tl)],W),Mi=new We([new kt(Ot(ji),ji,El)],W),$i=new We([new kt(Ot(Fi),new tr([Fi,new tn(Mi,{delay:4e3})]),Mi)],W),sr=new kt(Ot($i),$i,Cl),or;
9return a.useTLS?or=new tr([Di,new tn(sr,{delay:2e3})]):or=new tr([Di,new tn(xl,{delay:2e3}),new tn(sr,{delay:5e3})]),new Cc(new Ac(new kt(Ot(he),or,sr)),p,{ttl:18e5,timeline:a.timeline,useTLS:a.useTLS})};const Pc=Rc;function Ic(){var u=this;u.timeline.info(u.buildTimelineMessage({transport:u.name+(u.options.useTLS?"s":"")})),u.hooks.isInitialized()?u.changeState("initialized"):u.hooks.file?(u.changeState("initializing"),_.load(u.hooks.file,{useTLS:u.options.useTLS},function(a,l){u.hooks.isInitialized()?(u.changeState("initialized"),l(!0)):(a&&u.onError(a),u.onClose(),l(!1))})):u.onClose()}var Lc={getRequest:function(u){var a=new window.XDomainRequest;return a.ontimeout=function(){u.emit("error",new j),u.close()},a.onerror=function(l){u.emit("error",l),u.close()},a.onprogress=function(){a.responseText&&a.responseText.length>0&&u.onChunk(200,a.responseText)},a.onload=function(){a.responseText&&a.responseText.length>0&&u.onChunk(200,a.responseText),u.emit("finished",200),u.close()},a},abortRequest:function(u){u.ontimeout=u.onerror=u.onprogress=u.onload=null,u.abort()}};const Nc=Lc,jc=256*1024;class Dc extends Le{constructor(a,l,p){super(),this.hooks=a,this.method=l,this.url=p}start(a){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},J.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(a)}close(){this.unloader&&(J.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(a,l){for(;;){var p=this.advanceBuffer(l);
9if(p)this.emit("chunk",{status:a,data:p});else break}this.isBufferTooLong(l)&&this.emit("buffer_too_long")}advanceBuffer(a){var l=a.slice(this.position),p=l.indexOf(`
10`);return p!==-1?(this.position+=p+1,l.slice(0,p)):null}isBufferTooLong(a){return this.position===a.length&&a.length>jc}}var rr;(function(u){u[u.CONNECTING=0]="CONNECTING",u[u.OPEN=1]="OPEN",u[u.CLOSED=3]="CLOSED"})(rr||(rr={}));const Ke=rr;var Fc=1;class Mc{constructor(a,l){this.hooks=a,this.session=Ai(1e3)+"/"+qc(8),this.location=$c(l),this.readyState=Ke.CONNECTING,this.openStream()}send(a){return this.sendRaw(JSON.stringify([a]))}ping(){this.hooks.sendHeartbeat(this)}close(a,l){this.onClose(a,l,!0)}sendRaw(a){if(this.readyState===Ke.OPEN)try{return J.createSocketRequest("POST",Oi(Uc(this.location,this.session))).start(a),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(a,l,p){this.closeStream(),this.readyState=Ke.CLOSED,this.onclose&&this.onclose({code:a,reason:l,wasClean:p})}onChunk(a){if(a.status===200){this.readyState===Ke.OPEN&&this.onActivity();var l,p=a.data.slice(0,1);switch(p){case"o":l=JSON.parse(a.data.slice(1)||"{}"),this.onOpen(l);break;case"a":l=JSON.parse(a.data.slice(1)||"[]");for(var v=0;v<l.length;v++)this.onEvent(l[v]);break;case"m":l=JSON.parse(a.data.slice(1)||"null"),this.onEvent(l);break;case"h":this.hooks.onHeartbeat(this);break;case"c":l=JSON.parse(a.data.slice(1)||"[]"),this.onClose(l[0],l[1],!0);break}}}onOpen(a){this.readyState===Ke.CONNECTING?(a&&a.hostname&&(this.location.base=Bc(this.location.base,a.hostname)),this.readyState=Ke.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(a){this.readyState===Ke.OPEN&&this.onmessage&&this.onmessage({data:a})}onActivity(){this.onactivity&&this.onactivity()}onError(a){this.onerror&&this.onerror(a)}openStream(){this.stream=J.createSocketRequest("POST",Oi(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",a=>{this.onChunk(a)}),this.stream.bind("finished",a=>{this.hooks.onFinished(this,a)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(a){ie.defer(()=>{this.onError(a),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function $c(u){var a=/([^\?]*)\/*(\??.*)/.exec(u);return{base:a[1],queryString:a[2]}}function Uc(u,a){return u.base+"/"+a+"/xhr_send"}function Oi(u){var a=u.indexOf("?")===-1?"?":"&";return u+a+"t="+ +new Date+"&n="+Fc++}function Bc(u,a){var l=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(u);return l[1]+a+l[3]}function Ai(u){return J.randomInt(u)}function qc(u){for(var a=[],l=0;l<u;l++)a.push(Ai(32).toString(32));return a.join("")}const Hc=Mc;var zc={getReceiveURL:function(u,a){return u.base+"/"+a+"/xhr_streaming"+u.queryString},onHeartbeat:function(u){u.sendRaw("[]")},sendHeartbeat:function(u){u.sendRaw("[]")},onFinished:function(u,a){u.onClose(1006,"Connection interrupted ("+a+")",!1)}};const Wc=zc;var Kc={getReceiveURL:function(u,a){return u.base+"/"+a+"/xhr"+u.queryString},onHeartbeat:function(){},sendHeartbeat:function(u){u.sendRaw("[]")},onFinished:function(u,a){a===200?u.reconnect():u.onClose(1006,"Connection interrupted ("+a+")",!1)}};const Jc=Kc;var Xc={getRequest:function(u){var a=J.getXHRAPI(),l=new a;return l.onreadystatechange=l.onprogress=function(){switch(l.readyState){case 3:l.responseText&&l.responseText.length>0&&u.onChunk(l.status,l.responseText);break;case 4:l.responseText&&l.responseText.length>0&&u.onChunk(l.status,l.responseText),u.emit("finished",l.status),u.close();break}},l},abortRequest:function(u){u.onreadystatechange=null,u.abort()}};const Gc=Xc;var Vc={createStreamingSocket(u){return this.createSocket(Wc,u)},createPollingSocket(u){return this.createSocket(Jc,u)},createSocket(u,a){return new Hc(u,a)},createXHR(u,a){return this.createRequest(Gc,u,a)},createRequest(u,a,l){return new Dc(u,a,l)}};const Ri=Vc;Ri.createXDR=function(u,a){return this.createRequest(Nc,u,a)};var Yc={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:m,DependenciesReceivers:y,getDefaultStrategy:Pc,Transports:ac,transportConnectionInitializer:Ic,HTTPFactory:Ri,TimelineTransport:Xa,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(u){if(typeof window<"u"){window.Pusher=u;var a=()=>{this.onDocumentBody(u.ready)};window.JSON?a():_.load("json2",{},a)}},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:E,jsonp:Ha}},onDocumentBody(u){document.body?u():setTimeout(()=>{this.onDocumentBody(u)},0)},createJSONPRequest(u,a){return new Wa(u,a)},createScriptRequest(u){return new za(u)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var u=this.getXHRAPI();return new u},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return lc},createWebSocket(u){var a=this.getWebSocketAPI();return new a(u)}
10,createSocketRequest(u,a){if(this.isXHRSupported())return this.HTTPFactory.createXHR(u,a);if(this.isXDRSupported(a.indexOf("https:")===0))return this.HTTPFactory.createXDR(u,a);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var u=this.getXHRAPI();return!!u&&new u().withCredentials!==void 0},isXDRSupported(u){var a=u?"https:":"http:",l=this.getProtocol();return!!window.XDomainRequest&&l===a},addUnloadListener(u){window.addEventListener!==void 0?window.addEventListener("pagehide",u,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",u)},removeUnloadListener(u){window.addEventListener!==void 0?window.removeEventListener("pagehide",u,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",u)},randomInt(u){const a=window.crypto||window.msCrypto,l=Math.floor(Math.pow(2,32)/u)*u;let p;do p=a.getRandomValues(new Uint32Array(1))[0];while(p>=l);return p%u}};const J=Yc;var ir;(function(u){u[u.ERROR=3]="ERROR",u[u.INFO=6]="INFO",u[u.DEBUG=7]="DEBUG"})(ir||(ir={}));const nn=ir;class Qc{constructor(a,l,p){this.key=a,this.session=l,this.events=[],this.options=p||{},this.sent=0,this.uniqueID=0}log(a,l){a<=this.options.level&&(this.events.push(me({},l,{timestamp:ie.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(a){this.log(nn.ERROR,a)}info(a){this.log(nn.INFO,a)}debug(a){this.log(nn.DEBUG,a)}isEmpty(){return this.events.length===0}send(a,l){var p=me({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=[],a(p,(v,k)=>{v||this.sent++,l&&l(v,k)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class Zc{constructor(a,l,p,v){this.name=a,this.priority=l,this.transport=p,this.options=v||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(a,l){if(this.isSupported()){if(this.priority<a)return Pi(new U,l)}else return Pi(new Q,l);var p=!1,v=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),k=null,R=function(){v.unbind("initialized",R),v.connect()},D=function(){k=Ne.createHandshake(v,function(he){p=!0,ee(),l(null,he)})},W=function(he){ee(),l(he)},Y=function(){ee();var he;he=Zt(v),l(new G(he))},ee=function(){v.unbind("initialized",R),v.unbind("open",D),v.unbind("error",W),v.unbind("closed",Y)};return v.bind("initialized",R),v.bind("open",D),v.bind("error",W),v.bind("closed",Y),v.initialize(),{abort:()=>{p||(ee(),k?k.close():v.close())},forceMinPriority:he=>{p||this.priority<he&&(k?k.close():v.close())}}}}function Pi(u,a){return ie.defer(function(){a(u)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:el}=J;var tl=function(u,a,l,p,v,k){var R=el[l];if(!R)throw new oe(l);var D=(!u.enabledTransports||Se(u.enabledTransports,a)!==-1)&&(!u.disabledTransports||Se(u.disabledTransports,a)===-1),W;return D?(v=Object.assign({ignoreNullOrigin:u.ignoreNullOrigin},v),W=new Zc(a,p,k?k.getAssistant(R):R,v)):W=nl,W},nl={isSupported:function(){return!1},connect:function(u,a){var l=ie.defer(function(){a(new Q)});return{abort:function(){l.ensureAborted()},forceMinPriority:function(){}}}};function rl(u){if(u==null)throw"You must pass an options object";if(u.cluster==null)throw"Options object must provide a cluster";"disableStats"in u&&se.warn("The disableStats option is deprecated in favor of enableStats")}const il=(u,a)=>{var l="socket_id="+encodeURIComponent(u.socketId);for(var p in a.params)l+="&"+encodeURIComponent(p)+"="+encodeURIComponent(a.params[p]);if(a.paramsProvider!=null){let v=a.paramsProvider();for(var p in v)l+="&"+encodeURIComponent(p)+"="+encodeURIComponent(v[p])}return l},sl=u=>{if(typeof J.getAuthorizers()[u.transport]>"u")throw`'${u.transport}' is not a recognized auth transport`;return(a,l)=>{const p=il(a,u);J.getAuthorizers()[u.transport](J,p,u,x.UserAuthentication,l)}},ol=(u,a)=>{var l="socket_id="+encodeURIComponent(u.socketId);l+="&channel_name="+encodeURIComponent(u.channelName);for(var p in a.params)l+="&"+encodeURIComponent(p)+"="+encodeURIComponent(a.params[p]);if(a.paramsProvider!=null){let v=a.paramsProvider();for(var p in v)l+="&"+encodeURIComponent(p)+"="+encodeURIComponent(v[p])}return l},al=u=>{if(typeof J.getAuthorizers()[u.transport]>"u")throw`'${u.transport}' is not a recognized auth transport`;return(a,l)=>{const p=ol(a,u);J.getAuthorizers()[u.transport](J,p,u,x.ChannelAuthorization,l)}},cl=(u,a,l)=>{const p={authTransport:a.transport,authEndpoint:a.endpoint,auth:{params:a.params,headers:a.headers}};return(v,k)=>{const R=u.channel(v.channelName);l(R,p).authorize(v.socketId,k)}};function Ii(u,a){let l={activityTimeout:u.activityTimeout||f.activityTimeout,cluster:u.cluster,httpPath:u.httpPath||f.httpPath,httpPort:u.httpPort||f.httpPort,httpsPort:u.httpsPort||f.httpsPort,pongTimeout:u.pongTimeout||f.pongTimeout,statsHost:u.statsHost||f.stats_host,unavailableTimeout:u.unavailableTimeout||f.unavailableTimeout,wsPath:u.wsPath||f.wsPath,wsPort:u.wsPort||f.wsPort,wssPort:u.wssPort||f.wssPort,enableStats:fl(u),httpHost:ll(u),useTLS:dl(u),wsHost:ul(u),userAuthenticator:pl(u),channelAuthorizer:gl(u,a)};return"disabledTransports"in u&&(l.disabledTransports=u.disabledTransports),"enabledTransports"in u&&(l.enabledTransports=u.enabledTransports),"ignoreNullOrigin"in u&&(l.ignoreNullOrigin=u.ignoreNullOrigin),"timelineParams"in u&&(l.timelineParams=u.timelineParams),"nacl"in u&&(l.nacl=u.n
10acl),l}function ll(u){return u.httpHost?u.httpHost:u.cluster?`sockjs-${u.cluster}.pusher.com`:f.httpHost}function ul(u){return u.wsHost?u.wsHost:hl(u.cluster)}function hl(u){return`ws-${u}.pusher.com`}function dl(u){return J.getProtocol()==="https:"?!0:u.forceTLS!==!1}function fl(u){return"enableStats"in u?u.enableStats:"disableStats"in u?!u.disableStats:!1}const Li=u=>"customHandler"in u&&u.customHandler!=null;function pl(u){const a=Object.assign(Object.assign({},f.userAuthentication),u.userAuthentication);return Li(a)?a.customHandler:sl(a)}function ml(u,a){let l;return"channelAuthorization"in u?l=Object.assign(Object.assign({},f.channelAuthorization),u.channelAuthorization):(l={transport:u.authTransport||f.authTransport,endpoint:u.authEndpoint||f.authEndpoint},"auth"in u&&("params"in u.auth&&(l.params=u.auth.params),"headers"in u.auth&&(l.headers=u.auth.headers)),"authorizer"in u&&(l.customHandler=cl(a,l,u.authorizer))),l}function gl(u,a){const l=ml(u,a);return Li(l)?l.customHandler:al(l)}class bl extends Le{constructor(a){super(function(l,p){se.debug(`No callbacks on watchlist events for ${l}`)}),this.pusher=a,this.bindWatchlistInternalEvent()}handleEvent(a){a.data.events.forEach(l=>{this.emit(l.name,l)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",a=>{var l=a.event;l==="pusher_internal:watchlist_events"&&this.handleEvent(a)})}}function vl(){let u,a;return{promise:new Promise((p,v)=>{u=p,a=v}),resolve:u,reject:a}}const yl=vl;class wl extends Le{constructor(a){super(function(l,p){se.debug("No callbacks on user for "+l)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(l,p)=>{if(l){se.warn(`Error during signin: ${l}`),this.emit("pusher:signin_error",Object.assign({},{type:"AuthError",error:l.message},l instanceof V?{status:l.status}:{})),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:p.auth,user_data:p.user_data})},this.pusher=a,this.pusher.connection.bind("state_change",({previous:l,current:p})=>{l!=="connected"&&p==="connected"&&this._signin(),l==="connected"&&p!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new bl(a),this.pusher.connection.bind("message",l=>{var p=l.event;p==="pusher:signin_success"&&this._onSigninSuccess(l.data),this.serverToUserChannel&&this.serverToUserChannel.name===l.channel&&this.serverToUserChannel.handleEvent(l)})}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(a){try{this.user_data=JSON.parse(a.user_data)}catch{se.error(`Failed parsing user data after signin: ${a.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){se.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const a=l=>{l.subscriptionPending&&l.subscriptionCancelled?l.reinstateSubscription():!l.subscriptionPending&&this.pusher.connection.state==="connected"&&l.subscribe()};this.serverToUserChannel=new Qn(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((l,p)=>{l.indexOf("pusher_internal:")===0||l.indexOf("pusher:")===0||this.emit(l,p)}),a(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:a,resolve:l}=yl();a.done=!1;const p=()=>{a.done=!0};a.then(p).catch(p),this.signinDonePromise=a,this._signinDoneResolve=l}}class fe{static ready(){fe.isReady=!0;for(var a=0,l=fe.instances.length;a<l;a++)fe.instances[a].connect()}static getClientFeatures(){return lt(Ct({ws:J.Transports.ws},function(a){return a.isSupported({})}))}constructor(a,l){_l(a),rl(l),this.key=a,this.options=l,this.config=Ii(this.options,this),this.channels=Ne.createChannels(),this.global_emitter=new Le,this.sessionID=J.randomInt(1e9),this.timeline=new Qc(this.key,this.sessionID,{cluster:this.config.cluster,features:fe.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:nn.INFO,version:f.VERSION}),this.config.enableStats&&(this.timelineSender=Ne.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+J.TimelineTransport.name}));var p=v=>J.getDefaultStrategy(this.config,v,tl);this.connection=Ne.createConnectionManager(this.key,{getStrategy:p,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",v=>{var k=v.event,R=k.indexOf("pusher_internal:")===0;if(v.channel){var D=this.channel(v.channel);D&&D.handleEvent(v)}R||this.global_emitter.emit(v.event,v.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",v=>{se.warn(v)}),fe.instances.push(this),this.timeline.info({instances:fe.instances.length}),this.user=new wl(this),fe.isReady&&this.connect()}switchCluster(a){const{appKey:l,cluster:p}=a;this.key=l,this.options=Object.assign(Object.assign({},this.options),{cluster:p}),this.config=Ii(this.options,this),this.connection.switchCluster(this.key)}channel(a){return this.channels.find(a)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var a=this.connection.isUsingTLS(),l=this.timelineSender;
10this.timelineSenderTimer=new re(6e4,function(){l.send(a)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(a,l,p){return this.global_emitter.bind(a,l,p),this}unbind(a,l,p){return this.global_emitter.unbind(a,l,p),this}bind_global(a){return this.global_emitter.bind_global(a),this}unbind_global(a){return this.global_emitter.unbind_global(a),this}unbind_all(a){return this.global_emitter.unbind_all(),this}subscribeAll(){var a;for(a in this.channels.channels)this.channels.channels.hasOwnProperty(a)&&this.subscribe(a)}subscribe(a){var l=this.channels.add(a,this);return l.subscriptionPending&&l.subscriptionCancelled?l.reinstateSubscription():!l.subscriptionPending&&this.connection.state==="connected"&&l.subscribe(),l}unsubscribe(a){var l=this.channels.find(a);l&&l.subscriptionPending?l.cancelSubscription():(l=this.channels.remove(a),l&&l.subscribed&&l.unsubscribe())}send_event(a,l,p){return this.connection.send_event(a,l,p)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}fe.instances=[],fe.isReady=!1,fe.logToConsole=!1,fe.Runtime=J,fe.ScriptReceivers=J.ScriptReceivers,fe.DependenciesReceivers=J.DependenciesReceivers,fe.auth_callbacks=J.auth_callbacks;const rn=fe;function _l(u){if(u==null)throw"You must pass your app key when you instantiate Pusher."}J.setup(fe)}},r={};function i(o){var h=r[o];if(h!==void 0)return h.exports;var d=r[o]={exports:{}};return n[o].call(d.exports,d,d.exports,i),d.exports}i.d=(o,h)=>{for(var d in h)i.o(h,d)&&!i.o(o,d)&&Object.defineProperty(o,d,{enumerable:!0,get:h[d]})},i.o=(o,h)=>Object.prototype.hasOwnProperty.call(o,h);var s=i(721);return s})())})(hr)),hr.exports}var Bh=Uh();const qh=$h(Bh);window.Pusher=qh;window.Echo=new Mh({broadcaster:"reverb",key:"f52eee5d3154def059084c6e369b8c30",wsHost:"smartcomm.ai",wsPort:"443",wssPort:"443",forceTLS:!0,enabledTransports:["ws","wss"]});window.axios=le;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";var Sr=!1,Tr=!1,Qe=[],Er=-1,Vr=!1;function Hh(e){Kh(e)}function zh(){Vr=!0}function Wh(){Vr=!1,po()}function Kh(e){Qe.includes(e)||Qe.push(e),po()}function Jh(e){let t=Qe.indexOf(e);t!==-1&&t>Er&&Qe.splice(t,1)}function po(){if(!Tr&&!Sr){if(Vr)return;Sr=!0,queueMicrotask(Xh)}}function Xh(){Sr=!1,Tr=!0;for(let e=0;e<Qe.length;e++)Qe[e](),Er=e;Qe.length=0,Er=-1,Tr=!1}var _t,ct,St,mo,xr=!0;function Gh(e){xr=!1,e(),xr=!0}function Vh(e){_t=e.reactive,St=e.release,ct=t=>e.effect(t,{scheduler:n=>{xr?Hh(n):n()}}),mo=e.raw}function cs(e){ct=e}function Yh(e){let t=()=>{};return[r=>{let i=ct(r);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(s=>s())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),St(i))},i},()=>{t()}]}function go(e,t){let n=!0,r,i,s=ct(()=>{let o=e(),h=JSON.stringify(o);if(!n&&(typeof o=="object"||o!==r)){let d=typeof r=="object"?JSON.parse(i):r;queueMicrotask(()=>{t(o,d)})}r=o,i=h,n=!1});return()=>St(s)}async function Qh(e){zh();try{await e(),await Promise.resolve()}finally{Wh()}}var bo=[],vo=[],yo=[];function Zh(e){yo.push(e)}function Yr(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,vo.push(t))}function wo(e){bo.push(e)}function _o(e,t,n){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(n)}function So(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([n,r])=>{(t===void 0||t.includes(n))&&(r.forEach(i=>i()),delete e._x_attributeCleanups[n])})}function ed(e){for(e._x_effects?.forEach(Jh);e._x_cleanups?.length;)e._x_cleanups.pop()()}var Qr=new MutationObserver(ni),Zr=!1;function ei(){Qr.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Zr=!0}function To(){td(),Qr.disconnect(),Zr=!1}var Rt=[];function td(){let e=Qr.takeRecords();Rt.push(()=>e.length>0&&ni(e));let t=Rt.length;queueMicrotask(()=>{if(Rt.length===t)for(;Rt.length>0;)Rt.shift()()})}function ce(e){if(!Zr)return e();To();let t=e();return ei(),t}var ti=!1,xn=[];
vendor: 19,981 bytes, lines 10-14
10function nd(){ti=!0}function rd(){ti=!1,ni(xn),xn=[]}function ni(e){if(ti){xn=xn.concat(e);return}let t=[],n=new Set,r=new Map,i=new Map;for(let s=0;s<e.length;s++)if(!e[s].target._x_ignoreMutationObserver&&(e[s].type==="childList"&&(e[s].removedNodes.forEach(o=>{o.nodeType===1&&o._x_marker&&n.add(o)}),e[s].addedNodes.forEach(o=>{if(o.nodeType===1){if(n.has(o)){n.delete(o);return}o._x_marker||t.push(o)}})),e[s].type==="attributes")){let o=e[s].target,h=e[s].attributeName,d=e[s].oldValue,g=()=>{r.has(o)||r.set(o,[]),r.get(o).push({name:h,value:o.getAttribute(h)})},m=()=>{i.has(o)||i.set(o,[]),i.get(o).push(h)};o.hasAttribute(h)&&d===null?g():o.hasAttribute(h)?(m(),g()):m()}i.forEach((s,o)=>{So(o,s)}),r.forEach((s,o)=>{bo.forEach(h=>h(o,s))});for(let s of n)t.some(o=>o.contains(s))||vo.forEach(o=>o(s));for(let s of t)s.isConnected&&yo.forEach(o=>o(s));t=null,n=null,r=null,i=null}function Eo(e){return st(it(e))}function Yt(e,t,n){return e._x_dataStack=[t,...it(n||e)],()=>{e._x_dataStack=e._x_dataStack.filter(r=>r!==t)}}function it(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?it(e.host):e.parentNode?it(e.parentNode):[]}function st(e){return new Proxy({objects:e},id)}function xo(e,t){return e===null||e===Object.prototype?null:Object.prototype.hasOwnProperty.call(e,t)?e:xo(Object.getPrototypeOf(e),t)}var id={ownKeys({objects:e}){return Array.from(new Set(e.flatMap(t=>Object.keys(t))))},has({objects:e},t){return t==Symbol.unscopables?!1:e.some(n=>Object.prototype.hasOwnProperty.call(n,t)||Reflect.has(n,t))},get({objects:e},t,n){return t=="toJSON"?sd:Reflect.get(e.find(r=>Reflect.has(r,t))||{},t,n)},set({objects:e},t,n,r){let i;for(const o of e)if(i=xo(o,t),i)break;i||(i=e[e.length-1]);const s=Object.getOwnPropertyDescriptor(i,t);return s?.set&&s?.get?s.set.call(r,n)||!0:Reflect.set(i,t,n)}};function sd(){return Reflect.ownKeys(this).reduce((t,n)=>(t[n]=Reflect.get(this,n),t),{})}function ri(e){let t=r=>typeof r=="object"&&!Array.isArray(r)&&r!==null,n=(r,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(r)).forEach(([s,{value:o,enumerable:h}])=>{if(h===!1||o===void 0||typeof o=="object"&&o!==null&&o.__v_skip)return;let d=i===""?s:`${i}.${s}`;typeof o=="object"&&o!==null&&o._x_interceptor?r[s]=o.initialize(e,d,s):t(o)&&o!==r&&!(o instanceof Element)&&n(o,d)})};return n(e)}function Co(e,t=()=>{}){let n={initialValue:void 0,_x_interceptor:!0,initialize(r,i,s){return e(this.initialValue,()=>od(r,i),o=>Cr(r,i,o),i,s)}};return t(n),r=>{if(typeof r=="object"&&r!==null&&r._x_interceptor){let i=n.initialize.bind(n);n.initialize=(s,o,h)=>{let d=r.initialize(s,o,h);return n.initialValue=d,i(s,o,h)}}else n.initialValue=r;return n}}function od(e,t){return t.split(".").reduce((n,r)=>n[r],e)}function Cr(e,t,n){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=n;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),Cr(e[t[0]],t.slice(1),n)}}var ko={};function ke(e,t){ko[e]=t}function Ht(e,t){let n=ad(t);return Object.entries(ko).forEach(([r,i])=>{Object.defineProperty(e,`$${r}`,{get(){return i(t,n)},enumerable:!1})}),e}function ad(e){let[t,n]=No(e),r={interceptor:Co,...t};return Yr(e,n),r}function cd(e,t,n,...r){try{return n(...r)}catch(i){zt(i,e,t)}}function zt(...e){return Oo(...e)}var Oo=ud;function ld(e){Oo=e}function ud(e,t,n=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:n}),console.warn(`Alpine Expression Error: ${e.message}
11
12${n?'Expression: "'+n+`"
13
14`:""}`,t),setTimeout(()=>{throw e},0)}var mt=!0;function Ao(e){let t=mt;mt=!1;let n=e();return mt=t,n}function Ze(e,t,n={}){let r;return ye(e,t)(i=>r=i,n),r}function ye(...e){return Ro(...e)}var Ro=()=>{};function hd(e){Ro=e}var Po;function dd(e){Po=e}function fd(e,t){let n={};Ht(n,e);let r=[n,...it(e)],i=typeof t=="function"?pd(r,t):gd(r,t,e);return cd.bind(null,e,t,i)}function pd(e,t){return(n=()=>{},{scope:r={},params:i=[],context:s}={})=>{if(!mt){Wt(n,t,st([r,...e]),i);return}let o=t.apply(st([r,...e]),i);Wt(n,o)}}var dr={};function md(e,t){if(dr[e])return dr[e];let n=Object.getPrototypeOf(async function(){}).constructor,r=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e,s=(()=>{try{let o=new n(["__self","scope"],`with (scope) { __self.result = ${r} }; __self.finished = true; return __self.result;`);return Object.defineProperty(o,"name",{value:`[Alpine] ${e}`}),o}catch(o){return zt(o,t,e),Promise.resolve()}})();return dr[e]=s,s}function gd(e,t,n){let r=md(t,n);return(i=()=>{},{scope:s={},params:o=[],context:h}={})=>{r.result=void 0,r.finished=!1;let d=st([s,...e]);if(typeof r=="function"){let g=r.call(h,r,d).catch(m=>zt(m,n,t));r.finished?(Wt(i,r.result,d,o,n),r.result=void 0):g.then(m=>{Wt(i,m,d,o,n)}).catch(m=>zt(m,n,t)).finally(()=>r.result=void 0)}}}function Wt(e,t,n,r,i){if(mt&&typeof t=="function"){let s=t.apply(n,r);s instanceof Promise?s.then(o=>Wt(e,o,n,r)).catch(o=>zt(o,i,t)):e(s)}else typeof t=="object"&&t instanceof Promise?t.then(s=>e(s)):e(t)}function bd(...e){return Po(...e)}function vd(e,t,n={}){let r={};Ht(r,e);let i=[r,...it(e)],s=st([n.scope??{},...i]),o=n.params??[];if(t.includes("await")){let h=Object.getPrototypeOf(async function(){}).constructor,d=/^[\n\s]*if.*\(.*\)/.test(t.trim())||/^(let|const)\s/.test(t.trim())?`(async()=>{ ${t} })()`:t;return new h(["scope"],`with (scope) { let __result = ${d}; return __result }`).call(n.context,s)}else{let h=/^[\n\s]*if.*\(.*\)/.test(t.trim())||/^(let|const)\s/.test(t.trim())?`(()=>{ ${t} })()`:t,g=new Function(["scope"],`with (scope) { let __result = ${h}; return __result }`).call(n.context,s);return typeof g=="function"&&mt?g.apply(s,o):g}}var ii="x-";function Tt(e=""){return ii+e}function yd(e){ii=e}var Cn={};function de(e,t){return Cn[e]=t,{before(n){if(!Cn[n]){console.warn(String.raw`Cannot find directive \`${n}\`. \`${e}\` will use the default order of execution`);return}const r=Ve.indexOf(n);Ve.splice(r>=0?r:Ve.indexOf("DEFAULT"),0,e)}}}function wd(e){return Object.keys(Cn).includes(e)}function si(e,t,n){if(t=Array.from(t),e._x_virtualDirectives){let s=Object.entries(e._x_virtualDirectives).map(([h,d])=>({name:h,value:d})),o=Io(s);s=s.map(h=>o.find(d=>d.name===h.name)?{name:`x-bind:${h.name}`,value:`"${h.value}"`}:h),t=t.concat(s)}let r={};return t.map(Fo((s,o)=>r[s]=o)).filter($o).map(Td(r,n)).sort(Ed).map(s=>Sd(e,s))}function Io(e){return Array.from(e).map(Fo()).filter(t=>!$o(t))}var kr=!1,jt=new Map,Lo=Symbol();function _d(e){kr=!0;let t=Symbol();Lo=t,jt.set(t,[]);let n=()=>{for(;jt.get(t).length;)jt.get(t).shift()();jt.delete(t)},r=()=>{kr=!1,n()};e(n),r()}function No(e){let t=[],n=h=>t.push(h),[r,i]=Yh(e);return t.push(i),[{Alpine:xt,effect:r,cleanup:n,evaluateLater:ye.bind(ye,e),evaluate:Ze.bind(Ze,e)},()=>t.forEach(h=>h())]}function Sd(e,t){let n=()=>{},r=Cn[t.type]||n,[i,s]=No(e);_o(e,t.original,s);let o=()=>{e._x_ignore||e._x_ignoreSelf||(r.inline&&r.inline(e,t,i),r=r.bind(r,e,t,i),kr?jt.get(Lo).push(r):r())};return o.runCleanups=s,o}var jo=(e,t)=>({name:n,value:r})=>(n.startsWith(e)&&(n=n.replace(e,t)),{name:n,value:r}),Do=e=>e;function Fo(e=()=>{}){return({name:t,value:n})=>{let{name:r,value:i}=Mo.reduce((s,o)=>o(s),{name:t,value:n});return r!==t&&e(r,t),{name:r,value:i}}}var Mo=[];function oi(e){Mo.push(e)}function $o({name:e}){return Uo().test(e)}var Uo=()=>new RegExp(`^${ii}([^:^.]+)\\b`);function Td(e,t){return({name:n,value:r})=>{n===r&&(r="");let i=n.match(Uo()),s=n.match(/:([a-zA-Z0-9\-_:]+)/),o=n.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],h=t||e[n]||n;return{type:i?i[1]:null,value:s?s[1]:null,modifiers:o.map(d=>d.replace(".","")),expression:r,original:h}}}var Or="DEFAULT",Ve=["ignore","ref","id","data","anchor","bind","init","for","model","modelable","transition","show","if",Or,"teleport"];function Ed(e,t){let n=Ve.indexOf(e.type)===-1?Or:e.type,r=Ve.indexOf(t.type)===-1?Or:t.type;return Ve.indexOf(n)-Ve.indexOf(r)}function Mt(e,t,n={},r={}){return e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0,...r}))}function ot(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>ot(i,t));return}let n=!1;if(t(e,()=>n=!0),n)return;let r=e.firstElementChild;for(;r;)ot(r,t),r=r.nextElementSibling}function Ie(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var ls=!1;function xd(){ls&&Ie("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),ls=!0,document.body||Ie("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),Mt(document,"alpine:init"),Mt(document,"alpine:initializing"),ei(),Zh(t=>Fe(t,ot)),Yr(t=>Et(t)),wo((t,n)=>{si(t,n).forEach(r=>r())});let e=t=>!Bn(t.parentElement,!0);Array.from(document.querySelectorAll(Ho().join(","))).filter(e).forEach(t=>{Fe(t)}),Mt(document,"alpine:initialized"),setTimeout(()=>{Ad()})}var ai=[],Bo=[];function qo(){return ai.map(e=>e())}function Ho(){return ai.concat(Bo).map(e=>e())}function zo(e){ai.push(e)}function Wo(e){Bo.push(e)}function Bn(e,t=!1){return De(e,n=>{if((t?Ho():qo()).some(i=>n.matches(i)))return!0})}function De(e,t){if(e){if(t(e))return e;if(e._x_teleportBack)return De(e._x_teleportBack,t);if(e.parentNode instanceof ShadowRoot)return De(e.parentNode.host,t);if(e.parentElement)return De(e.parentElement,t)}}function Cd(e){return qo().some(t=>e.matches(t))}var Ko=[];function kd(e){Ko.push(e)}var Od=1;function Fe(e,t=ot,n=()=>{}){De(e,r=>r._x_ignore)||_d(()=>{t(e,(r,i)=>{r._x_marker||(n(r,i),Ko.forEach(s=>s(r,i)),si(r,r.attributes).forEach(s=>s()),r._x_ignore||(r._x_marker=Od++),r._x_ignore&&i())})})}function Et(e,t=ot){t(e,n=>{ed(n),So(n),delete n._x_marker})}function Ad(){[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([t,n,r])=>{wd(n)||r.some(i=>{if(document.querySelector(i))return Ie(`found "${i}", but missing ${t} plugin`),!0})})}var Ar=[],ci=!1;function li(e=()=>{}){return queueMicrotask(()=>{ci||setTimeout(()=>{Rr()})}),new Promise(t=>{Ar.push(()=>{e(),t()})})}function Rr(){for(ci=!1;Ar.length;)Ar.shift()()}function Rd(){ci=!0}function ui(e,t){return Array.isArray(t)?us(e,t.join(" ")):typeof t=="object"&&t!==null?Pd(e,t):typeof t=="function"?ui(e,t()):us(e,t)}function Pr(e){return e.split(/\s/).filter(Boolean)}function us(e,t){let n=i=>Pr(i).filter(s=>!e.classList.contains(s)).filter(Boolean),r=i=>(e.classList.add(...i),()=>{e.classList.remove(...i)});return t=t===!0?t="":t||"",r(n(t))}function Pd(e,t){let n=Object.entries(t).flatMap(([o,h])=>h?Pr(o):!1).filter(Boolean),r=Object.entries(t).flatMap(([o,h])=>h?!1:Pr(o)).filter(Boolean),i=[],s=[];return r.forEach(o=>{e.classList.contains(o)&&(e.classList.remove(o),s.push(o))}),n.forEach(o=>{e.classList.contains(o)||(e.classList.add(o),i.push(o))}),()=>{s.forEach(o=>e.classList.add(o)),i.forEach(o=>e.classList.remove(o))}}function qn(e,t){return typeof t=="object"&&t!==null?Id(e,t):Ld(e,t)}function Id(e,t){let n={};return Object.entries(t).forEach(([r,i])=>{n[r]=e.style[r],r.startsWith("--")||(r=Nd(r)),e.style.setProperty(r,i)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{qn(e,n)}}function Ld(e,t){let n=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",n||"")}}function Nd(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Ir(e,t=()=>{}){let n=!1;return function(){n?t.apply(this,arguments):(n=!0,e.apply(this,arguments))}}de("transition",(e,{value:t,modifiers:n,expression:r},{evaluate:i})=>{typeof r=="function"&&(r=i(r)),r!==!1&&(!r||typeof r=="boolean"?Dd(e,n,t):jd(e,r,t))});function jd(e,t,n){Jo(e,ui,""),{enter:i=>{e._x_transition.enter.during=i},"enter-start":i=>{e._x_transition.enter.start=i},"enter-end":i=>{e._x_transition.enter.end=i},leave:i=>{e._x_transition.leave.during=i},"leave-start":i=>{e._x_transition.leave.start=i},"leave-end":i=>{e._x_transition.leave.end=i}}[n](t)}function Dd(e,t,n){Jo(e,qn);let r=!t.includes("in")&&!t.includes("out")&&!n,i=r||t.includes("in")||["enter"].includes(n),s=r||t.includes("out")||["leave"].includes(n);t.includes("in")&&!r&&(t=t.filter((S,C)=>C<t.indexOf("out"))),t.includes("out")&&!r&&(t=t.filter((S,C)=>C>t.indexOf("out")));let o=!t.includes("opacity")&&!t.includes("scale"),h=o||t.includes("opacity"),d=o||t.includes("scale"),g=h?0:1,m=d?Pt(t,"scale",95)/100:1,c=Pt(t,"delay",0)/1e3,f=Pt(t,"origin","center"),b="opacity, transform",y=Pt(t,"duration",150)/1e3,_=Pt(t,"duration",75)/1e3,T="cubic-bezier(0.4, 0.0, 0.2, 1)";i&&(e._x_transition.enter.during={transformOrigin:f,transitionDelay:`${c}s`,transitionProperty:b,transitionDuration:`${y}s`,transitionTimingFunction:T},e._x_transition.enter.start={opacity:g,transform:`scale(${m})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),s&&(e._x_transition.leave.during={transformOrigin:f,transitionDelay:`${c}s`,transitionProperty:b,transitionDuration:`${_}s`,transitionTimingFunction:T},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:g,transform:`scale(${m})`})}function Jo(e,t,n={}){e._x_transition||(e._x_transition={enter:{during:n,start:n,end:n},leave:{during:n,start:n,end:n},in(r=()=>{},i=()=>{}){Lr(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},r,i)},out(r=()=>{},i=()=>{}){Lr(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},r,i)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,n,r){const i=document.visibilityState==="visible"?requestAnimationFrame:setTimeout;let s=()=>i(n);if(t){e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(n):s():e._x_transition?e._x_transition.in(n):s();return}e._x_hidePromise=e._x_transition?new Promise((o,h)=>{e._x_transition.out(()=>{},()=>o(r)),e._x_transitioning&&e._x_transitioning.beforeCancel(()=>h({isFromCancelledTransition:!0}))}):Promise.resolve(r),queueMicrotask(()=>{let o=Xo(e);o?(o._x_hideChildren||(o._x_hideChildren=[]),o._x_hideChildren.push(e)):i(()=>{let h=d=>{let g=Promise.all([d._x_hidePromise,...(d._x_hideChildren||[]).map(h)]).then(([m])=>m?.());return delete d._x_hidePromise,delete d._x_hideChildren,g};h(e).catch(d=>{if(!d.isFromCancelledTransition)throw d})})})};function Xo(e){let t=e.parentNode;if(t)return t._x_hidePromise?t:Xo(t)}function Lr(e,t,{during:n,start:r,end:i}={},s=()=>{},o=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(n).length===0&&Object.keys(r).length===0&&Object.keys(i).length===0){s(),o();return}let h,d,g;Fd(e,{start(){h=t(e,r)},during(){d=t(e,n)},before:s,end(){h(),g=t(e,i)},after:o,cleanup(){d(),g()}})}function Fd(e,t){let n,r,i,s=Ir(()=>{ce(()=>{n=!0,r||t.before(),i||(t.end(),Rr()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(o){this.beforeCancels.push(o)},cancel:Ir(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();s()}),finish:s},ce(()=>{t.start(),t.during()}),Rd(),requestAnimationFrame(()=>{if(n)return;let o=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,h=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;o===0&&(o=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),ce(()=>{t.before()}),r=!0,requestAnimationFrame(()=>{n||(ce(()=>{t.end()}),Rr(),setTimeout(e._x_transitioning.finish,o+h),i=!0)})})}function Pt(e,t,n){if(e.indexOf(t)===-1)return n;const r=e[e.indexOf(t)+1];if(!r||t==="scale"&&isNaN(r))return n;if(t==="duration"||t==="delay"){let i=r.match(/([0-9]+)ms/);if(i)return i[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[r,e[e.indexOf(t)+2]].join(" "):r}var Be=!1;function He(e,t=()=>{}){return(...n)=>Be?t(...n):e(...n)}function Md(e){return(...t)=>Be&&e(...t)}var Go=[];function Hn(e){Go.push(e)}function $d(e,t){Go.forEach(n=>n(e,t)),Be=!0,Vo(()=>{Fe(t,(n,r)=>{r(n,()=>{})})}),Be=!1}var Nr=!1;function Ud(e,t){t._x_dataStack||(t._x_dataStack=e._x_dataStack),Be=!0,Nr=!0,Vo(()=>{Bd(t)}),Be=!1,Nr=!1}function Bd(e){let t=!1;Fe(e,(r,i)=>{ot(r,(s,o)=>{if(t&&Cd(s))return o();t=!0,i(s,o)})})}function Vo(e){let t=ct;cs((n,r)=>{let i=t(n);return St(i),()=>{}}),e(),cs(t)}function Yo(e,t,n,r=[]){switch(e._x_bindings||(e._x_bindings=_t({})),e._x_bindings[t]=n,t=r.includes("camel")?Gd(t):t,t){case"value":qd(e,n);break;case"style":zd(e,n);break;case"class":Hd(e,n);break;case"selected":case"checked":Wd(e,t,n);break;default:Qo(e,t,n);break}}function qd(e,t){if(hi(e))e.attributes.value===void 0&&(e.value=t);else if(kn(e))Number.isInteger(t)?e.value=t:!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(n=>Vd(n,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")Xd(e,t);else{if(e.value===t)return;e.value=t===void 0?"":t}}function Hd(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=ui(e,t)}function zd(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=qn(e,t)}function Wd(e,t,n){Qo(e,t,n),Jd(e,t,n)}function Qo(e,t,n){[null,void 0,!1].includes(n)&&Qd(t)?e.removeAttribute(t):(Zo(t)&&(n=t),Kd(e,t,n))}function Kd(e,t,n){e.getAttribute(t)!=n&&e.setAttribute(t,n)}function Jd(e,t,n){e[t]!==n&&(e[t]=n)}function Xd(e,t){const n=[].concat(t).map(r=>r+"");Array.from(e.options).forEach(r=>{r.selected=n.includes(r.value)})}function Gd(e){return e.toLowerCase().replace(/-(\w)/g,(t,n)=>n.toUpperCase())}function Vd(e,t){return e==t}function yn(e){return[1,"1","true","on","yes",!0].includes(e)?!0:[0,"0","false","off","no",!1].includes(e)?!1:e?!!e:null}var Yd=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootserializable"]);function Zo(e){return Yd.has(e)}function Qd(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function Zd(e,t,n){return e._x_bindings&&e._x_bindings[t]!==void 0?e._x_bindings[t]:ea(e,t,n)}function ef(e,t,n,r=!0){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];if(e._x_inlineBindings&&e._x_inlineBindings[t]!==void 0){let i=e._x_inlineBindings[t];return i.extract=r,Ao(()=>Ze(e,i.expression))}return ea(e,t,n)}function ea(e,t,n){let r=e.getAttribute(t);return r===null?typeof n=="function"?n():n:r===""?!0:Zo(t)?!![t,"true"].includes(r):r}function kn(e){return e.type==="checkbox"||e.localName==="ui-checkbox"||e.localName==="ui-switch"}function hi(e){return e.type==="radio"||e.localName==="ui-radio"}function ta(e,t){let n;return function(){const r=this,i=arguments,s=function(){n=null,e.apply(r,i)};clearTimeout(n),n=setTimeout(s,t)}}function na(e,t){let n;return function(){let r=this,i=arguments;n||(e.apply(r,i),n=!0,setTimeout(()=>n=!1,t))}}function ra({get:e,set:t},{get:n,set:r}){let i=!0,s,o=ct(()=>{let h=e(),d=n();if(i)r(fr(h)),i=!1;else{let g=JSON.stringify(h),m=JSON.stringify(d);g!==s?r(fr(h)):g!==m&&t(fr(d))}s=JSON.stringify(e()),JSON.stringify(n())});return()=>{St(o)}}function fr(e){return typeof e=="object"?JSON.parse(JSON.stringify(e)):e}function tf(e){(Array.isArray(e)?e:[e]).forEach(n=>n(xt))}var Je={},hs=!1;function nf(e,t){if(hs||(Je=_t(Je),hs=!0),t===void 0)return Je[e];Je[e]=t,ri(Je[e]),typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&Je[e].init()}function rf(){return Je}var ia={};function sf(e,t){let n=typeof t!="function"?()=>t:t;return e instanceof Element?sa(e,n()):(ia[e]=n,()=>{})}
14function of(e){return Object.entries(ia).forEach(([t,n])=>{Object.defineProperty(e,t,{get(){return(...r)=>n(...r)}})}),e}function sa(e,t,n){let r=[];for(;r.length;)r.pop()();let i=Object.entries(t).map(([o,h])=>({name:o,value:h})),s=Io(i);return i=i.map(o=>s.find(h=>h.name===o.name)?{name:`x-bind:${o.name}`,value:`"${o.value}"`}:o),si(e,i,n).map(o=>{r.push(o.runCleanups),o()}),()=>{for(;r.length;)r.pop()()}}var oa={};function af(e,t){oa[e]=t}function cf(e,t){return Object.entries(oa).forEach(([n,r])=>{Object.defineProperty(e,n,{get(){return(...i)=>r.bind(t)(...i)},enumerable:!1})}),e}var lf={get reactive(){return _t},get release(){return St},get effect(){return ct},get raw(){return mo},get transaction(){return Qh},version:"3.15.12",flushAndStopDeferringMutations:rd,dontAutoEvaluateFunctions:Ao,disableEffectScheduling:Gh,startObservingMutations:ei,stopObservingMutations:To,setReactivityEngine:Vh,onAttributeRemoved:_o,onAttributesAdded:wo,closestDataStack:it,skipDuringClone:He,onlyDuringClone:Md,addRootSelector:zo,addInitSelector:Wo,setErrorHandler:ld,interceptClone:Hn,addScopeToNode:Yt,deferMutations:nd,mapAttributes:oi,evaluateLater:ye,interceptInit:kd,initInterceptors:ri,injectMagics:Ht,setEvaluator:hd,setRawEvaluator:dd,mergeProxies:st,extractProp:ef,findClosest:De,onElRemoved:Yr,closestRoot:Bn,destroyTree:Et,interceptor:Co,transition:Lr,setStyles:qn,mutateDom:ce,directive:de,entangle:ra,throttle:na,debounce:ta,evaluate:Ze,evaluateRaw:bd,initTree:Fe,nextTick:li,prefixed:Tt,prefix:yd,plugin:tf,magic:ke,store:nf,start:xd,clone:Ud,cloneNode:$d,bound:Zd,$data:Eo,watch:go,walk:ot,data:af,bind:sf},xt=lf;function uf(e,t){const n=Object.create(null),r=e.split(",");for(let i=0;i<r.length;i++)n[r[i]]=!0;return i=>!!n[i]}var hf=Object.freeze({}),df=Object.prototype.hasOwnProperty,zn=(e,t)=>df.call(e,t),et=Array.isArray,$t=e=>aa(e)==="[object Map]",ff=e=>typeof e=="string",di=e=>typeof e=="symbol",Wn=e=>e!==null&&typeof e=="object",pf=Object.prototype.toString,aa=e=>pf.call(e),ca=e=>aa(e).slice(8,-1),fi=e=>ff(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,mf=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},gf=mf(e=>e.charAt(0).toUpperCase()+e.slice(1)),la=(e,t)=>e!==t&&(e===e||t===t),jr=new WeakMap,It=[],Pe,tt=Symbol("iterate"),Dr=Symbol("Map key iterate");function bf(e){return e&&e._isEffect===!0}function vf(e,t=hf){bf(e)&&(e=e.raw);const n=_f(e,t);return t.lazy||n(),n}function yf(e){e.active&&(ua(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var wf=0;function _f(e,t){const n=function(){if(!n.active)return e();if(!It.includes(n)){ua(n);try{return Tf(),It.push(n),Pe=n,e()}finally{It.pop(),ha(),Pe=It[It.length-1]}}};return n.id=wf++,n.allowRecurse=!!t.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=e,n.deps=[],n.options=t,n}function ua(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}var vt=!0,pi=[];function Sf(){pi.push(vt),vt=!1}function Tf(){pi.push(vt),vt=!0}function ha(){const e=pi.pop();vt=e===void 0?!0:e}function xe(e,t,n){if(!vt||Pe===void 0)return;let r=jr.get(e);r||jr.set(e,r=new Map);let i=r.get(n);i||r.set(n,i=new Set),i.has(Pe)||(i.add(Pe),Pe.deps.push(i),Pe.options.onTrack&&Pe.options.onTrack({effect:Pe,target:e,type:t,key:n}))}function qe(e,t,n,r,i,s){const o=jr.get(e);if(!o)return;const h=new Set,d=m=>{m&&m.forEach(c=>{(c!==Pe||c.allowRecurse)&&h.add(c)})};if(t==="clear")o.forEach(d);else if(n==="length"&&et(e))o.forEach((m,c)=>{(c==="length"||c>=r)&&d(m)});else switch(n!==void 0&&d(o.get(n)),t){case"add":et(e)?fi(n)&&d(o.get("length")):(d(o.get(tt)),$t(e)&&d(o.get(Dr)));break;case"delete":et(e)||(d(o.get(tt)),$t(e)&&d(o.get(Dr)));break;case"set":$t(e)&&d(o.get(tt));break}const g=m=>{m.options.onTrigger&&m.options.onTrigger({effect:m,target:e,key:n,type:t,newValue:r,oldValue:i,oldTarget:s}),m.options.scheduler?m.options.scheduler(m):m()};h.forEach(g)}var Ef=uf("__proto__,__v_isRef,__isVue"),da=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(di)),xf=fa(),Cf=fa(!0),ds=kf();function kf(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const r=te(this);for(let s=0,o=this.length;s<o;s++)xe(r,"get",s+"");const i=r[t](...n);return i===-1||i===!1?r[t](...n.map(te)):i}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){Sf();const r=te(this)[t].apply(this,n);return ha(),r}}),e}function fa(e=!1,t=!1){return function(r,i,s){if(i==="__v_isReactive")return!e;if(i==="__v_isReadonly")return e;if(i==="__v_raw"&&s===(e?t?Bf:ba:t?Uf:ga).get(r))return r;const o=et(r);
14if(!e&&o&&zn(ds,i))return Reflect.get(ds,i,s);const h=Reflect.get(r,i,s);return(di(i)?da.has(i):Ef(i))||(e||xe(r,"get",i),t)?h:Fr(h)?!o||!fi(i)?h.value:h:Wn(h)?e?va(h):vi(h):h}}var Of=Af();function Af(e=!1){return function(n,r,i,s){let o=n[r];if(!e&&(i=te(i),o=te(o),!et(n)&&Fr(o)&&!Fr(i)))return o.value=i,!0;const h=et(n)&&fi(r)?Number(r)<n.length:zn(n,r),d=Reflect.set(n,r,i,s);return n===te(s)&&(h?la(i,o)&&qe(n,"set",r,i,o):qe(n,"add",r,i)),d}}function Rf(e,t){const n=zn(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&qe(e,"delete",t,void 0,r),i}function Pf(e,t){const n=Reflect.has(e,t);return(!di(t)||!da.has(t))&&xe(e,"has",t),n}function If(e){return xe(e,"iterate",et(e)?"length":tt),Reflect.ownKeys(e)}var Lf={get:xf,set:Of,deleteProperty:Rf,has:Pf,ownKeys:If},Nf={get:Cf,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},mi=e=>Wn(e)?vi(e):e,gi=e=>Wn(e)?va(e):e,bi=e=>e,Kn=e=>Reflect.getPrototypeOf(e);function cn(e,t,n=!1,r=!1){e=e.__v_raw;const i=te(e),s=te(t);t!==s&&!n&&xe(i,"get",t),!n&&xe(i,"get",s);const{has:o}=Kn(i),h=r?bi:n?gi:mi;if(o.call(i,t))return h(e.get(t));if(o.call(i,s))return h(e.get(s));e!==i&&e.get(t)}function ln(e,t=!1){const n=this.__v_raw,r=te(n),i=te(e);return e!==i&&!t&&xe(r,"has",e),!t&&xe(r,"has",i),e===i?n.has(e):n.has(e)||n.has(i)}function un(e,t=!1){return e=e.__v_raw,!t&&xe(te(e),"iterate",tt),Reflect.get(e,"size",e)}function fs(e){e=te(e);const t=te(this);return Kn(t).has.call(t,e)||(t.add(e),qe(t,"add",e,e)),this}function ps(e,t){t=te(t);const n=te(this),{has:r,get:i}=Kn(n);let s=r.call(n,e);s?ma(n,r,e):(e=te(e),s=r.call(n,e));const o=i.call(n,e);return n.set(e,t),s?la(t,o)&&qe(n,"set",e,t,o):qe(n,"add",e,t),this}function ms(e){const t=te(this),{has:n,get:r}=Kn(t);let i=n.call(t,e);i?ma(t,n,e):(e=te(e),i=n.call(t,e));const s=r?r.call(t,e):void 0,o=t.delete(e);return i&&qe(t,"delete",e,void 0,s),o}function gs(){const e=te(this),t=e.size!==0,n=$t(e)?new Map(e):new Set(e),r=e.clear();return t&&qe(e,"clear",void 0,void 0,n),r}function hn(e,t){return function(r,i){const s=this,o=s.__v_raw,h=te(o),d=t?bi:e?gi:mi;return!e&&xe(h,"iterate",tt),o.forEach((g,m)=>r.call(i,d(g),d(m),s))}}function dn(e,t,n){return function(...r){const i=this.__v_raw,s=te(i),o=$t(s),h=e==="entries"||e===Symbol.iterator&&o,d=e==="keys"&&o,g=i[e](...r),m=n?bi:t?gi:mi;return!t&&xe(s,"iterate",d?Dr:tt),{next(){const{value:c,done:f}=g.next();return f?{value:c,done:f}:{value:h?[m(c[0]),m(c[1])]:m(c),done:f}},[Symbol.iterator](){return this}}}}function $e(e){return function(...t){{const n=t[0]?`on key "${t[0]}" `:"";console.warn(`${gf(e)} operation ${n}failed: target is readonly.`,te(this))}return e==="delete"?!1:this}}function jf(){const e={get(s){return cn(this,s)},get size(){return un(this)},has:ln,add:fs,set:ps,delete:ms,clear:gs,forEach:hn(!1,!1)},t={get(s){return cn(this,s,!1,!0)},get size(){return un(this)},has:ln,add:fs,set:ps,delete:ms,clear:gs,forEach:hn(!1,!0)},n={get(s){return cn(this,s,!0)},get size(){return un(this,!0)},has(s){return ln.call(this,s,!0)},add:$e("add"),set:$e("set"),delete:$e("delete"),clear:$e("clear"),forEach:hn(!0,!1)},r={get(s){return cn(this,s,!0,!0)},get size(){return un(this,!0)},has(s){return ln.call(this,s,!0)},add:$e("add"),set:$e("set"),delete:$e("delete"),clear:$e("clear"),forEach:hn(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(s=>{e[s]=dn(s,!1,!1),n[s]=dn(s,!0,!1),t[s]=dn(s,!1,!0),r[s]=dn(s,!0,!0)}),[e,n,t,r]}var[Df,Ff]=jf();function pa(e,t){const n=e?Ff:Df;return(r,i,s)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?r:Reflect.get(zn(n,i)&&i in r?n:r,i,s)}var Mf={get:pa(!1)},$f={get:pa(!0)};function ma(e,t,n){const r=te(n);if(r!==n&&t.call(e,r)){const i=ca(e);console.warn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var ga=new WeakMap,Uf=new WeakMap,ba=new WeakMap,Bf=new WeakMap;function qf(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Hf(e){return e.__v_skip||!Object.isExtensible(e)?0:qf(ca(e))}function vi(e){return e&&e.__v_isReadonly?e:ya(e,!1,Lf,Mf,ga)}function va(e){return ya(e,!0,Nf,$f,ba)}function ya(e,t,n,r,i){if(!Wn(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=i.get(e);if(s)return s;const o=Hf(e);
vendor: 9,647 bytes, line 14
14if(o===0)return e;const h=new Proxy(e,o===2?r:n);return i.set(e,h),h}function te(e){return e&&te(e.__v_raw)||e}function Fr(e){return!!(e&&e.__v_isRef===!0)}ke("nextTick",()=>li);ke("dispatch",e=>Mt.bind(Mt,e));ke("watch",(e,{evaluateLater:t,cleanup:n})=>(r,i)=>{let s=t(r),h=go(()=>{let d;return s(g=>d=g),d},i);n(h)});ke("store",rf);ke("data",e=>Eo(e));ke("root",e=>Bn(e));ke("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=st(zf(e))),e._x_refs_proxy));function zf(e){let t=[];return De(e,n=>{n._x_refs&&t.push(n._x_refs)}),t}var pr={};function wa(e){return pr[e]||(pr[e]=0),++pr[e]}function Wf(e,t){return De(e,n=>{if(n._x_ids&&n._x_ids[t])return!0})}function Kf(e,t){e._x_ids||(e._x_ids={}),e._x_ids[t]||(e._x_ids[t]=wa(t))}ke("id",(e,{cleanup:t})=>(n,r=null)=>{let i=`${n}${r?`-${r}`:""}`;return Jf(e,i,t,()=>{let s=Wf(e,n),o=s?s._x_ids[n]:wa(n);return r?`${n}-${o}-${r}`:`${n}-${o}`})});Hn((e,t)=>{e._x_id&&(t._x_id=e._x_id)});function Jf(e,t,n,r){if(e._x_id||(e._x_id={}),e._x_id[t])return e._x_id[t];let i=r();return e._x_id[t]=i,n(()=>{delete e._x_id[t]}),i}ke("el",e=>e);_a("Focus","focus","focus");_a("Persist","persist","persist");function _a(e,t,n){ke(t,r=>Ie(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,r))}de("modelable",(e,{expression:t},{effect:n,evaluateLater:r,cleanup:i})=>{let s=r(t),o=()=>{let m;return s(c=>m=c),m},h=r(`${t} = __placeholder`),d=m=>h(()=>{},{scope:{__placeholder:m}}),g=o();d(g),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let m=e._x_model.get,c=e._x_model.setWithModifiers,f=ra({get(){return m()},set(b){c(b)}},{get(){return o()},set(b){d(b)}});i(f)})});de("teleport",(e,{modifiers:t,expression:n},{cleanup:r})=>{e.tagName.toLowerCase()!=="template"&&Ie("x-teleport can only be used on a <template> tag",e);let i=bs(n),s=e.content.cloneNode(!0).firstElementChild;e._x_teleport=s,s._x_teleportBack=e,e.setAttribute("data-teleport-template",!0),s.setAttribute("data-teleport-target",!0),e._x_forwardEvents&&e._x_forwardEvents.forEach(h=>{s.addEventListener(h,d=>{d.stopPropagation(),e.dispatchEvent(new d.constructor(d.type,d))})}),Yt(s,{},e);let o=(h,d,g)=>{g.includes("prepend")?d.parentNode.insertBefore(h,d):g.includes("append")?d.parentNode.insertBefore(h,d.nextSibling):d.appendChild(h)};ce(()=>{He(()=>{o(s,i,t),Fe(s)})()}),e._x_teleportPutBack=()=>{let h=bs(n);ce(()=>{o(e._x_teleport,h,t)})},r(()=>ce(()=>{s.remove(),Et(s)}))});var Xf=document.createElement("div");function bs(e){let t=He(()=>document.querySelector(e),()=>Xf)();return t||Ie(`Cannot find x-teleport element for selector: "${e}"`),t}var Sa=()=>{};Sa.inline=(e,{modifiers:t},{cleanup:n})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,n(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};de("ignore",Sa);de("effect",He((e,{expression:t},{effect:n})=>{n(ye(e,t))}));function pt(e,t,n,r){let i=e,s=d=>r(d),o={},h=(d,g)=>m=>g(d,m);return n.includes("dot")&&(t=Gf(t)),n.includes("camel")&&(t=Vf(t)),n.includes("capture")&&(o.capture=!0),n.includes("window")&&(i=window),n.includes("document")&&(i=document),n.includes("passive")&&(o.passive=n[n.indexOf("passive")+1]!=="false"),s=Ta(n,s),n.includes("prevent")&&(s=h(s,(d,g)=>{g.preventDefault(),d(g)})),n.includes("stop")&&(s=h(s,(d,g)=>{g.stopPropagation(),d(g)})),n.includes("once")&&(s=h(s,(d,g)=>{d(g),i.removeEventListener(t,s,o)})),(n.includes("away")||n.includes("outside"))&&(i=document,s=h(s,(d,g)=>{e.contains(g.target)||g.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&d(g))})),n.includes("self")&&(s=h(s,(d,g)=>{g.target===e&&d(g)})),t==="submit"&&(s=h(s,(d,g)=>{g.target._x_pendingModelUpdates&&g.target._x_pendingModelUpdates.forEach(m=>m()),d(g)})),(Qf(t)||Ea(t))&&(s=h(s,(d,g)=>{Zf(g,n)||d(g)})),i.addEventListener(t,s,o),()=>{i.removeEventListener(t,s,o)}}function Ta(e,t){if(e.includes("debounce")){let n=e[e.indexOf("debounce")+1]||"invalid-wait",r=On(n.split("ms")[0])?Number(n.split("ms")[0]):250;t=ta(t,r)}if(e.includes("throttle")){let n=e[e.indexOf("throttle")+1]||"invalid-wait",r=On(n.split("ms")[0])?Number(n.split("ms")[0]):250;t=na(t,r)}return t}function Gf(e){return e.replace(/-/g,".")}function Vf(e){return e.toLowerCase().replace(/-(\w)/g,(t,n)=>n.toUpperCase())}function On(e){return!Array.isArray(e)&&!isNaN(e)}function Yf(e){return[" ","_"].includes(e)?e:e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Qf(e){return["keydown","keyup"].includes(e)}function Ea(e){return["contextmenu","click","mouse"].some(t=>e.includes(t))}function Zf(e,t){let n=t.filter(s=>!["window","document","prevent","stop","once","capture","self","away","outside","passive","preserve-scroll","blur","change","lazy"].includes(s));if(n.includes("debounce")){let s=n.indexOf("debounce");n.splice(s,On((n[s+1]||"invalid-wait").split("ms")[0])?2:1)}if(n.includes("throttle")){let s=n.indexOf("throttle");n.splice(s,On((n[s+1]||"invalid-wait").split("ms")[0])?2:1)}if(n.length===0||n.length===1&&vs(e.key).includes(n[0]))return!1;const i=["ctrl","shift","alt","meta","cmd","super"].filter(s=>n.includes(s));return n=n.filter(s=>!i.includes(s)),!(i.length>0&&i.filter(o=>((o==="cmd"||o==="super")&&(o="meta"),e[`${o}Key`])).length===i.length&&(Ea(e.type)||vs(e.key).includes(n[0])))}function vs(e){if(!e)return[];e=Yf(e);let t={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",comma:",",equal:"=",minus:"-",underscore:"_"};return t[e]=e,Object.keys(t).map(n=>{if(t[n]===e)return n}).filter(n=>n)}de("model",(e,{modifiers:t,expression:n},{effect:r,cleanup:i})=>{let s=e;t.includes("parent")&&(s=De(e,_=>_!==e));let o=ye(s,n),h;typeof n=="string"?h=ye(s,`${n} = __placeholder`):typeof n=="function"&&typeof n()=="string"?h=ye(s,`${n()} = __placeholder`):h=()=>{};let d=()=>{let _;return o(T=>_=T),ys(_)?_.get():_},g=_=>{let T;o(S=>T=S),ys(T)?T.set(_):h(()=>{},{scope:{__placeholder:_}})};typeof n=="string"&&e.type==="radio"&&ce(()=>{e.hasAttribute("name")||e.setAttribute("name",n)});let m=t.includes("change")||t.includes("lazy"),c=t.includes("blur"),f=t.includes("enter"),b=m||c||f,y;if(Be)y=()=>{};else if(b){let _=[],T=S=>g(fn(e,t,S,d()));if(m&&_.push(pt(e,"change",t,T)),c&&(_.push(pt(e,"blur",t,T)),e.form)){let S=e.form,C=()=>T({target:e});S._x_pendingModelUpdates||(S._x_pendingModelUpdates=[]),S._x_pendingModelUpdates.push(C),i(()=>{S._x_pendingModelUpdates&&S._x_pendingModelUpdates.splice(S._x_pendingModelUpdates.indexOf(C),1)})}f&&_.push(pt(e,"keydown",t,S=>{S.key==="Enter"&&T(S)})),y=()=>_.forEach(S=>S())}else{let _=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)?"change":"input";y=pt(e,_,t,T=>{g(fn(e,t,T,d()))})}if(t.includes("fill")&&([void 0,null,""].includes(d())||kn(e)&&Array.isArray(d())||e.tagName.toLowerCase()==="select"&&e.multiple)&&g(fn(e,t,{target:e},d())),e._x_removeModelListeners||(e._x_removeModelListeners={}),e._x_removeModelListeners.default=y,i(()=>e._x_removeModelListeners.default()),e.form){let _=pt(e.form,"reset",[],T=>{li(()=>e._x_model&&e._x_model.set(fn(e,t,{target:e},d())))});i(()=>_())}e._x_model={get(){return d()},set(_){g(_)},setWithModifiers:Ta(t,g)},e._x_forceModelUpdate=_=>{_===void 0&&typeof n=="string"&&n.match(/\./)&&(_=""),ce(()=>{kn(e)?Array.isArray(_)?e.checked=_.some(T=>T==e.value):e.checked=!!_:hi(e)?typeof _=="boolean"?e.checked=yn(e.value)===_:e.checked=e.value==_:Yo(e,"value",_)})},r(()=>{let _=d();t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate(_)})});function fn(e,t,n,r){return ce(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail!==null&&n.detail!==void 0?n.detail:n.target.value;if(kn(e))if(Array.isArray(r)){let i=null;return t.includes("number")?i=mr(n.target.value):t.includes("boolean")?i=yn(n.target.value):i=n.target.value,n.target.checked?r.includes(i)?r:r.concat([i]):r.filter(s=>!ep(s,i))}else return n.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(i=>{let s=i.value||i.text;return mr(s)}):t.includes("boolean")?Array.from(n.target.selectedOptions).map(i=>{let s=i.value||i.text;return yn(s)}):Array.from(n.target.selectedOptions).map(i=>i.value||i.text);{let i;return hi(e)?n.target.checked?i=n.target.value:i=r:i=n.target.value,t.includes("number")?mr(i):t.includes("boolean")?yn(i):t.includes("trim")?i.trim():i}}})}function mr(e){let t=e?parseFloat(e):null;return tp(t)?t:e}function ep(e,t){return e==t}function tp(e){return!Array.isArray(e)&&!isNaN(e)}function ys(e){return e!==null&&typeof e=="object"&&typeof e.get=="function"&&typeof e.set=="function"}de("cloak",e=>queueMicrotask(()=>ce(()=>e.removeAttribute(Tt("cloak")))));Wo(()=>`[${Tt("init")}]`);de("init",He((e,{expression:t},{evaluate:n})=>typeof t=="string"?!!t.trim()&&n(t,{},!1):n(t,{},!1)));de("text",(e,{expression:t},{effect:n,evaluateLater:r})=>{let i=r(t);n(()=>{i(s=>{ce(()=>{e.textContent=s})})})});de("html",(e,{expression:t},{effect:n,evaluateLater:r})=>{let i=r(t);n(()=>{i(s=>{ce(()=>{e.innerHTML=s??"",e._x_ignoreSelf=!0,Fe(e),delete e._x_ignoreSelf})})})});oi(jo(":",Do(Tt("bind:"))));var xa=(e,{value:t,modifiers:n,expression:r,original:i},{effect:s,cleanup:o})=>{if(!t){let d={};of(d),ye(e,r)(m=>{sa(e,m,i)},{scope:d});return}if(t==="key")return np(e,r);if(e._x_inlineBindings&&e._x_inlineBindings[t]&&e._x_inlineBindings[t].extract)return;let h=ye(e,r);s(()=>h(d=>{d===void 0&&typeof r=="string"&&r.match(/\./)&&(d=""),ce(()=>Yo(e,t,d,n))})),o(()=>
14{e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedStyles&&e._x_undoAddedStyles()})};xa.inline=(e,{value:t,modifiers:n,expression:r})=>{t&&(e._x_inlineBindings||(e._x_inlineBindings={}),e._x_inlineBindings[t]={expression:r,extract:!1})};de("bind",xa);function np(e,t){e._x_keyExpression=t}zo(()=>`[${Tt("data")}]`);de("data",(e,{expression:t},{cleanup:n})=>{if(rp(e))return;t=t===""?"{}":t;let r={};Ht(r,e);let i={};cf(i,r);let s=Ze(e,t,{scope:i});(s===void 0||s===!0)&&(s={}),Ht(s,e);let o=_t(s);ri(o);let h=Yt(e,o);o.init&&Ze(e,o.init),n(()=>{o.destroy&&Ze(e,o.destroy),h()})});Hn((e,t)=>{e._x_dataStack&&(t._x_dataStack=e._x_dataStack,t.setAttribute("data-has-alpine-state",!0))});function rp(e){return Be?Nr?!0:e.hasAttribute("data-has-alpine-state"):!1}de("show",(e,{modifiers:t,expression:n},{effect:r})=>{let i=ye(e,n);e._x_doHide||(e._x_doHide=()=>{ce(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})}),e._x_doShow||(e._x_doShow=()=>{ce(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display")})});let s=()=>{e._x_doHide(),e._x_isShown=!1},o=()=>{e._x_doShow(),e._x_isShown=!0},h=()=>setTimeout(o),d=Ir(c=>c?o():s(),c=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,c,o,s):c?h():s()}),g,m=!0;r(()=>i(c=>{!m&&c===g||(t.includes("immediate")&&(c?h():s()),d(c),g=c,m=!1)}))});de("for",(e,{expression:t},{effect:n,cleanup:r})=>{let i=op(t),s=ye(e,i.items),o=ye(e,e._x_keyExpression||"index");e._x_lookup=new Map,n(()=>sp(e,i,s,o)),r(()=>{e._x_lookup.forEach(h=>ce(()=>{Et(h),h.remove()})),delete e._x_lookup})});function ip(e){return t=>{Object.entries(t).forEach(([n,r])=>{e[n]=r})}}function sp(e,t,n,r){n(i=>{cp(i)&&(i=Array.from({length:i},(g,m)=>m+1)),i==null&&(i=[]),i instanceof Set&&(i=Array.from(i)),i instanceof Map&&(i=Array.from(i));let s=e._x_lookup,o=new Map;e._x_lookup=o;let h=lp(i),d=Object.entries(i).map(([g,m])=>{h||(g=parseInt(g));let c=ap(t,m,g,i),f;return r(b=>{typeof b=="object"&&Ie("x-for key cannot be an object, it must be a string or an integer",e),s.has(b)&&(o.set(b,s.get(b)),s.delete(b)),f=b},{scope:{index:g,...c}}),[f,c]});ce(()=>{s.forEach(c=>{Et(c),c.remove()});let g=new Set,m=e;d.forEach(([c,f])=>{if(o.has(c)){let _=o.get(c);_._x_refreshXForScope(f),m.nextElementSibling!==_&&(m.nextElementSibling&&_.replaceWith(m.nextElementSibling),m.after(_)),m=_,_._x_currentIfEl&&(_.nextElementSibling!==_._x_currentIfEl&&m.after(_._x_currentIfEl),m=_._x_currentIfEl);return}e.content.children.length>1&&Ie("x-for templates require a single root element, additional elements will be ignored.",e);let b=document.importNode(e.content,!0).firstElementChild,y=_t(f);Yt(b,y,e),b._x_refreshXForScope=ip(y),o.set(c,b),g.add(b),m.after(b),m=b}),He(()=>g.forEach(c=>Fe(c)))()})})}function op(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,n=/^\s*\(|\)\s*$/g,r=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,i=e.match(r);if(!i)return;let s={};s.items=i[2].trim();let o=i[1].replace(n,"").trim(),h=o.match(t);return h?(s.item=o.replace(t,"").trim(),s.index=h[1].trim(),h[2]&&(s.collection=h[2].trim())):s.item=o,s}function ap(e,t,n,r){let i={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(o=>o.trim()).forEach((o,h)=>{i[o]=t[h]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(o=>o.trim()).forEach(o=>{i[o]=t[o]}):i[e.item]=t,e.index&&(i[e.index]=n),e.collection&&(i[e.collection]=r),i}function cp(e){return typeof e!="object"&&!isNaN(e)}function lp(e){return typeof e=="object"&&!Array.isArray(e)}function Ca(){}Ca.inline=(e,{expression:t},{cleanup:n})=>{let r=Bn(e);r&&(r._x_refs||(r._x_refs={}),r._x_refs[t]=e,n(()=>delete r._x_refs[t]))};de("ref",Ca);de("if",(e,{expression:t},{effect:n,cleanup:r})=>{e.tagName.toLowerCase()!=="template"&&Ie("x-if can only be used on a <template> tag",e);let i=ye(e,t),s=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let h=e.content.cloneNode(!0).firstElementChild;return Yt(h,{},e),ce(()=>{e.after(h),He(()=>Fe(h))()}),e._x_currentIfEl=h,e._x_undoIf=()=>{ce(()=>{Et(h),h.remove()}),delete e._x_currentIfEl},h},o=()=>{e._x_undoIf&&(e._x_undoIf(),delete e._x_undoIf)};n(()=>i(h=>{h?s():o()})),r(()=>e._x_undoIf&&e._x_undoIf())});de("id",(e,{expression:t},{evaluate:n})=>{n(t).forEach(i=>
14Kf(e,i))});Hn((e,t)=>{e._x_ids&&(t._x_ids=e._x_ids)});oi(jo("@",Do(Tt("on:"))));de("on",He((e,{value:t,modifiers:n,expression:r},{cleanup:i})=>{let s=r?ye(e,r):()=>{};e.tagName.toLowerCase()==="template"&&(e._x_forwardEvents||(e._x_forwardEvents=[]),e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let o=pt(e,t,n,h=>{s(()=>{},{scope:{$event:h},params:[h]})});i(()=>o())}));Jn("Collapse","collapse","collapse");Jn("Intersect","intersect","intersect");Jn("Focus","trap","focus");Jn("Mask","mask","mask");function Jn(e,t,n){de(t,r=>Ie(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${n}`,r))}xt.setEvaluator(fd);xt.setRawEvaluator(vd);xt.setReactivityEngine({reactive:vi,effect:vf,release:yf,raw:te});var up=xt,L=up;function hp(e){e.directive("collapse",t),t.inline=(n,{modifiers:r})=>{r.includes("min")&&(n._x_doShow=()=>{},n._x_doHide=()=>{})};function t(n,{modifiers:r}){let i=ws(r,"duration",250)/1e3,s=ws(r,"min",0),o=!r.includes("min");n._x_isShown||(n.style.height=`${s}px`),!n._x_isShown&&o&&(n.hidden=!0),n._x_isShown||(n.style.overflow="hidden");let h=(g,m)=>{let c=e.setStyles(g,m);return m.height?()=>{}:c},d={transitionProperty:"height",transitionDuration:`${i}s`,transitionTimingFunction:"cubic-bezier(0.4, 0.0, 0.2, 1)"};n._x_transition={in(g=()=>{},m=()=>{}){o&&(n.hidden=!1),o&&(n.style.display=null);let c=n.getBoundingClientRect().height;n.style.height="auto";let f=n.getBoundingClientRect().height;c===f&&(c=s),e.transition(n,e.setStyles,{during:d,start:{height:c+"px"},end:{height:f+"px"}},()=>n._x_isShown=!0,()=>{Math.abs(n.getBoundingClientRect().height-f)<1&&(n.style.overflow=null)})},out(g=()=>{},m=()=>{}){let c=n.getBoundingClientRect().height;e.transition(n,h,{during:d,start:{height:c+"px"},end:{height:s+"px"}},()=>n.style.overflow="hidden",()=>{n._x_isShown=!1,n.style.height==`${s}px`&&o&&(n.style.display="none",n.hidden=!0)})}}}}function ws(e,t,n){if(e.indexOf(t)===-1)return n;const r=e[e.indexOf(t)+1];if(!r)return n;if(t==="duration"){let i=r.match(/([0-9]+)ms/);if(i)return i[1]}if(t==="min"){let i=r.match(/([0-9]+)px/);if(i)return i[1]}return r}var dp=hp;const _s=180;function fp(){return["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm","video/mp4"].find(t=>MediaRecorder.isTypeSupported?.(t))??""}function pp(){return{supported:!0,recording:!1,seconds:0,error:"",blob:null,previewUrl:null,poster:null,withMic:!0,recorder:null,tracks:[],timer:null,audioContext:null,init(){this.supported=!!navigator.mediaDevices?.getDisplayMedia&&typeof MediaRecorder<"u"},get clock(){const e=Math.max(0,this.seconds);return`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`},get sizeLabel(){if(!this.blob)return"";const e=this.blob.size/(1024*1024);return e<1?`${Math.round(this.blob.size/1024)} KB`:`${e.toFixed(1)} MB`},async start(){if(this.recording||!this.supported)return;this.error="",this.discard();let e;try{e=await navigator.mediaDevices.getDisplayMedia({video:{frameRate:15},audio:!0})}catch{return}let t=null;if(this.withMic)try{t=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{this.error="Recording without your voice — the microphone was not available."}const n=this.combine(e,t);this.tracks=[...e.getTracks(),...t?.getTracks()??[]],e.getVideoTracks()[0]?.addEventListener("ended",()=>this.stop());const r=fp(),i=new MediaRecorder(n,r?{mimeType:r}:{}),s=[];i.ondataavailable=o=>o.data.size&&s.push(o.data),i.onstop=()=>{this.release();const o=new Blob(s,{type:i.mimeType||"video/webm"});o.size>0&&(this.blob=o,this.previewUrl=URL.createObjectURL(o),this.grabPoster(o)),this.recording=!1},i.start(1e3),this.recorder=i,this.recording=!0,this.seconds=0,this.timer=setInterval(()=>{this.seconds+=1,this.seconds>=_s&&(this.error=`Recordings stop at ${_s/60} minutes.`,this.stop())},1e3)},combine(e,t){const n=e.getVideoTracks();if(!(e.getAudioTracks().length||t?.getAudioTracks().length))return new MediaStream(n);const i=window.AudioContext||window.webkitAudioContext;if(!i)return new MediaStream([...n,...e.getAudioTracks()]);this.audioContext=new i;const s=this.audioContext.createMediaStreamDestination();return[e,t].forEach(o=>{!o||!o.getAudioTracks().length||this.audioContext.createMediaStreamSource(o).connect(s)}),new MediaStream([...n,...s.stream.getAudioTracks()])},stop(){this.recorder?.state==="recording"?this.recorder.stop():this.release()}
14,release(){clearInterval(this.timer),this.tracks.forEach(e=>e.stop()),this.tracks=[],this.audioContext?.close().catch(()=>{}),this.audioContext=null},grabPoster(e){const t=document.createElement("video"),n=URL.createObjectURL(e);let r=!1;const i=s=>{r||(r=!0,URL.revokeObjectURL(n),this.poster=s)};setTimeout(()=>i(null),5e3),t.preload="metadata",t.muted=!0,t.playsInline=!0,t.onloadeddata=()=>{t.currentTime=Math.min(1,(t.duration||2)/4)},t.onseeked=()=>{const s=t.videoWidth||1280,o=t.videoHeight||720,h=Math.min(1,960/s),d=document.createElement("canvas");d.width=Math.round(s*h),d.height=Math.round(o*h),d.getContext("2d").drawImage(t,0,0,d.width,d.height),d.toBlob(g=>i(g),"image/jpeg",.7)},t.onerror=()=>i(null),t.src=n},attachPoster(e){if(!this.poster||!e)return;const t=new DataTransfer;t.items.add(new File([this.poster],"poster.jpg",{type:"image/jpeg"})),e.files=t.files},discard(){this.previewUrl&&URL.revokeObjectURL(this.previewUrl),this.blob=null,this.previewUrl=null,this.poster=null,this.seconds=0},attachTo(e){if(!this.blob||!e)return;const t=(this.blob.type||"").includes("mp4")?"mp4":"webm",n=new File([this.blob],`screen-recording.${t}`,{type:this.blob.type}),r=new DataTransfer;r.items.add(n),e.files=r.files}}}function mp(e){let t=()=>{let n,r;try{r=localStorage}catch(i){console.error(i),console.warn("Alpine: $persist is using temporary storage since localStorage is unavailable.");let s=new Map;r={getItem:s.get.bind(s),setItem:s.set.bind(s)}}return e.interceptor((i,s,o,h,d)=>{let g=n||`_x_${h}`,m=Ss(g,r)?Ts(g,r):i;return o(m),e.effect(()=>{let c=s();Es(g,c,r),o(c)}),m},i=>{i.as=s=>(n=s,i),i.using=s=>(r=s,i)})};Object.defineProperty(e,"$persist",{get:()=>t()}),e.magic("persist",t),e.persist=(n,{get:r,set:i},s=localStorage)=>{let o=Ss(n,s)?Ts(n,s):r();i(o),e.effect(()=>{let h=r();Es(n,h,s),i(h)})}}function Ss(e,t){return t.getItem(e)!==null}function Ts(e,t){let n=t.getItem(e);if(n!==void 0)return JSON.parse(n)}function Es(e,t,n){n.setItem(e,JSON.stringify(t))}var gp=mp,ka=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],An=ka.join(","),Oa=typeof Element>"u",at=Oa?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Rn=!Oa&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Pn=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=i===""||i==="true",o=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Pn(t.parentNode));return o},bp=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Aa=function(t,n,r){if(Pn(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(An));return n&&at.call(t,An)&&i.unshift(t),i=i.filter(r),i},In=function(t,n,r){for(var i=[],s=Array.from(t);s.length;){var o=s.shift();if(!Pn(o,!1))if(o.tagName==="SLOT"){var h=o.assignedElements(),d=h.length?h:o.children,g=In(d,!0,r);r.flatten?i.push.apply(i,g):i.push({scopeParent:o,candidates:g})}else{var m=at.call(o,An);m&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var c=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),f=!Pn(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(c&&f){var b=In(c===!0?o.children:c.children,!0,r);r.flatten?i.push.apply(i,b):i.push({scopeParent:o,candidates:b})}else s.unshift.apply(s,o.children)}}return i},Ra=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Xe=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||bp(t))&&!Ra(t)?0:t.tabIndex},vp=function(t,n){var r=Xe(t);
vendor: 22,169 bytes, lines 14-16
14return r<0&&n&&!Ra(t)?0:r},yp=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Pa=function(t){return t.tagName==="INPUT"},wp=function(t){return Pa(t)&&t.type==="hidden"},_p=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Sp=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Tp=function(t){if(!t.name)return!0;var n=t.form||Rn(t),r=function(h){return n.querySelectorAll('input[type="radio"][name="'+h+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var s=Sp(i,t.form);return!s||s===t},Ep=function(t){return Pa(t)&&t.type==="radio"},xp=function(t){return Ep(t)&&!Tp(t)},Cp=function(t){var n,r=t&&Rn(t),i=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var o,h,d;for(s=!!((o=i)!==null&&o!==void 0&&(h=o.ownerDocument)!==null&&h!==void 0&&h.contains(i)||t!=null&&(d=t.ownerDocument)!==null&&d!==void 0&&d.contains(t));!s&&i;){var g,m,c;r=Rn(i),i=(g=r)===null||g===void 0?void 0:g.host,s=!!((m=i)!==null&&m!==void 0&&(c=m.ownerDocument)!==null&&c!==void 0&&c.contains(i))}}return s},xs=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},kp=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var o=at.call(t,"details>summary:first-of-type"),h=o?t.parentElement:t;if(at.call(h,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var d=t;t;){var g=t.parentElement,m=Rn(t);if(g&&!g.shadowRoot&&i(g)===!0)return xs(t);t.assignedSlot?t=t.assignedSlot:!g&&m!==t.ownerDocument?t=m.host:t=g}t=d}if(Cp(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return xs(t);return!1},Op=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return at.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},Ln=function(t,n){return!(n.disabled||wp(n)||kp(n,t)||_p(n)||Op(n))},Mr=function(t,n){return!(xp(n)||Xe(n)<0||!Ln(t,n))},Ap=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ia=function(t){var n=[],r=[];return t.forEach(function(i,s){var o=!!i.scopeParent,h=o?i.scopeParent:i,d=vp(h,o),g=o?Ia(i.candidates):h;d===0?o?n.push.apply(n,g):n.push(h):r.push({documentOrder:s,tabIndex:d,item:i,isScope:o,content:g})}),r.sort(yp).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},Rp=function(t,n){n=n||{};var r;return n.getShadowRoot?r=In([t],n.includeContainer,{filter:Mr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ap}):r=Aa(t,n.includeContainer,Mr.bind(null,n)),Ia(r)},La=function(t,n){n=n||{};var r;return n.getShadowRoot?r=In([t],n.includeContainer,{filter:Ln.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Aa(t,n.includeContainer,Ln.bind(null,n)),r},dt=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return at.call(t,An)===!1?!1:Mr(n,t)},Pp=ka.concat("iframe:not([inert]):not([inert] *)").join(","),wn=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return at.call(t,Pp)===!1?!1:Ln(n,t)};function $r(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ip(e){if(Array.isArray(e))return $r(e)}function Cs(e,t,n,r,i,s,o){try{var h=e[s](o),d=h.value}catch(g){return void n(g)}h.done?t(d):Promise.resolve(d).then(r,i)}function ks(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(d){Cs(s,r,i,o,h,"next",d)}function h(d){Cs(s,r,i,o,h,"throw",d)}o(void 0)})}}function Os(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Na(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(d){throw d},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
15In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,h=!1;return{s:function(){n=n.call(e)},n:function(){var d=n.next();return o=d.done,d},e:function(d){h=!0,s=d},f:function(){try{o||n.return==null||n.return()}finally{if(h)throw s}}}}function Lp(e,t,n){return(t=Mp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Np(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jp(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
16In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function As(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?As(Object(n),!0).forEach(function(r){Lp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):As(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dt(){var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(b,y,_,T){var S=y&&y.prototype instanceof h?y:h,C=Object.create(S.prototype);return _e(C,"_invoke",(function(x,A,N){var j,U,G,ne=0,oe=N||[],Q=!1,V={p:0,n:0,v:e,a:z,f:z.bind(e,4),d:function(E,O){return j=E,U=0,G=e,V.n=O,o}};function z(E,O){for(U=E,G=O,t=0;!Q&&ne&&!P&&t<oe.length;t++){var P,F=oe[t],q=V.p,X=F[2];E>3?(P=X===O)&&(G=F[(U=F[4])?5:(U=3,3)],F[4]=F[5]=e):F[0]<=q&&((P=E<2&&q<F[1])?(U=0,V.v=O,V.n=F[1]):q<X&&(P=E<3||F[0]>O||O>X)&&(F[4]=E,F[5]=O,V.n=X,U=0))}if(P||E>1)return o;throw Q=!0,O}return function(E,O,P){if(ne>1)throw TypeError("Generator is already running");for(Q&&O===1&&z(O,P),U=O,G=P;(t=U<2?e:G)||!Q;){j||(U?U<3?(U>1&&(V.n=-1),z(U,G)):V.n=G:V.v=G);try{if(ne=2,j){if(U||(E="next"),t=j[E]){if(!(t=t.call(j,G)))throw TypeError("iterator result is not an object");if(!t.done)return t;G=t.value,U<2&&(U=0)}else U===1&&(t=j.return)&&t.call(j),U<2&&(G=TypeError("The iterator does not provide a '"+E+"' method"),U=1);j=e}else if((t=(Q=V.n<0)?G:x.call(A,V))!==o)break}catch(F){j=e,U=1,G=F}finally{ne=1}}return{value:t,done:Q}}})(b,_,T),!0),C}var o={};function h(){}function d(){}function g(){}t=Object.getPrototypeOf;var m=[][r]?t(t([][r]())):(_e(t={},r,function(){return this}),t),c=g.prototype=h.prototype=Object.create(m);function f(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,g):(b.__proto__=g,_e(b,i,"GeneratorFunction")),b.prototype=Object.create(c),b}return d.prototype=g,_e(c,"constructor",g),_e(g,"constructor",d),d.displayName="GeneratorFunction",_e(g,i,"GeneratorFunction"),_e(c),_e(c,i,"Generator"),_e(c,r,function(){return this}),_e(c,"toString",function(){return"[object Generator]"}),(Dt=function(){return{w:s,m:f}})()}function _e(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}_e=function(s,o,h,d){function g(m,c){_e(s,m,function(f){return this._invoke(m,c,f)})}o?i?i(s,o,{value:h,enumerable:!d,configurable:!d,writable:!d}):s[o]=h:(g("next",0),g("throw",1),g("return",2))},_e(e,t,n,r)}function Dp(e){return Ip(e)||Np(e)||Na(e)||jp()}function Fp(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mp(e){var t=Fp(e,"string");return typeof t=="symbol"?t:t+""}function Na(e,t){if(e){if(typeof e=="string")return $r(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$r(e,t):void 0}}var je={getActiveTrap:function(t){return t?.length>0?t[t.length-1]:null},activateTrap:function(t,n){var r=je.getActiveTrap(t);n!==r&&je.pauseTrap(t);var i=t.indexOf(n);i===-1||t.splice(i,1),t.push(n)},deactivateTrap:function(t,n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),je.unpauseTrap(t)},pauseTrap:function(t){var n=je.getActiveTrap(t);n?._setPausedState(!0)},unpauseTrap:function(t){var n=je.getActiveTrap(t);n&&!n._isManuallyPaused()&&n._setPausedState(!1)}},$p=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},Up=function(t){return t?.key==="Escape"||t?.key==="Esc"||t?.keyCode===27},Ut=function(t){return t?.key==="Tab"||t?.keyCode===9},Bp=function(t){return Ut(t)&&!t.shiftKey},qp=function(t){return Ut(t)&&t.shiftKey},Ps=function(t){return setTimeout(t,0)},Lt=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return typeof t=="function"?t.apply(void 0,r):t},pn=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},Hp=[],zp=function(t,n){var r=n?.document||document,i=n?.trapStack||Hp,s=Rs({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:Bp,isKeyBackward:qp},n),o={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},h,d=function(E,O,P){return E&&E[O]!==void 0?E[O]:s[P||O]},g=function(E,O){var P=typeof O?.composedPath=="function"?O.composedPath():void 0;return o.containerGroups.findIndex(function(F){var q=F.container,X=F.tabbableNodes;return q.contains(E)||P?.includes(q)||X.find(function(M){return M===E})})},m=function(E){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P=O.hasFallback,F=P===void 0?!1:P,q=O.params,X=q===void 0?[]:q,M=s[E];if(typeof M=="function"&&(M=M.apply(void 0,Dp(X))),M===!0&&(M=void 0),!M){if(M===void 0||M===!1)return M;throw new Error("`".concat(E,"` was specified but was not a node, or did not return a node"))}var $=M;if(typeof M=="string"){try{$=r.querySelector(M)}catch(K){throw new Error("`".concat(E,'` appears to be an invalid selector; error="').concat(K.message,'"'))}if(!$&&!F)throw new Error("`".concat(E,"` as selector refers to no known node"))}return $},c=function(){var E=m("initialFocus",{hasFallback:!0});if(E===!1)return!1;if(E===void 0||E&&!wn(E,s.tabbableOptions))if(g(r.activeElement)>=0)E=r.activeElement;else{var O=o.tabbableGroups[0],P=O&&O.firstTabbableNode;E=P||m("fallbackFocus")}else E===null&&(E=m("fallbackFocus"));if(!E)throw new Error("Your focus-trap needs to have at least one focusable element");return E},f=function(){if(o.containerGroups=o.containers.map(function(E){var O=Rp(E,s.tabbableOptions),P=La(E,s.tabbableOptions),F=O.length>0?O[0]:void 0,q=O.length>0?O[O.length-1]:void 0,X=P.find(function(K){return dt(K)}),M=P.slice().reverse().find(function(K){return dt(K)}),$=!!O.find(function(K){return Xe(K)>0});return{container:E,tabbableNodes:O,focusableNodes:P,posTabIndexesFound:$,firstTabbableNode:F,lastTabbableNode:q,firstDomTabbableNode:X,lastDomTabbableNode:M,nextTabbableNode:function(Z){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ue=O.indexOf(Z);return ue<0?ae?P.slice(P.indexOf(Z)+1).find(function(H){return dt(H)}):P.slice(0,P.indexOf(Z)).reverse().find(function(H){return dt(H)}):O[ue+(ae?1:-1)]}}}),o.tabbableGroups=o.containerGroups.filter(function(E){return E.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!m("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(o.containerGroups.find(function(E){return E.posTabIndexesFound})&&o.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},b=function(E){var O=E.activeElement;if(O)return O.shadowRoot&&O.shadowRoot.activeElement!==null?b(O.shadowRoot):O},y=function(E){if(E!==!1&&E!==b(document)){if(!E||!E.focus){y(c());return}E.focus({preventScroll:!!s.preventScroll}),o.mostRecentlyFocusedNode=E,$p(E)&&E.select()}},_=function(E){var O=m("setReturnFocus",{params:[E]});return O||(O===!1?!1:E)},T=function(E){var O=E.target,P=E.event,F=E.isBackward,q=F===void 0?!1:F;O=O||pn(P),f();var X=null;if(o.tabbableGroups.length>0){var M=g(O,P),$=M>=0?o.containerGroups[M]:void 0;if(M<0)q?X=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:X=o.tabbableGroups[0].firstTabbableNode;else if(q){var K=o.tabbableGroups.findIndex(function(Oe){var ie=Oe.firstTabbableNode;return O===ie});if(K<0&&($.container===O||wn(O,s.tabbableOptions)&&!dt(O,s.tabbableOptions)&&!$.nextTabbableNode(O,!1))&&(K=M),K>=0){var Z=K===0?o.tabbableGroups.length-1:K-1,ae=o.tabbableGroups[Z];X=Xe(O)>=0?ae.lastTabbableNode:ae.lastDomTabbableNode}else Ut(P)||(X=$.nextTabbableNode(O,!1))}else{var ue=o.tabbableGroups.findIndex(function(Oe){var ie=Oe.lastTabbableNode;return O===ie});if(ue<0&&($.container===O||wn(O,s.tabbableOptions)&&!dt(O,s.tabbableOptions)&&!$.nextTabbableNode(O))&&(ue=M),ue>=0){var H=ue===o.tabbableGroups.length-1?0:ue+1,re=o.tabbableGroups[H];X=Xe(O)>=0?re.firstTabbableNode:re.firstDomTabbableNode}else Ut(P)||(X=$.nextTabbableNode(O))}}else X=m("fallbackFocus");return X},S=function(E){var O=pn(E);if(!(g(O,E)>=0)){if(Lt(s.clickOutsideDeactivates,E)){h.deactivate({returnFocus:s.returnFocusOnDeactivate});return}Lt(s.allowOutsideClick,E)||E.preventDefault()}},C=function(E){var O=pn(E),P=g(O,E)>=0;if(P||O instanceof Document)P&&(o.mostRecentlyFocusedNode=O);else{E.stopImmediatePropagation();var F,q=!0;if(o.mostRecentlyFocusedNode)if(Xe(o.mostRecentlyFocusedNode)>0){var X=g(o.mostRecentlyFocusedNode),M=o.containerGroups[X].tabbableNodes;if(M.length>0){var $=M.findIndex(function(K){return K===o.mostRecentlyFocusedNode});$>=0&&(s.isKeyForward(o.recentNavEvent)?$+1<M.length&&(F=M[$+1],q=!1):$-1>=0&&(F=M[$-1],q=!1))}}else o.containerGroups.some(function(K){return K.tabbableNodes.some(function(Z){return Xe(Z)>0})})||(q=!1);else q=!1;q&&(F=T({target:o.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(o.recentNavEvent)})),y(F||o.mostRecentlyFocusedNode||c())}o.recentNavEvent=void 0},x=function(E){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;o.recentNavEvent=E;var P=T({event:E,isBackward:O});P&&(Ut(E)&&E.preventDefault(),y(P))},A=function(E){(s.isKeyForward(E)||s.isKeyBackward(E))&&x(E,s.isKeyBackward(E))},N=function(E){Up(E)&&Lt(s.escapeDeactivates,E)!==!1&&(E.preventDefault(),h.deactivate())},j=function(E){var O=pn(E);g(O,E)>=0||Lt(s.clickOutsideDeactivates,E)||Lt(s.allowOutsideClick,E)||(E.preventDefault(),E.stopImmediatePropagation())},U=function(){if(!o.active)return Promise.resolve();je.activateTrap(i,h);var E;return s.delayInitialFocus?E=new Promise(function(O){o.delayInitialFocusTimer=Ps(function(){y(c()),O()})}):(E=Promise.resolve(),y(c())),r.addEventListener("focusin",C,!0),r.addEventListener("mousedown",S,{capture:!0,passive:!1}),r.addEventListener("touchstart",S,{capture:!0,passive:!1}),r.addEventListener("click",j,{capture:!0,passive:!1}),r.addEventListener("keydown",A,{capture:!0,passive:!1}),r.addEventListener("keydown",N),E},G=function(E){o.active&&!o.paused&&h._setSubtreeIsolation(!1),o.adjacentElements.clear(),o.alreadySilent.clear();var O=new Set,P=new Set,F=Os(E),q;try{for(F.s();!(q=F.n()).done;){var X=q.value;O.add(X);for(var M=typeof ShadowRoot<"u"&&X.getRootNode()instanceof ShadowRoot,$=X;$;){O.add($);var K=$.parentElement,Z=[];K?Z=K.children:!K&&M&&(Z=$.getRootNode().children,K=$.getRootNode().host,M=typeof ShadowRoot<"u"&&K.getRootNode()instanceof ShadowRoot);var ae=Os(Z),ue;try{for(ae.s();!(ue=ae.n()).done;){var H=ue.value;P.add(H)}}catch(re){ae.e(re)}finally{ae.f()}$=K}}}catch(re){F.e(re)}finally{F.f()}O.forEach(function(re){P.delete(re)}),o.adjacentElements=P},ne=function(){if(o.active)return r.removeEventListener("focusin",C,!0),r.removeEventListener("mousedown",S,!0),r.removeEventListener("touchstart",S,!0),r.removeEventListener("click",j,!0),r.removeEventListener("keydown",A,!0),r.removeEventListener("keydown",N),h},oe=function(E){var O=E.some(function(P){var F=Array.from(P.removedNodes);return F.some(function(q){return q===o.mostRecentlyFocusedNode})});O&&y(c())},Q=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(oe):void 0,V=function(){Q&&(Q.disconnect(),o.active&&!o.paused&&o.containers.map(function(E){Q.observe(E,{subtree:!0,childList:!0})}))};return h={get active(){return o.active},get paused(){return o.paused},activate:function(E){if(o.active)return this;var O=d(E,"onActivate"),P=d(E,"onPostActivate"),F=d(E,"checkCanFocusTrap"),q=je.getActiveTrap(i),X=!1;if(q&&!q.paused){var M;(M=q._setSubtreeIsolation)===null||M===void 0||M.call(q,!1),X=!0}try{F||f(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=b(r),O?.();var $=(function(){var Z=ks(Dt().m(function ae(){return Dt().w(function(ue){for(;;)switch(ue.n){case 0:return F&&f(),ue.n=1,U();case 1:h._setSubtreeIsolation(!0),V(),P?.();case 2:return ue.a(2)}},ae)}));return function(){return Z.apply(this,arguments)}})();if(F)return F(o.containers.concat()).then($,$),this;$()}catch(Z){if(q===je.getActiveTrap(i)&&X){var K;(K=q._setSubtreeIsolation)===null||K===void 0||K.call(q,!0)}throw Z}return this},deactivate:function(E){if(!o.active)return this;var O=Rs({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},E);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,o.paused||h._setSubtreeIsolation(!1),o.alreadySilent.clear(),ne(),o.active=!1,o.paused=!1,V(),je.deactivateTrap(i,h);var P=d(O,"onDeactivate"),F=d(O,"onPostDeactivate"),q=d(O,"checkCanReturnFocus"),X=d(O,"returnFocus","returnFocusOnDeactivate");P?.();var M=function(){Ps(function(){X&&y(_(o.nodeFocusedBeforeActivation)),F?.()})};return X&&q?(q(_(o.nodeFocusedBeforeActivation)).then(M,M),this):(M(),this)},pause:function(E){return o.active?(o.manuallyPaused=!0,this._setPausedState(!0,E)):this},unpause:function(E){return o.active?(o.manuallyPaused=!1,i[i.length-1]!==this?this:this._setPausedState(!1,E)):this},updateContainerElements:function(E){var O=[].concat(E).filter(Boolean);return o.containers=O.map(function(P){return typeof P=="string"?r.querySelector(P):P}),s.isolateSubtrees&&G(o.containers),o.active&&(f(),o.paused||h._setSubtreeIsolation(!0)),V(),this}},Object.defineProperties(h,{_isManuallyPaused:{value:function(){return o.manuallyPaused}},_setPausedState:{value:function(E,O){if(o.paused===E)return this;if(o.paused=E,E){var P=d(O,"onPause"),F=d(O,"onPostPause");P?.(),ne(),h._setSubtreeIsolation(!1),V(),F?.()}else{var q=d(O,"onUnpause"),X=d(O,"onPostUnpause");q?.();var M=(function(){var $=ks(Dt().m(function K(){return Dt().w(function(Z){for(;;)switch(Z.n){case 0:return f(),Z.n=1,U();case 1:h._setSubtreeIsolation(!0),V(),X?.();case 2:return Z.a(2)}},K)}));return function(){return $.apply(this,arguments)}})();M()}return this}},_setSubtreeIsolation:{value:function(E){s.isolateSubtrees&&o.adjacentElements.forEach(function(O){var P;E?s.isolateSubtrees==="aria-hidden"?((O.ariaHidden==="true"||((P=O.getAttribute("aria-hidden"))===null||P===void 0?void 0:P.toLowerCase())==="true")&&o.alreadySilent.add(O),O.setAttribute("aria-hidden","true")):((O.inert||O.hasAttribute("inert"))&&o.alreadySilent.add(O),O.setAttribute("inert",!0)):o.alreadySilent.has(O)||(s.isolateSubtrees==="aria-hidden"?O.removeAttribute("aria-hidden"):O.removeAttribute("inert"))})}}}),h.updateContainerElements(t),h};function Wp(e){let t,n;window.addEventListener("focusin",()=>{t=n,n=document.activeElement}),e.magic("focus",r=>{let i=r;return{__noscroll:!1,__wrapAround:!1,within(s){return i=s,this},withoutScrolling(){return this.__noscroll=!0,this},noscroll(){return this.__noscroll=!0,this},withWrapAround(){return this.__wrapAround=!0,this},wrap(){return this.withWrapAround()},focusable(s){return wn(s)},previouslyFocused(){return t},lastFocused(){return t},focused(){return n},focusables(){return Array.isArray(i)?i:La(i,{displayCheck:"none"})},all(){return this.focusables()},isFirst(s){let o=this.all();return o[0]&&o[0].isSameNode(s)},isLast(s){let o=this.all();return o.length&&o.slice(-1)[0].isSameNode(s)},getFirst(){return this.all()[0]},getLast(){return this.all().slice(-1)[0]},getNext(){let s=this.all(),o=document.activeElement;if(s.indexOf(o)!==-1)return this.__wrapAround&&s.indexOf(o)===s.length-1?s[0]:s[s.indexOf(o)+1]},getPrevious(){let s=this.all(),o=document.activeElement;if(s.indexOf(o)!==-1)return this.__wrapAround&&s.indexOf(o)===0?s.slice(-1)[0]:s[s.indexOf(o)-1]},first(){this.focus(this.getFirst())},last(){this.focus(this.getLast())},next(){this.focus(this.getNext())},previous(){this.focus(this.getPrevious())},prev(){return this.previous()},focus(s){s&&setTimeout(()=>{s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),s.focus({preventScroll:this.__noscroll})})}}}),e.directive("trap",e.skipDuringClone((r,{expression:i,modifiers:s},{effect:o,evaluateLater:h,cleanup:d})=>{let g=h(i),m=!1,c={escapeDeactivates:!1,allowOutsideClick:!0,fallbackFocus:()=>r},f=()=>{};if(s.includes("noautofocus"))c.initialFocus=!1;else{let T=r.querySelector("[autofocus]");T&&(c.initialFocus=T)}s.includes("inert")&&(c.onPostActivate=()=>{e.nextTick(()=>
16{f=Is(r)})});let b=zp(r,c),y=()=>{};const _=()=>{f(),f=()=>{},y(),y=()=>{},b.deactivate({returnFocus:!s.includes("noreturn")})};o(()=>g(T=>{m!==T&&(T&&!m&&(s.includes("noscroll")&&(y=Kp()),setTimeout(()=>{b.activate()},15)),!T&&m&&_(),m=!!T)})),d(_)},(r,{expression:i,modifiers:s},{evaluate:o})=>{s.includes("inert")&&o(i)&&Is(r)}))}function Is(e){let t=[];return ja(e,n=>{let r=n.hasAttribute("aria-hidden");n.setAttribute("aria-hidden","true"),t.push(()=>r||n.removeAttribute("aria-hidden"))}),()=>{for(;t.length;)t.pop()()}}function ja(e,t){e.isSameNode(document.body)||!e.parentNode||Array.from(e.parentNode.children).forEach(n=>{n.isSameNode(e)?ja(e.parentNode,t):t(n)})}function Kp(){let e=document.documentElement.style.overflow,t=document.documentElement.style.paddingRight,n=window.innerWidth-document.documentElement.clientWidth,r=window.getComputedStyle(document.documentElement).scrollbarGutter;return document.documentElement.style.overflow="hidden",r&&r!=="auto"?()=>{document.documentElement.style.overflow=e}:(document.documentElement.style.paddingRight=`${n}px`,()=>{document.documentElement.style.overflow=e,document.documentElement.style.paddingRight=t})}var Jp=Wp;const Ue=8,Nt=12;function Xp(){return{steps:[],index:0,active:!1,tourKey:null,completeUrl:null,target:null,box:{top:0,left:0,width:0,height:0},panel:{top:0,left:0,placement:"bottom"},get step(){return this.steps[this.index]??null},get isFirst(){return this.index===0},get isLast(){return this.index===this.steps.length-1},init(){const e=this.$el.dataset.autostart;e&&this.start(JSON.parse(e)),window.addEventListener("start-tour",n=>this.start(n.detail));const t=()=>this.active&&this.locate();window.addEventListener("resize",t),window.addEventListener("scroll",t,!0)},start(e){e?.steps?.length&&(this.steps=e.steps,this.tourKey=e.key,this.completeUrl=e.completeUrl,this.index=0,this.active=!0,document.body.style.overflow="hidden",this.$nextTick(()=>this.locate()))},next(){if(this.isLast)return this.finish("completed");this.index++,this.$nextTick(()=>this.locate())},back(){this.isFirst||(this.index--,this.$nextTick(()=>this.locate()))},goTo(e){this.index=e,this.$nextTick(()=>this.locate())},locate(){const e=this.step;if(e){if(this.target=e.target?document.querySelector(`[data-tour="${e.target}"]`):null,!this.target){this.box={top:0,left:0,width:0,height:0},this.panel={centered:!0,placement:"center"};return}this.target.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),setTimeout(()=>this.measure(),220)}},measure(){if(!this.target)return;const e=this.target.getBoundingClientRect();this.box={top:e.top-Ue,left:e.left-Ue,width:e.width+Ue*2,height:e.height+Ue*2},this.placePanel(e)},placePanel(e){const t=Math.min(320,window.innerWidth-Nt*2),n=200,r=this.step?.placement??"bottom",i={bottom:window.innerHeight-e.bottom,top:e.top,right:window.innerWidth-e.right,left:e.left};let s=r;s==="bottom"&&i.bottom<n&&(s="top"),s==="top"&&i.top<n&&(s="bottom"),s==="right"&&i.right<t&&(s="bottom"),s==="left"&&i.left<t&&(s="bottom");let o,h;s==="top"?(o=e.top-n-Ue*2,h=e.left+e.width/2-t/2):s==="left"?(o=e.top+e.height/2-n/2,h=e.left-t-Ue*2):s==="right"?(o=e.top+e.height/2-n/2,h=e.right+Ue*2):(o=e.bottom+Ue*2,h=e.left+e.width/2-t/2),h=Math.max(Nt,Math.min(h,window.innerWidth-t-Nt)),o=Math.max(Nt,Math.min(o,window.innerHeight-n-Nt)),this.panel={top:o,left:h,width:t,placement:s,centered:!1}},skip(){this.finish("dismissed")},async finish(e){if(this.active=!1,document.body.style.overflow="",!(!this.completeUrl||!this.tourKey))try{await fetch(this.completeUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]')?.content??""},body:JSON.stringify({tour:this.tourKey,outcome:e})})}catch{}}}}let gr=null;const yi=()=>(gr||(gr=Ds(()=>import("./apexcharts.esm-BzFP5PJR.js"),[]).then(e=>e.default??e)),gr),Nn=["#2563eb","#10b981","#f59e0b","#f43f5e","#7c3aed","#0f172a"],ft=()=>document.documentElement.classList.contains("dark"),jn=()=>({chart:{fontFamily:"inherit",toolbar:{show:!1},animations:{enabled:!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}},colors:Nn,grid:{borderColor:ft()?"#263352":"#e2e8f0",strokeDashArray:4},dataLabels:{enabled:!1},legend:{labels:{colors:ft()?"#c3cddd":"#475569"}},xaxis:{labels:{style:{colors:ft()?"#94a3bb":"#64748b"}}},yaxis:{labels:{style:{colors:ft()?"#94a3bb":"#64748b"}}},tooltip:{style:{fontSize:"12px"}
16,theme:ft()?"dark":"light"},noData:{text:"Nothing to show for this period.",style:{color:ft()?"#6b7a94":"#94a3b8"}}}),Kt=(e,t)=>{const n={...e};return Object.entries(t||{}).forEach(([r,i])=>{n[r]=i&&typeof i=="object"&&!Array.isArray(i)?Kt(e[r]||{},i):i}),n},Ur=(e,t=0)=>Number(e||0).toLocaleString(void 0,{minimumFractionDigits:t,maximumFractionDigits:t}),Gp=({options:e={},labelClick:t=null,labels:n=[]}={})=>({instance:null,init(){this.draw(e),this.$el.addEventListener("chart:update",r=>this.draw(r.detail))},async draw(r){const i=await yi();this.instance&&this.instance.destroy(),this.instance=new i(this.$el,Kt(jn(),r)),await this.instance.render(),this.wireLabels(r)},wireLabels(r){if(!t)return;const i=r?.plotOptions?.bar?.horizontal??!1,s=this.$el.querySelector(i?".apexcharts-yaxis-texts-g":".apexcharts-xaxis-texts-g");s&&[...s.children].forEach((o,h)=>{const d=o.querySelector("title")?.textContent??o.textContent??"",g=n.indexOf(d.trim()),m=g===-1?h:g;o.style.cursor="pointer",o.addEventListener("click",c=>{c.stopPropagation(),t(m)})})},destroy(){this.instance?.destroy(),this.instance=null}}),Vp=({rows:e=[],metrics:t=[],parts:n=[],active:r="total_actions",limit:i=10,href:s=null}={})=>({rows:e,metrics:t,parts:n,active:r,instance:null,init(){this.draw()},select(o){this.active=o,this.draw()},get metric(){return this.metrics.find(o=>o.key===this.active)||this.metrics[0]},async draw(){const o=this.metric;if(!o)return;const h=this.rows.filter(m=>Number(m[o.key])>0).sort((m,c)=>c[o.key]-m[o.key]).slice(0,i),d=o.stacked?this.parts.map(m=>({name:m.label,data:h.map(c=>Number(c[m.key])||0)})):[{name:o.label,data:h.map(m=>Number(m[o.key])||0)}],g=await yi();this.instance&&this.instance.destroy(),this.instance=new g(this.$refs.canvas,Kt(jn(),{chart:{type:"bar",height:Math.max(240,h.length*38),stacked:o.stacked,events:s?{dataPointSelection:(m,c,f)=>{const b=h[f.dataPointIndex];b?.client_id&&(window.location.href=s.replace("__ID__",b.client_id))}}:{}},series:d,plotOptions:{bar:{horizontal:!0,borderRadius:o.stacked?0:4,barHeight:"65%"}},dataLabels:{enabled:!o.stacked,formatter:m=>Ur(m,o.decimals),style:{colors:["#fff"],fontWeight:600}},legend:{show:o.stacked,position:"top",horizontalAlign:"left"},xaxis:{categories:h.map(m=>m.name)},tooltip:{shared:o.stacked,intersect:!1,y:{formatter:m=>Ur(m,o.decimals)}},noData:{text:"No usage for this measure in the selected period.",style:{color:"#94a3b8"}}})),this.instance.render()},destroy(){this.instance?.destroy(),this.instance=null}}),Yp=({sets:e=[],active:t=null,type:n="bar"}={})=>({sets:e,active:t||e[0]&&e[0].key,instance:null,init(){this.draw()},select(r){this.active=r,this.draw()},get set(){return this.sets.find(r=>r.key===this.active)||this.sets[0]},async draw(){const r=this.set;if(!r)return;const i=r.rows||[],s=r.type||n,o=await yi();this.instance&&this.instance.destroy();const h=m=>{const c=i[m]?.href;c&&(window.location.href=c)},d={colors:i.some(m=>m.color)?i.map(m=>m.color||Nn[0]):Nn,labels:i.map(m=>m.label),noData:{text:"Nothing in this breakdown yet.",style:{color:"#94a3b8"}}},g=s==="donut"?Kt(jn(),{...d,chart:{type:"donut",height:320,events:{dataPointSelection:(m,c,f)=>h(f.dataPointIndex)}},series:i.map(m=>Number(m.count)||0),legend:{position:"bottom"},dataLabels:{enabled:!0,formatter:m=>m.toFixed(0)+"%"}}):Kt(jn(),{...d,chart:{type:"bar",height:Math.max(240,i.length*34),events:{dataPointSelection:(m,c,f)=>h(f.dataPointIndex)}},series:[{name:r.label,data:i.map(m=>Number(m.count)||0)}],plotOptions:{bar:{horizontal:!0,borderRadius:4,barHeight:"60%",distributed:i.some(m=>m.color)}},dataLabels:{enabled:!0,style:{colors:["#fff"],fontWeight:600}},legend:{show:!1},xaxis:{categories:i.map(m=>m.label)}});this.instance=new o(this.$refs.canvas,g),this.instance.render()},destroy(){this.instance?.destroy(),this.instance=null}}),Qp=e=>({categories:e,type:"datetime",labels:{format:"dd MMM",style:{colors:"#94a3b8"}},axisBorder:{show:!1},axisTicks:{show:!1}});let br=null;function Da(){const e=window.AudioContext||window.webkitAudioContext;return e?(br=br||new e,br):null}function Dn(){const e=Da();if(!e)return;const t=()=>{window.removeEventListener("pointerdown",Dn),window.removeEventListener("keydown",Dn)};if(e.state==="running"){t();return}
16e.resume().then(t).catch(()=>{})}function Ls(e){[[880,0],[1318.5,.09]].forEach(([t,n])=>{const r=e.createOscillator(),i=e.createGain();r.type="sine",r.frequency.value=t,i.gain.setValueAtTime(1e-4,e.currentTime+n),i.gain.exponentialRampToValueAtTime(.18,e.currentTime+n+.01),i.gain.exponentialRampToValueAtTime(1e-4,e.currentTime+n+.35),r.connect(i).connect(e.destination),r.start(e.currentTime+n),r.stop(e.currentTime+n+.4)})}let mn=null,Ns=0;const Zp=200;function Ft(){const e=Date.now();if(!(e-Ns<Zp)){Ns=e;try{const t=Da();if(!t)return;if(t.state==="running"){Ls(t);return}mn||(mn=t.resume().then(()=>{mn=null,Ls(t)}).catch(()=>{mn=null}))}catch{}}}function em(e){if(!e)return"";const t=["B","KB","MB","GB"];let n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n<10&&r>0?n.toFixed(1):Math.round(n)} ${t[r]}`}function js(e){const t=Math.max(0,Math.round(e||0));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function tm(e){return new Promise(t=>{const n=document.createElement("video"),r=URL.createObjectURL(e);let i=!1;const s=o=>{i||(i=!0,URL.revokeObjectURL(r),t(o))};setTimeout(()=>s(null),5e3),n.preload="metadata",n.muted=!0,n.playsInline=!0,n.onloadeddata=()=>{n.currentTime=Math.min(.5,(n.duration||1)/2)},n.onseeked=()=>{const o=n.videoWidth||640,h=n.videoHeight||360,d=Math.min(1,640/o),g=document.createElement("canvas");g.width=Math.round(o*d),g.height=Math.round(h*d),g.getContext("2d").drawImage(n,0,0,g.width,g.height),g.toBlob(m=>s({blob:m,duration:Math.round(n.duration)||null}),"image/jpeg",.7)},n.onerror=()=>s(null),n.src=r})}function nm(e){return new Promise(t=>{const n=document.createElement("audio"),r=URL.createObjectURL(e);let i=!1;const s=o=>{i||(i=!0,URL.revokeObjectURL(r),t(o))};setTimeout(()=>s(null),4e3),n.preload="metadata",n.onloadedmetadata=()=>s(Number.isFinite(n.duration)?Math.round(n.duration):null),n.onerror=()=>s(null),n.src=r})}function rm({endpoints:e,me:t,initialConversations:n=[],initialUnread:r=0,openId:i=null,openMessageId:s=null,avatars:o={},faces:h={},lazy:d=!1,maxUploadMb:g=50,roster:m=[]}){return{conversations:n,conversationSearch:"",scope:"mine",scopedConversations:[],scopeLoading:!1,ticketCounts:{open:0,resolved:0},get inboxTabs(){return[{key:"mine",label:"Mine",count:null,help:"Your colleagues, and the client conversations you have taken."},{key:"open",label:"All open",count:this.ticketCounts.open,help:"Every open client conversation across the team, including ones somebody else has taken. You can read one, take it back or hand it on."},{key:"resolved",label:"Resolved",count:this.ticketCounts.resolved,help:"Closed client conversations. A reply from the client reopens one automatically, and you can reopen one yourself."}]},async setScope(c){if(this.scope=c,c!=="mine"){this.scopeLoading=!0;try{const f=await fetch(`${e.tickets}?scope=${c}`,{headers:{Accept:"application/json"}});this.scopedConversations=f.ok?(await f.json()).conversations??[]:[]}catch{this.scopedConversations=[]}finally{this.scopeLoading=!1}}},async loadTicketCounts(){try{const c=await fetch(e.ticketCounts,{headers:{Accept:"application/json"}});c.ok&&(this.ticketCounts=await c.json())}catch{}},get scopedList(){return this.scope==="mine"?this.conversations:this.scopedConversations},get visibleConversations(){const c=this.conversationSearch.trim().toLowerCase(),f=this.scopedList;return c?f.filter(b=>[b.title,b.subtitle,b.agent_name,b.last_message_preview].filter(Boolean).some(y=>String(y).toLowerCase().includes(c))):f},unread:r,activeId:i,highlightId:null,avatars:o,faces:h,showsSender(c){if(!this.active)return!1;const f=c.mine&&this.active.kind==="support"&&(c.sender?.name??"")!==(t?.name??"");return!c.mine&&(this.active.is_group||this.active.kind==="support")||f},faceFor(c){const f=(c??"").trim().toLowerCase(),b=this.faces[f];return b||{url:null,initials:(c??"?").trim().split(/\s+/).filter(Boolean).slice(0,2).map(_=>_[0].toUpperCase()).join("")||"?"}},pressTimer:null,sheetFor:null,holdStart(c){this.clearHold(),this.pressTimer=setTimeout(()=>{this.sheetFor=c,navigator.vibrate&&navigator.vibrate(12)},450)},clearHold(){this.pressTimer&&clearTimeout(this.pressTimer),this.pressTimer=null},closeSheet(){this.sheetFor=null},fromSheet(c){const f=this.sheetFor;if(this.sheetFor=null,!!f){if(c==="reply")return this.replyTo(f);if(c==="forward")return this.openForward(f);if(c==="edit")return this.startEdit(f);if(c==="delete")return this.deleteMessage(f);if(c==="copy")return navigator.clipboard?.writeText(f.body??"")}},avatarFor(c){return this.avatars[(c?.email??"").toLowerCase()]??null},messages:[],cursor:null,hasMore:!1,loading:!1,loadingOlder:!1,sending:!1,draft:"",mentionTerm:null,mentionIndex:0,composerFull:!1,replyingTo:null,editingId:null,editingBody:"",forwarding:null,seenBy(c){if(!c?.created_at||!this.active?.is_group)return[];const f=new Date(c.created_at).getTime();return(this.active.participants??[]).filter(b=>b.email!==t.email&&b.last_read_at&&new Date(b.last_read_at).getTime()>=f)},replyTo(c){this.replyingTo=c,this.$nextTick(()=>this.$refs.draft?.focus())},cancelReply(){this.replyingTo=null},jumpTo(c){const f=document.getElementById(`msg-${c}`);if(!f){this.error="That message is further back than this thread is loaded.";return}f.scrollIntoView({behavior:"smooth",block:"center"}),f.classList.add("sc-flash"),setTimeout(()=>f.classList.remove("sc-flash"),1400)},async react(c,f){const b=c.reactions??[],y=b.find(_=>_.emoji===f&&_.mine);c.reactions=y?b.map(_=>_.emoji===f?{..._,count:_.count-1,mine:!1}:_).filter(_=>_.count>0):b.some(_=>_.emoji===f)?b.map(_=>_.emoji===f?{..._,count:_.count+1,mine:!0}:_):[...b,{emoji:f,count:1,mine:!0}];try{await fetch(this.reactUrl(this.activeId,c.id),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":e.csrf},body:JSON.stringify({emoji:f})})}catch{this.error="That did not save."}},startEdit(c){this.editingId=c.id,this.editingBody=c.body??""},cancelEdit(){this.editingId=null,this.editingBody=""},async saveEdit(c){const f=this.editingBody.trim();if(f)try{if(!(await fetch(this.editUrl(this.activeId,c.id),{method:"PATCH",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":e.csrf},body:JSON.stringify({body:f})})).ok)throw new Error("failed");c.body=f,c.edited_at=new Date().toISOString(),c.edited=!0,this.cancelEdit()}catch{this.error="That did not save."}}
16,async deleteMessage(c){if(window.confirm("Delete this message? The client will see that it was deleted."))try{if(!(await fetch(this.deleteUrl(this.activeId,c.id),{method:"DELETE",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":e.csrf}})).ok)throw new Error("failed");c.body="This message was deleted",c.deleted=!0,c.media=null,c.attachments=[]}catch{this.error="That did not delete."}},openForward(c){this.forwarding=c},async forwardTo(c){const f=this.forwarding;if(!f)return;const b=this.isSupport(this.activeId)?{from:"ticket",from_id:Number(String(this.activeId).slice(1))}:{from:"team",from_id:Number(this.activeId)};this.forwarding=null;try{const y=await fetch(e.forward.replace("__ID__",c),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":e.csrf},body:JSON.stringify({message_id:f.id,...b})});if(!y.ok){this.error="That did not send.";return}const _=(await y.json())?.message;_&&this.activeId===c&&(this.messages.push(_),this.scrollToEnd())}catch{this.error="That did not send."}},get mentionMatches(){if(this.mentionTerm===null)return[];const c=this.mentionTerm.toLowerCase();return(this.active?.participants??[]).filter(f=>f.name&&f.email!==t.email).filter(f=>!c||f.name.toLowerCase().includes(c)).slice(0,6)},announceTyping(){const c=Date.now();this.typedAt&&c-this.typedAt<2e3||(this.typedAt=c,this.presence?.whisper?.("typing",{conversation:this.activeId,email:t.email}))},typedAt:0,presence:null,get typingNames(){const c=Object.keys(this.typing);return(this.active?.participants??[]).filter(f=>c.includes(f.email)).map(f=>f.name)},isOnline(c){return this.online.includes(c)},linkify(c){const f=String(c??""),b=C=>C.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"),y=/\b(?:https?:\/\/|www\.)[^\s<>"']+/gi;let _="",T=0,S;for(;(S=y.exec(f))!==null;){const C=S[0].replace(/[.,;:!?)\]]+$/,""),x=C.startsWith("www.")?`https://${C}`:C;_+=b(f.slice(T,S.index)),_+=`<a href="${b(x)}" target="_blank" rel="noopener noreferrer nofollow" class="underline decoration-current/40 underline-offset-2 hover:
16decoration-current">${b(C)}</a>`,T=S.index+C.length}return _+b(f.slice(T))},get activePresence(){const c=this.active;if(!c||c.kind==="support")return null;const f=(c.participants??[]).filter(y=>y.email&&y.email!==t.email);if(c.is_group){const y=f.filter(_=>this.isOnline(_.email));return y.length?{label:y.length===1?`${y[0].name} is online`:`${y.length} online`}:null}const b=f.find(y=>y.name===c.title)??f[0];return b&&this.isOnline(b.email)?{label:"Online"}:null},detectMention(){const f=(this.$refs.draft??this.$refs.draftFull)?.selectionStart??this.draft.length,b=this.draft.slice(0,f).match(/(?:^|\s)@([\w.\-]*)$/);this.mentionTerm=b?b[1]:null,this.mentionIndex=0},moveMention(c){if(!this.mentionMatches.length)return!1;const f=this.mentionMatches.length;return this.mentionIndex=(this.mentionIndex+c+f)%f,!0},pickMention(c){const f=this.$refs.draftFull??this.$refs.draft,b=f?.selectionStart??this.draft.length,y=this.draft.slice(0,b).lastIndexOf("@");if(y<0){this.mentionTerm=null;return}const _=this.draft.slice(b),T=`@${c.name}`+(_.startsWith(" ")?"":" ");this.draft=this.draft.slice(0,y)+T+this.draft.slice(b),this.mentionTerm=null,this.$nextTick(()=>{f?.focus();const S=y+T.length;f?.setSelectionRange?.(S,S)})},enterInComposer(c){if(this.mentionMatches.length){c.preventDefault(),this.pickMention(this.mentionMatches[this.mentionIndex]);return}!c.shiftKey&&!c.isComposing&&(c.preventDefault(),this.send())},error:"",connected:!1,otherPerson(c){return!c||c.is_group||c.kind==="support"?null:(c.participants??[]).find(f=>f.name===c.title)??null},get active(){return this.conversations.find(c=>c.id===this.activeId)??this.scopedConversations.find(c=>c.id===this.activeId)??null},isSupport(c=this.activeId){return typeof c=="string"&&c.startsWith("s")},reactUrl(c,f){return e.react.replace("__ID__",c).replace("__MESSAGE__",f)}
16,editUrl(c,f){return this.isSupport(c)?e.supportEditMessage.replace("__ID__",String(c).slice(1)).replace("__MESSAGE__",f):e.editMessage.replace("__ID__",c).replace("__MESSAGE__",f)},canChange(c){return!c||c.deleted||!c.body?!1:this.isSupport(this.activeId)?c.can_change===!0:c.mine===!0},deleteUrl(c,f){return e.supportDeleteMessage.replace("__ID__",String(c).slice(1)).replace("__MESSAGE__",f)},readUrl(c){return this.isSupport(c)?e.supportRead.replace("__ID__",String(c).slice(1)):e.read.replace("__ID__",c)},messagesUrl(c){return this.isSupport(c)?e.supportMessages.replace("__ID__",String(c).slice(1)):e.messages.replace("__ID__",c)},sendUrl(c){return this.isSupport(c)?e.supportSend.replace("__ID__",String(c).slice(1)):e.send.replace("__ID__",c)},meetingUrl(c){return this.isSupport(c)?e.supportMeeting.replace("__ID__",String(c).slice(1)):e.meeting.replace("__ID__",c)},resolveUrl(c){return e.supportResolve.replace("__ID__",String(c).slice(1))},async resolveSupport(){if(this.isSupport(this.activeId))try{if(!(await fetch(this.resolveUrl(this.activeId),{method:"POST",headers:{Accept:"application/json","X-CSRF-TOKEN":e.csrf}})).ok){this.error="That did not save.";return}const f=this.activeId;this.conversations=this.conversations.filter(b=>b.id!==f),this.activeId===f&&this.back()}catch{this.error="That did not save."}},async unpickSupport(){this.isSupport(this.activeId)&&window.confirm("Put this back in the queue for somebody else to take?")&&await this.leaveSupport(e.supportRelease.replace("__ID__",String(this.activeId).slice(1)),{})},async takeSupport(){if(!this.isSupport(this.activeId))return;const c=String(this.activeId).slice(1);try{if(!(await fetch(e.supportPick.replace("__ID__",c),{method:"POST",headers:{Accept:"application/json","X-CSRF-TOKEN":e.csrf}})).ok){this.error="That did not save.";return}this.active.mine=!0,this.active.picked=!0,await this.load(),this.loadTicketCounts()}catch{this.error="That did not save."}},async reopenSupport(){if(!this.isSupport(this.activeId))return;const c=String(this.activeId).slice(1);try{if(!(await fetch(e.supportReopen.replace("__ID__",c),{method:"POST",headers:{Accept:"application/json","X-CSRF-TOKEN":e.csrf}})).ok){this.error="That did not save.";return}this.active.resolved=!1,await this.setScope(this.scope),this.loadTicketCounts()}catch{this.error="That did not save."}},handing:null,handoverAgents:[],handoverTo:"",handoverNote:"",async handOverSupport(){if(this.isSupport(this.activeId)){this.handing=this.activeId,this.handoverTo="",this.handoverNote="";try{const c=await fetch(e.supportAgents,{headers:{Accept:"application/json"}});this.handoverAgents=c.ok?(await c.json()).agents??[]:[]}catch{this.handoverAgents=[]}}},async confirmHandover(){if(!this.handoverTo)return;const c=this.handing;this.handing=null,await this.leaveSupport(e.supportTransfer.replace("__ID__",String(c).slice(1)),{to_actor_id:Number(this.handoverTo),note:this.handoverNote||null},c)},async leaveSupport(c,f,b=null){const y=b??this.activeId;try{if(!(await fetch(c,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":e.csrf},body:JSON.stringify(f)})).ok){this.error="That did not save.";return}this.conversations=this.conversations.filter(T=>T.id!==y),this.activeId===y&&this.back()}catch{this.error="That did not save."}},loaded:!d,open_:!1,quickOpen:!1,pending:null,online:[],typing:{},queued:[],progress:0,recording:!1,recordSeconds:0,recorder:null,recordTimer:null,supportTimer:null,listTimer:null,readTimers:{},cancelled:!1,lightbox:null,dragging:0,tickets:{},groupOpen:!1,meetingOpen:!1,meetingTitle:"",meetingWhenChoice:"now",meetingMinutes:"30",meetingBusy:!1,adding:!1,adds:[],peopleTerm:"",endpoints:e,me:t,playing:[],init(){this.listen(),this.watchWindowPaste(),d&&this.refreshBadge(),this.activeId&&this.open(this.activeId,s),this.loadTicketCounts(),setInterval(()=>{document.hidden||this.loadTicketCounts()},6e4),this.supportTimer=setInterval(()=>{document.visibilityState==="visible"&&this.isSupport(this.activeId)&&this.pollSupportThread()},1e4),this.listTimer=setInterval(()=>{document.visibilityState==="visible"&&this.loaded&&this.refreshList()},1e4),window.addEventListener("support-counts-changed",()=>{this.loaded&&this.refreshList()}),this.fitPanes();const c=()=>this.fitPanes();window.addEventListener("resize",c),window.addEventListener("orientationchange",c),window.visualVie
16wport?.addEventListener("resize",c),d||window.addEventListener("popstate",()=>{this.activeId&&this.narrow()&&this.back()}),this.$watch("unread",f=>this.paintBadge(f)),this.paintBadge(this.unread),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this.refreshBadge()})},async pollSupportThread(){if(!(this.loadingOlder||this.sending))try{const c=await fetch(this.messagesUrl(this.activeId),{headers:{Accept:"application/json"}});if(!c.ok)return;const f=await c.json(),b=new Set(this.messages.map(T=>T.id)),y=(f.messages??[]).filter(T=>!b.has(T.id));if(!y.length)return;this.messages.push(...y),this.atBottom()&&this.scrollToEnd(),y.some(T=>!T.mine)&&Ft(),this.viewing(this.activeId)&&this.markRead(this.activeId);const _=y[y.length-1];this.touchConversation(this.activeId,{body:_.body||(_.media?"Attachment":""),at:_.created_at})}catch{}},async refreshList(){try{const c=await fetch(e.conversations,{headers:{Accept:"application/json"}});if(!c.ok)return;const f=await c.json(),b=this.activeId,y=(f.conversations??[]).map(T=>T.id===b?{...T,unread:0}:T),_=y.reduce((T,S)=>T+(S.unread||0),0);this.loaded&&_>this.unread&&Ft(),this.conversations=y,this.unread=_}catch{}},listen(){if(!window.Echo||!t?.id)return;const c=window.Echo.private(`chat.user.${t.id}`);c.listen(".message.received",y=>this.onMessage(y)),c.listen(".read.receipt",y=>this.onReadReceipt(y)),c.listen(".unread.changed",y=>{this.unread=y.unread_total;const _=this.conversations.find(T=>T.id===y.conversation_id);_&&(_.unread=0)});const f=window.Echo.join("chat.presence").here(y=>{this.online=y.map(_=>_.email)}).joining(y=>{this.online=[...this.online,y.email]}).leaving(y=>{this.online=this.online.filter(_=>_!==y.email)}).listenForWhisper("typing",y=>{y.conversation!==this.activeId||y.email===t.email||(this.typing={...this.typing,[y.email]:Date.now()})});this.presence=f,setInterval(()=>{const y=Object.fromEntries(Object.entries(this.typing).filter(([,_])=>Date.now()-_<4e3));Object.keys(y).length!==Object.keys(this.typing).length&&(this.typing=y)},2e3);const b=window.Echo.connector?.pusher?.connection;b&&(b.bind("connected",()=>{const y=this.connected===!1;this.connected=!0,y&&(this.refreshList(),this.activeId&&this.reloadOpenThread())}),b.bind("unavailable",()=>this.connected=!1),b.bind("disconnected",()=>this.connected=!1),this.connected=b.state==="connected")},viewing(c){return this.activeId!==c||document.hidden?!1:d?this.open_:!0},onReadReceipt({conversation_id:c,read_at:f}){if(this.activeId!==c)return;const b=f?Date.parse(f):Date.now();this.messages=this.messages.map(y=>!y.mine||y.read?y:(y.created_at?Date.parse(y.created_at):0)<=b?{...y,read:!0,read_at:f}:y)},onMessage({message:c,conversation:f,unread_total:b}){const y=this.viewing(c.conversation_id);if(y||(this.unread=b),this.loaded&&this.mergeConversation(f),this.activeId===c.conversation_id){const _=this.atBottom();this.messages.push(c),_&&this.scrollToEnd()}y&&this.markRead(c.conversation_id),c.mine||Ft()},touchConversation(c,{body:f,at:b}){const y=this.conversations.findIndex(T=>T.id===c);if(y===-1)return;const _={...this.conversations[y]};f&&(_.last_message_preview=f),_.last_message_at=b||new Date().toISOString(),this.activeId===c&&(_.unread=0),this.conversations.splice(y,1),this.conversations.unshift(_)},mergeConversation(c){if(!c?.id)return;const f=this.conversations.findIndex(y=>y.id===c.id);if(f===-1){this.conversations.unshift(c);return}const b=this.activeId===c.id?0:c.unread;this.conversations.splice(f,1),this.conversations.unshift({...c,unread:b})},async toggle(){this.open_=!this.open_,this.open_&&(this.quickOpen=!1),this.open_&&(this.back(),this.loaded||await this.loadConversations(),this.refreshList())},async refreshBadge(){if(e.unread)try{const c=await fetch(e.unread,{headers:{Accept:"application/json"}});c.ok&&(this.unread=(await c.json()).unread_total)}catch{}},async loadConversations(){this.loading=!0;try{const c=await fetch(e.conversations,{headers:{Accept:"application/json"}});if(!c.ok)throw new Error("Could not load conversations.");const f=await c.json();this.conversations=f.conversations,this.unread=f.unread_total,this.loaded=!0}catch(c){this.error=c.message}finally{this.loading=!1}},back(){this.activeId=null,this.messages=[],this.cursor=null,this.hasMore=!1,this.discardAttachment()},async reloadOpenThread(){if(!(!this.activeId||this.loading))try{const c=await fetch(this.messagesUrl(this.activeId),{headers:{Accept:"application/json"}});if(!c.ok)return;const f=await c.json(),b=new Set(this.messages.map(_=>_.id)),y=(f.messages??[]).filter(_=>!b.has(_.id));if(this.messages=this.messages.map(_=>(f.messages??[]).find(T=>T.id===_.id)??_),!y.length)return;this.messages.push(...y),this.tickets={...this.tickets,...f.tickets??{}},this.atBottom()&&this.$nextTick(()=>this.scrollToEnd()),y.some(_=>!_.mine)&&Ft(),this.markRead(this.activeId)}catch{}},fitPanes(){const c=this.$refs.panes;if(!c)return;
16const f=window.visualViewport?.height??window.innerHeight,b=c.getBoundingClientRect().top,y=Math.max(280,f-b-16);c.style.height=`${Math.round(y)}px`},narrow(){return typeof window.matchMedia=="function"&&window.matchMedia("(max-width: 1023.98px)").matches},async open(c,f=null){if(!this.loading){!d&&!this.activeId&&this.narrow()&&window.history.pushState({chatThread:c},"",window.location.href),this.activeId=c,this.messages=[],this.cursor=null,this.hasMore=!1,this.loading=!0,this.error="",this.playing=[],this.groupOpen=!1,this.meetingOpen=!1,this.adding=!1,this.adds=[],this.peopleTerm="",this.discardAttachment();try{const b=await fetch(this.messagesUrl(c),{headers:{Accept:"application/json"}});if(!b.ok)throw new Error("Could not load that conversation.");const y=await b.json();this.messages=y.messages,this.tickets=y.tickets??{},this.cursor=y.next_cursor,this.hasMore=y.has_more,f?this.jumpTo(f):this.$nextTick(()=>this.scrollToEnd()),this.markRead(c)}catch(b){this.error=b.message}finally{this.loading=!1}}},async loadOlder(){if(!this.activeId||this.loadingOlder||!this.hasMore||!this.cursor)return;this.loadingOlder=!0;const c=this.$refs.thread,f=c?c.scrollHeight:0;try{const b=`${this.messagesUrl(this.activeId)}?before=${this.cursor}`,y=await fetch(b,{headers:{Accept:"application/json"}});if(!y.ok)return;const _=await y.json();this.messages=[..._.messages,...this.messages],this.tickets={..._.tickets??{},...this.tickets},this.cursor=_.next_cursor,this.hasMore=_.has_more,this.$nextTick(()=>{c&&(c.scrollTop=c.scrollHeight-f)})}finally{this.loadingOlder=!1}},onScroll(){const c=this.$refs.thread;c&&c.scrollTop<80&&this.loadOlder()},markRead(c){const f=this.conversations.find(b=>b.id===c);f&&(f.unread=0),clearTimeout(this.readTimers[c]),this.readTimers[c]=setTimeout(()=>this.sendRead(c),300)},async sendRead(c){try{const f=await fetch(this.readUrl(c),{method:"POST",headers:{Accept:"application/json","X-CSRF-TOKEN":e.csrf}});if(f.ok){const b=await f.json();typeof b.unread_total=="number"&&(this.unread=b.unread_total)}}catch{}this.dismissNotifications(c)},async dismissNotifications(c){if(!("serviceWorker"in navigator))return;const f=String(c).match(/^s(\d+)$/),b=[`chat-${c}`,f?`support-ticket-${f[1]}`:null].filter(Boolean);try{const y=await navigator.serviceWorker.ready;for(const T of b)(await y.getNotifications({tag:T})).forEach(S=>S.close());const _=await y.pushManager?.getSubscription?.();await fetch("/api/notifications/seen",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({tags:b,badge:this.unread,endpoint:_?.endpoint??null})})}catch{}},addable(){const c=new Set((this.active?.participants??[]).map(b=>b.email)),f=this.peopleTerm.trim().toLowerCase();return m.filter(b=>c.has(b.email)?!1:f?b.name.toLowerCase().includes(f)||(b.team??"").toLowerCase().includes(f):!0)},toggleAddable(c){this.adds=this.adds.includes(c)?this.adds.filter(f=>f!==c):[...this.adds,c]},async startMeeting(){const c=this.meetingTitle.trim();if(!(!c||this.meetingBusy||!this.activeId)){this.meetingBusy=!0,this.error="";try{const f=await fetch(this.meetingUrl(this.activeId),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","X-CSRF-TOKEN":e.csrf},body:JSON.stringify({title:c,starts_at:this.meetingStart(),minutes:Number(this.meetingMinutes)})}),b=await f.json();if(!f.ok){this.error=b.message||"That meeting could not be made.";return}this.messages.push(b.message),this.mergeConversation(b.conversation),this.scrollToEnd(),this.meetingOpen=!1,this.meetingTitle=""}catch{this.error="That meeting could not be made."}finally{this.meetingBusy=!1}}},meetingStart(){const c=new Date;if(this.meetingWhenChoice==="tomorrow")return c.setDate(c.getDate()+1),c.setHours(10,0,0,0),c.toISOString();const f=Number(this.meetingWhenChoice);return c.setMinutes(c.getMinutes()+(Number.isFinite(f)?f:0)),c.toISOString()},kindOf(c){return c?c.startsWith("image/")?"image":c.startsWith("video/")?"video":c.startsWith("audio/")?"audio":"file":"file"},async attach(c){if(!c)return;if(this.error="",c.size>g*1024*1024){this.error=`That file is larger than ${g} MB.`;return}this.discardAttachment();const f=this.kindOf(c.type);if(this.pending={file:c,bytes:await this.bytesOf(c),kind:f,name:c.name||"attachment",size:c.size,preview:f==="image"?URL.createObjectURL(c):null,poster:null,thumbnail:null,duration:null},f==="video"){const b=await tm(c);if(this.pending?.file!==c)return;this.pending.thumbnail=b?.blob??null,this.pending.duration=b?.duration??null,this.pending.poster=b?.blob?URL.createObjectURL(b.blob):null}if(f==="audio"){const b=await nm(c);this.pending?.file===c&&(this.pending.duration=b)}this.$nextTick(()=>this.$refs.draft?.focus())},onPick(c){this.takeFiles(c.target.files),c.target.value=""},onDrop(c){this.dragging=0,this.takeFiles(c.dataTransfer?.files)},takeFiles(c){const f=Array.from(c??[]);f.length&&(this.attach(f[0]),this.queued=[...this.queued,...f.slice(1)])},watchWindowPaste(){document.addEventListener("paste",c=>
16{if(!this.activeId||this.lazy&&!this.open_)return;const f=[...c.clipboardData?.items??[]].find(b=>b.kind==="file")?.getAsFile();f&&(c.preventDefault(),this.attach(f),this.$nextTick(()=>this.$refs.draft?.focus()))})},async bytesOf(c){try{return new Blob([await c.arrayBuffer()],{type:c.type||"application/octet-stream"})}catch{return null}},onPaste(c){const f=[...c.clipboardData?.items??[]].find(b=>b.kind==="file")?.getAsFile();f&&(c.preventDefault(),this.attach(f))},discardAttachment(){this.pending?.preview&&URL.revokeObjectURL(this.pending.preview),this.pending?.poster&&URL.revokeObjectURL(this.pending.poster),this.pending=null,this.progress=0},filenameFor(c){if(c?.name)return c.name;const f=(c?.type||"").split("/")[1]||"dat";return`upload-${Date.now()}.${f.replace("jpeg","jpg")}`},uploadPending(){const{file:c,bytes:f,thumbnail:b}=this.pending,y=new FormData;return y.append("file",f??c,this.filenameFor(c)),b&&y.append("thumbnail",b,"poster.jpg"),new Promise((_,T)=>{const S=new XMLHttpRequest;S.open("POST",e.upload.replace("__ID__",this.activeId)),S.setRequestHeader("Accept","application/json"),S.setRequestHeader("X-CSRF-TOKEN",e.csrf),S.upload.onprogress=C=>{C.lengthComputable&&(this.progress=Math.round(C.loaded/C.total*100))},S.onload=()=>{let C={};try{C=JSON.parse(S.responseText||"{}")}catch{}S.status>=200&&S.status<300?_(C):T(new Error(C.message||"That file did not upload."))},S.onerror=()=>T(new Error("That file did not upload.")),S.send(y)})},async record(){if(this.recording)return this.stopRecording();if(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>"u"){this.error="This browser cannot record audio.";return}try{const c=await navigator.mediaDevices.getUserMedia({audio:!0}),f=["audio/webm;codecs=opus","audio/webm","audio/mp4"].find(_=>MediaRecorder.isTypeSupported?.(_)),b=new MediaRecorder(c,f?{mimeType:f}:{}),y=[];b.ondataavailable=_=>_.data.size&&y.push(_.data),b.onstop=async()=>{c.getTracks().forEach(C=>C.stop()),clearInterval(this.recordTimer);const _=this.recordSeconds;if(this.recording=!1,this.recordSeconds=0,this.recorder=null,this.cancelled){this.cancelled=!1;return}const T=new Blob(y,{type:b.mimeType||"audio/webm"});if(T.size<1024)return;const S=(b.mimeType||"").includes("mp4")?"m4a":"webm";await this.attach(new File([T],`voice-message.${S}`,{type:T.type})),this.pending&&!this.pending.duration&&(this.pending.duration=_)},this.error="",this.recordSeconds=0,this.recording=!0,this.cancelled=!1,b.start(),this.recorder=b,this.recordTimer=setInterval(()=>{this.recordSeconds+=1,this.recordSeconds>=300&&this.stopRecording()},1e3)}catch{this.error="No microphone, or permission was refused."}},stopRecording(){this.recorder?.state==="recording"&&this.recorder.stop()},cancelRecording(){this.cancelled=!0,this.stopRecording()},recordClock(){return js(this.recordSeconds)},async send(){const c=this.draft.trim();if(!c&&!this.pending||this.sending||!this.activeId)return;this.sending=!0,this.draft="",this.error="";const f=this.replyingTo;this.replyingTo=null;const b=this.pending;try{if(this.isSupport(this.activeId)){const S=new FormData;S.append("body",c),f&&S.append("reply_to_id",f.id),b&&S.append("attachments[]",b.bytes??b.file,this.filenameFor(b.file));const C=await fetch(this.sendUrl(this.activeId),{method:"POST",headers:{Accept:"application/json","X-CSRF-TOKEN":e.csrf},body:S});if(!C.ok){this.draft=c,this.error="That did not send.";return}const x=await C.json();this.discardAttachment(),this.messages.push(x.message),this.scrollToEnd(),this.touchConversation(this.activeId,{body:x.message.body||(x.message.media?"Attachment":""),at:x.message.created_at});return}let y={body:c};if(f&&(y.reply_to_id=f.id),b){const S=await this.uploadPending();y={body:c,type:"media",media_path:S.media_path,media_name:S.media_name,media_mime:S.media_mime,media_size:S.media_size,thumbnail_path:S.thumbnail_path,media_duration:b.duration}}const _=await fetch(this.sendUrl(this.activeId),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","X-CSRF-TOKEN":e.csrf},body:JSON.stringify(y)});if(!_.ok){this.draft=c,this.replyingTo=f,this.error="That did not send.";return}const T=await _.json();if(this.discardAttachment(),this.messages.push(T.message),this.mergeConversation(T.conversation),this.scrollToEnd(),this.queued.length){const S=this.queued[0];this.queued=this.queued.slice(1),this.attach(S),this.$nextTick(()=>this.send())}}catch(y){this.draft=c,this.error=y.message||"That did not send."}finally{this.sending=!1,this.progress=0}},closingLine(c,f){if(!c?.ticket_id)return null;const b=this.messages[f+1];if(b&&b.ticket_id===c.ticket_id)return null;const y=this.tickets?.[String(c.ticket_id)];return y?.resolved?{id:y.id,by:y.resolved_by,at:y.resolved_at?this.clock(y.resolved_at):null}:null},atBottom(){const c=this.$refs.thread;return c?c.scrollHeight-c.scrollTop-c.clientHeight<80:!0},async jumpTo(c,f=10){const b=Number(c);if(!this.messages.some(y=>Number(y.id)===b)){if(!this.hasMore||f<=0){this.scrollToEnd();return}return await this.loadOlder(),this.jumpTo(c,f-1)}this.highlightId=b,this.$nextTick(()=>{const y=document.getElementById("msg-"+b);if(!y){this.scrollToEnd();return}y.scrollIntoView({block:"center",behavior:"smooth"})}),clearTimeout(this.highlightTimer),this.highlightTimer=setTimeout(()=>{this.highlightId=null},4e3)},highlightTimer:null,scrollToEnd(){this.$nextTick(()=>{const c=this.$refs.thread;c&&(c.scrollTop=c.scrollHeight)})}
16,paintBadge(c){const f=document.title.replace(/^\(\d+\)\s*/,"");document.title=c>0?`(${c}) ${f}`:f,"setAppBadge"in navigator&&(c>0?navigator.setAppBadge(c):navigator.clearAppBadge()).catch(()=>{})},clock(c){return c?new Date(c).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):""},size(c){return em(c)},meetingWhen(c){if(!c?.starts_at)return"Starting now";const f=new Date(c.starts_at),b=f.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}),y=c.minutes?` · ${c.minutes} min`:"",_=new Date;if(f.toDateString()===_.toDateString()){const S=Math.round((f-_)/6e4);return S<=0&&S>-(c.minutes??60)?`In progress${y}`:S<=0?`Was at ${b}`:S<60?`In ${S} min${y}`:`Today at ${b}${y}`}return`${f.toLocaleDateString([],{day:"numeric",month:"short"})} at ${b}${y}`},length(c){return c?js(c):""},play(c){this.playing.includes(c)||this.playing.push(c)},isPlaying(c){return this.playing.includes(c)},show(c){c?.media?.kind==="image"&&(this.lightbox={url:c.media.url,name:c.media.name})}}}typeof window<"u"&&(window.chatArrivalTone=Ft,window.addEventListener("pointerdown",Dn),window.addEventListener("keydown",Dn));function im(){return{meetings:[],editing:!1,error:"",form:{title:"",url:"",days:[0,1,2,3,4],starts_at:"10:00",duration_minutes:30,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"Asia/Dhaka"},init(){this.$watch("activeId",()=>this.load()),this.load(),setInterval(()=>this.load(),6e4)},get isGroup(){return this.active?.kind==="group"||this.active?.is_group},async load(){if(!this.activeId||!this.isGroup){this.meetings=[];return}try{const e=this.endpoints.groupMeetings.replace("__ID__",this.activeId),t=await fetch(e,{headers:{Accept:"application/json"}});this.meetings=t.ok?(await t.json()).meetings??[]:[]}catch{this.meetings=[]}},get live(){return this.meetings.find(e=>e.is_live)??null},join(e){e&&(window.open(e.url,"_blank","noopener"),fetch("/admin/status",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":this.endpoints.csrf},body:JSON.stringify({state:"meeting",minutes:e.duration_minutes??30,meeting_url:e.url,subject_type:"group",subject_id:e.conversation_id,subject_label:e.title})}).then(()=>window.Alpine?.store("statuses")?.refresh()))},startEdit(){const e=this.meetings[0];
16e&&(this.form={title:e.title==="Group meeting"?"":e.title,url:e.url,days:[...e.days],starts_at:e.starts_at,duration_minutes:e.duration_minutes,timezone:e.timezone}),this.error="",this.editing=!0},toggleDay(e){this.form.days=this.form.days.includes(e)?this.form.days.filter(t=>t!==e):[...this.form.days,e]},async save(){this.error="";try{const e=this.endpoints.groupMeetings.replace("__ID__",this.activeId),t=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":this.endpoints.csrf},body:JSON.stringify(this.form)});if(!t.ok){this.error=t.status===403?"Only a group admin can set the meeting.":"That did not save.";return}this.editing=!1,await this.load()}catch{this.error="That did not save."}},async remove(e){if(window.confirm("Remove this standing meeting?"))try{const t=this.endpoints.groupMeeting.replace("__ID__",this.activeId).replace("__MEETING__",e.id);await fetch(t,{method:"DELETE",headers:{Accept:"application/json","X-CSRF-TOKEN":this.endpoints.csrf}}),await this.load()}catch{this.error="That did not save."}}}}function sm({url:e}){return{ticket:null,title:"",thread:null,messages:[],loading:!1,loadingOlder:!1,error:"",async open(t,n){this.ticket=t,this.title=n||`Ticket #${t}`,this.thread=null,this.messages=[],this.error="",this.loading=!0,document.body.style.overflow="hidden",await this.fetchInto(null),this.loading=!1,this.$nextTick(()=>this.toBottom())},close(){this.ticket=null,this.thread=null,this.messages=[],document.body.style.overflow=""},async loadOlder(){if(this.loadingOlder||!this.messages.length)return;this.loadingOlder=!0;const t=this.messages[0]?.id,n=this.$refs.scroll,r=n?n.scrollHeight:0;await this.fetchInto(t),this.$nextTick(()=>{n&&(n.scrollTop=n.scrollHeight-r)}),this.loadingOlder=!1},async fetchInto(t){try{const n=e.replace("__ID__",this.ticket)+(t?`?before=${t}`:""),r=await fetch(n,{headers:{Accept:"application/json"}});if(!r.ok){this.error=r.status===404?"That conversation is not on this client.":"That could not be loaded.";return}const i=await r.json(),s=[...i.messages??[]].reverse();this.thread=i,this.messages=t?[...s,...this.messages]:s}catch{this.error="That could not be loaded."}},toBottom(){const t=this.$refs.scroll;t&&(t.scrollTop=t.scrollHeight)},when(t){if(!t)return"";const n=new Date(t),r=new Date;return n.toDateString()===r.toDateString()?n.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}):n.toLocaleDateString([],{day:"numeric",month:"short"})+", "+n.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}}}function om({localUrl:e,remoteUrl:t}){return{open:!1,term:"",localGroups:[],remoteGroups:[],loadingLocal:!1,loadingRemote:!1,remoteError:null,highlighted:0,localController:null,remoteController:null,seq:0,show(){this.open=!0,this.$nextTick(()=>this.$refs.field?.focus())},close(){this.open=!1,this.term="",this.localGroups=[],this.remoteGroups=[],this.remoteError=null,this.highlighted=0,this.localController?.abort(),this.remoteController?.abort()},hotkey(r){(r.metaKey||r.ctrlKey)&&r.key.toLowerCase()==="k"&&(r.preventDefault(),this.open?this.close():this.show())},get tooShort(){return this.term.trim().length<2},get groups(){return[...this.localGroups,...this.remoteGroups]},get results(){return this.groups.flatMap(r=>r.results)},get busy(){return this.loadingLocal||this.loadingRemote},get empty(){return!this.tooShort&&!this.busy&&this.results.length===0},look(){const r=this.term.trim();if(r.length<2){this.localGroups=[],this.remoteGroups=[],this.remoteError=null,this.localController?.abort(),this.remoteController?.abort();return}const i=++this.seq;this.highlighted=0,this.fetchLocal(r,i),this.fetchRemote(r,i)},async fetchLocal(r,i){this.localController?.abort(),this.localController=new AbortController,this.loadingLocal=!0;try{const s=await this.ask(e,r,this.localController);if(i!==this.seq)return;this.localGroups=s?.data??[]}catch{}finally{i===this.seq&&(this.loadingLocal=!1)}},async fetchRemote(r,i){this.remoteController?.abort(),this.remoteController=new AbortController,this.loadingRemote=!0;try{const s=await this.ask(t,r,this.remoteController);if(i!==this.seq)return;this.remoteGroups=s?.data??[],this.remoteError=s?.error??null}catch{}finally{i===this.seq&&(this.loadingRemote=!1)}},async ask(r,i,s){const o=await fetch(`${r}?q=${encodeURIComponent(i)}`,{headers:{Accept:"application/json"},credentials:"same-origin",signal:s.signal});return o.ok?o.json():null},move(r){const i=this.results.length;i&&(this.highlighted=(this.highlighted+r+i)%i,this.$nextTick(()=>{this.$refs.panel?.querySelector('[data-highlighted="true"]')?.scrollIntoView({block:"nearest"})}))},go(r){const i=this.results[this.highlighted];i&&(r.preventDefault(),window.location=i.url)},indexOf(r,i){return this.groups.slice(0,r).reduce((s,o)=>s+o.results.length,0)+i},parts(r){const i=String(r??""),s=this.term.trim();if(!s)return[{text:i,match:!1}];const o=i.toLowerCase().indexOf(s.toLowerCase());return o===-1?[{text:i,match:!1}]:[{text:i.slice(0,o),match:!1},{text:i.slice(o,o+s.length),match:!0},{text:i.slice(o+s.length),match:!1}].filter(h=>h.text!=="")}}}window.Alpine=L;L.plugin(dp);L.plugin(gp);L.plugin(Jp);window.startTour=e=>window.dispatchEvent(new CustomEvent("start-tour",{detail:e}));document.addEventListener("alpine:init",()=>{L.data("chat",rm),L.data("groupMeeting",im),L.data("clientTickets",sm),L.data("announcementMedia",()=>({files:[],limit:25*1024*1024,get label(){return this.files.length?`${this.files.length} ${this.files.length===1?"file":"files"} — choose again to replace`:"Choose pictures or video"},picked(){this.files=[...this.$refs.media.files??[]].map(n=>({name:n.name,size:n.size,tooBig:n.size>this.limit,readable:n.size>1048576?`${(n.size/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(n.size/1024))} KB`}))}})),L.data("screenRecorder",pp),L.data("tourDriver",Xp),L.data("chart",Gp),L.data("rankingChart",Vp),L.data("breakdownChart",Yp),L.magic("chartAxis",()=>Qp),L.magic("chartPalette",()=>Nn),L.magic("chartNumber",()=>Ur),L.data("modal",n=>({open:!1,opener:null,openFor(r){r===n&&(this.opener=document.activeElement,this.open=!0)},close(){this.open&&(this.open=!1,this.$nextTick(()=>this.opener?.focus?.()))}})),L.data("searchSelect",({options:n=[],selected:r=[],multiple:i=!1})=>({options:n,selected:r,multiple:i,open:!1,term:"",highlighted:0,dropUp:!1,init(){this.$watch("selected",()=>{this.$el.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{value:this.selected[0]??"",values:[...this.selected]}}))})},get visible(){const s=this.term.trim().toLowerCase();return s?this.options.filter(o=>`${o.label} ${o.hint??""}`.toLowerCase().includes(s)):this.options},get chosenOptions(){return this.selected.map(s=>this.options.find(o=>
16o.value===s)).filter(Boolean)},toggle(){this.open=!this.open,this.open&&(this.term="",this.highlighted=0,this.$nextTick(()=>{this.placePanel(),this.$refs.search?.focus()}))},placePanel(){const s=this.$refs.panel;if(!s)return;const o=8,h=this.$el.getBoundingClientRect(),d=s.offsetHeight+o,g=window.innerHeight-h.bottom;this.dropUp=g<d&&h.top>g},close(){this.open=!1},isSelected(s){return this.selected.includes(s)},pick(s){if(this.multiple){this.selected=this.isSelected(s)?this.selected.filter(o=>o!==s):[...this.selected,s],this.term="";return}this.selected=[s],this.close()},pickHighlighted(){const s=this.visible[this.highlighted];s&&this.pick(s.value)},deselect(s){this.selected=this.selected.filter(o=>o!==s)},clear(){this.selected=[],this.close()},move(s){const o=this.visible.length;o&&(this.highlighted=(this.highlighted+s+o)%o)}})),L.data("notificationSetting",()=>({state:"unsupported",working:!1,init(){!("Notification"in window)||!("serviceWorker"in navigator)||!("PushManager"in window)||(this.state=Notification.permission)},get heading(){return{granted:"Notifications are on for this browser",denied:"Notifications are blocked",default:"Notifications are off",unsupported:"Notifications are not available here"}[this.state]},get detail(){return{granted:"You will be told about messages and work assigned to you, even with the app closed.",denied:"This browser refused them, so nothing can be sent to it.",default:"Be told about messages and work assigned to you without keeping a tab open.",unsupported:"This browser does not support web notifications."}[this.state]},async enable(){this.working=!0;try{if(await Notification.requestPermission()!=="granted"){this.state=Notification.permission;return}await window.__subscribeToPush?.(),this.state="granted"}finally{this.working=!1}},async disable(){await window.__unsubscribeFromPush?.(),this.state="default"}})),L.data("connectionState",()=>({offline:!1,init(){this.offline=!navigator.onLine,window.addEventListener("online",()=>this.offline=!1),window.addEventListener("offline",()=>this.offline=!0)}})),L.data("liveForm",({onSaved:n=null}={})=>({saving:!1,saved:!1,error:"",async submit(r){const i=r.target.closest("form");if(!(!i||this.saving)){this.saving=!0,this.error="";try{const s=await fetch(i.action,{method:"POST",body:new FormData(i),headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}}),o=await s.json().catch(()=>({}));if(!s.ok){this.error=o.message||"That did not save.";return}this.saved=!0,setTimeout(()=>this.saved=!1,1600),this.$dispatch("task-updated",o),n&&n(o)}catch{i.submit()}finally{this.saving=!1}}}})),L.data("supportOutreach",({agentsUrl:n})=>({open:!1,clientId:"",agents:[],chosen:[],loading:!1,presenceKnown:!1,async loadAgents(){if(this.agents=[],this.chosen=[],this.presenceKnown=!1,!!this.clientId){this.loading=!0;try{const i=await(await fetch(n.replace("__ID__",this.clientId),{headers:{Accept:"application/json"}})).json();this.agents=i.agents??[],this.presenceKnown=!!i.presence_known}catch{this.agents=[]}finally{this.loading=!1}}},toggleAll(){this.chosen=this.chosen.length===this.agents.length?[]:this.agents.map(r=>r.id)}})),L.data("taskShare",({text:n="",chat:r=null}={})=>({text:n,copied:!1,failed:!1,chatOpen:!1,chatLoading:!1,chatSent:!1,conversations:[],async openChat(){if(r&&(this.chatOpen=!0,this.chatSent=!1,!this.conversations.length)){this.chatLoading=!0;try{const s=await(await fetch(r.conversations,{headers:{Accept:"application/json"}})).json();this.conversations=(s.conversations??[]).filter(o=>o.kind!=="support")}catch{this.conversations=[]}finally{this.chatLoading=!1}}},async sendToChat(i){try{await fetch(r.send.replace("__ID__",i),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":r.csrf},body:JSON.stringify({body:this.text})}),this.chatSent=!0,setTimeout(()=>this.chatOpen=!1,900)}catch{this.failed=!0}},async copy(){this.failed=!1;try{await navigator.clipboard.writeText(this.text)}catch{if(!this.fallbackCopy()){this.failed=!0;return}}this.copied=!0,setTimeout(()=>this.copied=!1,2200)},fallbackCopy(){const i=document.createElement("textarea");i.value=this.text,i.setAttribute("readonly",""),i.style.position="fixed",i.style.opacity="0",document.body.appendChild(i),i.select();let s=!1;
16try{s=document.execCommand("copy")}catch{s=!1}return document.body.removeChild(i),s},whatsapp(){window.open("https://wa.me/?text="+encodeURIComponent(this.text),"_blank","noopener")}})),L.data("passwordField",()=>({value:"",visible:!1,copied:!1,generate(){const n="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789",r=new Uint32Array(18);crypto.getRandomValues(r),this.value=Array.from(r,i=>n[i%n.length]).join(""),this.visible=!0,this.copied=!1},async copy(){if(this.value)try{await navigator.clipboard.writeText(this.value),this.copied=!0,setTimeout(()=>this.copied=!1,2e3)}catch{this.visible=!0}}})),L.data("sidebarNav",({active:n=null,keys:r=[]}={})=>({collapsed:L.$persist(!1).as("sc:nav:collapsed"),openGroups:L.$persist(null).as("sc:nav:groups"),seen:L.$persist([]).as("sc:nav:seen"),init(){this.openGroups===null&&(this.openGroups=[...r]);const i=L.raw(this.openGroups),s=r.filter(o=>!i.includes(o)&&!this.seen.includes(o));s.length&&(this.openGroups=[...i,...s],this.seen=[...this.seen,...s])},isOpen(i){return i===n||this.openGroups.includes(i)},toggleGroup(i){i!==n&&(this.openGroups=this.openGroups.includes(i)?this.openGroups.filter(s=>s!==i):[...this.openGroups,i])},toggleCollapsed(){this.collapsed=!this.collapsed}})),L.store("sc",{plan:L.$persist("pro").as("sc:plan"),billing:L.$persist("monthly").as("sc:billing"),company:L.$persist({company:"",name:"",designation:"",email:"",whatsapp:"",phone:"",website:"",country:"Bangladesh",businessType:"",industry:""}).as("sc:company")}),L.store("training",{completed:L.$persist({}).as("sc:tr:completed"),videoWatched:L.$persist({}).as("sc:tr:video"),quizPassed:L.$persist({}).as("sc:tr:quiz")}),window.filePasteBehaviour=({fileRef:n="files"}={})=>({fileRef:n,names:[],dragging:!1,fileInputEl(){return this.$refs?.[this.fileRef]??null},pasteFiles(r){const i=Array.from(r.clipboardData?.items??[]).filter(s=>s.kind==="file").map(s=>s.getAsFile()).filter(Boolean);i.length&&(r.preventDefault(),this.attach(i.map((s,o)=>this.named(s,o))))},onDropFiles(r){this.dragging=!1,this.attach(Array.from(r.dataTransfer?.files??[]))},attach(r){if(!r.length||!this.fileInputEl())return;const i=new DataTransfer;for(const s of this.fileInputEl()?.files??[])i.items.add(s);for(const s of r)i.items.add(s);this.fileInputEl().files=i.files,this.showFiles()},named(r,i){if(r.name&&r.name!=="image.png")return r;const s=(r.type.split("/")[1]||"png").replace("jpeg","jpg"),o=new Date().toISOString().slice(11,19).replace(/:/g,""),h=(this.fileInputEl()?.files?.length??0)+i+1;return new File([r],`pasted-${o}-${h}.${s}`,{type:r.type})},showFiles(){this.names=Array.from(this.fileInputEl()?.files??[]).map(r=>r.name)}}),L.data("filePaste",window.filePasteBehaviour),L.data("workItems",({url:n})=>({describe(r){return r.subtitle?r.subtitle:[r.client,r.asked_by,r.by?`handled by ${r.by}`:null].filter(Boolean).join(" · ")},open:!1,loading:!1,error:"",kind:"all",filter:"all",heading:"",subheading:"",data:{created:[],solved:[],tickets:[],trainings:[],demos:[]},tabs:[{key:"all",label:"Everything"},{key:"created",label:"Tasks created"},{key:"solved",label:"Tasks solved"},{key:"tickets",label:"Tickets"},{key:"trainings",label:"Training"},{key:"demos",label:"Demos"}],get taskSections(){return[{key:"created",label:"Tasks created",rows:this.data.created??[]},{key:"solved",label:"Tasks solved",rows:this.data.solved??[]}]},get flatSections(){return[{key:"tickets",label:"Tickets resolved",rows:this.data.tickets??[],href:r=>"/admin/chat?c=s"+r.id},{key:"trainings",label:"Training delivered",rows:this.data.trainings??[],href:()=>"/admin/trainings"},{key:"demos",label:"Demos given",rows:this.data.demos??[],href:()=>"/admin/meetings"}]},shows(r){return this.filter==="all"||this.filter===r},count(r){return r==="all"?this.total:(this.data[r]??[]).reduce((s,o)=>s+(o.counted===!1?0:1)+(o.subtasks?o.subtasks.length:0),0)},get total(){return["created","solved","tickets","trainings","demos"].reduce((r,i)=>r+this.count(i),0)},async show({actorId:r,email:i,name:s,kind:o="all",days:h=7,from:d,to:g,label:m}){this.open=!0,this.loading=!0,this.error="",this.kind=o,this.filter=o,this.heading=s||"Work delivered",this.subheading=m||(h===1?"Today":"Last "+h+" days"),this.data={created:[],solved:[],tickets:[],trainings:[],demos:[]};const c=new URLSearchParams({kind:o,days:h});r&&c.set("actor_id",r),i&&c.set("email",i),d&&c.set("from",d),g&&c.set("to",g);try{const f=await fetch(`${n}?${c}`,{headers:{Accept:"application/json"}});if(!f.ok)throw new Error("Could not load that.");const b=await f.json();this.data={created:b.created??[],solved:b.solved??[],tickets:b.tickets??[],trainings:b.trainings??[],demos:b.demos??[]},this.error=b.error??""}catch(f){this.error=f.message}finally{this.loading=!1}},close(){this.open=!1}})),L.data("peopleSelect",()=>({init(){L.store("statuses").load(),this.$watch("$store.statuses.byEmail",()=>this.decorate()),this.decorate()}
16,decorate(){[...this.$el.options].forEach(n=>{const r=n.dataset.email;if(!r)return;n.dataset.name||(n.dataset.name=n.textContent.trim());const i=L.store("statuses").for(r);n.textContent=i.known?`${n.dataset.name} — ${i.emoji} ${i.label}`:n.dataset.name})}})),L.data("meetingPrompt",({url:n,durations:r=[],presets:i=[]})=>({open:!1,href:"",state:"meeting",minutes:null,durations:r,presets:i,get shown(){return this.presets.filter(s=>["training","support_meeting","demo_meeting","meeting"].includes(s.key))},ask({href:s,context:o}){this.href=s,this.state=o||"meeting",this.minutes=this.presets.find(h=>h.key===this.state)?.minutes??30,this.open=!0},async confirm(){const s=this.href;this.open=!1;try{const o=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]')?.content??""},body:JSON.stringify({state:this.state,minutes:this.minutes,meeting_url:s,subject_type:this.subject?.type??null,subject_id:this.subject?.id??null,subject_label:this.subject?.label??null})});o.ok&&window.dispatchEvent(new CustomEvent("status-changed",{detail:await o.json()}))}catch{}this.go(s)},cancel(){this.open=!1,this.href=""},go(s){s&&window.open(s,"_blank","noopener")}}));const e=["meet.google.com","zoom.us","teams.microsoft.com","teams.live.com","whereby.com"],t=n=>{const r=n.closest("[data-status-context]")?.dataset.statusContext;if(r)return r;const i=window.location.pathname;return i.includes("/trainings")?"training":i.includes("/support")||i.includes("/tickets")?"support_meeting":i.includes("/meetings")||i.includes("/demos")?"demo_meeting":"meeting"};document.addEventListener("click",n=>{const r=n.target.closest?.("a[href]");if(!r||r.dataset.noStatus!==void 0||n.metaKey||n.ctrlKey||n.shiftKey||n.button!==0)return;let i="";try{i=new URL(r.href,window.location.origin).hostname}catch{return}e.some(s=>i===s||i.endsWith("."+s))&&(n.preventDefault(),window.dispatchEvent(new CustomEvent("meeting-join",{detail:{href:r.href,context:t(r)}})))}),L.store("statuses",{byEmail:{},faces:{},loaded:!1,async load(){if(!this.loaded)return this.loaded=!0,this.fetch()},async refresh(){return this.fetch()},async fetch(){try{const n=document.querySelector('meta[name="status-roster-url"]')?.content;if(!n)return;const r=await fetch(n,{headers:{Accept:"application/json"}});if(!r.ok)return;const i=await r.json();this.byEmail=i.by_email??{},this.faces=i.faces??{}}catch{}},avatarFor(n){return this.faces[(n||"").toLowerCase()]?.avatar??null},faceFor(n){return this.faces[(n||"").toLowerCase()]??{name:null,initials:null,color:"#4f46e5",avatar:null}},notable(n){const r=this.for(n);return r.known&&r.state!=="online"&&r.state!=="unknown"},for(n){const r=(n||"").toLowerCase();return r?this.byEmail[r]?{...this.byEmail[r],known:!0}:{state:"unknown",label:"",emoji:"",colour:"slate",available:!1,minutes:0,known:!1,href:null,subject_label:null}:{state:"unknown",label:"",emoji:"",colour:"slate",available:!1,minutes:0,known:!1,href:null,subject_label:null}}}),document.querySelector('meta[name="status-roster-url"]')&&queueMicrotask(()=>L.store("statuses").load()),L.data("activityTimeline",()=>({tip:null,tipX:0,tipY:0,flip:!1,show(n,r){this.tip=r,this.move(n)},move(n){const r=this.$root.getBoundingClientRect(),i=n.clientX-r.left,s=n.clientY-r.top,o=this.$root.clientWidth;this.tipX=Math.min(Math.max(i,90),Math.max(90,o-90)),this.flip=s<56,this.tipY=this.flip?s+18:s-10},hide(){this.tip=null}})),L.data("liveBoard",({people:n=[]}={})=>({people:n,tick:0,init(){L.store("statuses").load(),setInterval(()=>L.store("statuses").refresh(),3e4),setInterval(()=>{this.tick+=1},15e3)},get roster(){return this.tick,this.people.map(r=>({...r,status:L.store("statuses").for(r.email)}))},get busy(){return this.roster.filter(r=>L.store("statuses").notable(r.email)).sort((r,i)=>(i.status.minutes??0)-(r.status.minutes??0))},get busyGrouped(){const r=[],i=new Map;return this.busy.forEach(s=>{const o=s.status.meeting_key;if(!o){r.push({key:"solo-"+s.email,people:[s],status:s.status});return}if(!i.has(o)){const h={key:"group-"+o,people:[],status:s.status};i.set(o,h),r.push(h)}i.get(o).people.push(s)}
16),r.sort((s,o)=>this.longest(o)-this.longest(s))},longest(r){return Math.max(...r.people.map(i=>i.status.minutes??0),0)},namesFor(r){const i=r.people.map(s=>s.name);return i.length===1?i[0]:i.length===2?`${i[0]} and ${i[1]}`:`${i[0]}, ${i[1]} and ${i.length-2} ${i.length===3?"other":"others"}`},get present(){return this.roster.filter(r=>r.status.state==="online")},get silent(){return this.roster.filter(r=>r.status.state==="unknown")},get census(){return[{key:"present",label:"at their desk",n:this.present.length},{key:"busy",label:"in something",n:this.busy.length},{key:"silent",label:"no signal",n:this.silent.length}]},lastSeen(r){if(!r.last_seen)return"never opened the app";const i=Math.round((new Date-new Date(r.last_seen))/6e4);return i<60?`last seen ${Math.max(1,i)}m ago`:i<1440?`last seen ${Math.floor(i/60)}h ago`:`last seen ${Math.floor(i/1440)}d ago`},overrun(r){return r.until?new Date(r.until)<new Date:!1},howLong(r){const i=r.minutes??0;return i>=60?Math.floor(i/60)+"h"+(i%60?" "+i%60+"m":""):i+"m"}})),L.data("liveMeetings",({url:n})=>({meetings:[],init(){this.load(),setInterval(()=>this.load(),12e4),document.addEventListener("visibilitychange",()=>{document.hidden||this.load()})},async load(){try{const r=await fetch(n,{headers:{Accept:"application/json"}});if(!r.ok)return;const i=await r.json();this.meetings=(i.meetings??[]).map(s=>({...s,when:this.when(s.starts_at)}))}catch{}},when(r){if(!r)return"now";const i=Math.round((new Date(r)-new Date)/6e4);return i>0?`in ${i} min`:i>-2?"now":`started ${Math.abs(i)} min ago`},join(r){window.open(r.url,"_blank","noopener"),fetch("/admin/status",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]')?.content??""},body:JSON.stringify({state:r.state,minutes:r.duration_minutes??60,meeting_url:r.url,subject_type:r.subject_type,subject_id:r.subject_id,subject_label:r.title})}).then(()=>L.store("statuses")?.refresh())}})),L.data("statusPicker",({url:n,clearUrl:r,heartbeatUrl:i,durations:s=[],current:o={},dayEnd:h=22})=>({open:!1,custom:!1,customLabel:"",customEmoji:"",durations:s,pendingMinutes:null,lastBeat:0,untilTime:"",restOfDayChosen:!1,current:{state:"online",label:"Online",emoji:"🟢",until:null,...o},remaining:"",restOfDay(){const d=new Date;d.setHours(h,0,0,0),this.pendingMinutes=Math.max(1,Math.round((d-new Date)/6e4)),this.restOfDayChosen=!0,this.untilTime=""},untilChosen(){if(!this.untilTime)return;const[d,g]=this.untilTime.split(":").map(Number),m=new Date;m.setHours(d,g,0,0),m<=new Date&&m.setDate(m.getDate()+1),this.pendingMinutes=Math.max(1,Math.round((m-new Date)/6e4)),this.restOfDayChosen=!1},init(){this.tick(),setInterval(()=>this.tick(),3e4),this.beat(),setInterval(()=>this.beat(),6e4),document.addEventListener("visibilitychange",()=>{document.hidden||(this.lastBeat=0,this.beat())}),window.addEventListener("focus",()=>{this.lastBeat=0,this.beat()}),["pointerdown","keydown"].forEach(d=>window.addEventListener(d,()=>this.beat(),{passive:!0})),window.addEventListener("status-changed",d=>{d.detail?.state&&this.adopt(d.detail)})},tick(){if(!this.current.until){this.remaining="";return}const d=Math.round((new Date(this.current.until)-new Date)/6e4);if(d<=0){this.remaining="",this.beat();return}this.remaining=d>=60?Math.floor(d/60)+"h "+(d%60?d%60+"m":""):d+"m"},openCustom(){this.open=!1,this.custom=!0,this.$nextTick(()=>this.$refs.customLabel?.focus())},saveCustom(){this.customLabel.trim()&&this.choose("custom",this.pendingMinutes)},needsSubject:["support_meeting","demo_meeting","training","meeting"],subjectFor:null,subjectClient:"",subjectLink:"",subjectState:null,subjectMinutes:null,askSubject(d,g){this.subjectState=d,this.subjectMinutes=this.pendingMinutes??g??null,this.subjectClient="",this.subjectLink="",this.subjectFor=d,this.open=!1},async saveSubject(){const d=this.subjectState;this.subjectFor=null,await this.choose(d,this.subjectMinutes,{meeting_url:this.subjectLink.trim()||null,subject_label:this.subjectClient.trim()||null})},async choose(d,g=null,m=null){if(!m&&this.needsSubject.includes(d)){this.askSubject(d,g);return}const c=this.pendingMinutes??g??null,f={state:d,minutes:c,...m??{}};if(d==="custom"){if(!this.customLabel.trim())return;f.label=this.customLabel.trim(),f.emoji=this.customEmoji.trim()||"💬"}this.apply(f,d==="custom"?{state:d,label:f.label,emoji:f.emoji}:null),this.open=!1,this.custom=!1,this.customLabel="",this.customEmoji="",this.pendingMinutes=null,this.untilTime="",this.restOfDayChosen=!1,await this.post(n,f)},async clear(){this.open=!1,this.current={state:"online",label:"Online",emoji:"🟢",until:null},this.remaining="",await this.send(r,"DELETE"),L.store("statuses").refresh()},async beat(){const d=Date.now();if(this.lastBeat&&d-this.lastBeat<55e3)return;this.lastBeat=d;const g=await this.send(i,"POST",{focused:document.visibilityState==="visible"&&document.hasFocus()});g&&g.state&&this.adopt(g)},apply(d,g){const m=g||window.__statusPresets?.[d.state];this.current={state:d.state,label:g?.label??m?.label??d.state,emoji:g?.emoji??m?.emoji??"💬",until:d.minutes?new Date(Date.now()+d.minutes*6e4).toISOString():null},this.tick()},adopt(d){L.store("statuses").refresh(),this.current={state:d.state,label:d.label??"Online",emoji:d.emoji??"🟢",until:d.until??null},this.tick()},async post(d,g){const m=await this.send(d,"POST",g);m&&m.state&&this.adopt(m),L.store("statuses").refresh()},async send(d,g,m=null){try{const c=await fetch(d,{method:g,headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]')?.content??""},body:m?JSON.stringify(m):null});return c.ok?await c.json():null}catch{return null}}})),L.data("teamPresence",({people:n=[]}={})=>({people:n,online:[],status(r){return L.store("statuses").for(r)},init(){L.store("statuses").load(),window.Echo&&window.Echo.join("chat.presence").here(r=>{this.online=r.map(i=>i.email)}).joining(r=>{this.online=[...this.online,r.email]}).leaving(r=>{this.online=this.online.filter(i=>i!==r.email)})},isOnline(r){return this.online.includes(r)}})),L.data("clientSuggest",({url:n})=>({term:"",matches:[],open:!1,highlighted:0,controller:null,init(){this.term=this.$el.querySelector('input[name="q"]')?.value??""},async look(){const r=this.term.trim();if(r.length<2){this.close();return}this.controller?.abort(),this.controller=new AbortController;try{const i=await fetch(`${n}?q=${encodeURIComponent(r)}`,{headers:{Accept:"application/json"},signal:this.controller.signal});if(!i.ok)return;const s=await i.json();this.matches=s.data??[],this.highlighted=0,this.open=this.matches.length>0}catch{}},move(r){this.matches.length&&(this.highlighted=(this.highlighted+r+this.matches.length)%this.matches.length)},go(r){!this.open||!this.matches.length||(r.preventDefault(),window.location=this.matches[this.highlighted].url)},close(){this.open=!1,this.matches=[]}})),L.data("globalSearch",om),L.data("fileDrop",({auto:n=!1}={})=>({drag:!1,file:null,preview:null,uploading:!1,auto:n,onSelect(r){this.setFile(r.target.files?.[0])},onDrop(r){this.drag=!1;const i=r.dataTransfer?.files;i?.length&&(this.$refs.input.files=i,this.setFile(i[0]))},setFile(r){r&&(this.file=r,this.preview=r.type?.startsWith("image/")?URL.createObjectURL(r):null,this.auto&&(this.uploading=!0,this.$refs.input.form?.requestSubmit?.()??this.$refs.input.form?.submit()))},get size(){if(!this.file)return"";const r=this.file.size/1024;return r>1024?(r/1024).toFixed(1)+" MB":Math.round(r)+" KB"}}))});window.scFmtTk=function(e){return new Intl.NumberFormat("en-IN").format(Math.round(e))+" TK"};(function(){const e=()=>{const t=document.querySelectorAll("[data-reveal]:not(.revealed)");if(!("IntersectionObserver"in window)){t.forEach(r=>r.classList.add("revealed"));return}const n=new IntersectionObserver(r=>{r.forEach(i=>
16{if(!i.isIntersecting)return;const s=i.target,o=s.dataset.revealDelay;o&&(s.style.transitionDelay=o+"ms"),s.classList.add("revealed"),n.unobserve(s)})},{threshold:.12,rootMargin:"0px 0px -40px 0px"});t.forEach(r=>n.observe(r))};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()})();(()=>{const e=n=>{setTimeout(()=>{[...n.querySelectorAll('button[type="submit"], button:not([type]), input[type="submit"]'),...n.id?document.querySelectorAll(`[form="${n.id}"]`):[]].forEach(i=>{i.disabled||(i.disabled=!0,i.dataset.wasEnabled="1",i.classList.add("cursor-not-allowed","opacity-60"))})},0)},t=()=>{document.querySelectorAll("[data-was-enabled]").forEach(n=>{n.disabled=!1,delete n.dataset.wasEnabled,n.classList.remove("cursor-not-allowed","opacity-60")}),document.querySelectorAll("form[data-submitting]").forEach(n=>delete n.dataset.submitting)};document.addEventListener("submit",n=>{const r=n.target;if(!(!(r instanceof HTMLFormElement)||r.hasAttribute("data-allow-resubmit"))){if(r.dataset.submitting==="1"){n.preventDefault();return}r.dataset.submitting="1",e(r)}},!0),window.addEventListener("pageshow",t)})();L.start();document.querySelectorAll("[data-pdf-viewer]").forEach(e=>{Ds(async()=>{const{mount:t}=await import("./proposal-viewer-Bby082BN.js");return{mount:t}},[]).then(({mount:t})=>t(e))});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.