"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7420],{47420:function(e,t,r){let i;r.d(t,{createBrowserClient:function(){return v}});var n=r(70516),o=r(34875);function a(){return"undefined"!=typeof window&&void 0!==window.document}let s={path:"/",sameSite:"lax",httpOnly:!1,maxAge:3456e4},l=/^(.*)[.](0|[1-9][0-9]*)$/;function c(e,t){if(e===t)return!0;let r=e.match(l);return!!r&&r[1]===t}function u(e,t,r){let i=r??3180,n=encodeURIComponent(t);if(n.length<=i)return[{name:e,value:t}];let o=[];for(;n.length>0;){let e=n.slice(0,i),t=e.lastIndexOf("%");t>i-3&&(e=e.slice(0,t));let r="";for(;e.length>0;)try{r=decodeURIComponent(e);break}catch(t){if(t instanceof URIError&&"%"===e.at(-3)&&e.length>3)e=e.slice(0,e.length-3);else throw t}o.push(r),n=n.slice(e.length)}return o.map((t,r)=>({name:`${e}.${r}`,value:t}))}async function f(e,t){let r=await t(e);if(r)return r;let i=[];for(let r=0;;r++){let n=`${e}.${r}`,o=await t(n);if(!o)break;i.push(o)}return i.length>0?i.join(""):null}let d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),p=" 	\n\r=".split(""),h=(()=>{let e=Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<p.length;t+=1)e[p[t].charCodeAt(0)]=-2;for(let t=0;t<d.length;t+=1)e[d[t].charCodeAt(0)]=t;return e})();function m(e){let t=[],r=0,i=0;if(function(e,t){for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r);if(i>55295&&i<=56319){let t=(i-55296)*1024&65535;i=(e.charCodeAt(r+1)-56320&65535|t)+65536,r+=1}!function(e,t){if(e<=127){t(e);return}if(e<=2047){t(192|e>>6),t(128|63&e);return}if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|63&e);return}if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|63&e);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}(i,t)}}(e,e=>{for(r=r<<8|e,i+=8;i>=6;){let e=r>>i-6&63;t.push(d[e]),i-=6}}),i>0)for(r<<=6-i,i=6;i>=6;){let e=r>>i-6&63;t.push(d[e]),i-=6}return t.join("")}function g(e){let t=[],r=e=>{t.push(String.fromCodePoint(e))},i={utf8seq:0,codepoint:0},n=0,o=0;for(let t=0;t<e.length;t+=1){let a=h[e.charCodeAt(t)];if(a>-1)for(n=n<<6|a,o+=6;o>=8;)(function(e,t,r){if(0===t.utf8seq){if(e<=127){r(e);return}for(let r=1;r<6;r+=1)if((e>>7-r&1)==0){t.utf8seq=r;break}if(2===t.utf8seq)t.codepoint=31&e;else if(3===t.utf8seq)t.codepoint=15&e;else if(4===t.utf8seq)t.codepoint=7&e;else throw Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|63&e,t.utf8seq-=1,0===t.utf8seq&&r(t.codepoint)}})(n>>o-8&255,i,r),o-=8;else if(-2===a)continue;else throw Error(`Invalid Base64-URL character "${e.at(t)}" at position ${t}`)}return t.join("")}let w="base64-";async function y({getAll:e,setAll:t,setItems:r,removedItems:i},n){let o=n.cookieEncoding,a=n.cookieOptions??null,l=await e([...r?Object.keys(r):[],...i?Object.keys(i):[]]),f=l?.map(({name:e})=>e)||[],d=Object.keys(i).flatMap(e=>f.filter(t=>c(t,e))),p=Object.keys(r).flatMap(e=>{let t=new Set(f.filter(t=>c(t,e))),i=r[e];"base64url"===o&&(i=w+m(i));let n=u(e,i);return n.forEach(e=>{t.delete(e.name)}),d.push(...t),n}),h={...s,...a,maxAge:0},g={...s,...a,maxAge:s.maxAge};delete h.name,delete g.name,await t([...d.map(e=>({name:e,value:"",options:h})),...p.map(({name:e,value:t})=>({name:e,value:t,options:g}))])}function v(e,t,r){let l=r?.isSingleton===!0||(!r||!("isSingleton"in r))&&a();if(l&&i)return i;if(!e||!t)throw Error(`@supabase/ssr: Your project's URL and API key are required to create a Supabase client!

Check your Supabase project's API settings to find these values

https://supabase.com/dashboard/project/_/settings/api`);let{storage:d}=function(e,t){let r,i;let n=e.cookies??null,l=e.cookieEncoding,d={},p={};if(n){if("get"in n){let e=async e=>{let t=e.flatMap(e=>[e,...Array.from({length:5}).map((t,r)=>`${e}.${r}`)]),r=[];for(let e=0;e<t.length;e+=1){let i=await n.get(t[e]);(i||"string"==typeof i)&&r.push({name:t[e],value:i})}return r};if(r=async t=>await e(t),"set"in n&&"remove"in n)i=async e=>{for(let t=0;t<e.length;t+=1){let{name:r,value:i,options:o}=e[t];i?await n.set(r,i,o):await n.remove(r,o)}};else if(t)i=async()=>{console.warn("@supabase/ssr: createServerClient was configured without set and remove cookie methods, but the client needs to set cookies. This can lead to issues such as random logouts, early session termination or increased token refresh requests. If in NextJS, check your middleware.ts file, route handlers and server actions for correctness. Consider switching to the getAll and setAll cookie methods instead of get, set and remove which are deprecated and can be difficult to use correctly.")};else throw Error("@supabase/ssr: createBrowserClient requires configuring a getAll and setAll cookie method (deprecated: alternatively both get, set and remove can be used)")}else if("getAll"in n){if(r=async()=>await n.getAll(),"setAll"in n)i=n.setAll;else if(t)i=async()=>{console.warn("@supabase/ssr: createServerClient was configured without the setAll cookie method, but the client needs to set cookies. This can lead to issues such as random logouts, early session termination or increased token refresh requests. If in NextJS, check your middleware.ts file, route handlers and server actions for correctness.")};else throw Error("@supabase/ssr: createBrowserClient requires configuring both getAll and setAll cookie methods (deprecated: alternatively both get, set and remove can be used)")}else throw Error(`@supabase/ssr: ${t?"createServerClient":"createBrowserClient"} requires configuring getAll and setAll cookie methods (deprecated: alternatively use get, set and remove).${a()?" As this is called in a browser runtime, consider removing the cookies option object to use the document.cookie API automatically.":""}`)}else if(!t&&a()){let e=()=>{let e=(0,o.Q)(document.cookie);return Object.keys(e).map(t=>({name:t,value:e[t]}))};r=()=>e(),i=e=>{e.forEach(({name:e,value:t,options:r})=>{document.cookie=(0,o.q)(e,t,r)})}}else if(t)throw Error("@supabase/ssr: createServerClient must be initialized with cookie options that specify getAll and setAll functions (deprecated, not recommended: alternatively use get, set and remove)");else r=()=>[],i=()=>{throw Error("@supabase/ssr: createBrowserClient in non-browser runtimes (including Next.js pre-rendering mode) was not initialized cookie options that specify getAll and setAll functions (deprecated: alternatively use get, set and remove), but they were needed")};return t?{getAll:r,setAll:i,setItems:d,removedItems:p,storage:{isServer:!0,getItem:async e=>{if("string"==typeof d[e])return d[e];if(p[e])return null;let t=await r([e]),i=await f(e,async e=>{let r=t?.find(({name:t})=>t===e)||null;return r?r.value:null});if(!i)return null;let n=i;return i.startsWith(w)&&(n=g(i.substring(w.length))),n},setItem:async(t,n)=>{t.endsWith("-code-verifier")&&await y({getAll:r,setAll:i,setItems:{[t]:n},removedItems:{}},{cookieOptions:e?.cookieOptions??null,cookieEncoding:l}),d[t]=n,delete p[t]},removeItem:async e=>{delete d[e],p[e]=!0}}}:{getAll:r,setAll:i,setItems:d,removedItems:p,storage:{isServer:!1,getItem:async e=>{let t=await r([e]),i=await f(e,async e=>{let r=t?.find(({name:t})=>t===e)||null;return r?r.value:null});if(!i)return null;let n=i;return i.startsWith(w)&&(n=g(i.substring(w.length))),n},setItem:async(t,n)=>{let o=await r([t]),a=new Set((o?.map(({name:e})=>e)||[]).filter(e=>c(e,t))),f=n;"base64url"===l&&(f=w+m(n));let d=u(t,f);d.forEach(({name:e})=>{a.delete(e)});let p={...s,...e?.cookieOptions,maxAge:0},h={...s,...e?.cookieOptions,maxAge:s.maxAge};delete p.name,delete h.name;let g=[...[...a].map(e=>({name:e,value:"",options:p})),...d.map(({name:e,value:t})=>({name:e,value:t,options:h}))];g.length>0&&await i(g)},removeItem:async t=>{let n=await r([t]),o=(n?.map(({name:e})=>e)||[]).filter(e=>c(e,t)),a={...s,...e?.cookieOptions,maxAge:0};delete a.name,o.length>0&&await i(o.map(e=>({name:e,value:"",options:a})))}}}}({...r,cookieEncoding:r?.cookieEncoding??"base64url"},!1),p=(0,n.eI)(e,t,{...r,global:{...r?.global,headers:{...r?.global?.headers,"X-Client-Info":"supabase-ssr/0.5.1"}},auth:{...r?.auth,...r?.cookieOptions?.name?{storageKey:r.cookieOptions.name}:null,flowType:"pkce",autoRefreshToken:a(),detectSessionInUrl:a(),persistSession:!0,storage:d}});return l&&(i=p),p}},34875:function(e,t){t.Q=function(e,t){if("string"!=typeof e)throw TypeError("argument str must be a string");for(var r={},i=(t||{}).decode||n,o=0;o<e.length;){var a=e.indexOf("=",o);if(-1===a)break;var s=e.indexOf(";",o);if(-1===s)s=e.length;else if(s<a){o=e.lastIndexOf(";",a-1)+1;continue}var l=e.slice(o,a).trim();if(void 0===r[l]){var c=e.slice(a+1,s).trim();34===c.charCodeAt(0)&&(c=c.slice(1,-1)),r[l]=function(e,t){try{return t(e)}catch(t){return e}}(c,i)}o=s+1}return r},t.q=function(e,t,n){var a=n||{},s=a.encode||o;if("function"!=typeof s)throw TypeError("option encode is invalid");if(!i.test(e))throw TypeError("argument name is invalid");var l=s(t);if(l&&!i.test(l))throw TypeError("argument val is invalid");var c=e+"="+l;if(null!=a.maxAge){var u=a.maxAge-0;if(isNaN(u)||!isFinite(u))throw TypeError("option maxAge is invalid");c+="; Max-Age="+Math.floor(u)}if(a.domain){if(!i.test(a.domain))throw TypeError("option domain is invalid");c+="; Domain="+a.domain}if(a.path){if(!i.test(a.path))throw TypeError("option path is invalid");c+="; Path="+a.path}if(a.expires){var f=a.expires;if("[object Date]"!==r.call(f)&&!(f instanceof Date)||isNaN(f.valueOf()))throw TypeError("option expires is invalid");c+="; Expires="+f.toUTCString()}if(a.httpOnly&&(c+="; HttpOnly"),a.secure&&(c+="; Secure"),a.partitioned&&(c+="; Partitioned"),a.priority)switch("string"==typeof a.priority?a.priority.toLowerCase():a.priority){case"low":c+="; Priority=Low";break;case"medium":c+="; Priority=Medium";break;case"high":c+="; 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":c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"none":c+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return c};var r=Object.prototype.toString,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function n(e){return -1!==e.indexOf("%")?decodeURIComponent(e):e}function o(e){return encodeURIComponent(e)}}}]);