PageSourceSearch

https://artificialanalysis.ai/_next/static/chunks/66498-aa5028b47850c22a.js

js artificialanalysis.ai collected 2026-10-02 02:13:01 UTC 31,612 bytes, 2 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0fa55-3fbd-74e3-b459-047aa296a84e")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[66498],{3757:(e,t,r)=>{r.d(t,{bH:()=>i,Xc:()=>d,tT:()=>s,VY:()=>c});var n=r(89368);r(34872);let o=(0,n.a)({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]});o.newRole({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]}),o.newRole({user:[],session:[]});let i=()=>({id:"api-key",$InferServerPlugin:{},pathMethods:{"/api-key/create":"POST","/api-key/delete":"POST","/api-key/delete-all-expired-api-keys":"POST"}}),s=()=>({id:"magic-link",$InferServerPlugin:{}});var a=r(7528);r(61927),r(10214),r(67917),r(15042),r(86456),r(14375);var l=r(86035);r(52328);var u=r(63709);let c=e=>{let t=(0,u.eU)(!1),r=(0,u.eU)(!1),n=(0,u.eU)(!1),o=(0,u.eU)(!1),i={admin:l.MH,member:l.vC,owner:l.U1,...e?.roles};return{id:"organization",$InferServerPlugin:{},getActions:(t,r,n)=>({$Infer:{ActiveOrganization:{},Organization:{},Invitation:{},Member:{},Team:{}},organization:{checkRolePermission:t=>(e=>((e,t)=>{if(!e.permissions&&!e.permission)return!1;let r=e.role.split(","),n=e.options.creatorRole||"owner",o=r.includes(n),i=e.allowCreatorAllPermissions||!1;if(o&&i)return!0;for(let n of r)if(t[n]?.authorize(e.permissions??e.permission)?.success)return!0;return!1})(e,e.options.roles||l.Hc))({role:t.role,options:{ac:e?.ac,roles:i},permissions:t.permissions??t.permission})}}),getAtoms:e=>{let i=(0,a.A)(t,"/organization/list",e,{method:"GET"});return{$listOrg:t,$activeOrgSignal:r,$activeMemberSignal:n,$activeMemberRoleSignal:o,activeOrganization:(0,a.A)([r],"/organization/get-full-organization",e,()=>({method:"GET"})),listOrganizations:i,activeMember:(0,a.A)([n],"/organization/get-active-member",e,{method:"GET"}),activeMemberRole:(0,a.A)([o],"/organization/get-active-member-role",e,{method:"GET"})}},pathMethods:{"/organization/get-full-organization":"GET","/organization/list-user-teams":"GET"},atomListeners:[{matcher:e=>"/organization/create"===e||"/organization/delete"===e||"/organization/update"===e,signal:"$listOrg"},{matcher:e=>e.startsWith("/organization"),signal:"$activeOrgSignal"},{matcher:e=>e.startsWith("/organization/set-active"),signal:"$sessionSignal"},{matcher:e=>e.includes("/organization/update-member-role"),signal:"$activeMemberSignal"},{matcher:e=>e.includes("/organization/update-member-role"),signal:"$activeMemberRoleSignal"}]}},d=e=>({})},7528:(e,t,r)=>{r.d(t,{A:()=>s});var n=r(63709),o=r(67334);let i=()=>"undefined"==typeof window,s=(e,t,r,s)=>{let a=(0,n.eU)({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>l(e)}),l=async e=>new Promise(n=>{let o="function"==typeof s?s({data:a.get().data,error:a.get().error,isPending:a.get().isPending}):s;r(t,{...o,query:{...o?.query,...e?.query},async onSuccess(e){a.set({data:e.data,error:null,isPending:!1,isRefetching:!1,refetch:a.value.refetch}),await o?.onSuccess?.(e)},async onError(e){let{request:t}=e,r="number"==typeof t.retry?t.retry:t.retry?.attempts,n=t.retryAttempt||0;r&&n<r||(a.set({error:e.error,data:null,isPending:!1,isRefetching:!1,refetch:a.value.refetch}),await o?.onError?.(e))},async onRequest(e){let t=a.get();a.set({isPending:null===t.data,data:t.data,error:null,isRefetching:!0,refetch:a.value.refetch}),await o?.onRequest?.(e)}}).catch(e=>{a.set({error:e,data:null,isPending:!1,isRefetching:!1,refetch:a.value.refetch})}).finally(()=>{n(void 0)})});e=Array.isArray(e)?e:[e];let u=!1;for(let t of e)t.subscribe(async()=>{i()||(u?await l():(0,o.Rc)(a,()=>{let e=setTimeout(async()=>{u||(await l(),u=!0)},0);return()=>{a.off(),t.off(),clearTimeout(e)}}))});return a}},10214:(e,t,r)=>{r.d(t,{x:()=>i});let n=Symbol.for("better-auth:focus-manager");var o=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}
1setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if("undefined"==typeof window||"undefined"==typeof document||void 0===window.addEventListener)return()=>{};let e=()=>{"visible"===document.visibilityState&&this.setFocused(!0)};return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e,!1)}}};function i(){return globalThis[n]||(globalThis[n]=new o),globalThis[n]}},13269:(e,t,r)=>{r.d(t,{_K:()=>s,lh:()=>a});var n=r(37811);let o=Object.create(null),i=e=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?o:globalThis),s=new Proxy(o,{get:(e,t)=>i()[t]??o[t],has:(e,t)=>t in i()||t in o,set:(e,t,r)=>(i(!0)[t]=r,!0),deleteProperty(e,t){if(!t)return!1;let r=i(!0);return delete r[t],!0},ownKeys:()=>Object.keys(i(!0))});function a(e,t){return void 0!==n&&n.env?n.env[e]??t:"undefined"!=typeof Deno?Deno.env.get(e)??t:"undefined"!=typeof Bun?Bun.env[e]??t:t}void 0!==n&&n.env,Object.freeze({get BETTER_AUTH_SECRET(){return a("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return a("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return a("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return a("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return a("NODE_ENV","development")},get PACKAGE_VERSION(){return a("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return a("BETTER_AUTH_TELEMETRY_ENDPOINT","https://telemetry.better-auth.com/v1/track")}})},13470:(e,t,r)=>{r.d(t,{M:()=>s});var n=r(86456),o=r(96040),i=r(14375);function s(e){var t;let{pluginPathMethods:r,pluginsActions:s,pluginsAtoms:a,$fetch:l,$store:u,atomListeners:c}=(0,n.i)(e),d={};for(let[e,t]of Object.entries(a))d[`use${(0,i.Zr)(e)}`]=()=>(function(e,t={}){let r=(0,o.useRef)(e.get()),{keys:n,deps:i=[e,n]}=t,s=(0,o.useCallback)(t=>{let o=e=>{r.current!==e&&(r.current=e,t())};if(o(e.value),n?.length){let t;return t=new Set(n).add(void 0),e.listen((e,r,n)=>{t.has(n)&&o(e,r,n)})}return e.listen(o)},i),a=()=>r.current;return(0,o.useSyncExternalStore)(s,a,a)})(t);return t={...s,...d,$fetch:l,$store:u},function e(n=[]){return new Proxy(function(){},{get(r,o){var i;if("string"!=typeof o||"then"===o||"catch"===o||"finally"===o)return;let s=[...n,o],a=t;for(let e of s)if(a&&"object"==typeof a&&e in a)a=a[e];else{a=void 0;break}return"function"==typeof a?a:"object"==typeof(i=a)&&null!==i&&"get"in i&&"function"==typeof i.get&&"lc"in i&&"number"==typeof i.lc?a:e(s)},apply:async(e,t,o)=>{let i="/"+n.map(e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)).join("/"),s=o[0]||{},u=o[1]||{},{query:d,fetchOptions:f,...p}=s,h={...u,...f},v=function(e,t,r){let n=t[e],{fetchOptions:o,query:i,...s}=r||{};return n||(o?.method?o.method:s&&Object.keys(s).length>0?"POST":"GET")}(i,r,s);return await l(i,{...h,body:"GET"===v?void 0:{...p,...h?.body||{}},query:d||h?.query,method:v,async onSuccess(e){if(await h?.onSuccess?.(e),!c||h.disableSignal)return;let t=c.filter(e=>e.matcher(i));if(!t.length)return;let r=new Set;for(let e of t){let t=a[e.signal];if(!t)return;if(r.has(e.signal))continue;r.add(e.signal);let n=t.get();setTimeout(()=>{t.set(!n)},10)}}})}})}()}},14375:(e,t,r)=>{function n(e){return e.charAt(0).toUpperCase()+e.slice(1)}r.d(t,{Zr:()=>n}),r(89477),r(35717)},15042:(e,t,r)=>{r.d(t,{X:()=>a});var n=r(61927),o=r(10214),i=r(67917);let s=()=>Math.floor(Date.now()/1e3);function a(e){let{sessionAtom:t,sessionSignal:r,$fetch:a,options:l={}}=e,u=l.sessionOptions?.refetchInterval??0,c=l.sessionOptions?.refetchOnWindowFocus??!0,d=l.sessionOptions?.refetchWhenOffline??!1,f={lastSync:0,lastSessionRequest:0,cachedSession:void 0},p=e=>{if(!(d||(0,i.Y)().isOnline))return;if(e?.event==="storage"){f.lastSync=s(),r.set(!r.get());return}let n=t.get();if(e?.event==="poll"){f.lastSessionRequest=s(),a("/get-session").then(e=>{e.error?t.set({...n,data:null,error:e.error}):t.set({...n,data:e.data,error:null}),f.lastSync=s(),r.set(!r.get())}).catch(()=>{});return}if(e?.event==="visibilitychange"){if(s()-f.lastSessionRequest<5)return;f.lastSessionRequest=s()}(n?.data===null||n?.data===void 0||e?.event==="visibilitychange")&&(f.lastSync=s(),r.set(!r.get()))};return{init:()=>{u&&u>0&&(f.pollInterval=setInterval(()=>{t.get()?.data&&p({event:"poll"})},1e3*u)),f.unsubscribeBroadcast=(0,n.i)().subscribe(()=>{p({event:"storage"})}),c&&(f.unsubscribeFocus=(0,o.x)().subscribe(()=>{p({event:"visibilitychange"})})),f.unsubscribeOnline=(0,i.Y)().subscribe(e=>{e&&p({event:"visibilitychange"})}),(0,n.i)().setup(),(0,o.x)().setup(),(0,i.Y)().setup()},cleanup:()=>{f.pollInterval&&(clearInterval(f.pollInterval),f.pollInterval=void 0),f.unsubscribeBroadcast&&(f.unsubscribeBroadcast(),f.unsubscribeBroadcast=void 0),f.unsubscribeFocus&&(f.unsubscribeFocus(),f.unsubscribeFocus=void 0),f.unsubscribeOnline&&(f.unsubscribeOnline(),f.unsubscribeOnline=void 0),f.lastSync=0,f.lastSessionRequest=0,f.cac
1hedSession=void 0},triggerRefetch:p,broadcastSessionUpdate:e=>{(0,n.i)().post({event:"session",data:{trigger:e},clientId:Math.random().toString(36).substring(7)})}}}},16840:(e,t,r)=>{r.d(t,{$:()=>n}),r(14375);var n=class extends Error{constructor(e,t){super(e,t),this.name="BetterAuthError",this.message=e,this.stack=""}}},34872:(e,t,r)=>{r.d(t,{a:()=>n.a});var n=r(89368)},35717:(e,t,r)=>{r.d(t,{_K:()=>n._K});var n=r(13269);r(76512),r(89477)},52328:(e,t,r)=>{r.d(t,{KW:()=>n.KW,MH:()=>n.MH,U1:()=>n.U1,vC:()=>n.vC});var n=r(86035)},61927:(e,t,r)=>{r.d(t,{i:()=>i});let n=Symbol.for("better-auth:broadcast-channel");var o=class{listeners=new Set;name;constructor(e="better-auth.message"){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if("undefined"!=typeof window)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:Math.floor(Date.now()/1e3)}))}catch{}}setup(){if("undefined"==typeof window||void 0===window.addEventListener)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??"{}");t?.event==="session"&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}};function i(e="better-auth.message"){return globalThis[n]||(globalThis[n]=new o(e)),globalThis[n]}},63709:(e,t,r)=>{r.d(t,{eU:()=>s});let n=[],o=0,i=0,s=e=>{let t=[],r={get:()=>(r.lc||r.listen(()=>{})(),r.value),lc:0,listen:e=>(r.lc=t.push(e),()=>{for(let t=o+4;t<n.length;)n[t]===e?n.splice(t,4):t+=4;let i=t.indexOf(e);~i&&(t.splice(i,1),--r.lc||r.off())}),notify(e,s){i++;let a=!n.length;for(let o of t)n.push(o,r.value,e,s);if(a){for(o=0;o<n.length;o+=4)n[o](n[o+1],n[o+2],n[o+3]);n.length=0}},off(){},set(e){let t=r.value;t!==e&&(r.value=e,r.notify(t))},subscribe(e){let t=r.listen(e);return e(r.value),t},value:e};return r}},67334:(e,t,r)=>{r.d(t,{Rc:()=>n});let n=(e,t)=>((e,t,r,n)=>(e.events=e.events||{},e.events[15]||(e.events[15]=n(t=>{e.events[r].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[r]=e.events[r]||[],e.events[r].push(t),()=>{let n=e.events[r],o=n.indexOf(t);n.splice(o,1),n.length||(delete e.events[r],e.events[r+10](),delete e.events[r+10])}))(e,r=>{let n=t(r);n&&e.events[6].push(n)},5,t=>{let r=e.listen;e.listen=(...n)=>(e.lc||e.active||(e.active=!0,t()),r(...n));let n=e.off;return e.events[6]=[],e.off=()=>{n(),setTimeout(()=>{if(e.active&&!e.lc){for(let t of(e.active=!1,e.events[6]))t();e.events[6]=[]}},1e3)},()=>{e.listen=r,e.off=n}})},67917:(e,t,r)=>{r.d(t,{Y:()=>i});let n=Symbol.for("better-auth:online-manager");var o=class{listeners=new Set;isOnline="undefined"==typeof navigator||navigator.onLine;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if("undefined"==typeof window||void 0===window.addEventListener)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",e,!1),window.removeEventListener("offline",t,!1)}}};function i(){return globalThis[n]||(globalThis[n]=new o),globalThis[n]}},76512:(e,t,r)=>{r.d(t,{t:()=>a});var n=r(13269);let o={eterm:4,cons25:4,console:4,cygwin:4,dtterm:4,gnome:4,hurd:4,jfbterm:4,konsole:4,kterm:4,mlterm:4,mosh:24,putty:4,st:4,"rxvt-unicode-24bit":24,terminator:24,"xterm-kitty":24},i=new Map(Object.entries({APPVEYOR:8,BUILDKITE:8,CIRCLECI:24,DRONE:8,GITEA_ACTIONS:24,GITHUB_ACTIONS:24,GITLAB_CI:8,TRAVIS:8})),s=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function a(){if(void 0!==(0,n.lh)("FORCE_COLOR"))switch((0,n.lh)("FORCE_COLOR")){case"":case"1":case"true":return 4;case"2":return 8;case"3":return 24;default:return 1}if(void 0!==(0,n.lh)("NODE_DISABLE_COLORS")&&""!==(0,n.lh)("NODE_DISABLE_COLORS")||void 0!==(0,n.lh)("NO_COLOR")&&""!==(0,n.lh)("NO_COLOR")||"dumb"===(0,n.lh)("TERM"))return 1;if((0,n.lh)("TMUX"))return 24;if("TF_BUILD"in n._K&&"AGENT_NAME"in n._K)return 4;if("CI"in n._K){for(let{0:e,1:t}of i)if(e in n._K)return t;return"codeship"===(0,n.lh)("CI_NAME")?8:1}if("TEAMCITY_VERSION"in n._K)return null!==/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec((0,n.lh)("TEAMCITY_VERSION"))?4:1;switch((0,n.lh)("TERM_PROGRAM")){case"iTerm.app":if(!(0,n.lh)("TERM_PROGRAM_VERSION")||null!==/^[0-2]\./.exec((0,n.lh)("TERM_PROGRAM_VERSION")))return 8;return 24;case"HyperTerm":case"MacTerm":return 24;case"Apple_Terminal":return 8}if("truecolor"===(0,n.lh)("COLORTERM")||"24bit"===(0,n.lh)("COLORTERM"))return 24;if((0,n.lh)("TERM")){if(null!==/truecolor/.exec((0,n.lh)("TERM")))return 24;if(null!==/^xterm-256/.exec((0,n.lh)("TERM")))return 8;let e=(0,n.lh)("TERM").toLowerCase();if(o[e])return o[e];if(s.some(t=>null!==t.exec(e)))return 4}return(0,n.lh)("COLORTERM")?4:1}},86035:(e,t,r)=>{r.d(t,{Hc:()=>u,KW:()=>o,MH:()=>s,U1:()=>a,vC:()=>l});var n=r(89368);r(34872);let o={organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}
1,i=(0,n.a)(o),s=i.newRole({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),a=i.newRole({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),l=i.newRole({organization:[],member:[],invitation:[],team:[],ac:["read"]}),u={admin:s,owner:a,member:l}},86456:(e,t,r)=>{r.d(t,{i:()=>q});var n=r(35717),o=r(16840);function i(e,t="/api/auth"){try{let t=new URL(e);if("http:"!==t.protocol&&"https:"!==t.protocol)throw new o.$(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){if(t instanceof o.$)throw t;throw new o.$(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}if(function(e){try{return"/"!==(new URL(e).pathname.replace(/\/+$/,"")||"/")}catch{throw new o.$(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}(e))return e;let r=e.replace(/\/+$/,"");return t&&"/"!==t?(t=t.startsWith("/")?t:`/${t}`,`${r}${t}`):r}let s={id:"redirect",name:"Redirect",hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&"undefined"!=typeof window&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},a={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},l=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,u={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},c=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;var d=r(7528),f=r(15042),p=r(63709),h=r(67334);function v(e){if(null===e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.iterator in e)&&(!(Symbol.toStringTag in e)||"[object Module]"===Object.prototype.toString.call(e))}function g(e){return(...t)=>t.reduce((t,r)=>(function e(t,r,n=".",o){if(!v(r))return e(t,{},n,o);let i=Object.assign({},r);for(let r in t){if("__proto__"===r||"constructor"===r)continue;let s=t[r];null!=s&&(o&&o(i,r,s,n)||(Array.isArray(s)&&Array.isArray(i[r])?i[r]=[...s,...i[r]]:v(s)&&v(i[r])?i[r]=e(s,i[r],(n?`${n}.`:"")+r.toString(),o):i[r]=s))}return i})(t,r,"",e),{})}let m=g();g((e,t,r)=>{if(void 0!==e[t]&&"function"==typeof r)return e[t]=r(e[t]),!0}),g((e,t,r)=>{if(Array.isArray(e[t])&&"function"==typeof r)return e[t]=r(e[t]),!0});var y=Object.defineProperty,b=Object.defineProperties,w=Object.getOwnPropertyDescriptors,T=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,O=(e,t,r)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,S=(e,t)=>{for(var r in t||(t={}))R.call(t,r)&&O(e,r,t[r]);if(T)for(var r of T(t))E.call(t,r)&&O(e,r,t[r]);return e},_=(e,t)=>b(e,w(t)),A=class extends Error{constructor(e,t,r){super(t||e.toString(),{cause:r}),this.status=e,this.statusText=t,this.error=r,Error.captureStackTrace(this,this.constructor)}},U=async(e,t)=>{var r,n,o,i,s,a;let l=t||{},u={onRequest:[null==t?void 0:t.onRequest],onResponse:[null==t?void 0:t.onResponse],onSuccess:[null==t?void 0:t.onSuccess],onError:[null==t?void 0:t.onError],onRetry:[null==t?void 0:t.onRetry]};if(!t||!(null==t?void 0:t.plugins))return{url:e,options:l,hooks:u};for(let c of(null==t?void 0:t.plugins)||[]){if(c.init){let n=await (null==(r=c.init)?void 0:r.call(c,e.toString(),t));l=n.options||l,e=n.url}u.onRequest.push(null==(n=c.hooks)?void 0:n.onRequest),u.onResponse.push(null==(o=c.hooks)?void 0:o.onResponse),u.onSuccess.push(null==(i=c.hooks)?void 0:i.onSuccess),u.onError.push(null==(s=c.hooks)?void 0:s.onError),u.onRetry.push(null==(a=c.hooks)?void 0:a.onRetry)}return{url:e,options:l,hooks:u}},L=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},I=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}},x=async e=>{let t={},r=async e=>"function"==typeof e?await e():e;
1if(null==e?void 0:e.auth){if("Bearer"===e.auth.type){let n=await r(e.auth.token);if(!n)return t;t.authorization=`Bearer ${n}`}else if("Basic"===e.auth.type){let[n,o]=await Promise.all([r(e.auth.username),r(e.auth.password)]);if(!n||!o)return t;t.authorization=`Basic ${btoa(`${n}:${o}`)}`}else if("Custom"===e.auth.type){let[n,o]=await Promise.all([r(e.auth.prefix),r(e.auth.value)]);if(!o)return t;t.authorization=`${null!=n?n:""} ${o}`}}return t},P=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function $(e){if(void 0===e)return!1;let t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===t||"object"===t&&(!!Array.isArray(e)||!e.buffer&&(e.constructor&&"Object"===e.constructor.name||"function"==typeof e.toJSON))}function C(e){try{return JSON.parse(e)}catch(t){return e}}function j(e){return"function"==typeof e}async function M(e){let t=new Headers(null==e?void 0:e.headers);for(let[r,n]of Object.entries(await x(e)||{}))t.set(r,n);if(!t.has("content-type")){let r=$(null==e?void 0:e.body)?"application/json":null;r&&t.set("content-type",r)}return t}var N=class e extends Error{constructor(t,r){super(r||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function k(e,t){let r=await e["~standard"].validate(t);if(r.issues)throw new N(r.issues);return r.value}var B=["get","post","put","patch","delete"],D=async(e,t)=>{var r,n,o,i,s,a,l,u;let{hooks:c,url:d,options:f}=await U(e,t),p=function(e){if(null==e?void 0:e.customFetchImpl)return e.customFetchImpl;if("undefined"!=typeof globalThis&&j(globalThis.fetch))return globalThis.fetch;if("undefined"!=typeof window&&j(window.fetch))return window.fetch;throw Error("No fetch implementation found")}(f),h=new AbortController,v=null!=(r=f.signal)?r:h.signal,g=function(e,t){let{baseURL:r,params:n,query:o}=t||{query:{},params:{},baseURL:""},i=e.startsWith("http")?e.split("/").slice(0,3).join("/"):r||"";if(e.startsWith("@")){let t=e.toString().split("@")[1].split("/")[0];B.includes(t)&&(e=e.replace(`@${t}/`,"/"))}i.endsWith("/")||(i+="/");let[s,a]=e.replace(i,"").split("?"),l=new URLSearchParams(a);for(let[e,t]of Object.entries(o||{})){let r;if(null!=t){if("string"==typeof t)r=t;else if(Array.isArray(t)){for(let r of t)l.append(e,r);continue}else r=JSON.stringify(t);l.set(e,r)}}if(n)if(Array.isArray(n))for(let[e,t]of s.split("/").filter(e=>e.startsWith(":")).entries()){let r=n[e];s=s.replace(t,r)}else for(let[e,t]of Object.entries(n))s=s.replace(`:${e}`,String(t));(s=s.split("/").map(encodeURIComponent).join("/")).startsWith("/")&&(s=s.slice(1));let u=l.toString();return(u=u.length>0?`?${u}`.replace(/\+/g,"%20"):"",i.startsWith("http"))?new URL(`${s}${u}`,i):`${i}${s}${u}`}(d,f),m=function(e){if(!(null==e?void 0:e.body))return null;let t=new Headers(null==e?void 0:e.headers);if($(e.body)&&!t.has("content-type")){for(let[t,r]of Object.entries(null==e?void 0:e.body))r instanceof Date&&(e.body[t]=r.toISOString());return JSON.stringify(e.body)}return t.has("content-type")&&"application/x-www-form-urlencoded"===t.get("content-type")&&$(e.body)?new URLSearchParams(e.body).toString():e.body}(f),y=await M(f),b=function(e,t){var r;if(null==t?void 0:t.method)return t.method.toUpperCase();if(e.startsWith("@")){let n=null==(r=e.split("@")[1])?void 0:r.split("/")[0];return B.includes(n)?n.toUpperCase():(null==t?void 0:t.body)?"POST":"GET"}return(null==t?void 0:t.body)?"POST":"GET"}(d,f),w=_(S({},f),{url:g,headers:y,body:m,method:b,signal:v});for(let e of c.onRequest)if(e){let t=await e(w);"object"==typeof t&&null!==t&&(w=t)}("pipeTo"in w&&"function"==typeof w.pipeTo||"function"==typeof(null==(n=null==t?void 0:t.body)?void 0:n.pipe))&&!("duplex"in w)&&(w.duplex="half");let{clearTimeout:T}=function(e,t){let r;return!(null==e?void 0:e.signal)&&(null==e?void 0:e.timeout)&&(r=setTimeout(()=>null==t?void 0:t.abort(),null==e?void 0:e.timeout)),{abortTimeout:r,clearTimeout:()=>{r&&clearTimeout(r)}}}(f,h),R=await p(w.url,w);T();let E={response:R,request:w};for(let e of c.onResponse)if(e){let r=await e(_(S({},E),{response:(null==(o=null==t?void 0:t.hookOptions)?void 0:o.cloneResponse)?R.clone():R}));r instanceof Response?R=r:"object"==typeof r&&null!==r&&(R=r.response)}if(R.ok){if("HEAD"===w.method)return{data:"",error:null};let e=function(e){let t=e.headers.get("content-type"),r=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!t)return"json";let n=t.split(";").shift()||"";return P.test(n)?"json":r.has(n)||n.startsWith("text/")?"text":"blob"}(R),r={data:null,response:R,request:w};if("json"===e||"text"===e){let e=await R.text(),t=null!=(i=w.jsonParser)?i:C;r.data=await t(e)}else r.data=await R[e]();for(let e of((null==w?void 0:w.output)&&w.output&&!w.disableValidation&&(r.data=await k(w.output,r.data)),c.onSuccess))e&&await e(_(S({},r),{response:(null==(s=null==t?void 0:t.hookOptions)?void 0:s.cloneResponse)?R.clone():R}));return(null==t?void 0:t.throw)?r.data:{data:r.data,error:null}}let O=null!=(a=null==t?void 0:t.jsonParser)?a:C,x=await R.text(),N=function(e){try{return JSON.parse(e),!0}catch(e){return!1}}
1(x),q=N?await O(x):null,z={response:R,responseText:x,request:w,error:_(S({},q),{status:R.status,statusText:R.statusText})};for(let e of c.onError)e&&await e(_(S({},z),{response:(null==(l=null==t?void 0:t.hookOptions)?void 0:l.cloneResponse)?R.clone():R}));if(null==t?void 0:t.retry){let r=function(e){if("number"==typeof e)return new L({type:"linear",attempts:e,delay:1e3});switch(e.type){case"linear":return new L(e);case"exponential":return new I(e);default:throw Error("Invalid retry strategy")}}(t.retry),n=null!=(u=t.retryAttempt)?u:0;if(await r.shouldAttemptRetry(n,R)){for(let e of c.onRetry)e&&await e(E);let o=r.getDelay(n);return await new Promise(e=>setTimeout(e,o)),await D(e,_(S({},t),{retryAttempt:n+1}))}}if(null==t?void 0:t.throw)throw new A(R.status,R.statusText,N?q:x);return{data:null,error:_(S({},q),{status:R.status,statusText:R.statusText})}};let q=(e,t)=>{let r="credentials"in Request.prototype,v=function(e,t,r,s,a){if(e)return i(e,t);if(!1!==s){let e=n._K.BETTER_AUTH_URL||n._K.NEXT_PUBLIC_BETTER_AUTH_URL||n._K.PUBLIC_BETTER_AUTH_URL||n._K.NUXT_PUBLIC_BETTER_AUTH_URL||n._K.NUXT_PUBLIC_AUTH_URL||("/"!==n._K.BASE_URL?n._K.BASE_URL:void 0);if(e)return i(e,t)}r?.headers.get("x-forwarded-host"),r?.headers.get("x-forwarded-proto");if(r){let e=function(e){try{let t=new URL(e);return"null"===t.origin?null:t.origin}catch{return null}}(r.url);if(!e)throw new o.$("Could not get origin from request. Please provide a valid base URL.");return i(e,t)}if("undefined"!=typeof window&&window.location)return i(window.location.origin,t)}(e?.baseURL,e?.basePath,void 0,t)??"/api/auth",g=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>void 0!==e)||[],y={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:b,onError:w,onRequest:T,onResponse:R,...E}=e?.fetchOptions||{},O=(e=>async function(t,r){let n,o=_(S(S({},e),r),{plugins:[...(null==e?void 0:e.plugins)||[],(n=e||{},{id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,t){var r,o,i,s;let a=(null==(o=null==(r=n.plugins)?void 0:r.find(t=>{var r;return null!=(r=t.schema)&&!!r.config&&(e.startsWith(t.schema.config.baseURL||"")||e.startsWith(t.schema.config.prefix||""))}))?void 0:o.schema)||n.schema;if(a){let r=e;(null==(i=a.config)?void 0:i.prefix)&&r.startsWith(a.config.prefix)&&(r=r.replace(a.config.prefix,""),a.config.baseURL&&(e=e.replace(a.config.prefix,a.config.baseURL))),(null==(s=a.config)?void 0:s.baseURL)&&r.startsWith(a.config.baseURL)&&(r=r.replace(a.config.baseURL,""));let n=a.schema[r];if(n){let r=_(S({},t),{method:n.method,output:n.output});return(null==t?void 0:t.disableValidation)||(r=_(S({},r),{body:n.input?await k(n.input,null==t?void 0:t.body):null==t?void 0:t.body,params:n.params?await k(n.params,null==t?void 0:t.params):null==t?void 0:t.params,query:n.query?await k(n.query,null==t?void 0:t.query):null==t?void 0:t.query})),{url:e,options:r}}}return{url:e,options:t}}}),...(null==r?void 0:r.plugins)||[]]});if(null==e?void 0:e.catchAllError)try{return await D(t,o)}catch(e){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:e}}}return await D(t,o)})({baseURL:v,...r?{credentials:"include"}:{},method:"GET",jsonParser:e=>e?function(e,t={strict:!0}){return function(e,t={}){let{strict:r=!1,warnings:n=!1,reviver:o,parseDates:i=!0}=t;if("string"!=typeof e)return e;let s=e.trim();if(s.length>0&&'"'===s[0]&&s.endsWith('"')&&!s.slice(1,-1).includes('"'))return s.slice(1,-1);let d=s.toLowerCase();if(d.length<=9&&d in u)return u[d];if(!l.test(s)){if(r)throw SyntaxError("[better-json] Invalid JSON");return e}if(Object.entries(a).some(([e,t])=>{let r=t.test(s);return r&&n&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),r})&&r)throw Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(s,(e,t)=>{if("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t){n&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(i&&"string"==typeof t){let e=function(e){let t=c.exec(e);if(!t)return null;let[,r,n,o,i,s,a,l,u,d,f]=t,p=new Date(Date.UTC(parseInt(r,10),parseInt(n,10)-1,parseInt(o,10),parseInt(i,10),parseInt(s,10),parseInt(a,10),l?parseInt(l.padEnd(3,"0"),10):0));if(u){let e=(60*parseInt(d,10)+parseInt(f,10))*("+"===u?-1:1);p.setUTCMinutes(p.getUTCMinutes()+e)}
1return p instanceof Date&&!isNaN(p.getTime())?p:null}(t);if(e)return e}return o?o(e,t):t})}catch(t){if(r)throw t;return e}}(e,t)}(e,{strict:!1}):null,customFetchImpl:fetch,...E,plugins:[y,...E.plugins||[],...e?.disableDefaultFetchPlugins?[]:[s],...g]}),{$sessionSignal:A,session:U}=function(e,t){let r=(0,p.eU)(!1),n=(0,d.A)(r,"/get-session",e,{method:"GET"});return(0,h.Rc)(n,()=>{let o=(0,f.X)({sessionAtom:n,sessionSignal:r,$fetch:e,options:t});return o.init(),()=>{o.cleanup()}}),{session:n,$sessionSignal:r}}(O,e),L=e?.plugins||[],I={},x={$sessionSignal:A,session:U},P={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},$=[{signal:"$sessionSignal",matcher:e=>"/sign-out"===e||"/update-user"===e||"/sign-up/email"===e||"/sign-in/email"===e||"/delete-user"===e||"/verify-email"===e||"/revoke-sessions"===e||"/revoke-session"===e||"/change-email"===e}];for(let e of L)e.getAtoms&&Object.assign(x,e.getAtoms?.(O)),e.pathMethods&&Object.assign(P,e.pathMethods),e.atomListeners&&$.push(...e.atomListeners);let C={notify:e=>{x[e].set(!x[e].get())},listen:(e,t)=>{x[e].subscribe(t)},atoms:x};for(let t of L)t.getActions&&(I=m(t.getActions?.(O,C,e)??{},I));return{get baseURL(){return v},pluginsActions:I,pluginsAtoms:x,pluginPathMethods:P,atomListeners:$,$fetch:O,$store:C}}},89368:(e,t,r)=>{r.d(t,{a:()=>o});var n=r(16840);function o(e){return{newRole:e=>{var t;return{authorize(e,r="AND"){let o=!1;for(let[i,s]of Object.entries(e)){let e=t[i];if(!e)return{success:!1,error:`You are not allowed to access resource: ${i}`};if(Array.isArray(s))o=s.every(t=>e.includes(t));else if("object"==typeof s)o="OR"===s.connector?s.actions.some(t=>e.includes(t)):s.actions.every(t=>e.includes(t));else throw new n.$("Invalid access control request");if(o&&"OR"===r)return{success:o};if(!o&&"AND"===r)return{success:!1,error:`unauthorized to access resource "${i}"`}}return o?{success:o}:{success:!1,error:"Not authorized"}},statements:t=e}},statements:e}}},89477:(e,t,r)=>{var n=r(76512);let o={reset:"\x1b[0m",bright:"\x1b[1m",dim:"\x1b[2m",fg:{black:"\x1b[30m",red:"\x1b[31m",green:"\x1b[32m",yellow:"\x1b[33m",blue:"\x1b[34m",magenta:"\x1b[35m",cyan:"\x1b[36m",white:"\x1b[37m"}},i=["debug","info","success","warn","error"],s={info:o.fg.blue,success:o.fg.green,warn:o.fg.yellow,error:o.fg.red,debug:o.fg.magenta};(e=>{let t=(void 0)??"error",r=e?.disableColors!==void 0?!e.disableColors:1!==(0,n.t)();return{...Object.fromEntries(i.map(n=>[n,(...[a,...l])=>((n,a,l=[])=>{if(!(i.indexOf(n)>=i.indexOf(t)))return;let u=((e,t,r)=>{let n=new Date().toISOString();return r?`${o.dim}${n}${o.reset} ${s[e]}${e.toUpperCase()}${o.reset} ${o.bright}[Better Auth]:${o.reset} ${t}`:`${n} ${e.toUpperCase()} [Better Auth]: ${t}`})(n,a,r);if(!e||"function"!=typeof e.log)return void("error"===n?console.error(u,...l):"warn"===n?console.warn(u,...l):console.log(u,...l));e.log("success"===n?"info":n,a,...l)})(n,a,l)])),get level(){return t}}})()}}]);
2//# chunkId=01a0fa55-3fbd-74e3-b459-047aa296a84e

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