1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2888],{57542:function(e,t,n){"use strict";var r,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,c={};((e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})})(c,{createBrowserSupabaseClient:()=>P,createClientComponentClient:()=>u,createMiddlewareClient:()=>y,createMiddlewareSupabaseClient:()=>I,createPagesBrowserClient:()=>d,createPagesServerClient:()=>g,createRouteHandlerClient:()=>O,createServerActionClient:()=>E,createServerComponentClient:()=>k,createServerSupabaseClient:()=>C}),e.exports=((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let c of s(t))a.call(e,c)||c===n||i(e,c,{get:()=>t[c],enumerable:!(r=o(t,c))||r.enumerable});return e})(i({},"__esModule",{value:!0}),c);var l=n(27995);function u({supabaseUrl:e="https://uclskwetrppbodtcelol.supabase.co",supabaseKey:t="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVjbHNrd2V0cnBwYm9kdGNlbG9sIiwicm9sZSI6ImFub24iLCJpYXQiOjE2Njc3ODI1NDEsImV4cCI6MTk4MzM1ODU0MX0.FMoZFrDpQB6oGht9VTVcdS695SUoi-NpzawahVrLae0",options:n,cookieOptions:i,isSingleton:o=!0}={}){if(!e||!t)throw Error("either NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY env variables or supabaseUrl and supabaseKey are required!");let s=()=>{var r;return(0,l.createSupabaseClient)(e,t,{...n,global:{...null==n?void 0:n.global,headers:{...null==(r=null==n?void 0:n.global)?void 0:r.headers,"X-Client-Info":"@supabase/[email protected]"}},auth:{storageKey:null==i?void 0:i.name,storage:new l.BrowserCookieAuthStorageAdapter(i)}})};if(o){let e=r??s();return"undefined"==typeof window?e:(r||(r=e),r)}return s()}var d=u,h=n(27995),f=n(69328),p=class extends h.CookieAuthStorageAdapter{constructor(e,t){super(t),this.context=e}getCookie(e){var t;return(0,f.splitCookiesString)((null==(t=this.context.res.getHeader("set-cookie"))?void 0:t.toString())??"").map(t=>(0,h.parseCookies)(t)[e]).find(e=>!!e)??this.context.req.cookies[e]}setCookie(e,t){this._setCookie(e,t)}deleteCookie(e){this._setCookie(e,"",{maxAge:0})}_setCookie(e,t,n){var r;let i=(0,f.splitCookiesString)((null==(r=this.context.res.getHeader("set-cookie"))?void 0:r.toString())??"").filter(t=>!(e in(0,h.parseCookies)(t))),o=(0,h.serializeCookie)(e,t,{...this.cookieOptions,...n,httpOnly:!1});this.context.res.setHeader("set-cookie",[...i,o])}};function g(e,{supabaseUrl:t="https://uclskwetrppbodtcelol.supabase.co",supabaseKey:n="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVjbHNrd2V0cnBwYm9kdGNlbG9sIiwicm9sZSI6ImFub24iLCJpYXQiOjE2Njc3ODI1NDEsImV4cCI6MTk4MzM1ODU0MX0.FMoZFrDpQB6oGht9VTVcdS695SUoi-NpzawahVrLae0",options:r,cookieOptions:i}={}){var o;if(!t||!n)throw Error("either NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY env variables or supabaseUrl and supabaseKey are required!");return(0,h.createSupabaseClient)(t,n,{...r,global:{...null==r?void 0:r.global,headers:{...null==(o=null==r?void 0:r.global)?void 0:o.headers,"X-Client-Info":"@supabase/[email protected]"}},auth:{storageKey:null==i?void 0:i.name,storage:new p(e,i)}})}var v=n(27995),m=n(69328),_=class extends v.CookieAuthStorageAdapter{constructor(e,t){super(t),this.context=e}getCookie(e){var t;return(0,m.splitCookiesString)((null==(t=this.context.res.headers.get("set-cookie"))?void 0:t.toString())??"").map(t=>(0,v.parseCookies)(t)[e]).find(e=>!!e)||(0,v.parseCookies)(this.context.req.headers.get("cookie")??"")[e]}setCookie(e,t){this._setCookie(e,t)}deleteCookie(e){this._setCookie(e,"",{maxAge:0})}_setCookie(e,t,n){let r=(0,v.serializeCookie)(e,t,{...this.cookieOptions,...n,httpOnly:!1});this.context.res.headers&&(this.context.res.headers.append("set-cookie",r),this.context.res.headers.append("cookie",r))}};function y(e,{supabaseUrl:t="https://uclskwetrppbodtcelol.supabase.co",supabaseKey:n="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVjbHNrd2V0cnBwYm9kdGNlbG9sIiwicm9sZSI6ImFub24iLCJpYXQiOjE2Njc3ODI1NDEsImV4cCI6MTk4MzM1ODU0MX0.FMoZFrDpQB6oGht9VTVcdS695SUoi-NpzawahVrLae0",options:r,cookieOptions:i}={}){var o;if(!t||!n)throw Error("either NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY env variables or supabaseUrl and supabaseKey are required!");return(0,v.createSupabaseClient)(t,n,{...r,global:{...null==r?void 0:r.global,headers:{...null==(o=null==r?void 0:r.global)?void 0:o.headers,"X-Client-Info":"@supabase/[email protected]"}},auth:{storageKey:null==i?void 0:i.name,storage:new _(e,i)}})}var b=n(27995),w=class extends b.CookieAuthStorageAdapter{constructor(e,t){super(t),this.context=e}getCookie(e){var t;return null==(t=this.context.cookies().get(e))?void 0:t.value}setCookie(e,t){}deleteCookie(e){}};function k(e,{supabaseUrl:t="https://uclskwetrppbodtcelol.supabase.co",supabaseKey:n="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVjbHNrd2V0cnBwYm9kdGNlbG9sIiwicm9sZSI6ImFub24iLCJpYXQiOjE2Njc3ODI1NDEsImV4cCI6MTk4MzM1ODU0MX0.FMoZFrDpQB6oGht9VTVcdS695SUoi-NpzawahVrLae0",options:r,cookieOptions:i}={}){var o;if(!t||!n)throw Error("either NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY env variables or supabaseUrl and supabaseKey are required!");return(0,b.createSupabaseClient)(t,n,{...r,global:{...null==r?void 0:r.global,headers:{...null==(o=null==r?void 0:r.global)?void 0:o.headers,"X-Client-Info":"@supabase/[email protected]"}},auth:{storageKey:null==i?void 0:i.name,storage:new w(e,i)}})}var S=n(27995),x=class extends S.CookieAuthStorageAdapter{constructor(e,t){super(t),this.context=e}getCookie(e){var t;return null==(t=this.context.cookies().get(e))?void 0:t.value}setCookie(e,t){this.context.cookies().set(e,t)}deleteCookie(e){this.context.cookies().set(e,"",{maxAge:0}
1)}};function O(e,{supabaseUrl:t="https://uclskwetrppbodtcelol.supabase.co",supabaseKey:n="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVjbHNrd2V0cnBwYm9kdGNlbG9sIiwicm9sZSI6ImFub24iLCJpYXQiOjE2Njc3ODI1NDEsImV4cCI6MTk4MzM1ODU0MX0.FMoZFrDpQB6oGht9VTVcdS695SUoi-NpzawahVrLae0",options:r,cookieOptions:i}={}){var o;if(!t||!n)throw Error("either NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY env variables or supabaseUrl and supabaseKey are required!");return(0,S.createSupabaseClient)(t,n,{...r,global:{...null==r?void 0:r.global,headers:{...null==(o=null==r?void 0:r.global)?void 0:o.headers,"X-Client-Info":"@supabase/[email protected]"}},auth:{storageKey:null==i?void 0:i.name,storage:new x(e,i)}})}var E=O;function P({supabaseUrl:e="https://uclskwetrppbodtcelol.supabase.co",supabaseKey:t="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVjbHNrd2V0cnBwYm9kdGNlbG9sIiwicm9sZSI6ImFub24iLCJpYXQiOjE2Njc3ODI1NDEsImV4cCI6MTk4MzM1ODU0MX0.FMoZFrDpQB6oGht9VTVcdS695SUoi-NpzawahVrLae0",options:n,cookieOptions:r}={}){return console.warn("Please utilize the `createPagesBrowserClient` function instead of the deprecated `createBrowserSupabaseClient` function. Learn more: https://supabase.com/docs/guides/auth/auth-helpers/nextjs-pages"),d({supabaseUrl:e,supabaseKey:t,options:n,cookieOptions:r})}function C(e,{supabaseUrl:t="https://uclskwetrppbodtcelol.supabase.co",supabaseKey:n="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVjbHNrd2V0cnBwYm9kdGNlbG9sIiwicm9sZSI6ImFub24iLCJpYXQiOjE2Njc3ODI1NDEsImV4cCI6MTk4MzM1ODU0MX0.FMoZFrDpQB6oGht9VTVcdS695SUoi-NpzawahVrLae0",options:r,cookieOptions:i}={}){return console.warn("Please utilize the `createPagesServerClient` function instead of the deprecated `createServerSupabaseClient` function. Learn more: https://supabase.com/docs/guides/auth/auth-helpers/nextjs-pages"),g(e,{supabaseUrl:t,supabaseKey:n,options:r,cookieOptions:i})}function I(e,{supabaseUrl:t="https://uclskwetrppbodtcelol.supabase.co",supabaseKey:n="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InVjbHNrd2V0cnBwYm9kdGNlbG9sIiwicm9sZSI6ImFub24iLCJpYXQiOjE2Njc3ODI1NDEsImV4cCI6MTk4MzM1ODU0MX0.FMoZFrDpQB6oGht9VTVcdS695SUoi-NpzawahVrLae0",options:r,cookieOptions:i}={}){return console.warn("Please utilize the `createMiddlewareClient` function instead of the deprecated `createMiddlewareSupabaseClient` function. Learn more: https://supabase.com/docs/guides/auth/auth-helpers/nextjs#middleware"),y(e,{supabaseUrl:t,supabaseKey:n,options:r,cookieOptions:i})}},84053:function(e,t,n){"use strict";var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,a=(e,t,n)=>new Promise((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}),c={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(c,{SessionContextProvider:()=>h,useSession:()=>g,useSessionContext:()=>f,useSupabaseClient:()=>p,useUser:()=>v}),e.exports=((e,t,n,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let c of o(t))s.call(e,c)||c===n||r(e,c,{get:()=>t[c],enumerable:!(a=i(t,c))||a.enumerable});return e})(r({},"__esModule",{value:!0}),c);var l=n(67294),u=n(85893),d=(0,l.createContext)({isLoading:!0,session:null,error:null,supabaseClient:{}}),h=({supabaseClient:e,initialSession:t=null,children:n})=>{let[r,i]=(0,l.useState)(t),[o,s]=(0,l.useState)(!t),[c,h]=(0,l.useState)();(0,l.useEffect)(()=>{let t=!0;return function(){a(this,null,function*(){let{data:{session:n},error:r}=yield e.auth.getSession();if(t){if(r){h(r),s(!1);return}i(n),s(!1)}})}(),()=>{t=!1}},[]),(0,l.useEffect)(()=>{let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{t&&("SIGNED_IN"===e||"TOKEN_REFRESHED"===e)&&i(t),"SIGNED_OUT"===e&&i(null)});return()=>{t.unsubscribe()}},[]);let f=(0,l.useMemo)(()=>o?{isLoading:!0,session:null,error:null,supabaseClient:e}:c?{isLoading:!1,session:null,error:c,supabaseClient:e}:{isLoading:!1,session:r,error:null,supabaseClient:e},[o,r,c]);return(0,u.jsx)(d.Provider,{value:f,children:n})},f=()=>{let e=(0,l.useContext)(d);if(void 0===e)throw Error("useSessionContext must be used within a SessionContextProvider.");return e};function p(){let e=(0,l.useContext)(d);if(void 0===e)throw Error("useSupabaseClient must be used within a SessionContextProvider.");return e.supabaseClient}var g=()=>{let e=(0,l.useContext)(d);if(void 0===e)throw Error("useSession must be used within a SessionContextProvider.");return e.session},v=()=>{var e,t;let n=(0,l.useContext)(d);if(void 0===n)throw Error("useUser must be used within a SessionContextProvider.");return null!=(t=null==(e=n.session)?void 0:e.user)?t:null}}
1,54098:function(e,t){var n="undefined"!=typeof self?self:this,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();(function(e){var t={searchParams:"URLSearchParams"in r,iterable:"Symbol"in r&&"iterator"in Symbol,blob:"FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};if(t.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(e){return e&&n.indexOf(Object.prototype.toString.call(e))>-1};function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw TypeError("Invalid character in header field name");return e.toLowerCase()}function s(e){return"string"!=typeof e&&(e=String(e)),e}function a(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(n[Symbol.iterator]=function(){return n}),n}function c(e){this.map={},e instanceof c?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function l(e){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}function u(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function d(e){var t=new FileReader,n=u(t);return t.readAsArrayBuffer(e),n}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e){if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var n;t.arrayBuffer&&t.blob&&(n=e)&&DataView.prototype.isPrototypeOf(n)?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||i(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e)}}else this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,n,r=l(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,n=u(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},t.formData&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(e,t){e=o(e),t=s(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},c.prototype.delete=function(e){delete this.map[o(e)]},c.prototype.get=function(e){return e=o(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(o(e))},c.prototype.set=function(e,t){this.map[o(e)]=s(t)},c.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},c.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),a(e)},c.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),a(e)},c.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),a(e)},t.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);
1var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(e,t){var n,r,i=(t=t||{}).body;if(e instanceof g){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new c(t.headers)),this.method=(r=(n=t.method||this.method||"GET").toUpperCase(),p.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function v(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function m(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},f.call(g.prototype),f.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];m.redirect=function(e,t){if(-1===_.indexOf(t))throw RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},e.DOMException=r.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function y(n,r){return new Promise(function(i,o){var s=new g(n,r);if(s.signal&&s.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var e,t,n={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}}),t)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL"),i(new m("response"in a?a.response:a.responseText,n))},a.onerror=function(){o(TypeError("Network request failed"))},a.ontimeout=function(){o(TypeError("Network request failed"))},a.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&t.blob&&(a.responseType="blob"),s.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),s.signal&&(s.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",l)}),a.send(void 0===s._bodyInit?null:s._bodyInit)})}y.polyfill=!0,r.fetch||(r.fetch=y,r.Headers=c,r.Request=g,r.Response=m),e.Headers=c,e.Request=g,e.Response=m,e.fetch=y,Object.defineProperty(e,"__esModule",{value:!0})})({}),r.fetch.ponyfill=!0,delete r.fetch.polyfill,(t=r.fetch).default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t},284:function(e){var t=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return t()}try{if(!__global__)return t();return __global__}finally{delete Object.prototype.__global__}}()},83454:function(e,t,n){"use strict";var r,i;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(i=n.g.process)?void 0:i.env)?n.g.process:n(77663)},91118:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return n(48269)}])},10790:function(e,t,n){"use strict";n.d(t,{AB:function(){return i},LV:function(){return r}});let r=e=>{i({action:"page_view",page_path:e})},i=e=>{let{action:t,category:n,label:r,value:i,nonInteraction:o}=e;window.gtag("event",t,{event_category:n,event_label:r,value:i,non_interaction:o})}},99484:function(e,t,n){"use strict";n.d(t,{A3:function(){return c},hy:function(){return s},ls:function(){return l},mV:function(){return a},qy:function(){return o}});var r,i=n(83454);let o="https://chrome.google.com/webstore/detail/ipikiaejjblmdopojhpejjmbedhlibno",s="https://microsoftedge.microsoft.com/addons/detail/hbmlbjinfgpkjdgjhhbnjjicebbnljmb",a=(null===(r=i.env.
1NEXT_PUBLIC_WEB_APP_URL)||void 0===r?void 0:r.trim())||"https://app.swiftread.com",c=6470811151,l="com.swiftread.universal"},10728:function(e,t,n){"use strict";n.d(t,{_:function(){return a}});var r=n(83454);let i=e=>{if(!e)return;let t=e.toLowerCase();return["development","dev"].includes(t)?"development":["preview","staging","stage"].includes(t)?"preview":["production","prod"].includes(t)?"production":void 0},o=()=>{var e,t;let n=null===(t=window.location)||void 0===t?void 0:null===(e=t.hostname)||void 0===e?void 0:e.toLowerCase();if(n)return"localhost"===n||"127.0.0.1"===n||"[::1]"===n?"development":n.endsWith(".vercel.app")?"preview":"production"},s=null,a=()=>{if(s)return s;for(let e of[r.env.NEXT_PUBLIC_VERCEL_ENV,r.env.VERCEL_ENV]){let t=i(e);if(t)return s=t}let e=i("production");if(e)return s=e;let t=o();return s=t||"production"}},21563:function(e,t,n){"use strict";n.d(t,{Ax:function(){return v},H_:function(){return k},Xk:function(){return b},hd:function(){return w}});var r=n(99484);let i="swiftread.campaign_attribution.v1",o=["sr_touch_id","sr_source","sr_medium","sr_account_id","sr_account","sr_campaign_id","sr_campaign","sr_audience_id","sr_audience","sr_adgroup_id","sr_adgroup","sr_ad_id","sr_creative_id","sr_creative","sr_keyword_id","sr_keyword","sr_matchtype","sr_network","sr_placement","sr_device","sr_landing","sr_cta","sr_destination","sr_experiment"],s=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","gclid","gbraid","wbraid","ttclid","rdt_cid","msclkid","fbclid",...o],a=[...o],c=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","gclid","gbraid","wbraid","ttclid","rdt_cid","msclkid","fbclid","sr_source","sr_medium","sr_account_id","sr_account","sr_campaign_id","sr_campaign","sr_audience_id","sr_audience","sr_adgroup_id","sr_adgroup","sr_ad_id","sr_creative_id","sr_creative","sr_keyword_id","sr_keyword","sr_matchtype","sr_network","sr_placement","sr_device","sr_experiment"],l=()=>!0;function u(){return"undefined"!=typeof crypto&&crypto.randomUUID?"sr_".concat(crypto.randomUUID()):"sr_".concat(Date.now().toString(36),"_").concat(Math.random().toString(36).slice(2,10))}function d(){if(!l())return null;try{let e=window.localStorage.getItem(i);if(!e)return null;let t=JSON.parse(e);return(null==t?void 0:t.sr_touch_id)?t:null}catch(e){return null}}function h(e){if(l())try{window.localStorage.setItem(i,JSON.stringify(e))}catch(e){}}function f(e){return Object.fromEntries(e.filter(e=>{let[,t]=e;return t&&t.trim().length>0}))}function p(){if(l())return window.location.pathname||"/"}function g(e,t){try{var n;null==e||null===(n=e.register)||void 0===n||n.call(e,{...f(a.map(e=>{var n;return[e,null!==(n=t[e])&&void 0!==n?n:void 0]})),acquisition_source:"reddit"===t.sr_source&&"finance_jun26"===t.sr_campaign?"reddit_finance":t.sr_source})}catch(e){}}function v(e){var t,n,r,i,o,a;if(!l())return null;let v=function(e){let t={...e};return!t.sr_source&&t.utm_source&&(t.sr_source=t.utm_source),!t.sr_medium&&t.utm_medium&&(t.sr_medium=t.utm_medium),!t.sr_campaign&&t.utm_campaign&&(t.sr_campaign=t.utm_campaign),!t.sr_campaign_id&&t.utm_id&&(t.sr_campaign_id=t.utm_id),!t.sr_creative&&t.utm_content&&(t.sr_creative=t.utm_content),!t.sr_keyword&&t.utm_term&&(t.sr_keyword=t.utm_term),t}(function(e){let t=new URLSearchParams(e);return f(s.map(e=>{var n;return[e,null!==(n=t.get(e))&&void 0!==n?n:void 0]}))}(window.location.search)),m=d();if(!s.some(e=>!!v[e]))return m&&g(e,m),m;let _=new Date().toISOString(),y={...m,...v,first_touch_at:null!==(t=null==m?void 0:m.first_touch_at)&&void 0!==t?t:_,latest_touch_at:_,sr_touch_id:null!==(r=null!==(n=v.sr_touch_id)&&void 0!==n?n:null==m?void 0:m.sr_touch_id)&&void 0!==r?r:u(),sr_landing:null!==(o=null!==(i=v.sr_landing)&&void 0!==i?i:null==m?void 0:m.sr_landing)&&void 0!==o?o:"marketing_site"};if(h(y),g(e,y),c.some(e=>!!v[e]))try{null==e||null===(a=e.capture)||void 0===a||a.call(e,"landing_page_viewed",{...y,acquisition_source:"reddit"===y.sr_source&&"finance_jun26"===y.sr_campaign?"reddit_finance":y.sr_source,page_path:p()})}catch(e){}return y}function m(e,t,n){let r=new URL(e,l()?window.location.origin:"https://swiftread.com"),i=f([...Object.entries(null!=t?t:{}),...Object.entries(n)]);for(let e of s){let t=i[e];t&&r.searchParams.set(e,t)}return r.toString()}function _(){var e,t;let n=null!==(t=null!==(e=v(null))&&void 0!==e?e:d())&&void 0!==t?t:{first_touch_at:new Date().toISOString(),latest_touch_at:new Date().toISOString(),sr_touch_id:u()};return h(n),n}function y(e,t,n){var i;let o=new URL(m("".concat(r.mV,"/extension-install"),t,{sr_cta:n.cta,sr_destination:null!==(i=n.destination)&&void 0!==i?i:"edge"===e?"edge_extension":"chrome_extension",sr_placement:e}));return o.searchParams.set("platform",e),o.toString()}function b(e,t){var n,i;let o=_();return"ios"===e||"android"===e?function(e,t){var n;let r=l()?window.location.origin:"https://swiftread.com";return m("".concat(r,"/mobile"),e,{sr_cta:t.cta,sr_destination:null!==(n=t.destination)&&void 0!==n?n:"mobile_store"})}(o,{...t,destination:null!==(n=t.destination)&&void 0!==n?n:"mobile_store"}):"edge"===e?y("edge",o,t):"chrome"===e?y("chrome",o,t):m(r.mV,o,{sr_cta:t.cta,sr_destination:null!==(i=t.destination)&&void 0!==i?i:"web_app"})}function w(e){let t=_();return m("".concat(r.mV,"/purchase"),t,{sr_cta:e.cta,sr_destination:"app_checkout",...t.sr_source?{}:{sr_source:"web"}})}function k(e,t){let n=_();g(e,n);try{var r;null==e||null===(r=e.capture)||void 0===r||r.call(e,"marketing_cta_clicked",{...n,acquisition_source:(null==n?void 0:n.sr_source)==="reddit"&&"finance_jun26"===n.sr_campaign?"reddit_finance":null==n?void 0:n.sr_source,cta:t.cta,destination:t.destination,platform_id:t.platformId,page_path:p()})}catch(e){}}},90139:function(e,t,n){"use strict";n.d(t,{E3:function(){return v},V3:function(){return p},yx:function(){return g}});var r=n(99893),i=n(10728);let o="swiftread_ph_anonymous_id",s=null,a=()=>s||(s=(0,i._)()),c=()=>"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"anon_".concat(Math.random().toString(36).slice(2,11)),l=()=>{try{return window.localStorage.getItem(o)}catch(e){return null}},u=e=>{try{window.localStorage.setItem(o,e)}catch(e){}},d=()=>{let e=l();return e||u(e=c()),e},h=r.ZP,f=e=>{let t={env_person:e};"function"==typeof h.setPersonPropertiesForFlags&&h.setPersonPropertiesForFlags(t),h.register(t)},p=()=>{let e=a();return f(e),e},g=function(){let{distinctId:e,properties:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=a(),i={...t,env_person:n};if(f(n),e)return r.ZP.identify(e,i),e;let o=d();return o?(r.ZP.identify(o,i),o):null},v=()=>{r.ZP.reset()}},48269:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return v},reportWebVitals:function(){return p}});var r=n(85893),i=n(67294),o=n(11163),s=n(10790),a=n(57542),c=n(84053),l=n(99893),u=n(58192),d=n(90139),h=n(21563);n(49990);var f=n(23636);function p(e){let{id:t,name:n,label:r,value:i}=e;s.AB({category:"web-vital"===r?"Web Vitals":"Next.js custom metric",action:n,value:Math.round("CLS"===n?1e3*i:i),label:t,nonInteraction:!0})}function g(){var e,t,n,r;let{session:o}=(0,c.useSessionContext)(),s=(0,i.useRef)(null),a=null!==(n=null==o?void 0:null===(e=o.user)||void 0===e?void 0:e.id)&&void 0!==n?n:null,l=null!==(r=null==o?void 0:null===(t=o.user)||void 0===t?void 0:t.email)&&void 0!==r?r:void 0;return(0,i.useEffect)(()=>
1{if(a){s.current!==a&&((0,d.yx)({distinctId:a,properties:{email:l}}),s.current=a);return}s.current&&((0,d.E3)(),s.current=null),(0,d.yx)()},[a,l]),null}function v(e){let{Component:t,pageProps:n}=e,d=(0,o.useRouter)(),[f]=(0,i.useState)(()=>(0,a.createPagesBrowserClient)());return(0,i.useEffect)(()=>{let e=d.pathname;s.LV(e),(0,h.Ax)(l.ZP)},[]),(0,i.useEffect)(()=>{let e=()=>{null===l.ZP||void 0===l.ZP||l.ZP.capture("$pageview"),(0,h.Ax)(l.ZP)};return d.events.on("routeChangeComplete",e),()=>{d.events.off("routeChangeComplete",e)}},[]),(0,r.jsx)(c.SessionContextProvider,{supabaseClient:f,initialSession:n.initialSession,children:(0,r.jsxs)(u.zf,{client:l.ZP,children:[(0,r.jsx)(g,{}),(0,r.jsx)(t,{...n})]})})}n(21540),f.vc.autoAddCss=!1,l.ZP.init("phc_O1KAsXgHjGwY3cdHQZVdclGmRJNqrRzPUTHHkVUO7dS",{api_host:"https://t.swiftread.com",ui_host:"https://us.posthog.com",disable_session_recording:!0,autocapture:{css_selector_allowlist:["[data-ph-id]"]},loaded:e=>{}}),(0,d.V3)()},21540:function(){},49990:function(){},77663:function(e){!function(){var t={229:function(e){var t,n,r,i=e.exports={};function o(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var c=[],l=!1,u=-1;function d(){l&&r&&(l=!1,r.length?c=r.concat(c):u=-1,c.length&&h())}function h(){if(!l){var e=a(d);l=!0;for(var t=c.length;t;){for(r=c,c=[];++u<t;)r&&r[u].run();u=-1,t=c.length}r=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new f(e,t)),1!==c.length||l||a(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var o=n[e]={exports:{}},s=!0;try{t[e](o,o.exports,r),s=!1}finally{s&&delete n[e]}return o.exports}r.ab="//";var i=r(229);e.exports=i}()},11163:function(e,t,n){e.exports=n(37253)},99893:function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){l(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}
1function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,r=d(e);return n=t?Reflect.construct(r,arguments,d(this).constructor):r.apply(this,arguments),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){a=!0,i=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}}(e,t)||v(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=v(e))||t&&e&&"number"==typeof e.length){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(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}n.d(t,{ZP:function(){return no}});var y,b=String.fromCharCode,w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",S={};function x(e,t){if(!S[e]){S[e]={};for(var n=0;n<e.length;n++)S[e][e.charAt(n)]=n}return S[e][t]}var O={compressToBase64:function(e){if(null==e)return"";var t=O._compress(e,6,function(e){return w.charAt(e)});switch(t.length%4){default:case 0:return t;case 1:return t+"===";case 2:return t+"==";case 3:return t+"="}},decompressFromBase64:function(e){return null==e?"":""==e?null:O._decompress(e.length,32,function(t){return x(w,e.charAt(t))})},compressToUTF16:function(e){return null==e?"":O._compress(e,15,function(e){return b(e+32)})+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:O._decompress(e.length,16384,function(t){return e.charCodeAt(t)-32})},compressToUint8Array:function(e){for(var t=O.compress(e),n=new Uint8Array(2*t.length),r=0,i=t.length;r<i;r++){var o=t.charCodeAt(r);n[2*r]=o>>>8,n[2*r+1]=o%256}return n},decompressFromUint8Array:function(e){if(null==e)return O.decompress(e);for(var t=Array(e.length/2),n=0,r=t.length;n<r;n++)t[n]=256*e[2*n]+e[2*n+1];var i=[];return t.forEach(function(e){i.push(b(e))}),O.decompress(i.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":O._compress(e,6,function(e){return k.charAt(e)})},decompressFromEncodedURIComponent:function(e){return null==e?"":""==e?null:(e=e.replace(/ /g,"+"),O._decompress(e.length,32,function(t){return x(k,e.charAt(t))}))},compress:function(e){return O._compress(e,16,function(e){return b(e)})},_compress:function(e,t,n){if(null==e)return"";var r,i,o,s="",a="",c="",l=2,u=3,d=2,h=0,f=0,p={},g={},v=[];for(o=0;o<e.length;o+=1)if(s=e.charAt(o),Object.prototype.hasOwnProperty.call(p,s)||(p[s]=u++,g[s]=!0),a=c+s,Object.prototype.hasOwnProperty.call(p,a))c=a;else{if(Object.prototype.hasOwnProperty.call(g,c)){if(256>c.charCodeAt(0)){for(r=0;r<d;r++)h<<=1,f==t-1?(f=0,v.push(n(h)),h=0):f++;for(i=c.charCodeAt(0),r=0;r<8;r++)h=h<<1|1&i,f==t-1?(f=0,v.push(n(h)),h=0):f++,i>>=1}else{for(i=1,r=0;r<d;r++)h=h<<1|i,f==t-1?(f=0,v.push(n(h)),h=0):f++,i=0;for(i=c.charCodeAt(0),r=0;r<16;r++)h=h<<1|1&i,f==t-1?(f=0,v.push(n(h)),h=0):f++,i>>=1}0==--l&&(l=Math.pow(2,d),d++),delete g[c]}else for(i=p[c],r=0;r<d;r++)h=h<<1|1&i,f==t-1?(f=0,v.push(n(h)),h=0):f++,i>>=1;0==--l&&(l=Math.pow(2,d),d++),p[a]=u++,c=String(s)}if(""!==c){if(Object.prototype.hasOwnProperty.call(g,c)){if(256>c.charCodeAt(0)){for(r=0;r<d;r++)h<<=1,f==t-1?(f=0,v.push(n(h)),h=0):f++;for(i=c.charCodeAt(0),r=0;r<8;r++)h=h<<1|1&i,f==t-1?(f=0,v.push(n(h)),h=0):f++,i>>=1}else{for(i=1,r=0;r<d;r++)h=h<<1|i,f==t-1?(f=0,v.push(n(h)),h=0):f++,i=0;for(i=c.charCodeAt(0),r=0;r<16;r++)h=h<<1|1&i,f==t-1?(f=0,v.push(n(h)),h=0):f++,i>>=1}0==--l&&(l=Math.pow(2,d),d++),delete g[c]}else for(i=p[c],r=0;r<d;r++)h=h<<1|1&i,f==t-1?(f=0,v.push(n(h)),h=0):f++,i>>=1;0==--l&&(l=Math.pow(2,d),d++)}for(i=2,r=0;r<d;r++)h=h<<1|1&i,f==t-1?(f=0,v.push(n(h)),h=0):f++,i>>=1;for(;;){if(h<<=1,f==t-1){v.push(n(h));break}f++}return v.join("")},decompress:function(e){return null==e?"":""==e?null:O._decompress(e.length,32768,function(t){return e.charCodeAt(t)})},_decompress:function(e,t,n){var r,i,o,s,a,c,l,u=[],d=[],h={val:n(0),position:t,index:1},f=4,p=4,g=3,v="";for(r=0;r<3;r+=1)u[r]=r;for(o=0,a=4,c=1;c!=a;)s=h.val&h.position,h.position>>
1=1,0==h.position&&(h.position=t,h.val=n(h.index++)),o|=(s>0?1:0)*c,c<<=1;switch(o){case 0:for(o=0,a=256,c=1;c!=a;)s=h.val&h.position,h.position>>=1,0==h.position&&(h.position=t,h.val=n(h.index++)),o|=(s>0?1:0)*c,c<<=1;l=b(o);break;case 1:for(o=0,a=65536,c=1;c!=a;)s=h.val&h.position,h.position>>=1,0==h.position&&(h.position=t,h.val=n(h.index++)),o|=(s>0?1:0)*c,c<<=1;l=b(o);break;case 2:return""}for(u[3]=l,i=l,d.push(l);;){if(h.index>e)return"";for(o=0,a=Math.pow(2,g),c=1;c!=a;)s=h.val&h.position,h.position>>=1,0==h.position&&(h.position=t,h.val=n(h.index++)),o|=(s>0?1:0)*c,c<<=1;switch(l=o){case 0:for(o=0,a=256,c=1;c!=a;)s=h.val&h.position,h.position>>=1,0==h.position&&(h.position=t,h.val=n(h.index++)),o|=(s>0?1:0)*c,c<<=1;u[p++]=b(o),l=p-1,f--;break;case 1:for(o=0,a=65536,c=1;c!=a;)s=h.val&h.position,h.position>>=1,0==h.position&&(h.position=t,h.val=n(h.index++)),o|=(s>0?1:0)*c,c<<=1;u[p++]=b(o),l=p-1,f--;break;case 2:return d.join("")}if(0==f&&(f=Math.pow(2,g),g++),u[l])v=u[l];else{if(l!==p)return null;v=i+i.charAt(0)}d.push(v),u[p++]=i+v.charAt(0),i=v,0==--f&&(f=Math.pow(2,g),g++)}}},E={DEBUG:!1,LIB_VERSION:"1.53.4"},P=Array.prototype,C=Object.prototype,I=C.toString,T=C.hasOwnProperty,A="undefined"!=typeof window?window:{},j=A.navigator||{userAgent:""},R=A.document||{},N=j.userAgent,$=["localhost","127.0.0.1"],F=P.forEach,M=P.indexOf,D={},L={log:function(){if(E.DEBUG&&!Y(window.console)&&window.console){for(var e=("__rrweb_original__"in window.console.log)?window.console.log.__rrweb_original__:window.console.log,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];try{e.apply(window.console,n)}catch(t){z(n,function(t){e(t)})}}},error:function(){if(E.DEBUG&&!Y(window.console)&&window.console){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),i="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{i.apply(window.console,r)}catch(e){z(r,function(e){i(e)})}}},critical:function(){if(!Y(window.console)&&window.console){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),i="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{i.apply(window.console,r)}catch(e){z(r,function(e){i(e)})}}}},U=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function B(e,t,n){if(null!=e){if(F&&Array.isArray(e)&&e.forEach===F)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===D)return}else for(var o in e)if(T.call(e,o)&&t.call(n,e[o],o)===D)return}}function z(e,t,n){if(Array.isArray(e)){if(F&&e.forEach===F)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===D)return}}}var q=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return z(n,function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},V=Array.isArray||function(e){return"[object Array]"===I.call(e)},J=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}};function H(e,t){return -1!==e.indexOf(t)}var G=function(e){return e===Object(e)&&!V(e)},Y=function(e){return void 0===e},X=function(e){return"[object String]"==I.call(e)},K=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},W=function(e){return function(){try{for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){L.critical("Implementation error. Please turn on debug and contact [email protected]."),L.critical(e)}}},Z=function(e){var t={};return B(e,function(e,n){X(e)&&e.length>0&&(t[n]=e)}),t},Q=["$performance_raw"];function ee(e,t){var n,r;return n=function(e,n){return n&&Q.indexOf(n)>-1?e:"string"==typeof e&&null!==t?e.slice(0,t):e},r=new Set,function e(t,i){var o;return t!==Object(t)?n?n(t,i):t:r.has(t)?void 0:(r.add(t),V(t)?(o=[],z(t,function(t){o.push(e(t))})):(o={},B(t,function(t,n){r.has(t)||(o[n]=e(t,n))})),o)}(e)}function et(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1+/=",a=0,c=0,l="",u=[];if(!e)return e;e=er(e);do t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,u[c++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i);while(a<e.length);switch(l=u.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}var en,er=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var s=e.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},ei=(en=function(){for(var e=(new Date).valueOf(),t=0;e==(new Date).valueOf();)t++;return e.toString(16)+t.toString(16)},function(){var e="undefined"!=typeof window?(window.screen.height*window.screen.width).toString(16):"0";return en()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=0,r=[];function i(e,t){var n,i=0;for(n=0;n<t.length;n++)i|=r[n]<<8*n;return e^i}for(e=0;e<N.length;e++)t=N.charCodeAt(e),r.unshift(255&t),r.length>=4&&(n=i(n,r),r=[]);return r.length>0&&(n=i(n,r)),n.toString(16)}()+"-"+e+"-"+en()}),eo=function(e,t){var n=RegExp("[\\?&]"+t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]")+"=([^&#]*)").exec(e);if(null===n||n&&"string"!=typeof n[1]&&n[1].length)return"";var r=n[1];try{r=decodeURIComponent(r)}catch(e){L.error("Skipping decoding for malformed query param: "+r)}return r.replace(/\+/g," ")},es=function(e,t){var n=e.match(RegExp(t+"=([^&]*)"));return n?n[1]:null},ea=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t){if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var s="on"+n,a=t[s];t[s]=function(n){if(n=n||e(window.event)){var i,o=!0;J(a)&&(i=a(n));var s=r.call(t,n);return!1!==i&&!1!==s||(o=!1),o}}}}else L.error("No valid element provided to register_event")}}(),ec={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","msclkid"].concat(e||[]),n={};return B(t,function(e){var t=eo(R.URL,e);t.length&&(n[e]=t)}),n},searchEngine:function(){var e=R.referrer;return e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null},searchInfo:function(){var e=ec.searchEngine(),t={};if(null!==e){t.$search_engine=e;var n=eo(R.referrer,"yahoo"!=e?"q":"p");n.length&&(t.ph_keyword=n)}return t},browser:function(e,t,n){return t=t||"",n||H(e," OPR/")?H(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":H(e,"IEMobile")||H(e,"WPDesktop")?"Internet Explorer Mobile":H(e,"SamsungBrowser/")?"Samsung Internet":H(e,"Edge")||H(e,"Edg/")?"Microsoft Edge":H(e,"FBIOS")?"Facebook Mobile":H(e,"Chrome")?"Chrome":H(e,"CriOS")?"Chrome iOS":H(e,"UCWEB")||H(e,"UCBrowser")?"UC Browser":H(e,"FxiOS")?"Firefox iOS":H(t,"Apple")?H(e,"Mobile")?"Mobile Safari":"Safari":H(e,"Android")?"Android Mobile":H(e,"Konqueror")?"Konqueror":H(e,"Firefox")?"Firefox":H(e,"MSIE")||H(e,"Trident/")?"Internet Explorer":H(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[ec.browser(e,t,n)];if(void 0===r)return null;var i=e.match(r);return i?parseFloat(i[i.length-2]):null},browserLanguage:function(){return j.language||j.userLanguage},os:function(){return/Windows/i.test(N)?/Phone/.test(N)||/WPDesktop/.test(N)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(N)?"iOS":/Android/.test(N)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(N)?"BlackBerry":/Mac/i.test(N)?"Mac OS X":/Linux/.test(N)?"Linux":/CrOS/.test(N)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return"iPad"===t||"Android Tablet"===t?"Tablet":t?"Mobile":"Desktop"},referrer:function(){return R.referrer||"$direct"},referringDomain:function(){if(!R.referrer)return"$direct";var e=R.createElement("a");return e.href=R.referrer,e.host},properties:function(){return q(Z({$os:ec.os(),$browser:ec.browser(N,j.vendor,A.opera),$device:ec.device(N),$device_type:ec.deviceType(N)}),{$current_url:null==A?void 0:A.location.href,$host:null==A?void 0:A.location.host,$pathname:null==A?void 0:A.location.pathname,$browser_version:ec.browserVersion(N,j.vendor,A.opera),$browser_language:ec.browserLanguage(),$screen_height:null==A?void 0:A.screen.height,$screen_width:null==A?void 0:A.screen.width,$viewport_height:null==A?void 0:A.innerHe
1ight,$viewport_width:null==A?void 0:A.innerWidth,$lib:"web",$lib_version:E.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:(Date.now=Date.now||function(){return+new Date},Date.now()/1e3)})},people_properties:function(){return q(Z({$os:ec.os(),$browser:ec.browser(N,j.vendor,A.opera)}),{$browser_version:ec.browserVersion(N,j.vendor,A.opera)})}};function el(e){switch(o(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function eu(e){var t="";return ev(e)&&!em(e)&&e.childNodes&&e.childNodes.length&&B(e.childNodes,function(e){ef(e)&&e.textContent&&(t+=U(e.textContent).split(/(\s+)/).filter(e_).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),U(t)}function ed(e){return!!e&&1===e.nodeType}function eh(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function ef(e){return!!e&&3===e.nodeType}function ep(e){return!!e&&11===e.nodeType}var eg=["a","button","form","input","select","textarea","label"];function ev(e){for(var t=e;t.parentNode&&!eh(t,"body");t=t.parentNode){var n=el(t).split(" ");if(H(n,"ph-sensitive")||H(n,"ph-no-capture"))return!1}if(H(el(e).split(" "),"ph-include"))return!0;var r=e.type||"";if("string"==typeof r)switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return!("string"==typeof i&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function em(e){return!!(eh(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||eh(e,"select")||eh(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function e_(e){return!(null===e||Y(e)||"string"==typeof e&&(e=U(e),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(e)))}function ey(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t;var r,i=document.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(n,i[0]):document.body.appendChild(n)}function eb(e){var t=eu(e);return e_(t="".concat(t," ").concat(function e(t){var n="";return t&&t.childNodes&&t.childNodes.length&&B(t.childNodes,function(t){var r;if(t&&"span"===(null===(r=t.tagName)||void 0===r?void 0:r.toLowerCase()))try{var i=eu(t);n="".concat(n," ").concat(i).trim(),t.childNodes&&t.childNodes.length&&(n="".concat(n," ").concat(e(t)).trim())}catch(e){console.error(e)}}),n}(e)).trim())?t:""}var ew=function(){function e(t){s(this,e),this.clicks=[],this.enabled=t}return c(e,[{key:"isRageClick",value:function(e,t,n){if(!this.enabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}]),e}(),ek=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,eS={is_supported:function(){return!0},error:function(e){L.error("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null},parse:function(e){var t;try{t=JSON.parse(eS.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){try{var o="",s="",a="";if(r){var c=document.location.hostname.match(ek),l=c?c[0]:"";o=l?"; domain=."+l:""}if(n){var u=new Date;u.setTime(u.getTime()+24*n*36e5),s="; expires="+u.toUTCString()}i&&(a="; secure");var d=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+o+a;return document.cookie=d,d}catch(e){return}},remove:function(e,t){try{eS.set(e,"",-1,t)}catch(e){return}}},ex=null,eO={is_supported:function(){if(null!==ex)return ex;var e=!0;
1if("undefined"!=typeof window)try{var t="__mplssupport__";eO.set(t,"xyz"),'"xyz"'!==eO.get(t)&&(e=!1),eO.remove(t)}catch(t){e=!1}else e=!1;return e||L.error("localStorage unsupported; falling back to cookie store"),ex=e,e},error:function(e){L.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(e){eO.error(e)}return null},parse:function(e){try{return JSON.parse(eO.get(e))||{}}catch(e){}return null},set:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){eO.error(e)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(e){eO.error(e)}}},eE=i(i({},eO),{},{parse:function(e){try{var t={};try{(t=eS.parse(e)||{}).distinct_id&&eS.set(e,{distinct_id:t.distinct_id})}catch(e){}var n=q(t,JSON.parse(eO.get(e)||"{}"));return eO.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i){try{eO.set(e,t),t.distinct_id&&eS.set(e,{distinct_id:t.distinct_id},n,r,i)}catch(e){eO.error(e)}},remove:function(e,t){try{window.localStorage.removeItem(e),eS.remove(e,t)}catch(e){eO.error(e)}}}),eP={},eC={is_supported:function(){return!0},error:function(e){L.error("memoryStorage error: "+e)},get:function(e){return eP[e]||null},parse:function(e){return eP[e]||null},set:function(e,t){eP[e]=t},remove:function(e){delete eP[e]}},eI=null,eT={is_supported:function(){if(null!==eI)return eI;if(eI=!0,"undefined"!=typeof window)try{var e="__support__";eT.set(e,"xyz"),'"xyz"'!==eT.get(e)&&(eI=!1),eT.remove(e)}catch(e){eI=!1}else eI=!1;return eI},error:function(e){E.DEBUG&&L.error("sessionStorage error: ",e)},get:function(e){try{return window.sessionStorage.getItem(e)}catch(e){eT.error(e)}return null},parse:function(e){try{return JSON.parse(eT.get(e))||null}catch(e){}return null},set:function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){eT.error(e)}},remove:function(e){try{window.sessionStorage.removeItem(e)}catch(e){eT.error(e)}}},eA="$people_distinct_id",ej="__alias",eR="__timers",eN="$autocapture_disabled_server_side",e$="$session_recording_enabled_server_side",eF="$console_log_recording_enabled_server_side",eM="$session_recording_recorder_version_server_side",eD="$sesid",eL="$enabled_feature_flags",eU="$user_state",eB=[eA,ej,"__cmpns",eR,e$,eD,eL,eU],ez=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],eq=function(){function e(t){s(this,e);var n="";t.token&&(n=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,this.custom_campaign_params=t.custom_campaign_params||[],t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+n+"_posthog",-1===ez.indexOf(t.persistence.toLowerCase())&&(L.critical("Unknown persistence type "+t.persistence+"; falling back to cookie"),t.persistence="cookie");var r=t.persistence.toLowerCase();"localstorage"===r&&eO.is_supported()?this.storage=eO:"localstorage+cookie"===r&&eE.is_supported()?this.storage=eE:"sessionstorage"===r&&eT.is_supported()?this.storage=eT:this.storage="memory"===r?eC:eS,this.user_state="anonymous",this.load(),this.update_config(t),this.save()}return c(e,[{key:"properties",value:function(){var e={};return B(this.props,function(t,n){if(n===eL&&"object"===o(t))for(var r,i=Object.keys(t),s=0;s<i.length;s++)e["$feature/".concat(i[s])]=t[i[s]];else r=!1,(null===eB?r:M&&eB.indexOf===M?-1!=eB.indexOf(n):(B(eB,function(e){if(r||(r=e===n))return D}),r))||(e[n]=t)}),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=q({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var r=this;if(G(e)){void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n;var i=!1;if(B(e,function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)}),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(G(e)){this.expire_days=void 0===t?this.default_expiry:t;var r=!1;if(B(e,function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,r=!0)}),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(ec.campaignParams(this.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(ec.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||ec.referrer(),$referring_domain:this.props.$referring_domain||ec.referringDomain()})}},{key:"get_referrer_info",value:function(){return Z({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return B(this.props,function(t,n){n in e||(e[
1n]=t)}),e}},{key:"update_config",value:function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[eR]||{};n[e]=t,this.props[eR]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[eR]||{})[e];return Y(t)||(delete this.props[eR][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[eU]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[eU]=e,this.save()}}]),e}(),eV={_initializedTokens:[],_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t=!!e.get_property(eN),n=!!e.get_config("autocapture");this._isAutocaptureEnabled=n&&!t},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!ed(t));return t},_getAugmentPropertiesFromElement:function(e){if(!ev(e))return{};var t={};return B(e.attributes,function(e){if(e.name.startsWith("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&e_(r)&&(t[n]=r)}}),t},_getPropertiesFromElement:function(e,t,n){var r=e.tagName.toLowerCase(),i={tag_name:r};eg.indexOf(r)>-1&&!n&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?i.$el_text=eb(e):i.$el_text=eu(e));var o=el(e);o.length>0&&(i.classes=o.split(" ").filter(function(e){return""!==e})),B(e.attributes,function(n){var r;em(e)&&-1===["name","id","class"].indexOf(n.name)||!t&&e_(n.value)&&("string"!=typeof(r=n.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))&&(i["attr__"+n.name]=n.value)});for(var s=1,a=1,c=e;c=this._previousElementSibling(c);)s++,c.tagName===e.tagName&&a++;return i.nth_child=s,i.nth_of_type=a,i},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return B(document.querySelectorAll(e.css_selector),function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),e_(n)&&t.push(n)}),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return B(this._customProperties,function(r){B(r.event_selectors,function(i){B(document.querySelectorAll(i),function(i){H(e,i)&&ev(i)&&(n[r.name]=t._extractCustomPropertyValue(r))})})}),n},_getEventTarget:function(e){var t;return void 0===e.target?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null},_captureEvent:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",o=this._getEventTarget(e);if(ef(o)&&(o=o.parentNode||null),"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent&&null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,t,"$rageclick"),o&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!e||eh(e,"html")||!ed(e))return!1;if(null!=n&&n.url_allowlist){var r=window.location.href,i=n.url_allowlist;if(i&&!i.some(function(e){return r.match(e)}))return!1}if(null!=n&&n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some(function(e){return t.type===e}))return!1}if(null!=n&&n.element_allowlist){var s=n.element_allowlist;if(s&&!s.some(function(t){return e.tagName.toLowerCase()===t}))return!1}if(null!=n&&n.css_selector_allowlist){var a=n.css_selector_allowlist;if(a&&!a.some(function(t){return e.matches(t)}))return!1}for(var c=!1,l=[e],u=!0,d=e;d.parentNode&&!eh(d,"body");)if(ep(d.parentNode))l.push(d.parentNode.host),d=d.parentNode.host;else{if(!(u=d.parentNode||!1))break;if(eg.indexOf(u.tagName.toLowerCase())>-1)c=!0;else{var h=window.getComputedStyle(u);h&&"pointer"===h.getPropertyValue("cursor")&&(c=!0)}l.push(u),d=u}var f=window.getComputedStyle(e);
1if(f&&"pointer"===f.getPropertyValue("cursor")&&"click"===t.type)return!0;var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return"submit"===t.type;case"input":case"select":case"textarea":return"change"===t.type||"click"===t.type;default:return c?"click"===t.type:"click"===t.type&&(eg.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}(o,e,this.config)){for(var s=[o],a=o;a.parentNode&&!eh(a,"body");)ep(a.parentNode)?(s.push(a.parentNode.host),a=a.parentNode.host):(s.push(a.parentNode),a=a.parentNode);var c,l=[],u={},d=!1;if(B(s,function(e){var n=ev(e);"a"===e.tagName.toLowerCase()&&(c=e.getAttribute("href"),c=n&&e_(c)&&c),H(el(e).split(" "),"ph-no-capture")&&(d=!0),l.push(r._getPropertiesFromElement(e,t.get_config("mask_all_element_attributes"),t.get_config("mask_all_text"))),q(u,r._getAugmentPropertiesFromElement(e))}),t.get_config("mask_all_text")||("a"===o.tagName.toLowerCase()||"button"===o.tagName.toLowerCase()?l[0].$el_text=eb(o):l[0].$el_text=eu(o)),c&&(l[0].attr__href=c),d)return!1;var h=q(this._getDefaultProperties(e.type),{$elements:l},this._getCustomProperties(s),u);return t.capture(i,h),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=this,n=function(n){n=n||window.event,t._captureEvent(n,e)};ea(document,"submit",n,!1,!0),ea(document,"change",n,!1,!0),ea(document,"click",n,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;"boolean"!=typeof e.__autocapture&&(this.config=e.__autocapture),null!==(t=this.config)&&void 0!==t&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map(function(e){return new RegExp(e)})),this.rageclicks=new ew(e.get_config("rageclick"))},afterDecideResponse:function(e,t){this._setIsAutocaptureEnabled(t);var n=t.get_config("token");this._initializedTokens.indexOf(n)>-1?L.log('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(l({},eN,!!e.autocapture_opt_out)),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=Y(t)?10:t,n=Y(n)?10:n;for(var r=0,i=0;i<e.length;i++)r+=e.charCodeAt(i);return r%t<n},isBrowserSupported:function(){return J(document.querySelectorAll)}};function eJ(e,t){eQ(!0,e,t)}function eH(e,t){eQ(!1,e,t)}function eG(e,t){return"1"===eZ(e,t)}function eY(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||A,n=t.navigator||{},r=!1;return B([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],function(e){H([!0,1,"1","yes"],e)&&(r=!0)}),r}return!1}(t)||"0"===eZ(e,t)}function eX(e,t){eK(t=t||{}).remove(eW(e,t),!!t.crossSubdomainCookie)}function eK(e){return"localStorage"===(e=e||{}).persistenceType?eO:"localStorage+cookie"===e.persistenceType?eE:eS}function eW(e,t){return((t=t||{}).persistencePrefix||"__ph_opt_in_out_")+e}function eZ(e,t){return eK(t).get(eW(e,t))}function eQ(e,t,n){var r;X(t)&&t.length?(eK(n=n||{}).set(eW(t,n),e?1:0,(r=n.cookieExpiration,"[object Number]"==I.call(r))?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):console.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function e0(e,t){var n=!1;try{var r=e.get_config("token"),i=e.get_config("respect_dnt"),o=e.get_config("opt_out_capturing_persistence_type"),s=e.get_config("opt_out_capturing_cookie_prefix")||void 0,a=e.get_config("window");r&&(n=eY(r,{respectDnt:i,persistenceType:o,persistencePrefix:s,window:a}))}catch(e){t||console.error("Unexpected error when checking capturing opt-out status: "+e)}return n}function e1(e,t,n){return function(){for(var r=e0(e,n),i=arguments.length,o=Array(i),s=0;s<i;s++)o[s]=arguments[s];if(!r)return t.apply(this,o);var a=o[o.length-1];"function"==typeof a&&a(0)}}!function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=e[t].bind(e))}(eV),function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=W(e[t]))}(eV);var e2="$set",e5=function(){function e(t){var n=this;s(this,e),this._posthog=t,this.set=e1(t,function(e,t,r){var i=n.set_action(e,t);return G(e)&&(r=t),n._get_config("save_referrer")&&n._posthog.sessionPersistence.update_referrer_info(),i[e2]=q({},ec.people_properties(),n._posthog.sessionPersistence.get_referrer_info(),i[e2]),n._send_request(i,r)}),this.set_once=e1(t,function(e,t,r){var i=n.set_once_action(e,t);return G(e)&&(r=t),n._send_request(i,r)})}return c(e,[{key:"toString",value:function(){return this._posthog.toString()+".people"}},{key:"_send_request",value:function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._posthog.get_distinct_id();var n=this._posthog.get_property("$device_id"),r=this._posthog.get_property("$user_id"),i=this._posthog.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),i&&(e.$had_persisted_distinct_id=i);var o=function e(t){return B(t,function(n,r){"[object Date]"!=I.call(n)?G(n)&&(t[r]=e(n)):t[r]=K(n)}),t}(e),s=ee(o,this._get_config("properties_string_max_length")),a=et(JSON.stringify(o));return this._posthog._send_request(this._get_config("api_host")+"/engage/",{data:a},{},this._posthog._prepare_callback(t,s)),s}},{key:"_get_config",value:function(e){return this._posthog.get_config(e)}},{key:"_is_reserved_property",value:function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e}},{key:"set_action",value:function(e,t){return this.apiActionParser(e2,e,t)}},{key:"set_once_action",value:function(e,t){return this.apiActionParser("$set_once",e,t)}},{key:"apiActionParser",value:function(e,t,n){var r=this,i={},o={};return G(t)?B(t,function(e,t){r._is_reserved_property(t)||(o[t]=e)}):o[t]=n,i[e]=o,i}}]),e}(),e3="$active_feature_flags",e6="$enabled_feature_flags",e4="$override_feature_flags",e9="$feature_flag_payloads",e8=function(){function e(t){s(this,e),this.instance=t,this._override_warning=!1,this.flagCallReported={},this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return c(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(e6),t=this.instance.get_property(e4);if(!t)return e||{};for(var n=q({},e),r=Object.keys(t),i=0;i<r.length;
1i++)!1===t[r[i]]?delete n[r[i]]:n[r[i]]=t[r[i]];return this._override_warning||(console.warn("[PostHog] Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(e9)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;this.setReloadingPaused(!0);var t=et(JSON.stringify({token:this.instance.get_config("token"),distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id}));this.instance._send_request(this.instance.get_config("api_host")+"/decide/?v=3",{data:t},{method:"POST"},this.instance._prepare_callback(function(t){e.$anon_distinct_id=void 0,e.receivedFeatureFlags(t),e.setReloadingPaused(!1),e._startReloadTimer()}))}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.getFlags())return console.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time."),!1;var n=this.getFlagVariants()[e];return!t.send_event&&"send_event"in t||this.flagCallReported[e]||(this.flagCallReported[e]=!0,this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getFlags()?!!this.getFeatureFlag(e,t):(console.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time."),!1)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(t){return t!==e})}},{key:"receivedFeatureFlags",value:function(e){this.instance.decideEndpointWasHit=!0;var t=this.getFlagVariants(),n=this.getFlagPayloads();!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.featureFlags,s=e.featureFlagPayloads;if(o){if(Array.isArray(o)){var a,c={};if(o)for(var u=0;u<o.length;u++)c[o[u]]=!0;t&&t.register((l(a={},e3,o),l(a,e6,c),a))}else{var d,h=o,f=s;e.errorsWhileComputingFlags&&(h=i(i({},n),h),f=i(i({},r),f)),t&&t.register((l(d={},e3,Object.keys(h||{})),l(d,e6,h||{}),l(d,e9,f||{}),d))}}else t&&(t.unregister(e3),t.unregister(e6),t.unregister(e9))}(e,this.instance.persistence,t,n);var r=this._prepareFeatureFlagsForCallbacks(),o=r.flags,s=r.flagVariants;this.featureFlagEventHandlers.forEach(function(e){return e(o,s)})}},{key:"override",value:function(e){if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(e4);else if(Array.isArray(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(l({},e4,t))}else this.instance.persistence.register(l({},e4,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks();e(n.flags,n.flagVariants)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(function(e){return t[e]}),flagVariants:Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){return e[n]=t[n],e},{})}}}]),e}(),e7=function(){function e(t){s(this,e),this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint="/e/",this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1}return c(e,[{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled()?this.startCaptureAndTrySendingQueuedSnapshots():this.stopRecording()}},{key:"started",value:function(){return this.captureStarted}},{key:"stopRecording",value:function(){this.captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this.captureStarted=!1)}},{key:"isRecordingEnabled",value:function(){var e=!!this.instance.get_property(e$),t=!this.instance.get_config("disable_session_recording");return e&&t}},{key:"isConsoleLogCaptureEnabled",value:function(){var e=!!this.instance.get_property(eF),t=this.instance.get_config("enable_recording_console_log");return null!=t?t:e}},{key:"getRecordingVersion",value:function(){var e,t=this.instance.get_property(eM);return(null===(e=this.instance.get_config("session_recording"))||void 0===e?void 0:e.recorderVersion)||t||"v1"}},{key:"afterDecideResponse",value:function(e){var t,n,r,i,o,s;this.receivedDecide=!0,this.instance.persistence&&this.instance.persistence.register((l(o={},e$,!!e.sessionRecording),l(o,eF,null===(r=e.sessionRecording)||void 0===r?void 0:r.consoleLogRecordingEnabled),l(o,eM,null===(i=e.sessionRecording)||void 0===i?void 0:i.recorderVersion),o)),null!==(t=e.sessionRecording)&&void 0!==t&&t.endpoint&&(this.endpoint=null===(s=e.sessionRecording)||void 0===s?void 0:s.endpoint),null!==(n=e.sessionRecording)&&void 0!==n&&n.recorderVersion&&(this.recorderVersion=e.sessionRecording.recorderVersion),this.startRecordingIfEnabled()}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){var e=this;
1this.receivedDecide&&(this.emit=!0,this.snapshots.forEach(function(t){return e._captureSnapshot(t)})),this._startCapture()}},{key:"_startCapture",value:function(){if(void 0!==Object.assign&&!this.captureStarted&&!this.instance.get_config("disable_session_recording")){this.captureStarted=!0;var e="v2"===this.getRecordingVersion()?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.getRecordingVersion()?ey(this.instance.get_config("api_host")+"/static/".concat(e,"?v=").concat(E.LIB_VERSION),this._onScriptLoaded.bind(this)):this._onScriptLoaded()}}},{key:"_updateWindowAndSessionIds",value:function(e){var t,n,r=3===e.type&&0===(null===(n=e.data)||void 0===n?void 0:n.source),i=this.instance.sessionManager.checkAndGetSessionAndWindowId(r,e.timestamp),o=i.windowId,s=i.sessionId;if(this.captureStarted&&(this.windowId!==o||this.sessionId!==s)&&-1===[2,4].indexOf(e.type))try{null===(t=this.rrwebRecord)||void 0===t||t.takeFullSnapshot()}catch(e){L.error("Error taking full snapshot.",e)}this.windowId=o,this.sessionId=s}},{key:"_onScriptLoaded",value:function(){var e=this,t={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var n=this.instance.get_config("session_recording"),r=0,o=Object.entries(n||{});r<o.length;r++){var s=p(o[r],2),a=s[0],c=s[1];a in t&&(t[a]=c)}this.rrwebRecord?(this.stopRrweb=this.rrwebRecord(i({emit:function(t){e.onRRwebEmit(t)},plugins:window.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled()?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},t)),this.instance._addCaptureHook(function(t){try{var n;"$pageview"===t&&(null===(n=e.rrwebRecord)||void 0===n||n.addCustomEvent("$pageview",{href:window.location.href}))}catch(e){L.error("Could not add $pageview to rrweb session",e)}})):L.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"onRRwebEmit",value:function(e){e=function(e){if(e&&"object"===o(e)&&6===e.type&&"object"===o(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var t=[],n=0;n<e.data.payload.payload.length;n++)e.data.payload.payload[n]&&e.data.payload.payload[n].length>2e3?t.push(e.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[n]);return e.data.payload.payload=t,e}return e}(function(e){if(e&&"object"===o(e)){var t=JSON.stringify(e);if(t.length>5e6){var n,r=_(t.matchAll(/data:([\w\/\-\.]+);(\w+),([^)"]*)/gim));try{for(r.s();!(n=r.n()).done;){var i=n.value;t="image/"===i[1].toLocaleLowerCase().slice(0,6)?t.replace(i[0],"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg=="):t.replace(i[0],"")}}catch(e){r.e(e)}finally{r.f()}}return JSON.parse(t)}return e}(e)),this._updateWindowAndSessionIds(e);var t={$snapshot_data:e,$session_id:this.sessionId,$window_id:this.windowId};this.instance._captureMetrics.incr("rrweb-record"),this.instance._captureMetrics.incr("rrweb-record-".concat(e.type)),this.emit?this._captureSnapshot(t):this.snapshots.push(t)}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this.endpoint,_noTruncate:!0,_batchKey:"sessionRecording",_metrics:{rrweb_full_snapshot:2===e.$snapshot_data.type}})}}]),e}(),te={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},tt=["first-input","navigation","paint","resource"],tn=["/s/","/e/"],tr=function(){function e(t){s(this,e),l(this,"_forceAllowLocalhost",!1),this.instance=t}return c(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var e=this;if(!this.observer){if(!$.includes(location.hostname)||this._forceAllowLocalhost)try{this.observer=new PerformanceObserver(function(t){t.getEntries().forEac
1h(function(t){e._capturePerformanceEvent(t)})}),PerformanceObserver.supportedEntryTypes.filter(function(e){return tt.includes(e)}).forEach(function(t){var n;null===(n=e.observer)||void 0===n||n.observe({type:t,buffered:!0})})}catch(e){console.error("PostHog failed to start performance observer",e),this.stopObserving()}else L.log("PostHog Peformance observer not started because we are on localhost.")}}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var e,t;return null!==(e=null!==(t=this.instance.get_config("capture_performance"))&&void 0!==t?t:this.remoteEnabled)&&void 0!==e&&e}},{key:"afterDecideResponse",value:function(e){this.remoteEnabled=e.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(e){if(e.name.startsWith(this.instance.get_config("api_host"))){var t=e.name.replace(this.instance.get_config("api_host"),"");if(tn.find(function(e){return t.startsWith(e)}))return}var n=e.toJSON(),r={},i=Math.floor(Date.now()-performance.now());for(var o in r[te.timeOrigin]=i,r[te.timestamp]=Math.floor(i+e.startTime),te)void 0!==n[o]&&(r[te[o]]=n[o]);if(this.capturePerformanceEvent(r),ti(e)){var s,a=_(e.serverTiming||[]);try{for(a.s();!(s=a.n()).done;){var c,u=s.value;this.capturePerformanceEvent((l(c={},te.timeOrigin,i),l(c,te.timestamp,Math.floor(i+e.startTime)),l(c,te.name,u.name),l(c,te.duration,u.duration),l(c,te.entryType,"serverTiming"),c))}}catch(e){a.e(e)}finally{a.f()}}}},{key:"capturePerformanceEvent",value:function(e){var t,n=e[te.timestamp];null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"posthog/network@1",payload:e},timestamp:n})}}]),e}(),ti=function(e){return"navigation"===e.entryType||"resource"===e.entryType},to=function(){function e(t){s(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return c(e,[{key:"call",value:function(){var e=this,t=et(JSON.stringify({token:this.instance.get_config("token"),distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups()}));this.instance._send_request("".concat(this.instance.get_config("api_host"),"/decide/?v=3"),{data:t,verbose:!0},{method:"POST"},function(t){return e.parseDecideResponse(t)})}},{key:"parseDecideResponse",value:function(e){var t,n,r=this;if(0!==(null==e?void 0:e.status)){if(this.instance.decideEndpointWasHit=!0,!document||!document.body)return console.log("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){r.parseDecideResponse(e)},500);if(this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),eV.afterDecideResponse(e,this.instance),null===(n=this.instance.webPerformance)||void 0===n||n.afterDecideResponse(e),this.instance.featureFlags.receivedFeatureFlags(e),this.instance.compression={},e.supportedCompression&&!this.instance.get_config("disable_compression")){var i,o={},s=_(e.supportedCompression);try{for(s.s();!(i=s.n()).done;)o[i.value]=!0}catch(e){s.e(e)}finally{s.f()}this.instance.compression=o}if(e.siteApps){if(this.instance.get_config("opt_in_site_apps")){var a,c=this.instance.get_config("api_host"),l=_(e.siteApps);try{for(l.s();!(a=l.n()).done;)(function(){var e=a.value,t=e.id,n=e.url,i=document.createElement("script");i.src=[c,"/"===c[c.length-1]&&"/"===n[0]?n.substring(1):n].join(""),i.onerror=function(e){console.error("Error while initializing PostHog app with config id ".concat(t),e)},window["__$$ph_site_app_".concat(t)]=r.instance,document.body.appendChild(i)})()}catch(e){l.e(e)}finally{l.f()}}else e.siteApps.length>0&&console.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}else console.error("Failed to fetch feature flags from PostHog.")}}]),e}(),ts=["https://app.posthog.com","https://eu.posthog.com"],ta=["source"],tc=function(){function e(t){s(this,e),this.instance=t}return c(e,[{key:"afterDecideResponse",value:function(e){var t=e.toolbarParam
1s||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&t.toolbarVersion&&0===t.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(i(i({},t),{},{apiURL:this.instance.get_config("api_host")}))}},{key:"maybeLoadToolbar",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.history;try{if(!t){try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test")}catch(e){return!1}t=window.localStorage}var r,i=es(e.hash,"__posthog")||es(e.hash,"state"),o=i?JSON.parse(decodeURIComponent(i)):null;return o&&"ph_authorize"===o.action?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:n?n.replaceState("",document.title,e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete r.userIntent),r.apiURL||(r.apiURL=this.instance.get_config("api_host")),!(!r.token||this.instance.get_config("token")!==r.token)&&(this.loadToolbar(r),!0)}catch(e){return!1}}},{key:"loadToolbar",value:function(e){var t=this;if(window._postHogToolbarLoaded)return!1;window._postHogToolbarLoaded=!0;var n=(null==e?void 0:e.apiURL)||this.instance.get_config("api_host"),r=3e4*Math.floor(Date.now()/3e4),o="".concat(n).concat(n.endsWith("/")?"":"/","static/toolbar.js?_ts=").concat(r),s=!ts.includes(this.instance.get_config("api_host"))&&this.instance.get_config("advanced_disable_toolbar_metrics"),a=i(i({apiURL:n,jsURL:n,token:this.instance.get_config("token")},e),s?{instrument:!1}:{});a.source;var c=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(a,ta);return window.localStorage.setItem("_postHogToolbarParams",JSON.stringify(c)),ey(o,function(){(window.ph_load_toolbar||window.ph_load_editor)(a,t.instance)}),ea(window,"turbolinks:load",function(){window._postHogToolbarLoaded=!1,t.loadToolbar(a)}),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.history;return this.maybeLoadToolbar(e,t,n)}}]),e}(),tl=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;s(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return c(e,[{key:"setPollInterval",value:function(e){this._pollInterval=e,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return(new Date).getTime()}}]),e}(),tu=function(e){u(n,tl);var t=f(n);function n(e,r){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;return s(this,n),(i=t.call(this,o)).handlePollRequest=r,i.captureMetrics=e,i}return c(n,[{key:"enqueue",value:function(e,t,n){this.captureMetrics.incr("batch-enqueue"),this._event_queue.push({url:e,data:t,options:n}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;clearTimeout(this._poller),this._poller=setTimeout(function(){if(e._event_queue.length>0){var t=e.formatQueue();for(var n in t)(function(n){var r=t[n],i=r.url,o=r.data,s=r.options;B(o,function(t,n){o[n].offset=Math.abs(o[n].timestamp-e.getTime()),delete o[n].timestamp}),e.handlePollRequest(i,o,s),e.captureMetrics.incr("batch-requests"),e.captureMetrics.incr("batch-requests-".concat(i.slice(i.length-2))),e.captureMetrics.incr("batch-handle",o.length),e.captureMetrics.incr("batch-handle-".concat(i.slice(i.length-2)),o.length)})(n);e._event_queue.length=0,e._empty_queue_count=0}else e._empty_queue_count++;e._empty_queue_count>4&&(e.isPolling=!1,e._empty_queue_count=0),e.isPolling&&e.poll()},this._pollInterval)}},{key:"updateUnloadMetrics",value:function(){var e=this.formatQueue();for(var t in e){var n=e[t],r=n.url,i=n.data;this.captureMetrics.incr("batch-unload-requests"),this.captureMetrics.incr("batch-unload-requests-".concat(r.slice(r.length-2))),this.captureMetrics.incr("batch-unload",i.length),this.captureMetrics.incr("batch-unload-".concat(r.slice(r.length-2)),i.length)}}},{key:"unload",value:function(){var e=this;clearTimeout(this._poller);var t=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var n=Object.values(t);[].concat(g(n.filter(function(e){return 0===e.url.indexOf("/e")})),g(n.filter(function(e){return 0!==e.url.indexOf("/e")}))).map(function(t){var n=t.url,r=t.data,o=t.options;e.handlePollRequest(n,r,i(i({},o),{},{transport:"sendBeacon"}))})}},{key:"formatQueue",value:function(){var e={};return B(this._event_queue,function(t){var n=t.url,r=t.data,i=t.options,o=(i?i._batchKey:null)||n;void 0===e[o]&&(e[o]={data:[],url:n,options:i}),i&&e[o].options&&e[o].options._metrics&&!e[o].options._metrics.rrweb_full_snapshot&&(e[o].options._metrics.rrweb_full_snapshot=i._metrics.rrweb_full_snapshot),e[o].data.push(r)}),e}}]),n}(),td=function(){function e(t){s(this,e),this.enabled=t,this.metrics={}}return c(e,[{key:"incr",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.enabled&&(e="phjs-".concat(e),this.metrics[e]=(this.metrics[e]||0)+t)}},{key:"decr",value:function(e){this.enabled&&(e="phjs-".concat(e),this.metrics[e]=(this.metrics[e]||0)-1)}}]),e}(),th=Uint8Array,tf=Uint16Array,tp=Uint32Array,tg=new th([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),tv=new th([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),tm=new th([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),t_=function(e,t){for(var n=new tf(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new tp(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},ty=t_(tg,2),tb=ty[0],tw=ty[1];tb[28]=258,tw[258]=28;for(var tk=t_(tv,0)[1],tS=new tf(32768),tx=0;tx<32768;++tx){var tO=(43690&tx)>>>1|(21845&tx)<<1;tO=(61680&(tO=(52428&tO)>>>2|(13107&tO)<<2))>>>4|(3855&tO)<<4,tS[tx]=((65280&tO)>>>8|(255&tO)<<8)>>>1}var tE=function(e,t,n){for(var r=e.length,i=0,o=new tf(t);i<r;++i)++o[e[i]-1];var s,a=new tf(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new tf(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)s[tS[d]>>>c]=l}else for(s=new tf(r),i=0;i<r;++i)s[i]=tS[a[e[i]-1]++]>>>15-e[i];return s},tP=new th(288);for(tx=0;tx<144;++tx)tP[tx]=8;for(tx=144;tx<256;++tx)tP[tx]=9;for(tx=256;tx<280;++tx)tP[tx]=7;for(tx=280;tx<288;++tx)tP[tx]=8;var tC=new th(32);for(tx=0;tx<32;++tx)tC[tx]=5;var tI,tT=tE(tP,9,0),tA=tE(tC,5,0),tj=function(e){return(e/8>>0)+(7&e&&1)},tR=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof tf?tf:e instanceof tp?tp:th)(n-t);return r.set(e.subarray(t,n)),r},tN=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},t$=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},tF=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new th(0),0];if(1==i){var s=new th(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var a=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=i-1;)a=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:a.f+c.f,l:a,r:c};var h=o[0].s;for(r=1;r<i;++r)o[r].s>h&&(h=o[r].s);var f=new tf(h+1),p=tM(n[u-1],f,0);if(p>t){r=0;var g=0,v=p-t,m=1<<v;for(o.sort(function(e,t){return f[t.s]-f[e.s]||e.f-t.f});r<i;++r){var _=o[r].s;if(!(f[_]>t))break;g+=m-(1<<p-f[_]),f[_]=t}for(g>>>=v;g>0;){var y=o[r].s;f[y]<t?g-=1<<t-f[y]++-1:++r}for(;r>=0&&g;--r){var b=o[r].s;f[b]==t&&(--f[b],++g)}p=t}return[new th(f),p]},tM=function e(t,n,r){return -1==t.s?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},tD=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new tf(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},tL=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},tU=function(e,t,n){var r=n.length,i=tj(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},tB=function(e,t,n,r,i,o,s,a,c,l,u){tN(t,u++,n),++i[256];for(var d=tF(i,15),h=d[0],f=d[1],p=tF(o,15),g=p[0],v=p[1],m=tD(h),_=m[0],y=m[1],b=tD(g),w=b[0],k=b[1],S=new tf(19),x=0;x<_.length;++x)S[31&_[x]]++;for(x=0;x<w.length;++x)S[31&w[x]]++;for(var O=tF(S,7),E=O[0],P=O[1],C=19;C>4&&!E[tm[C-1]];--C);var I,T,A,j,R=l+5<<3,N=tL(i,tP)+tL(o,tC)+s,$=tL(i,h)+tL(o,g)+s+14+3*C+tL(S,E)+(2*S[16]+3*S[17]+7*S[18]);if(R<=N&&R<=$)return tU(t,u,e.subarray(c,c+l));if(tN(t,u,1+($<N)),u+=2,$<N){I=tE(h,f,0),T=h,A=tE(g,v,0),j=g;var F=tE(E,P,0);
1for(tN(t,u,y-257),tN(t,u+5,k-1),tN(t,u+10,C-4),u+=14,x=0;x<C;++x)tN(t,u+3*x,E[tm[x]]);u+=3*C;for(var M=[_,w],D=0;D<2;++D){var L=M[D];for(x=0;x<L.length;++x){var U=31&L[x];tN(t,u,F[U]),u+=E[U],U>15&&(tN(t,u,L[x]>>>5&127),u+=L[x]>>>12)}}}else I=tT,T=tP,A=tA,j=tC;for(x=0;x<a;++x)if(r[x]>255){t$(t,u,I[(U=r[x]>>>18&31)+257]),u+=T[U+257],U>7&&(tN(t,u,r[x]>>>23&31),u+=tg[U]);var B=31&r[x];t$(t,u,A[B]),u+=j[B],B>3&&(t$(t,u,r[x]>>>5&8191),u+=tv[B])}else t$(t,u,I[r[x]]),u+=T[r[x]];return t$(t,u,I[256]),u+T[256]},tz=new tp([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),tq=new th(0),tV=function(){for(var e=new tp(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),tJ=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=tV[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},tH=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},tG=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&tH(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}};(tY=tI||(tI={})).GZipJS="gzip-js",tY.LZ64="lz64",tY.Base64="base64";var tY,tX,tK,tW,tZ=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=(new Date).getTime().toString(),r.ver=E.LIB_VERSION;var i=e.split("?");if(i.length>1){var o,s=_(i[1].split("&"));try{for(s.s();!(o=s.n()).done;){var a=o.value.split("=")[0];r[a]&&delete r[a]}}catch(e){s.e(e)}finally{s.f()}}var c=e.indexOf("?")>-1?"&":"?";return e+c+function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return B(e,function(e,r){t=encodeURIComponent(e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t}),i.join(r)}(r)},tQ=function e(t,n){if(n.blob&&t.buffer)return new Blob([t.buffer],{type:"text/plain"});if(n.sendBeacon||n.blob){var r;return new Blob([e(t,{method:"POST"})],{type:"application/x-www-form-urlencoded"})}return"POST"!==n.method?null:(r=Array.isArray(t)||"[object Uint8Array]"===Object.prototype.toString.call(t)?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(r+="&compression="+t.compression),r)},t0=function(e){var t=e.url,n=e.data,r=e.headers,i=e.options,o=e.captureMetrics,s=e.callback,a=e.retriesPerformedSoFar,c=e.retryQueue,l=e.onXHRError,u=e.timeout,d=new XMLHttpRequest;d.open(i.method||"GET",t,!0);var h=tQ(n,i);o.incr("_send_request"),o.incr("_send_request_inflight"),B(r,function(e,t){d.setRequestHeader(t,e)}),"POST"!==i.method||i.blob||d.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),d.timeout=void 0===u?1e4:u,d.withCredentials=!0,d.onreadystatechange=function(){if(4===d.readyState){if(o.incr("xhr-response"),o.incr("xhr-response-".concat(d.status)),o.decr("_send_request_inflight"),200===d.status){if(s){var e;try{e=JSON.parse(d.responseText)}catch(e){return void L.error(e)}s(e)}}else"function"==typeof l&&l(d),0>[401,403,404,500].indexOf(d.status)&&c.enqueue({url:t,data:n,options:i,headers:r,retriesPerformedSoFar:(a||0)+1,callback:s}),s&&s({status:0})}},d.send(h)},t1=function(e){u(n,tl);var t=f(n);function n(e,r){var i;return s(this,n),(i=t.call(this)).captureMetrics=e,i.isPolling=!1,i.queue=[],i.areWeOnline=!0,i.onXHRError=r,"undefined"!=typeof window&&"onLine"in window.navigator&&(i.areWeOnline=window.navigator.onLine,window.addEventListener("online",function(){i._handleWeAreNowOnline()}),window.addEventListener("offline",function(){i.areWeOnline=!1})),i}return c(n,[{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;if(!(t>=10)){var n=3e3*Math.pow(2,t),r=new Date(Date.now()+n);console.warn("Enqueued failed request for retry in ".concat(n)),this.queue.push({retryAt:r,requestData:e}),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var e=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout(function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()},this._pollInterval)}},{key:"flush",value:function(){var e=new Date(Date.now()),t=this.queue.filter(function(t){return t.retryAt<e});if(t.length>0){this.queue=this.queue.filter(function(t){return t.retryAt>=e});var n,r=_(t);try{for(r.s();!(n=r.n()).done;){var i=n.value.requestData;this._executeXhrRequest(i)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var e,t=_(this.queue);try{for(t.s();!(e=t.n()).done;){var n=e.value.requestData,r=n.url,o=n.data,s=n.options;try{window.navigator.sendBeacon(r,tQ(o,i(i({},s),{},{sendBeacon:!0})))}catch(e){E.DEBUG&&console.error(e)}}}catch(e){t.e(e)}finally{t.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(e){var t=e.url,n=e.data,r=e.options,i=e.headers,o=e.callback;t0({url:t,data:n||{},options:r||{},headers:i||{},retriesPerformedSoFar:e.retriesPerformedSoFar||0,callback:o,captureMetrics:this.captureMetrics,retryQueue:this,onXHRError:this.onXHRError})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),n}(),t2=function(){function e(t,n){s(this,e),this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null;var r=t.persistence_name||t.token;if(this.window_id_storage_key="ph_"+r+"_window_id",this.primary_window_exists_storage_key="ph_"+r+"_primary_window_exists",this._canUseSessionStorage()){var i=eT.parse(this.window_id_storage_key),o=eT.parse(this.primary_window_exists_storage_key);i&&!o?this._windowId=i:eT.remove(this.window_id_storage_key),eT.set(this.primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return c(e,[{key:"_canUseSessionStorage",value:function(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&eT.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&eT.set(this.window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?eT.parse(this.window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(l({},eD,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[eD];return Array.isArray(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;window.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&eT.remove(e.primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),n=p(this._getSessionId(),3),r=n[0],i=n[1],o=n[2],s=this._getWindowId(),a=o&&o>0&&Math.abs(t-o)>864e5;!i||!e&&Math.abs(t-r)>18e5||a?(i=ei(),s=ei(),o=t):s||(s=ei());var c=0===o?(new Date).getTime():o;return this._setWindowId(s),this._setSessionId(i,0===r||!e||a?t:r,c),{sessionId:i,windowId:s}}}]),e}(),t5=c(function e(t,n,r,i){s(this,e),this.name="posthog-js",this.setupOnce=function(e){e(function(e){if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={});var o,s,a,c=t.config.ui_host||t.config.api_host;e.tags["PostHog Person URL"]=c+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=c+"/recordings/"+t.sessionManager.checkAndGetSessionAndWindowId(!0).sessionId);var l=(null===(o=e.exception)||void 0===o?void 0:o.values)||[],u={$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:null===(s=l[0])||void 0===s?void 0:s.value,$sentry_exception_type:null===(a=l[0])||void 0===a?void 0:a.type,$sentry_tags:e.tags};return n&&r&&(u.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",u),e})}}),t3=function(e){var t=function(t,n){t.event.userId||t.event.anonymousId===e.get_distinct_id()||e.reset(),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:t.event.userId}),e.reloadFeatureFlags());var r=e._calculate_event_properties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}},t6=function(){function e(){s(this,e),l(this,"_seenFirstPageView",!1)}return c(e,[{key:"onPageview",value:function(){this._seenFirstPageView&&(this._pageViewId=ei()),this._seenFirstPageView=!0}},{key:"getPageViewId",value:function(){return this._pageViewId||(this._pageViewId=ei()),this._pageViewId}}]),e}();(y=tX||(tX={}))[y.INIT_MODULE=0]="INIT_MODULE",y[y.INIT_SNIPPET=1]="INIT_SNIPPET";var t4=function(){},t9={},t8="posthog",t7=A.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,ne=!t7&&-1===N.indexOf("MSIE")&&-1===N.indexOf("Mozilla"),nt=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:-1===(null==R||null===(e=R.location)||void 0===e||null===(t=e.hostname)||void 0===t?void 0:t.indexOf("herokuapp.com")),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:t4,store_google:!0,custom_campaign_params:[],save_referrer:!0,test:!1,verbose
1:!1,img:!1,capture_pageview:!0,capture_pageleave:!0,debug:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==A||null===(n=A.location)||void 0===n?void 0:n.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{blockClass:"ph-no-capture",blockSelector:null,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:null,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(e){console.error("Bad HTTP status: "+e.status+" "+e.statusText)},get_device_id:function(e){return e},_onCapture:t4,_capture_metrics:!1,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1}},nn=function(e,t,n,r){var i,o=n!==t8&&tW?n?tW[n]:void 0:tW,s={initComplete:!1,syncCode:!1},a=function(e){return function(t){s[e]||(s[e]=!0,s.initComplete&&s.syncCode&&(null==r||r(t)))}};if(o&&tK===tX.INIT_MODULE)i=o;else{if(o&&!V(o))return void console.error("You have already initialized "+n);i=new nr}return i._init(e,t,n,a("initComplete")),i.toolbar.maybeLoadToolbar(),i.sessionRecording=new e7(i),i.sessionRecording.startRecordingIfEnabled(),i.webPerformance=new tr(i),i.webPerformance.startObservingIfEnabled(),i.__autocapture=i.get_config("autocapture"),eV._setIsAutocaptureEnabled(i),eV._isAutocaptureEnabled&&(i.__autocapture=i.get_config("autocapture"),eV.enabledForProject(i.get_config("token"),100,100)?eV.isBrowserSupported()?eV.init(i):(i.__autocapture=!1,L.log("Disabling Automatic Event Collection because this browser is not supported")):(i.__autocapture=!1,L.log("Not in active bucket: disabling Automatic Event Collection."))),E.DEBUG=E.DEBUG||i.get_config("debug"),void 0!==o&&V(o)&&(i._execute_array.call(i.people,o.people),i._execute_array(o)),a("syncCode")(i),i},nr=function(){function e(){var t=this;s(this,e),this.config=nt(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=t5,this.segmentIntegration=function(){return t3(t)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.people=new e5(this),this.featureFlags=new e8(this),this.feature_flags=this.featureFlags,this.toolbar=new tc(this),this.pageViewIdManager=new t6,this._captureMetrics=void 0,this._requestQueue=void 0,this._retryQueue=void 0,this.persistence=void 0,this.sessionPersistence=void 0,this.sessionManager=void 0}return c(e,[{key:"init",value:function(e,t,n){if(Y(n))console.error("You must name your new library: init(token, config, name)");else{if(n!==t8){var r=nn(e,t,n,function(e){tW[n]=e,e._loaded()});return tW[n]=r,r}console.error("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var t,n,r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var c,l={segmentRegister:!1,syncCode:!1},u=function(e){return function(){l[e]||(l[e]=!0,l.segmentRegister&&l.syncCode&&(null==a||a(r)))}};if(this.set_config(q({},nt(),o,{name:s,token:e,callback_fn:(s===t8?s:t8+"."+s)+"._jsc"})),this._jsc=function(){},(null!=A&&null!==(t=A.rrweb)&&void 0!==t&&t.record||null!=A&&A.rrwebRecord)&&(this.__loaded_recorder_version=null==A||null===(c=A.rrweb)||void 0===c?void 0:c.version),this._captureMetrics=new td(this.get_config("_capture_metrics")),this._requestQueue=new tu(this._captureMetrics,this._handle_queued_event.bind(this)),this._retryQueue=new t1(this._captureMetrics,this.get_config("on_xhr_error")),this.__captureHooks=[],this.__request_queue=[],this.persistence=new eq(this.config),this.sessionManager=new t2(this.config,this.persistence),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new eq(i(i({},this.config),{},{persistence:"sessionStorage"})),this._gdpr_init(),o.segment?(this.config.get_device_id=function(){return o.segment.user().anonymousId()},o.segment.user().id()&&(this.register({distinct_id:o.segment.user().id()}),this.persistence.set_user_state("identified")),o.segment.register(this.segmentIntegration()).then(u("segmentRegister"))):u("segmentRegister")(),void 0!==(null===(n=o.bootstrap)||void 0===n?void 0:n.distinctID)
1){var d,h,f=this.get_config("get_device_id")(ei()),p=null!==(d=o.bootstrap)&&void 0!==d&&d.isIdentifiedID?f:o.bootstrap.distinctID;this.persistence.set_user_state(null!==(h=o.bootstrap)&&void 0!==h&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:p})}if(this._hasBootstrappedFeatureFlags()){var g,v,m=Object.keys((null===(g=o.bootstrap)||void 0===g?void 0:g.featureFlags)||{}).filter(function(e){var t,n;return!(null===(t=o.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])}).reduce(function(e,t){var n,r;return e[t]=(null===(n=o.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e},{}),_=Object.keys((null===(v=o.bootstrap)||void 0===v?void 0:v.featureFlagPayloads)||{}).filter(function(e){return m[e]}).reduce(function(e,t){var n,r,i,s;return null!==(n=o.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(i=o.bootstrap)||void 0===i||null===(s=i.featureFlagPayloads)||void 0===s?void 0:s[t]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:_})}if(!this.get_distinct_id()){var y=this.get_config("get_device_id")(ei());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_user_state("anonymous")}A.addEventListener&&A.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),u("syncCode")()}},{key:"_loaded",value:function(){this.featureFlags.setReloadingPaused(!0);try{this.get_config("loaded")(this)}catch(e){console.error("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.get_config("capture_pageview")&&this.capture("$pageview",{},{send_instantly:!0}),this.get_config("advanced_disable_decide")||new to(this).call(),this.featureFlags.resetRequestQueue(),this.featureFlags.setReloadingPaused(!1)}},{key:"_start_queue_if_opted_in",value:function(){this.has_opted_out_capturing()||this.get_config("request_batching")&&this._requestQueue.poll()}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||z(this.__request_queue,function(t){e._send_request.apply(e,g(t))}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,t){if(Y(e))return null;if(t7)return function(n){e(n,t)};var n=this._jsc,r=""+Math.floor(1e8*Math.random()),i=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(i){delete n[r],e(i,t)},i}},{key:"_handle_unload",value:function(){this.get_config("request_batching")?(this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&this.capture("$pageleave"),this.get_config("_capture_metrics")&&(this._requestQueue.updateUnloadMetrics(),this.capture("$capture_metrics",this._captureMetrics.metrics)),this._requestQueue.unload(),this._retryQueue.unload()):this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(e,t,n){var r=JSON.stringify(t);this.__compress_and_send_json_request(e,r,n||t9,t4)}},{key:"__compress_and_send_json_request",value:function(e,t,n,r){var o,s,a,c,l,u,d,h,f,g=p((o=(f=this.compression)[tI.GZipJS]?tI.GZipJS:f[tI.LZ64]?tI.LZ64:tI.Base64)===tI.LZ64?[{data:O.compressToBase64(t),compression:tI.LZ64},n]:o===tI.GZipJS?[(s=function(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new th(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new th(i+8+(n-s<<1));a.set(r),r=a}var c=e.charCodeAt(s);c<128?o(c):(c<2048?o(192|c>>>6):(c>55295&&c<57344?(o(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++s))>>>18),o(128|c>>>12&63)):o(224|c>>>12),o(128|c>>>6&63)),o(128|63&c))}return tR(r,0,i)}(t),a={mtime:0},c=tJ(),l=s.length,c.p(s),h=(u=10+(a.filename&&a.filename.length+1||0),d=function(e,t,n,r,i,o){var s=e.length,a=new th(r+s+5*(1+Math.floor(s/7e3))+8),c=a.subarray(r,a.length-8),l=0;if(!t||s<8)for(var u=0;u<=s;u+=65535){var d=u+65535;d<s?l=tU(c,l,e.subarray(u,d)):(c[u]=o,l=tU(c,l,e.subarray(u,s)))}else{for(var h=tz[t-1],f=h>>>13,p=8191&h,g=(1<<n)-1,v=new tf(32768),m=new tf(g+1),_=Math.ceil(n/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&g},w=new tp(25e3),k=new tf(288),S=new tf(32),x=0,O=0,E=(u=0,0),P=0,C=0;u<s;++u){var I=b(u),T=32767&u,A=m[I];if(v[T]=A,m[I]=T,P<=u){var j=s-u;if((x>7e3||E>24576)&&j>423){l=tB(e,c,0,w,k,S,O,E,C,u-C,l),E=x=O=0,C=u;for(var R=0;R<286;++R)k[R]=0;for(R=0;R<30;++R)S[R]=0}
1var N=2,$=0,F=p,M=T-A&32767;if(j>2&&I==b(u-M))for(var D=Math.min(f,j)-1,L=Math.min(32767,u),U=Math.min(258,j);M<=L&&--F&&T!=A;){if(e[u+N]==e[u+N-M]){for(var B=0;B<U&&e[u+B]==e[u+B-M];++B);if(B>N){if(N=B,$=M,B>D)break;var z=Math.min(M,B-2),q=0;for(R=0;R<z;++R){var V=u-M+R+32768&32767,J=V-v[V]+32768&32767;J>q&&(q=J,A=V)}}}M+=(T=A)-(A=v[T])+32768&32767}if($){w[E++]=268435456|tw[N]<<18|tk[$];var H=31&tw[N],G=31&tk[$];O+=tg[H]+tv[G],++k[257+H],++S[G],P=u+N,++x}else w[E++]=e[u],++k[e[u]]}}l=tB(e,c,o,w,k,S,O,E,C,u-C,l),o||(l=tU(c,l,tq))}return tR(a,0,r+tj(l)+i)}(s,null==a.level?6:a.level,null==a.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+a.mem,u,8,!0)).length,tG(d,a),tH(d,h-8,c.d()),tH(d,h-4,l),d),i(i({},n),{},{blob:!0,urlQueryArgs:{compression:tI.GZipJS}})]:[{data:et(t)},n],2),v=g[0],m=g[1];this._send_request(e,v,m,r)}},{key:"_send_request",value:function(e,t,n,r){if(ne)this.__request_queue.push([e,t,n,r]);else{n=q({method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},n||{}),t7||(n.method="GET");var o="sendBeacon"in A.navigator&&"sendBeacon"===n.transport;if(e=tZ(e,n.urlQueryArgs||{},{ip:this.get_config("ip")}),G(t)&&this.get_config("img")){var s=R.createElement("img");s.src=e,R.body.appendChild(s)}else if(o)try{A.navigator.sendBeacon(e,tQ(t,i(i({},n),{},{sendBeacon:!0})))}catch(e){this.get_config("debug")&&console.error(e)}else if(t7)try{t0({url:e,data:t,headers:this.get_config("xhr_headers"),options:n,captureMetrics:this._captureMetrics,callback:r,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.get_config("on_xhr_error")})}catch(e){console.error(e)}else{var a,c=R.createElement("script");c.type="text/javascript",c.async=!0,c.defer=!0,c.src=e;var l=R.getElementsByTagName("script")[0];null===(a=l.parentNode)||void 0===a||a.insertBefore(c,l)}}}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];z(e,function(e){e&&(V(t=e[0])?o.push(e):"function"==typeof e?e.call(n):V(e)&&"alias"===t?r.push(e):V(e)&&-1!==t.indexOf("capture")&&"function"==typeof n[t]?o.push(e):i.push(e))});var s=function(e,t){z(e,function(e){if(V(e[0])){var n=t;B(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};s(r,this),s(i,this),s(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t9;if(this.__loaded&&!e0(this,!1)){this._captureMetrics.incr("capture"),"$snapshot"===e&&this._captureMetrics.incr("snapshot");var r=(n=n||t9).transport;if(r&&(n.transport=r),Y(e)||"string"!=typeof e)console.error("No event name provided to posthog.capture");else if(!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp|ahrefsbot|facebookexternalhit|facebookcatalog|applebot|semrushbot|duckduckbot|twitterbot|rogerbot|linkedinbot|mj12bot|sitebulb|bot.htm|bot.php|hubspot|crawler)/i.test(N)){this.sessionPersistence.update_search_keyword(),this.get_config("store_google")&&this.sessionPersistence.update_campaign_params(),this.get_config("save_referrer")&&this.sessionPersistence.update_referrer_info();var i={event:e,properties:this._calculate_event_properties(e,t||{})};"$identify"===e&&n.$set&&(i.$set=n.$set),(i=ee(i,n._noTruncate?null:this.get_config("properties_string_max_length"))).timestamp=n.timestamp||new Date,this.get_config("debug")&&L.log("PostHog.js send",i);var o=JSON.stringify(i),s=this.get_config("api_host")+(n.endpoint||"/e/"),a=n!==t9;return!this.get_config("request_batching")||a&&!n._batchKey||n.send_instantly?this.__compress_and_send_json_request(s,o,n):this._requestQueue.enqueue(s,i,n),this._invokeCaptureHooks(e,i),i}}}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,t){this.config._onCapture(e,t),B(this.__captureHooks,function(t){return t(e)})}},{key:"_calculate_event_properties",value:function(e,t){var n,r=this.persistence.remove_event_timer(e),o=i({},t);if(o.token=this.get_config("token"),"$snapshot"===e){var s=i(i({},this.persistence.properties()),this.sessionPersistence.properties());return o.distinct_id=s.distinct_id,o}var a=ec.properties();if(this.sessionManager){var c=this.sessionManager.checkAndGetSessionAndWindowId(),l=c.sessionId,u=c.windowId;o.$session_id=l,o.$window_id=u}if(null!==(n=this.webPerformance)&&void 0!==n&&n.isEnabled&&("$pageview"===e&&this.pageViewIdManager.onPageview(),o=q(o,{$pageview_id:this.pageViewIdManager.getPageViewId()})),"$performance_event"===e){var d=this.persistence.properties();return o.distinct_id=d.distinct_id,o.$current_url=a.$current_url,o}if(void 0!==r){var h=(new Date).getTime()-r;o.$duration=parseFloat((h/1e3).toFixed(3))}o=q({},ec.properties(),this.persistence.properties(),this.sessionPersistence.properties(),o);var f=this.get_config("property_blacklist");V(f)?B(f,function(e){delete o[e]}):console.error("Invalid value for property_blacklist config: "+f);var p=this.get_config("sanitize_properties");return p&&(o=p(o,e)),o}},{key:"register",value:function(e,t){this.persistence.register(e,t)}},{key:"register_once",value:function(e,t,n){this.persistence.register_once(e,t,n)}},{key:"register_for_session",value:function(e){this.sessionPersistence.register(e)}},{key:"unregister",value:function(e){this.persistence.unregister(e)}},{key:"unregister_for_session",value:function(e){this.sessionPersistence.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(l({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"identify",value:function(e,t,n){if(e){this._captureMetrics.incr("identify");var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:r}
1,""),e!==r&&e!==this.get_property(ej)&&(this.unregister(ej),this.register({distinct_id:e}));var i="anonymous"===this.persistence.get_user_state();e!==r&&i?(this.persistence.set_user_state("identified"),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t&&this.people.set(t),n&&this.people.set_once(n)),e!==r&&this.reloadFeatureFlags()}else console.error("Unique user id has not been set in posthog.identify")}},{key:"group",value:function(e,t,n){if(e&&t){this._captureMetrics.incr("group");var r=this.getGroups();this.register({$groups:i(i({},r),{},l({},e,t))}),n&&this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),r[e]!==t&&this.reloadFeatureFlags()}else console.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.reloadFeatureFlags()}},{key:"reset",value:function(e){var t=this.get_property("$device_id");this.persistence.clear(),this.sessionPersistence.clear(),this.persistence.set_user_state("anonymous"),this.sessionManager.resetSessionId();var n=this.get_config("get_device_id")(ei());this.register_once({distinct_id:n,$device_id:e?n:t},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"alias",value:function(e,t){return e===this.get_property(eA)?(L.critical("Attempting to create alias for existing People user - aborting."),-2):(Y(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(ej,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(console.error("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var t=i({},this.config);G(e)&&(q(this.config,e),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),this.sessionPersistence&&this.sessionPersistence.update_config(this.config),eO.is_supported()&&"true"===eO.get("ph_debug")&&(this.config.debug=!0),this.get_config("debug")&&(E.DEBUG=!0),this.sessionRecording&&void 0!==e.disable_session_recording&&t.disable_session_recording!==e.disable_session_recording&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started())}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_config",value:function(e){var t;return null===(t=this.config)||void 0===t?void 0:t[e]}},{key:"get_property",value:function(e){return this.persistence.props[e]}},{key:"getSessionProperty",value:function(e){return this.sessionPersistence.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.get_config("name"))&&void 0!==e?e:t8;return t!==t8&&(t=t8+"."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.get_config("opt_out_capturing_persistence_type")&&eO.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_capturing()&&(this.get_config("opt_out_capturing_by_default")||eS.get("ph_optout"))&&(eS.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.get_config("opt_out_persistence_by_default")}))}},{key:"_gdpr_update_persistence",value:function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t),this.get_config("disable_persistence")||this.sessionPersistence.disabled===t||this.sessionPersistence.set_disabled(t)}},{key:"_gdpr_call_func",value:function(e,t){return t=q({capture:this.capture.bind(this),persistence_type:this.get_config("opt_out_capturing_persistence_type"),cookie_prefix:this.get_config("opt_out_capturing_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),secure_cookie:this.get_config("secure_cookie")},t||{}),eO.is_supported()||"localStorage"!==t.persistence_type||(t.persistence_type="cookie"),e(this.get_config("token"),{capture:t.capture,captureEventName:t.capture_event_name,captureProperties:t.capture_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieExpiration:t.cookie_expiration,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=q({enable_persistence:!0},e||{}),this._gdpr_call_func(eJ,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=q({clear_persistence:!0},e||{});this._gdpr_call_func(eH,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(eG,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(eY,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=q({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(eX,t),this._gdpr_update_persistence(t)}}
1,{key:"debug",value:function(e){!1===e?(A.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(A.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}},{key:"decodeLZ64",value:function(e){return O.decompressFromBase64(e||null)}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=W(e.prototype[t[n]])}(nr,["identify"]);var ni={},no=(tK=tX.INIT_MODULE,(tW=new nr).init=function(e,t,n){if(n)return tW[n]||(tW[n]=ni[n]=nn(e||"",t||{},n,function(e){tW[n]=ni[n]=e,e._loaded()})),tW[n];var r=tW;return ni[t8]?r=ni[t8]:e&&(r=nn(e,t||{},t8,function(e){ni[t8]=e,e._loaded()}),ni[t8]=r),tW=r,tK===tX.INIT_SNIPPET&&(A[t8]=tW),B(ni,function(e,t){t!==t8&&(tW[t]=e)}),r},tW.init(),function(){function e(){e.done||(e.done=!0,ne=!1,B(ni,function(e){e._dom_loaded()}))}R.addEventListener&&("complete"===R.readyState?e():R.addEventListener("DOMContentLoaded",e,!1)),ea(A,"load",e,!0)}(),tW)},58192:function(e,t,n){"use strict";n.d(t,{U0:function(){return a},zf:function(){return s}});var r=n(67294),i=n(99893),o=(0,r.createContext)({client:void 0});function s(e){var t=e.children,n=e.client,s=e.apiKey,a=e.options,c=(0,r.useState)(n),l=c[0],u=c[1];return(0,r.useEffect)(function(){n&&s&&console.warn("You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),n&&a&&console.warn("You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),!l&&(n?u(n):s&&(i.ZP.init(s,a),u(i.ZP)))},[l,n,s,a]),r.createElement(o.Provider,{value:{client:l}},t)}var a=function(){return(0,r.useContext)(o).client}},69328:function(e){"use strict";var t={decodeValues:!0,map:!1,silent:!1};function n(e){return"string"==typeof e&&!!e.trim()}function r(e,r){var i,o,s,a,c=e.split(";").filter(n),l=(i=c.shift(),o="",s="",(a=i.split("=")).length>1?(o=a.shift(),s=a.join("=")):s=i,{name:o,value:s}),u=l.name,d=l.value;r=r?Object.assign({},t,r):t;try{d=r.decodeValues?decodeURIComponent(d):d}catch(e){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+d+"'. Set options.decodeValues to false to disable this feature.",e)}var h={name:u,value:d};return c.forEach(function(e){var t=e.split("="),n=t.shift().trimLeft().toLowerCase(),r=t.join("=");"expires"===n?h.expires=new Date(r):"max-age"===n?h.maxAge=parseInt(r,10):"secure"===n?h.secure=!0:"httponly"===n?h.httpOnly=!0:"samesite"===n?h.sameSite=r:h[n]=r}),h}function i(e,i){if(i=i?Object.assign({},t,i):t,!e)return i.map?{}:[];if(e.headers){if("function"==typeof e.headers.getSetCookie)e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var o=e.headers[Object.keys(e.headers).find(function(e){return"set-cookie"===e.toLowerCase()})];o||!e.headers.cookie||i.silent||console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),e=o}}return(Array.isArray(e)||(e=[e]),(i=i?Object.assign({},t,i):t).map)?e.filter(n).reduce(function(e,t){var n=r(t,i);return e[n.name]=n,e},{}):e.filter(n).map(function(e){return r(e,i)})}e.exports=i,e.exports.parse=i,e.exports.parseString=r,e.exports.splitCookiesString=function(e){if(Array.isArray(e))return e;if("string"!=typeof e)return[];var t,n,r,i,o,s=[],a=0;function c(){for(;a<e.length&&/\s/.test(e.charAt(a));)a+=1;return a<e.length}for(;a<e.length;){for(t=a,o=!1;c();)if(","===(n=e.charAt(a))){for(r=a,a+=1,c(),i=a;a<e.length&&"="!==(n=e.charAt(a))&&";"!==n&&","!==n;)a+=1;a<e.length&&"="===e.charAt(a)?(o=!0,a=i,s.push(e.substring(t,r)),t=a):a=r+1}else a+=1;(!o||a>=e.length)&&s.push(e.substring(t,e.length))}return s}},45840:function(e,t,n){if("object"==typeof globalThis)r=globalThis;else try{r=n(284)}catch(e){}finally{if(r||"undefined"==typeof window||(r=window),!r)throw Error("Could not determine global this")}var r,i=r.WebSocket||r.MozWebSocket,o=n(79387);function s(e,t){return t?new i(e,t):new i(e)}i&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(e){Object.defineProperty(s,e,{get:function(){return i[e]}})}),e.exports={w3cwebsocket:i?s:null,version:o}},79387:function(e,t,n){e.exports=n(19794).version},23636:function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?r(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],s=!0,a=!1;try{for(i=i.call(e);!(s=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);s=!0);}catch(e){a=!0,r=e}finally{try{s||null==i.return||i.return()}finally{if(a)throw r}}return o}}(e,t)||l(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{Qc:function(){return t$},qv:function(){return tF},vc:function(){return tN}});var d,h,f,p,g,v,m,_,y=function(){},b={},w={},k=null,S={mark:y,measure:y};try{"undefined"!=typeof window&&(b=window),"undefined"!=typeof document&&(w=document),"undefined"!=typeof MutationObserver&&(k=MutationObserver),"undefined"!=typeof performance&&(S=performance)}catch(e){}var x=(b.navigator||{}).userAgent,O=void 0===x?"":x,E=b,P=w,C=k,I=S;E.document;var T=!!P.documentElement&&!!P.head&&"function"==typeof P.addEventListener&&"function"==typeof P.createElement,A=~O.indexOf("MSIE")||~O.indexOf("Trident/"),j="___FONT_AWESOME___",R="svg-inline--fa",N="data-fa-i2svg",$="data-fa-pseudo-element",F="data-prefix",M="data-icon",D="fontawesome-i2svg",L=["HTML","HEAD","STYLE","SCRIPT"],U=function(){try{return!0}catch(e){return!1}}(),B="classic",z="sharp",q=[B,z];function V(e){return new Proxy(e,{get:function(e,t){return t in e?e[t]:e[B]}})}var J=V((s(d={},B,{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands",fak:"kit","fa-kit":"kit"}),s(d,z,{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light"}),d)),H=V((s(h={},B,{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab",kit:"fak"}),s(h,z,{solid:"fass",regular:"fasr",light:"fasl"}),h)),G=V((s(f={},B,{fab:"fa-brands",fad:"fa-duotone",fak:"fa-kit",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"}),s(f,z,{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light"}),f)),Y=V((s(p={},B,{"fa-brands":"fab","fa-duotone":"fad","fa-kit":"fak","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"}),s(p,z,{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl"}),p)),X=/fa(s|r|l|t|d|b|k|ss|sr|sl)?[\-\ ]/,K="fa-layers-text",W=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp|Kit)?.*/i,Z=V((s(g={},B,{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"}),s(g,z,{900:"fass",400:"fasr",300:"fasl"}),g)),Q=[1,2,3,4,5,6,7,8,9,10],ee=Q.concat([11,12,13,14,15,16,17,18,19,20]),et=["class","data-
1prefix","data-icon","data-fa-transform","data-fa-mask"],en={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},er=new Set;Object.keys(H[B]).map(er.add.bind(er)),Object.keys(H[z]).map(er.add.bind(er));var ei=[].concat(q,c(er),["2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",en.GROUP,en.SWAP_OPACITY,en.PRIMARY,en.SECONDARY]).concat(Q.map(function(e){return"".concat(e,"x")})).concat(ee.map(function(e){return"w-".concat(e)})),eo=E.FontAwesomeConfig||{};P&&"function"==typeof P.querySelector&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(function(e){var t,n=a(e,2),r=n[0],i=n[1],o=""===(t=function(e){var t=P.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}(r))||"false"!==t&&("true"===t||t);null!=o&&(eo[i]=o)});var es={styleDefault:"solid",familyDefault:"classic",cssPrefix:"fa",replacementClass:R,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};eo.familyPrefix&&(eo.cssPrefix=eo.familyPrefix);var ea=i(i({},es),eo);ea.autoReplaceSvg||(ea.observeMutations=!1);var ec={};Object.keys(es).forEach(function(e){Object.defineProperty(ec,e,{enumerable:!0,set:function(t){ea[e]=t,el.forEach(function(e){return e(ec)})},get:function(){return ea[e]}})}),Object.defineProperty(ec,"familyPrefix",{enumerable:!0,set:function(e){ea.cssPrefix=e,el.forEach(function(e){return e(ec)})},get:function(){return ea.cssPrefix}}),E.FontAwesomeConfig=ec;var el=[],eu={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function ed(){for(var e=12,t="";e-- >0;)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[62*Math.random()|0];return t}function eh(e){for(var t=[],n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function ef(e){return e.classList?eh(e.classList):(e.getAttribute("class")||"").split(" ").filter(function(e){return e})}function ep(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function eg(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,": ").concat(e[n].trim(),";")},"")}function ev(e){return e.size!==eu.size||e.x!==eu.x||e.y!==eu.y||e.rotate!==eu.rotate||e.flipX||e.flipY}function em(){var e=ec.cssPrefix,t=ec.replacementClass,n=':root, :host {\n --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid";\n --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular";\n --fa-font-light: normal 300 1em/1 "Font Awesome 6 Light";\n --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Thin";\n --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";\n --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-light: normal 3
vendor: 21,719 bytes, line 1
100 1em/1 "Font Awesome 6 Sharp";\n --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n box-sizing: content-box;\n}\n\n.svg-inline--fa {\n display: var(--fa-display, inline-block);\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-li {\n width: var(--fa-li-width, 2em);\n top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: var(--fa-counter-background-color, #ff253a);\n border-radius: var(--fa-counter-border-radius, 1em);\n box-sizing: border-box;\n color: var(--fa-inverse, #fff);\n line-height: var(--fa-counter-line-height, 1);\n max-width: var(--fa-counter-max-width, 5em);\n min-width: var(--fa-counter-min-width, 1.5em);\n overflow: hidden;\n padding: var(--fa-counter-padding, 0.25em 0.5em);\n right: var(--fa-right, 0);\n text-overflow: ellipsis;\n top: var(--fa-top, 0);\n -webkit-transform: scale(var(--fa-counter-scale, 0.25));\n transform: scale(var(--fa-counter-scale, 0.25));\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: var(--fa-bottom, 0);\n right: var(--fa-right, 0);\n top: auto;\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: var(--fa-bottom, 0);\n left: var(--fa-left, 0);\n right: auto;\n top: auto;\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n top: var(--fa-top, 0);\n right: var(--fa-right, 0);\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: top right;\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: var(--fa-left, 0);\n right: auto;\n top: var(--fa-top, 0);\n -webkit-transform: scale(var(--fa-layers-scale, 0.25));\n transform: scale(var(--fa-layers-scale, 0.25));\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-2xs {\n font-size: 0.625em;\n line-height: 0.1em;\n vertical-align: 0.225em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n line-height: 0.0833333337em;\n vertical-align: 0.125em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n line-height: 0.0714285718em;\n vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n font-size: 1.25em;\n line-height: 0.05em;\n vertical-align: -0.075em;\n}\n\n.fa-xl {\n font-size: 1.5em;\n line-height: 0.0416666682em;\n vertical-align: -0.125em;\n}\n\n.fa-2xl {\n font-size: 2em;\n line-height: 0.03125em;\n vertical-align: -0.1875em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: var(--fa-li-margin, 2.5em);\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: calc(var(--fa-li-width, 2em) * -1);\n position: absolute;\n text-align: center;\n width: var(--fa-li-width, 2em);\n line-height: inherit;\n}\n\n.fa-border {\n border-color: var(--fa-border-color, #eee);\n border-radius: var(--fa-border-radius, 0.1em);\n border-style: var(--fa-border-style, solid);\n border-width: var(--fa-border-width, 0.08em);\n padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n float: left;\n margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n float: right;\n margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n -webkit-animation-name: fa-beat;\n animation-name: fa-beat;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-bounce {\n -webkit-animation-name: fa-bounce;\n animation-name: fa-bounce;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n}\n\n.fa-fade {\n -webkit-animation-name: fa-fade;\n animation-name: fa-fade;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n -webkit-animation-name: fa-beat-fade;\n animation-name: fa-beat-fade;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n -webkit-animation-name: fa-flip;\n animation-name: fa-flip;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-shake {\n -webkit-animation-name: fa-shake;\n animation-name: fa-shake;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, linear);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin {\n -webkit-animation-name: fa-spin;\n animation-name: fa-spin;\n -webkit-animation-delay: var(--fa-animation-delay, 0s);\n animation-delay: var(--fa-animation-delay, 0s);\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 2s);\n animation-duration: var(--fa-animation-duration, 2s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, linear);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n -webkit-animation-name: fa-spin;\n animation-name: fa-spin;\n -webkit-animation-direction: var(--fa-animation-direction, normal);\n animation-direction: var(--fa-animation-direction, normal);\n -webkit-animation-duration: var(--fa-animation-duration, 1s);\n animation-duration: var(--fa-animation-duration, 1s);\n -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n -webkit-animation-timing-function: var(--fa-animation-timing, steps(8));\n animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fa-beat,\n.fa-bounce,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-shake,\n.fa-spin,\n.fa-spin-pulse {\n -webkit-animation-delay: -1ms;\n animation-delay: -1ms;\n -webkit-animation-duration: 1ms;\n animation-duration: 1ms;\n -webkit-animation-iteration-count: 1;\n animation-iteration-count: 1;\n -webkit-transition-delay: 0s;\n transition-delay: 0s;\n -webkit-transition-duration: 0s;\n transition-duration: 0s;\n }\n}\n@-webkit-keyframes fa-beat {\n 0%, 90% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 45% {\n -webkit-transform: scale(var(--fa-beat-scale, 1.25));\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@keyframes fa-beat {\n 0%, 90% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 45% {\n -webkit-transform: scale(var(--fa-beat-scale, 1.25));\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@-webkit-keyframes fa-bounce {\n 0% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n}\n@keyframes fa-bounce {\n 0% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n -webkit-transform: scale(1, 1) translateY(0);\n transform: scale(1, 1) translateY(0);\n }\n}\n@-webkit-keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@-webkit-keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125));\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@-webkit-keyframes fa-flip {\n 50% {\n -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@keyframes fa-flip {\n 50% {\n -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@-webkit-keyframes fa-shake {\n 0% {\n -webkit-transform: rotate(-15deg);\n transform: rotate(-15deg);\n }\n 4% {\n -webkit-transform: rotate(15deg);\n transform: rotate(15deg);\n }\n 8%, 24% {\n -webkit-transform: rotate(-18deg);\n transform: rotate(-18deg);\n }\n 12%, 28% {\n -webkit-transform: rotate(18deg);\n transform: rotate(18deg);\n }\n 16% {\n -webkit-transform: rotate(-22deg);\n transform: rotate(-22deg);\n }\n 20% {\n -webkit-transform: rotate(22deg);\n transform: rotate(22deg);\n }\n 32% {\n -webkit-transform: rotate(-12deg);\n transform: rotate(-12deg);\n }\n 36% {\n -webkit-transform: rotate(12deg);\n transform: rotate(12deg);\n }\n 40%, 100% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n}\n@keyframes fa-shake {\n 0% {\n -webkit-transform: rotate(-15deg);\n transform: rotate(-15deg);\n }\n 4% {\n -webkit-transform: rotate(15deg);\n transform: rotate(15deg);\n }\n 8%, 24% {\n -webkit-transform: rotate(-18deg);\n transform: rotate(-18deg);\n }\n 12%, 28% {\n -webkit-transform: rotate(18deg);\n transform: rotate(18deg);\n }\n 16% {\n -webkit-transform: rotate(-22deg);\n transform: rotate(-22deg);\n }\n 20% {\n -webkit-transform: rotate(22deg);\n transform: rotate(22deg);\n }\n 32% {\n -webkit-transform: rotate(-12deg);\n transform: rotate(-12deg);\n }\n 36% {\n -webkit-transform: rotate(12deg);\n transform: rotate(12deg);\n }\n 40%, 100% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n}\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n -webkit-transform: rotate(var(--fa-rotate-angle, none));\n transform: rotate(var(--fa-rotate-angle, none));\n}\n\n.fa-stack {\n display: inline-block;\n vertical-align: middle;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse,\n.fa-duotone.fa-inverse {\n color: var(--fa-inverse, #fff);\n}';if(
1"fa"!==e||t!==R){var r=RegExp("\\.".concat("fa","\\-"),"g"),i=RegExp("\\--".concat("fa","\\-"),"g"),o=RegExp("\\.".concat(R),"g");n=n.replace(r,".".concat(e,"-")).replace(i,"--".concat(e,"-")).replace(o,".".concat(t))}return n}var e_=!1;function ey(){ec.autoAddCss&&!e_&&(!function(e){if(e&&T){var t=P.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;for(var n=P.head.childNodes,r=null,i=n.length-1;i>-1;i--){var o=n[i];["STYLE","LINK"].indexOf((o.tagName||"").toUpperCase())>-1&&(r=o)}P.head.insertBefore(t,r)}}(em()),e_=!0)}var eb=E||{};eb[j]||(eb[j]={}),eb[j].styles||(eb[j].styles={}),eb[j].hooks||(eb[j].hooks={}),eb[j].shims||(eb[j].shims=[]);var ew=eb[j],ek=[],eS=!1;function ex(e){var t,n=e.tag,r=e.attributes,i=e.children;return"string"==typeof e?ep(e):"<".concat(n," ").concat(Object.keys((t=void 0===r?{}:r)||{}).reduce(function(e,n){return e+"".concat(n,'="').concat(ep(t[n]),'" ')},"").trim(),">").concat((void 0===i?[]:i).map(ex).join(""),"</").concat(n,">")}function eO(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}!T||(eS=(P.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(P.readyState))||P.addEventListener("DOMContentLoaded",function e(){P.removeEventListener("DOMContentLoaded",e),eS=1,ek.map(function(e){return e()})});var eE=function(e,t,n,r){var i,o,s,a=Object.keys(e),c=a.length,l=void 0!==r?function(e,n,i,o){return t.call(r,e,n,i,o)}:t;for(void 0===n?(i=1,s=e[a[0]]):(i=0,s=n);i<c;i++)s=l(s,e[o=a[i]],o,e);return s};function eP(e){var t=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var o=e.charCodeAt(n++);(64512&o)==56320?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),n--)}else t.push(i)}return t}(e);return 1===t.length?t[0].toString(16):null}function eC(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return r.icon?t[r.iconName]=r.icon:t[n]=r,t},{})}function eI(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.skipHooks,o=eC(t);"function"!=typeof ew.hooks.addPack||void 0!==r&&r?ew.styles[e]=i(i({},ew.styles[e]||{}),o):ew.hooks.addPack(e,eC(t)),"fas"===e&&eI("fa",t)}var eT=ew.styles,eA=ew.shims,ej=(s(v={},B,Object.values(G[B])),s(v,z,Object.values(G[z])),v),eR=null,eN={},e$={},eF={},eM={},eD={},eL=(s(m={},B,Object.keys(J[B])),s(m,z,Object.keys(J[z])),m),eU=function(){var e=function(e){return eE(eT,function(t,n,r){return t[r]=eE(n,e,{}),t},{})};eN=e(function(e,t,n){return t[3]&&(e[t[3]]=n),t[2]&&t[2].filter(function(e){return"number"==typeof e}
1).forEach(function(t){e[t.toString(16)]=n}),e}),e$=e(function(e,t,n){return e[n]=n,t[2]&&t[2].filter(function(e){return"string"==typeof e}).forEach(function(t){e[t]=n}),e}),eD=e(function(e,t,n){var r=t[2];return e[n]=n,r.forEach(function(t){e[t]=n}),e});var t="far"in eT||ec.autoFetchSvg,n=eE(eA,function(e,n){var r=n[0],i=n[1],o=n[2];return"far"!==i||t||(i="fas"),"string"==typeof r&&(e.names[r]={prefix:i,iconName:o}),"number"==typeof r&&(e.unicodes[r.toString(16)]={prefix:i,iconName:o}),e},{names:{},unicodes:{}});eF=n.names,eM=n.unicodes,eR=eJ(ec.styleDefault,{family:ec.familyDefault})};function eB(e,t){return(eN[e]||{})[t]}function ez(e,t){return(eD[e]||{})[t]}function eq(e){return eF[e]||{prefix:null,iconName:null}}el.push(function(e){eR=eJ(e.styleDefault,{family:ec.familyDefault})}),eU();var eV=function(){return{prefix:null,iconName:null,rest:[]}};function eJ(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.family,r=void 0===n?B:n,i=J[r][e],o=H[r][e]||H[r][i],s=e in ew.styles?e:null;return o||s||null}var eH=(s(_={},B,Object.keys(G[B])),s(_,z,Object.keys(G[z])),_);function eG(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.skipLookups,i=void 0!==r&&r,o=(s(t={},B,"".concat(ec.cssPrefix,"-").concat(B)),s(t,z,"".concat(ec.cssPrefix,"-").concat(z)),t),a=null,c=B;(e.includes(o[B])||e.some(function(e){return eH[B].includes(e)}))&&(c=B),(e.includes(o[z])||e.some(function(e){return eH[z].includes(e)}))&&(c=z);var l=e.reduce(function(e,t){var n,r,s,l,u=(n=ec.cssPrefix,s=(r=t.split("-"))[0],l=r.slice(1).join("-"),s!==n||""===l||~ei.indexOf(l)?null:l);if(eT[t]?(a=t=ej[c].includes(t)?Y[c][t]:t,e.prefix=t):eL[c].indexOf(t)>-1?(a=t,e.prefix=eJ(t,{family:c})):u?e.iconName=u:t!==ec.replacementClass&&t!==o[B]&&t!==o[z]&&e.rest.push(t),!i&&e.prefix&&e.iconName){var d="fa"===a?eq(e.iconName):{},h=ez(e.prefix,e.iconName);d.prefix&&(a=null),e.iconName=d.iconName||h||e.iconName,e.prefix=d.prefix||e.prefix,"far"!==e.prefix||eT.far||!eT.fas||ec.autoFetchSvg||(e.prefix="fas")}return e},eV());return(e.includes("fa-brands")||e.includes("fab"))&&(l.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(l.prefix="fad"),!l.prefix&&c===z&&(eT.fass||ec.autoFetchSvg)&&(l.prefix="fass",l.iconName=ez(l.prefix,l.iconName)||l.iconName),("fa"===l.prefix||"fa"===a)&&(l.prefix=eR||"fas"),l}var eY=function(){var e;function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.definitions={}}return e=[{key:"add",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n.reduce(this._pullDefinitions,{});Object.keys(o).forEach(function(t){e.definitions[t]=i(i({},e.definitions[t]||{}),o[t]),eI(t,o[t]);var n=G[B][t];n&&eI(n,o[t]),eU()})}},{key:"reset",value:function(){this.definitions={}}},{key:"_pullDefinitions",value:function(e,t){var n=t.prefix&&t.iconName&&t.icon?{0:t}:t;return Object.keys(n).map(function(t){var r=n[t],i=r.prefix,o=r.iconName,s=r.icon,a=s[2];e[i]||(e[i]={}),a.length>0&&a.forEach(function(t){"string"==typeof t&&(e[i][t]=s)}),e[i][o]=s}),e}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(),eX=[],eK={},eW={},eZ=Object.keys(eW);function eQ(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return(eK[e]||[]).forEach(function(e){t=e.apply(null,[t].concat(r))}),t}function e0(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(eK[e]||[]).forEach(function(e){e.apply(null,n)})}function e1(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return eW[e]?eW[e].apply(null,t):void 0}function e2(e){"fa"===e.prefix&&(e.prefix="fas");var t=e.iconName,n=e.prefix||eR;if(t)return t=ez(n,t)||t,eO(e5.definitions,n,t)||eO(ew.styles,n,t)}var e5=new eY,e3={noAuto:function(){ec.autoReplaceSvg=!1,ec.observeMutations=!1,e0("noAuto")},config:ec,dom:{i2svg:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return T?(e0("beforeI2svg",e),e1("pseudoElements2svg",e),e1("i2svg",e)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.autoReplaceSvgRoot;!1===ec.autoReplaceSvg&&(ec.autoReplaceSvg=!0),ec.observeMutations=!0,e=function(){e6({autoReplaceSvgRoot:n}),e0("watch",t)},T&&(eS?setTimeout(e,0):ek.push(e))}},parse:{icon:function(e){if(null===e)return null;if("object"===o(e)&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:ez(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&2===e.length){var t=0===e[1].indexOf("fa-")?e[1].slice(3):e[1],n=eJ(e[0]);return{prefix:n,iconName:ez(n,t)||t}}if("string"==typeof e&&(e.indexOf("".concat(ec.cssPrefix,"-"))>-1||e.match(X))){var r=eG(e.split(" "),{skipLookups:!0});return{prefix:r.prefix||eR,iconName:ez(r.prefix,r.iconName)||r.iconName}}if("string"==typeof e){var i=eR;return{prefix:i,iconName:ez(i,e)||e}}}},library:e5,findIconDefinition:e2,toHtml:ex},e6=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.autoReplaceSvgRoot,n=void 0===t?P:t;(Object.keys(ew.styles).length>0||ec.autoFetchSvg)&&T&&ec.autoReplaceSvg&&e3.dom.i2svg({node:n})};function e4(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(e){return ex(e)})}}),Object.defineProperty(e,"node",{get:function(){if(T){var t=P.createElement("div");return t.innerHTML=e.html,t.children}}}),e}function e9(e){var t,n,r,o,s,a,c=e.icons,l=c.main,u=c.mask,d=e.prefix,h=e.iconName,f=e.transform,p=e.symbol,g=e.title,v=e.maskId,m=e.titleId,_=e.extra,y=e.watchable,b=u.found?u:l,w=b.width,k=b.height,S="fak"===d,x=[ec.replacementClass,h?"".concat(ec.cssPrefix,"-").concat(h):""].filter(function(e){return -1===_.classes.indexOf(e)}).filter(function(e){return""!==e||!!e}).concat(_.classes).join(" "),O={children:[],attributes:i(i({},_.attributes),{},{"data-prefix":d,"data-icon":h,class:x,role:_.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(w," ").concat(k)})},E=S&&!~_.classes.indexOf("fa-fw")?{width:"".concat(w/k*1,"em")}:{};void 0!==y&&y&&(O.attributes[N]=""),g&&(O.children.push({tag:"title",attributes:{id:O.attributes["aria-labelledby"]||"title-".concat(m||ed())},children:[g]}),delete O.attributes.title);var P=i(i({},O),{},{prefix:d,iconName:h,main:l,mask:u,maskId:v,transform:f,symbol:p,styles:i(i({},E),_.styles)}),C=u.found&&l.found?e1("generateAbstractMask",P)||{children:[],attributes:{}}:e1("generateAbstractIcon",P)||{children:[],attributes:{}},I=C.children,T=C.attributes;return(P.children=I,P.attributes=T,p)?(t=P.prefix,n=P.iconName,r=P.children,o=P.attributes,a=!0===(s=P.symbol)?"".concat(t,"-").concat(ec.cssPrefix,"-").concat(n):s,[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:i(i({},o),{},{id:a}),children:r}]}]):function(e){var t=e.children,n=e.main,r=e.mask,o=e.attributes,s=e.styles,a=e.transform;if(ev(a)&&n.found&&!r.found){var c={x:n.width/n.height/2,y:.5};o.style=eg(i(i({},s),{},{"transform-origin":"".concat(c.x+a.x/16,"em ").concat(c.y+a.y/16,"em")}))}return[{tag:"svg",attributes:o,children:t}]}(P)}function e8(e){var t,n,r,o,s,a,c,l=e.content,u=e.width,d=e.height,h=e.transform,f=e.title,p=e.extra,g=e.watchable,v=i(i(i({},p.attributes),f?{title:f}:{}),{},{class:p.classes.join(" ")});void 0!==g&&g&&(v[N]="");var m=i({},p.styles);ev(h)&&(m.transform=(n=(t={transform:h,startCentered:!0,width:u,height:d}).transform,r=t.width,o=t.height,a=void 0!==(s=t.startCentered)&&s,c="",a&&A?c+="translate(".concat(n.x/16-(void 0===r?16:r)/2,"em, ").concat(n.y/16-(void 0===o?16:o)/2,"em) "):a?c+="translate(calc(-50% + ".concat(n.x/16,"em), calc(-50% + ").concat(n.y/16,"em)) "):c+="translate(".concat(n.x/16,"em, ").concat(n.y/16,"em) "),c+="scale(".concat(n.size/16*(n.flipX?-1:1),", ").concat(n.size/16*(n.flipY?-1:1),") ")+"rotate(".concat(n.rotate,"deg) ")),m["-webkit-transform"]=m.transform);var _=eg(m);_.length>0&&(v.style=_);var y=[];return y.push({tag:"span",attributes:v,children:[l]}),f&&y.push({tag:"span",attributes:{class:"sr-only"},children:[f]}),y}var e7=ew.styles;function te(e){var t=e[0],n=e[1],r=a(e.slice(4),1)[0];return{found:!0,width:t,height:n,icon:Array.isArray(r)?{tag:"g",attributes:{class:"".concat(ec.cssPrefix,"-").concat(en.GROUP)},children:[{tag:"path",attributes:{class:"".concat(ec.cssPrefix,"-").concat(en.SECONDARY),fill:"currentColor",d:r[0]}},{tag:"path",attributes:{class:"".concat(ec.cssPrefix,"-").concat(en.PRIMARY),fill:"currentColor",d:r[1]}}]}
1:{tag:"path",attributes:{fill:"currentColor",d:r}}}}var tt={found:!1,width:512,height:512};function tn(e,t){var n=t;return"fa"===t&&null!==ec.styleDefault&&(t=eR),new Promise(function(r,o){if(e1("missingIconAbstract"),"fa"===n){var s,a,c=eq(e)||{};e=c.iconName||e,t=c.prefix||t}if(e&&t&&e7[t]&&e7[t][e])return r(te(e7[t][e]));s=e,a=t,U||ec.showMissingIcons||!s||console.error('Icon with name "'.concat(s,'" and prefix "').concat(a,'" is missing.')),r(i(i({},tt),{},{icon:ec.showMissingIcons&&e&&e1("missingIconAbstract")||{}}))})}var tr=function(){},ti=ec.measurePerformance&&I&&I.mark&&I.measure?I:{mark:tr,measure:tr},to='FA "6.4.0"',ts=function(e){ti.mark("".concat(to," ").concat(e," ends")),ti.measure("".concat(to," ").concat(e),"".concat(to," ").concat(e," begins"),"".concat(to," ").concat(e," ends"))},ta={begin:function(e){return ti.mark("".concat(to," ").concat(e," begins")),function(){return ts(e)}}},tc=function(){};function tl(e){return"string"==typeof(e.getAttribute?e.getAttribute(N):null)}function tu(e){return P.createElementNS("http://www.w3.org/2000/svg",e)}function td(e){return P.createElement(e)}var th={replace:function(e){var t=e[0];if(t.parentNode){if(e[1].forEach(function(e){t.parentNode.insertBefore(function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.ceFn,i=void 0===r?"svg"===t.tag?tu:td:r;if("string"==typeof t)return P.createTextNode(t);var o=i(t.tag);return Object.keys(t.attributes||[]).forEach(function(e){o.setAttribute(e,t.attributes[e])}),(t.children||[]).forEach(function(t){o.appendChild(e(t,{ceFn:i}))}),o}(e),t)}),null===t.getAttribute(N)&&ec.keepOriginalSource){var n,r=P.createComment((n=" ".concat(t.outerHTML," "),n="".concat(n,"Font Awesome fontawesome.com ")));t.parentNode.replaceChild(r,t)}else t.remove()}},nest:function(e){var t=e[0],n=e[1];if(~ef(t).indexOf(ec.replacementClass))return th.replace(e);var r=new RegExp("".concat(ec.cssPrefix,"-.*"));if(delete n[0].attributes.id,n[0].attributes.class){var i=n[0].attributes.class.split(" ").reduce(function(e,t){return t===ec.replacementClass||t.match(r)?e.toSvg.push(t):e.toNode.push(t),e},{toNode:[],toSvg:[]});n[0].attributes.class=i.toSvg.join(" "),0===i.toNode.length?t.removeAttribute("class"):t.setAttribute("class",i.toNode.join(" "))}var o=n.map(function(e){return ex(e)}).join("\n");t.setAttribute(N,""),t.innerHTML=o}};function tf(e){e()}function tp(e,t){var n="function"==typeof t?t:tc;if(0===e.length)n();else{var r=tf;"async"===ec.mutateApproach&&(r=E.requestAnimationFrame||tf),r(function(){var t=!0===ec.autoReplaceSvg?th.replace:th[ec.autoReplaceSvg]||th.replace,r=ta.begin("mutate");e.map(t),r(),n()})}}var tg=!1,tv=null;function tm(e){if(C&&ec.observeMutations){var t=e.treeCallback,n=void 0===t?tc:t,r=e.nodeCallback,i=void 0===r?tc:r,o=e.pseudoElementsCallback,s=void 0===o?tc:o,a=e.observeMutationsRoot,c=void 0===a?P:a;tv=new C(function(e){if(!tg){var t=eR;eh(e).forEach(function(e){if("childList"===e.type&&e.addedNodes.length>0&&!tl(e.addedNodes[0])&&(ec.searchPseudoElements&&s(e.target),n(e.target)),"attributes"===e.type&&e.target.parentNode&&ec.searchPseudoElements&&s(e.target.parentNode),"attributes"===e.type&&tl(e.target)&&~et.indexOf(e.attributeName)){if("class"===e.attributeName&&(o=(r=e.target).getAttribute?r.getAttribute(F):null,a=r.getAttribute?r.getAttribute(M):null,o&&a)){var r,o,a,c,l=eG(ef(e.target)),u=l.prefix,d=l.iconName;e.target.setAttribute(F,u||t),d&&e.target.setAttribute(M,d)}else(c=e.target)&&c.classList&&c.classList.contains&&c.classList.contains(ec.replacementClass)&&i(e.target)}})}}),T&&tv.observe(c,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function t_(e){var t,n,r,o,s,a,c,l,u,d,h,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{styleParser:!0},p=(r=e.getAttribute("data-prefix"),o=e.getAttribute("data-icon"),s=void 0!==e.innerText?e.innerText.trim():"",(a=eG(ef(e))).prefix||(a.prefix=eR),r&&o&&(a.prefix=r,a.iconName=o),a.iconName&&a.prefix||(a.prefix&&s.length>0&&(a.iconName=(t=a.prefix,n=e.innerText,(e$[t]||{})[n]||eB(a.prefix,eP(e.innerText)))),!a.iconName&&ec.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(a.iconName=e.firstChild.data)),a),g=p.iconName,v=p.prefix,m=p.rest,_=(c=eh(e.attributes).reduce(function(e,t){return"class"!==e.name&&"style"!==e.name&&(e[t.name]=t.value),e},{}),l=e.getAttribute("title"),u=e.getAttribute("data-fa-title-id"),ec.autoA11y&&(l?c["aria-labelledby"]="".concat(ec.replacementClass,"-title-").concat(u||ed()):(c["aria-hidden"]="true",c.focusable="false")),c),y=eQ("parseNodeAttributes",{}
1,e),b=f.styleParser?(d=e.getAttribute("style"),h=[],d&&(h=d.split(";").reduce(function(e,t){var n=t.split(":"),r=n[0],i=n.slice(1);return r&&i.length>0&&(e[r]=i.join(":").trim()),e},{})),h):[];return i({iconName:g,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:v,transform:eu,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:m,styles:b,attributes:_}},y)}var ty=ew.styles;function tb(e){var t="nest"===ec.autoReplaceSvg?t_(e,{styleParser:!1}):t_(e);return~t.extra.classes.indexOf(K)?e1("generateLayersText",e,t):e1("generateSvgReplacementMutation",e,t)}var tw=new Set;function tk(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!T)return Promise.resolve();var n=P.documentElement.classList,r=function(e){return n.add("".concat(D,"-").concat(e))},i=function(e){return n.remove("".concat(D,"-").concat(e))},o=ec.autoFetchSvg?tw:q.map(function(e){return"fa-".concat(e)}).concat(Object.keys(ty));o.includes("fa")||o.push("fa");var s=[".".concat(K,":not([").concat(N,"])")].concat(o.map(function(e){return".".concat(e,":not([").concat(N,"])")})).join(", ");if(0===s.length)return Promise.resolve();var a=[];try{a=eh(e.querySelectorAll(s))}catch(e){}if(!(a.length>0))return Promise.resolve();r("pending"),i("complete");var c=ta.begin("onTree"),l=a.reduce(function(e,t){try{var n=tb(t);n&&e.push(n)}catch(e){U||"MissingIcon"!==e.name||console.error(e)}return e},[]);return new Promise(function(e,n){Promise.all(l).then(function(n){tp(n,function(){r("active"),r("complete"),i("pending"),"function"==typeof t&&t(),c(),e()})}).catch(function(e){c(),n(e)})})}function tS(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;tb(e).then(function(e){e&&tp([e],t)})}q.map(function(e){tw.add("fa-".concat(e))}),Object.keys(J[B]).map(tw.add.bind(tw)),Object.keys(J[z]).map(tw.add.bind(tw)),tw=c(tw);var tx=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.transform,r=void 0===n?eu:n,o=t.symbol,s=void 0!==o&&o,a=t.mask,c=void 0===a?null:a,l=t.maskId,u=void 0===l?null:l,d=t.title,h=void 0===d?null:d,f=t.titleId,p=void 0===f?null:f,g=t.classes,v=void 0===g?[]:g,m=t.attributes,_=void 0===m?{}:m,y=t.styles,b=void 0===y?{}:y;if(e){var w=e.prefix,k=e.iconName,S=e.icon;return e4(i({type:"icon"},e),function(){return e0("beforeDOMElementCreation",{iconDefinition:e,params:t}),ec.autoA11y&&(h?_["aria-labelledby"]="".concat(ec.replacementClass,"-title-").concat(p||ed()):(_["aria-hidden"]="true",_.focusable="false")),e9({icons:{main:te(S),mask:c?te(c.icon):{found:!1,width:null,height:null,icon:{}}},prefix:w,iconName:k,transform:i(i({},eu),r),symbol:s,title:h,maskId:u,titleId:p,extra:{attributes:_,styles:b,classes:v}})})}},tO=RegExp('"',"ug");function tE(e,t){var n="".concat("data-fa-pseudo-element-pending").concat(t.replace(":","-"));return new Promise(function(r,o){if(null!==e.getAttribute(n))return r();var s=eh(e.children).filter(function(e){return e.getAttribute($)===t})[0],a=E.getComputedStyle(e,t),c=a.getPropertyValue("font-family").match(W),l=a.getPropertyValue("font-weight"),u=a.getPropertyValue("content");if(s&&!c)return e.removeChild(s),r();if(c&&"none"!==u&&""!==u){var d=a.getPropertyValue("content"),h=~["Sharp"].indexOf(c[2])?z:B,f=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(c[2])?H[h][c[2].toLowerCase()]:Z[h][l],p=(S=(w=b=d.replace(tO,"")).length,O=(x=w.charCodeAt(0))>=55296&&x<=56319&&S>1&&(k=w.charCodeAt(1))>=56320&&k<=57343?(x-55296)*1024+k-56320+65536:x,{value:(C=2===b.length&&b[0]===b[1])?eP(b[0]):eP(b),isSecondary:O>=1105920&&O<=1112319||C}),g=p.value,v=p.isSecondary,m=c[0].startsWith("FontAwesome"),_=eB(f,g),y=_;if(m){var b,w,k,S,x,O,C,I,T,A=(I=eM[g],T=eB("fas",g),I||(T?{prefix:"fas",iconName:T}:null)||{prefix:null,iconName:null});A.iconName&&A.prefix&&(_=A.iconName,f=A.prefix)}if(!_||v||s&&s.getAttribute(F)===f&&s.getAttribute(M)===y)r();else{e.setAttribute(n,y),s&&e.removeChild(s);var j={iconName:null,title:null,titleId:null,prefix:null,transform:eu,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}},R=j.extra;R.attributes[$]=t,tn(_,f).then(function(o){var s=e9(i(i({},j),{},{icons:{main:o,mask:eV()},prefix:f,iconName:y,extra:R,watchable:!0})),a=P.createElement("svg");"::before"===t?e.insertBefore(a,e.firstChild):e.appendChild(a),a.outerHTML=s.map(function(e){return ex(e)}).join("\n"),e.removeAttribute(n),r()}).catch(o)}}else r()})}function tP(e){return Promise.all([tE(e,"::before"),tE(e,"::after")])}function tC(e){return e.parentNode!==document.head&&!~L.indexOf(e.tagName.toUpperCase())&&!e.getAttribute($)&&(!e.parentNode||"svg"!==e.parentNode.tagName)}function tI(e){if(T)return new Promise(function(t,n){var r=eh(e.querySelectorAll("*")).filter(tC).map(tP),i=ta.begin("searchPseudoElements");tg=!0,Promise.all(r).then(function(){i(),tg=!1,t()}).catch(function(){i(),tg=!1,n()})})}var tT=!1,tA=function(e){return e.toLowerCase().split(" ").reduce(function(e,t){var n=t.toLowerCase().split("-"),r=n[0],i=n.slice(1).join("-");if(r&&"h"===i)return e.flipX=!0,e;if(r&&"v"===i)return e.flipY=!0,e;if(isNaN(i=parseFloat(i)))return e;switch(r){case"grow":e.size=e.size+i;break;case"shrink":e.size=e.size-i;break;case"left":e.x=e.x-i;break;case"right":e.x=e.x+i;break;case"up":e.y=e.y-i;break;case"down":e.y=e.y+i;break;case"rotate":e.rotate=e.rotate+i}return e},{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0})},tj={x:0,y:0,width:"100%",height:"100%"};function tR(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}eX=[{mixout:function(){return{dom:{css:em,insertCss:ey}}},hooks:function(){return{beforeDOMElementCreation:function(){ey()},beforeI2svg:function(){ey()}}}},{mixout:function(){return{icon:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(e||{}).icon?e:e2(e||{}),r=t.mask;return r&&(r=(r||{}).icon?r:e2(r||{})),tx(n,i(i({},t),{},{mask:r}))}}},hooks:function(){return{mutationObserverCallbacks:function(e){return e.treeCallback=tk,e.nodeCallback=tS,e}}},provides:function(e){e.i2svg=function(e){var t=e.node,n=void 0===t?P:t,r=e.callback;return tk(n,void 0===r?function(){}:r)},e.generateSvgReplacementMutation=function(e,t){var n=t.iconName,r=t.title,i=t.titleId,o=t.prefix,s=t.transform,c=t.symbol,l=t.mask,u=t.maskId,d=t.extra;return new Promise(function(t,h){Promise.all([tn(n,o),l.iconName?tn(l.iconName,l.prefix):Promise.resolve({foun
1d:!1,width:512,height:512,icon:{}})]).then(function(l){var h=a(l,2);t([e,e9({icons:{main:h[0],mask:h[1]},prefix:o,iconName:n,transform:s,symbol:c,maskId:u,title:r,titleId:i,extra:d,watchable:!0})])}).catch(h)})},e.generateAbstractIcon=function(e){var t,n=e.children,r=e.attributes,i=e.main,o=e.transform,s=eg(e.styles);return s.length>0&&(r.style=s),ev(o)&&(t=e1("generateAbstractTransformGrouping",{main:i,transform:o,containerWidth:i.width,iconWidth:i.width})),n.push(t||i.icon),{children:n,attributes:r}}}},{mixout:function(){return{layer:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.classes,r=void 0===n?[]:n;return e4({type:"layer"},function(){e0("beforeDOMElementCreation",{assembler:e,params:t});var n=[];return e(function(e){Array.isArray(e)?e.map(function(e){n=n.concat(e.abstract)}):n=n.concat(e.abstract)}),[{tag:"span",attributes:{class:["".concat(ec.cssPrefix,"-layers")].concat(c(r)).join(" ")},children:n}]})}}}},{mixout:function(){return{counter:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.title,r=void 0===n?null:n,o=t.classes,s=void 0===o?[]:o,a=t.attributes,l=void 0===a?{}:a,u=t.styles,d=void 0===u?{}:u;return e4({type:"counter",content:e},function(){var n,o,a,u,h,f,p;return e0("beforeDOMElementCreation",{content:e,params:t}),o=(n={content:e.toString(),title:r,extra:{attributes:l,styles:d,classes:["".concat(ec.cssPrefix,"-layers-counter")].concat(c(s))}}).content,a=n.title,h=i(i(i({},(u=n.extra).attributes),a?{title:a}:{}),{},{class:u.classes.join(" ")}),(f=eg(u.styles)).length>0&&(h.style=f),(p=[]).push({tag:"span",attributes:h,children:[o]}),a&&p.push({tag:"span",attributes:{class:"sr-only"},children:[a]}),p})}}}},{mixout:function(){return{text:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.transform,r=void 0===n?eu:n,o=t.title,s=void 0===o?null:o,a=t.classes,l=void 0===a?[]:a,u=t.attributes,d=void 0===u?{}:u,h=t.styles,f=void 0===h?{}:h;return e4({type:"text",content:e},function(){return e0("beforeDOMElementCreation",{content:e,params:t}),e8({content:e,transform:i(i({},eu),r),title:s,extra:{attributes:d,styles:f,classes:["".concat(ec.cssPrefix,"-layers-text")].concat(c(l))}})})}}},provides:function(e){e.generateLayersText=function(e,t){var n=t.title,r=t.transform,i=t.extra,o=null,s=null;if(A){var a=parseInt(getComputedStyle(e).fontSize,10),c=e.getBoundingClientRect();o=c.width/a,s=c.height/a}return ec.autoA11y&&!n&&(i.attributes["aria-hidden"]="true"),Promise.resolve([e,e8({content:e.innerHTML,width:o,height:s,transform:r,title:n,extra:i,watchable:!0})])}}},{hooks:function(){return{mutationObserverCallbacks:function(e){return e.pseudoElementsCallback=tI,e}}},provides:function(e){e.pseudoElements2svg=function(e){var t=e.node,n=void 0===t?P:t;ec.searchPseudoElements&&tI(n)}}},{mixout:function(){return{dom:{unwatch:function(){tg=!0,tT=!0}}}},hooks:function(){return{bootstrap:function(){tm(eQ("mutationObserverCallbacks",{}))},noAuto:function(){tv&&tv.disconnect()},watch:function(e){var t=e.observeMutationsRoot;tT?tg=!1:tm(eQ("mutationObserverCallbacks",{observeMutationsRoot:t}))}}}},{mixout:function(){return{parse:{transform:function(e){return tA(e)}}}},hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute("data-fa-transform");return n&&(e.transform=tA(n)),e}}},provides:function(e){e.generateAbstractTransformGrouping=function(e){var t=e.main,n=e.transform,r=e.containerWidth,o=e.iconWidth,s="translate(".concat(32*n.x,", ").concat(32*n.y,") "),a="scale(".concat(n.size/16*(n.flipX?-1:1),", ").concat(n.size/16*(n.flipY?-1:1),") "),c="rotate(".concat(n.rotate," 0 0)"),l={transform:"".concat(s," ").concat(a," ").concat(c)},u={outer:{transform:"translate(".concat(r/2," 256)")},inner:l,path:{transform:"translate(".concat(-(o/2*1)," -256)")}};return{tag:"g",attributes:i({},u.outer),children:[{tag:"g",attributes:i({},u.inner),children:[{tag:t.icon.tag,children:t.icon.children,attributes:i(i({},t.icon.attributes),u.path)}]}]}}}},{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute("data-fa-mask"),r=n?eG(n.split(" ").map(function(e){return e.trim()})):eV();return r.prefix||(r.prefix=eR),e.mask=r,e.maskId=t.getAttribute("data-fa-mask-id"),e}}},provides:function(e){e.generateAbstractMask=function(e){var t,n,r,o,s,a,c,l,u=e.children,d=e.attributes,h=e.main,f=e.mask,p=e.maskId,g=e.transform,v=h.width,m=h.icon,_=f.width,y=f.icon,b=(n=(t={transform:g,containerWidth:_,iconWidth:v}).transform,r=t.containerWidth,o=t.iconWidth,s="translate(".concat(32*n.x,", ").concat(32*n.y,") "),a="scale(".concat(n.size/16*(n.flipX?-1:1),", ").concat(n.size/16*(n.flipY?-1:1),") "),c="rotate(".concat(n.rotate," 0 0)"),l={transform:"".concat(s," ").concat(a," ").concat(c)},{outer:{transform:"translate(".concat(r/2," 256)")},inner:l,path:{transform:"translate(".concat(-(o/2*1)," -256)")}}),w={tag:"rect",attributes:i(i({},tj),{},{fill:"white"})},k=m.children?{children:m.children.map(tR)}:{},S={tag:"g",attributes:i({},b.inner),children:[tR(i({tag:m.tag,attributes:i(i({},m.attributes),b.path)},k))]},x={tag:"g",attributes:i({},b.outer),children:[S]},O="mask-".concat(p||ed()),E="clip-".concat(p||ed()),P={tag:"mask",attributes:i(i({},tj),{},{id:O,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[w,x]},C={tag:"defs",children:[{tag:"clipPath",attributes:{id:E},children:"g"===y.tag?y.children:[y]},P]};
1return u.push(C,{tag:"rect",attributes:i({fill:"currentColor","clip-path":"url(#".concat(E,")"),mask:"url(#".concat(O,")")},tj)}),{children:u,attributes:d}}}},{provides:function(e){var t=!1;E.matchMedia&&(t=E.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){var e=[],n={fill:"currentColor"},r={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};e.push({tag:"path",attributes:i(i({},n),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var o=i(i({},r),{},{attributeName:"opacity"}),s={tag:"circle",attributes:i(i({},n),{},{cx:"256",cy:"364",r:"28"}),children:[]};return t||s.children.push({tag:"animate",attributes:i(i({},r),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:i(i({},o),{},{values:"1;0;1;1;0;1;"})}),e.push(s),e.push({tag:"path",attributes:i(i({},n),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:t?[]:[{tag:"animate",attributes:i(i({},o),{},{values:"1;0;0;0;0;1;"})}]}),t||e.push({tag:"path",attributes:i(i({},n),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:i(i({},o),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:e}}}},{hooks:function(){return{parseNodeAttributes:function(e,t){var n=t.getAttribute("data-fa-symbol");return e.symbol=null!==n&&(""===n||n),e}}}}],eK={},Object.keys(eW).forEach(function(e){-1===eZ.indexOf(e)&&delete eW[e]}),eX.forEach(function(e){var t=e.mixout?e.mixout():{};if(Object.keys(t).forEach(function(e){"function"==typeof t[e]&&(e3[e]=t[e]),"object"===o(t[e])&&Object.keys(t[e]).forEach(function(n){e3[e]||(e3[e]={}),e3[e][n]=t[e][n]})}),e.hooks){var n=e.hooks();Object.keys(n).forEach(function(e){eK[e]||(eK[e]=[]),eK[e].push(n[e])})}e.provides&&e.provides(eW)}),e3.noAuto;var tN=e3.config;e3.library,e3.dom;var t$=e3.parse;e3.findIconDefinition,e3.toHtml;var tF=e3.icon;e3.layer,e3.text,e3.counter},27995:function(e,t,n){"use strict";let r,i;n.r(t),n.d(t,{BrowserCookieAuthStorageAdapter:function(){return tL},CookieAuthStorageAdapter:function(){return tD},DEFAULT_COOKIE_OPTIONS:function(){return tM},createSupabaseClient:function(){return tU},isBrowser:function(){return tF},parseCookies:function(){return tB},parseSupabaseCookie:function(){return tN},serializeCookie:function(){return tz},stringifySupabaseSession:function(){return t$}}),new TextEncoder;let o=new TextDecoder,s=e=>{let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n};var a,c,l,u,d,h,f,p,g,v,m,_,y,b,w,k,S,x,O,E=crypto;E.getRandomValues.bind(E),Symbol();let P=e=>{let t=e;t instanceof Uint8Array&&(t=o.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return s(t)}catch(e){throw TypeError("The input to be decoded is not correctly encoded.")}},C=e=>{let t;return e?t=e:"undefined"==typeof fetch?t=(...e)=>{var t,r,i,o;return t=void 0,r=void 0,i=void 0,o=function*(){return yield(yield Promise.resolve().then(n.t.bind(n,54098,23))).fetch(...e)}
1,new(i||(i=Promise))(function(e,n){function s(e){try{c(o.next(e))}catch(e){n(e)}}function a(e){try{c(o.throw(e))}catch(e){n(e)}}function c(t){var n;t.done?e(t.value):((n=t.value)instanceof i?n:new i(function(e){e(n)})).then(s,a)}c((o=o.apply(t,r||[])).next())})}:t=fetch,(...e)=>t(...e)};class I extends Error{constructor(e,t="FunctionsError",n){super(e),super.name=t,this.context=n}}class T extends I{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class A extends I{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class j extends I{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}class R{constructor(e,{headers:t={},customFetch:n}={}){this.url=e,this.headers=t,this.fetch=C(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var n,r,i,o,s;return r=this,i=void 0,o=void 0,s=function*(){try{let r;let{headers:i,method:o,body:s}=t,a={};s&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&("undefined"!=typeof Blob&&s instanceof Blob||s instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",r=s):"string"==typeof s?(a["Content-Type"]="text/plain",r=s):"undefined"!=typeof FormData&&s instanceof FormData?r=s:(a["Content-Type"]="application/json",r=JSON.stringify(s)));let c=yield this.fetch(`${this.url}/${e}`,{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:r}).catch(e=>{throw new T(e)}),l=c.headers.get("x-relay-error");if(l&&"true"===l)throw new A(c);if(!c.ok)throw new j(c);let u=(null!==(n=c.headers.get("Content-Type"))&&void 0!==n?n:"text/plain").split(";")[0].trim();return{data:"application/json"===u?yield c.json():"application/octet-stream"===u?yield c.blob():"multipart/form-data"===u?yield c.formData():yield c.text(),error:null}}catch(e){return{data:null,error:e}}},new(o||(o=Promise))(function(e,t){function n(e){try{c(s.next(e))}catch(e){t(e)}}function a(e){try{c(s.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):((r=t.value)instanceof o?r:new o(function(e){e(r)})).then(n,a)}c((s=s.apply(r,i||[])).next())})}}var N=n(54098),$=n.n(N);class F{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:"undefined"==typeof fetch?this.fetch=$():this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}then(e,t){void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),"GET"!==this.method&&"HEAD"!==this.method&&(this.headers["Content-Type"]="application/json");let n=(0,this.fetch)(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async e=>{var t,n,r;let i=null,o=null,s=null,a=e.status,c=e.statusText;if(e.ok){if("HEAD"!==this.method){let t=await e.text();""===t||(o="text/csv"===this.headers.Accept?t:this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?t:JSON.parse(t))}let r=null===(t=this.headers.Prefer)||void 0===t?void 0:t.match(/count=(exact|planned|estimated)/),l=null===(n=e.headers.get("content-range"))||void 0===n?void 0:n.split("/");r&&l&&l.length>1&&(s=parseInt(l[1])),this.isMaybeSingle&&"GET"===this.method&&Array.isArray(o)&&(o.length>1?(i={code:"PGRST116",details:`Results contain ${o.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},o=null,s=null,a=406,c="Not Acceptable"):o=1===o.length?o[0]:null)}else{let t=await e.text();try{i=JSON.parse(t),Array.isArray(i)&&404===e.status&&(o=[],i=null,a=200,c="OK")}catch(n){404===e.status&&""===t?(a=204,c="No Content"):i={message:t}}if(i&&this.isMaybeSingle&&(null===(r=null==i?void 0:i.details)||void 0===r?void 0:r.includes("Results contain 0 rows"))&&(i=null,a=200,c="OK"),i&&this.shouldThrowOnError)throw i}return{error:i,data:o,count:s,status:a,statusText:c}});return this.shouldThrowOnError||(n=n.catch(e=>{var t,n,r;return{error:{message:`${null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"FetchError"}: ${null==e?void 0:e.message}`,details:`${null!==(n=null==e?void 0:e.stack)&&void 0!==n?n:""}`,hint:"",code:`${null!==(r=null==e?void 0:e.code)&&void 0!==r?r:""}`},data:null,count:null,status:0,statusText:""}}
1)),n.then(e,t)}}class M extends F{select(e){let t=!1,n=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)).join("");return this.url.searchParams.set("select",n),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r}={}){let i=r?`${r}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${void 0===n?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t}={}){let n=void 0===t?"limit":`${t}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:n}={}){let r=void 0===n?"offset":`${n}.offset`,i=void 0===n?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this.url.searchParams.set(i,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return"GET"===this.method?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:o="text"}={}){let s=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,i?"wal":null].filter(Boolean).join("|"),a=this.headers.Accept;return this.headers.Accept=`application/vnd.pgrst.plan+${o}; for="${a}"; options=${s};`,this}rollback(){var e;return(null!==(e=this.headers.Prefer)&&void 0!==e?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}}class D extends M{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}in(e,t){let n=t.map(e=>"string"==typeof e&&RegExp("[,()]").test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}contains(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return"string"==typeof t?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:r}={}){let i="";"plain"===r?i="pl":"phrase"===r?i="ph":"websearch"===r&&(i="w");let o=void 0===n?"":`(${n})`;return this.url.searchParams.append(e,`${i}fts${o}.${t}`),this}match(e){return Object.entries(e).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t}={}){let n=t?`${t}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}}class L{constructor(e,{headers:t={},schema:n,fetch:r}){this.url=e,this.headers=t,this.schema=n,this.fetch=r}
1select(e,{head:t=!1,count:n}={}){let r=!1,i=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!r?"":('"'===e&&(r=!r),e)).join("");return this.url.searchParams.set("select",i),n&&(this.headers.Prefer=`count=${n}`),new D({method:t?"HEAD":"GET",url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:t,defaultToNull:n=!0}={}){let r=[];if(this.headers.Prefer&&r.push(this.headers.Prefer),t&&r.push(`count=${t}`),n||r.push("missing=default"),this.headers.Prefer=r.join(","),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);this.url.searchParams.set("columns",e.join(","))}}return new D({method:"POST",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){let o=[`resolution=${n?"ignore":"merge"}-duplicates`];if(void 0!==t&&this.url.searchParams.set("on_conflict",t),this.headers.Prefer&&o.push(this.headers.Prefer),r&&o.push(`count=${r}`),i||o.push("missing=default"),this.headers.Prefer=o.join(","),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);this.url.searchParams.set("columns",e.join(","))}}return new D({method:"POST",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:t}={}){let n=[];return this.headers.Prefer&&n.push(this.headers.Prefer),t&&n.push(`count=${t}`),this.headers.Prefer=n.join(","),new D({method:"PATCH",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){let t=[];return e&&t.push(`count=${e}`),this.headers.Prefer&&t.unshift(this.headers.Prefer),this.headers.Prefer=t.join(","),new D({method:"DELETE",url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}}let U={"X-Client-Info":"postgrest-js/1.7.2"};class B{constructor(e,{headers:t={},schema:n,fetch:r}={}){this.url=e,this.headers=Object.assign(Object.assign({},U),t),this.schema=n,this.fetch=r}from(e){return new L(new URL(`${this.url}/${e}`),{headers:Object.assign({},this.headers),schema:this.schema,fetch:this.fetch})}rpc(e,t={},{head:n=!1,count:r}={}){let i,o;let s=new URL(`${this.url}/rpc/${e}`);n?(i="HEAD",Object.entries(t).forEach(([e,t])=>{s.searchParams.append(e,`${t}`)})):(i="POST",o=t);let a=Object.assign({},this.headers);return r&&(a.Prefer=`count=${r}`),new D({method:i,url:s,headers:a,schema:this.schema,body:o,fetch:this.fetch,allowEmpty:!1})}}var z=n(45840);let q={"X-Client-Info":"realtime-js/2.7.3"};(a=v||(v={}))[a.connecting=0]="connecting",a[a.open=1]="open",a[a.closing=2]="closing",a[a.closed=3]="closed",(c=m||(m={})).closed="closed",c.errored="errored",c.joined="joined",c.joining="joining",c.leaving="leaving",(l=_||(_={})).close="phx_close",l.error="phx_error",l.join="phx_join",l.reply="phx_reply",l.leave="phx_leave",l.access_token="access_token",(y||(y={})).websocket="websocket",(u=b||(b={})).Connecting="connecting",u.Open="open",u.Closing="closing",u.Closed="closed";class V{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}class J{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):"string"==typeof e?t(JSON.parse(e)):t({})}_binaryDecode(e){let t=new DataView(e),n=new TextDecoder;return this._decodeBroadcast(e,t,n)}_decodeBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),o=this.HEADER_LENGTH+2,s=n.decode(e.slice(o,o+r));o+=r;let a=n.decode(e.slice(o,o+i));return o+=i,{ref:null,topic:s,event:a,payload:JSON.parse(n.decode(e.slice(o,e.byteLength)))}}}class H{constructor(e,t,n={},r=1e4){this.channel=e,this.event=t,this.payload=n,this.timeout=r,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHo
1oks=[],this.refEvent=null,this.rateLimited=!1}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,"rate limited"!==this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()})||(this.rateLimited=!0))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var n;return this._hasReceived(e)&&t(null===(n=this.receivedResp)||void 0===n?void 0:n.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){this.timeoutTimer||(this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref),this.channel._on(this.refEvent,{},e=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=e,this._matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout))}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}(d=w||(w={})).SYNC="sync",d.JOIN="join",d.LEAVE="leave";class G{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};let n=(null==t?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},e=>{let{onJoin:t,onLeave:n,onSync:r}=this.caller;this.joinRef=this.channel._joinRef(),this.state=G.syncState(this.state,e,t,n),this.pendingDiffs.forEach(e=>{this.state=G.syncDiff(this.state,e,t,n)}),this.pendingDiffs=[],r()}),this.channel._on(n.diff,{},e=>{let{onJoin:t,onLeave:n,onSync:r}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(e):(this.state=G.syncDiff(this.state,e,t,n),r())}),this.onJoin((e,t,n)=>{this.channel._trigger("presence",{event:"join",key:e,currentPresences:t,newPresences:n})}),this.onLeave((e,t,n)=>{this.channel._trigger("presence",{event:"leave",key:e,currentPresences:t,leftPresences:n})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,n,r){let i=this.cloneDeep(e),o=this.transformState(t),s={},a={};return this.map(i,(e,t)=>{o[e]||(a[e]=t)}),this.map(o,(e,t)=>{let n=i[e];if(n){let r=t.map(e=>e.presence_ref),i=n.map(e=>e.presence_ref),o=t.filter(e=>0>i.indexOf(e.presence_ref)),c=n.filter(e=>0>r.indexOf(e.presence_ref));o.length>0&&(s[e]=o),c.length>0&&(a[e]=c)}else s[e]=t}),this.syncDiff(i,{joins:s,leaves:a},n,r)}static syncDiff(e,t,n,r){let{joins:i,leaves:o}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return n||(n=()=>{}),r||(r=()=>{}),this.map(i,(t,r)=>{var i;let o=null!==(i=e[t])&&void 0!==i?i:[];if(e[t]=this.cloneDeep(r),o.length>0){let n=e[t].map(e=>e.presence_ref),r=o.filter(e=>0>n.indexOf(e.presence_ref));e[t].unshift(...r)}n(t,o,r)}),this.map(o,(t,n)=>{let i=e[t];if(!i)return;let o=n.map(e=>e.presence_ref);i=i.filter(e=>0>o.indexOf(e.presence_ref)),e[t]=i,r(t,i,n),0===i.length&&delete e[t]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(n=>t(n,e[n]))}static transformState(e){return Object.getOwnPropertyNames(e=this.cloneDeep(e)).reduce((t,n)=>{let r=e[n];return"metas"in r?t[n]=r.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e)):t[n]=r,t},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}(h=k||(k={})).abstime="abstime",h.bool="bool",h.date="date",h.daterange="daterange",h.float4="float4",h.float8="float8",h.int2="int2",h.int4="int4",h.int4range="int4range",h.int8="int8",h.int8range="int8range",h.json="json",h.jsonb="jsonb",h.money="money",h.numeric="numeric",h.oid="oid",h.reltime="reltime",h.text="text",h.time="time",h.timestamp="timestamp",h.timestamptz="timestamptz",h.timetz="timetz",h.tsrange="tsrange",h.tstzrange="tstzrange";let Y=(e,t,n={})=>{var r;let i=null!==(r=n.skipTypes)&&void 0!==r?r:[];return Object.keys(t).reduce((n,r)=>(n[r]=X(r,e,t,i),n),{})},X=(e,t,n,r)=>{let i=t.find(t=>t.name===e),o=null==i?void 0:i.type,s=n[e];return o&&!r.includes(o)?K(o,s):W(s)},K=(e,t)=>
1{if("_"===e.charAt(0))return et(t,e.slice(1,e.length));switch(e){case k.bool:return Z(t);case k.float4:case k.float8:case k.int2:case k.int4:case k.int8:case k.numeric:case k.oid:return Q(t);case k.json:case k.jsonb:return ee(t);case k.timestamp:return en(t);case k.abstime:case k.date:case k.daterange:case k.int4range:case k.int8range:case k.money:case k.reltime:case k.text:case k.time:case k.timestamptz:case k.timetz:case k.tsrange:case k.tstzrange:default:return W(t)}},W=e=>e,Z=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},Q=e=>{if("string"==typeof e){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},ee=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){console.log(`JSON parse error: ${e}`)}return e},et=(e,t)=>{if("string"!=typeof e)return e;let n=e.length-1,r=e[n];if("{"===e[0]&&"}"===r){let r;let i=e.slice(1,n);try{r=JSON.parse("["+i+"]")}catch(e){r=i?i.split(","):[]}return r.map(e=>K(t,e))}return e},en=e=>"string"==typeof e?e.replace(" ","T"):e;var er=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})};(f=S||(S={})).ALL="*",f.INSERT="INSERT",f.UPDATE="UPDATE",f.DELETE="DELETE",(p=x||(x={})).BROADCAST="broadcast",p.PRESENCE="presence",p.POSTGRES_CHANGES="postgres_changes",(g=O||(O={})).SUBSCRIBED="SUBSCRIBED",g.TIMED_OUT="TIMED_OUT",g.CLOSED="CLOSED",g.CHANNEL_ERROR="CHANNEL_ERROR";class ei{constructor(e,t={config:{}},n){this.topic=e,this.params=t,this.socket=n,this.bindings={},this.state=m.closed,this.joinedOnce=!1,this.pushBuffer=[],this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""}},t.config),this.timeout=this.socket.timeout,this.joinPush=new H(this,_.join,this.params,this.timeout),this.rejoinTimer=new V(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=m.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=m.closed,this.socket._remove(this)}),this._onError(e=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,e),this.state=m.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=m.errored,this.rejoinTimer.scheduleTimeout())}),this._on(_.reply,{},(e,t)=>{this._trigger(this._replyEventName(t),e)}),this.presence=new G(this)}subscribe(e,t=this.timeout){var n,r;if(this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{let{config:{broadcast:i,presence:o}}=this.params;this._onError(t=>e&&e("CHANNEL_ERROR",t)),this._onClose(()=>e&&e("CLOSED"));let s={},a={broadcast:i,presence:o,postgres_changes:null!==(r=null===(n=this.bindings.postgres_changes)||void 0===n?void 0:n.map(e=>e.filter))&&void 0!==r?r:[]};this.socket.accessToken&&(s.access_token=this.socket.accessToken),this.updateJoinPayload(Object.assign({config:a},s)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",({postgres_changes:t})=>{var n;if(this.socket.accessToken&&this.socket.setAuth(this.socket.accessToken),void 0===t){e&&e("SUBSCRIBED");return}{let r=this.bindings.postgres_changes,i=null!==(n=null==r?void 0:r.length)&&void 0!==n?n:0,o=[];for(let n=0;n<i;n++){let i=r[n],{filter:{event:s,schema:a,table:c,filter:l}}=i,u=t&&t[n];if(u&&u.event===s&&u.schema===a&&u.table===c&&u.filter===l)o.push(Object.assign(Object.assign({},i),{id:u.id}));else{this.unsubscribe(),e&&e("CHANNEL_ERROR",Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,e&&e("SUBSCRIBED");return}}).receive("error",t=>{e&&e("CHANNEL_ERROR",Error(JSON.stringify(Object.values(t).join(", ")||"error")))}).receive("timeout",()=>{e&&e("TIMED_OUT")})}return this}presenceState(){return this.presence.state}track(e,t={}){return er(this,void 0,void 0,function*(){return yield this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)})}untrack(e={}){return er(this,void 0,void 0,function*(){return yield this.send({type:"presence",event:"untrack"},e)})}on(e,t,n){return this._on(e,t,n)}send(e,t={}){return new Promise(n=>{var r,i,o;let s=this._push(e.type,e,t.timeout||this.timeout);s.rateLimited&&n("rate limited"),"broadcast"!==e.type||(null===(o=null===(i=null===(r=this.params)||void 0===r?void 0:r.config)||void 0===i?void 0:i.broadcast)||void 0===o?void 0:o.ack)||n("ok"),s.receive("ok",()=>n("ok")),s.receive("timeout",()=>n("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=m.leaving;let t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(_.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(n=>{let r=new H(this,_.leave,{},e);r.receive("ok",()=>{t(),n("ok")}).receive("timeout",()=>{t(),n("timed out")}).receive("error",()=>{n("error")}),r.send(),this._canPush()||r.trigger("ok",{})})}_push(e,t,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let r=new H(this,e,t,n);return this._canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}_onMessage(e,t,n){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,n){var r,i;let o=e.toLocaleLowerCase(),{close:s,error:a,leave:c,join:l}=_;if(n&&[s,a,c,l].indexOf(o)>=0&&n!==this._joinRef())return;let u=this._onMessage(o,t,n);if(t&&!u)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?null===(r=this.bindings.postgres_changes)||void 0===r||r.filter(e=>{var t,n,r;return(null===(t=e.filter)||void 0===t?void 0:t.event)==="*"||(null===(r=null===(n=e.filter)||void 0===n?void 0:n.event)||void 0===r?void 0:r.toLocaleLowerCase())===o}).map(e=>e.callback(u,n)):null===(i=this.bindings[o])||void 0===i||i.filter(e=>{var n,r,i,s,a,c;if(!["broadcast","presence","postgres_changes"].includes(o))return e.type.toLocaleLowerCase()===o;if("id"in e){let o=e.id,s=null===(n=e.filter)||void 0===n?void 0:n.event;return o&&(null===(r=t.ids)||void 0===r?void 0:r.includes(o))&&("*"===s||(null==s?void 0:s.toLocaleLowerCase())===(null===(i=t.data)||void 0===i?void 0:i.type.toLocaleLowerCase()))}{let n=null===(a=null===(s=null==e?void 0:e.filter)||void 0===s?void 0:s.event)||void 0===a?void 0:a.toLocaleLowerCase();return"*"===n||n===(null===(c=null==t?void 0:t.event)||void 0===c?void 0:c.toLocaleLowerCase())}}).map(e=>{if("object"==typeof u&&"ids"in u){let e=u.data,{schema:t,table:n,commit_timestamp:r,type:i,errors:o}=e;u=Object.assign(Object.assign({},{schema:t,table:n,commit_timestamp:r,eventType:i,new:{},old:{},errors:o}),this._getPayloadRecords(e))}e.callback(u,n)})}_isClosed(){return this.state===m.closed}_isJoined(){return this.state===m.joined}_isJoining(){return this.state===m.joining}_isLeaving(){return this.state===m.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,n){let r=e.toLocaleLowerCase(),i={type:r,filter:t,callback:n};return this.bindings[r]?this.bindings[r].push(i):this.bindings[r]=[i],this}_off(e,t){let n=e.toLocaleLowerCase();return this.bindings[n]=this.bindings[n].filter(e=>{var r;return!((null===(r=e.type)||void 0===r?void 0:r.toLocaleLowerCase())===n&&ei.isEqual(e.filter,t))}),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(_.close,{},e)}_onError(e){this._on(_.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=m.joining,this.joinPush.resend(e))}_getPayloadRecords(e){let t={new:{},old:{}};return("INSERT"===e.type||"UPDATE"===e.type)&&(t.new=Y(e.columns,e.record)),("UPDATE"===e.type||"DELET
1E"===e.type)&&(t.old=Y(e.columns,e.old_record)),t}}var eo=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})};let es=()=>{};class ea{constructor(e,t){var n;this.accessToken=null,this.channels=[],this.endPoint="",this.headers=q,this.params={},this.timeout=1e4,this.transport=z.w3cwebsocket,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=es,this.conn=null,this.sendBuffer=[],this.serializer=new J,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.eventsPerSecondLimitMs=100,this.inThrottle=!1,this.endPoint=`${e}/${y.websocket}`,(null==t?void 0:t.params)&&(this.params=t.params),(null==t?void 0:t.headers)&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),(null==t?void 0:t.timeout)&&(this.timeout=t.timeout),(null==t?void 0:t.logger)&&(this.logger=t.logger),(null==t?void 0:t.transport)&&(this.transport=t.transport),(null==t?void 0:t.heartbeatIntervalMs)&&(this.heartbeatIntervalMs=t.heartbeatIntervalMs);let r=null===(n=null==t?void 0:t.params)||void 0===n?void 0:n.eventsPerSecond;r&&(this.eventsPerSecondLimitMs=Math.floor(1e3/r)),this.reconnectAfterMs=(null==t?void 0:t.reconnectAfterMs)?t.reconnectAfterMs:e=>[1e3,2e3,5e3,1e4][e-1]||1e4,this.encode=(null==t?void 0:t.encode)?t.encode:(e,t)=>t(JSON.stringify(e)),this.decode=(null==t?void 0:t.decode)?t.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new V(()=>eo(this,void 0,void 0,function*(){this.disconnect(),this.connect()}),this.reconnectAfterMs)}connect(){!this.conn&&(this.conn=new this.transport(this._endPointURL(),[],null,this.headers),this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e)))}disconnect(e,t){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,null!=t?t:""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}removeChannel(e){return eo(this,void 0,void 0,function*(){let t=yield e.unsubscribe();return 0===this.channels.length&&this.disconnect(),t})}removeAllChannels(){return eo(this,void 0,void 0,function*(){let e=yield Promise.all(this.channels.map(e=>e.unsubscribe()));return this.disconnect(),e})}log(e,t,n){this.logger(e,t,n)}connectionState(){switch(this.conn&&this.conn.readyState){case v.connecting:return b.Connecting;case v.open:return b.Open;case v.closing:return b.Closing;default:return b.Closed}}isConnected(){return this.connectionState()===b.Open}channel(e,t={config:{}}){this.isConnected()||this.connect();let n=new ei(`realtime:${e}`,t,this);return this.channels.push(n),n}push(e){let{topic:t,event:n,payload:r,ref:i}=e,o=()=>{this.encode(e,e=>{var t;null===(t=this.conn)||void 0===t||t.send(e)})};if(this.log("push",`${t} ${n} (${i})`,r),this.isConnected()){if(["broadcast","presence","postgres_changes"].includes(n)){if(this._throttle(o)())return"rate limited"}else o()}else this.sendBuffer.push(o)}setAuth(e){this.accessToken=e,this.channels.forEach(t=>{e&&t.updateJoinPayload({access_token:e}),t.joinedOnce&&t._isJoined()&&t._push(_.access_token,{access_token:e})})}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t._isJoined()||t._isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter(t=>t._joinRef()!==e._joinRef())}_endPointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:"1.0.0"}))}_onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:n,payload:r,ref:i}=e;(i&&i===this.pendingHeartbeatRef||n===(null==r?void 0:r.type))&&(this.pendingHeartbeatRef=null),this.log("receive",`${r.status||""} ${t} ${n} ${i&&"("+i+")"||""}`,r),this.channels.filter(e=>
1e._isMember(t)).forEach(e=>e._trigger(n,r,i)),this.stateChangeCallbacks.message.forEach(t=>t(e))})}_onConnOpen(){this.log("transport",`connected to ${this._endPointURL()}`),this._flushSendBuffer(),this.reconnectTimer.reset(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this._sendHeartbeat(),this.heartbeatIntervalMs),this.stateChangeCallbacks.open.forEach(e=>e())}_onConnClose(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(t=>t(e))}_onConnError(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(t=>t(e))}_triggerChanError(){this.channels.forEach(e=>e._trigger(_.error))}_appendParams(e,t){if(0===Object.keys(t).length)return e;let n=e.match(/\?/)?"&":"?",r=new URLSearchParams(t);return`${e}${n}${r}`}_flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),null===(e=this.conn)||void 0===e||e.close(1e3,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth(this.accessToken)}}_throttle(e,t=this.eventsPerSecondLimitMs){return()=>!!this.inThrottle||(e(),t>0&&(this.inThrottle=!0,setTimeout(()=>{this.inThrottle=!1},t)),!1)}}class ec extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function el(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}class eu extends ec{constructor(e,t){super(e),this.name="StorageApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class ed extends ec{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}var eh=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})};let ef=e=>{let t;return e?t=e:"undefined"==typeof fetch?t=(...e)=>eh(void 0,void 0,void 0,function*(){return yield(yield Promise.resolve().then(n.t.bind(n,54098,23))).fetch(...e)}):t=fetch,(...e)=>t(...e)},ep=()=>eh(void 0,void 0,void 0,function*(){return"undefined"==typeof Response?(yield Promise.resolve().then(n.t.bind(n,54098,23))).Response:Response});var eg=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})};let ev=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),em=(e,t)=>eg(void 0,void 0,void 0,function*(){e instanceof(yield ep())?e.json().then(n=>{t(new eu(ev(n),e.status||500))}).catch(e=>{t(new ed(ev(e),e))}):t(new ed(ev(e),e))}),e_=(e,t,n,r)=>{let i={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?i:(i.headers=Object.assign({"Content-Type":"application/json"},null==t?void 0:t.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};function ey(e,t,n,r,i,o){return eg(this,void 0,void 0,function*(){return new Promise((s,a)=>{e(n,e_(t,r,i,o)).then(e=>{if(!e.ok)throw e;return(null==r?void 0:r.noResolveJson)?e:e.json()}).then(e=>s(e)).catch(e=>em(e,a))})})}function eb(e,t,n,r){return eg(this,void 0,void 0,function*(){return ey(e,"GET",t,n,r)})}function ew(e,t,n,r,i){return eg(this,void 0,void 0,function*(){return ey(e,"POST",t,r,i,n)})}function ek(e,t,n,r,i){return eg(this,void 0,void 0,function*(){return ey(e,"DELETE",t,r,i,n)})}var eS=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})};let ex={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},eO={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class eE{constructor(e,t={},n,r){this.url=e,this.headers=t,this.bucketId=n,this.fetch=ef(r)}uploadOrUpdate(e,t,n,r){return eS(this,void 0,void 0,function*(){try{let i;let o=Object.assign(Object.assign({},eO),r),s=Object.assign(Object.assign({},this.headers),"POST"===e&&{"x-upsert":String(o.upsert)});"undefined"!=typeof Blob&&n instanceof Blob?((i=new FormData).append("cacheControl",o.cacheControl),i.append("",n)):"undefined"!=typeof FormData&&n instanceof FormData?(i=n).append("cacheControl",o.cacheControl):(i=n,s["cache-control"]=`max-age=${o.cacheControl}`,s["content-type"]=o.contentType);let a=this._removeEmptyFolders(t),c=this._getFinalPath(a),l=yield this.fetch(`${this.url}/object/${c}`,Object.assign({method:e,body:i,headers:s},(null==o?void 0:o.duplex)?{duplex:o.duplex}:{}));if(l.ok)return{data:{path:a},error:null};{let e=yield l.json();return{data:null,error:e}}}catch(e){if(el(e))return{data:null,error:e};throw e}})}upload(e,t,n){return eS(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,n)})}uploadToSignedUrl(e,t,n,r){return eS(this,void 0,void 0,function*(){let i=this._removeEmptyFolders(e),o=this._getFinalPath(i),s=new URL(this.url+`/object/upload/sign/${o}`);s.searchParams.set("token",t);try{let e;let t=Object.assign({upsert:eO.upsert},r),o=Object.assign(Object.assign({},this.headers),{"x-upsert":String(t.upsert)});"undefined"!=typeof Blob&&n instanceof Blob?((e=new FormData).append("cacheControl",t.cacheControl),e.append("",n)):"undefined"!=typeof FormData&&n instanceof FormData?(e=n).append("cacheControl",t.cacheControl):(e=n,o["cache-control"]=`max-age=${t.cacheControl}`,o["content-type"]=t.contentType);let a=yield this.fetch(s.toString(),{method:"PUT",body:e,headers:o});if(a.ok)return{data:{path:i},error:null};{let e=yield a.json();return{data:null,error:e}}}catch(e){if(el(e))return{data:null,error:e};throw e}})}createSignedUploadUrl(e){return eS(this,void 0,void 0,function*(){try{let t=this._getFinalPath(e),n=yield ew(this.fetch,`${this.url}/object/upload/sign/${t}`,{},{headers:this.headers}
1),r=new URL(this.url+n.url),i=r.searchParams.get("token");if(!i)throw new ec("No token returned by API");return{data:{signedUrl:r.toString(),path:e,token:i},error:null}}catch(e){if(el(e))return{data:null,error:e};throw e}})}update(e,t,n){return eS(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,n)})}move(e,t){return eS(this,void 0,void 0,function*(){try{return{data:yield ew(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers}),error:null}}catch(e){if(el(e))return{data:null,error:e};throw e}})}copy(e,t){return eS(this,void 0,void 0,function*(){try{return{data:{path:(yield ew(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers})).Key},error:null}}catch(e){if(el(e))return{data:null,error:e};throw e}})}createSignedUrl(e,t,n){return eS(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e),i=yield ew(this.fetch,`${this.url}/object/sign/${r}`,Object.assign({expiresIn:t},(null==n?void 0:n.transform)?{transform:n.transform}:{}),{headers:this.headers}),o=(null==n?void 0:n.download)?`&download=${!0===n.download?"":n.download}`:"";return{data:i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},error:null}}catch(e){if(el(e))return{data:null,error:e};throw e}})}createSignedUrls(e,t,n){return eS(this,void 0,void 0,function*(){try{let r=yield ew(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),i=(null==n?void 0:n.download)?`&download=${!0===n.download?"":n.download}`:"";return{data:r.map(e=>Object.assign(Object.assign({},e),{signedUrl:e.signedURL?encodeURI(`${this.url}${e.signedURL}${i}`):null})),error:null}}catch(e){if(el(e))return{data:null,error:e};throw e}})}download(e,t){return eS(this,void 0,void 0,function*(){let n=void 0!==(null==t?void 0:t.transform),r=this.transformOptsToQueryString((null==t?void 0:t.transform)||{}),i=r?`?${r}`:"";try{let t=this._getFinalPath(e),r=yield eb(this.fetch,`${this.url}/${n?"render/image/authenticated":"object"}/${t}${i}`,{headers:this.headers,noResolveJson:!0});return{data:yield r.blob(),error:null}}catch(e){if(el(e))return{data:null,error:e};throw e}})}getPublicUrl(e,t){let n=this._getFinalPath(e),r=[],i=(null==t?void 0:t.download)?`download=${!0===t.download?"":t.download}`:"";""!==i&&r.push(i);let o=void 0!==(null==t?void 0:t.transform),s=this.transformOptsToQueryString((null==t?void 0:t.transform)||{});""!==s&&r.push(s);let a=r.join("&");return""!==a&&(a=`?${a}`),{data:{publicUrl:encodeURI(`${this.url}/${o?"render/image":"object"}/public/${n}${a}`)}}}remove(e){return eS(this,void 0,void 0,function*(){try{return{data:yield ek(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(e){if(el(e))return{data:null,error:e};throw e}})}list(e,t,n){return eS(this,void 0,void 0,function*(){try{let r=Object.assign(Object.assign(Object.assign({},ex),t),{prefix:e||""});return{data:yield ew(this.fetch,`${this.url}/object/list/${this.bucketId}`,r,{headers:this.headers},n),error:null}}catch(e){if(el(e))return{data:null,error:e};throw e}})}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}}let eP={"X-Client-Info":"storage-js/2.5.1"};var eC=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})};class eI{constructor(e,t={},n){this.url=e,this.headers=Object.assign(Object.assign({},eP),t),this.fetch=ef(n)}listBuckets(){return eC(this,void 0,void 0,function*(){try{return{data:yield eb(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(el(e))return{data:null,error:e};throw e}})}getBucket(e){return eC(this,void 0,void 0,function*(){try{return{data:yield eb(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(e){if(el(e))return{data:null,error:e};throw e}})}createBucket(e,t={public:!1}){return eC(this,void 0,void 0,function*(){try{return{data:yield ew(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(e){if(el(e))return{data:null,error:e};throw e}})}updateBucket(e,t){return eC(this,void 0,void 0,function*(){try{return{data:yield function(e,t,n,r,i){return eg(this,void 0,void 0,function*(){return ey(e,"PUT",t,r,void 0,n)})}(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(e){if(el(e))return{data:null,error:e};throw e}})}emptyBucket(e){return eC(this,void 0,void 0,function*(){try{return{data:yield ew(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(e){if(el(e))return{data:null,error:e};throw e}})}deleteBucket(e){return eC(this,void 0,void 0,function*(){try{return{data:yield ek(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(e){if(el(e))return{data:null,error:e};throw e}})}}class eT extends eI{constructor(e,t={},n){super(e,t,n)}from(e){return new eE(this.url,this.headers,e,this.fetch)}}let eA=e=>{let t;return e?t=e:"undefined"==typeof fetch?t=$():t=fetch,(...e)=>t(...e)},ej=()=>"undefined"==typeof Headers?N.Headers:Headers,eR=(e,t,n)=>{let r=eA(n),i=ej();return(n,o)=>{var s,a,c,l;return s=void 0,a=void 0,c=void 0,l=function*(){var s;let a=null!==(s=yield t())&&void 0!==s?s:e,c=new i(null==o?void 0:o.headers);return c.has("apikey")||c.set("apikey",e),c.has("Authorization")||c.set("Authorization",`Bearer ${a}`),r(n,Object.assign(Object.assign({},o),{headers:c}))},new(c||(c=Promise))(function(e,t){function n(e){try{i(l.next(e))}catch(e){t(e)}}function r(e){try{i(l.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):((i=t.value)instanceof c?i:new c(function(e){e(i)})).then(n,r)}i((l=l.apply(s,a||[])).next())})}};
1var eN=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})};let e$=()=>"undefined"!=typeof document,eF={tested:!1,writable:!1},eM=()=>{if(!e$())return!1;try{if("object"!=typeof globalThis.localStorage)return!1}catch(e){return!1}if(eF.tested)return eF.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),eF.tested=!0,eF.writable=!0}catch(e){eF.tested=!0,eF.writable=!1}return eF.writable};function eD(e,t){var n;t||(t=(null===(n=null==window?void 0:window.location)||void 0===n?void 0:n.href)||"");let r=RegExp("[?&#]"+(e=e.replace(/[\[\]]/g,"\\$&"))+"(=([^&#]*)|&|#|$)").exec(t);return r?r[2]?decodeURIComponent(r[2].replace(/\+/g," ")):"":null}let eL=e=>{let t;return e?t=e:"undefined"==typeof fetch?t=(...e)=>eN(void 0,void 0,void 0,function*(){return yield(yield Promise.resolve().then(n.t.bind(n,54098,23))).fetch(...e)}):t=fetch,(...e)=>t(...e)},eU=e=>"object"==typeof e&&null!==e&&"status"in e&&"ok"in e&&"json"in e&&"function"==typeof e.json,eB=(e,t,n)=>eN(void 0,void 0,void 0,function*(){yield e.setItem(t,JSON.stringify(n))}),ez=(e,t)=>eN(void 0,void 0,void 0,function*(){let n=yield e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch(e){return n}}),eq=(e,t)=>eN(void 0,void 0,void 0,function*(){yield e.removeItem(t)});class eV{constructor(){this.promise=new eV.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}function eJ(e){let t=e.split(".");if(3!==t.length)throw Error("JWT is not valid: not a JWT structure");if(!/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i.test(t[1]))throw Error("JWT is not valid: payload is not in base64url format");return JSON.parse(function(e){let t,n,r,i,o,s,a;let c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",u=0;for(e=e.replace("-","+").replace("_","/");u<e.length;)i=c.indexOf(e.charAt(u++)),o=c.indexOf(e.charAt(u++)),s=c.indexOf(e.charAt(u++)),a=c.indexOf(e.charAt(u++)),t=i<<2|o>>4,n=(15&o)<<4|s>>2,r=(3&s)<<6|a,l+=String.fromCharCode(t),64!=s&&0!=n&&(l+=String.fromCharCode(n)),64!=a&&0!=r&&(l+=String.fromCharCode(r));return l}(t[1]))}function eH(e){return("0"+e.toString(16)).substr(-2)}function eG(){let e=new Uint32Array(56);if("undefined"==typeof crypto){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",t=e.length,n="";for(let r=0;r<56;r++)n+=e.charAt(Math.floor(Math.random()*t));return n}return crypto.getRandomValues(e),Array.from(e,eH).join("")}function eY(e){return eN(this,void 0,void 0,function*(){return"undefined"==typeof crypto?(console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e):btoa((yield function(e){return eN(this,void 0,void 0,function*(){let t=new TextEncoder().encode(e);return Array.from(new Uint8Array((yield crypto.subtle.digest("SHA-256",t)))).map(e=>String.fromCharCode(e)).join("")})}(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")})}eV.promiseConstructor=Promise;class eX extends Error{constructor(e,t){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t}}function eK(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class eW extends eX{constructor(e,t){super(e,t),this.name="AuthApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class eZ extends eX{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class eQ extends eX{constructor(e,t,n){super(e),this.name=t,this.status=n}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class e0 extends eQ{constructor(){super("Auth session missing!","AuthSessionMissingError",400)}}class e1 extends eQ{constructor(){super("Auth session or user missing","AuthInvalidToken
1ResponseError",500)}}class e2 extends eQ{constructor(e){super(e,"AuthInvalidCredentialsError",400)}}class e5 extends eQ{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class e3 extends eQ{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class e6 extends eQ{constructor(e,t){super(e,"AuthRetryableFetchError",t)}}function e4(e){return eK(e)&&"AuthRetryableFetchError"===e.name}var e9=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})},e8=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};let e7=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),te=[502,503,504];function tt(e){return e9(this,void 0,void 0,function*(){let t;if(!eU(e))throw new e6(e7(e),0);if(te.includes(e.status))throw new e6(e7(e),e.status);try{t=yield e.json()}catch(e){throw new eZ(e7(e),e)}throw new eW(e7(t),e.status||500)})}let tn=(e,t,n,r)=>{let i={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==t?void 0:t.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};function tr(e,t,n,r){var i;return e9(this,void 0,void 0,function*(){let o=Object.assign({},null==r?void 0:r.headers);(null==r?void 0:r.jwt)&&(o.Authorization=`Bearer ${r.jwt}`);let s=null!==(i=null==r?void 0:r.query)&&void 0!==i?i:{};(null==r?void 0:r.redirectTo)&&(s.redirect_to=r.redirectTo);let a=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",c=yield function(e,t,n,r,i,o){return e9(this,void 0,void 0,function*(){let s;let a=tn(t,r,i,o);try{s=yield e(n,a)}catch(e){throw console.error(e),new e6(e7(e),0)}if(s.ok||(yield tt(s)),null==r?void 0:r.noResolveJson)return s;try{return yield s.json()}catch(e){yield tt(e)}})}(e,t,n+a,{headers:o,noResolveJson:null==r?void 0:r.noResolveJson},{},null==r?void 0:r.body);return(null==r?void 0:r.xform)?null==r?void 0:r.xform(c):{data:Object.assign({},c),error:null}})}function ti(e){var t,n;let r=null;return e.access_token&&e.refresh_token&&e.expires_in&&((r=Object.assign({},e)).expires_at=(n=e.expires_in,Math.round(Date.now()/1e3)+n)),{data:{session:r,user:null!==(t=e.user)&&void 0!==t?t:e},error:null}}function to(e){var t;return{data:{user:null!==(t=e.user)&&void 0!==t?t:e},error:null}}function ts(e){return{data:e,error:null}}function ta(e){let{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:o}=e;return{data:{properties:{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:o},user:Object.assign({},e8(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]))},error:null}}function tc(e){return e}var tl=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})},tu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};class td{constructor({url:e="",headers:t={},fetch:n}){this.url=e,this.headers=t,this.fetch=eL(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}signOut(e,t="global"){return tl(this,void 0,void 0,function*(){try{return yield tr(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(eK(e))return{data:null,error:e};throw e}})}inviteUserByEmail(e,t={}){return tl(this,void 0,void 0,function*(){try{return yield tr(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:to})}catch(e){if(eK(e))return{data:{user:null},error:e};throw e}})}generateLink(e){return tl(this,void 0,void 0,function*(){try{let{options:t}=e,n=tu(e,["options"]),r=Object.assign(Object.assign({},n),t);return"newEmail"in n&&(r.new_email=null==n?void 0:n.newEmail,delete r.newEmail),yield tr(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:r,headers:this.headers,xform:ta,redirectTo:null==t?void 0:t.redirectTo})}catch(e){if(eK(e))return{data:{properties:null,user:null},error:e};throw e}})}createUser(e){return tl(this,void 0,void 0,function*(){try{return yield tr(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:to})}catch(e){if(eK(e))return{data:{user:null},error:e};throw e}})}listUsers(e){var t,n,r,i,o,s,a;return tl(this,void 0,void 0,function*(){try{let c={nextPage:null,lastPage:0,total:0},l=yield tr(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:null!==(n=null===(t=null==e?void 0:e.page)||void 0===t?void 0:t.toString())&&void 0!==n?n:"",per_page:null!==(i=null===(r=null==e?void 0:e.perPage)||void 0===r?void 0:r.toString())&&void 0!==i?i:""},xform:tc});if(l.error)throw l.error;let u=yield l.json(),d=null!==(o=l.headers.get("x-total-count"))&&void 0!==o?o:0,h=null!==(a=null===(s=l.headers.get("link"))||void 0===s?void 0:s.split(","))&&void 0!==a?a:[];return h.length>
10&&(h.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),n=JSON.parse(e.split(";")[1].split("=")[1]);c[`${n}Page`]=t}),c.total=parseInt(d)),{data:Object.assign(Object.assign({},u),c),error:null}}catch(e){if(eK(e))return{data:{users:[]},error:e};throw e}})}getUserById(e){return tl(this,void 0,void 0,function*(){try{return yield tr(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:to})}catch(e){if(eK(e))return{data:{user:null},error:e};throw e}})}updateUserById(e,t){return tl(this,void 0,void 0,function*(){try{return yield tr(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:to})}catch(e){if(eK(e))return{data:{user:null},error:e};throw e}})}deleteUser(e,t=!1){return tl(this,void 0,void 0,function*(){try{return yield tr(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:to})}catch(e){if(eK(e))return{data:{user:null},error:e};throw e}})}_listFactors(e){return tl(this,void 0,void 0,function*(){try{let{data:t,error:n}=yield tr(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:n}}catch(e){if(eK(e))return{data:null,error:e};throw e}})}_deleteFactor(e){return tl(this,void 0,void 0,function*(){try{return{data:yield tr(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(eK(e))return{data:null,error:e};throw e}})}}var th={getItem:e=>eM()?globalThis.localStorage.getItem(e):null,setItem:(e,t)=>{eM()&&globalThis.localStorage.setItem(e,t)},removeItem:e=>{eM()&&globalThis.localStorage.removeItem(e)}},tf=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((r=r.apply(e,t||[])).next())})};!function(){if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(e){"undefined"!=typeof self&&(self.globalThis=self)}}();let tp={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:{"X-Client-Info":"gotrue-js/2.39.1"},flowType:"implicit",debug:!1};class tg{constructor(e){var t;this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.broadcastChannel=null,this.instanceID=tg.nextInstanceID,tg.nextInstanceID+=1,this.instanceID>0&&e$()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let n=Object.assign(Object.assign({},tp),e);if(this.logDebugMessages=n.debug,this.inMemorySession=null,this.storageKey=n.storageKey,this.autoRefreshToken=n.autoRefreshToken,this.persistSession=n.persistSession,this.storage=n.storage||th,this.admin=new td({url:n.url,headers:n.headers,fetch:n.fetch}),this.url=n.url,this.headers=n.headers,this.fetch=eL(n.fetch),this.detectSessionInUrl=n.detectSessionInUrl,this.flowType=n.flowType,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession&&this.storage===th&&!eM()&&console.warn(`No storage option exists to persist the session, which may result in unexpected behavior when using auth. 2 If you want to set persistSession to true, please provide a storage option or you may set persistSession to false to disable this warning.`),e$()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",e)}null===(t=this.broadcastChannel)||void 0===t||t.addEventListener("message",e=>tf(this,void 0,void 0,function*(){this._debug("received broadcast notification from other tab or client",e),yield this._notifyAllSubscribers(e.data.event,e.data.session,!1)}))}this.initialize()}_debug(...e){return this.logDebugMessages&&console.log(`GoTrueClient@${this.instanceID} ${new Date().toISOString()}`,...e),this}initialize(){return this.initializePromise||(this.initializePromise=this._initialize()),this.initializePromise}_initialize(){return tf(this,void 0,void 0,function*(){if(this.initializePromise)return this.initializePromise;try{let e=!!e$()&&(yield this._isPKCEFlow());if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){let{data:t,error:n}=yield this._getSessionFromUrl(e);if(n)return this._debug("#_initialize()","error detecting session from URL",n),yield this._removeSession(),{error:n};let{session:r,redirectType:i}=t;return this._debug("#_initialize()","detected session in URL",r,"redirect type",i),yield this._saveSession(r),setTimeout(()=>tf(this,void 0,void 0,function*(){"recovery"===i?yield this._notifyAllSubscribers("PASSWORD_RECOVERY",r):yield this._notifyAllSubscribers("SIGNED_IN",r)}),0),{error:null}}return yield this._recoverAndRefresh(),{error:null}}catch(e){if(eK(e))return{error:e};return{error:new eZ("Unexpected error during initialization",e)}}finally{yield this._handleVisibilityChange(),this._debug("#_initialize()","end")}})}signUp(e){var t,n,r;return tf(this,void 0,void 0,function*(){try{let i;if(yield this._removeSession(),"email"in e){let{email:n,password:r,options:o}=e,s=null,a=null;if("pkce"===this.flowType){let e=eG();yield eB(this.storage,`${this.storageKey}-code-verifier`,e),s=yield eY(e),a=e===s?"plain":"s256"}i=yield tr(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null==o?void 0:o.emailRedirectTo,body:{email:n,password:r,data:null!==(t=null==o?void 0:o.data)&&void 0!==t?t:{},gotrue_meta_security:{captcha_token:null==o?void 0:o.captchaToken},code_challenge:s,code_challenge_method:a},xform:ti})}else if("phone"in e){let{phone:t,password:o,options:s}=e;i=yield tr(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:o,data:null!==(n=null==s?void 0:s.data)&&void 0!==n?n:{},channel:null!==(r=null==s?void 0:s.channel)&&void 0!==r?r:"sms",gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:ti})}else throw new e2("You must provide either an email or phone number and a password");let{data:o,error:s}=i;if(s||!o)return{data:{user:null,session:null},error:s};let a=o.session,c=o.user;return o.session&&(yield this._saveSession(o.session),yield this._notifyAllSubscribers("SIGNED_IN",a)),{data:{user:c,session:a},error:null}}catch(e){if(eK(e))return{data:{user:null,session:null},error:e};throw e}})}signInWithPassword(e){return tf(this,void 0,void 0,function*(){try{let t;if(yield this._removeSession(),"email"in e){let{email:n,password:r,options:i}=e;t=yield tr(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:ti})}else if("phone"in e){let{phone:n,password:r,options:i}=e;t=yield tr(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:ti})}else throw new e2("You must provide either an email or phone number and a password");let{data:n,error:r}=t;if(r)return{data:{user:null,session:null},error:r};
2if(!n||!n.session||!n.user)return{data:{user:null,session:null},error:new e1};return n.session&&(yield this._saveSession(n.session),yield this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:{user:n.user,session:n.session},error:r}}catch(e){if(eK(e))return{data:{user:null,session:null},error:e};throw e}})}signInWithOAuth(e){var t,n,r,i;return tf(this,void 0,void 0,function*(){return yield this._removeSession(),yield this._handleProviderSignIn(e.provider,{redirectTo:null===(t=e.options)||void 0===t?void 0:t.redirectTo,scopes:null===(n=e.options)||void 0===n?void 0:n.scopes,queryParams:null===(r=e.options)||void 0===r?void 0:r.queryParams,skipBrowserRedirect:null===(i=e.options)||void 0===i?void 0:i.skipBrowserRedirect})})}exchangeCodeForSession(e){return tf(this,void 0,void 0,function*(){let t=yield ez(this.storage,`${this.storageKey}-code-verifier`),{data:n,error:r}=yield tr(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:t},xform:ti});return(yield eq(this.storage,`${this.storageKey}-code-verifier`),r)?{data:{user:null,session:null},error:r}:n&&n.session&&n.user?(n.session&&(yield this._saveSession(n.session),yield this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:n,error:r}):{data:{user:null,session:null},error:new e1}})}signInWithIdToken(e){return tf(this,void 0,void 0,function*(){yield this._removeSession();try{let{options:t,provider:n,token:r,access_token:i,nonce:o}=e,{data:s,error:a}=yield tr(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:r,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:ti});if(a)return{data:{user:null,session:null},error:a};if(!s||!s.session||!s.user)return{data:{user:null,session:null},error:new e1};return s.session&&(yield this._saveSession(s.session),yield this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:s,error:a}}catch(e){if(eK(e))return{data:{user:null,session:null},error:e};throw e}})}signInWithOtp(e){var t,n,r,i,o;return tf(this,void 0,void 0,function*(){try{if(yield this._removeSession(),"email"in e){let{email:r,options:i}=e,o=null,s=null;if("pkce"===this.flowType){let e=eG();yield eB(this.storage,`${this.storageKey}-code-verifier`,e),o=yield eY(e),s=e===o?"plain":"s256"}let{error:a}=yield tr(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:r,data:null!==(t=null==i?void 0:i.data)&&void 0!==t?t:{},create_user:null===(n=null==i?void 0:i.shouldCreateUser)||void 0===n||n,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},code_challenge:o,code_challenge_method:s},redirectTo:null==i?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:a}}if("phone"in e){let{phone:t,options:n}=e,{data:s,error:a}=yield tr(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!==(r=null==n?void 0:n.data)&&void 0!==r?r:{},create_user:null===(i=null==n?void 0:n.shouldCreateUser)||void 0===i||i,gotrue_meta_security:{captcha_token:null==n?void 0:n.captchaToken},channel:null!==(o=null==n?void 0:n.channel)&&void 0!==o?o:"sms"}});return{data:{user:null,session:null,messageId:null==s?void 0:s.message_id},error:a}}throw new e2("You must provide either an email or phone number.")}catch(e){if(eK(e))return{data:{user:null,session:null},error:e};throw e}})}verifyOtp(e){var t,n;return tf(this,void 0,void 0,function*(){try{"email_change"!==e.type&&"phone_change"!==e.type&&(yield this._removeSession());let{data:r,error:i}=yield tr(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:null===(t=e.options)||void 0===t?void 0:t.captchaToken}}),redirectTo:null===(n=e.options)||void 0===n?void 0:n.redirectTo,xform:ti});if(i)throw i;if(!r)throw Error("An error occurred on token verification.");let o=r.session,s=r.user;return(null==o?void 0:o.access_token)&&(yield this._saveSession(o),yield this._notifyAllSubscribers("SIGNED_IN",o)),{data:{user:s,session:o},error:null}}catch(e){if(eK(e))return{data:{user:null,session:null},error:e};throw e}})}signInWithSSO(e){var t,n,r;return tf(this,void 0,void 0,function*(){try{return yield this._removeSession(),yield tr(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:null!==(n=null===(t=e.options)||void 0===t?void 0:t.redirectTo)&&void 0!==n?n:void 0}),(null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0}),headers:this.headers,xform:ts})}catch(e){if(eK(e))return{data:null,error:e};throw e}})}reauthenticate(){return tf(this,void 0,void 0,function*(){try{let{data:{session:e},error:t}
2=yield this.getSession();if(t)throw t;if(!e)throw new e0;let{error:n}=yield tr(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:e.access_token});return{data:{user:null,session:null},error:n}}catch(e){if(eK(e))return{data:{user:null,session:null},error:e};throw e}})}resend(e){return tf(this,void 0,void 0,function*(){try{yield this._removeSession();let t=`${this.url}/resend`;if("email"in e){let{email:n,type:r,options:i}=e,{error:o}=yield tr(this.fetch,"POST",t,{headers:this.headers,body:{email:n,type:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},redirectTo:null==i?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:o}}if("phone"in e){let{phone:n,type:r,options:i}=e,{data:o,error:s}=yield tr(this.fetch,"POST",t,{headers:this.headers,body:{phone:n,type:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:null==o?void 0:o.message_id},error:s}}throw new e2("You must provide either an email or phone number and a type")}catch(e){if(eK(e))return{data:{user:null,session:null},error:e};throw e}})}getSession(){return tf(this,void 0,void 0,function*(){yield this.initializePromise,this._debug("#getSession()","begin");try{let e=null;if(this.persistSession){let t=yield ez(this.storage,this.storageKey);this._debug("#getSession()","session from storage",t),null!==t&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),yield this._removeSession()))}else e=this.inMemorySession,this._debug("#getSession()","session from memory",e);if(!e)return{data:{session:null},error:null};let t=!!e.expires_at&&e.expires_at<=Date.now()/1e3;if(this._debug("#getSession()",`session has${t?"":" not"} expired`,"expires_at",e.expires_at),!t)return{data:{session:e},error:null};let{session:n,error:r}=yield this._callRefreshToken(e.refresh_token);if(r)return{data:{session:null},error:r};return{data:{session:n},error:null}}finally{this._debug("#getSession()","end")}})}getUser(e){var t,n;return tf(this,void 0,void 0,function*(){try{if(!e){let{data:r,error:i}=yield this.getSession();if(i)throw i;e=null!==(n=null===(t=r.session)||void 0===t?void 0:t.access_token)&&void 0!==n?n:void 0}return yield tr(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:to})}catch(e){if(eK(e))return{data:{user:null},error:e};throw e}})}updateUser(e,t={}){return tf(this,void 0,void 0,function*(){try{let{data:n,error:r}=yield this.getSession();if(r)throw r;if(!n.session)throw new e0;let i=n.session,{data:o,error:s}=yield tr(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:null==t?void 0:t.emailRedirectTo,body:e,jwt:i.access_token,xform:to});if(s)throw s;return i.user=o.user,yield this._saveSession(i),yield this._notifyAllSubscribers("USER_UPDATED",i),{data:{user:i.user},error:null}}catch(e){if(eK(e))return{data:{user:null},error:e};throw e}})}_decodeJWT(e){return eJ(e)}setSession(e){return tf(this,void 0,void 0,function*(){try{if(!e.access_token||!e.refresh_token)throw new e0;let t=Date.now()/1e3,n=t,r=!0,i=null,o=eJ(e.access_token);if(o.exp&&(r=(n=o.exp)<=t),r){let{session:t,error:n}=yield this._callRefreshToken(e.refresh_token);if(n)return{data:{user:null,session:null},error:n};if(!t)return{data:{user:null,session:null},error:null};i=t}else{let{data:r,error:o}=yield this.getUser(e.access_token);if(o)throw o;i={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:"bearer",expires_in:n-t,expires_at:n},yield this._saveSession(i),yield this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(e){if(eK(e))return{data:{session:null,user:null},error:e};throw e}})}refreshSession(e){var t;return tf(this,void 0,void 0,function*(){try{if(!e){let{data:n,error:r}=yield this.getSession();if(r)throw r;e=null!==(t=n.session)&&void 0!==t?t:void 0}if(!(null==e?void 0:e.refresh_token))throw new e0;let{session:n,error:r}=yield this._callRefreshToken(e.refresh_token);if(r)return{data:{user:null,session:null},error:r};if(!n)return{data:{user:null,session:null},error:null};return{data:{user:n.user,session:n},error:null}}catch(e){if(eK(e))return{data:{user:null,session:null},error:e};throw e}})}_getSessionFromUrl(e){return tf(this,void 0,void 0,function*(){try{if(!e$())throw new e5("No browser detected.");
2if("implicit"!==this.flowType||this._isImplicitGrantFlow()){if("pkce"==this.flowType&&!e)throw new e3("Not a valid PKCE flow url.")}else throw new e5("Not a valid implicit grant flow url.");if(e){let e=eD("code");if(!e)throw new e3("No code detected.");let{data:t,error:n}=yield this.exchangeCodeForSession(e);if(n)throw n;if(!t.session)throw new e3("No session detected.");let r=new URL(window.location.href);return r.searchParams.delete("code"),window.history.replaceState(window.history.state,"",r.toString()),{data:{session:t.session,redirectType:null},error:null}}let t=eD("error_description");if(t){let e=eD("error_code");if(!e)throw new e5("No error_code detected.");let n=eD("error");if(!n)throw new e5("No error detected.");throw new e5(t,{error:n,code:e})}let n=eD("provider_token"),r=eD("provider_refresh_token"),i=eD("access_token");if(!i)throw new e5("No access_token detected.");let o=eD("expires_in");if(!o)throw new e5("No expires_in detected.");let s=eD("refresh_token");if(!s)throw new e5("No refresh_token detected.");let a=eD("token_type");if(!a)throw new e5("No token_type detected.");let c=Math.round(Date.now()/1e3)+parseInt(o),{data:l,error:u}=yield this.getUser(i);if(u)throw u;let d=l.user,h={provider_token:n,provider_refresh_token:r,access_token:i,expires_in:parseInt(o),expires_at:c,refresh_token:s,token_type:a,user:d},f=eD("type");return window.location.hash="",this._debug("#_getSessionFromUrl()","clearing window.location.hash"),{data:{session:h,redirectType:f},error:null}}catch(e){if(eK(e))return{data:{session:null,redirectType:null},error:e};throw e}})}_isImplicitGrantFlow(){return e$()&&(!!eD("access_token")||!!eD("error_description"))}_isPKCEFlow(){return tf(this,void 0,void 0,function*(){let e=yield ez(this.storage,`${this.storageKey}-code-verifier`);return!!eD("code")&&!!e})}signOut({scope:e}={scope:"global"}){var t;return tf(this,void 0,void 0,function*(){let{data:n,error:r}=yield this.getSession();if(r)return{error:r};let i=null===(t=n.session)||void 0===t?void 0:t.access_token;if(i){let{error:t}=yield this.admin.signOut(i,e);if(t&&!(eK(t)&&"AuthApiError"===t.name&&(404===t.status||401===t.status)))return{error:t}}return"others"!==e&&(yield this._removeSession(),yield eq(this.storage,`${this.storageKey}-code-verifier`),yield this._notifyAllSubscribers("SIGNED_OUT",null)),{error:null}})}onAuthStateChange(e){let t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),n={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,n),this._emitInitialSession(t),{data:{subscription:n}}}_emitInitialSession(e){var t,n;return tf(this,void 0,void 0,function*(){try{let{data:{session:n},error:r}=yield this.getSession();if(r)throw r;yield null===(t=this.stateChangeEmitters.get(e))||void 0===t?void 0:t.callback("INITIAL_SESSION",n),this._debug("INITIAL_SESSION","callback id",e,"session",n)}catch(t){yield null===(n=this.stateChangeEmitters.get(e))||void 0===n?void 0:n.callback("INITIAL_SESSION",null),this._debug("INITIAL_SESSION","callback id",e,"error",t),console.error(t)}})}resetPasswordForEmail(e,t={}){return tf(this,void 0,void 0,function*(){let n=null,r=null;if("pkce"===this.flowType){let e=eG();yield eB(this.storage,`${this.storageKey}-code-verifier`,e),n=yield eY(e),r=e===n?"plain":"s256"}try{return yield tr(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(eK(e))return{data:null,error:e};throw e}})}_refreshAccessToken(e){return tf(this,void 0,void 0,function*(){let t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{let n=Date.now();return yield function(e,t){return new Promise((n,r)=>{eN(this,void 0,void 0,function*(){for(let i=0;i<1/0;i++)try{let r=yield e(i);if(!t(i,null,r)){n(r);return}}catch(e){if(!t(i,e)){r(e);return}}})})}(n=>tf(this,void 0,void 0,function*(){var r;return yield(r=200*n,new Promise(e=>{setTimeout(()=>e(null),r)})),this._debug(t,"refreshing attempt",n),yield tr(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ti})}),(e,t,r)=>r&&r.error&&e4(r.error)&&Date.now()+(e+1)*200-n<3e4)}catch(e){if(this._debug(t,"error",e),eK(e))return{data:{session:null,user:null},error:e};throw e}finally{this._debug(t,"end")}})}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}_handleProviderSignIn(e,t){return tf(this,void 0,void 0,function*(){let n=yield this._getUrlForProvider(e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",n),e$()&&!t.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}})}_recoverAndRefresh(){var e;return tf(this,void 0,void 0,function*(){let t="#_recoverAndRefresh()";this._debug(t,"begin");try{let n=yield ez(this.storage,this.storageKey);if(this._debug(t,"session from storage",n),!this._isValidSession(n)){this._debug(t,"session is not val
2id"),null!==n&&(yield this._removeSession());return}let r=Math.round(Date.now()/1e3),i=(null!==(e=n.expires_at)&&void 0!==e?e:1/0)<r+10;if(this._debug(t,`session has${i?"":" not"} expired with margin of 10s`),i){if(this.autoRefreshToken&&n.refresh_token){let{error:e}=yield this._callRefreshToken(n.refresh_token);e&&(console.error(e),e4(e)||(this._debug(t,"refresh failed with a non-retryable error, removing the session",e),yield this._removeSession()))}}else yield this._notifyAllSubscribers("SIGNED_IN",n)}catch(e){this._debug(t,"error",e),console.error(e);return}finally{this._debug(t,"end")}})}_callRefreshToken(e){var t,n;return tf(this,void 0,void 0,function*(){if(!e)throw new e0;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let r=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{this.refreshingDeferred=new eV;let{data:t,error:n}=yield this._refreshAccessToken(e);if(n)throw n;if(!t.session)throw new e0;yield this._saveSession(t.session),yield this._notifyAllSubscribers("TOKEN_REFRESHED",t.session);let r={session:t.session,error:null};return this.refreshingDeferred.resolve(r),r}catch(e){if(this._debug(r,"error",e),eK(e)){let n={session:null,error:e};return null===(t=this.refreshingDeferred)||void 0===t||t.resolve(n),n}throw null===(n=this.refreshingDeferred)||void 0===n||n.reject(e),e}finally{this.refreshingDeferred=null,this._debug(r,"end")}})}_notifyAllSubscribers(e,t,n=!0){return tf(this,void 0,void 0,function*(){let r=`#_notifyAllSubscribers(${e})`;this._debug(r,"begin",t,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:t});let r=[],i=Array.from(this.stateChangeEmitters.values()).map(n=>tf(this,void 0,void 0,function*(){try{yield n.callback(e,t)}catch(e){r.push(e)}}));if(yield Promise.all(i),r.length>0){for(let e=0;e<r.length;e+=1)console.error(r[e]);throw r[0]}}finally{this._debug(r,"end")}})}_saveSession(e){return tf(this,void 0,void 0,function*(){this._debug("#_saveSession()",e),this.persistSession||(this.inMemorySession=e),this.persistSession&&e.expires_at&&(yield this._persistSession(e))})}_persistSession(e){return this._debug("#_persistSession()",e),eB(this.storage,this.storageKey,e)}_removeSession(){return tf(this,void 0,void 0,function*(){this._debug("#_removeSession()"),this.persistSession?yield eq(this.storage,this.storageKey):this.inMemorySession=null})}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&e$()&&(null==window?void 0:window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(e){console.error("removing visibilitychange callback failed",e)}}_startAutoRefresh(){return tf(this,void 0,void 0,function*(){yield this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),3e4);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref?e.unref():"undefined"!=typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(e),yield this._autoRefreshTokenTick()})}_stopAutoRefresh(){return tf(this,void 0,void 0,function*(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)})}startAutoRefresh(){return tf(this,void 0,void 0,function*(){this._removeVisibilityChangedCallback(),yield this._startAutoRefresh()})}stopAutoRefresh(){return tf(this,void 0,void 0,function*(){this._removeVisibilityChangedCallback(),yield this._stopAutoRefresh()})}_autoRefreshTokenTick(){return tf(this,void 0,void 0,function*(){this._debug("#_autoRefreshTokenTick()","begin");try{let e=Date.now();try{let{data:{session:t}}=yield this.getSession();if(!t||!t.refresh_token||!t.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let n=Math.floor((1e3*t.expires_at-e)/3e4);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts 30000ms, refresh threshold is 3 ticks`),n<=3&&(yield this._callRefreshToken(t.refresh_token))}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}_handleVisibilityChange(){return tf(this,void 0,void 0,function*(){if(this._debug("#_handleVisibilityChange()"),!e$()||!(null==window?void 0:window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=()=>tf(this,void 0,void 0,function*(){return yield this._onVisibilityChanged(!1)}),null==window||window.addEventListener("visibilitychange",this.visibilityChangedCallback),yield this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}})}_onVisibilityChanged(e){return tf(this,void 0,void 0,function*(){this._debug(`#_onVisibilityChanged(${e})`,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(e||(yield this.initializePromise,yield this._recoverAndRefresh(),this._debug("#_onVisibilityChanged()","finished waiting for initialize, _recoverAndRefresh")),this.autoRefreshToken&&this._startAutoRefresh()):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()})}_getUrlForProvider(e,t){return tf(this,void 0,void 0,function*(){let n=[`provider=${encodeURIComponent(e)}`];if((null==t?void 0:t.redirectTo)&&n.push(`redirect_to=${encodeURIComponent(t.redirectTo)}`),(null==t?void 0:t.scopes)&&n.push(`scopes=${encodeURIComponent(t.scopes)}`),"pkce"===this.flowType){let e=eG();yield eB(this.storage,`${this.storageKey}-code-verifier`,e);let t=yield eY(e),r=e===t?"plain":"s256";this._debug("PKCE","code verifier",`${e.substring(0,5)}...`,"code challenge",t,"method",r);let i=new URLSearchParams({code_challenge:`${encodeURIComponent(t)}`,code_challenge_method:`${encodeURIComponent(r)}`});n.push(i.toString())}if(null==t?void 0:t.queryParams){let e=new URLSearchParams(t.queryParams);n.push(e.toString())}return`${this.url}/authorize?${n.join("&")}`})}_unenroll(e){var t;return tf(this,void 0,void 0,function*(){try{let{data:n,error:r}
2=yield this.getSession();if(r)return{data:null,error:r};return yield tr(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null===(t=null==n?void 0:n.session)||void 0===t?void 0:t.access_token})}catch(e){if(eK(e))return{data:null,error:e};throw e}})}_enroll(e){var t,n;return tf(this,void 0,void 0,function*(){try{let{data:r,error:i}=yield this.getSession();if(i)return{data:null,error:i};let{data:o,error:s}=yield tr(this.fetch,"POST",`${this.url}/factors`,{body:{friendly_name:e.friendlyName,factor_type:e.factorType,issuer:e.issuer},headers:this.headers,jwt:null===(t=null==r?void 0:r.session)||void 0===t?void 0:t.access_token});if(s)return{data:null,error:s};return(null===(n=null==o?void 0:o.totp)||void 0===n?void 0:n.qr_code)&&(o.totp.qr_code=`data:image/svg+xml;utf-8,${o.totp.qr_code}`),{data:o,error:null}}catch(e){if(eK(e))return{data:null,error:e};throw e}})}_verify(e){var t;return tf(this,void 0,void 0,function*(){try{let{data:n,error:r}=yield this.getSession();if(r)return{data:null,error:r};let{data:i,error:o}=yield tr(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:null===(t=null==n?void 0:n.session)||void 0===t?void 0:t.access_token});if(o)return{data:null,error:o};return yield this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+i.expires_in},i)),yield this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",i),{data:i,error:o}}catch(e){if(eK(e))return{data:null,error:e};throw e}})}_challenge(e){var t;return tf(this,void 0,void 0,function*(){try{let{data:n,error:r}=yield this.getSession();if(r)return{data:null,error:r};return yield tr(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{headers:this.headers,jwt:null===(t=null==n?void 0:n.session)||void 0===t?void 0:t.access_token})}catch(e){if(eK(e))return{data:null,error:e};throw e}})}_challengeAndVerify(e){return tf(this,void 0,void 0,function*(){let{data:t,error:n}=yield this._challenge({factorId:e.factorId});return n?{data:null,error:n}:yield this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})})}_listFactors(){return tf(this,void 0,void 0,function*(){let{data:{user:e},error:t}=yield this.getUser();if(t)return{data:null,error:t};let n=(null==e?void 0:e.factors)||[],r=n.filter(e=>"totp"===e.factor_type&&"verified"===e.status);return{data:{all:n,totp:r},error:null}})}_getAuthenticatorAssuranceLevel(){var e,t;return tf(this,void 0,void 0,function*(){let{data:{session:n},error:r}=yield this.getSession();if(r)return{data:null,error:r};if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let i=this._decodeJWT(n.access_token),o=null;i.aal&&(o=i.aal);let s=o;return(null!==(t=null===(e=n.user.factors)||void 0===e?void 0:e.filter(e=>"verified"===e.status))&&void 0!==t?t:[]).length>0&&(s="aal2"),{data:{currentLevel:o,nextLevel:s,currentAuthenticationMethods:i.amr||[]},error:null}})}}tg.nextInstanceID=0;class tv extends tg{constructor(e){super(e)}}let tm={headers:{"X-Client-Info":"supabase-js/2.26.0"}},t_={schema:"public"},ty={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},tb={};class tw{constructor(e,t,n){var r,i,o,s,a,c,l,u;if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw Error("supabaseUrl is required.");if(!t)throw Error("supabaseKey is required.");let d=e.replace(/\/$/,"");this.realtimeUrl=`${d}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${d}/auth/v1`,this.storageUrl=`${d}/storage/v1`,this.functionsUrl=`${d}/functions/v1`;let h=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,f=function(e,t){let{db:n,auth:r,realtime:i,global:o}=e,{db:s,auth:a,realtime:c,global:l}=t;return{db:Object.assign(Object.assign({},s),n),auth:Object.assign(Object.assign({},a),r),realtime:Object.assign(Object.assign({},c),i),global:Object.assign(Object.assign({},l),o)}}(null!=n?n:{},{db:t_,realtime:tb,auth:Object.assign(Object.assign({},ty),{storageKey:h}),global:tm});this.storageKey=null!==(i=null===(r=f.auth)||void 0===r?void 0:r.storageKey)&&void 0!==i?i:"",this.headers=null!==(s=null===(o=f.global)||void 0===o?void 0:o.headers)&&void 0!==s?s:{},this.auth=this._initSupabaseAuthClient(null!==(a=f.auth)&&void 0!==a?a:{},this.headers,null===(c=f.global)||void 0===c?void 0:c.fetch),this.fetch=eR(t,this._getAccessToken.bind(this),null===(l=f.global)||void 0===l?void 0:l.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},f.realtime)),this.rest=new B(`${d}/rest/v1`,{headers:this.headers,schema:null===(u=f.db)||void 0===u?void 0:u.schema,fetch:this.fetch}),this._listenForAuthEvents()}get functions(){return new R(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new eT(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}rpc(e,t={},n){return this.rest.rpc(e,t,n)}
2channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,t,n,r,i,o;return n=this,r=void 0,i=void 0,o=function*(){let{data:n}=yield this.auth.getSession();return null!==(t=null===(e=n.session)||void 0===e?void 0:e.access_token)&&void 0!==t?t:null},new(i||(i=Promise))(function(e,t){function s(e){try{c(o.next(e))}catch(e){t(e)}}function a(e){try{c(o.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):((n=t.value)instanceof i?n:new i(function(e){e(n)})).then(s,a)}c((o=o.apply(n,r||[])).next())})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,storageKey:i,flowType:o},s,a){let c={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new tv({url:this.authUrl,headers:Object.assign(Object.assign({},c),s),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,flowType:o,fetch:a})}_initRealtimeClient(e){return new ea(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},null==e?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",null==t?void 0:t.access_token)})}_handleTokenChanged(e,t,n){("TOKEN_REFRESHED"===e||"SIGNED_IN"===e)&&this.changedAccessToken!==n?(this.realtime.setAuth(null!=n?n:null),this.changedAccessToken=n):"SIGNED_OUT"===e&&(this.realtime.setAuth(this.supabaseKey),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0)}}let tk=(e,t,n)=>new tw(e,t,n);var tS=Object.create,tx=Object.defineProperty,tO=Object.getOwnPropertyDescriptor,tE=Object.getOwnPropertyNames,tP=Object.getPrototypeOf,tC=Object.prototype.hasOwnProperty,tI=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of tE(t))tC.call(e,i)||i===n||tx(e,i,{get:()=>t[i],enumerable:!(r=tO(t,i))||r.enumerable});return e},tT=(e,t,n)=>(n=null!=e?tS(tP(e)):{},tI(!t&&e&&e.__esModule?n:tx(n,"default",{value:e,enumerable:!0}),e)),tA=(r={"../../node_modules/.pnpm/[email protected]/node_modules/cookie/index.js"(e){e.parse=function(e,t){if("string"!=typeof e)throw TypeError("argument str must be a string");for(var n={},i=(t||{}).decode||r,o=0;o<e.length;){var s=e.indexOf("=",o);if(-1===s)break;var a=e.indexOf(";",o);if(-1===a)a=e.length;else if(a<s){o=e.lastIndexOf(";",s-1)+1;continue}var c=e.slice(o,s).trim();if(void 0===n[c]){var l=e.slice(s+1,a).trim();34===l.charCodeAt(0)&&(l=l.slice(1,-1)),n[c]=function(e,t){try{return t(e)}catch(t){return e}}(l,i)}o=a+1}return n},e.serialize=function(e,r,o){var s=o||{},a=s.encode||i;if("function"!=typeof a)throw TypeError("option encode is invalid");if(!n.test(e))throw TypeError("argument name is invalid");var c=a(r);if(c&&!n.test(c))throw TypeError("argument val is invalid");var l=e+"="+c;if(null!=s.maxAge){var u=s.maxAge-0;if(isNaN(u)||!isFinite(u))throw TypeError("option maxAge is invalid");l+="; Max-Age="+Math.floor(u)}if(s.domain){if(!n.test(s.domain))throw TypeError("option domain is invalid");l+="; Domain="+s.domain}if(s.path){if(!n.test(s.path))throw TypeError("option path is invalid");l+="; Path="+s.path}if(s.expires){var d=s.expires;if("[object Date]"!==t.call(d)&&!(d instanceof Date)||isNaN(d.valueOf()))throw TypeError("option expires is invali
2d");l+="; Expires="+d.toUTCString()}if(s.httpOnly&&(l+="; HttpOnly"),s.secure&&(l+="; Secure"),s.priority)switch("string"==typeof s.priority?s.priority.toLowerCase():s.priority){case"low":l+="; Priority=Low";break;case"medium":l+="; Priority=Medium";break;case"high":l+="; Priority=High";break;default:throw TypeError("option priority is invalid")}if(s.sameSite)switch("string"==typeof s.sameSite?s.sameSite.toLowerCase():s.sameSite){case!0:case"strict":l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"none":l+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return l};var t=Object.prototype.toString,n=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function r(e){return -1!==e.indexOf("%")?decodeURIComponent(e):e}function i(e){return encodeURIComponent(e)}}},function(){return i||(0,r[tE(r)[0]])((i={exports:{}}).exports,i),i.exports}),tj=tT(tA()),tR=tT(tA());function tN(e){if(!e)return null;try{let t=JSON.parse(e);if(!t)return null;if("Object"===t.constructor.name)return t;if("Array"!==t.constructor.name)throw Error(`Unexpected format: ${t.constructor.name}`);let[n,r,i]=t[0].split("."),o=P(r),s=new TextDecoder,{exp:a,sub:c,...l}=JSON.parse(s.decode(o));return{expires_at:a,expires_in:a-Math.round(Date.now()/1e3),token_type:"bearer",access_token:t[0],refresh_token:t[1],provider_token:t[2],provider_refresh_token:t[3],user:{id:c,factors:t[4],...l}}}catch(e){return console.warn("Failed to parse cookie string:",e),null}}function t$(e){var t;return JSON.stringify([e.access_token,e.refresh_token,e.provider_token,e.provider_refresh_token,(null==(t=e.user)?void 0:t.factors)??null])}function tF(){return"undefined"!=typeof window&&void 0!==window.document}var tM={path:"/",maxAge:31536e6},tD=class{constructor(e){this.cookieOptions={...tM,...e}}getItem(e){let t=this.getCookie(e);return t?e.endsWith("-code-verifier")?t:JSON.stringify(tN(t)):null}setItem(e,t){if(e.endsWith("-code-verifier")){this.setCookie(e,t);return}let n=t$(JSON.parse(t));this.setCookie(e,n)}removeItem(e){this.deleteCookie(e)}},tL=class extends tD{constructor(e){super(e)}getCookie(e){return tF()?(0,tj.parse)(document.cookie)[e]:null}setCookie(e,t){if(!tF())return null;document.cookie=(0,tj.serialize)(e,t,{...this.cookieOptions,httpOnly:!1})}deleteCookie(e){if(!tF())return null;document.cookie=(0,tj.serialize)(e,"",{...this.cookieOptions,maxAge:0,httpOnly:!1})}};function tU(e,t,n){var r;let i=tF();return tk(e,t,{...n,auth:{flowType:"pkce",autoRefreshToken:i,detectSessionInUrl:i,persistSession:!0,storage:n.auth.storage,...(null==(r=n.auth)?void 0:r.storageKey)?{storageKey:n.auth.storageKey}:{}}})}var tB=tR.parse,tz=tR.serialize},19794:function(e){"use strict";e.exports={version:"1.0.34"}}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[9774,179],function(){return t(91118),t(37253)}),_N_E=e.O()}]);
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.