promptfoo 0.28.0 → 0.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +1 -1
- package/dist/src/web/nextui/404/index.html +1 -0
- package/dist/src/web/nextui/404.html +1 -0
- package/dist/src/web/nextui/_next/static/DcqS4TFYcRBwGDxrCK977/_buildManifest.js +1 -0
- package/dist/src/web/nextui/_next/static/DcqS4TFYcRBwGDxrCK977/_ssgManifest.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/21-8a2c661f5df627d6.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/238-84a998be247f92e7.js +2 -0
- package/dist/src/web/nextui/_next/static/chunks/293-f7537306415679fd.js +89 -0
- package/dist/src/web/nextui/_next/static/chunks/320-d41e321556b1b694.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/339-501c32916b785ef1.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/502-683cf7d0202ccda6.js +37 -0
- package/dist/src/web/nextui/_next/static/chunks/548-46c7c1d35ca1bc02.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/563-a961efef5193d79c.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/596-297f7ff4a0436e87.js +25 -0
- package/dist/src/web/nextui/_next/static/chunks/753-f62bfa32dbd9ff14.js +8 -0
- package/dist/src/web/nextui/_next/static/chunks/808-90426be34a5d9784.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/82-74626c128eefc7a5.js +7 -0
- package/dist/src/web/nextui/_next/static/chunks/891-e0c1a7fdffc35da6.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/919-d71c386cf4a86911.js +44 -0
- package/dist/src/web/nextui/_next/static/chunks/975-380318b3b26ba688.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/auth/login/page-74ee07fe19cc0bbe.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/auth/signup/page-910ae67c25dade94.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/datasets/page-8aeacfc0a957e29b.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/eval/[id]/not-found-8624f98413223113.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/eval/[id]/page-c553e2c475a3fb81.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/eval/page-378d9ba3c85a4c1d.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/layout-73ead9cc3e75fca2.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/page-864c14f3dfba2dc2.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/prompts/page-eaf4573ef16fa693.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/app/setup/page-c52eef7220e67bae.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/ca377847-26b462611379a4f7.js +6 -0
- package/dist/src/web/nextui/_next/static/chunks/fd9d1056-fba4b53a2f01213b.js +9 -0
- package/dist/src/web/nextui/_next/static/chunks/framework-8883d1e9be70c3da.js +25 -0
- package/dist/src/web/nextui/_next/static/chunks/main-4ff8304034a9c4dd.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/main-app-635e57f728b91b66.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/pages/_app-52924524f99094ab.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/pages/_error-c92d5c4bb2b49926.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js +1 -0
- package/dist/src/web/nextui/_next/static/chunks/webpack-d84770151d117d82.js +1 -0
- package/dist/src/web/nextui/_next/static/css/16c1dd82fc87c9d7.css +1 -0
- package/dist/src/web/nextui/_next/static/css/2e8afc839fdb6c80.css +1 -0
- package/dist/src/web/nextui/_next/static/css/48d388184a2f4ce3.css +1 -0
- package/dist/src/web/nextui/_next/static/css/6201f8d4bcf98b71.css +1 -0
- package/dist/src/web/nextui/_next/static/css/761e658b3bd1f2f6.css +1 -0
- package/dist/src/web/nextui/_next/static/css/8119d8bd13a8adab.css +1 -0
- package/dist/src/web/nextui/_next/static/media/0e4fe491bf84089c-s.p.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/1c57ca6f5208a29b-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/3dbd163d3bb09d47-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/42d52f46a26971a3-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/5647e4c23315a2d2-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/627622453ef56b0d-s.p.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/7be645d133f3ee22-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/7c53f7419436e04b-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/8fb72f69fba4e3d2-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/912a9cfe43c928d9-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/934c4b7cb736f2a3-s.p.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/a5b77b63ef20339c-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/a6d330d7873e7320-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/baf12dd90520ae41-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/bbdb6f0234009aba-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/cff529cd86cc0276-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/d117eea74e01de14-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/dfa8b99978df7bbc-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/e25729ca87cc7df9-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/eb52b768f62eeeb4-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/f06116e890b3dadb-s.woff2 +0 -0
- package/dist/src/web/nextui/auth/callback +1 -0
- package/dist/src/web/nextui/auth/login/index.html +1 -0
- package/dist/src/web/nextui/auth/login/index.txt +12 -0
- package/dist/src/web/nextui/auth/signup/index.html +1 -0
- package/dist/src/web/nextui/auth/signup/index.txt +12 -0
- package/dist/src/web/nextui/datasets/index.html +1 -0
- package/dist/src/web/nextui/datasets/index.txt +12 -0
- package/dist/src/web/nextui/eval/index.html +1 -0
- package/dist/src/web/nextui/eval/index.txt +14 -0
- package/dist/src/web/nextui/favicon.ico +0 -0
- package/dist/src/web/nextui/index.html +1 -0
- package/dist/src/web/nextui/index.txt +13 -0
- package/dist/src/web/nextui/logo.svg +30 -0
- package/dist/src/web/nextui/prompts/index.html +1 -0
- package/dist/src/web/nextui/prompts/index.txt +12 -0
- package/dist/src/web/nextui/setup/index.html +27 -0
- package/dist/src/web/nextui/setup/index.txt +14 -0
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[82],{3082:function(e,t,r){"use strict";var s,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{createBrowserSupabaseClient:()=>C,createClientComponentClient:()=>c,createMiddlewareClient:()=>b,createMiddlewareSupabaseClient:()=>I,createPagesBrowserClient:()=>u,createPagesServerClient:()=>g,createRouteHandlerClient:()=>T,createServerActionClient:()=>E,createServerComponentClient:()=>k,createServerSupabaseClient:()=>j}),e.exports=((e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of a(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(s=n(t,r))||s.enumerable});return e})(i({},"__esModule",{value:!0}),l);var h=r(9335);function c({supabaseUrl:e="https://vhywkeydkitmauabqnwv.supabase.co",supabaseKey:t="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZoeXdrZXlka2l0bWF1YWJxbnd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTI5OTAwMjQsImV4cCI6MjAwODU2NjAyNH0.C02gMvrfB4YOPEemF6S_OF2CKKawhRjWDNQfh3CEuxM",options:r,cookieOptions:i,isSingleton:n=!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 a=()=>{var s;return(0,h.createSupabaseClient)(e,t,{...r,global:{...null==r?void 0:r.global,headers:{...null==(s=null==r?void 0:r.global)?void 0:s.headers,"X-Client-Info":"@supabase/auth-helpers-nextjs@0.7.4"}},auth:{storageKey:null==i?void 0:i.name,storage:new h.BrowserCookieAuthStorageAdapter(i)}})};if(n){let e=s??a();return"undefined"==typeof window?e:(s||(s=e),s)}return a()}var u=c,d=r(9335),f=r(8027),p=class extends d.CookieAuthStorageAdapter{constructor(e,t){super(t),this.context=e}getCookie(e){var t;let r=(0,f.splitCookiesString)((null==(t=this.context.res.getHeader("set-cookie"))?void 0:t.toString())??"").map(t=>(0,d.parseCookies)(t)[e]).find(e=>!!e),s=r??this.context.req.cookies[e];return s}setCookie(e,t){this._setCookie(e,t)}deleteCookie(e){this._setCookie(e,"",{maxAge:0})}_setCookie(e,t,r){var s;let i=(0,f.splitCookiesString)((null==(s=this.context.res.getHeader("set-cookie"))?void 0:s.toString())??"").filter(t=>!(e in(0,d.parseCookies)(t))),n=(0,d.serializeCookie)(e,t,{...this.cookieOptions,...r,httpOnly:!1});this.context.res.setHeader("set-cookie",[...i,n])}};function g(e,{supabaseUrl:t="https://vhywkeydkitmauabqnwv.supabase.co",supabaseKey:r="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZoeXdrZXlka2l0bWF1YWJxbnd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTI5OTAwMjQsImV4cCI6MjAwODU2NjAyNH0.C02gMvrfB4YOPEemF6S_OF2CKKawhRjWDNQfh3CEuxM",options:s,cookieOptions:i}={}){var n;if(!t||!r)throw Error("either NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY env variables or supabaseUrl and supabaseKey are required!");return(0,d.createSupabaseClient)(t,r,{...s,global:{...null==s?void 0:s.global,headers:{...null==(n=null==s?void 0:s.global)?void 0:n.headers,"X-Client-Info":"@supabase/auth-helpers-nextjs@0.7.4"}},auth:{storageKey:null==i?void 0:i.name,storage:new p(e,i)}})}var y=r(9335),m=r(8027),v=class extends y.CookieAuthStorageAdapter{constructor(e,t){super(t),this.context=e}getCookie(e){var t;let r=(0,m.splitCookiesString)((null==(t=this.context.res.headers.get("set-cookie"))?void 0:t.toString())??"").map(t=>(0,y.parseCookies)(t)[e]).find(e=>!!e);return r||(0,y.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,r){let s=(0,y.serializeCookie)(e,t,{...this.cookieOptions,...r,httpOnly:!1});this.context.res.headers&&(this.context.res.headers.append("set-cookie",s),this.context.res.headers.append("cookie",s))}};function b(e,{supabaseUrl:t="https://vhywkeydkitmauabqnwv.supabase.co",supabaseKey:r="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZoeXdrZXlka2l0bWF1YWJxbnd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTI5OTAwMjQsImV4cCI6MjAwODU2NjAyNH0.C02gMvrfB4YOPEemF6S_OF2CKKawhRjWDNQfh3CEuxM",options:s,cookieOptions:i}={}){var n;if(!t||!r)throw Error("either NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY env variables or supabaseUrl and supabaseKey are required!");return(0,y.createSupabaseClient)(t,r,{...s,global:{...null==s?void 0:s.global,headers:{...null==(n=null==s?void 0:s.global)?void 0:n.headers,"X-Client-Info":"@supabase/auth-helpers-nextjs@0.7.4"}},auth:{storageKey:null==i?void 0:i.name,storage:new v(e,i)}})}var _=r(9335),w=class extends _.CookieAuthStorageAdapter{constructor(e,t){super(t),this.context=e}getCookie(e){var t;let r=this.context.cookies();return null==(t=r.get(e))?void 0:t.value}setCookie(e,t){}deleteCookie(e){}};function k(e,{supabaseUrl:t="https://vhywkeydkitmauabqnwv.supabase.co",supabaseKey:r="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZoeXdrZXlka2l0bWF1YWJxbnd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTI5OTAwMjQsImV4cCI6MjAwODU2NjAyNH0.C02gMvrfB4YOPEemF6S_OF2CKKawhRjWDNQfh3CEuxM",options:s,cookieOptions:i}={}){var n;if(!t||!r)throw Error("either NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY env variables or supabaseUrl and supabaseKey are required!");return(0,_.createSupabaseClient)(t,r,{...s,global:{...null==s?void 0:s.global,headers:{...null==(n=null==s?void 0:s.global)?void 0:n.headers,"X-Client-Info":"@supabase/auth-helpers-nextjs@0.7.4"}},auth:{storageKey:null==i?void 0:i.name,storage:new w(e,i)}})}var S=r(9335),O=class extends S.CookieAuthStorageAdapter{constructor(e,t){super(t),this.context=e}getCookie(e){var t;let r=this.context.cookies();return null==(t=r.get(e))?void 0:t.value}setCookie(e,t){let r=this.context.cookies();r.set(e,t,this.cookieOptions)}deleteCookie(e){let t=this.context.cookies();t.set(e,"",{maxAge:0})}};function T(e,{supabaseUrl:t="https://vhywkeydkitmauabqnwv.supabase.co",supabaseKey:r="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZoeXdrZXlka2l0bWF1YWJxbnd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTI5OTAwMjQsImV4cCI6MjAwODU2NjAyNH0.C02gMvrfB4YOPEemF6S_OF2CKKawhRjWDNQfh3CEuxM",options:s,cookieOptions:i}={}){var n;if(!t||!r)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,r,{...s,global:{...null==s?void 0:s.global,headers:{...null==(n=null==s?void 0:s.global)?void 0:n.headers,"X-Client-Info":"@supabase/auth-helpers-nextjs@0.7.4"}},auth:{storageKey:null==i?void 0:i.name,storage:new O(e,i)}})}var E=T;function C({supabaseUrl:e="https://vhywkeydkitmauabqnwv.supabase.co",supabaseKey:t="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZoeXdrZXlka2l0bWF1YWJxbnd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTI5OTAwMjQsImV4cCI6MjAwODU2NjAyNH0.C02gMvrfB4YOPEemF6S_OF2CKKawhRjWDNQfh3CEuxM",options:r,cookieOptions:s}={}){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"),u({supabaseUrl:e,supabaseKey:t,options:r,cookieOptions:s})}function j(e,{supabaseUrl:t="https://vhywkeydkitmauabqnwv.supabase.co",supabaseKey:r="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZoeXdrZXlka2l0bWF1YWJxbnd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTI5OTAwMjQsImV4cCI6MjAwODU2NjAyNH0.C02gMvrfB4YOPEemF6S_OF2CKKawhRjWDNQfh3CEuxM",options:s,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:r,options:s,cookieOptions:i})}function I(e,{supabaseUrl:t="https://vhywkeydkitmauabqnwv.supabase.co",supabaseKey:r="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZoeXdrZXlka2l0bWF1YWJxbnd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTI5OTAwMjQsImV4cCI6MjAwODU2NjAyNH0.C02gMvrfB4YOPEemF6S_OF2CKKawhRjWDNQfh3CEuxM",options:s,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"),b(e,{supabaseUrl:t,supabaseKey:r,options:s,cookieOptions:i})}},7992:function(e,t,r){"use strict";var s=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw Error("unable to locate global object")}();e.exports=t=s.fetch,s.fetch&&(t.default=s.fetch.bind(s)),t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response},9366:function(e,t){var r="undefined"!=typeof self?self:this,s=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();(function(e){var t={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};if(t.arrayBuffer)var r=["[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&&r.indexOf(Object.prototype.toString.call(e))>-1};function n(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 a(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(r[Symbol.iterator]=function(){return r}),r}function l(e){this.map={},e instanceof l?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 h(e){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function u(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function d(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 r;t.arrayBuffer&&t.blob&&(r=e)&&DataView.prototype.isPrototypeOf(r)?(this._bodyArrayBuffer=d(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||i(e))?this._bodyArrayBuffer=d(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=h(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?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(u)}),this.text=function(){var e,t,r,s=h(this);if(s)return s;if(this._bodyBlob)return e=this._bodyBlob,r=c(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=Array(t.length),s=0;s<t.length;s++)r[s]=String.fromCharCode(t[s]);return r.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(y)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(e,t){e=n(e),t=a(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},l.prototype.delete=function(e){delete this.map[n(e)]},l.prototype.get=function(e){return e=n(e),this.has(e)?this.map[e]:null},l.prototype.has=function(e){return this.map.hasOwnProperty(n(e))},l.prototype.set=function(e,t){this.map[n(e)]=a(t)},l.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},l.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),o(e)},l.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),o(e)},l.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),o(e)},t.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(e,t){var r,s,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 l(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 l(t.headers)),this.method=(s=(r=t.method||this.method||"GET").toUpperCase(),p.indexOf(s)>-1?s:r),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 y(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),s=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(s),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 l(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 l(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var v=[301,302,303,307,308];m.redirect=function(e,t){if(-1===v.indexOf(t))throw RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},e.DOMException=s.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function b(r,s){return new Promise(function(i,n){var a=new g(r,s);if(a.signal&&a.signal.aborted)return n(new e.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function h(){o.abort()}o.onload=function(){var e,t,r={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var r=e.split(":"),s=r.shift().trim();if(s){var i=r.join(":").trim();t.append(s,i)}}),t)};r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var s="response"in o?o.response:o.responseText;i(new m(s,r))},o.onerror=function(){n(TypeError("Network request failed"))},o.ontimeout=function(){n(TypeError("Network request failed"))},o.onabort=function(){n(new e.DOMException("Aborted","AbortError"))},o.open(a.method,a.url,!0),"include"===a.credentials?o.withCredentials=!0:"omit"===a.credentials&&(o.withCredentials=!1),"responseType"in o&&t.blob&&(o.responseType="blob"),a.headers.forEach(function(e,t){o.setRequestHeader(t,e)}),a.signal&&(a.signal.addEventListener("abort",h),o.onreadystatechange=function(){4===o.readyState&&a.signal.removeEventListener("abort",h)}),o.send(void 0===a._bodyInit?null:a._bodyInit)})}b.polyfill=!0,s.fetch||(s.fetch=b,s.Headers=l,s.Request=g,s.Response=m),e.Headers=l,e.Request=g,e.Response=m,e.fetch=b,Object.defineProperty(e,"__esModule",{value:!0})})({}),s.fetch.ponyfill=!0,delete s.fetch.polyfill,(t=s.fetch).default=s.fetch,t.fetch=s.fetch,t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response,e.exports=t},9472: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__}}()},8027:function(e){"use strict";var t={decodeValues:!0,map:!1,silent:!1};function r(e){return"string"==typeof e&&!!e.trim()}function s(e,s){var i,n,a,o,l=e.split(";").filter(r),h=(i=l.shift(),n="",a="",(o=i.split("=")).length>1?(n=o.shift(),a=o.join("=")):a=i,{name:n,value:a}),c=h.name,u=h.value;s=s?Object.assign({},t,s):t;try{u=s.decodeValues?decodeURIComponent(u):u}catch(e){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+u+"'. Set options.decodeValues to false to disable this feature.",e)}var d={name:c,value:u};return l.forEach(function(e){var t=e.split("="),r=t.shift().trimLeft().toLowerCase(),s=t.join("=");"expires"===r?d.expires=new Date(s):"max-age"===r?d.maxAge=parseInt(s,10):"secure"===r?d.secure=!0:"httponly"===r?d.httpOnly=!0:"samesite"===r?d.sameSite=s:d[r]=s}),d}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 n=e.headers[Object.keys(e.headers).find(function(e){return"set-cookie"===e.toLowerCase()})];n||!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=n}}return(Array.isArray(e)||(e=[e]),(i=i?Object.assign({},t,i):t).map)?e.filter(r).reduce(function(e,t){var r=s(t,i);return e[r.name]=r,e},{}):e.filter(r).map(function(e){return s(e,i)})}e.exports=i,e.exports.parse=i,e.exports.parseString=s,e.exports.splitCookiesString=function(e){if(Array.isArray(e))return e;if("string"!=typeof e)return[];var t,r,s,i,n,a=[],o=0;function l(){for(;o<e.length&&/\s/.test(e.charAt(o));)o+=1;return o<e.length}for(;o<e.length;){for(t=o,n=!1;l();)if(","===(r=e.charAt(o))){for(s=o,o+=1,l(),i=o;o<e.length&&"="!==(r=e.charAt(o))&&";"!==r&&","!==r;)o+=1;o<e.length&&"="===e.charAt(o)?(n=!0,o=i,a.push(e.substring(t,s)),t=o):o=s+1}else o+=1;(!n||o>=e.length)&&a.push(e.substring(t,e.length))}return a}},1775:function(e,t,r){if("object"==typeof globalThis)s=globalThis;else try{s=r(9472)}catch(e){}finally{if(s||"undefined"==typeof window||(s=window),!s)throw Error("Could not determine global this")}var s,i=s.WebSocket||s.MozWebSocket,n=r(5506);function a(e,t){return t?new i(e,t):new i(e)}i&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(e){Object.defineProperty(a,e,{get:function(){return i[e]}})}),e.exports={w3cwebsocket:i?a:null,version:n}},5506:function(e,t,r){e.exports=r(2151).version},9335:function(e,t,r){"use strict";r.r(t),r.d(t,{BrowserCookieAuthStorageAdapter:function(){return tq},CookieAuthStorageAdapter:function(){return tz},DEFAULT_COOKIE_OPTIONS:function(){return tM},createSupabaseClient:function(){return tK},isBrowser:function(){return tF},parseCookies:function(){return tH},parseSupabaseCookie:function(){return tB},serializeCookie:function(){return tX},stringifySupabaseSession:function(){return tJ}}),new TextEncoder;let s=new TextDecoder,i=e=>{let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r};var n,a,o,l,h,c,u,d,f,p,g,y,m,v,b,_,w,k,S,O,T,E=crypto;E.getRandomValues.bind(E),Symbol();let C=e=>{let t=e;t instanceof Uint8Array&&(t=s.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return i(t)}catch(e){throw TypeError("The input to be decoded is not correctly encoded.")}},j=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>{var t,s,i,n;return t=void 0,s=void 0,i=void 0,n=function*(){return yield(yield Promise.resolve().then(r.t.bind(r,9366,23))).fetch(...e)},new(i||(i=Promise))(function(e,r){function a(e){try{l(n.next(e))}catch(e){r(e)}}function o(e){try{l(n.throw(e))}catch(e){r(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof i?r:new i(function(e){e(r)})).then(a,o)}l((n=n.apply(t,s||[])).next())})}:fetch),(...e)=>t(...e)};class I extends Error{constructor(e,t="FunctionsError",r){super(e),this.name=t,this.context=r}}class x extends I{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class P extends I{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class A extends I{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}class ${constructor(e,{headers:t={},customFetch:r}={}){this.url=e,this.headers=t,this.fetch=j(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var r,s,i,n,a;return s=this,i=void 0,n=void 0,a=function*(){try{let s;let{headers:i,method:n,body:a}=t,o={};a&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&("undefined"!=typeof Blob&&a instanceof Blob||a instanceof ArrayBuffer?(o["Content-Type"]="application/octet-stream",s=a):"string"==typeof a?(o["Content-Type"]="text/plain",s=a):"undefined"!=typeof FormData&&a instanceof FormData?s=a:(o["Content-Type"]="application/json",s=JSON.stringify(a)));let l=yield this.fetch(`${this.url}/${e}`,{method:n||"POST",headers:Object.assign(Object.assign(Object.assign({},o),this.headers),i),body:s}).catch(e=>{throw new x(e)}),h=l.headers.get("x-relay-error");if(h&&"true"===h)throw new P(l);if(!l.ok)throw new A(l);let c=(null!==(r=l.headers.get("Content-Type"))&&void 0!==r?r:"text/plain").split(";")[0].trim();return{data:"application/json"===c?yield l.json():"application/octet-stream"===c?yield l.blob():"multipart/form-data"===c?yield l.formData():yield l.text(),error:null}}catch(e){return{data:null,error:e}}},new(n||(n=Promise))(function(e,t){function r(e){try{l(a.next(e))}catch(e){t(e)}}function o(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var s;t.done?e(t.value):((s=t.value)instanceof n?s:new n(function(e){e(s)})).then(r,o)}l((a=a.apply(s,i||[])).next())})}}var R=r(7992),U=r.n(R);class L{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=U():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 r=this.fetch,s=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async e=>{var t,r,s;let i=null,n=null,a=null,o=e.status,l=e.statusText;if(e.ok){if("HEAD"!==this.method){let t=await e.text();""===t||(n="text/csv"===this.headers.Accept?t:this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?t:JSON.parse(t))}let s=null===(t=this.headers.Prefer)||void 0===t?void 0:t.match(/count=(exact|planned|estimated)/),h=null===(r=e.headers.get("content-range"))||void 0===r?void 0:r.split("/");s&&h&&h.length>1&&(a=parseInt(h[1])),this.isMaybeSingle&&"GET"===this.method&&Array.isArray(n)&&(n.length>1?(i={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,a=null,o=406,l="Not Acceptable"):n=1===n.length?n[0]:null)}else{let t=await e.text();try{i=JSON.parse(t),Array.isArray(i)&&404===e.status&&(n=[],i=null,o=200,l="OK")}catch(r){404===e.status&&""===t?(o=204,l="No Content"):i={message:t}}if(i&&this.isMaybeSingle&&(null===(s=null==i?void 0:i.details)||void 0===s?void 0:s.includes("Results contain 0 rows"))&&(i=null,o=200,l="OK"),i&&this.shouldThrowOnError)throw i}let h={error:i,data:n,count:a,status:o,statusText:l};return h});return this.shouldThrowOnError||(s=s.catch(e=>{var t,r,s;return{error:{message:`${null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"FetchError"}: ${null==e?void 0:e.message}`,details:`${null!==(r=null==e?void 0:e.stack)&&void 0!==r?r:""}`,hint:"",code:`${null!==(s=null==e?void 0:e.code)&&void 0!==s?s:""}`},data:null,count:null,status:0,statusText:""}})),s.then(e,t)}}class N extends L{select(e){let t=!1,r=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)).join("");return this.url.searchParams.set("select",r),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:s}={}){let i=s?`${s}.order`:"order",n=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${n?`${n},`:""}${e}.${t?"asc":"desc"}${void 0===r?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t}={}){let r=void 0===t?"limit":`${t}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:r}={}){let s=void 0===r?"offset":`${r}.offset`,i=void 0===r?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${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:r=!1,buffers:s=!1,wal:i=!1,format:n="text"}={}){let a=[e?"analyze":null,t?"verbose":null,r?"settings":null,s?"buffers":null,i?"wal":null].filter(Boolean).join("|"),o=this.headers.Accept;return this.headers.Accept=`application/vnd.pgrst.plan+${n}; for="${o}"; options=${a};`,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 N{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 r=t.map(e=>"string"==typeof e&&RegExp("[,()]").test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),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:r,type:s}={}){let i="";"plain"===s?i="pl":"phrase"===s?i="ph":"websearch"===s&&(i="w");let n=void 0===r?"":`(${r})`;return this.url.searchParams.append(e,`${i}fts${n}.${t}`),this}match(e){return Object.entries(e).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t}={}){let r=t?`${t}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}}class B{constructor(e,{headers:t={},schema:r,fetch:s}){this.url=e,this.headers=t,this.schema=r,this.fetch=s}select(e,{head:t=!1,count:r}={}){let s=!1,i=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!s?"":('"'===e&&(s=!s),e)).join("");return this.url.searchParams.set("select",i),r&&(this.headers.Prefer=`count=${r}`),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:r=!0}={}){let s=[];if(this.headers.Prefer&&s.push(this.headers.Prefer),t&&s.push(`count=${t}`),r||s.push("missing=default"),this.headers.Prefer=s.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:r=!1,count:s,defaultToNull:i=!0}={}){let n=[`resolution=${r?"ignore":"merge"}-duplicates`];if(void 0!==t&&this.url.searchParams.set("on_conflict",t),this.headers.Prefer&&n.push(this.headers.Prefer),s&&n.push(`count=${s}`),i||n.push("missing=default"),this.headers.Prefer=n.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 r=[];return this.headers.Prefer&&r.push(this.headers.Prefer),t&&r.push(`count=${t}`),this.headers.Prefer=r.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 J={"X-Client-Info":"postgrest-js/1.8.4"};class F{constructor(e,{headers:t={},schema:r,fetch:s}={}){this.url=e,this.headers=Object.assign(Object.assign({},J),t),this.schemaName=r,this.fetch=s}from(e){let t=new URL(`${this.url}/${e}`);return new B(t,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new F(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,t={},{head:r=!1,count:s}={}){let i,n;let a=new URL(`${this.url}/rpc/${e}`);r?(i="HEAD",Object.entries(t).forEach(([e,t])=>{a.searchParams.append(e,`${t}`)})):(i="POST",n=t);let o=Object.assign({},this.headers);return s&&(o.Prefer=`count=${s}`),new D({method:i,url:a,headers:o,schema:this.schemaName,body:n,fetch:this.fetch,allowEmpty:!1})}}var M=r(1775);let z={"X-Client-Info":"realtime-js/2.7.4"};(n=y||(y={}))[n.connecting=0]="connecting",n[n.open=1]="open",n[n.closing=2]="closing",n[n.closed=3]="closed",(a=m||(m={})).closed="closed",a.errored="errored",a.joined="joined",a.joining="joining",a.leaving="leaving",(o=v||(v={})).close="phx_close",o.error="phx_error",o.join="phx_join",o.reply="phx_reply",o.leave="phx_leave",o.access_token="access_token",(b||(b={})).websocket="websocket",(l=_||(_={})).Connecting="connecting",l.Open="open",l.Closing="closing",l.Closed="closed";class q{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 K{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),r=new TextDecoder;return this._decodeBroadcast(e,t,r)}_decodeBroadcast(e,t,r){let s=t.getUint8(1),i=t.getUint8(2),n=this.HEADER_LENGTH+2,a=r.decode(e.slice(n,n+s));n+=s;let o=r.decode(e.slice(n,n+i));n+=i;let l=JSON.parse(r.decode(e.slice(n,e.byteLength)));return{ref:null,topic:a,event:o,payload:l}}}class H{constructor(e,t,r={},s=1e4){this.channel=e,this.event=t,this.payload=r,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],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(){if(this._hasReceived("timeout"))return;this.startTimeout(),this.sent=!0;let e=this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()});"rate limited"===e&&(this.rateLimited=!0)}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var r;return this._hasReceived(e)&&t(null===(r=this.receivedResp)||void 0===r?void 0:r.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}}(h=w||(w={})).SYNC="sync",h.JOIN="join",h.LEAVE="leave";class X{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};let r=(null==t?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},e=>{let{onJoin:t,onLeave:r,onSync:s}=this.caller;this.joinRef=this.channel._joinRef(),this.state=X.syncState(this.state,e,t,r),this.pendingDiffs.forEach(e=>{this.state=X.syncDiff(this.state,e,t,r)}),this.pendingDiffs=[],s()}),this.channel._on(r.diff,{},e=>{let{onJoin:t,onLeave:r,onSync:s}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(e):(this.state=X.syncDiff(this.state,e,t,r),s())}),this.onJoin((e,t,r)=>{this.channel._trigger("presence",{event:"join",key:e,currentPresences:t,newPresences:r})}),this.onLeave((e,t,r)=>{this.channel._trigger("presence",{event:"leave",key:e,currentPresences:t,leftPresences:r})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,r,s){let i=this.cloneDeep(e),n=this.transformState(t),a={},o={};return this.map(i,(e,t)=>{n[e]||(o[e]=t)}),this.map(n,(e,t)=>{let r=i[e];if(r){let s=t.map(e=>e.presence_ref),i=r.map(e=>e.presence_ref),n=t.filter(e=>0>i.indexOf(e.presence_ref)),l=r.filter(e=>0>s.indexOf(e.presence_ref));n.length>0&&(a[e]=n),l.length>0&&(o[e]=l)}else a[e]=t}),this.syncDiff(i,{joins:a,leaves:o},r,s)}static syncDiff(e,t,r,s){let{joins:i,leaves:n}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return r||(r=()=>{}),s||(s=()=>{}),this.map(i,(t,s)=>{var i;let n=null!==(i=e[t])&&void 0!==i?i:[];if(e[t]=this.cloneDeep(s),n.length>0){let r=e[t].map(e=>e.presence_ref),s=n.filter(e=>0>r.indexOf(e.presence_ref));e[t].unshift(...s)}r(t,n,s)}),this.map(n,(t,r)=>{let i=e[t];if(!i)return;let n=r.map(e=>e.presence_ref);i=i.filter(e=>0>n.indexOf(e.presence_ref)),e[t]=i,s(t,i,r),0===i.length&&delete e[t]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(r=>t(r,e[r]))}static transformState(e){return Object.getOwnPropertyNames(e=this.cloneDeep(e)).reduce((t,r)=>{let s=e[r];return"metas"in s?t[r]=s.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e)):t[r]=s,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()}}(c=k||(k={})).abstime="abstime",c.bool="bool",c.date="date",c.daterange="daterange",c.float4="float4",c.float8="float8",c.int2="int2",c.int4="int4",c.int4range="int4range",c.int8="int8",c.int8range="int8range",c.json="json",c.jsonb="jsonb",c.money="money",c.numeric="numeric",c.oid="oid",c.reltime="reltime",c.text="text",c.time="time",c.timestamp="timestamp",c.timestamptz="timestamptz",c.timetz="timetz",c.tsrange="tsrange",c.tstzrange="tstzrange";let G=(e,t,r={})=>{var s;let i=null!==(s=r.skipTypes)&&void 0!==s?s:[];return Object.keys(t).reduce((r,s)=>(r[s]=V(s,e,t,i),r),{})},V=(e,t,r,s)=>{let i=t.find(t=>t.name===e),n=null==i?void 0:i.type,a=r[e];return n&&!s.includes(n)?Y(n,a):W(a)},Y=(e,t)=>{if("_"===e.charAt(0)){let r=e.slice(1,e.length);return et(t,r)}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 er(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 r=e.length-1,s=e[r],i=e[0];if("{"===i&&"}"===s){let s;let i=e.slice(1,r);try{s=JSON.parse("["+i+"]")}catch(e){s=i?i.split(","):[]}return s.map(e=>Y(t,e))}return e},er=e=>"string"==typeof e?e.replace(" ","T"):e;var es=function(e,t,r,s){return new(r||(r=Promise))(function(i,n){function a(e){try{l(s.next(e))}catch(e){n(e)}}function o(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((s=s.apply(e,t||[])).next())})};(u=S||(S={})).ALL="*",u.INSERT="INSERT",u.UPDATE="UPDATE",u.DELETE="DELETE",(d=O||(O={})).BROADCAST="broadcast",d.PRESENCE="presence",d.POSTGRES_CHANGES="postgres_changes",(f=T||(T={})).SUBSCRIBED="SUBSCRIBED",f.TIMED_OUT="TIMED_OUT",f.CLOSED="CLOSED",f.CHANNEL_ERROR="CHANNEL_ERROR";class ei{constructor(e,t={config:{}},r){this.topic=e,this.params=t,this.socket=r,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,v.join,this.params,this.timeout),this.rejoinTimer=new q(()=>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(v.reply,{},(e,t)=>{this._trigger(this._replyEventName(t),e)}),this.presence=new X(this)}subscribe(e,t=this.timeout){var r,s;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:n}}=this.params;this._onError(t=>e&&e("CHANNEL_ERROR",t)),this._onClose(()=>e&&e("CLOSED"));let a={},o={broadcast:i,presence:n,postgres_changes:null!==(s=null===(r=this.bindings.postgres_changes)||void 0===r?void 0:r.map(e=>e.filter))&&void 0!==s?s:[]};this.socket.accessToken&&(a.access_token=this.socket.accessToken),this.updateJoinPayload(Object.assign({config:o},a)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",({postgres_changes:t})=>{var r;if(this.socket.accessToken&&this.socket.setAuth(this.socket.accessToken),void 0===t){e&&e("SUBSCRIBED");return}{let s=this.bindings.postgres_changes,i=null!==(r=null==s?void 0:s.length)&&void 0!==r?r:0,n=[];for(let r=0;r<i;r++){let i=s[r],{filter:{event:a,schema:o,table:l,filter:h}}=i,c=t&&t[r];if(c&&c.event===a&&c.schema===o&&c.table===l&&c.filter===h)n.push(Object.assign(Object.assign({},i),{id:c.id}));else{this.unsubscribe(),e&&e("CHANNEL_ERROR",Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=n,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 es(this,void 0,void 0,function*(){return yield this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)})}untrack(e={}){return es(this,void 0,void 0,function*(){return yield this.send({type:"presence",event:"untrack"},e)})}on(e,t,r){return this._on(e,t,r)}send(e,t={}){return new Promise(r=>{var s,i,n;let a=this._push(e.type,e,t.timeout||this.timeout);a.rateLimited&&r("rate limited"),"broadcast"!==e.type||(null===(n=null===(i=null===(s=this.params)||void 0===s?void 0:s.config)||void 0===i?void 0:i.broadcast)||void 0===n?void 0:n.ack)||r("ok"),a.receive("ok",()=>r("ok")),a.receive("timeout",()=>r("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(v.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(r=>{let s=new H(this,v.leave,{},e);s.receive("ok",()=>{t(),r("ok")}).receive("timeout",()=>{t(),r("timed out")}).receive("error",()=>{r("error")}),s.send(),this._canPush()||s.trigger("ok",{})})}_push(e,t,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new H(this,e,t,r);return this._canPush()?s.send():(s.startTimeout(),this.pushBuffer.push(s)),s}_onMessage(e,t,r){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,r){var s,i;let n=e.toLocaleLowerCase(),{close:a,error:o,leave:l,join:h}=v;if(r&&[a,o,l,h].indexOf(n)>=0&&r!==this._joinRef())return;let c=this._onMessage(n,t,r);if(t&&!c)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(n)?null===(s=this.bindings.postgres_changes)||void 0===s||s.filter(e=>{var t,r,s;return(null===(t=e.filter)||void 0===t?void 0:t.event)==="*"||(null===(s=null===(r=e.filter)||void 0===r?void 0:r.event)||void 0===s?void 0:s.toLocaleLowerCase())===n}).map(e=>e.callback(c,r)):null===(i=this.bindings[n])||void 0===i||i.filter(e=>{var r,s,i,a,o,l;if(!["broadcast","presence","postgres_changes"].includes(n))return e.type.toLocaleLowerCase()===n;if("id"in e){let n=e.id,a=null===(r=e.filter)||void 0===r?void 0:r.event;return n&&(null===(s=t.ids)||void 0===s?void 0:s.includes(n))&&("*"===a||(null==a?void 0:a.toLocaleLowerCase())===(null===(i=t.data)||void 0===i?void 0:i.type.toLocaleLowerCase()))}{let r=null===(o=null===(a=null==e?void 0:e.filter)||void 0===a?void 0:a.event)||void 0===o?void 0:o.toLocaleLowerCase();return"*"===r||r===(null===(l=null==t?void 0:t.event)||void 0===l?void 0:l.toLocaleLowerCase())}}).map(e=>{if("object"==typeof c&&"ids"in c){let e=c.data,{schema:t,table:r,commit_timestamp:s,type:i,errors:n}=e;c=Object.assign(Object.assign({},{schema:t,table:r,commit_timestamp:s,eventType:i,new:{},old:{},errors:n}),this._getPayloadRecords(e))}e.callback(c,r)})}_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,r){let s=e.toLocaleLowerCase(),i={type:s,filter:t,callback:r};return this.bindings[s]?this.bindings[s].push(i):this.bindings[s]=[i],this}_off(e,t){let r=e.toLocaleLowerCase();return this.bindings[r]=this.bindings[r].filter(e=>{var s;return!((null===(s=e.type)||void 0===s?void 0:s.toLocaleLowerCase())===r&&ei.isEqual(e.filter,t))}),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(v.close,{},e)}_onError(e){this._on(v.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=G(e.columns,e.record)),("UPDATE"===e.type||"DELETE"===e.type)&&(t.old=G(e.columns,e.old_record)),t}}var en=function(e,t,r,s){return new(r||(r=Promise))(function(i,n){function a(e){try{l(s.next(e))}catch(e){n(e)}}function o(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((s=s.apply(e,t||[])).next())})};let ea=()=>{};class eo{constructor(e,t){var r,s;this.accessToken=null,this.channels=[],this.endPoint="",this.headers=z,this.params={},this.timeout=1e4,this.transport=M.w3cwebsocket,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=ea,this.conn=null,this.sendBuffer=[],this.serializer=new K,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.eventsPerSecondLimitMs=100,this.inThrottle=!1,this.endPoint=`${e}/${b.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 i=null===(r=null==t?void 0:t.params)||void 0===r?void 0:r.eventsPerSecond;i&&(this.eventsPerSecondLimitMs=Math.floor(1e3/i));let n=null===(s=null==t?void 0:t.params)||void 0===s?void 0:s.apikey;n&&(this.accessToken=n),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 q(()=>en(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 en(this,void 0,void 0,function*(){let t=yield e.unsubscribe();return 0===this.channels.length&&this.disconnect(),t})}removeAllChannels(){return en(this,void 0,void 0,function*(){let e=yield Promise.all(this.channels.map(e=>e.unsubscribe()));return this.disconnect(),e})}log(e,t,r){this.logger(e,t,r)}connectionState(){switch(this.conn&&this.conn.readyState){case y.connecting:return _.Connecting;case y.open:return _.Open;case y.closing:return _.Closing;default:return _.Closed}}isConnected(){return this.connectionState()===_.Open}channel(e,t={config:{}}){this.isConnected()||this.connect();let r=new ei(`realtime:${e}`,t,this);return this.channels.push(r),r}push(e){let{topic:t,event:r,payload:s,ref:i}=e,n=()=>{this.encode(e,e=>{var t;null===(t=this.conn)||void 0===t||t.send(e)})};if(this.log("push",`${t} ${r} (${i})`,s),this.isConnected()){if(["broadcast","presence","postgres_changes"].includes(r)){let e=this._throttle(n)();if(e)return"rate limited"}else n()}else this.sendBuffer.push(n)}setAuth(e){this.accessToken=e,this.channels.forEach(t=>{e&&t.updateJoinPayload({access_token:e}),t.joinedOnce&&t._isJoined()&&t._push(v.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:r,payload:s,ref:i}=e;(i&&i===this.pendingHeartbeatRef||r===(null==s?void 0:s.type))&&(this.pendingHeartbeatRef=null),this.log("receive",`${s.status||""} ${t} ${r} ${i&&"("+i+")"||""}`,s),this.channels.filter(e=>e._isMember(t)).forEach(e=>e._trigger(r,s,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(v.error))}_appendParams(e,t){if(0===Object.keys(t).length)return e;let r=e.match(/\?/)?"&":"?",s=new URLSearchParams(t);return`${e}${r}${s}`}_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 el extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function eh(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}class ec extends el{constructor(e,t){super(e),this.name="StorageApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class eu extends el{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}var ed=function(e,t,r,s){return new(r||(r=Promise))(function(i,n){function a(e){try{l(s.next(e))}catch(e){n(e)}}function o(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((s=s.apply(e,t||[])).next())})};let ef=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>ed(void 0,void 0,void 0,function*(){return yield(yield Promise.resolve().then(r.t.bind(r,9366,23))).fetch(...e)}):fetch),(...e)=>t(...e)},ep=()=>ed(void 0,void 0,void 0,function*(){return"undefined"==typeof Response?(yield Promise.resolve().then(r.t.bind(r,9366,23))).Response:Response});var eg=function(e,t,r,s){return new(r||(r=Promise))(function(i,n){function a(e){try{l(s.next(e))}catch(e){n(e)}}function o(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((s=s.apply(e,t||[])).next())})};let ey=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),em=(e,t)=>eg(void 0,void 0,void 0,function*(){let r=yield ep();e instanceof r?e.json().then(r=>{t(new ec(ey(r),e.status||500))}).catch(e=>{t(new eu(ey(e),e))}):t(new eu(ey(e),e))}),ev=(e,t,r,s)=>{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(s),Object.assign(Object.assign({},i),r))};function eb(e,t,r,s,i,n){return eg(this,void 0,void 0,function*(){return new Promise((a,o)=>{e(r,ev(t,s,i,n)).then(e=>{if(!e.ok)throw e;return(null==s?void 0:s.noResolveJson)?e:e.json()}).then(e=>a(e)).catch(e=>em(e,o))})})}function e_(e,t,r,s){return eg(this,void 0,void 0,function*(){return eb(e,"GET",t,r,s)})}function ew(e,t,r,s,i){return eg(this,void 0,void 0,function*(){return eb(e,"POST",t,s,i,r)})}function ek(e,t,r,s,i){return eg(this,void 0,void 0,function*(){return eb(e,"DELETE",t,s,i,r)})}var eS=function(e,t,r,s){return new(r||(r=Promise))(function(i,n){function a(e){try{l(s.next(e))}catch(e){n(e)}}function o(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((s=s.apply(e,t||[])).next())})};let eO={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},eT={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class eE{constructor(e,t={},r,s){this.url=e,this.headers=t,this.bucketId=r,this.fetch=ef(s)}uploadOrUpdate(e,t,r,s){return eS(this,void 0,void 0,function*(){try{let i;let n=Object.assign(Object.assign({},eT),s),a=Object.assign(Object.assign({},this.headers),"POST"===e&&{"x-upsert":String(n.upsert)});"undefined"!=typeof Blob&&r instanceof Blob?((i=new FormData).append("cacheControl",n.cacheControl),i.append("",r)):"undefined"!=typeof FormData&&r instanceof FormData?(i=r).append("cacheControl",n.cacheControl):(i=r,a["cache-control"]=`max-age=${n.cacheControl}`,a["content-type"]=n.contentType);let o=this._removeEmptyFolders(t),l=this._getFinalPath(o),h=yield this.fetch(`${this.url}/object/${l}`,Object.assign({method:e,body:i,headers:a},(null==n?void 0:n.duplex)?{duplex:n.duplex}:{}));if(h.ok)return{data:{path:o},error:null};{let e=yield h.json();return{data:null,error:e}}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}upload(e,t,r){return eS(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,r)})}uploadToSignedUrl(e,t,r,s){return eS(this,void 0,void 0,function*(){let i=this._removeEmptyFolders(e),n=this._getFinalPath(i),a=new URL(this.url+`/object/upload/sign/${n}`);a.searchParams.set("token",t);try{let e;let t=Object.assign({upsert:eT.upsert},s),n=Object.assign(Object.assign({},this.headers),{"x-upsert":String(t.upsert)});"undefined"!=typeof Blob&&r instanceof Blob?((e=new FormData).append("cacheControl",t.cacheControl),e.append("",r)):"undefined"!=typeof FormData&&r instanceof FormData?(e=r).append("cacheControl",t.cacheControl):(e=r,n["cache-control"]=`max-age=${t.cacheControl}`,n["content-type"]=t.contentType);let o=yield this.fetch(a.toString(),{method:"PUT",body:e,headers:n});if(o.ok)return{data:{path:i},error:null};{let e=yield o.json();return{data:null,error:e}}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}createSignedUploadUrl(e){return eS(this,void 0,void 0,function*(){try{let t=this._getFinalPath(e),r=yield ew(this.fetch,`${this.url}/object/upload/sign/${t}`,{},{headers:this.headers}),s=new URL(this.url+r.url),i=s.searchParams.get("token");if(!i)throw new el("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:i},error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}update(e,t,r){return eS(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,r)})}move(e,t){return eS(this,void 0,void 0,function*(){try{let r=yield ew(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers});return{data:r,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}copy(e,t){return eS(this,void 0,void 0,function*(){try{let r=yield ew(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers});return{data:{path:r.Key},error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}createSignedUrl(e,t,r){return eS(this,void 0,void 0,function*(){try{let s=this._getFinalPath(e),i=yield ew(this.fetch,`${this.url}/object/sign/${s}`,Object.assign({expiresIn:t},(null==r?void 0:r.transform)?{transform:r.transform}:{}),{headers:this.headers}),n=(null==r?void 0:r.download)?`&download=${!0===r.download?"":r.download}`:"",a=encodeURI(`${this.url}${i.signedURL}${n}`);return{data:i={signedUrl:a},error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}createSignedUrls(e,t,r){return eS(this,void 0,void 0,function*(){try{let s=yield ew(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),i=(null==r?void 0:r.download)?`&download=${!0===r.download?"":r.download}`:"";return{data:s.map(e=>Object.assign(Object.assign({},e),{signedUrl:e.signedURL?encodeURI(`${this.url}${e.signedURL}${i}`):null})),error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}download(e,t){return eS(this,void 0,void 0,function*(){let r=void 0!==(null==t?void 0:t.transform),s=this.transformOptsToQueryString((null==t?void 0:t.transform)||{}),i=s?`?${s}`:"";try{let t=this._getFinalPath(e),s=yield e_(this.fetch,`${this.url}/${r?"render/image/authenticated":"object"}/${t}${i}`,{headers:this.headers,noResolveJson:!0}),n=yield s.blob();return{data:n,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}getPublicUrl(e,t){let r=this._getFinalPath(e),s=[],i=(null==t?void 0:t.download)?`download=${!0===t.download?"":t.download}`:"";""!==i&&s.push(i);let n=void 0!==(null==t?void 0:t.transform),a=this.transformOptsToQueryString((null==t?void 0:t.transform)||{});""!==a&&s.push(a);let o=s.join("&");return""!==o&&(o=`?${o}`),{data:{publicUrl:encodeURI(`${this.url}/${n?"render/image":"object"}/public/${r}${o}`)}}}remove(e){return eS(this,void 0,void 0,function*(){try{let t=yield ek(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers});return{data:t,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}list(e,t,r){return eS(this,void 0,void 0,function*(){try{let s=Object.assign(Object.assign(Object.assign({},eO),t),{prefix:e||""}),i=yield ew(this.fetch,`${this.url}/object/list/${this.bucketId}`,s,{headers:this.headers},r);return{data:i,error:null}}catch(e){if(eh(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 eC={"X-Client-Info":"storage-js/2.5.3"};var ej=function(e,t,r,s){return new(r||(r=Promise))(function(i,n){function a(e){try{l(s.next(e))}catch(e){n(e)}}function o(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((s=s.apply(e,t||[])).next())})};class eI{constructor(e,t={},r){this.url=e,this.headers=Object.assign(Object.assign({},eC),t),this.fetch=ef(r)}listBuckets(){return ej(this,void 0,void 0,function*(){try{let e=yield e_(this.fetch,`${this.url}/bucket`,{headers:this.headers});return{data:e,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}getBucket(e){return ej(this,void 0,void 0,function*(){try{let t=yield e_(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers});return{data:t,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}createBucket(e,t={public:!1}){return ej(this,void 0,void 0,function*(){try{let r=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});return{data:r,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}updateBucket(e,t){return ej(this,void 0,void 0,function*(){try{let r=yield function(e,t,r,s,i){return eg(this,void 0,void 0,function*(){return eb(e,"PUT",t,s,void 0,r)})}(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});return{data:r,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}emptyBucket(e){return ej(this,void 0,void 0,function*(){try{let t=yield ew(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers});return{data:t,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}deleteBucket(e){return ej(this,void 0,void 0,function*(){try{let t=yield ek(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers});return{data:t,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}}class ex extends eI{constructor(e,t={},r){super(e,t,r)}from(e){return new eE(this.url,this.headers,e,this.fetch)}}var eP=r(9366),eA=r.n(eP);let e$=e=>{let t;return t=e||("undefined"==typeof fetch?eA():fetch),(...e)=>t(...e)},eR=()=>"undefined"==typeof Headers?eP.Headers:Headers,eU=(e,t,r)=>{let s=e$(r),i=eR();return(r,n)=>{var a,o,l,h;return a=void 0,o=void 0,l=void 0,h=function*(){var a;let o=null!==(a=yield t())&&void 0!==a?a:e,l=new i(null==n?void 0:n.headers);return l.has("apikey")||l.set("apikey",e),l.has("Authorization")||l.set("Authorization",`Bearer ${o}`),s(r,Object.assign(Object.assign({},n),{headers:l}))},new(l||(l=Promise))(function(e,t){function r(e){try{i(h.next(e))}catch(e){t(e)}}function s(e){try{i(h.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):((i=t.value)instanceof l?i:new l(function(e){e(i)})).then(r,s)}i((h=h.apply(a,o||[])).next())})}},eL=()=>"undefined"!=typeof document,eN={tested:!1,writable:!1},eD=()=>{if(!eL())return!1;try{if("object"!=typeof globalThis.localStorage)return!1}catch(e){return!1}if(eN.tested)return eN.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),eN.tested=!0,eN.writable=!0}catch(e){eN.tested=!0,eN.writable=!1}return eN.writable};function eB(e){let t={},r=new URL(e);if(r.hash&&"#"===r.hash[0])try{let e=new URLSearchParams(r.hash.substring(1));e.forEach((e,r)=>{t[r]=e})}catch(e){}return r.searchParams.forEach((e,r)=>{t[r]=e}),t}let eJ=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>Promise.resolve().then(r.t.bind(r,7992,23)).then(({default:t})=>t(...e)):fetch),(...e)=>t(...e)},eF=e=>"object"==typeof e&&null!==e&&"status"in e&&"ok"in e&&"json"in e&&"function"==typeof e.json,eM=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},ez=async(e,t)=>{let r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch(e){return r}},eq=async(e,t)=>{await e.removeItem(t)};class eK{constructor(){this.promise=new eK.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}function eH(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");let r=t[1];return JSON.parse(function(e){let t,r,s,i,n,a,o;let l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",h="",c=0;for(e=e.replace("-","+").replace("_","/");c<e.length;)i=l.indexOf(e.charAt(c++)),n=l.indexOf(e.charAt(c++)),a=l.indexOf(e.charAt(c++)),o=l.indexOf(e.charAt(c++)),t=i<<2|n>>4,r=(15&n)<<4|a>>2,s=(3&a)<<6|o,h+=String.fromCharCode(t),64!=a&&0!=r&&(h+=String.fromCharCode(r)),64!=o&&0!=s&&(h+=String.fromCharCode(s));return h}(r))}async function eX(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function eG(e){return("0"+e.toString(16)).substr(-2)}function eV(){let e=new Uint32Array(56);if("undefined"==typeof crypto){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",t=e.length,r="";for(let s=0;s<56;s++)r+=e.charAt(Math.floor(Math.random()*t));return r}return crypto.getRandomValues(e),Array.from(e,eG).join("")}async function eY(e){let t=new TextEncoder,r=t.encode(e),s=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(s);return Array.from(i).map(e=>String.fromCharCode(e)).join("")}async function eW(e){if("undefined"==typeof crypto)return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;let t=await eY(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}eK.promiseConstructor=Promise;class eZ extends Error{constructor(e,t){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t}}function eQ(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class e0 extends eZ{constructor(e,t){super(e,t),this.name="AuthApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class e1 extends eZ{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class e2 extends eZ{constructor(e,t,r){super(e),this.name=t,this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class e3 extends e2{constructor(){super("Auth session missing!","AuthSessionMissingError",400)}}class e6 extends e2{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500)}}class e4 extends e2{constructor(e){super(e,"AuthInvalidCredentialsError",400)}}class e5 extends e2{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 e9 extends e2{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 e8 extends e2{constructor(e,t){super(e,"AuthRetryableFetchError",t)}}function e7(e){return eQ(e)&&"AuthRetryableFetchError"===e.name}var te=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&0>t.indexOf(s)&&(r[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)0>t.indexOf(s[i])&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(r[s[i]]=e[s[i]]);return r};let tt=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),tr=[502,503,504];async function ts(e){let t;if(!eF(e))throw new e8(tt(e),0);if(tr.includes(e.status))throw new e8(tt(e),e.status);try{t=await e.json()}catch(e){throw new e1(tt(e),e)}throw new e0(tt(t),e.status||500)}let ti=(e,t,r,s)=>{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(s),Object.assign(Object.assign({},i),r))};async function tn(e,t,r,s){var i;let n=Object.assign({},null==s?void 0:s.headers);(null==s?void 0:s.jwt)&&(n.Authorization=`Bearer ${s.jwt}`);let a=null!==(i=null==s?void 0:s.query)&&void 0!==i?i:{};(null==s?void 0:s.redirectTo)&&(a.redirect_to=s.redirectTo);let o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",l=await ta(e,t,r+o,{headers:n,noResolveJson:null==s?void 0:s.noResolveJson},{},null==s?void 0:s.body);return(null==s?void 0:s.xform)?null==s?void 0:s.xform(l):{data:Object.assign({},l),error:null}}async function ta(e,t,r,s,i,n){let a;let o=ti(t,s,i,n);try{a=await e(r,o)}catch(e){throw console.error(e),new e8(tt(e),0)}if(a.ok||await ts(a),null==s?void 0:s.noResolveJson)return a;try{return await a.json()}catch(e){await ts(e)}}function to(e){var t;let r=null;e.access_token&&e.refresh_token&&e.expires_in&&(r=Object.assign({},e),e.expires_at||(r.expires_at=function(e){let t=Math.round(Date.now()/1e3);return t+e}(e.expires_in)));let s=null!==(t=e.user)&&void 0!==t?t:e;return{data:{session:r,user:s},error:null}}function tl(e){var t;let r=null!==(t=e.user)&&void 0!==t?t:e;return{data:{user:r},error:null}}function th(e){return{data:e,error:null}}function tc(e){let{action_link:t,email_otp:r,hashed_token:s,redirect_to:i,verification_type:n}=e,a=te(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o=Object.assign({},a);return{data:{properties:{action_link:t,email_otp:r,hashed_token:s,redirect_to:i,verification_type:n},user:o},error:null}}function tu(e){return e}var td=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&0>t.indexOf(s)&&(r[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)0>t.indexOf(s[i])&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(r[s[i]]=e[s[i]]);return r};class tf{constructor({url:e="",headers:t={},fetch:r}){this.url=e,this.headers=t,this.fetch=eJ(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,t="global"){try{return await tn(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(eQ(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await tn(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:tl})}catch(e){if(eQ(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,r=td(e,["options"]),s=Object.assign(Object.assign({},r),t);return"newEmail"in r&&(s.new_email=null==r?void 0:r.newEmail,delete s.newEmail),await tn(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:tc,redirectTo:null==t?void 0:t.redirectTo})}catch(e){if(eQ(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await tn(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:tl})}catch(e){if(eQ(e))return{data:{user:null},error:e};throw e}}async listUsers(e){var t,r,s,i,n,a,o;try{let l={nextPage:null,lastPage:0,total:0},h=await tn(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:null!==(r=null===(t=null==e?void 0:e.page)||void 0===t?void 0:t.toString())&&void 0!==r?r:"",per_page:null!==(i=null===(s=null==e?void 0:e.perPage)||void 0===s?void 0:s.toString())&&void 0!==i?i:""},xform:tu});if(h.error)throw h.error;let c=await h.json(),u=null!==(n=h.headers.get("x-total-count"))&&void 0!==n?n:0,d=null!==(o=null===(a=h.headers.get("link"))||void 0===a?void 0:a.split(","))&&void 0!==o?o:[];return d.length>0&&(d.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);l[`${r}Page`]=t}),l.total=parseInt(u)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(e){if(eQ(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){try{return await tn(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:tl})}catch(e){if(eQ(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){try{return await tn(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:tl})}catch(e){if(eQ(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){try{return await tn(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:tl})}catch(e){if(eQ(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){try{let{data:t,error:r}=await tn(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:r}}catch(e){if(eQ(e))return{data:null,error:e};throw e}}async _deleteFactor(e){try{let t=await tn(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers});return{data:t,error:null}}catch(e){if(eQ(e))return{data:null,error:e};throw e}}}let tp="2.51.0",tg={"X-Client-Info":`gotrue-js/${tp}`};var ty={getItem:e=>eD()?globalThis.localStorage.getItem(e):null,setItem:(e,t)=>{eD()&&globalThis.localStorage.setItem(e,t)},removeItem:e=>{eD()&&globalThis.localStorage.removeItem(e)}};globalThis&&eD()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class tm extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}!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 tv={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:tg,flowType:"implicit",debug:!1};async function tb(e,t,r){return await r()}class t_{constructor(e){var t;this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.instanceID=t_.nextInstanceID,t_.nextInstanceID+=1,this.instanceID>0&&eL()&&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 r=Object.assign(Object.assign({},tv),e);if(this.logDebugMessages=r.debug,this.inMemorySession=null,this.storageKey=r.storageKey,this.autoRefreshToken=r.autoRefreshToken,this.persistSession=r.persistSession,this.storage=r.storage||ty,this.admin=new tf({url:r.url,headers:r.headers,fetch:r.fetch}),this.url=r.url,this.headers=r.headers,this.fetch=eJ(r.fetch),this.lock=r.lock||tb,this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.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===ty&&!eD()&&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.`),eL()&&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",async e=>{this._debug("received broadcast notification from other tab or client",e),await this._notifyAllSubscribers(e.data.event,e.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&console.log(`GoTrueClient@${this.instanceID} (${tp}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise||(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))()),await this.initializePromise}async _initialize(){try{let e=!!eL()&&await this._isPKCEFlow();if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){let{data:t,error:r}=await this._getSessionFromURL(e);if(r)return this._debug("#_initialize()","error detecting session from URL",r),await this._removeSession(),{error:r};let{session:s,redirectType:i}=t;return this._debug("#_initialize()","detected session in URL",s,"redirect type",i),await this._saveSession(s),setTimeout(async()=>{"recovery"===i?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){if(eQ(e))return{error:e};return{error:new e1("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signUp(e){var t,r,s;try{let i;if(await this._removeSession(),"email"in e){let{email:r,password:s,options:n}=e,a=null,o=null;if("pkce"===this.flowType){let e=eV();await eM(this.storage,`${this.storageKey}-code-verifier`,e),a=await eW(e),o=e===a?"plain":"s256"}i=await tn(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null==n?void 0:n.emailRedirectTo,body:{email:r,password:s,data:null!==(t=null==n?void 0:n.data)&&void 0!==t?t:{},gotrue_meta_security:{captcha_token:null==n?void 0:n.captchaToken},code_challenge:a,code_challenge_method:o},xform:to})}else if("phone"in e){let{phone:t,password:n,options:a}=e;i=await tn(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:n,data:null!==(r=null==a?void 0:a.data)&&void 0!==r?r:{},channel:null!==(s=null==a?void 0:a.channel)&&void 0!==s?s:"sms",gotrue_meta_security:{captcha_token:null==a?void 0:a.captchaToken}},xform:to})}else throw new e4("You must provide either an email or phone number and a password");let{data:n,error:a}=i;if(a||!n)return{data:{user:null,session:null},error:a};let o=n.session,l=n.user;return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",o)),{data:{user:l,session:o},error:null}}catch(e){if(eQ(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithPassword(e){try{let t;if(await this._removeSession(),"email"in e){let{email:r,password:s,options:i}=e;t=await tn(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:r,password:s,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:to})}else if("phone"in e){let{phone:r,password:s,options:i}=e;t=await tn(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:r,password:s,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:to})}else throw new e4("You must provide either an email or phone number and a password");let{data:r,error:s}=t;if(s)return{data:{user:null,session:null},error:s};if(!r||!r.session||!r.user)return{data:{user:null,session:null},error:new e6};return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:{user:r.user,session:r.session},error:s}}catch(e){if(eQ(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithOAuth(e){var t,r,s,i;return await this._removeSession(),await this._handleProviderSignIn(e.provider,{redirectTo:null===(t=e.options)||void 0===t?void 0:t.redirectTo,scopes:null===(r=e.options)||void 0===r?void 0:r.scopes,queryParams:null===(s=e.options)||void 0===s?void 0:s.queryParams,skipBrowserRedirect:null===(i=e.options)||void 0===i?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){let t=await ez(this.storage,`${this.storageKey}-code-verifier`),{data:r,error:s}=await tn(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:t},xform:to});return(await eq(this.storage,`${this.storageKey}-code-verifier`),s)?{data:{user:null,session:null},error:s}:r&&r.session&&r.user?(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:r,error:s}):{data:{user:null,session:null},error:new e6}}async signInWithIdToken(e){await this._removeSession();try{let{options:t,provider:r,token:s,access_token:i,nonce:n}=e,a=await tn(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:i,nonce:n,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:to}),{data:o,error:l}=a;if(l)return{data:{user:null,session:null},error:l};if(!o||!o.session||!o.user)return{data:{user:null,session:null},error:new e6};return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),{data:o,error:l}}catch(e){if(eQ(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithOtp(e){var t,r,s,i,n;try{if(await this._removeSession(),"email"in e){let{email:s,options:i}=e,n=null,a=null;if("pkce"===this.flowType){let e=eV();await eM(this.storage,`${this.storageKey}-code-verifier`,e),n=await eW(e),a=e===n?"plain":"s256"}let{error:o}=await tn(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:s,data:null!==(t=null==i?void 0:i.data)&&void 0!==t?t:{},create_user:null===(r=null==i?void 0:i.shouldCreateUser)||void 0===r||r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},code_challenge:n,code_challenge_method:a},redirectTo:null==i?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:o}}if("phone"in e){let{phone:t,options:r}=e,{data:a,error:o}=await tn(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!==(s=null==r?void 0:r.data)&&void 0!==s?s:{},create_user:null===(i=null==r?void 0:r.shouldCreateUser)||void 0===i||i,gotrue_meta_security:{captcha_token:null==r?void 0:r.captchaToken},channel:null!==(n=null==r?void 0:r.channel)&&void 0!==n?n:"sms"}});return{data:{user:null,session:null,messageId:null==a?void 0:a.message_id},error:o}}throw new e4("You must provide either an email or phone number.")}catch(e){if(eQ(e))return{data:{user:null,session:null},error:e};throw e}}async verifyOtp(e){var t,r;try{let s,i;"email_change"!==e.type&&"phone_change"!==e.type&&await this._removeSession(),"options"in e&&(s=null===(t=e.options)||void 0===t?void 0:t.redirectTo,i=null===(r=e.options)||void 0===r?void 0:r.captchaToken);let{data:n,error:a}=await tn(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:to});if(a)throw a;if(!n)throw Error("An error occurred on token verification.");let o=n.session,l=n.user;return(null==o?void 0:o.access_token)&&(await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)),{data:{user:l,session:o},error:null}}catch(e){if(eQ(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithSSO(e){var t,r,s;try{return await this._removeSession(),await tn(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!==(r=null===(t=e.options)||void 0===t?void 0:t.redirectTo)&&void 0!==r?r:void 0}),(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0}),headers:this.headers,xform:th})}catch(e){if(eQ(e))return{data:null,error:e};throw e}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)throw r;if(!t)throw new e3;let{error:s}=await tn(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return{data:{user:null,session:null},error:s}})}catch(e){if(eQ(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{"email_change"!=e.type&&"phone_change"!=e.type&&await this._removeSession();let t=`${this.url}/resend`;if("email"in e){let{email:r,type:s,options:i}=e,{error:n}=await tn(this.fetch,"POST",t,{headers:this.headers,body:{email:r,type:s,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:n}}if("phone"in e){let{phone:r,type:s,options:i}=e,{data:n,error:a}=await tn(this.fetch,"POST",t,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:null==n?void 0:n.message_id},error:a}}throw new e4("You must provide either an email or phone number and a type")}catch(e){if(eQ(e))return{data:{user:null,session:null},error:e};throw e}}async getSession(){return await this.initializePromise,this._acquireLock(-1,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await r}catch(e){}})()),r}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch(e){}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",Error().stack);try{let e=null;if(this.persistSession){let t=await 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"),await 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("#__loadSession()",`session has${t?"":" not"} expired`,"expires_at",e.expires_at),!t)return{data:{session:e},error:null};let{session:r,error:s}=await this._callRefreshToken(e.refresh_token);if(s)return{data:{session:null},error:s};return{data:{session:r},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{if(e)return await tn(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:tl});return await this._useSession(async e=>{var t,r;let{data:s,error:i}=e;if(i)throw i;return await tn(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:null!==(r=null===(t=s.session)||void 0===t?void 0:t.access_token)&&void 0!==r?r:void 0,xform:tl})})}catch(e){if(eQ(e))return{data:{user:null},error:e};throw e}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async r=>{let{data:s,error:i}=r;if(i)throw i;if(!s.session)throw new e3;let n=s.session,a=null,o=null;if("pkce"===this.flowType&&null!=e.email){let e=eV();await eM(this.storage,`${this.storageKey}-code-verifier`,e),a=await eW(e),o=e===a?"plain":"s256"}let{data:l,error:h}=await tn(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:null==t?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:o}),jwt:n.access_token,xform:tl});if(h)throw h;return n.user=l.user,await this._saveSession(n),await this._notifyAllSubscribers("USER_UPDATED",n),{data:{user:n.user},error:null}})}catch(e){if(eQ(e))return{data:{user:null},error:e};throw e}}_decodeJWT(e){return eH(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new e3;let t=Date.now()/1e3,r=t,s=!0,i=null,n=eH(e.access_token);if(n.exp&&(s=(r=n.exp)<=t),s){let{session:t,error:r}=await this._callRefreshToken(e.refresh_token);if(r)return{data:{user:null,session:null},error:r};if(!t)return{data:{user:null,session:null},error:null};i=t}else{let{data:s,error:n}=await this._getUser(e.access_token);if(n)throw n;i={access_token:e.access_token,refresh_token:e.refresh_token,user:s.user,token_type:"bearer",expires_in:r-t,expires_at:r},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(e){if(eQ(e))return{data:{session:null,user:null},error:e};throw e}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var r;if(!e){let{data:s,error:i}=t;if(i)throw i;e=null!==(r=s.session)&&void 0!==r?r:void 0}if(!(null==e?void 0:e.refresh_token))throw new e3;let{session:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{user:null,session:null},error:i}:s?{data:{user:s.user,session:s},error:null}:{data:{user:null,session:null},error:null}})}catch(e){if(eQ(e))return{data:{user:null,session:null},error:e};throw e}}async _getSessionFromURL(e){try{if(!eL())throw new e5("No browser detected.");if("implicit"!==this.flowType||this._isImplicitGrantFlow()){if("pkce"==this.flowType&&!e)throw new e9("Not a valid PKCE flow url.")}else throw new e5("Not a valid implicit grant flow url.");let t=eB(window.location.href);if(e){if(!t.code)throw new e9("No code detected.");let{data:e,error:r}=await this._exchangeCodeForSession(t.code);if(r)throw r;let s=new URL(window.location.href);return s.searchParams.delete("code"),window.history.replaceState(window.history.state,"",s.toString()),{data:{session:e.session,redirectType:null},error:null}}if(t.error||t.error_description||t.error_code)throw new e5(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});let{provider_token:r,provider_refresh_token:s,access_token:i,refresh_token:n,expires_in:a,expires_at:o,token_type:l}=t;if(!i||!a||!n||!l)throw new e5("No session defined in URL");let h=Math.round(Date.now()/1e3),c=parseInt(a),u=h+c;o&&(u=parseInt(o));let d=u-h;1e3*d<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${c}s`);let f=u-c;h-f>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",f,u,h):h-f<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clok for skew",f,u,h);let{data:p,error:g}=await this._getUser(i);if(g)throw g;let y={provider_token:r,provider_refresh_token:s,access_token:i,expires_in:c,expires_at:u,refresh_token:n,token_type:l,user:p.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:y,redirectType:t.type},error:null}}catch(e){if(eQ(e))return{data:{session:null,redirectType:null},error:e};throw e}}_isImplicitGrantFlow(){let e=eB(window.location.href);return!!(eL()&&(e.access_token||e.error_description))}async _isPKCEFlow(){let e=eB(window.location.href),t=await ez(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var r;let{data:s,error:i}=t;if(i)return{error:i};let n=null===(r=s.session)||void 0===r?void 0:r.access_token;if(n){let{error:t}=await this.admin.signOut(n,e);if(t&&!(eQ(t)&&"AuthApiError"===t.name&&(404===t.status||401===t.status)))return{error:t}}return"others"!==e&&(await this._removeSession(),await eq(this.storage,`${this.storageKey}-code-verifier`),await 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)}),r={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,r),(async()=>{await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async t=>{var r,s;try{let{data:{session:s},error:i}=t;if(i)throw i;await (null===(r=this.stateChangeEmitters.get(e))||void 0===r?void 0:r.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",e,"session",s)}catch(t){await (null===(s=this.stateChangeEmitters.get(e))||void 0===s?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",t),console.error(t)}})}async resetPasswordForEmail(e,t={}){let r=null,s=null;if("pkce"===this.flowType){let e=eV();await eM(this.storage,`${this.storageKey}-code-verifier`,e),r=await eW(e),s=e===r?"plain":"s256"}try{return await tn(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(eQ(e))return{data:null,error:e};throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{let r=Date.now();return await function(e,t){let r=new Promise((r,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{let s=await e(i);if(!t(i,null,s)){r(s);return}}catch(e){if(!t(i,e)){s(e);return}}})()});return r}(async r=>(await eX(200*r),this._debug(t,"refreshing attempt",r),await tn(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:to})),(e,t,s)=>s&&s.error&&e7(s.error)&&Date.now()+(e+1)*200-r<3e4)}catch(e){if(this._debug(t,"error",e),eQ(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}async _handleProviderSignIn(e,t){let r=await this._getUrlForProvider(e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",r),eL()&&!t.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e;let t="#_recoverAndRefresh()";this._debug(t,"begin");try{let r=await ez(this.storage,this.storageKey);if(this._debug(t,"session from storage",r),!this._isValidSession(r)){this._debug(t,"session is not valid"),null!==r&&await this._removeSession();return}let s=Math.round(Date.now()/1e3),i=(null!==(e=r.expires_at)&&void 0!==e?e:1/0)<s+10;if(this._debug(t,`session has${i?"":" not"} expired with margin of 10s`),i){if(this.autoRefreshToken&&r.refresh_token){let{error:e}=await this._callRefreshToken(r.refresh_token);e&&(console.error(e),e7(e)||(this._debug(t,"refresh failed with a non-retryable error, removing the session",e),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",r)}catch(e){this._debug(t,"error",e),console.error(e);return}finally{this._debug(t,"end")}}async _callRefreshToken(e){var t,r;if(!e)throw new e3;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new eK;let{data:t,error:r}=await this._refreshAccessToken(e);if(r)throw r;if(!t.session)throw new e3;await this._saveSession(t.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",t.session);let s={session:t.session,error:null};return this.refreshingDeferred.resolve(s),s}catch(e){if(this._debug(s,"error",e),eQ(e)){let r={session:null,error:e};return null===(t=this.refreshingDeferred)||void 0===t||t.resolve(r),r}throw null===(r=this.refreshingDeferred)||void 0===r||r.reject(e),e}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,t,r=!0){let s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",t,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:t});let s=[],i=Array.from(this.stateChangeEmitters.values()).map(async r=>{try{await r.callback(e,t)}catch(e){s.push(e)}});if(await Promise.all(i),s.length>0){for(let e=0;e<s.length;e+=1)console.error(s[e]);throw s[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.persistSession||(this.inMemorySession=e),this.persistSession&&e.expires_at&&await this._persistSession(e)}_persistSession(e){return this._debug("#_persistSession()",e),eM(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),this.persistSession?await eq(this.storage,this.storageKey):this.inMemorySession=null}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&eL()&&(null==window?void 0:window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(e){console.error("removing visibilitychange callback failed",e)}}async _startAutoRefresh(){await 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),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let s=Math.floor((1e3*r.expires_at-e)/3e4);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts 30000ms, refresh threshold is 3 ticks`),s<=3&&await this._callRefreshToken(r.refresh_token)})}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof tm)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!eL()||!(null==window?void 0:window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),null==window||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if("visible"!==document.visibilityState){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t){let r=[`provider=${encodeURIComponent(e)}`];if((null==t?void 0:t.redirectTo)&&r.push(`redirect_to=${encodeURIComponent(t.redirectTo)}`),(null==t?void 0:t.scopes)&&r.push(`scopes=${encodeURIComponent(t.scopes)}`),"pkce"===this.flowType){let e=eV();await eM(this.storage,`${this.storageKey}-code-verifier`,e);let t=await eW(e),s=e===t?"plain":"s256";this._debug("PKCE","code verifier",`${e.substring(0,5)}...`,"code challenge",t,"method",s);let i=new URLSearchParams({code_challenge:`${encodeURIComponent(t)}`,code_challenge_method:`${encodeURIComponent(s)}`});r.push(i.toString())}if(null==t?void 0:t.queryParams){let e=new URLSearchParams(t.queryParams);r.push(e.toString())}return`${this.url}/authorize?${r.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var r;let{data:s,error:i}=t;return i?{data:null,error:i}:await tn(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null===(r=null==s?void 0:s.session)||void 0===r?void 0:r.access_token})})}catch(e){if(eQ(e))return{data:null,error:e};throw e}}async _enroll(e){try{return await this._useSession(async t=>{var r,s;let{data:i,error:n}=t;if(n)return{data:null,error:n};let{data:a,error:o}=await tn(this.fetch,"POST",`${this.url}/factors`,{body:{friendly_name:e.friendlyName,factor_type:e.factorType,issuer:e.issuer},headers:this.headers,jwt:null===(r=null==i?void 0:i.session)||void 0===r?void 0:r.access_token});return o?{data:null,error:o}:((null===(s=null==a?void 0:a.totp)||void 0===s?void 0:s.qr_code)&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),{data:a,error:null})})}catch(e){if(eQ(e))return{data:null,error:e};throw e}}async _verify(e){try{return await this._useSession(async t=>{var r;let{data:s,error:i}=t;if(i)return{data:null,error:i};let{data:n,error:a}=await tn(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:null===(r=null==s?void 0:s.session)||void 0===r?void 0:r.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+n.expires_in},n)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",n),{data:n,error:a})})}catch(e){if(eQ(e))return{data:null,error:e};throw e}}async _challenge(e){try{return await this._useSession(async t=>{var r;let{data:s,error:i}=t;return i?{data:null,error:i}:await tn(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{headers:this.headers,jwt:null===(r=null==s?void 0:s.session)||void 0===r?void 0:r.access_token})})}catch(e){if(eQ(e))return{data:null,error:e};throw e}}async _challengeAndVerify(e){let{data:t,error:r}=await this._challenge({factorId:e.factorId});return r?{data:null,error:r}:await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){let{data:{user:e},error:t}=await this._getUser();if(t)return{data:null,error:t};let r=(null==e?void 0:e.factors)||[],s=r.filter(e=>"totp"===e.factor_type&&"verified"===e.status);return{data:{all:r,totp:s},error:null}}async _getAuthenticatorAssuranceLevel(){return await this._useSession(async e=>{var t,r;let{data:{session:s},error:i}=e;if(i)return{data:null,error:i};if(!s)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let n=this._decodeJWT(s.access_token),a=null;n.aal&&(a=n.aal);let o=a,l=null!==(r=null===(t=s.user.factors)||void 0===t?void 0:t.filter(e=>"verified"===e.status))&&void 0!==r?r:[];l.length>0&&(o="aal2");let h=n.amr||[];return{data:{currentLevel:a,nextLevel:o,currentAuthenticationMethods:h},error:null}})}}t_.nextInstanceID=0;class tw extends t_{constructor(e){super(e)}}let tk={headers:{"X-Client-Info":"supabase-js/2.33.1"}},tS={schema:"public"},tO={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},tT={};class tE{constructor(e,t,r){var s,i,n,a,o,l,h,c;if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw Error("supabaseUrl is required.");if(!t)throw Error("supabaseKey is required.");let u=e.replace(/\/$/,"");this.realtimeUrl=`${u}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${u}/auth/v1`,this.storageUrl=`${u}/storage/v1`,this.functionsUrl=`${u}/functions/v1`;let d=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,f={db:tS,realtime:tT,auth:Object.assign(Object.assign({},tO),{storageKey:d}),global:tk},p=function(e,t){let{db:r,auth:s,realtime:i,global:n}=e,{db:a,auth:o,realtime:l,global:h}=t;return{db:Object.assign(Object.assign({},a),r),auth:Object.assign(Object.assign({},o),s),realtime:Object.assign(Object.assign({},l),i),global:Object.assign(Object.assign({},h),n)}}(null!=r?r:{},f);this.storageKey=null!==(i=null===(s=p.auth)||void 0===s?void 0:s.storageKey)&&void 0!==i?i:"",this.headers=null!==(a=null===(n=p.global)||void 0===n?void 0:n.headers)&&void 0!==a?a:{},this.auth=this._initSupabaseAuthClient(null!==(o=p.auth)&&void 0!==o?o:{},this.headers,null===(l=p.global)||void 0===l?void 0:l.fetch),this.fetch=eU(t,this._getAccessToken.bind(this),null===(h=p.global)||void 0===h?void 0:h.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},p.realtime)),this.rest=new F(`${u}/rest/v1`,{headers:this.headers,schema:null===(c=p.db)||void 0===c?void 0:c.schema,fetch:this.fetch}),this._listenForAuthEvents()}get functions(){return new $(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new ex(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r){return this.rest.rpc(e,t,r)}channel(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,r,s,i,n;return r=this,s=void 0,i=void 0,n=function*(){let{data:r}=yield this.auth.getSession();return null!==(t=null===(e=r.session)||void 0===e?void 0:e.access_token)&&void 0!==t?t:null},new(i||(i=Promise))(function(e,t){function a(e){try{l(n.next(e))}catch(e){t(e)}}function o(e){try{l(n.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof i?r:new i(function(e){e(r)})).then(a,o)}l((n=n.apply(r,s||[])).next())})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:s,storageKey:i,flowType:n,debug:a},o,l){let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new tw({url:this.authUrl,headers:Object.assign(Object.assign({},h),o),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:s,flowType:n,debug:a,fetch:l})}_initRealtimeClient(e){return new eo(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,r){("TOKEN_REFRESHED"===e||"SIGNED_IN"===e)&&this.changedAccessToken!==r?(this.realtime.setAuth(null!=r?r:null),this.changedAccessToken=r):"SIGNED_OUT"===e&&(this.realtime.setAuth(this.supabaseKey),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0)}}let tC=(e,t,r)=>new tE(e,t,r);var tj=Object.create,tI=Object.defineProperty,tx=Object.getOwnPropertyDescriptor,tP=Object.getOwnPropertyNames,tA=Object.getPrototypeOf,t$=Object.prototype.hasOwnProperty,tR=(e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of tP(t))t$.call(e,i)||i===r||tI(e,i,{get:()=>t[i],enumerable:!(s=tx(t,i))||s.enumerable});return e},tU=(e,t,r)=>(r=null!=e?tj(tA(e)):{},tR(!t&&e&&e.__esModule?r:tI(r,"default",{value:e,enumerable:!0}),e)),tL=(p={"../../node_modules/.pnpm/cookie@0.5.0/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 r={},i=(t||{}).decode||s,n=0;n<e.length;){var a=e.indexOf("=",n);if(-1===a)break;var o=e.indexOf(";",n);if(-1===o)o=e.length;else if(o<a){n=e.lastIndexOf(";",a-1)+1;continue}var l=e.slice(n,a).trim();if(void 0===r[l]){var h=e.slice(a+1,o).trim();34===h.charCodeAt(0)&&(h=h.slice(1,-1)),r[l]=function(e,t){try{return t(e)}catch(t){return e}}(h,i)}n=o+1}return r},e.serialize=function(e,s,n){var a=n||{},o=a.encode||i;if("function"!=typeof o)throw TypeError("option encode is invalid");if(!r.test(e))throw TypeError("argument name is invalid");var l=o(s);if(l&&!r.test(l))throw TypeError("argument val is invalid");var h=e+"="+l;if(null!=a.maxAge){var c=a.maxAge-0;if(isNaN(c)||!isFinite(c))throw TypeError("option maxAge is invalid");h+="; Max-Age="+Math.floor(c)}if(a.domain){if(!r.test(a.domain))throw TypeError("option domain is invalid");h+="; Domain="+a.domain}if(a.path){if(!r.test(a.path))throw TypeError("option path is invalid");h+="; Path="+a.path}if(a.expires){var u=a.expires;if("[object Date]"!==t.call(u)&&!(u instanceof Date)||isNaN(u.valueOf()))throw TypeError("option expires is invalid");h+="; Expires="+u.toUTCString()}if(a.httpOnly&&(h+="; HttpOnly"),a.secure&&(h+="; Secure"),a.priority)switch("string"==typeof a.priority?a.priority.toLowerCase():a.priority){case"low":h+="; Priority=Low";break;case"medium":h+="; Priority=Medium";break;case"high":h+="; Priority=High";break;default:throw TypeError("option priority is invalid")}if(a.sameSite)switch("string"==typeof a.sameSite?a.sameSite.toLowerCase():a.sameSite){case!0:case"strict":h+="; SameSite=Strict";break;case"lax":h+="; SameSite=Lax";break;case"none":h+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return h};var t=Object.prototype.toString,r=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(e){return -1!==e.indexOf("%")?decodeURIComponent(e):e}function i(e){return encodeURIComponent(e)}}},function(){return g||(0,p[tP(p)[0]])((g={exports:{}}).exports,g),g.exports}),tN=tU(tL()),tD=tU(tL());function tB(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[r,s,i]=t[0].split("."),n=C(s),a=new TextDecoder,{exp:o,sub:l,...h}=JSON.parse(a.decode(n));return{expires_at:o,expires_in:o-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:l,factors:t[4],...h}}}catch(e){return console.warn("Failed to parse cookie string:",e),null}}function tJ(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},tz=class{constructor(e){this.cookieOptions={...tM,...e}}getItem(e){let t=this.getCookie(e);return t?e.endsWith("-code-verifier")?t:JSON.stringify(tB(t)):null}setItem(e,t){if(e.endsWith("-code-verifier")){this.setCookie(e,t);return}let r=JSON.parse(t),s=tJ(r);this.setCookie(e,s)}removeItem(e){this.deleteCookie(e)}},tq=class extends tz{constructor(e){super(e)}getCookie(e){if(!tF())return null;let t=(0,tN.parse)(document.cookie);return t[e]}setCookie(e,t){if(!tF())return null;document.cookie=(0,tN.serialize)(e,t,{...this.cookieOptions,httpOnly:!1})}deleteCookie(e){if(!tF())return null;document.cookie=(0,tN.serialize)(e,"",{...this.cookieOptions,maxAge:0,httpOnly:!1})}};function tK(e,t,r){var s;let i=tF();return tC(e,t,{...r,auth:{flowType:"pkce",autoRefreshToken:i,detectSessionInUrl:i,persistSession:!0,storage:r.auth.storage,...(null==(s=r.auth)?void 0:s.storageKey)?{storageKey:r.auth.storageKey}:{}}})}var tH=tD.parse,tX=tD.serialize;/*!
|
|
3
|
+
* cookie
|
|
4
|
+
* Copyright(c) 2012-2014 Roman Shtylman
|
|
5
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
6
|
+
* MIT Licensed
|
|
7
|
+
*/},2151:function(e){"use strict";e.exports={version:"1.0.34"}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[891],{6891:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return eS}});var n=s(7437),l=s(2265),a=s(2130),r=s(6882),i=s(3388),o=s(4033),c=s(3082),d=s(5551),u=s(6507),p=s(7760),h=s(4081),x=s(182),m=s(819),j=s(8212),f=s(5507),g=s(923),v=s(654),y=s(33),b=s(3457),Z=s(8276),C=s(3226),S=s(2467),w=s(9605),k=s(3391),R=s(9190),N=s(6704),P=s(9394),T=s(1797),M=s(6337),E=s(1101),I=s(9872),L=s(2653),D=s(3533),F=s(4740),V=s(4660);let W=(0,V.Ue)(e=>({table:null,setTable:t=>e(()=>({table:t})),config:null,setConfig:t=>e(()=>({config:t}))})),O=["#fd7f6f","#7eb0d5","#b2e061","#bd7ebe","#ffb55a","#ffee65","#beb9db","#fdcce5","#8bd3c7"];function z(e){let{table:t}=e,s=(0,l.useRef)(null),a=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!s.current)return;a.current&&a.current.destroy();let e=t.body.flatMap(e=>e.outputs.map(e=>e.score)),n=Math.min(...e),l=(Math.ceil(Math.max(...e))-Math.floor(n))/10,r=Array.from({length:11},(e,t)=>parseFloat((Math.floor(n)+t*l).toFixed(2))),i=t.head.prompts.map((e,s)=>{let n=t.body.flatMap(e=>e.outputs[s].score),a=r.map(e=>n.filter(t=>t>=e&&t<e+l).length);return{label:"Prompt ".concat(s+1),data:a,backgroundColor:O[s%O.length]}});a.current=new N.kL(s.current,{type:"bar",data:{labels:r,datasets:i},options:{animation:!1,plugins:{title:{display:!0,text:"Score Distribution"},legend:{display:!1},tooltip:{callbacks:{title:function(e){let t=e[0].datasetIndex;return"Prompt ".concat(t+1)},label:function(e){let t=e.dataIndex,s=r[t],n=r[t+1];return n?"".concat(s," <= score < ").concat(n):"".concat(s," <= score")}}}}}})},[t]),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px"}})}function _(e){let{table:t}=e,s=(0,l.useRef)(null),a=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!s.current)return;a.current&&a.current.destroy();let e=t.head.prompts.map((e,s)=>{let n=t.body.flatMap(e=>e.outputs[s]),l=n.filter(e=>e.pass).length,a=l/n.length*100;return{label:"Prompt ".concat(s+1),data:[a],backgroundColor:O[s%O.length]}});a.current=new N.kL(s.current,{type:"bar",data:{labels:["Pass Rate (%)"],datasets:e},options:{animation:!1,plugins:{title:{display:!0,text:"Pass rate"},legend:{display:!0}}}})},[t]),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px"}})}function A(e){let{table:t}=e,s=(0,l.useRef)(null),a=(0,l.useRef)(null),[r,i]=(0,l.useState)(0),[o,c]=(0,l.useState)(1),[d,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(!s.current)return;a.current&&a.current.destroy();let e=t.body.flatMap(e=>e.outputs.map(e=>e.score)),n=Math.min(...e),l=Math.max(...e),i=t.body.map(e=>{let t=e.outputs[r].score,s=e.outputs[o].score;return{x:t,y:s,backgroundColor:s>t?"green":s<t?"red":"gray"}});a.current=new N.kL(s.current,{type:"scatter",data:{datasets:[{data:i,backgroundColor:i.map(e=>e.backgroundColor)},{type:"line",data:[{x:n,y:n},{x:l,y:l}],borderColor:"gray",borderWidth:1,borderDash:[5,5],pointRadius:0}]},options:{animation:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(e){let s=t.body[e.dataIndex],n=s.outputs[0].text,l=s.outputs[1].text;return n.length>30&&(n=n.substring(0,30)+"..."),l.length>30&&(l=l.substring(0,30)+"..."),"Output 1: ".concat(n,"\nOutput 2: ").concat(l)}}}},scales:{x:{title:{display:!0,text:"Prompt ".concat(r+1," Score")}},y:{title:{display:!0,text:"Prompt ".concat(o+1," Score")}}}}})},[t,r,o]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(P.Z,{open:d,onClose:()=>u(!1),children:[(0,n.jsx)(T.Z,{children:"Compare prompt outputs"}),(0,n.jsxs)(M.Z,{children:[(0,n.jsx)(h.Z,{sx:{m:1,minWidth:120},children:(0,n.jsx)(v.Z,{value:r,onChange:e=>i(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,n.jsxs)(f.Z,{value:t,children:["Prompt ",t+1]},t))})}),(0,n.jsx)(h.Z,{sx:{m:1,minWidth:120},children:(0,n.jsx)(v.Z,{value:o,onChange:e=>c(Number(e.target.value)),children:t.head.prompts.map((e,t)=>(0,n.jsxs)(f.Z,{value:t,children:["Prompt ",t+1]},t))})})]})]}),(0,n.jsx)("canvas",{ref:s,style:{maxHeight:"300px",cursor:"pointer"},onClick:()=>u(!0)})]})}function U(e){let{columnVisibility:t}=e,s=(0,E.Z)();N.kL.defaults.color="dark"===s.palette.mode?"#aaa":"#666";let[a,r]=(0,l.useState)(!0),{table:i}=W();if(!i||!a||i.head.prompts.length<2)return null;let o=i.body.flatMap(e=>e.outputs.map(e=>e.score));return 1===new Set(o).size?null:(0,n.jsx)(F.SV,{fallback:null,children:(0,n.jsxs)(I.Z,{style:{position:"relative",padding:s.spacing(3)},children:[(0,n.jsx)(L.Z,{style:{position:"absolute",right:0,top:0},onClick:()=>r(!1),children:(0,n.jsx)(D.Z,{})}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(_,{table:i})}),(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(z,{table:i})}),(0,n.jsx)("div",{style:{width:"33%"},children:(0,n.jsx)(A,{table:i})})]})]})})}N.kL.register(N.vn,N.ST,N.ho,N.uw,N.f$,N.ZL,N.jn,N.od,N.u,N.wL);var H=s(9116);s(5777);var J=s(7660),B=s(3216),q=s(5391),G=s(1396),Y=s.n(G),X=s(2834),$=s(5446),K=s(9329),Q=s(4719),ee=s(3701),et=s(9279),es=s(666),en=s(5795),el=s(6988),ea=s(4147);function er(e){let{gradingResults:t}=e;return t?(0,n.jsxs)(u.Z,{mt:2,children:[(0,n.jsx)(C.Z,{variant:"subtitle1",children:"Assertions"}),(0,n.jsx)(en.Z,{children:(0,n.jsxs)(ee.Z,{children:[(0,n.jsx)(el.Z,{children:(0,n.jsxs)(ea.Z,{children:[(0,n.jsx)(es.Z,{style:{fontWeight:"bold"},children:"Pass"}),(0,n.jsx)(es.Z,{style:{fontWeight:"bold"},children:"Score"}),(0,n.jsx)(es.Z,{style:{fontWeight:"bold"},children:"Type"}),(0,n.jsx)(es.Z,{style:{fontWeight:"bold"},children:"Value"}),(0,n.jsx)(es.Z,{style:{fontWeight:"bold"},children:"Reason"})]})}),(0,n.jsx)(et.Z,{children:t.map((e,t)=>{var s,l;return(0,n.jsxs)(ea.Z,{children:[(0,n.jsx)(es.Z,{children:e.pass?"✅":"❌"}),(0,n.jsx)(es.Z,{children:e.score.toFixed(2)}),(0,n.jsx)(es.Z,{children:(null===(s=e.assertion)||void 0===s?void 0:s.type)||""}),(0,n.jsx)(es.Z,{style:{whiteSpace:"pre-wrap"},children:(null===(l=e.assertion)||void 0===l?void 0:l.value)?String(e.assertion.value):"-"}),(0,n.jsx)(es.Z,{style:{whiteSpace:"pre-wrap"},children:e.reason})]},t)})})]})})]}):null}function ei(e){let{open:t,onClose:s,prompt:a,provider:r,output:i,gradingResults:o}=e,[c,p]=(0,l.useState)(!1);(0,l.useEffect)(()=>{p(!1)},[a]);let h=async e=>{await navigator.clipboard.writeText(e),p(!0)};return(0,n.jsxs)(P.Z,{open:t,onClose:s,fullWidth:!0,maxWidth:"lg",children:[(0,n.jsxs)(T.Z,{children:["Details",r&&": ".concat(r)]}),(0,n.jsxs)(M.Z,{children:[(0,n.jsxs)(u.Z,{mb:2,children:[(0,n.jsx)(C.Z,{variant:"subtitle1",style:{marginBottom:"1rem"},children:"Prompt"}),(0,n.jsx)($.u,{readOnly:!0,value:a,style:{width:"100%",padding:"0.75rem"},maxRows:20}),(0,n.jsx)(L.Z,{onClick:()=>h(a),style:{position:"absolute",right:"10px",top:"10px"},children:c?(0,n.jsx)(Q.Z,{}):(0,n.jsx)(K.Z,{})})]}),i&&(0,n.jsxs)(u.Z,{my:2,children:[(0,n.jsx)(C.Z,{variant:"subtitle1",style:{marginBottom:"1rem",marginTop:"1rem"},children:"Output"}),(0,n.jsx)($.u,{readOnly:!0,maxRows:20,value:i,style:{width:"100%",padding:"0.75rem"}})]}),(0,n.jsx)(er,{gradingResults:o})]}),(0,n.jsx)(X.Z,{children:(0,n.jsx)(d.Z,{onClick:s,children:"Close"})})]})}function eo(e){return null===e||0===e||1===e?"":"(".concat(e.toFixed(2),")")}function ec(e){let{text:t,maxLength:s}=e,[a,r]=l.useState(!0),i="string"==typeof t?t:JSON.stringify(t);i=i.replace(/\n/g,"<br>");let o=()=>{r(!a)};return i.length<=s?(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:i}}):a?(0,n.jsxs)("span",{style:{cursor:"pointer"},onClick:o,children:[(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:i.substring(0,s)}})," ..."]}):(0,n.jsx)("span",{style:{cursor:"pointer"},onClick:o,children:(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:i}})})}function ed(e){var t,s,a;let{output:r,maxTextLength:i,rowIndex:o,promptIndex:c,onRating:d,firstOutput:u,filterMode:p}=e,[h,x]=l.useState(!1),m="string"==typeof r.text?r.text:JSON.stringify(r.text),j=[];if(!r.pass&&m.includes("---")?m=(j=m.split("---")).slice(1).join("---"):j=[m],"different"===p&&u){let e,t="string"==typeof u.text?u.text:JSON.stringify(u.text);t.includes("---")&&(t=t.split("---").slice(1).join("---"));try{JSON.parse(t),JSON.parse(m),e=(0,H.CT)(t,m)}catch(s){e=t.includes(". ")&&m.includes(". ")?(0,H.SY)(t,m):(0,H.NV)(t,m)}m=e.map(e=>e.added?"<ins>".concat(e.value,"</ins>"):e.removed?"<del>".concat(e.value,"</del>"):e.value).join("")}let f=e=>{d(o,c,e)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"cell",children:[r.pass&&(0,n.jsxs)("div",{className:"status pass",children:["PASS ",(0,n.jsx)("span",{className:"score",children:eo(r.score)})]}),!r.pass&&(0,n.jsxs)("div",{className:"status fail",children:["[FAIL",(0,n.jsx)("span",{className:"score",children:eo(r.score)}),"]"," ",(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:j[0].replace(/\n/g,"<br>")}})]})," ",(0,n.jsx)(ec,{text:m,maxLength:i})]}),(0,n.jsx)("div",{className:"cell-detail",children:(null===(t=r.tokenUsage)||void 0===t?void 0:t.cached)?(0,n.jsxs)("span",{children:[r.tokenUsage.cached," tokens (cached)"]}):(0,n.jsxs)(n.Fragment,{children:[(null===(s=r.tokenUsage)||void 0===s?void 0:s.total)&&(0,n.jsxs)("span",{children:[r.tokenUsage.total," tokens"]})," |"," ",(0,n.jsxs)("span",{children:[r.latencyMs," ms"]})]})}),(0,n.jsxs)("div",{className:"cell-actions",children:[r.prompt&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"action",onClick:()=>{x(!0)},children:(0,n.jsx)(Z.Z,{title:"View ouput and test details",children:(0,n.jsx)("span",{children:"\uD83D\uDD0E"})})}),(0,n.jsx)(ei,{open:h,onClose:()=>{x(!1)},prompt:r.prompt,provider:r.provider,gradingResults:null===(a=r.gradingResult)||void 0===a?void 0:a.componentResults,output:m})]}),(0,n.jsx)("span",{className:"action",onClick:()=>f(!0),children:(0,n.jsx)(Z.Z,{title:"Mark test passed (score 1.0)",children:(0,n.jsx)("span",{children:"\uD83D\uDC4D"})})}),(0,n.jsx)("span",{className:"action",onClick:()=>f(!1),children:(0,n.jsx)(Z.Z,{title:"Mark test failed (score 0.0)",children:(0,n.jsx)("span",{children:"\uD83D\uDC4E"})})})]})]})}function eu(e){let{text:t,maxLength:s,smallText:a,expandedText:r,resourceId:i}=e,[o,c]=l.useState(!1);return(0,n.jsxs)("div",{children:[(0,n.jsx)(ec,{text:t,maxLength:s}),r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Z.Z,{title:"View prompt",children:(0,n.jsx)("span",{className:"action",onClick:()=>{c(!0)},children:"\uD83D\uDD0E"})}),(0,n.jsx)(ei,{open:o,onClose:()=>{c(!1)},prompt:r}),i&&(0,n.jsx)(Z.Z,{title:"View other evals and datasets for this prompt",children:(0,n.jsx)("span",{className:"action",children:(0,n.jsx)(Y(),{href:"/prompts/?id=".concat(i),target:"_blank",children:(0,n.jsx)(q.Z,{fontSize:"small"})})})})]}),(0,n.jsx)("div",{className:"smalltext",children:a})]})}function ep(e){let{maxTextLength:t,columnVisibility:s,wordBreak:r,filterMode:i,failureFilter:o,onFailureFilterToggle:c}=e,{table:d,setTable:u}=W();(0,a.Z)(d,"Table should be defined");let{head:h,body:m}=d,j=h.prompts.map((e,t)=>m.reduce((e,s)=>e+(s.outputs[t].pass?1:0),0)),f=h.prompts.map((e,t)=>m.reduce((e,s)=>{var n,l;return e+((null===(l=s.outputs[t].gradingResult)||void 0===l?void 0:null===(n=l.componentResults)||void 0===n?void 0:n.length)||0)},0)),g=h.prompts.map((e,t)=>m.reduce((e,s)=>{var n;let l=null===(n=s.outputs[t].gradingResult)||void 0===n?void 0:n.componentResults;return e+(l?l.filter(e=>e.pass).length:0)},0)),v=(e,t,s)=>{let n=[...m],l={...n[e]},a=[...l.outputs];a[t].pass=s,a[t].score=s?1:0,l.outputs=a,n[e]=l,u({head:h,body:n})},y=j.reduce((e,t,s,n)=>t>n[e]?s:e,0),b=j[y],Z=(0,J.Cl)(),C=[Z.group({id:"vars",header:()=>(0,n.jsx)("span",{children:"Variables"}),columns:h.vars.map((e,s)=>Z.accessor(e=>e.vars[s],{id:"Variable ".concat(s+1),header:()=>(0,n.jsx)(eu,{smallText:"Variable ".concat(s+1),text:e,maxLength:t}),cell:e=>(0,n.jsx)(ec,{text:e.getValue(),maxLength:t}),size:50}))}),Z.group({id:"prompts",header:()=>(0,n.jsx)("span",{children:"Outputs"}),columns:h.prompts.map((e,s)=>Z.accessor(e=>(function(e){if("string"==typeof e){let t=e.startsWith("[PASS]"),s=e;return e.startsWith("[PASS]")?s=s.slice(6):e.startsWith("[FAIL]")&&(s=s.slice(6)),{text:s,pass:t,score:t?1:0}}return e})(e.outputs[s]),{id:"Prompt ".concat(s+1),header:()=>{var l,a,r,d,u,h;let v=j[s]&&m.length?(j[s]/m.length*100).toFixed(2):"0.00",y=j[s]===b&&0!==b,Z="Prompt ".concat(s+1),C=o[Z]||!1;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eu,{smallText:"Prompt ".concat(s+1),text:"string"==typeof e?e:e.display,expandedText:"string"==typeof e?void 0:e.raw,maxLength:t,resourceId:"string"==typeof e?void 0:e.id}),"failures"===i&&(0,n.jsx)(x.Z,{sx:{"& .MuiFormControlLabel-label":{fontSize:"0.75rem"}},control:(0,n.jsx)(p.Z,{checked:C,onChange:e=>c(Z,e.target.checked)}),label:"Show failures"}),(0,n.jsxs)("div",{className:"summary",children:[(0,n.jsxs)("span",{className:y?"highlight":"",children:["Passing: ",(0,n.jsxs)("strong",{children:[v,"%"]})," (",j[s],"/",m.length," cases",f[s]?(0,n.jsxs)("span",{children:[", ",g[s],"/",f[s]," asserts"]}):null,")"]}),((null===(l=e.metrics)||void 0===l?void 0:l.totalLatencyMs)||(null===(r=e.metrics)||void 0===r?void 0:null===(a=r.tokenUsage)||void 0===a?void 0:a.total))&&(0,n.jsx)("span",{children:" avg"}),(null===(d=e.metrics)||void 0===d?void 0:d.totalLatencyMs)&&(0,n.jsxs)("span",{children:[" ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.totalLatencyMs/m.length),"ms"]}),(null===(h=e.metrics)||void 0===h?void 0:null===(u=h.tokenUsage)||void 0===u?void 0:u.total)&&(0,n.jsxs)("span",{children:[" ",Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e.metrics.tokenUsage.total/m.length)," ","tokens"]})]})]})},cell:e=>(0,n.jsx)(ed,{output:e.getValue(),maxTextLength:t,rowIndex:e.row.index,promptIndex:s,onRating:v,firstOutput:S[e.row.index].outputs[0],filterMode:i})}))})],S=l.useMemo(()=>"failures"===i?Object.values(o).every(e=>!e)?m:m.filter(e=>e.outputs.some((e,t)=>{let s=!e.pass;return o["Prompt ".concat(t+1)]&&s})):"different"===i?m.filter(e=>!e.outputs.every(t=>t.text===e.outputs[0].text)):m,[m,o,i]),w=(0,B.b7)({data:S,columns:C,columnResizeMode:"onChange",getCoreRowModel:(0,J.sC)(),state:{columnVisibility:s}});return(0,n.jsxs)("table",{className:"results-table",style:{wordBreak:r},children:[(0,n.jsx)("thead",{children:w.getHeaderGroups().map(e=>(0,n.jsx)("tr",{className:"header",children:e.headers.map(e=>(0,n.jsxs)("th",{colSpan:e.colSpan,style:{width:e.getSize()},children:[e.isPlaceholder?null:(0,B.ie)(e.column.columnDef.header,e.getContext()),(0,n.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"resizer ".concat(e.column.getIsResizing()?"isResizing":"")})]},e.id))},e.id))}),(0,n.jsx)("tbody",{children:w.getRowModel().rows.map((e,t)=>{let s=!1;return(0,n.jsx)("tr",{children:e.getVisibleCells().map(e=>{let l=e.column.id.startsWith("Variable"),a=!l&&!s;return a&&(s=!0),(0,n.jsx)("td",{style:{width:e.column.getSize()},className:"".concat(l?"variable":""," ").concat(0!==t||l?"":"first-prompt-row"," ").concat(a?"first-prompt-col":""),children:(0,B.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)})})]})}s(2604);var eh=s(7175);function ex(e){let{open:t,onClose:a}=e,{config:r}=W(),i=l.useRef(null),[o,c]=l.useState(!1),[p,h]=l.useState("");l.useEffect(()=>{t&&(async()=>{let{default:e}=await s.e(339).then(s.bind(s,8339));h(e.dump(r))})()},[t,r]);let x=()=>{c(!1),a()};return(0,n.jsxs)(P.Z,{open:t,onClose:x,"aria-labelledby":"config-dialog-title",maxWidth:"md",fullWidth:!0,children:[(0,n.jsx)(T.Z,{id:"config-dialog-title",children:(0,n.jsxs)(u.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,n.jsx)(C.Z,{variant:"h6",children:"Config"}),(0,n.jsx)(L.Z,{onClick:()=>{i.current&&(i.current.select(),document.execCommand("copy"),c(!0))},children:o?(0,n.jsx)(Q.Z,{}):(0,n.jsx)(eh.Z,{})})]})}),(0,n.jsx)(M.Z,{children:(0,n.jsx)(C.Z,{variant:"body1",component:"div",children:(0,n.jsx)("textarea",{ref:i,readOnly:!0,value:p,style:{width:"100%",minHeight:"400px",fontFamily:"monospace",border:"1px solid #ccc"}})})}),(0,n.jsx)(X.Z,{children:(0,n.jsx)(d.Z,{onClick:x,color:"primary",children:"Close"})})]})}var em=s(4173),ej=s(1975),ef=e=>{let{open:t,onClose:s,shareUrl:a}=e,r=(0,l.useRef)(null),[i,o]=(0,l.useState)(!1),c=()=>{s(),o(!1)};return(0,n.jsxs)(P.Z,{open:t,onClose:c,PaperProps:{style:{minWidth:"min(660px, 100%)"}},children:[(0,n.jsx)(T.Z,{children:"Your eval is ready to share"}),(0,n.jsxs)(M.Z,{children:[(0,n.jsx)(ej.Z,{inputRef:r,value:a,fullWidth:!0,InputProps:{readOnly:!0,endAdornment:(0,n.jsx)(L.Z,{onClick:()=>{r.current&&(r.current.select(),document.execCommand("copy"),o(!0))},children:i?(0,n.jsx)(Q.Z,{}):(0,n.jsx)(eh.Z,{})})}}),(0,n.jsx)(em.Z,{sx:{fontSize:"0.75rem"},children:"Shared URLs are deleted after 1 week."})]}),(0,n.jsx)(X.Z,{children:(0,n.jsx)(d.Z,{onClick:c,color:"primary",children:"Close"})})]})},eg=s(1938);let ev=(0,R.Z)(b.Z)(e=>{let{theme:t}=e;return{maxWidth:"100%",flexWrap:"wrap",[t.breakpoints.down("sm")]:{flexDirection:"column"}}});function ey(e){let{recentEvals:t,onRecentEvalSelected:s,defaultEvalId:i}=e,c=(0,o.useRouter)(),{table:b,config:R}=W(),{setStateFromConfig:N}=(0,eg.o)(),[P,T]=l.useState(250),[M,E]=l.useState({}),[I,L]=l.useState([]),[D,F]=l.useState({}),[V,O]=l.useState("all"),[z,_]=l.useState("break-word"),[A,H]=l.useState(!1),[J,B]=l.useState(""),[q,G]=l.useState(!1),Y=async()=>{G(!0);try{let e=await fetch("https://api.promptfoo.dev/eval",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:{version:2,createdAt:new Date().toISOString(),results:{table:b},config:R}})}),{id:t}=await e.json(),s="https://app.promptfoo.dev/eval/".concat(t);B(s),H(!0)}catch(e){alert("Sorry, something went wrong.")}finally{G(!1)}},[X,$]=l.useState(!1);(0,a.Z)(b,"Table data must be loaded before rendering ResultsView");let{head:K}=b,Q=[...K.vars.map((e,t)=>({value:"Variable ".concat(t+1),label:"Variable ".concat(t+1),group:"Variables"})),...K.prompts.map((e,t)=>({value:"Prompt ".concat(t+1),label:"Prompt ".concat(t+1),group:"Prompts"}))];return l.useEffect(()=>{L([...K.vars.map((e,t)=>"Variable ".concat(t+1)),...K.prompts.map((e,t)=>"Prompt ".concat(t+1))])},[K]),(0,n.jsxs)("div",{style:{marginLeft:"1rem",marginRight:"1rem"},children:[(0,n.jsx)(u.Z,{py:"md",children:(0,n.jsxs)(ev,{direction:"row",spacing:4,alignItems:"center",children:[(0,n.jsx)(u.Z,{children:t&&t.length>0&&(0,n.jsxs)(h.Z,{sx:{m:1,minWidth:200},size:"small",children:[(0,n.jsx)(m.Z,{children:"View run"}),(0,n.jsx)(v.Z,{className:"recent-files",label:"Previous runs",defaultValue:i,onChange:e=>s(e.target.value),children:t.map(e=>(0,n.jsx)(f.Z,{value:e.id,children:e.label},e.id))},t.map(e=>e.id).join(","))]})}),(0,n.jsx)(u.Z,{children:(0,n.jsxs)(h.Z,{sx:{m:1,minWidth:200},size:"small",children:[(0,n.jsx)(m.Z,{id:"visible-columns-label",children:"Show columns"}),(0,n.jsx)(v.Z,{labelId:"visible-columns-label",id:"visible-columns",multiple:!0,value:I,onChange:e=>{let{target:{value:t}}=e;L("string"==typeof t?t.split(","):t);let s=[...K.vars.map((e,t)=>"Variable ".concat(t+1)),...K.prompts.map((e,t)=>"Prompt ".concat(t+1))],n={};s.forEach(e=>{n[e]=("string"==typeof t?t.split(","):t).includes(e)}),E(n)},input:(0,n.jsx)(g.Z,{label:"Visible columns"}),renderValue:e=>e.join(", "),children:Q.map(e=>(0,n.jsxs)(f.Z,{dense:!0,value:e.value,children:[(0,n.jsx)(p.Z,{checked:I.indexOf(e.value)>-1}),(0,n.jsx)(j.Z,{primary:e.label})]},e.value))})]})}),(0,n.jsx)(u.Z,{children:(0,n.jsxs)(h.Z,{sx:{minWidth:180},size:"small",children:[(0,n.jsx)(m.Z,{id:"failure-filter-mode-label",children:"Filter"}),(0,n.jsxs)(v.Z,{labelId:"filter-mode-label",id:"filter-mode",value:V,onChange:e=>{let t=e.target.value;O(t);let s={};K.prompts.forEach((e,n)=>{s["Prompt ".concat(n+1)]="failures"===t}),F(s)},label:"Filter",children:[(0,n.jsx)(f.Z,{value:"all",children:"Show all results"}),(0,n.jsx)(f.Z,{value:"failures",children:"Show failures only"}),(0,n.jsx)(f.Z,{value:"different",children:"Show different only"})]})]})}),(0,n.jsxs)(u.Z,{children:[(0,n.jsxs)(C.Z,{mt:2,children:["Max text length: ",P]}),(0,n.jsx)(y.ZP,{min:25,max:1e3,value:P,onChange:(e,t)=>T(t)})]}),(0,n.jsx)(u.Z,{children:(0,n.jsx)(Z.Z,{title:"Forcing line breaks makes it easier to adjust column widths to your liking",children:(0,n.jsx)(x.Z,{control:(0,n.jsx)(p.Z,{checked:"break-all"===z,onChange:e=>{_(e.target.checked?"break-all":"break-word")}}),label:"Force line breaks"})})}),(0,n.jsx)(u.Z,{flexGrow:1}),(0,n.jsx)(u.Z,{display:"flex",justifyContent:"flex-end",children:(0,n.jsxs)(ev,{direction:"row",spacing:2,children:[R&&(0,n.jsx)(Z.Z,{title:"View config",children:(0,n.jsx)(d.Z,{color:"primary",onClick:()=>$(!0),startIcon:(0,n.jsx)(w.Z,{}),children:"View Config"})}),R&&(0,n.jsx)(Z.Z,{title:"Edit eval",children:(0,n.jsx)(d.Z,{color:"primary",onClick:()=>{N(R),c.push("/setup/")},startIcon:(0,n.jsx)(k.Z,{}),children:"Edit Eval"})}),(null==R?void 0:R.sharing)&&(0,n.jsx)(Z.Z,{title:"Generate a unique URL that others can access",children:(0,n.jsx)(d.Z,{color:"primary",onClick:Y,disabled:q,startIcon:q?(0,n.jsx)(r.Z,{size:16}):(0,n.jsx)(S.Z,{}),children:"Share"})})]})})]})}),(0,n.jsx)(U,{columnVisibility:M}),(0,n.jsx)(ep,{maxTextLength:P,columnVisibility:M,wordBreak:z,filterMode:V,failureFilter:D,onFailureFilterToggle:(e,t)=>{F(s=>({...s,[e]:t}))}}),(0,n.jsx)(ex,{open:X,onClose:()=>$(!1)}),(0,n.jsx)(ef,{open:A,onClose:()=>H(!1),shareUrl:J})]})}var eb=s(279);async function eZ(){let e=(0,c.createClientComponentClient)(),{data:{user:t}}=await e.auth.getUser();(0,a.Z)(t,"User not logged in");let{data:s,error:n}=await e.from("EvaluationResult").select("id, createdAt").eq("user_id",t.id).order("createdAt",{ascending:!1}).limit(100);return s||[]}async function eC(e){let t=(0,c.createClientComponentClient)(),{data:s,error:n}=await t.from("EvaluationResult").select("*").eq("id",e).single();return s}function eS(e){var t;let{fetchId:s,preloadedData:c,recentEvals:d,defaultEvalId:u}=e,p=(0,o.useRouter)(),{table:h,setTable:x,setConfig:m}=W(),[j,f]=l.useState(!1),[g,v]=l.useState(!1),[y,b]=l.useState(d||[]),Z=async()=>{(0,a.Z)(eb.T8,"Cannot fetch recent files when not running locally");let e=await fetch("".concat(eb.CT,"/results"),{cache:"no-store"}),t=await e.json();return b(t.data),t.data},C=async e=>{let t=await fetch("".concat(eb.CT,"/results/").concat(e),{cache:"no-store"}),s=await t.json();x(s.data.results.table),m(s.data.config)},S=async e=>{eb.T8?C(e):(f(!1),p.push("/eval/remote:".concat(encodeURIComponent(e))))},[w,k]=l.useState(u||(null===(t=y[0])||void 0===t?void 0:t.id)),R=(0,o.useSearchParams)(),N=R?R.get("file"):null;return(l.useEffect(()=>{if(N){let e=async()=>{await C(N),f(!0)};e()}else if(c){var e;x(null===(e=c.data.results)||void 0===e?void 0:e.table),m(c.data.config),f(!0)}else if(s){let e=async()=>{var e;let t=await fetch("https://api.promptfoo.dev/eval/".concat(s));if(!t.ok){v(!0);return}let n=await t.json();x(null===(e=n.data.results)||void 0===e?void 0:e.table),m(n.data.config),f(!0)};e()}else if(eb.T8){let e=(0,i.io)(eb.CT);return e.on("init",e=>{console.log("Initialized socket connection",e),f(!0),x(e.results.table),m(e.config),Z().then(e=>{var t;k(null===(t=e[0])||void 0===t?void 0:t.id)})}),e.on("update",e=>{console.log("Received data update",e),x(e.results.table),m(e.config),Z().then(e=>{var t;k(null===(t=e[0])||void 0===t?void 0:t.id)})}),()=>{e.disconnect()}}else eZ().then(e=>{b(e.map(e=>({id:e.id,label:e.createdAt}))),e.length>0&&eC(e[0].id).then(t=>{(0,a.Z)(t,"Eval not found");let s=t.results,n=t.config;k(e[0].id),x(s.table),m(n),f(!0)})})},[s,x,m,c,k,N]),g)?(0,n.jsx)("div",{className:"loading",children:"404 Eval not found"}):j&&h?(0,n.jsx)(ey,{defaultEvalId:w,recentEvals:y,onRecentEvalSelected:S}):(0,n.jsxs)("div",{className:"loading",children:[(0,n.jsx)("div",{children:(0,n.jsx)(r.Z,{size:22})}),(0,n.jsx)("div",{children:"Loading eval data"})]})}s(5038)},279:function(e,t,s){"use strict";s.d(t,{CT:function(){return a},T8:function(){return l},eA:function(){return r}});var n=s(2601);let l=!n.env.NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER,a="http://localhost:15500",r=""},1938:function(e,t,s){"use strict";s.d(t,{o:function(){return a}});var n=s(4660),l=s(4810);let a=(0,n.Ue)()((0,l.tJ)((e,t)=>({env:{},testCases:[],description:"",providers:[],prompts:[],setEnv:t=>e({env:t}),setTestCases:t=>e({testCases:t}),setDescription:t=>e({description:t}),setProviders:t=>e({providers:t}),setPrompts:t=>e({prompts:t}),setStateFromConfig:t=>{let s={};t.description&&(s.description=t.description||""),t.tests&&(s.testCases=t.tests),t.providers&&(s.providers=t.providers),t.prompts&&("string"==typeof t.prompts?s.prompts=[t.prompts]:Array.isArray(t.prompts)?s.prompts=t.prompts.filter(e=>!e.endsWith(".txt")&&!e.endsWith(".json")&&!e.endsWith(".yaml")):console.warn("Invalid prompts config",t.prompts)),e(s)},getTestSuite:()=>{let{description:e,testCases:s,providers:n,prompts:l,env:a}=t();return{env:a,description:e,providers:n,prompts:l,tests:s}}}),{name:"promptfoo",skipHydration:!0}))},5038:function(){},2604:function(){},5777:function(){}}]);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[919],{9329:function(e,t,r){var n=r(6314);t.Z=void 0;var o=n(r(984)),a=r(7437),i=(0,o.default)((0,a.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}),"ContentCopy");t.Z=i},3391:function(e,t,r){var n=r(6314);t.Z=void 0;var o=n(r(984)),a=r(7437),i=(0,o.default)((0,a.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Edit");t.Z=i},6882:function(e,t,r){r.d(t,{Z:function(){return P}});var n=r(791),o=r(3428),a=r(2265),i=r(7042),s=r(5600),l=r(9538),u=r(8702),c=r(7927),d=r(5843),f=r(6520),v=r(5702);function h(e){return(0,v.Z)("MuiCircularProgress",e)}(0,f.Z)("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);var m=r(7437);let p=["className","color","disableShrink","size","style","thickness","value","variant"],g=e=>e,y,S,b,E,Z=(0,l.F4)(y||(y=g`
|
|
2
|
+
0% {
|
|
3
|
+
transform: rotate(0deg);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
100% {
|
|
7
|
+
transform: rotate(360deg);
|
|
8
|
+
}
|
|
9
|
+
`)),w=(0,l.F4)(S||(S=g`
|
|
10
|
+
0% {
|
|
11
|
+
stroke-dasharray: 1px, 200px;
|
|
12
|
+
stroke-dashoffset: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
50% {
|
|
16
|
+
stroke-dasharray: 100px, 200px;
|
|
17
|
+
stroke-dashoffset: -15px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
100% {
|
|
21
|
+
stroke-dasharray: 100px, 200px;
|
|
22
|
+
stroke-dashoffset: -125px;
|
|
23
|
+
}
|
|
24
|
+
`)),x=e=>{let{classes:t,variant:r,color:n,disableShrink:o}=e,a={root:["root",r,`color${(0,u.Z)(n)}`],svg:["svg"],circle:["circle",`circle${(0,u.Z)(r)}`,o&&"circleDisableShrink"]};return(0,s.Z)(a,h,t)},C=(0,d.ZP)("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[r.variant],t[`color${(0,u.Z)(r.color)}`]]}})(({ownerState:e,theme:t})=>(0,o.Z)({display:"inline-block"},"determinate"===e.variant&&{transition:t.transitions.create("transform")},"inherit"!==e.color&&{color:(t.vars||t).palette[e.color].main}),({ownerState:e})=>"indeterminate"===e.variant&&(0,l.iv)(b||(b=g`
|
|
25
|
+
animation: ${0} 1.4s linear infinite;
|
|
26
|
+
`),Z)),k=(0,d.ZP)("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),D=(0,d.ZP)("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.circle,t[`circle${(0,u.Z)(r.variant)}`],r.disableShrink&&t.circleDisableShrink]}})(({ownerState:e,theme:t})=>(0,o.Z)({stroke:"currentColor"},"determinate"===e.variant&&{transition:t.transitions.create("stroke-dashoffset")},"indeterminate"===e.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:e})=>"indeterminate"===e.variant&&!e.disableShrink&&(0,l.iv)(E||(E=g`
|
|
27
|
+
animation: ${0} 1.4s ease-in-out infinite;
|
|
28
|
+
`),w)),z=a.forwardRef(function(e,t){let r=(0,c.Z)({props:e,name:"MuiCircularProgress"}),{className:a,color:s="primary",disableShrink:l=!1,size:u=40,style:d,thickness:f=3.6,value:v=0,variant:h="indeterminate"}=r,g=(0,n.Z)(r,p),y=(0,o.Z)({},r,{color:s,disableShrink:l,size:u,thickness:f,value:v,variant:h}),S=x(y),b={},E={},Z={};if("determinate"===h){let e=2*Math.PI*((44-f)/2);b.strokeDasharray=e.toFixed(3),Z["aria-valuenow"]=Math.round(v),b.strokeDashoffset=`${((100-v)/100*e).toFixed(3)}px`,E.transform="rotate(-90deg)"}return(0,m.jsx)(C,(0,o.Z)({className:(0,i.Z)(S.root,a),style:(0,o.Z)({width:u,height:u},E,d),ownerState:y,ref:t,role:"progressbar"},Z,g,{children:(0,m.jsx)(k,{className:S.svg,ownerState:y,viewBox:"22 22 44 44",children:(0,m.jsx)(D,{className:S.circle,style:b,ownerState:y,cx:44,cy:44,r:(44-f)/2,fill:"none",strokeWidth:f})})}))});var P=z},4173:function(e,t,r){r.d(t,{Z:function(){return S}});var n=r(791),o=r(3428),a=r(2265),i=r(7042),s=r(5600),l=r(5843),u=r(7927),c=r(3226),d=r(6520),f=r(5702);function v(e){return(0,f.Z)("MuiDialogContentText",e)}(0,d.Z)("MuiDialogContentText",["root"]);var h=r(7437);let m=["children","className"],p=e=>{let{classes:t}=e,r=(0,s.Z)({root:["root"]},v,t);return(0,o.Z)({},t,r)},g=(0,l.ZP)(c.Z,{shouldForwardProp:e=>(0,l.FO)(e)||"classes"===e,name:"MuiDialogContentText",slot:"Root",overridesResolver:(e,t)=>t.root})({}),y=a.forwardRef(function(e,t){let r=(0,u.Z)({props:e,name:"MuiDialogContentText"}),{className:a}=r,s=(0,n.Z)(r,m),l=p(s);return(0,h.jsx)(g,(0,o.Z)({component:"p",variant:"body1",color:"text.secondary",ref:t,ownerState:s,className:(0,i.Z)(l.root,a)},r,{classes:l}))});var S=y},5795:function(e,t,r){r.d(t,{Z:function(){return y}});var n=r(3428),o=r(791),a=r(2265),i=r(7042),s=r(5600),l=r(7927),u=r(5843),c=r(6520),d=r(5702);function f(e){return(0,d.Z)("MuiTableContainer",e)}(0,c.Z)("MuiTableContainer",["root"]);var v=r(7437);let h=["className","component"],m=e=>{let{classes:t}=e;return(0,s.Z)({root:["root"]},f,t)},p=(0,u.ZP)("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"}),g=a.forwardRef(function(e,t){let r=(0,l.Z)({props:e,name:"MuiTableContainer"}),{className:a,component:s="div"}=r,u=(0,o.Z)(r,h),c=(0,n.Z)({},r,{component:s}),d=m(c);return(0,v.jsx)(p,(0,n.Z)({ref:t,as:s,className:(0,i.Z)(d.root,a),ownerState:c},u))});var y=g},4740:function(e,t,r){r.d(t,{SV:function(){return i}});var n=r(2265);let o=(0,n.createContext)(null),a={didCatch:!1,error:null};class i extends n.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=a}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,r,n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];null===(t=(r=this.props).onReset)||void 0===t||t.call(r,{args:o,reason:"imperative-api"}),this.setState(a)}}componentDidCatch(e,t){var r,n;null===(r=(n=this.props).onError)||void 0===r||r.call(n,e,t)}componentDidUpdate(e,t){let{didCatch:r}=this.state,{resetKeys:n}=this.props;if(r&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,n)){var o,i;null===(o=(i=this.props).onReset)||void 0===o||o.call(i,{next:n,prev:e.resetKeys,reason:"keys"}),this.setState(a)}}render(){let{children:e,fallbackRender:t,FallbackComponent:r,fallback:a}=this.props,{didCatch:i,error:s}=this.state,l=e;if(i){let e={error:s,resetErrorBoundary:this.resetErrorBoundary};if((0,n.isValidElement)(a))l=a;else if("function"==typeof t)l=t(e);else if(r)l=(0,n.createElement)(r,e);else throw s}return(0,n.createElement)(o.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},l)}}},1853:function(e,t,r){/**
|
|
29
|
+
* @license React
|
|
30
|
+
* use-sync-external-store-shim.production.min.js
|
|
31
|
+
*
|
|
32
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the MIT license found in the
|
|
35
|
+
* LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/var n=r(2265),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=n.useState,i=n.useEffect,s=n.useLayoutEffect,l=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!o(e,r)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=a({inst:{value:r,getSnapshot:t}}),o=n[0].inst,c=n[1];return s(function(){o.value=r,o.getSnapshot=t,u(o)&&c({inst:o})},[e,r,t]),i(function(){return u(o)&&c({inst:o}),e(function(){u(o)&&c({inst:o})})},[e]),l(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:c},8704:function(e,t,r){/**
|
|
37
|
+
* @license React
|
|
38
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
39
|
+
*
|
|
40
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
41
|
+
*
|
|
42
|
+
* This source code is licensed under the MIT license found in the
|
|
43
|
+
* LICENSE file in the root directory of this source tree.
|
|
44
|
+
*/var n=r(2265),o=r(6272),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=o.useSyncExternalStore,s=n.useRef,l=n.useEffect,u=n.useMemo,c=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,n,o){var d=s(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=u(function(){function e(e){if(!l){if(l=!0,i=e,e=n(e),void 0!==o&&f.hasValue){var t=f.value;if(o(t,e))return s=t}return s=e}if(t=s,a(i,e))return t;var r=n(e);return void 0!==o&&o(t,r)?t:(i=e,s=r)}var i,s,l=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,n,o]);var v=i(e,d[0],d[1]);return l(function(){f.hasValue=!0,f.value=v},[v]),c(v),v}},6272:function(e,t,r){e.exports=r(1853)},5401:function(e,t,r){e.exports=r(8704)},4660:function(e,t,r){r.d(t,{Ue:function(){return c}});let n=e=>{let t;let r=new Set,n=(e,n)=>{let o="function"==typeof e?e(t):e;if(!Object.is(o,t)){let e=t;t=(null!=n?n:"object"!=typeof o)?o:Object.assign({},t,o),r.forEach(r=>r(t,e))}},o=()=>t,a={setState:n,getState:o,subscribe:e=>(r.add(e),()=>r.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return t=e(n,o,a),a},o=e=>e?n(e):n;var a=r(2265),i=r(5401);let{useSyncExternalStoreWithSelector:s}=i,l=!1,u=e=>{"function"!=typeof e&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");let t="function"==typeof e?o(e):e,r=(e,r)=>(function(e,t=e.getState,r){r&&!l&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),l=!0);let n=s(e.subscribe,e.getState,e.getServerState||e.getState,t,r);return(0,a.useDebugValue)(n),n})(t,e,r);return Object.assign(r,t),r},c=e=>e?u(e):u},4810:function(e,t,r){r.d(t,{tJ:function(){return i}});let n=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>n(e)(r),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>n(t)(e)}}},o=(e,t)=>(r,o,a)=>{let i,s,l={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},u=!1,c=new Set,d=new Set;try{i=l.getStorage()}catch(e){}if(!i)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),r(...e)},o,a);let f=n(l.serialize),v=()=>{let e;let t=l.partialize({...o()}),r=f({state:t,version:l.version}).then(e=>i.setItem(l.name,e)).catch(t=>{e=t});if(e)throw e;return r},h=a.setState;a.setState=(e,t)=>{h(e,t),v()};let m=e((...e)=>{r(...e),v()},o,a),p=()=>{var e;if(!i)return;u=!1,c.forEach(e=>e(o()));let t=(null==(e=l.onRehydrateStorage)?void 0:e.call(l,o()))||void 0;return n(i.getItem.bind(i))(l.name).then(e=>{if(e)return l.deserialize(e)}).then(e=>{if(e){if("number"!=typeof e.version||e.version===l.version)return e.state;if(l.migrate)return l.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return r(s=l.merge(e,null!=(t=o())?t:m),!0),v()}).then(()=>{null==t||t(s,void 0),u=!0,d.forEach(e=>e(s))}).catch(e=>{null==t||t(void 0,e)})};return a.persist={setOptions:e=>{l={...l,...e},e.getStorage&&(i=e.getStorage())},clearStorage:()=>{null==i||i.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>p(),hasHydrated:()=>u,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(d.add(e),()=>{d.delete(e)})},p(),s||m},a=(e,t)=>(r,o,a)=>{let i,s={storage:function(e,t){let r;try{r=e()}catch(e){return}return{getItem:e=>{var n;let o=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),a=null!=(n=r.getItem(e))?n:null;return a instanceof Promise?a.then(o):o(a)},setItem:(e,n)=>r.setItem(e,JSON.stringify(n,null==t?void 0:t.replacer)),removeItem:e=>r.removeItem(e)}}(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},l=!1,u=new Set,c=new Set,d=s.storage;if(!d)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...e)},o,a);let f=()=>{let e=s.partialize({...o()});return d.setItem(s.name,{state:e,version:s.version})},v=a.setState;a.setState=(e,t)=>{v(e,t),f()};let h=e((...e)=>{r(...e),f()},o,a),m=()=>{var e,t;if(!d)return;l=!1,u.forEach(e=>{var t;return e(null!=(t=o())?t:h)});let a=(null==(t=s.onRehydrateStorage)?void 0:t.call(s,null!=(e=o())?e:h))||void 0;return n(d.getItem.bind(d))(s.name).then(e=>{if(e){if("number"!=typeof e.version||e.version===s.version)return e.state;if(s.migrate)return s.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return r(i=s.merge(e,null!=(t=o())?t:h),!0),f()}).then(()=>{null==a||a(i,void 0),i=o(),l=!0,c.forEach(e=>e(i))}).catch(e=>{null==a||a(void 0,e)})};return a.persist={setOptions:e=>{s={...s,...e},e.storage&&(d=e.storage)},clearStorage:()=>{null==d||d.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>l,onHydrate:e=>(u.add(e),()=>{u.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},s.skipHydration||m(),i||h},i=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?(console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),o(e,t)):a(e,t)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[975],{7328:function(e,t,r){var o=r(791),n=r(3428),i=r(2265),l=r(5959),a=r(5600),s=r(3382),d=r(5843),u=r(7927),p=r(9274),c=r(7437);let m=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],f=e=>{let{classes:t,disableUnderline:r}=e,o=(0,a.Z)({root:["root",!r&&"underline"],input:["input"]},p._,t);return(0,n.Z)({},t,o)},b=(0,d.ZP)(s.Ej,{shouldForwardProp:e=>(0,d.FO)(e)||"classes"===e,name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[...(0,s.Gx)(e,t),!r.disableUnderline&&t.underline]}})(({theme:e,ownerState:t})=>{var r;let o="light"===e.palette.mode,i=o?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)";return(0,n.Z)({position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i}},[`&.${p.Z.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i},[`&.${p.Z.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:o?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"}},!t.disableUnderline&&{"&:after":{borderBottom:`2px solid ${null==(r=(e.vars||e).palette[t.color||"primary"])?void 0:r.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${p.Z.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${p.Z.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&:before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:o?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)"}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${p.Z.disabled}, .${p.Z.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${p.Z.disabled}:before`]:{borderBottomStyle:"dotted"}},t.startAdornment&&{paddingLeft:12},t.endAdornment&&{paddingRight:12},t.multiline&&(0,n.Z)({padding:"25px 12px 8px"},"small"===t.size&&{paddingTop:21,paddingBottom:4},t.hiddenLabel&&{paddingTop:16,paddingBottom:17}))}),h=(0,d.ZP)(s.rA,{name:"MuiFilledInput",slot:"Input",overridesResolver:s._o})(({theme:e,ownerState:t})=>(0,n.Z)({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.mode?null:"#fff",caretColor:"light"===e.palette.mode?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},"small"===t.size&&{paddingTop:21,paddingBottom:4},t.hiddenLabel&&{paddingTop:16,paddingBottom:17},t.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0},t.startAdornment&&{paddingLeft:0},t.endAdornment&&{paddingRight:0},t.hiddenLabel&&"small"===t.size&&{paddingTop:8,paddingBottom:9})),v=i.forwardRef(function(e,t){var r,i,a,d;let p=(0,u.Z)({props:e,name:"MuiFilledInput"}),{components:v={},componentsProps:Z,fullWidth:g=!1,inputComponent:x="input",multiline:y=!1,slotProps:S,slots:w={},type:R="text"}=p,C=(0,o.Z)(p,m),k=(0,n.Z)({},p,{fullWidth:g,inputComponent:x,multiline:y,type:R}),P=f(p),F={root:{ownerState:k},input:{ownerState:k}},I=(null!=S?S:Z)?(0,l.Z)(null!=S?S:Z,F):F,M=null!=(r=null!=(i=w.root)?i:v.Root)?r:b,$=null!=(a=null!=(d=w.input)?d:v.Input)?a:h;return(0,c.jsx)(s.ZP,(0,n.Z)({slots:{root:M,input:$},componentsProps:I,fullWidth:g,inputComponent:x,multiline:y,ref:t,type:R},C,{classes:P}))});v.muiName="Input",t.Z=v},9274:function(e,t,r){r.d(t,{_:function(){return a}});var o=r(3428),n=r(6520),i=r(5702),l=r(7044);function a(e){return(0,i.Z)("MuiFilledInput",e)}let s=(0,o.Z)({},l.Z,(0,n.Z)("MuiFilledInput",["root","underline","input"]));t.Z=s},4081:function(e,t,r){r.d(t,{Z:function(){return S}});var o=r(791),n=r(3428),i=r(2265),l=r(7042),a=r(5600),s=r(7927),d=r(5843),u=r(5454),p=r(8702),c=r(673),m=r(2592),f=r(6520),b=r(5702);function h(e){return(0,b.Z)("MuiFormControl",e)}(0,f.Z)("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);var v=r(7437);let Z=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],g=e=>{let{classes:t,margin:r,fullWidth:o}=e,n={root:["root","none"!==r&&`margin${(0,p.Z)(r)}`,o&&"fullWidth"]};return(0,a.Z)(n,h,t)},x=(0,d.ZP)("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:e},t)=>(0,n.Z)({},t.root,t[`margin${(0,p.Z)(e.margin)}`],e.fullWidth&&t.fullWidth)})(({ownerState:e})=>(0,n.Z)({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},"normal"===e.margin&&{marginTop:16,marginBottom:8},"dense"===e.margin&&{marginTop:8,marginBottom:4},e.fullWidth&&{width:"100%"})),y=i.forwardRef(function(e,t){let r;let a=(0,s.Z)({props:e,name:"MuiFormControl"}),{children:d,className:p,color:f="primary",component:b="div",disabled:h=!1,error:y=!1,focused:S,fullWidth:w=!1,hiddenLabel:R=!1,margin:C="none",required:k=!1,size:P="medium",variant:F="outlined"}=a,I=(0,o.Z)(a,Z),M=(0,n.Z)({},a,{color:f,component:b,disabled:h,error:y,fullWidth:w,hiddenLabel:R,margin:C,required:k,size:P,variant:F}),$=g(M),[O,z]=i.useState(()=>{let e=!1;return d&&i.Children.forEach(d,t=>{if(!(0,c.Z)(t,["Input","Select"]))return;let r=(0,c.Z)(t,["Select"])?t.props.input:t;r&&(0,u.B7)(r.props)&&(e=!0)}),e}),[B,j]=i.useState(()=>{let e=!1;return d&&i.Children.forEach(d,t=>{(0,c.Z)(t,["Input","Select"])&&((0,u.vd)(t.props,!0)||(0,u.vd)(t.props.inputProps,!0))&&(e=!0)}),e}),[W,A]=i.useState(!1);h&&W&&A(!1);let N=void 0===S||h?W:S,L=i.useMemo(()=>({adornedStart:O,setAdornedStart:z,color:f,disabled:h,error:y,filled:B,focused:N,fullWidth:w,hiddenLabel:R,size:P,onBlur:()=>{A(!1)},onEmpty:()=>{j(!1)},onFilled:()=>{j(!0)},onFocus:()=>{A(!0)},registerEffect:r,required:k,variant:F}),[O,f,h,y,B,N,w,R,r,k,P,F]);return(0,v.jsx)(m.Z.Provider,{value:L,children:(0,v.jsx)(x,(0,n.Z)({as:b,ownerState:M,className:(0,l.Z)($.root,p),ref:t},I,{children:d}))})});var S=y},2592:function(e,t,r){var o=r(2265);let n=o.createContext(void 0);t.Z=n},4379:function(e,t,r){r.d(t,{Z:function(){return o}});function o({props:e,states:t,muiFormControl:r}){return t.reduce((t,o)=>(t[o]=e[o],r&&void 0===e[o]&&(t[o]=r[o]),t),{})}},9592:function(e,t,r){r.d(t,{Z:function(){return i}});var o=r(2265),n=r(2592);function i(){return o.useContext(n.Z)}},1711:function(e,t,r){var o=r(791),n=r(3428),i=r(2265),l=r(5600),a=r(5959),s=r(3382),d=r(5843),u=r(7927),p=r(466),c=r(7437);let m=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],f=e=>{let{classes:t,disableUnderline:r}=e,o=(0,l.Z)({root:["root",!r&&"underline"],input:["input"]},p.l,t);return(0,n.Z)({},t,o)},b=(0,d.ZP)(s.Ej,{shouldForwardProp:e=>(0,d.FO)(e)||"classes"===e,name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[...(0,s.Gx)(e,t),!r.disableUnderline&&t.underline]}})(({theme:e,ownerState:t})=>{let r="light"===e.palette.mode,o=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(o=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),(0,n.Z)({position:"relative"},t.formControl&&{"label + &":{marginTop:16}},!t.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(e.vars||e).palette[t.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${p.Z.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${p.Z.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&:before":{borderBottom:`1px solid ${o}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${p.Z.disabled}, .${p.Z.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${o}`}},[`&.${p.Z.disabled}:before`]:{borderBottomStyle:"dotted"}})}),h=(0,d.ZP)(s.rA,{name:"MuiInput",slot:"Input",overridesResolver:s._o})({}),v=i.forwardRef(function(e,t){var r,i,l,d;let p=(0,u.Z)({props:e,name:"MuiInput"}),{disableUnderline:v,components:Z={},componentsProps:g,fullWidth:x=!1,inputComponent:y="input",multiline:S=!1,slotProps:w,slots:R={},type:C="text"}=p,k=(0,o.Z)(p,m),P=f(p),F={root:{ownerState:{disableUnderline:v}}},I=(null!=w?w:g)?(0,a.Z)(null!=w?w:g,F):F,M=null!=(r=null!=(i=R.root)?i:Z.Root)?r:b,$=null!=(l=null!=(d=R.input)?d:Z.Input)?l:h;return(0,c.jsx)(s.ZP,(0,n.Z)({slots:{root:M,input:$},slotProps:I,fullWidth:x,inputComponent:y,multiline:S,ref:t,type:C},k,{classes:P}))});v.muiName="Input",t.Z=v},466:function(e,t,r){r.d(t,{l:function(){return a}});var o=r(3428),n=r(6520),i=r(5702),l=r(7044);function a(e){return(0,i.Z)("MuiInput",e)}let s=(0,o.Z)({},l.Z,(0,n.Z)("MuiInput",["root","underline","input"]));t.Z=s},3382:function(e,t,r){r.d(t,{rA:function(){return z},Ej:function(){return O},ZP:function(){return W},_o:function(){return M},Gx:function(){return I}});var o=r(791),n=r(3428),i=r(18),l=r(2265),a=r(7042),s=r(5600),d=r(5446),u=r(3655),p=r(4379),c=r(2592),m=r(9592),f=r(5843),b=r(7927),h=r(8702),v=r(7663),Z=r(8519),g=r(9538),x=r(7437);function y(e){let{styles:t,defaultTheme:r={}}=e,o="function"==typeof t?e=>t(null==e||0===Object.keys(e).length?r:e):t;return(0,x.jsx)(g.xB,{styles:o})}var S=r(5270),w=function({styles:e,themeId:t,defaultTheme:r={}}){let o=(0,S.Z)(r),n="function"==typeof e?e(t&&o[t]||o):e;return(0,x.jsx)(y,{styles:n})},R=r(3794),C=r(3469),k=r(5454),P=r(7044);let F=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],I=(e,t)=>{let{ownerState:r}=e;return[t.root,r.formControl&&t.formControl,r.startAdornment&&t.adornedStart,r.endAdornment&&t.adornedEnd,r.error&&t.error,"small"===r.size&&t.sizeSmall,r.multiline&&t.multiline,r.color&&t[`color${(0,h.Z)(r.color)}`],r.fullWidth&&t.fullWidth,r.hiddenLabel&&t.hiddenLabel]},M=(e,t)=>{let{ownerState:r}=e;return[t.input,"small"===r.size&&t.inputSizeSmall,r.multiline&&t.inputMultiline,"search"===r.type&&t.inputTypeSearch,r.startAdornment&&t.inputAdornedStart,r.endAdornment&&t.inputAdornedEnd,r.hiddenLabel&&t.inputHiddenLabel]},$=e=>{let{classes:t,color:r,disabled:o,error:n,endAdornment:i,focused:l,formControl:a,fullWidth:d,hiddenLabel:u,multiline:p,readOnly:c,size:m,startAdornment:f,type:b}=e,v={root:["root",`color${(0,h.Z)(r)}`,o&&"disabled",n&&"error",d&&"fullWidth",l&&"focused",a&&"formControl","small"===m&&"sizeSmall",p&&"multiline",f&&"adornedStart",i&&"adornedEnd",u&&"hiddenLabel",c&&"readOnly"],input:["input",o&&"disabled","search"===b&&"inputTypeSearch",p&&"inputMultiline","small"===m&&"inputSizeSmall",u&&"inputHiddenLabel",f&&"inputAdornedStart",i&&"inputAdornedEnd",c&&"readOnly"]};return(0,s.Z)(v,P.u,t)},O=(0,f.ZP)("div",{name:"MuiInputBase",slot:"Root",overridesResolver:I})(({theme:e,ownerState:t})=>(0,n.Z)({},e.typography.body1,{color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${P.Z.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"}},t.multiline&&(0,n.Z)({padding:"4px 0 5px"},"small"===t.size&&{paddingTop:1}),t.fullWidth&&{width:"100%"})),z=(0,f.ZP)("input",{name:"MuiInputBase",slot:"Input",overridesResolver:M})(({theme:e,ownerState:t})=>{let r="light"===e.palette.mode,o=(0,n.Z)({color:"currentColor"},e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5},{transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})}),i={opacity:"0 !important"},l=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5};return(0,n.Z)({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":o,"&::-moz-placeholder":o,"&:-ms-input-placeholder":o,"&::-ms-input-placeholder":o,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${P.Z.formControl} &`]:{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&:-ms-input-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":l,"&:focus::-moz-placeholder":l,"&:focus:-ms-input-placeholder":l,"&:focus::-ms-input-placeholder":l},[`&.${P.Z.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},"small"===t.size&&{paddingTop:1},t.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},"search"===t.type&&{MozAppearance:"textfield"})}),B=(0,x.jsx)(function(e){return(0,x.jsx)(w,(0,n.Z)({},e,{defaultTheme:R.Z,themeId:C.Z}))},{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),j=l.forwardRef(function(e,t){var r;let s=(0,b.Z)({props:e,name:"MuiInputBase"}),{"aria-describedby":f,autoComplete:h,autoFocus:g,className:y,components:S={},componentsProps:w={},defaultValue:R,disabled:C,disableInjectingGlobalStyles:P,endAdornment:I,fullWidth:M=!1,id:j,inputComponent:W="input",inputProps:A={},inputRef:N,maxRows:L,minRows:E,multiline:T=!1,name:q,onBlur:D,onChange:H,onClick:U,onFocus:V,onKeyDown:_,onKeyUp:K,placeholder:X,readOnly:G,renderSuffix:J,rows:Q,slotProps:Y={},slots:ee={},startAdornment:et,type:er="text",value:eo}=s,en=(0,o.Z)(s,F),ei=null!=A.value?A.value:eo,{current:el}=l.useRef(null!=ei),ea=l.useRef(),es=l.useCallback(e=>{},[]),ed=(0,v.Z)(ea,N,A.ref,es),[eu,ep]=l.useState(!1),ec=(0,m.Z)(),em=(0,p.Z)({props:s,muiFormControl:ec,states:["color","disabled","error","hiddenLabel","size","required","filled"]});em.focused=ec?ec.focused:eu,l.useEffect(()=>{!ec&&C&&eu&&(ep(!1),D&&D())},[ec,C,eu,D]);let ef=ec&&ec.onFilled,eb=ec&&ec.onEmpty,eh=l.useCallback(e=>{(0,k.vd)(e)?ef&&ef():eb&&eb()},[ef,eb]);(0,Z.Z)(()=>{el&&eh({value:ei})},[ei,eh,el]),l.useEffect(()=>{eh(ea.current)},[]);let ev=W,eZ=A;T&&"input"===ev&&(eZ=Q?(0,n.Z)({type:void 0,minRows:Q,maxRows:Q},eZ):(0,n.Z)({type:void 0,maxRows:L,minRows:E},eZ),ev=d.u),l.useEffect(()=>{ec&&ec.setAdornedStart(!!et)},[ec,et]);let eg=(0,n.Z)({},s,{color:em.color||"primary",disabled:em.disabled,endAdornment:I,error:em.error,focused:em.focused,formControl:ec,fullWidth:M,hiddenLabel:em.hiddenLabel,multiline:T,size:em.size,startAdornment:et,type:er}),ex=$(eg),ey=ee.root||S.Root||O,eS=Y.root||w.root||{},ew=ee.input||S.Input||z;return eZ=(0,n.Z)({},eZ,null!=(r=Y.input)?r:w.input),(0,x.jsxs)(l.Fragment,{children:[!P&&B,(0,x.jsxs)(ey,(0,n.Z)({},eS,!(0,u.X)(ey)&&{ownerState:(0,n.Z)({},eg,eS.ownerState)},{ref:t,onClick:e=>{ea.current&&e.currentTarget===e.target&&ea.current.focus(),U&&U(e)}},en,{className:(0,a.Z)(ex.root,eS.className,y,G&&"MuiInputBase-readOnly"),children:[et,(0,x.jsx)(c.Z.Provider,{value:null,children:(0,x.jsx)(ew,(0,n.Z)({ownerState:eg,"aria-invalid":em.error,"aria-describedby":f,autoComplete:h,autoFocus:g,defaultValue:R,disabled:em.disabled,id:j,onAnimationStart:e=>{eh("mui-auto-fill-cancel"===e.animationName?ea.current:{value:"x"})},name:q,placeholder:X,readOnly:G,required:em.required,rows:Q,value:ei,onKeyDown:_,onKeyUp:K,type:er},eZ,!(0,u.X)(ew)&&{as:ev,ownerState:(0,n.Z)({},eg,eZ.ownerState)},{ref:ed,className:(0,a.Z)(ex.input,eZ.className,G&&"MuiInputBase-readOnly"),onBlur:e=>{D&&D(e),A.onBlur&&A.onBlur(e),ec&&ec.onBlur?ec.onBlur(e):ep(!1)},onChange:(e,...t)=>{if(!el){let t=e.target||ea.current;if(null==t)throw Error((0,i.Z)(1));eh({value:t.value})}A.onChange&&A.onChange(e,...t),H&&H(e,...t)},onFocus:e=>{if(em.disabled){e.stopPropagation();return}V&&V(e),A.onFocus&&A.onFocus(e),ec&&ec.onFocus?ec.onFocus(e):ep(!0)}}))}),I,J?J((0,n.Z)({},em,{startAdornment:et})):null]}))]})});var W=j},7044:function(e,t,r){r.d(t,{u:function(){return i}});var o=r(6520),n=r(5702);function i(e){return(0,n.Z)("MuiInputBase",e)}let l=(0,o.Z)("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);t.Z=l},5454:function(e,t,r){function o(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function n(e,t=!1){return e&&(o(e.value)&&""!==e.value||t&&o(e.defaultValue)&&""!==e.defaultValue)}function i(e){return e.startAdornment}r.d(t,{B7:function(){return i},vd:function(){return n}})},819:function(e,t,r){r.d(t,{Z:function(){return F}});var o=r(791),n=r(3428),i=r(2265),l=r(5600),a=r(7042),s=r(4379),d=r(9592),u=r(8702),p=r(7927),c=r(5843),m=r(6520),f=r(5702);function b(e){return(0,f.Z)("MuiFormLabel",e)}let h=(0,m.Z)("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]);var v=r(7437);let Z=["children","className","color","component","disabled","error","filled","focused","required"],g=e=>{let{classes:t,color:r,focused:o,disabled:n,error:i,filled:a,required:s}=e,d={root:["root",`color${(0,u.Z)(r)}`,n&&"disabled",i&&"error",a&&"filled",o&&"focused",s&&"required"],asterisk:["asterisk",i&&"error"]};return(0,l.Z)(d,b,t)},x=(0,c.ZP)("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:e},t)=>(0,n.Z)({},t.root,"secondary"===e.color&&t.colorSecondary,e.filled&&t.filled)})(({theme:e,ownerState:t})=>(0,n.Z)({color:(e.vars||e).palette.text.secondary},e.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${h.focused}`]:{color:(e.vars||e).palette[t.color].main},[`&.${h.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${h.error}`]:{color:(e.vars||e).palette.error.main}})),y=(0,c.ZP)("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(({theme:e})=>({[`&.${h.error}`]:{color:(e.vars||e).palette.error.main}})),S=i.forwardRef(function(e,t){let r=(0,p.Z)({props:e,name:"MuiFormLabel"}),{children:i,className:l,component:u="label"}=r,c=(0,o.Z)(r,Z),m=(0,d.Z)(),f=(0,s.Z)({props:r,muiFormControl:m,states:["color","required","focused","disabled","error","filled"]}),b=(0,n.Z)({},r,{color:f.color||"primary",component:u,disabled:f.disabled,error:f.error,filled:f.filled,focused:f.focused,required:f.required}),h=g(b);return(0,v.jsxs)(x,(0,n.Z)({as:u,ownerState:b,className:(0,a.Z)(h.root,l),ref:t},c,{children:[i,f.required&&(0,v.jsxs)(y,{ownerState:b,"aria-hidden":!0,className:h.asterisk,children:[" ","*"]})]}))});function w(e){return(0,f.Z)("MuiInputLabel",e)}(0,m.Z)("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);let R=["disableAnimation","margin","shrink","variant","className"],C=e=>{let{classes:t,formControl:r,size:o,shrink:i,disableAnimation:a,variant:s,required:d}=e,u=(0,l.Z)({root:["root",r&&"formControl",!a&&"animated",i&&"shrink","small"===o&&"sizeSmall",s],asterisk:[d&&"asterisk"]},w,t);return(0,n.Z)({},t,u)},k=(0,c.ZP)(S,{shouldForwardProp:e=>(0,c.FO)(e)||"classes"===e,name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[{[`& .${h.asterisk}`]:t.asterisk},t.root,r.formControl&&t.formControl,"small"===r.size&&t.sizeSmall,r.shrink&&t.shrink,!r.disableAnimation&&t.animated,t[r.variant]]}})(({theme:e,ownerState:t})=>(0,n.Z)({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},t.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},"small"===t.size&&{transform:"translate(0, 17px) scale(1)"},t.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!t.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},"filled"===t.variant&&(0,n.Z)({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},"small"===t.size&&{transform:"translate(12px, 13px) scale(1)"},t.shrink&&(0,n.Z)({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},"small"===t.size&&{transform:"translate(12px, 4px) scale(0.75)"})),"outlined"===t.variant&&(0,n.Z)({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},"small"===t.size&&{transform:"translate(14px, 9px) scale(1)"},t.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),P=i.forwardRef(function(e,t){let r=(0,p.Z)({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,shrink:l,className:u}=r,c=(0,o.Z)(r,R),m=(0,d.Z)(),f=l;void 0===f&&m&&(f=m.filled||m.focused||m.adornedStart);let b=(0,s.Z)({props:r,muiFormControl:m,states:["size","variant","required"]}),h=(0,n.Z)({},r,{disableAnimation:i,formControl:m,shrink:f,size:b.size,variant:b.variant,required:b.required}),Z=C(h);return(0,v.jsx)(k,(0,n.Z)({"data-shrink":f,ownerState:h,ref:t,className:(0,a.Z)(Z.root,u)},c,{classes:Z}))});var F=P},923:function(e,t,r){r.d(t,{Z:function(){return R}});var o,n=r(791),i=r(3428),l=r(2265),a=r(5600),s=r(5843),d=r(7437);let u=["children","classes","className","label","notched"],p=(0,s.ZP)("fieldset")({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),c=(0,s.ZP)("legend")(({ownerState:e,theme:t})=>(0,i.Z)({float:"unset",width:"auto",overflow:"hidden"},!e.withLabel&&{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})},e.withLabel&&(0,i.Z)({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},e.notched&&{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})})));var m=r(9592),f=r(4379),b=r(130),h=r(3382),v=r(7927);let Z=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],g=e=>{let{classes:t}=e,r=(0,a.Z)({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},b.e,t);return(0,i.Z)({},t,r)},x=(0,s.ZP)(h.Ej,{shouldForwardProp:e=>(0,s.FO)(e)||"classes"===e,name:"MuiOutlinedInput",slot:"Root",overridesResolver:h.Gx})(({theme:e,ownerState:t})=>{let r="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return(0,i.Z)({position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${b.Z.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${b.Z.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:r}},[`&.${b.Z.focused} .${b.Z.notchedOutline}`]:{borderColor:(e.vars||e).palette[t.color].main,borderWidth:2},[`&.${b.Z.error} .${b.Z.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${b.Z.disabled} .${b.Z.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}},t.startAdornment&&{paddingLeft:14},t.endAdornment&&{paddingRight:14},t.multiline&&(0,i.Z)({padding:"16.5px 14px"},"small"===t.size&&{padding:"8.5px 14px"}))}),y=(0,s.ZP)(function(e){let{className:t,label:r,notched:l}=e,a=(0,n.Z)(e,u),s=null!=r&&""!==r,m=(0,i.Z)({},e,{notched:l,withLabel:s});return(0,d.jsx)(p,(0,i.Z)({"aria-hidden":!0,className:t,ownerState:m},a,{children:(0,d.jsx)(c,{ownerState:m,children:s?(0,d.jsx)("span",{children:r}):o||(o=(0,d.jsx)("span",{className:"notranslate",children:""}))})}))},{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{let t="light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),S=(0,s.ZP)(h.rA,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:h._o})(({theme:e,ownerState:t})=>(0,i.Z)({padding:"16.5px 14px"},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.mode?null:"#fff",caretColor:"light"===e.palette.mode?null:"#fff",borderRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},"small"===t.size&&{padding:"8.5px 14px"},t.multiline&&{padding:0},t.startAdornment&&{paddingLeft:0},t.endAdornment&&{paddingRight:0})),w=l.forwardRef(function(e,t){var r,o,a,s,u;let p=(0,v.Z)({props:e,name:"MuiOutlinedInput"}),{components:c={},fullWidth:b=!1,inputComponent:w="input",label:R,multiline:C=!1,notched:k,slots:P={},type:F="text"}=p,I=(0,n.Z)(p,Z),M=g(p),$=(0,m.Z)(),O=(0,f.Z)({props:p,muiFormControl:$,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),z=(0,i.Z)({},p,{color:O.color||"primary",disabled:O.disabled,error:O.error,focused:O.focused,formControl:$,fullWidth:b,hiddenLabel:O.hiddenLabel,multiline:C,size:O.size,type:F}),B=null!=(r=null!=(o=P.root)?o:c.Root)?r:x,j=null!=(a=null!=(s=P.input)?s:c.Input)?a:S;return(0,d.jsx)(h.ZP,(0,i.Z)({slots:{root:B,input:j},renderSuffix:e=>(0,d.jsx)(y,{ownerState:z,className:M.notchedOutline,label:null!=R&&""!==R&&O.required?u||(u=(0,d.jsxs)(l.Fragment,{children:[R," ","*"]})):R,notched:void 0!==k?k:!!(e.startAdornment||e.filled||e.focused)}),fullWidth:b,inputComponent:w,multiline:C,ref:t,type:F},I,{classes:(0,i.Z)({},M,{notchedOutline:null})}))});w.muiName="Input";var R=w},130:function(e,t,r){r.d(t,{e:function(){return a}});var o=r(3428),n=r(6520),i=r(5702),l=r(7044);function a(e){return(0,i.Z)("MuiOutlinedInput",e)}let s=(0,o.Z)({},l.Z,(0,n.Z)("MuiOutlinedInput",["root","notchedOutline","input"]));t.Z=s},654:function(e,t,r){r.d(t,{Z:function(){return ee}});var o,n=r(3428),i=r(791),l=r(2265),a=r(7042),s=r(5959),d=r(18);r(9176);var u=r(5600),p=r(3931),c=r(8702),m=r(3375),f=r(6520),b=r(5702);function h(e){return(0,b.Z)("MuiNativeSelect",e)}let v=(0,f.Z)("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Z=r(5843),g=r(7437);let x=["className","disabled","error","IconComponent","inputRef","variant"],y=e=>{let{classes:t,variant:r,disabled:o,multiple:n,open:i,error:l}=e,a={select:["select",r,o&&"disabled",n&&"multiple",l&&"error"],icon:["icon",`icon${(0,c.Z)(r)}`,i&&"iconOpen",o&&"disabled"]};return(0,u.Z)(a,h,t)},S=({ownerState:e,theme:t})=>(0,n.Z)({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":(0,n.Z)({},t.vars?{backgroundColor:`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:"light"===t.palette.mode?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${v.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},"filled"===e.variant&&{"&&&":{paddingRight:32}},"outlined"===e.variant&&{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}),w=(0,Z.ZP)("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Z.FO,overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.select,t[r.variant],r.error&&t.error,{[`&.${v.multiple}`]:t.multiple}]}})(S),R=({ownerState:e,theme:t})=>(0,n.Z)({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${v.disabled}`]:{color:(t.vars||t).palette.action.disabled}},e.open&&{transform:"rotate(180deg)"},"filled"===e.variant&&{right:7},"outlined"===e.variant&&{right:7}),C=(0,Z.ZP)("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.icon,r.variant&&t[`icon${(0,c.Z)(r.variant)}`],r.open&&t.iconOpen]}})(R),k=l.forwardRef(function(e,t){let{className:r,disabled:o,error:s,IconComponent:d,inputRef:u,variant:p="standard"}=e,c=(0,i.Z)(e,x),m=(0,n.Z)({},e,{disabled:o,variant:p,error:s}),f=y(m);return(0,g.jsxs)(l.Fragment,{children:[(0,g.jsx)(w,(0,n.Z)({ownerState:m,className:(0,a.Z)(f.select,r),disabled:o,ref:u||t},c)),e.multiple?null:(0,g.jsx)(C,{as:d,ownerState:m,className:f.icon})]})});var P=r(5454),F=r(7663),I=r(3292);function M(e){return(0,b.Z)("MuiSelect",e)}let $=(0,f.Z)("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),O=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],z=(0,Z.ZP)("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[{[`&.${$.select}`]:t.select},{[`&.${$.select}`]:t[r.variant]},{[`&.${$.error}`]:t.error},{[`&.${$.multiple}`]:t.multiple}]}})(S,{[`&.${$.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),B=(0,Z.ZP)("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.icon,r.variant&&t[`icon${(0,c.Z)(r.variant)}`],r.open&&t.iconOpen]}})(R),j=(0,Z.ZP)("input",{shouldForwardProp:e=>(0,Z.Dz)(e)&&"classes"!==e,name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function W(e,t){return"object"==typeof t&&null!==t?e===t:String(e)===String(t)}let A=e=>{let{classes:t,variant:r,disabled:o,multiple:n,open:i,error:l}=e,a={select:["select",r,o&&"disabled",n&&"multiple",l&&"error"],icon:["icon",`icon${(0,c.Z)(r)}`,i&&"iconOpen",o&&"disabled"],nativeInput:["nativeInput"]};return(0,u.Z)(a,M,t)},N=l.forwardRef(function(e,t){var r;let s,u;let{"aria-describedby":c,"aria-label":f,autoFocus:b,autoWidth:h,children:v,className:Z,defaultOpen:x,defaultValue:y,disabled:S,displayEmpty:w,error:R=!1,IconComponent:C,inputRef:k,labelId:M,MenuProps:$={},multiple:N,name:L,onBlur:E,onChange:T,onClose:q,onFocus:D,onOpen:H,open:U,readOnly:V,renderValue:_,SelectDisplayProps:K={},tabIndex:X,value:G,variant:J="standard"}=e,Q=(0,i.Z)(e,O),[Y,ee]=(0,I.Z)({controlled:G,default:y,name:"Select"}),[et,er]=(0,I.Z)({controlled:U,default:x,name:"Select"}),eo=l.useRef(null),en=l.useRef(null),[ei,el]=l.useState(null),{current:ea}=l.useRef(null!=U),[es,ed]=l.useState(),eu=(0,F.Z)(t,k),ep=l.useCallback(e=>{en.current=e,e&&el(e)},[]),ec=null==ei?void 0:ei.parentNode;l.useImperativeHandle(eu,()=>({focus:()=>{en.current.focus()},node:eo.current,value:Y}),[Y]),l.useEffect(()=>{x&&et&&ei&&!ea&&(ed(h?null:ec.clientWidth),en.current.focus())},[ei,h]),l.useEffect(()=>{b&&en.current.focus()},[b]),l.useEffect(()=>{if(!M)return;let e=(0,p.Z)(en.current).getElementById(M);if(e){let t=()=>{getSelection().isCollapsed&&en.current.focus()};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}},[M]);let em=(e,t)=>{e?H&&H(t):q&&q(t),ea||(ed(h?null:ec.clientWidth),er(e))},ef=l.Children.toArray(v),eb=e=>t=>{let r;if(t.currentTarget.hasAttribute("tabindex")){if(N){r=Array.isArray(Y)?Y.slice():[];let t=Y.indexOf(e.props.value);-1===t?r.push(e.props.value):r.splice(t,1)}else r=e.props.value;if(e.props.onClick&&e.props.onClick(t),Y!==r&&(ee(r),T)){let o=t.nativeEvent||t,n=new o.constructor(o.type,o);Object.defineProperty(n,"target",{writable:!0,value:{value:r,name:L}}),T(n,e)}N||em(!1,t)}},eh=null!==ei&&et;delete Q["aria-invalid"];let ev=[],eZ=!1;((0,P.vd)({value:Y})||w)&&(_?s=_(Y):eZ=!0);let eg=ef.map(e=>{let t;if(!l.isValidElement(e))return null;if(N){if(!Array.isArray(Y))throw Error((0,d.Z)(2));(t=Y.some(t=>W(t,e.props.value)))&&eZ&&ev.push(e.props.children)}else(t=W(Y,e.props.value))&&eZ&&(u=e.props.children);return l.cloneElement(e,{"aria-selected":t?"true":"false",onClick:eb(e),onKeyUp:t=>{" "===t.key&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:"option",selected:t,value:void 0,"data-value":e.props.value})});eZ&&(s=N?0===ev.length?null:ev.reduce((e,t,r)=>(e.push(t),r<ev.length-1&&e.push(", "),e),[]):u);let ex=es;!h&&ea&&ei&&(ex=ec.clientWidth);let ey=K.id||(L?`mui-component-select-${L}`:void 0),eS=(0,n.Z)({},e,{variant:J,value:Y,open:eh,error:R}),ew=A(eS);return(0,g.jsxs)(l.Fragment,{children:[(0,g.jsx)(z,(0,n.Z)({ref:ep,tabIndex:void 0!==X?X:S?null:0,role:"button","aria-disabled":S?"true":void 0,"aria-expanded":eh?"true":"false","aria-haspopup":"listbox","aria-label":f,"aria-labelledby":[M,ey].filter(Boolean).join(" ")||void 0,"aria-describedby":c,onKeyDown:e=>{V||-1===[" ","ArrowUp","ArrowDown","Enter"].indexOf(e.key)||(e.preventDefault(),em(!0,e))},onMouseDown:S||V?null:e=>{0===e.button&&(e.preventDefault(),en.current.focus(),em(!0,e))},onBlur:e=>{!eh&&E&&(Object.defineProperty(e,"target",{writable:!0,value:{value:Y,name:L}}),E(e))},onFocus:D},K,{ownerState:eS,className:(0,a.Z)(K.className,ew.select,Z),id:ey,children:null!=(r=s)&&("string"!=typeof r||r.trim())?s:o||(o=(0,g.jsx)("span",{className:"notranslate",children:""}))})),(0,g.jsx)(j,(0,n.Z)({"aria-invalid":R,value:Array.isArray(Y)?Y.join(","):Y,name:L,ref:eo,"aria-hidden":!0,onChange:e=>{let t=ef.find(t=>t.props.value===e.target.value);void 0!==t&&(ee(t.props.value),T&&T(e,t))},tabIndex:-1,disabled:S,className:ew.nativeInput,autoFocus:b,ownerState:eS},Q)),(0,g.jsx)(B,{as:C,className:ew.icon,ownerState:eS}),(0,g.jsx)(m.Z,(0,n.Z)({id:`menu-${L||""}`,anchorEl:ec,open:eh,onClose:e=>{em(!1,e)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},$,{MenuListProps:(0,n.Z)({"aria-labelledby":M,role:"listbox",disableListWrap:!0},$.MenuListProps),PaperProps:(0,n.Z)({},$.PaperProps,{style:(0,n.Z)({minWidth:ex},null!=$.PaperProps?$.PaperProps.style:null)}),children:eg}))]})});var L=r(4379),E=r(9592),T=r(2246),q=r(1711),D=r(7328),H=r(923),U=r(7927);let V=["autoWidth","children","classes","className","defaultOpen","displayEmpty","IconComponent","id","input","inputProps","label","labelId","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"],_=["root"],K=e=>{let{classes:t}=e;return t},X={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>(0,Z.FO)(e)&&"variant"!==e,slot:"Root"},G=(0,Z.ZP)(q.Z,X)(""),J=(0,Z.ZP)(H.Z,X)(""),Q=(0,Z.ZP)(D.Z,X)(""),Y=l.forwardRef(function(e,t){let r=(0,U.Z)({name:"MuiSelect",props:e}),{autoWidth:o=!1,children:d,classes:u={},className:p,defaultOpen:c=!1,displayEmpty:m=!1,IconComponent:f=T.Z,id:b,input:h,inputProps:v,label:Z,labelId:x,MenuProps:y,multiple:S=!1,native:w=!1,onClose:R,onOpen:C,open:P,renderValue:I,SelectDisplayProps:M,variant:$="outlined"}=r,O=(0,i.Z)(r,V),z=w?k:N,B=(0,E.Z)(),j=(0,L.Z)({props:r,muiFormControl:B,states:["variant","error"]}),W=j.variant||$,A=(0,n.Z)({},r,{variant:W,classes:u}),q=K(A),D=(0,i.Z)(q,_),H=h||({standard:(0,g.jsx)(G,{ownerState:A}),outlined:(0,g.jsx)(J,{label:Z,ownerState:A}),filled:(0,g.jsx)(Q,{ownerState:A})})[W],X=(0,F.Z)(t,H.ref);return(0,g.jsx)(l.Fragment,{children:l.cloneElement(H,(0,n.Z)({inputComponent:z,inputProps:(0,n.Z)({children:d,error:j.error,IconComponent:f,variant:W,type:void 0,multiple:S},w?{id:b}:{autoWidth:o,defaultOpen:c,displayEmpty:m,labelId:x,MenuProps:y,onClose:R,onOpen:C,open:P,renderValue:I,SelectDisplayProps:(0,n.Z)({id:b},M)},v,{classes:v?(0,s.Z)(D,v.classes):D},h?h.props.inputProps:{})},S&&w&&"outlined"===W?{notched:!0}:{},{ref:X,className:(0,a.Z)(H.props.className,p,q.root)},!h&&{variant:W},O))})});Y.muiName="Select";var ee=Y},1975:function(e,t,r){r.d(t,{Z:function(){return W}});var o,n=r(3428),i=r(791),l=r(2265),a=r(7042),s=r(5600),d=r(3449),u=r(5843),p=r(7927),c=r(1711),m=r(7328),f=r(923),b=r(819),h=r(4081),v=r(4379),Z=r(9592),g=r(8702),x=r(6520),y=r(5702);function S(e){return(0,y.Z)("MuiFormHelperText",e)}let w=(0,x.Z)("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var R=r(7437);let C=["children","className","component","disabled","error","filled","focused","margin","required","variant"],k=e=>{let{classes:t,contained:r,size:o,disabled:n,error:i,filled:l,focused:a,required:d}=e,u={root:["root",n&&"disabled",i&&"error",o&&`size${(0,g.Z)(o)}`,r&&"contained",a&&"focused",l&&"filled",d&&"required"]};return(0,s.Z)(u,S,t)},P=(0,u.ZP)("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,r.size&&t[`size${(0,g.Z)(r.size)}`],r.contained&&t.contained,r.filled&&t.filled]}})(({theme:e,ownerState:t})=>(0,n.Z)({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${w.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${w.error}`]:{color:(e.vars||e).palette.error.main}},"small"===t.size&&{marginTop:4},t.contained&&{marginLeft:14,marginRight:14})),F=l.forwardRef(function(e,t){let r=(0,p.Z)({props:e,name:"MuiFormHelperText"}),{children:l,className:s,component:d="p"}=r,u=(0,i.Z)(r,C),c=(0,Z.Z)(),m=(0,v.Z)({props:r,muiFormControl:c,states:["variant","size","disabled","error","filled","focused","required"]}),f=(0,n.Z)({},r,{component:d,contained:"filled"===m.variant||"outlined"===m.variant,variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required}),b=k(f);return(0,R.jsx)(P,(0,n.Z)({as:d,ownerState:f,className:(0,a.Z)(b.root,s),ref:t},u,{children:" "===l?o||(o=(0,R.jsx)("span",{className:"notranslate",children:""})):l}))});var I=r(654);function M(e){return(0,y.Z)("MuiTextField",e)}(0,x.Z)("MuiTextField",["root"]);let $=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],O={standard:c.Z,filled:m.Z,outlined:f.Z},z=e=>{let{classes:t}=e;return(0,s.Z)({root:["root"]},M,t)},B=(0,u.ZP)(h.Z,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),j=l.forwardRef(function(e,t){let r=(0,p.Z)({props:e,name:"MuiTextField"}),{autoComplete:o,autoFocus:l=!1,children:s,className:u,color:c="primary",defaultValue:m,disabled:f=!1,error:h=!1,FormHelperTextProps:v,fullWidth:Z=!1,helperText:g,id:x,InputLabelProps:y,inputProps:S,InputProps:w,inputRef:C,label:k,maxRows:P,minRows:M,multiline:j=!1,name:W,onBlur:A,onChange:N,onFocus:L,placeholder:E,required:T=!1,rows:q,select:D=!1,SelectProps:H,type:U,value:V,variant:_="outlined"}=r,K=(0,i.Z)(r,$),X=(0,n.Z)({},r,{autoFocus:l,color:c,disabled:f,error:h,fullWidth:Z,multiline:j,required:T,select:D,variant:_}),G=z(X),J={};"outlined"===_&&(y&&void 0!==y.shrink&&(J.notched=y.shrink),J.label=k),D&&(H&&H.native||(J.id=void 0),J["aria-describedby"]=void 0);let Q=(0,d.Z)(x),Y=g&&Q?`${Q}-helper-text`:void 0,ee=k&&Q?`${Q}-label`:void 0,et=O[_],er=(0,R.jsx)(et,(0,n.Z)({"aria-describedby":Y,autoComplete:o,autoFocus:l,defaultValue:m,fullWidth:Z,multiline:j,name:W,rows:q,maxRows:P,minRows:M,type:U,value:V,id:Q,inputRef:C,onBlur:A,onChange:N,onFocus:L,placeholder:E,inputProps:S},J,w));return(0,R.jsxs)(B,(0,n.Z)({className:(0,a.Z)(G.root,u),disabled:f,error:h,fullWidth:Z,ref:t,required:T,color:c,variant:_,ownerState:X},K,{children:[null!=k&&""!==k&&(0,R.jsx)(b.Z,(0,n.Z)({htmlFor:Q,id:ee},y,{children:k})),D?(0,R.jsx)(I.Z,(0,n.Z)({"aria-describedby":Y,id:Q,labelId:ee,value:V,input:er},H,{children:s})):er,g&&(0,R.jsx)(F,(0,n.Z)({id:Y},v,{children:g}))]}))});var W=j},2246:function(e,t,r){r(2265);var o=r(9782),n=r(7437);t.Z=(0,o.Z)((0,n.jsx)("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown")}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[716],{8938:function(e,t,a){"use strict";a.d(t,{Z:function(){return W}});var n=a(791),i=a(3428),r=a(2265),s=a(7042),u=a(1380),o=a(5702),l=a(5600),d=a(8153),c=a(9190),h=a(4775),p=a(7437);let m=["className","component","disableGutters","fixed","maxWidth","classes"],x=(0,h.Z)(),f=(0,c.Z)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[`maxWidth${(0,u.Z)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),g=e=>(0,d.Z)({props:e,name:"MuiContainer",defaultTheme:x}),b=(e,t)=>{let{classes:a,fixed:n,disableGutters:i,maxWidth:r}=e,s={root:["root",r&&`maxWidth${(0,u.Z)(String(r))}`,n&&"fixed",i&&"disableGutters"]};return(0,l.Z)(s,e=>(0,o.Z)(t,e),a)};var v=a(8702),C=a(5843),S=a(7927);let Z=function(e={}){let{createStyledComponent:t=f,useThemeProps:a=g,componentName:u="MuiContainer"}=e,o=t(({theme:e,ownerState:t})=>(0,i.Z)({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,a)=>{let n=e.breakpoints.values[a];return 0!==n&&(t[e.breakpoints.up(a)]={maxWidth:`${n}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:t})=>(0,i.Z)({},"xs"===t.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},t.maxWidth&&"xs"!==t.maxWidth&&{[e.breakpoints.up(t.maxWidth)]:{maxWidth:`${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`}})),l=r.forwardRef(function(e,t){let r=a(e),{className:l,component:d="div",disableGutters:c=!1,fixed:h=!1,maxWidth:x="lg"}=r,f=(0,n.Z)(r,m),g=(0,i.Z)({},r,{component:d,disableGutters:c,fixed:h,maxWidth:x}),v=b(g,u);return(0,p.jsx)(o,(0,i.Z)({as:d,ownerState:g,className:(0,s.Z)(v.root,l),ref:t},f))});return l}({createStyledComponent:(0,C.ZP)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[`maxWidth${(0,v.Z)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,S.Z)({props:e,name:"MuiContainer"})});var W=Z},4348:function(e,t,a){Promise.resolve().then(a.bind(a,6722))},6722:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return p}});var n=a(7437),i=a(2265),r=a(1396),s=a.n(r),u=a(5551),o=a(1975),l=a(8938),d=a(3226),c=a(4033),h=a(3571);function p(){let e=(0,c.useRouter)(),[t,a]=i.useState(""),[r,p]=i.useState(""),[m,x]=i.useState(""),[f,g]=i.useState(!1),[b,v]=i.useState(null),C=i.useCallback(async()=>{let{data:e,error:t}=await h.OQ.auth.refreshSession();e&&v(e.user)},[]);i.useEffect(()=>{C()},[C]);let S=async a=>{if(g(!0),x(""),a.stopPropagation(),a.preventDefault(),!b){let{data:a,error:n}=await h.OQ.auth.signInWithPassword({email:t,password:r});n?x(n.message):e.push("/")}g(!1)};return b?(0,n.jsxs)("div",{style:{textAlign:"center"},children:["You're already logged in as ",b.email,"."]}):(0,n.jsxs)(l.Z,{component:"main",maxWidth:"xs",children:[(0,n.jsx)(d.Z,{component:"h1",variant:"h5",children:"Sign in"}),(0,n.jsx)("form",{children:!b&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,onChange:e=>a(e.target.value),value:t,error:!!m}),(0,n.jsx)(o.Z,{disabled:f,variant:"outlined",margin:"normal",required:!0,fullWidth:!0,name:"password",label:"Password",type:"password",id:"password",autoComplete:"current-password",onChange:e=>p(e.target.value),value:r,error:!!m,helperText:m}),(0,n.jsx)(u.Z,{type:"submit",disabled:f,sx:{marginTop:"1em"},fullWidth:!0,variant:"contained",color:"primary",onClick:S,children:"Sign In"}),(0,n.jsxs)("p",{children:["Don't have an account yet? ",(0,n.jsx)(s(),{href:"/auth/signup",children:"Sign up"})]})]})})]})}},3571:function(e,t,a){"use strict";a.d(t,{Ho:function(){return c},OQ:function(){return s},aC:function(){return o}});var n=a(7437),i=a(2265),r=a(3082);let s=(0,r.createClientComponentClient)(),u=(0,i.createContext)({}),o=()=>(0,i.useContext)(u),l=(e,t)=>s.auth.signInWithPassword({email:e,password:t}),d=()=>s.auth.signOut(),c=e=>{let{children:t}=e,[a,r]=(0,i.useState)(null),[o,c]=(0,i.useState)(!1),h=(0,i.useCallback)(async()=>{let{data:e,error:t}=await s.auth.refreshSession();e&&r(e.user)},[]);return(0,i.useEffect)(()=>{h();let{data:e}=s.auth.onAuthStateChange(async(e,t)=>{"PASSWORD_RECOVERY"==e?c(!1):"SIGNED_IN"===e&&t?(r(t.user),c(!0)):"SIGNED_OUT"===e&&(c(!1),r(null))});return()=>{e.subscription.unsubscribe()}},[h]),(0,n.jsx)(u.Provider,{value:{loggedIn:o,user:a,login:l,logout:d},children:t})}}},function(e){e.O(0,[293,808,548,82,975,971,596,744],function(){return e(e.s=4348)}),_N_E=e.O()}]);
|