PageSourceSearch

https://www.surreyi.gov.uk/_nuxt/DxaIYWt5.js

js surreyi.gov.uk collected 2026-10-02 07:20:37 UTC 8,499 bytes, 1 lines download raw bytes

1import{Pt as e,Rt as t,St as n,bt as r,dt as i,st as a,ut as o,vt as s,zt as c}from"./v5pQv3-G.js";import{Ht as l,L as u,_n as d,ct as f,g as p,tt as m}from"./BKdLzFmX.js";import{t as h}from"./CXB5hBqR.js";import"./BrH92DS3.js";import{t as g}from"./7FrsrHJy.js";import{t as _}from"./B55w1DUP.js";var v=/^\d+|-$/,y=/\//,b=/~1/g,x=/~0/g;function S(e,t){let n=e.public.auth.provider;if(n.type===t)return n;throw Error(`RuntimeError: Type must match at this point`)}function C(e,t){let n=Array.isArray(t)?t:E(t);for(let t=0;t<n.length;++t){let r=n[t];if(!(typeof e==`object`&&r in e))throw Error(`Invalid reference token: ${r}`);e=e[r]}return e}function w(e,t,n){let r=Array.isArray(t)?t:E(t),i=r[0];if(r.length===0)throw Error(`Can not set the root object`);for(let t=0;t<r.length-1;++t){let n=r[t];typeof n!=`string`&&typeof n!=`number`&&(n=String(n)),!(n===`__proto__`||n===`constructor`||n===`prototype`)&&(n===`-`&&Array.isArray(e)&&(n=e.length),i=r[t+1],n in e||(v.test(i)?e[n]=[]:e[n]={}),e=e[n])}i===`-`&&Array.isArray(e)&&(i=e.length),e[i]=n}function T(e,t){let n={};return w(n,e,t),n}function E(e){if(e===``||e===`/`)return[];if(e.charAt(0)!==`/`)throw Error(`Invalid JSON pointer: ${e}`);return e.substring(1).split(y).map(e=>e.replace(b,`/`).replace(x,`~`))}function D(e,t){return k(e)?e:s(O(t),e)}function O(e,t){let i=e.public.auth;t===void 0&&(t=!e.public.auth.disableInternalRouting);let a=i.baseURL;return t&&(a=n(r(a).pathname)),a}function k(e){return e.startsWith(`http://`)||e.startsWith(`https://`)}var A=`[@sidebase/nuxt-auth]`;async function j(t,n,r={},i=!1){let a=e(t,c),o=`public`in a?a:await a,s=D(n,o);if(o.public.auth.disableInternalRouting===!1&&(t.ssrContext?.event?.path)?.startsWith(s))throw console.error(`${A} Recursion detected at ${s}. Have you set the correct \`auth.baseURL\`?`),new M(`Server configuration error`);r.credentials||=`include`;try{return $fetch.raw(s,r).then(e=>e._data)}catch(e){let t=`${A} Error while requesting ${s}.`;throw o.public.auth.provider.type===`authjs`&&(t+=" Have you added the authentication handler server-endpoint `[...].ts`? Have you added the authentication handler in a non-default location (default is `~/server/api/auth/[...].ts`) and not updated the module-setting `auth.basePath`?"),t+=` Error is:`,console.error(t),console.error(e),new M(`Runtime error, check the console logs to debug, open an issue at https://github.com/sidebase/nuxt-auth/issues/new/choose if you continue to have this problem`)}}var M=class extends Error{};function N(e,t=!0){let n=t&&e.headers?e.headers[`x-forwarded-proto`]:void 0,r=typeof n==`string`?n.includes(`https`):void 0;if(r)return!0;let i=e.connection?e.connection.encrypted:void 0,a=i===void 0?void 0:i===!0;if(a)return!0;if(!(r===void 0&&a===void 0))return!1}var P=N,F=typeof location<`u`?location:{origin:``,pathname:`/`};function I(e,t){return e?encodeURI(`http`+(P(e)?`s`:``)+`://`+(e.headers[`x-forwarded-host`]||e.headers.host)+(t?e.url:``)):F.origin+(t?F.pathname:``)}function L(e=!0){return I(_()?.node.req,e)}function R(t){return e(t,L)}async function z(e,n,r){if(n)return await V(n);let i=typeof e.globalAppMiddleware==`object`?e.globalAppMiddleware.addDefaultCallbackUrl:void 0;if(typeof i==`string`)return await V(i);if(r!==!1&&(r===!0||i===!0||i===void 0&&e.globalAppMiddleware===!0))return R(t())}function B(e,t){let n=typeof e.globalAppMiddleware==`object`?e.globalAppMiddleware.addDefaultCallbackUrl:void 0;if(typeof n==`string`)return n;if(n===!0||n===void 0&&e.globalAppMiddleware===!0)return t.fullPath}async function V(n){return k(n)?n:(await e(t(),i)).options.history.createHref(n)}function H(e,t){return e==null?null:t.token.type.length>0?`${t.token.type} ${e}`:e}function U(){let e=h(`auth:data`,()=>void 0),t=p(()=>!!e.value),n=h(`auth:lastRefreshedAt`,()=>{if(t.value)return new Date}),r=h(`auth:loading`,()=>!1);return{data:e,loading:r,lastRefreshedAt:n,status:p(()=>r.value?`loading`:e.value?`authenticated`:`unauthenticated`)}}function W(){let e=S(c(),`local`),t=U(),n=u(),r=g(e.token.cookieName,{default:()=>null,domain:e.token.cookieDomain,maxAge:e.token.maxAgeInSeconds,sameSite:e.token.sameSiteAttribute,secure:e.token.secureCookieAttribute,httpOnly:e.token.httpOnlyCookieAttribute}),i=h(`auth:raw-token`,()=>r.value);l(i,()=>{r.value=i.value});let a=p(()=>H(i.value,e));function o(e){i.value=e}function s(){o(null)}n&&f(()=>{r.value&&!i.value&&o(r.value)});let d=h(`auth:raw-refresh-token`,()=>null);if(e.refresh.isEnabled){let t=g(e.refresh.token.cookieName,{default:()=>null,domain:e.refresh.token.cookieDomain,maxAge:e.refresh.token.maxAgeInSeconds,sameSite:e.refresh.token.sameSiteAttribute,secure:e.refresh.token.secureCookieAttribute,httpOnly:e.refresh.token.httpOnlyCookieAttribute});d.value===null&&(d.value=t.value),l(d,()=>{t.value=d.value}),n&&f(()=>{t.value&&!d.value&&(d.value=t.value)})}let m=p(()=>d.value);return{...t,token:a,rawToken:i,refreshToken:m,rawRefreshToken:d,setToken:o,clearToken:s,_internal:{rawTokenCookie:r}}}function G(){let e=t(),n=c(),r=S(n,`local`),{data:i,status:s,lastRefreshedAt:l,loading:u,token:f,refreshToken:p,rawToken:h,rawRefreshToken:g,_internal:_}=W();async function v(t,i,s,c){let{path:l,method:u}=r.endpoints.signIn,d=await j(e,l,{method:u,body:t,params:s??{},headers:c??{}},!0);if(typeof d!=`object`||!d){console.error(`${A} signIn returned non-object value`);return}let f=C(d,r.token.signInResponseTokenPointer);if(typeof f!=`string`){console.error(`${A} string token expected, received instead: ${JSON.stringify(f)}. Tried to find token at ${r.token.signInResponseTokenPointer} in ${JSON.stringify(d)}`);return}if(h.value=f,r.refresh.isEnabled){let e=r.refresh.token.signInResponseRefreshTokenPointer,t=C(d,e);if(typeof t!=`string`){console.error(`${A} string token expected, received instead: ${JSON.stringify(t)}. Tried to find refresh token at ${e} in ${JSON.stringify(d)}`);return}g.value=t}let{redirect:p=!0,external:_,callGetSession:v=!0}=i??{};if(v&&await m(b),p){let e=i?.callbackUrl;
1if(e===void 0){let t=o()?.query?.redirect;e=await z(n.public.auth,t?.toString())}await a(e,{external:_});return}return d}async function y(t){let s=r.endpoints.signOut,c,l;if(s&&(c=new Headers({[r.token.headerName]:f.value}),r.refresh.isEnabled&&[`post`,`put`,`patch`,`delete`].includes(s.method.toLowerCase()))){let e=r.refresh.token.refreshRequestTokenPointer;l=T(e,p.value)}i.value=null,h.value=null,g.value=null;let u;if(s){let{path:t,method:n}=s;u=await j(e,t,{method:n,headers:c,body:l})}let{redirect:d=!0,external:m}=t??{};if(d){let e=t?.callbackUrl;if(e===void 0){let t=o()?.query?.redirect;e=await z(n.public.auth,t?.toString(),!0)}await a(e,{external:m})}return u}async function b(t){let{path:n,method:o}=r.endpoints.getSession,s=f.value;if(s??=H(_.rawTokenCookie.value,r),!s&&!t?.force){u.value=!1;return}let c=new Headers;s&&c.append(r.token.headerName,s),u.value=!0;try{let t=await j(e,n,{method:o,headers:c},!0),{dataResponsePointer:a}=r.session;i.value=C(t,a)}catch(e){!i.value&&e instanceof Error&&console.error(`Session: unable to extract session, ${e.message}`),i.value=null,h.value=null}u.value=!1,l.value=new Date;let{required:d=!1,callbackUrl:p,onUnauthenticated:m,external:g}=t??{};if(d&&i.value===null){if(m)return m();await a(p??await R(e),{external:g})}return i.value}async function x(t,n){let i=r.endpoints.signUp;if(!i){console.warn(`${A} provider.endpoints.signUp is disabled.`);return}let{path:a,method:o}=i,s=await j(e,a,{method:o,body:t});return n?.preventLoginFlow?s:v(t,n)}async function w(t){if(!r.refresh.isEnabled)return b(t);let{path:n,method:i}=r.refresh.endpoint,a=r.refresh.token.refreshRequestTokenPointer,o=new Headers({[r.token.headerName]:f.value}),s=await j(e,n,{method:i,headers:o,body:T(a,p.value)}),c=r.refresh.token.refreshResponseTokenPointer||r.token.signInResponseTokenPointer,u=C(s,c);if(typeof u!=`string`){console.error(`Auth: string token expected, received instead: ${JSON.stringify(u)}. Tried to find token at ${c} in ${JSON.stringify(s)}`);return}if(!r.refresh.refreshOnlyToken){let e=r.refresh.token.signInResponseRefreshTokenPointer,t=C(s,e);if(typeof t!=`string`){console.error(`Auth: string token expected, received instead: ${JSON.stringify(t)}. Tried to find refresh token at ${e} in ${JSON.stringify(s)}`);return}g.value=t}return h.value=u,l.value=new Date,await m(),b(t)}return{status:s,data:d(i),lastRefreshedAt:d(l),token:d(f),refreshToken:d(p),getSession:b,signIn:v,signOut:y,signUp:x,refresh:w}}export{A as a,M as i,W as n,k as o,B as r,G as t};

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.