vendor: 4,774 bytes, line 1
1import{A as Ft,C as rs,D as ss,F as ns,G as q,L as J,N as is,O as os,P as as,Q as cs,R as Y,T as Ht,at as qe,ct as ee,gt as pt,ht as mt,it as Le,k as ls,l as us,n as fs,nt as Z,ot as Ye,pt as hs,r as Fe,t as A,x as ds,yt as ps}from"./client-C1uQcr27.js";var Ct=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function tr(){}function gt(e){return e==null||typeof e!="object"&&typeof e!="function"}function yt(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ms(e){if(gt(e))return e;if(Array.isArray(e)||yt(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);const r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){const s=new r(e);return s.lastIndex=e.lastIndex,s}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let s;return e instanceof AggregateError?s=new r(e.errors,e.message,{cause:e.cause}):s=new r(e.message,{cause:e.cause}),s.stack=e.stack,Object.assign(s,e),s}return typeof File<"u"&&e instanceof File?new r([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e=="object"?Object.assign(Object.create(t),e):e}function ke(e){return typeof Ct.Buffer<"u"&&Ct.Buffer.isBuffer(e)}function Ue(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Se(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var rr="[object RegExp]",wt="[object String]",Pt="[object Number]",vt="[object Boolean]",sr="[object Arguments]",nr="[object Symbol]",ir="[object Date]",or="[object Map]",ar="[object Set]",cr="[object Array]",gs="[object Function]",lr="[object ArrayBuffer]",He="[object Object]",ys="[object Error]",ur="[object DataView]",fr="[object Uint8Array]",hr="[object Uint8ClampedArray]",dr="[object Uint16Array]",pr="[object Uint32Array]",ws="[object BigUint64Array]",mr="[object Int8Array]",gr="[object Int16Array]",yr="[object Int32Array]",Ps="[object BigInt64Array]",wr="[object Float32Array]",Pr="[object Float64Array]";function vs(e,t){return se(e,void 0,e,new Map,t)}function se(e,t,r,s=new Map,n=void 0){const a=n?.(e,t,r,s);if(a!==void 0)return a;if(gt(e))return e;if(s.has(e))return s.get(e);if(Array.isArray(e)){const i=new Array(e.length);s.set(e,i);for(let o=0;o<e.length;o++)i[o]=se(e[o],o,r,s,n);return Object.hasOwn(e,"index")&&(i.index=e.index),Object.hasOwn(e,"input")&&(i.input=e.input),i}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const i=new RegExp(e.source,e.flags);return i.lastIndex=e.lastIndex,i}if(e instanceof Map){const i=new Map;s.set(e,i);for(const[o,c]of e)i.set(o,se(c,o,r,s,n));return i}if(e instanceof Set){const i=new Set;s.set(e,i);for(const o of e)i.add(se(o,void 0,r,s,n));return i}if(ke(e))return e.subarray();if(yt(e)){const i=new(Object.getPrototypeOf(e)).constructor(e.length);s.set(e,i);for(let o=0;o<e.length;o++)i[o]=se(e[o],o,r,s,n);return i}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const i=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return s.set(e,i),V(i,e,r,s,n),i}if(typeof File<"u"&&e instanceof File){const i=new File([e],e.name,{type:e.type});return s.set(e,i),V(i,e,r,s,n),i}if(typeof Blob<"u"&&e instanceof Blob){const i=new Blob([e],{type:e.type});return s.set(e,i),V(i,e,r,s,n),i}if(e instanceof Error){const i=structuredClone(e);return s.set(e,i),i.message=e.message,i.name=e.name,i.stack=e.stack,i.cause=e.cause,i.constructor=e.constructor,V(i,e,r,s,n),i}if(e instanceof Boolean){const i=new Boolean(e.valueOf());return s.set(e,i),V(i,e,r,s,n),i}if(e instanceof Number){const i=new Number(e.valueOf());return s.set(e,i),V(i,e,r,s,n),i}if(e instanceof String){const i=new String(e.valueOf());return s.set(e,i),V(i,e,r,s,n),i}if(typeof e=="object"&&Ss(e)){const i=Object.create(Object.getPrototypeOf(e));return s.set(e,i),V(i,e,r,s,n),i}return e}function V(e,t,r=e,s,n){const a=[...Object.keys(t),...Ue(t)];for(let i=0;i<a.length;i++){const o=a[i],c=Object.getOwnPropertyDescriptor(e,o);(c==null||c.writable)&&(e[o]=se(t[o],o,r,s,n))}}function Ss(e){switch(Se(e)){case sr:case cr:case lr:case ur:case vt:case ir:case wr:case Pr:case mr:case gr:case yr:case or:case Pt:case He:case rr:case ar:case wt:case nr:case fr:case hr:case dr:case pr:return!0;default:return!1}}function X(e){return se(e,void 0,e,new Map,void 0)}function jt(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);
1return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}function be(e){return e==="__proto__"}function Ze(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const r=e[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function vr(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function bs(e,t,r){return we(e,t,void 0,void 0,void 0,void 0,r)}function we(e,t,r,s,n,a,i){const o=i(e,t,r,s,n,a);if(o!==void 0)return o;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return ve(e,t,a,i)}return ve(e,t,a,i)}function ve(e,t,r,s){if(Object.is(e,t))return!0;let n=Se(e),a=Se(t);if(n==="[object Arguments]"&&(n=He),a==="[object Arguments]"&&(a=He),n!==a)return!1;switch(n){case wt:return e.toString()===t.toString();case Pt:return vr(e.valueOf(),t.valueOf());case vt:case ir:case nr:return Object.is(e.valueOf(),t.valueOf());case rr:return e.source===t.source&&e.flags===t.flags;case gs:return e===t}r=r??new Map;const i=r.get(e),o=r.get(t);if(i!=null&&o!=null)return i===t;r.set(e,t),r.set(t,e);try{switch(n){case or:if(e.size!==t.size)return!1;for(const[c,h]of e.entries())if(!t.has(c)||!we(h,t.get(c),c,e,t,r,s))return!1;return!0;case ar:{if(e.size!==t.size)return!1;const c=Array.from(e.values()),h=Array.from(t.values());for(let f=0;f<c.length;f++){const l=c[f],p=h.findIndex(d=>we(l,d,void 0,e,t,r,s));if(p===-1)return!1;h.splice(p,1)}return!0}case cr:case fr:case hr:case dr:case pr:case ws:case mr:case gr:case yr:case Ps:case wr:case Pr:if(ke(e)!==ke(t)||e.length!==t.length)return!1;for(let c=0;c<e.length;c++)if(!we(e[c],t[c],c,e,t,r,s))return!1;return!0;case lr:return e.byteLength!==t.byteLength?!1:ve(new Uint8Array(e),new Uint8Array(t),r,s);case ur:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:ve(new Uint8Array(e),new Uint8Array(t),r,s);case ys:return e.name===t.name&&e.message===t.message;case He:{if(!(ve(e.constructor,t.constructor,r,s)||jt(e)&&jt(t)))return!1;const c=[...Object.keys(e),...Ue(e)],h=[...Object.keys(t),...Ue(t)];if(c.length!==h.length)return!1;for(let f=0;f<c.length;f++){const l=c[f],p=e[l];if(!Object.hasOwn(t,l))return!1;const d=t[l];if(!we(p,d,l,e,t,r,s))return!1}return!0}default:return!1}}finally{r.delete(e),r.delete(t)}}function ne(e,t){return bs(e,t,tr)}function Es(e){return Number.isSafeInteger(e)&&e>=0}function As(e){return e!=null&&typeof e!="function"&&Es(e.length)}function Sr(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(Sr).join(",");const t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}function St(e){return typeof e=="string"||typeof e=="symbol"?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}function bt(e){if(Array.isArray(e))return e.map(St);if(typeof e=="symbol")return[e];e=Sr(e);const t=[],r=e.length;if(r===0)return t;let s=0,n="",a="",i=!1;
1for(e.charCodeAt(0)===46&&t.push("");s<r;){const o=e[s];if(a)o==="\\"&&s+1<r?(s++,n+=e[s]):o===a?a="":n+=o;else if(i)o==='"'||o==="'"?a=o:o==="]"?(i=!1,t.push(n),n=""):n+=o;else if(o==="[")i=!0,n&&(t.push(n),n="");else if(o==="."){n&&(t.push(n),n="");const c=e[s+1];(c===void 0||c===".")&&t.push("")}else n+=o;s++}return n&&t.push(n),t}var Os=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function br(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e===""||e.startsWith(".")||e.endsWith(".")?!1:Os.test(e);default:return!1}}function T(e,t,r){if(e==null)return r;switch(typeof t){case"string":{if(be(t))return r;const s=e[t];return s===void 0?br(t)&&!Object.hasOwn(e,t)?T(e,bt(t),r):r:s}case"number":case"symbol":{typeof t=="number"&&(t=St(t));const s=e[t];return s===void 0?r:s}default:{if(Array.isArray(t))return qs(e,t,r);if(Object.is(t?.valueOf(),-0)?t="-0":t=String(t),be(t))return r;const s=e[t];return s===void 0?r:s}}}function qs(e,t,r){if(t.length===0)return r;let s=e;for(let n=0;n<t.length;n++){if(s==null||be(t[n]))return r;s=s[t[n]]}return s===void 0?r:s}function Tt(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function xs(e,t){return vs(e,(r,s,n,a)=>{const i=t?.(r,s,n,a);if(i!==void 0)return i;if(typeof e=="object"){if(Se(e)==="[object Object]"&&typeof e.constructor!="function"){const o={};return a.set(e,o),V(o,e,n,a),o}switch(Object.prototype.toString.call(e)){case Pt:case wt:case vt:{const o=new e.constructor(e?.valueOf());return V(o,e),o}case sr:{const o={};return V(o,e),o.length=e.length,o[Symbol.iterator]=e[Symbol.iterator],o}default:return}}})}function Dt(e){return xs(e)}function nt(e){return e!==null&&typeof e=="object"&&Se(e)==="[object Arguments]"}var Rs=/^(?:0|[1-9]\d*)$/;function Er(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<t;case"symbol":return!1;case"string":return Rs.test(e)}}function Is(e,t){let r;if(Array.isArray(t)?r=t:typeof t=="string"&&br(t)&&!(t in Object(e))?r=bt(t):r=[t],r.length===0)return!1;let s=e;for(let n=0;n<r.length;n++){const a=r[n];if((s==null||!Object.hasOwn(s,a))&&!((Array.isArray(s)||nt(s))&&Er(a)&&a<s.length))return!1;s=s[a]}return!0}function it(e){return typeof e=="object"&&e!==null}function Fs(e){return it(e)&&As(e)}function Hs(e){return typeof e=="symbol"||e instanceof Symbol}var Cs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,js=/^\w*$/;function Ts(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||Hs(e)?!0:typeof e=="string"&&(js.test(e)||!Cs.test(e))||t!=null&&Object.hasOwn(t,e)}function et(e){return yt(e)}var Ds=(e,t,r)=>{const s=e[t];(!(Object.hasOwn(e,t)&&vr(s,r))||r===void 0&&!(t in e))&&(e[t]=r)};function Ls(e,t,r,s){if(e==null&&!Tt(e))return e;let n;Ts(t,e)?n=[t]:Array.isArray(t)?n=t:n=bt(t);const a=r(T(e,n));let i=e;for(let o=0;o<n.length&&i!=null;o++){const c=St(n[o]);if(be(c))continue;let h;if(o===n.length-1)h=a;else{const f=i[c],l=s?.(f,c,e);h=l!==void 0?l:Tt(f)?f:Er(n[o+1])?[]:{}}Ds(i,c,h),i=i[c]}return e}function ie(e,t,r){return Ls(e,t,()=>r,()=>{})}function ks(e,...t){const r=t.slice(0,-1),s=t[t.length-1];let n=e;for(let a=0;a<r.length;a++){const i=r[a];n=Ce(n,i,s,new Map)}return n}function Ce(e,t,r,s){if(gt(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(s.has(t))return ms(s.get(t));if(s.set(t,e),Array.isArray(t)){t=t.slice();for(let a=0;a<t.length;a++)t[a]=t[a]??void 0}const n=[...Object.keys(t),...Ue(t)];for(let a=0;a<n.length;a++){const i=n[a];if(be(i))continue;let o=t[i],c=e[i];if(nt(o)&&(o={...o}),nt(c)&&(c={...c}),ke(o)&&(o=Dt(o)),Array.isArray(o))if(Array.isArray(c)){const f=[],l=Reflect.ownKeys(c);for(let p=0;p<l.length;p++){const d=l[p];f[d]=c[d]}c=f}else if(Fs(c)){const f=[];for(let l=0;l<c.length;l++)f[l]=c[l];c=f}else c=[];const h=r(c,o,i,e,t,s);h!==void 0?e[i]=h:Array.isArray(o)||it(c)&&it(o)&&(Ze(c)||Ze(o)||et(c)||et(o))?e[i]=Ce(c,o,r,s):c==null&&Ze(o)?e[i]=Ce({},o,r,s):c==null&&et(o)?e[i]=Dt(o):(c===void 0||o!==void 0)&&(e[i]=o)}return e}function Lt(e,...t){return ks(e,...t,tr)}var Us=e=>typeof File<"u"&&e instanceof File||e instanceof Blob||typeof FileList<"u"&&e instanceof FileList&&e.length>0,Ke=e=>e instanceof FormData?!0:Us(e)||typeof e=="object"&&e!==null&&Object.values(e).some(t=>
1Ke(t)),ot=class extends Error{response;constructor(e){super(`HTTP error ${e.status}`),this.name="HttpResponseError",this.response=e}},Ns=class extends Error{constructor(e="Request was cancelled"){super(e),this.name="HttpCancelledError"}},Bs=class extends Error{constructor(e="Network error"){super(e),this.name="HttpNetworkError"}};function Ms(e){const t=new URLSearchParams;return Object.entries(e).forEach(([r,s])=>{s!=null&&(Array.isArray(s)?s.forEach(n=>t.append(`${r}[]`,String(n))):typeof s=="object"?t.append(r,JSON.stringify(s)):t.append(r,String(s)))}),t.toString()}function _s(e,t,r){if(t&&!e.startsWith("http://")&&!e.startsWith("https://")&&(e=t.replace(/\/$/,"")+"/"+e.replace(/^\//,"")),r&&Object.keys(r).length>0){const s=Ms(r);s&&(e+=(e.includes("?")?"&":"?")+s)}return e}function Ws(){return typeof window>"u"?null:window.axios?.defaults?.headers?.common?.["X-Requested-With"]??null}function Ar(e,t=new FormData,r=null){for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&Or(t,r?`${r}[${s}]`:s,e[s]);return t}function Or(e,t,r){if(Array.isArray(r))return r.forEach((s,n)=>Or(e,`${t}[${n}]`,s));if(r instanceof Date)return e.append(t,r.toISOString());if(typeof File<"u"&&r instanceof File)return e.append(t,r,r.name);if(r instanceof Blob)return e.append(t,r);if(typeof r=="boolean")return e.append(t,r?"1":"0");if(typeof r=="string")return e.append(t,r);if(typeof r=="number")return e.append(t,`${r}`);if(r==null)return e.append(t,"");Ar(r,e,t)}function $s(e,t){if(e!=null)return e instanceof FormData?e:typeof e=="object"&&Ke(e)?Ar(e):typeof e=="object"||t["Content-Type"]?.includes("application/json")?JSON.stringify(e):String(e)}function Vs(e){const t={};return e.forEach((r,s)=>{t[s.toLowerCase()]=r}),t}function Xs(e={}){let t=e.xsrfCookieName??"XSRF-TOKEN",r=e.xsrfHeaderName??"X-XSRF-TOKEN";function s(){if(typeof document>"u")return null;const n=document.cookie.match(new RegExp("(^|;\\s*)"+t+"=([^;]*)"));return n?decodeURIComponent(n[2]):null}return{setXsrfCookieName(n){t=n},setXsrfHeaderName(n){r=n},async request(n){const a=_s(n.url,n.baseURL,n.params),i=n.method.toUpperCase(),o={},c=Ws();c&&(o["X-Requested-With"]=c),n.data!==void 0&&!["GET","DELETE"].includes(i)&&!(n.data instanceof FormData)&&!Ke(n.data)&&(o["Content-Type"]="application/json"),n.headers&&Object.entries(n.headers).forEach(([m,b])=>{b!==void 0&&(o[m]=String(b))});const h=s();h&&!["GET","HEAD","OPTIONS"].includes(i)&&(o[r]=h);let f=n.signal,l;const p=n.timeout??3e4;if(p>0&&!f){const m=new AbortController;f=m.signal,l=setTimeout(()=>m.abort(),p)}const d=["GET","DELETE"].includes(i)?void 0:$s(n.data,o);d instanceof FormData&&delete o["Content-Type"];try{const m=await fetch(a,{method:i,headers:o,body:d,signal:f,credentials:n.credentials??"same-origin"});l&&clearTimeout(l);let b;m.headers.get("content-type")?.includes("application/json")?b=await m.json():b=await m.text();const g={status:m.status,data:b,headers:Vs(m.headers)};if(!m.ok)throw new ot(g);return g}catch(m){throw l&&clearTimeout(l),m instanceof ot?m:m instanceof DOMException&&m.name==="AbortError"?new Ns:m instanceof TypeError?new Bs(m.message):m}}}}var at=Xs(),Et=at,At=void 0,qr=void 0,xr="same-origin",Rr=e=>`${e.method}:${e.baseURL??At??""}${e.url}`,Ir=e=>e.status===204&&e.headers["precognition-success"]==="true",Ne={},K={get:(e,t={},r={})=>me(pe("get",e,t,r)),post:(e,t={},r={})=>me(pe("post",e,t,r)),patch:(e,t={},r={})=>me(pe("patch",e,t,r)),put:(e,t={},r={})=>me(pe("put",e,t,r)),delete:(e,t={},r={})=>me(pe("delete",e,t,r)),useHttpClient(e){return Et=e,K},withBaseURL(e){return At=e,K},withTimeout(e){return qr=e,K},withCredentials(e){return xr=typeof e=="string"?e:e?"include":"omit",K},fingerprintRequestsUsing(e){return Rr=e===null?()=>null:e,K},determineSuccessUsing(e){return Ir=e,K},withXsrfCookieName(e){return at.setXsrfCookieName(e),K},withXsrfHeaderName(e){return at.setXsrfHeaderName(e),K}},pe=(e,t,r,s)=>({url:t,method:e,...s,...["get","delete"].includes(e)?{params:Lt({},r,s?.params)}:{data:Lt({},r,s?.data)}}),me=(e={})=>{const t=[Ks,Gs,zs].reduce((r,s)=>s(r),e);return(t.onBefore??(()=>!0))()===!1?Promise.resolve(null):((t.onStart??(()=>null))(),Et.request({method:t.method,url:t.url,baseURL:t.baseURL??At,data:t.data,params:t.params,headers:t.headers,signal:t.signal,timeout:t.timeout,credentials:xr}).then(async r=>{t.precognitive&&kt(r);const s=r.status;let n=r;return t.precognitive&&t.onPrecognitionSuccess&&Ir(r)&&(n=await Promise.resolve(t.onPrecognitionSuccess(r)??n)),t.onSuccess&&Qs(s)&&(n=await Promise.resolve(t.onSuccess(n)??n)),(Ut(t,s)??(a=>a))(n)??n},r=>{if(Js(r))return Promise.reject(r);const s=r;return t.precognitive&&kt(s.response),(Ut(t,s.response.status)??((n,a)=>Promise.reject(a)))(s.response,s)}).finally(t.onFinish??(()=>null)))},Ks=e=>{const t=e.only??e.validate;return{...e,timeout:e.timeout??qr,precognitive:e.precognitive!==!1,fingerprint:typeof e.fingerprint>"u"?Rr(e,Et):e.fingerprint,headers:{...e.headers,Accept:"application/json","Content-Type":Ys(e),...e.precognitive!==!1?{Precognition:!0}:{},...t?{"Precognition-Validate-Only":Array.from(t).join()}:{}}}},Qs=e=>e>=200&&e<300,Gs=e=>(typeof e.fingerprint!="string"||(Ne[e.fingerprint]?.abort(),delete Ne[e.fingerprint]),e),zs=e=>typeof e.fingerprint!="string"||e.signal||!e.precognitive?e:(Ne[e.fingerprint]=new AbortController,{...e,signal:Ne[e.fingerprint].signal}),kt=e=>
1{if(e.headers?.precognition!=="true")throw Error("Did not receive a Precognition response. Ensure you have the Precognition middleware in place for the route.")},Js=e=>!(e instanceof ot)||typeof e.response?.status!="number",Ut=(e,t)=>({401:e.onUnauthorized,403:e.onForbidden,404:e.onNotFound,409:e.onConflict,422:e.onValidationError,423:e.onLocked})[t],Ys=e=>e.headers?.["Content-Type"]??e.headers?.["Content-type"]??e.headers?.["content-type"]??(Ke(e.data)?"multipart/form-data":"application/json"),Zs=class{config={};defaults;constructor(e){this.defaults=e}extend(e){return e&&(this.defaults={...this.defaults,...e}),this}replace(e){this.config=e}get(e){return Is(this.config,e)?T(this.config,e):T(this.defaults,e)}set(e,t){typeof e=="string"?ie(this.config,e,t):Object.entries(e).forEach(([r,s])=>{ie(this.config,r,s)})}},le=new Zs({form:{recentlySuccessfulDuration:2e3,forceIndicesArrayFormatInFormData:!0,withAllErrors:!1},prefetch:{cacheFor:3e4,hoverDelay:75}});function ct(e,t){let r;return function(...s){clearTimeout(r),r=setTimeout(()=>e.apply(this,s),t)}}function D(e,t){return document.dispatchEvent(new CustomEvent(`inertia:${e}`,t))}var Nt=e=>D("before",{cancelable:!0,detail:{visit:e}}),en=(e,{page:t,visitId:r}={})=>D("error",{detail:{errors:e,page:t,visitId:r}}),tn=e=>D("networkError",{cancelable:!0,detail:{error:e}}),rn=e=>D("finish",{detail:{visit:e}}),Bt=e=>D("httpException",{cancelable:!0,detail:{response:e}}),sn=e=>D("beforeUpdate",{detail:{page:e}}),Be=(e,{cached:t=!1,visitId:r}={})=>D("navigate",{detail:{page:e,cached:t,visitId:r}}),nn=(e,{replace:t,visitId:r})=>D("clientVisit",{detail:{page:e,replace:t,visitId:r}}),on=e=>D("progress",{detail:{progress:e}}),an=e=>D("start",{detail:{visit:e}}),cn=(e,{visitId:t}={})=>D("success",{detail:{page:e,visitId:t}}),ln=(e,t)=>D("prefetched",{detail:{fetchedAt:Date.now(),response:e,visit:t}}),un=e=>D("prefetching",{detail:{visit:e}}),Me=e=>D("flash",{detail:{flash:e}}),fn=(e,t)=>D("location",{cancelable:!0,detail:{url:e,versionChange:t}}),k=class{static locationVisitKey="inertiaLocationVisit";static set(e,t){typeof window<"u"&&window.sessionStorage.setItem(e,JSON.stringify(t))}static get(e){if(typeof window<"u")return JSON.parse(window.sessionStorage.getItem(e)||"null")}static merge(e,t){const r=this.get(e);r===null?this.set(e,t):this.set(e,{...r,...t})}static remove(e){typeof window<"u"&&window.sessionStorage.removeItem(e)}static removeNested(e,t){const r=this.get(e);r!==null&&(delete r[t],this.set(e,r))}static exists(e){try{return this.get(e)!==null}catch{return!1}}static clear(){typeof window<"u"&&window.sessionStorage.clear()}},hn=async e=>{if(typeof window>"u")throw new Error("Unable to encrypt history");const t=Fr(),r=await wn(await Hr());if(!r)throw new Error("Unable to encrypt history");return await pn(t,r,e)},ue={key:"historyKey",iv:"historyIv"},dn=async e=>{const t=Fr(),r=await Hr();if(!r)throw new Error("Unable to decrypt history");return await mn(t,r,e)},pn=async(e,t,r)=>{if(typeof window>"u")throw new Error("Unable to encrypt history");if(typeof window.crypto.subtle>"u")return console.warn("Encryption is not supported in this environment. SSL is required."),Promise.resolve(r);const s=new TextEncoder,n=JSON.stringify(r),a=new Uint8Array(n.length*3),i=s.encodeInto(n,a);return window.crypto.subtle.encrypt({name:"AES-GCM",iv:e},t,a.subarray(0,i.written))},mn=async(e,t,r)=>{if(typeof window.crypto.subtle>"u")return console.warn("Decryption is not supported in this environment. SSL is required."),Promise.resolve(r);const s=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,r);return JSON.parse(new TextDecoder().decode(s))},Fr=()=>{const e=k.get(ue.iv);if(e)return new Uint8Array(e);const t=window.crypto.getRandomValues(new Uint8Array(12));return k.set(ue.iv,Array.from(t)),t},gn=async()=>typeof window.crypto.subtle>"u"?(console.warn("Encryption is not supported in this environment. SSL is required."),Promise.resolve(null)):window.crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt","decrypt"]),yn=async e=>{if(typeof window.crypto.subtle>"u")return console.warn("Encryption is not supported in this environment. SSL is required."),Promise.resolve();const t=await window.crypto.subtle.exportKey("raw",e);k.set(ue.key,Array.from(new Uint8Array(t)))},wn=async e=>{if(e)return e;const t=await gn();return t?(await yn(t),t):null},Hr=async()=>{const e=k.get(ue.key);return e?await window.crypto.subtle.importKey("raw",new Uint8Array(e),{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]):null},Mt=e=>{const t={};for(const r of Object.keys(e))e[r]!==void 0&&(t[r]=e[r]);return t},Cr=(e,t,r)=>{if(e===t)return!0;for(const s in e)if(!r.includes(s)&&e[s]!==t[s]&&!Pn(e[s],t[s]))return!1;for(const s in t)if(!r.includes(s)&&!(s in e))return!1;return!0},Pn=(e,t)=>{switch(typeof e){case"object":return Cr(e,t,[]);case"function":return e.toString()===t.toString();default:return e===t}},vn={ms:1,s:1e3,m:1e3*60,h:1e3*60*60,d:1e3*60*60*24},_t=e=>{if(typeof e=="number")return e;for(const[t,r]of Object.entries(vn))if(e.endsWith(t))return parseFloat(e)*r;return parseInt(e)},Sn=class{cached=[];inFlightRequests=[];removalTimers=[];currentUseId=null;add(e,t,{cacheFor:r,cacheTags:s}
1){if(this.findInFlight(e))return Promise.resolve();const n=this.findCached(e);if(!e.fresh&&n&&n.staleTimestamp>Date.now())return Promise.resolve();const[a,i]=this.extractStaleValues(r),o=new Promise((c,h)=>{t({...e,onCancel:()=>{this.remove(e),e.onCancel(),h()},onError:f=>{this.remove(e),e.onError(f),h()},onPrefetching(f){e.onPrefetching(f)},onPrefetched(f,l){e.onPrefetched(f,l)},onPrefetchResponse(f){c(f)},onPrefetchError(f){Q.removeFromInFlight(e),h(f)}})}).then(c=>{this.remove(e);const h=c.getPageResponse();u.mergeOncePropsIntoResponse(h),this.cached.push({params:{...e},staleTimestamp:Date.now()+a,expiresAt:Date.now()+i,response:o,singleUse:i===0,timestamp:Date.now(),inFlight:!1,tags:Array.isArray(s)?s:[s]});const f=this.getShortestOncePropTtl(h);return this.scheduleForRemoval(e,f?Math.min(i,f):i),this.removeFromInFlight(e),c.handlePrefetch(),c});return this.inFlightRequests.push({params:{...e},response:o,staleTimestamp:null,inFlight:!0}),o}removeAll(){this.cached=[],this.removalTimers.forEach(e=>{clearTimeout(e.timer)}),this.removalTimers=[]}removeByTags(e){this.cached=this.cached.filter(t=>!t.tags.some(r=>e.includes(r)))}remove(e){this.cached=this.cached.filter(t=>!this.paramsAreEqual(t.params,e)),this.clearTimer(e)}removeFromInFlight(e){this.inFlightRequests=this.inFlightRequests.filter(t=>!this.paramsAreEqual(t.params,e))}extractStaleValues(e){const[t,r]=this.cacheForToStaleAndExpires(e);return[_t(t),_t(r)]}cacheForToStaleAndExpires(e){if(!Array.isArray(e))return[e,e];switch(e.length){case 0:return[0,0];case 1:return[e[0],e[0]];default:return[e[0],e[1]]}}clearTimer(e){const t=this.removalTimers.find(r=>this.paramsAreEqual(r.params,e));t&&(clearTimeout(t.timer),this.removalTimers=this.removalTimers.filter(r=>r!==t))}scheduleForRemoval(e,t){if(!(typeof window>"u")&&(this.clearTimer(e),t>0)){const r=window.setTimeout(()=>this.remove(e),t);this.removalTimers.push({params:e,timer:r})}}get(e){return this.findCached(e)||this.findInFlight(e)}use(e,t){const r=`${t.url.pathname}-${Date.now()}-${Math.random().toString(36).substring(7)}`;this.currentUseId=r;const s={...t,cached:!0};return e.response.then(n=>{if(this.currentUseId===r)return n.mergeParams({...s,onPrefetched:()=>{}}),this.removeSingleUseItems(t),n.handle()})}removeSingleUseItems(e){this.cached=this.cached.filter(t=>this.paramsAreEqual(t.params,e)?!t.singleUse:!0)}findCached(e){return this.cached.find(t=>this.paramsAreEqual(t.params,e))||null}findInFlight(e){return this.inFlightRequests.find(t=>this.paramsAreEqual(t.params,e))||null}withoutPurposePrefetchHeader(e){const t=X(e);return t.headers.Purpose==="prefetch"&&delete t.headers.Purpose,t}paramsAreEqual(e,t){return Cr(this.withoutPurposePrefetchHeader(e),this.withoutPurposePrefetchHeader(t),["id","showProgress","replace","prefetch","preserveScroll","preserveState","onBefore","onBeforeUpdate","onStart","onProgress","onFinish","onCancel","onSuccess","onError","onFlash","onPrefetched","onCancelToken","onPrefetching","async","viewTransition","optimistic","component","pageProps","cached"])}updateCachedOncePropsFromCurrentPage(){this.cached.forEach(e=>{e.response.then(t=>{const r=t.getPageResponse();u.mergeOncePropsIntoResponse(r,{force:!0});for(const[i,o]of Object.entries(r.deferredProps??{})){const c=o.filter(h=>T(r.props,h)===void 0);c.length>0?r.deferredProps[i]=c:delete r.deferredProps[i]}const s=this.getShortestOncePropTtl(r);if(s===null)return;const n=e.expiresAt-Date.now(),a=Math.min(n,s);a>0?this.scheduleForRemoval(e.params,a):this.remove(e.params)})})}getShortestOncePropTtl(e){const t=Object.values(e.onceProps??{}).map(r=>r.expiresAt).filter(r=>!!r);return t.length===0?null:Math.min(...t)-Date.now()}},Q=new Sn,jr=(e,t=1)=>{window.requestAnimationFrame(()=>{t>1?jr(e,t-1):e()})},bn=e=>{if(typeof window>"u")return null;const t=document.querySelector(`script[data-page="${e}"][type="application/json"]`);return t?.textContent?JSON.parse(t.textContent):null},Pe=typeof window>"u",En=!Pe&&/Firefox/i.test(window.navigator.userAgent),U=class{static save(){S.saveScrollPositions(this.getScrollRegions())}static getScrollRegions(){return Array.from(this.regions()).map(e=>({top:e.scrollTop,left:e.scrollLeft}))}static regions(){return document.querySelectorAll("[scroll-region]")}static scrollToTop(){if(En&&getComputedStyle(document.documentElement).scrollBehavior==="smooth")return jr(()=>window.scrollTo(0,0),2);window.scrollTo(0,0)}static reset(){!Pe&&window.location.hash||this.scrollToTop(),this.regions().forEac
1h(e=>{typeof e.scrollTo=="function"?e.scrollTo(0,0):(e.scrollTop=0,e.scrollLeft=0)}),this.save(),this.scrollToAnchor()}static scrollToAnchor(){const e=Pe?null:window.location.hash;e&&setTimeout(()=>{const t=document.getElementById(e.slice(1));t?t.scrollIntoView():this.scrollToTop()})}static restore(e){Pe||window.requestAnimationFrame(()=>{this.restoreDocument(),this.restoreScrollRegions(e)})}static restoreScrollRegions(e){Pe||this.regions().forEach((t,r)=>{const s=e[r];s&&(typeof t.scrollTo=="function"?t.scrollTo(s.left,s.top):(t.scrollTop=s.top,t.scrollLeft=s.left))})}static restoreDocument(){const e=S.getDocumentScrollPosition();window.scrollTo(e.left,e.top)}static onScroll(e){const t=e.target;typeof t.hasAttribute=="function"&&t.hasAttribute("scroll-region")&&this.save()}static onWindowScroll(){S.saveDocumentScrollPosition({top:window.scrollY,left:window.scrollX})}},An=e=>typeof File<"u"&&e instanceof File||e instanceof Blob||typeof FileList<"u"&&e instanceof FileList&&e.length>0;function lt(e){return An(e)||e instanceof FormData&&Array.from(e.values()).some(t=>lt(t))||typeof e=="object"&&e!==null&&Object.values(e).some(t=>lt(t))}var ut=e=>e instanceof FormData;function Tr(e,t=new FormData,r=null,s="brackets"){e=e||{};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&Lr(t,Dr(r,n,"indices"),e[n],s);return t}function Dr(e,t,r){return e?r==="brackets"?`${e}[]`:`${e}[${t}]`:t}function Lr(e,t,r,s){if(Array.isArray(r))return Array.from(r.keys()).forEach(n=>Lr(e,Dr(t,n.toString(),s),r[n],s));if(r instanceof Date)return e.append(t,r.toISOString());if(r instanceof File)return e.append(t,r,r.name);if(r instanceof Blob)return e.append(t,r);if(typeof r=="boolean")return e.append(t,r?"1":"0");if(typeof r=="string")return e.append(t,r);if(typeof r=="number")return e.append(t,`${r}`);if(r==null)return e.append(t,"");Tr(r,e,t,s)}function On(e){return/\[\d+\]/.test(decodeURIComponent(e.search))}function qn(e){if(!e||e==="?")return{};const t={};return e.replace(/^\?/,"").split("&").filter(Boolean).forEach(r=>{const[s,n]=Rn(r);In(t,Wt(s),Wt(n))}),t}function xn(e,t){const r=[];return ft(e,"",r,t),r.length?"?"+r.join("&"):""}function Rn(e){const t=e.indexOf("=");return t===-1?[e,""]:[e.substring(0,t),e.substring(t+1)]}function Wt(e){return decodeURIComponent(e.replace(/\+/g," "))}function In(e,t,r){const s=Fn(t);if(s.some(i=>i==="__proto__"))return;let n=e;for(;s.length>1;){const i=s.shift(),o=s[0]==="";(typeof n[i]!="object"||n[i]===null)&&(n[i]=o?[]:{}),n=n[i]}const a=s.shift();a===""&&Array.isArray(n)?n.push(r):n[a]=r}function Fn(e){const t=[],r=e.split("[")[0];r&&t.push(r);let s;const n=/\[([^\]]*)\]/g;for(;(s=n.exec(e))!==null;)t.push(s[1]);return t}function ft(e,t,r,s){if(e!==void 0){if(e===null){r.push(`${t}=`);return}if(Array.isArray(e)){e.forEach((n,a)=>{ft(n,s==="indices"?`${t}[${a}]`:`${t}[]`,r,s)});return}if(typeof e=="object"){Object.keys(e).forEach(n=>{ft(e[n],t?`${t}[${n}]`:n,r,s)});return}r.push(`${t}=${encodeURIComponent(String(e))}`)}}function z(e){return new URL(e.toString(),typeof window>"u"?void 0:window.location.toString())}var Hn=(e,t,r,s,n)=>{let a=typeof e=="string"?z(e):e;if((lt(t)||s)&&!ut(t)&&(le.get("form.forceIndicesArrayFormatInFormData")&&(n="indices"),t=Tr(t,new FormData,null,n)),ut(t))return[a,t];const[i,o]=Ot(r,a,t,n);return[z(i),o]};function Ot(e,t,r,s="brackets"){const n=e==="get"&&!ut(r)&&Object.keys(r).length>0,a=jn(t.toString()),i=a||t.toString().startsWith("/")||t.toString()==="",o=!i&&!t.toString().startsWith("#")&&!t.toString().startsWith("?"),c=/^[.]{1,2}([/]|$)/.test(t.toString()),h=t.toString().includes("?")||n,f=t.toString().includes("#"),l=new URL(t.toString(),typeof window>"u"?"http://localhost":window.location.toString());if(n){const p=On(l)?"indices":s;l.search=xn({...qn(l.search),...r},p)}return[[a?`${l.protocol}//${l.host}`:"",i?l.pathname:"",o?l.pathname.substring(c?0:1):"",h?l.search:"",f?l.hash:""].join(""),n?{}:r]}function _e(e){return e=new URL(e.href),e.hash="",e}var $t=(e,t)=>{e.hash&&!t.hash&&_e(e).href===t.href&&(t.hash=e.hash)},We=(e,t)=>_e(e).href===_e(t).href,Cn=(e,t)=>e.origin===t.origin&&e.pathname===t.pathname;function te(e){return e!==null&&typeof e=="object"&&e!==void 0&&"url"in e&&"method"in e}function kr(e){return e.component?typeof e.component!="string"?(console.error(`The "component" property on the URL method pair received multiple components (${Object.keys(e.component).join(", ")}), but only a single component string is supported for instant visits. Use the withComponent() method to specify which component to use.`),null):e.component:null}function jn(e){return/^([a-z][a-z0-9+.-]*:)?\/\/[^/]/i.test(e)}var Tn=class{page;swapComponent;resolveComponent;onFlashCallback;componentId={};listeners=[];isFirstPageLoad=!0;cleared=!1;pendingDeferredProps=null;historyQuotaExceeded=!1;optimisticBaseline={};pendingOptimistics=[];optimisticCounter=0;
1init({initialPage:e,swapComponent:t,resolveComponent:r,onFlash:s}){return this.page={...e,flash:e.flash??{},rescuedProps:e.rescuedProps??[]},this.swapComponent=t,this.resolveComponent=r,this.onFlashCallback=s,G.on("historyQuotaExceeded",()=>{this.historyQuotaExceeded=!0}),this}set(e,{replace:t=!1,preserveScroll:r=!1,preserveState:s=!1,viewTransition:n=!1,cached:a=!1,visitId:i}={}){Object.keys(e.deferredProps||{}).length&&(this.pendingDeferredProps={deferredProps:e.deferredProps,component:e.component,url:e.url},e.initialDeferredProps===void 0&&(e.initialDeferredProps=e.deferredProps)),this.componentId={};const o=this.componentId;return e.clearHistory&&S.clear(),this.resolve(e.component,e).then(c=>{if(o!==this.componentId)return;e.rememberedState??={};const h=typeof window>"u",f=h?new URL(e.url):window.location,l=!h&&r?U.getScrollRegions():[];t=t||We(z(e.url),f);const p={...e,flash:{}};return new Promise(d=>t?S.replaceState(p,d):S.pushState(p,d)).then(()=>{const d=!this.isTheSame(e);if(!d&&Object.keys(e.props.errors||{}).length>0&&(n=!1),this.page=e,this.cleared=!1,this.hasOnceProps()&&Q.updateCachedOncePropsFromCurrentPage(),d&&this.fireEventsFor("newComponent"),this.isFirstPageLoad&&this.fireEventsFor("firstLoad"),this.isFirstPageLoad=!1,this.historyQuotaExceeded){this.historyQuotaExceeded=!1;return}return this.swap({component:c,page:e,preserveState:s,viewTransition:n}).then(()=>{r?window.requestAnimationFrame(()=>U.restoreScrollRegions(l)):U.reset(),this.pendingDeferredProps&&this.pendingDeferredProps.component===e.component&&this.pendingDeferredProps.url===e.url&&G.fireInternalEvent("loadDeferredProps",this.pendingDeferredProps.deferredProps),this.pendingDeferredProps=null,t||Be(e,{cached:a,visitId:i})})})})}setQuietly(e,{preserveState:t=!1}={}){return this.resolve(e.component,e).then(r=>(this.page=e,this.cleared=!1,S.setCurrent(e),this.swap({component:r,page:e,preserveState:t,viewTransition:!1})))}clear(){this.cleared=!0}isCleared(){return this.cleared}get(){return this.page}getWithoutFlashData(){return{...this.page,flash:{}}}hasOnceProps(){return Object.keys(this.page.onceProps??{}).length>0}merge(e){this.page={...this.page,...e}}setPropsQuietly(e){return this.page={...this.page,props:e},this.resolve(this.page.component,this.page).then(t=>this.swap({component:t,page:this.page,preserveState:!0,viewTransition:!1}))}setFlash(e){this.page={...this.page,flash:e},this.onFlashCallback?.(e)}setUrlHash(e){this.page.url.includes(e)||(this.page.url+=e)}remember(e){this.page.rememberedState=e}swap({component:e,page:t,preserveState:r,viewTransition:s}){const n=()=>this.swapComponent({component:e,page:t,preserveState:r});if(!s||!document?.startViewTransition||document.visibilityState==="hidden")return n();const a=typeof s=="boolean"?()=>null:s;return new Promise(i=>{const o=document.startViewTransition(()=>n().then(i));o.ready.catch(()=>{}),a(o)})}resolve(e,t){return Promise.resolve(this.resolveComponent(e,t))}nextOptimisticId(){return++this.optimisticCounter}setBaseline(e,t){e in this.optimisticBaseline||(this.optimisticBaseline[e]=t)}updateBaseline(e,t){e in this.optimisticBaseline&&(this.optimisticBaseline[e]=t)}hasBaseline(e){return e in this.optimisticBaseline}registerOptimistic(e,t){this.pendingOptimistics.push({id:e,callback:t})}unregisterOptimistic(e){this.pendingOptimistics=this.pendingOptimistics.filter(t=>t.id!==e)}replayOptimistics(){const e=Object.keys(this.optimisticBaseline);if(e.length===0)return{};const t=X(this.page.props);for(const s of e)t[s]=X(this.optimisticBaseline[s]);for(const{callback:s}of this.pendingOptimistics){const n=s(X(t));n&&Object.assign(t,n)}const r={};for(const s of e)r[s]=t[s];return r}pendingOptimisticCount(){return this.pendingOptimistics.length}clearOptimisticState(){this.optimisticBaseline={},this.pendingOptimistics=[]}isTheSame(e){return this.page.component===e.component}on(e,t){return this.listeners.push({event:e,callback:t}),()=>{this.listeners=this.listeners.filter(r=>r.event!==e&&r.callback!==t)}}fireEventsFor(e){this.listeners.filter(t=>t.event===e).forEach(t=>t.callback())}mergeOncePropsIntoResponse(e,{force:t=!1}={}){Object.entries(e.onceProps??{}
1).forEach(([r,s])=>{const n=this.page.onceProps?.[r];n!==void 0&&(t||T(e.props,s.prop)===void 0)&&(ie(e.props,s.prop,T(this.page.props,n.prop)),e.onceProps[r].expiresAt=n.expiresAt)})}},u=new Tn,Qe=class{items=[];processingPromise=null;add(e){return this.items.push(e),this.process()}process(){return this.processingPromise??=this.processNext().finally(()=>{this.processingPromise=null}),this.processingPromise}processNext(){const e=this.items.shift();return e?Promise.resolve(e()).then(()=>this.processNext()):Promise.resolve()}},ce=typeof window>"u",ge=new Qe,Vt=!ce&&/CriOS/.test(window.navigator.userAgent),Dn=class{rememberedState="rememberedState";scrollRegions="scrollRegions";preserveUrl=!1;current={};initialState=null;remember(e,t){this.replaceState({...u.getWithoutFlashData(),rememberedState:{...u.get()?.rememberedState??{},[t]:e}})}restore(e){if(!ce)return this.current[this.rememberedState]?.[e]!==void 0?this.current[this.rememberedState]?.[e]:this.initialState?.[this.rememberedState]?.[e]}pushState(e,t=null){if(!ce){if(this.preserveUrl){t&&t();return}this.current=e,ge.add(()=>this.getPageData(e).then(r=>{const s=()=>this.doPushState({page:r},e.url).then(()=>t?.());return Vt?new Promise(n=>{setTimeout(()=>s().then(n))}):s()}))}}clonePageProps(e){try{return structuredClone(e.props),e}catch{return{...e,props:X(e.props)}}}getPageData(e){const t=this.clonePageProps(e);return new Promise(r=>e.encryptHistory?hn(t).then(r):r(t))}processQueue(){return ge.process()}decrypt(e=null){if(ce)return Promise.resolve(e??u.get());const t=e??window.history.state?.page;return this.decryptPageData(t).then(r=>{if(!r)throw new Error("Unable to decrypt history");return this.initialState===null?this.initialState=r??void 0:this.current=r??{},r})}decryptPageData(e){return e instanceof ArrayBuffer?dn(e):Promise.resolve(e)}saveScrollPositions(e){ge.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!ne(this.getScrollRegions(),e))return this.doReplaceState({page:window.history.state.page,scrollRegions:e})}))}saveDocumentScrollPosition(e){ge.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!ne(this.getDocumentScrollPosition(),e))return this.doReplaceState({page:window.history.state.page,documentScrollPosition:e})}))}getScrollRegions(){return window.history.state?.scrollRegions||[]}getDocumentScrollPosition(){return window.history.state?.documentScrollPosition||{top:0,left:0}}replaceState(e,t=null){if(ne(this.current,e)){t&&t();return}const{flash:r,...s}=e;if(u.merge(s),!ce){if(this.preserveUrl){t&&t();return}this.current=e,ge.add(()=>this.getPageData(e).then(n=>{const a=()=>this.doReplaceState({page:n},e.url).then(()=>t?.());return Vt?new Promise(i=>{setTimeout(()=>a().then(i))}):a()}))}}isHistoryThrottleError(e){return e instanceof Error&&e.name==="SecurityError"&&(e.message.includes("history.pushState")||e.message.includes("history.replaceState"))}isQuotaExceededError(e){return e instanceof Error&&e.name==="QuotaExceededError"}withThrottleProtection(e){return Promise.resolve().then(()=>{try{return e()}catch(t){if(!this.isHistoryThrottleError(t))throw t;console.error(t.message)}})}doReplaceState(e,t){return this.withThrottleProtection(()=>{window.history.replaceState({...e,scrollRegions:e.scrollRegions??window.history.state?.scrollRegions,documentScrollPosition:e.documentScrollPosition??window.history.state?.documentScrollPosition},"",t)})}doPushState(e,t){return this.withThrottleProtection(()=>{try{window.history.pushState(e,"",t)}catch(r){if(!this.isQuotaExceededError(r))throw r;G.fireInternalEvent("historyQuotaExceeded",t)}})}getState(e,t){return this.current?.[e]??t}deleteState(e){this.current[e]!==void 0&&(delete this.current[e],this.replaceState(this.current))}clearInitialState(e){this.initialState&&this.initialState[e]!==void 0&&delete this.initialState[e]}browserHasHistoryEntry(){return!ce&&!!window.history.state?.page}clear(){k.remove(ue.key),k.remove(ue.iv)}setCurrent(e){this.current=e}isValidState(e){return!!e.page}getAllState(){return this.current}};typeof window<"u"&&window.history.scrollRestoration&&(window.history.scrollRestoration="manual");var S=new Dn,Ln=class{internalListeners=[];init(){typeof window<"u"&&(window.addEventListener("popstate",this.handlePopstateEvent.bind(this)),window.addEventListener("pageshow",this.handlePageshowEvent.bind(this)),window.addEventListener("scroll",ct(U.onWindowScroll.bind(U),100),!0)),typeof document<"u"&&document.addEventListener("scroll",ct(U.onScroll.bind(U),100),!0)}onGlobalEvent(e,t){const r=(s=>{const n=t(s);s.cancelable&&!s.defaultPrevented&&n===!1&&s.preventDefault()});return this.registerListener(`inertia:${e}`,r)}on(e,t){return this.internalListeners.push({event:e,listener:t}),()=>{this.internalListeners=this.internalListeners.filter(r=>r.listener!==t)}}onMissingHistoryItem(){u.clear(),this.fireInternalEvent("missingHistoryItem")}fireInternalEvent(e,...t){this.internalListeners.filter(r=>r.event===e).forEach(r=>r.listener(...t))}registerListener(e,t){return document.addEventListener(e,t),()=>document.removeEventListener(e,t)}handlePageshowEvent(e){e.persisted&&S.decrypt().catch(()=>this.onMissingHistoryItem())}handlePopstateEvent(e){const t=e.state||null;if(t===null){const r=z(u.get().url);r.hash=window.location.hash,S.replaceState({...u.getWithoutFlashData(),url:r.href}),U.reset();return}if(!S.isValidState(t))return this.onMissingHistoryItem();S.decrypt(t.page).then(r=>{if(u.get().version!==r.version){this.onMissingHistoryItem();return}B.cancelAll({prefetch:!1}),u.setQuietly(r,{preserveState:!1}).then(()=>{U.restore(S.getScrollRegions()),Be(u.get());const s={},n=u.get().props;for(const[a,i]of Object.entries(r.initialDeferredProps??r.deferredProps??{})){const o=i.filter(c=>T(n,c)===void 0);o.length>0&&(s[a]=o)}Object.keys(s).length>0&&this.fireInternalEvent("loadDeferredProps",s)})}).catch(()=>{this.onMissingHistoryItem()})}},G=new Ln,kn=class{type;constructor(){this.type=this.resolveType()}resolveType(){return typeof window>
1"u"?"navigate":window.performance?.getEntriesByType("navigation")[0]?.type??"navigate"}get(){return this.type}isBackForward(){return this.type==="back_forward"}isReload(){return this.type==="reload"}},tt=new kn;function je(){const e=typeof window<"u"?window.crypto:void 0;if(e?.randomUUID)return e.randomUUID();const t=()=>e?.getRandomValues?e.getRandomValues(new Uint8Array(1))[0]:Math.floor(Math.random()*256);return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,r=>(+r^t()&15>>+r/4).toString(16))}var Un=class{static handle(){this.clearRememberedStateOnReload(),[this.handleBackForward,this.handleLocation,this.handleDefault].find(e=>e.bind(this)())}static clearRememberedStateOnReload(){tt.isReload()&&(S.deleteState(S.rememberedState),S.clearInitialState(S.rememberedState))}static handleBackForward(){if(!tt.isBackForward()||!S.browserHasHistoryEntry())return!1;const e=S.getScrollRegions();return S.decrypt().then(t=>{const r=je();u.set(t,{preserveScroll:!0,preserveState:!0,visitId:r}).then(()=>{U.restore(e),Be(u.get(),{visitId:r})})}).catch(()=>{G.onMissingHistoryItem()}),!0}static handleLocation(){if(!k.exists(k.locationVisitKey))return!1;const e=k.get(k.locationVisitKey)||{};return k.remove(k.locationVisitKey),typeof window<"u"&&u.setUrlHash(window.location.hash),S.decrypt(u.get()).then(()=>{const t=je(),r=S.getState(S.rememberedState,{}),s=S.getScrollRegions();u.remember(r),u.set(u.get(),{preserveScroll:e.preserveScroll,preserveState:!0,visitId:t}).then(()=>{e.preserveScroll&&U.restore(s),this.fireInitialEvents(t)})}).catch(()=>{G.onMissingHistoryItem()}),!0}static handleDefault(){typeof window<"u"&&u.setUrlHash(window.location.hash);const e=je();u.set(u.get(),{preserveScroll:!0,preserveState:!0,visitId:e}).then(()=>{tt.isReload()?U.restore(S.getScrollRegions()):U.scrollToAnchor(),this.fireInitialEvents(e)})}static fireInitialEvents(e){const t=u.get();Be(t,{visitId:e}),Object.keys(t.flash).length>0&&queueMicrotask(()=>Me(t.flash))}},Nn=class{intervalId=null;timeoutId=null;throttle=!1;keepAlive=!1;cb;interval;cbCount=0;mode;inFlight=!1;currentCancel=null;stopped=!0;instanceId=0;constructor(e,t,r){this.keepAlive=r.keepAlive??!1,this.mode=r.mode??"overlap",this.cb=t,this.interval=e,(r.autoStart??!0)&&this.start()}stop(){this.stopped=!0,this.instanceId++,this.inFlight=!1,this.currentCancel=null,this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}start(){if(!(typeof window>"u")){if(this.stop(),this.stopped=!1,this.mode==="rest"){this.scheduleNext();return}this.intervalId=window.setInterval(()=>this.tick(),this.interval)}}isInBackground(e){this.throttle=this.keepAlive?!1:e,this.throttle&&(this.cbCount=0)}scheduleNext(){this.stopped||(this.timeoutId=window.setTimeout(()=>{this.timeoutId=null,this.tick()},this.interval))}tick(){!this.throttle||this.cbCount%10===0?this.fire():this.mode==="rest"&&this.scheduleNext(),this.throttle&&this.cbCount++}fire(){this.inFlight&&this.mode==="cancel"&&this.currentCancel?.();const e=this.instanceId;this.cb({onStart:t=>{e===this.instanceId&&(this.inFlight=!0,this.currentCancel=t)},onFinish:()=>{e===this.instanceId&&(this.inFlight=!1,this.currentCancel=null,this.mode==="rest"&&this.scheduleNext())}})}},Bn=class{polls=[];constructor(){this.setupVisibilityListener()}get count(){return this.polls.length}add(e,t,r){const s=new Nn(e,t,r);return this.polls.push(s),{stop:()=>s.stop(),start:()=>s.start(),destroy:()=>{s.stop(),this.polls=this.polls.filter(n=>n!==s)}}}clear(){this.polls.forEach(e=>e.stop()),this.polls=[]}setupVisibilityListener(){typeof document>"u"||document.addEventListener("visibilitychange",()=>{this.polls.forEach(e=>e.isInBackground(document.hidden))},!1)}},Xt=new Bn,Mn=class{requestHandlers=[];responseHandlers=[];errorHandlers=[];onRequest(e){return this.requestHandlers.push(e),()=>{this.requestHandlers=this.requestHandlers.filter(t=>t!==e)}}onResponse(e){return this.responseHandlers.push(e),()=>{this.responseHandlers=this.responseHandlers.filter(t=>t!==e)}}onError(e){return this.errorHandlers.push(e),()=>{this.errorHandlers=this.errorHandlers.filter(t=>t!==e)}}async processRequest(e){let t=e;for(const r of this.requestHandlers)t=await r(t);return t}async processResponse(e){let t=e;for(const r of this.responseHandlers)t=await r(t);return t}async processError(e){for(const t of this.errorHandlers)await t(e)}}
1,C=new Mn,qt=class extends Error{code;url;constructor(e,t,r){super(r?`${e} (${r})`:e),this.name="HttpError",this.code=t,this.url=r}},ht=class extends qt{response;constructor(e,t,r){super(e,"ERR_HTTP_RESPONSE",r),this.name="HttpResponseError",this.response=t}},dt=class extends qt{constructor(e="Request was cancelled",t){super(e,"ERR_CANCELLED",t),this.name="HttpCancelledError"}},Kt=class extends qt{cause;constructor(e,t,r){super(e,"ERR_NETWORK",t),this.name="HttpNetworkError",this.cause=r}};function _n(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null}function Wn(e){const t={};return e.getAllResponseHeaders().split(`\r 2`).forEach(r=>{const s=r.indexOf(":");s>0&&(t[r.slice(0,s).toLowerCase().trim()]=r.slice(s+1).trim())}),t}function Ur(e){return typeof FormData<"u"&&e instanceof FormData}function $n(e){return typeof e=="string"||Ur(e)||typeof Blob<"u"&&e instanceof Blob||typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer||typeof ArrayBuffer<"u"&&ArrayBuffer.isView(e)||typeof URLSearchParams<"u"&&e instanceof URLSearchParams}function Vn(e,t){if(!t.headers)return;const r=Ur(t.data);Object.entries(t.headers).forEach(([s,n])=>{(s.toLowerCase()!=="content-type"||!r)&&e.setRequestHeader(s,String(n))})}function Xn(e,t){if(!t||Object.keys(t).length===0)return e;const[r]=Ot("get",e,t);return r}var Nr=class{xsrfCookieName;xsrfHeaderName;constructor(e={}){this.xsrfCookieName=e.xsrfCookieName??"XSRF-TOKEN",this.xsrfHeaderName=e.xsrfHeaderName??"X-XSRF-TOKEN"}async request(e){const t=await C.processRequest(e);try{const r=await this.doRequest(t);return await C.processResponse(r)}catch(r){throw(r instanceof ht||r instanceof Kt||r instanceof dt)&&await C.processError(r),r}}doRequest(e){return new Promise((t,r)=>{const s=new XMLHttpRequest,n=Xn(e.url,e.params);s.open(e.method.toUpperCase(),n,!0);const a=_n(this.xsrfCookieName);a&&s.setRequestHeader(this.xsrfHeaderName,a),Object.keys(e.headers??{}).some(o=>o.toLowerCase()==="x-requested-with")||s.setRequestHeader("X-Requested-With","XMLHttpRequest");let i=null;e.data!==null&&e.data!==void 0&&($n(e.data)?i=e.data:typeof e.data=="object"?(i=JSON.stringify(e.data),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&s.setRequestHeader("Content-Type","application/json")):i=String(e.data)),Vn(s,e),e.onUploadProgress&&(s.upload.onprogress=o=>{const c=o.lengthComputable?o.loaded/o.total:void 0;e.onUploadProgress({progress:c,percentage:c?Math.round(c*100):0,loaded:o.loaded,total:o.lengthComputable?o.total:void 0})}),e.signal&&e.signal.addEventListener("abort",()=>s.abort()),s.onabort=()=>r(new dt("Request was cancelled",e.url)),s.onerror=()=>r(new Kt("Network error",e.url)),s.onload=()=>{const o={status:s.status,data:s.responseText,headers:Wn(s)};s.status>=400?r(new ht(`Request failed with status ${s.status}`,o,e.url)):t(o)},s.send(i)})}},Kn=new Nr,rt=Kn;function Qn(e){return!("request"in e)}var Br={getClient(){return rt},setClient(e){if(!Qn(e)){rt=e;return}rt=new Nr(e),e.xsrfCookieName&&K.withXsrfCookieName(e.xsrfCookieName),e.xsrfHeaderName&&K.withXsrfHeaderName(e.xsrfHeaderName)},onRequest:C.onRequest.bind(C),onResponse:C.onResponse.bind(C),onError:C.onError.bind(C),processRequest:C.processRequest.bind(C),processResponse:C.processResponse.bind(C),processError:C.processError.bind(C)},Gn=class{requestHandlers=[];responseHandlers=[];onVisitRequest(e){return this.requestHandlers.push(e),()=>{this.requestHandlers=this.requestHandlers.filter(t=>t!==e)}}onVisitResponse(e){return this.responseHandlers.push(e),()=>{this.responseHandlers=this.responseHandlers.filter(t=>t!==e)}}async processRequest(e,t){let r=t;for(const s of this.requestHandlers)r=await s(e,r);return r}async processResponse(e,t){let r=t;for(const s of this.responseHandlers)r=await s(e,r);return r}},xt=new Gn;function zn(){typeof window>"u"||(window.__inertia_interceptors__=xt)}var Te=class De{callbacks=[];params;constructor(t){if(!t.prefetch)this.params=t;else{const r={onBefore:this.wrapCallback(t,"onBefore"),onBeforeUpdate:this.wrapCallback(t,"onBeforeUpdate"),onStart:this.wrapCallback(t,"onStart"),onProgress:this.wrapCallback(t,"onProgress"),onFinish:this.wrapCallback(t,"onFinish"),onCancel:this.wrapCallback(t,"onCancel"),onSuccess:this.wrapCallback(t,"onSuccess"),onError:this.wrapCallback(t,"onError"),onHttpException:this.wrapCallback(t,"onHttpException"),onNetworkError:this.wrapCallback(t,"onNetworkError"),onFlash:this.wrapCallback(t,"onFlash"),onCancelToken:this.wrapCallback(t,"onCancelToken"),onPrefetched:this.wrapCallback(t,"onPrefetched"),onPrefetching:this.wrapCallback(t,"onPrefetching")};this.params={...t,...r,onPrefetchResponse:t.onPrefetchResponse||(()=>{}),onPrefetchError:t.onPrefetchError||(()=>{})}}}static create(t){return new De(t)}data(){return this.params.method==="get"?null:this.params.data}queryParams(){return this.params.method==="get"?this.params.data:{}}isPartial(){return this.params.only.length>0||this.params.except.length>0||this.params.reset.length>0}isPrefetch(){return this.params.prefetch===!0}isDeferredPropsRequest(){return this.params.deferredProps===!0}isPollRequest(){return this.params.poll===!0}onCancelToken(t){this.params.onCancelToken({cancel:t})}markAsFinished(){this.params.completed=!0,this.params.cancelled=!1,this.params.interrupted=!1}markAsCancelled({cancelled:t=!0,interrupted:r=!1}){this.params.onCancel(),this.params.completed=!1,this.params.cancelled=t,this.params.interrupted=r}wasCancelledAtAll(){return this.params.cancelled||this.params.interrupted}onFinish(){this.params.onFinish(this.params)}onStart(){this.params.onStart(this.params)}onPrefetching(){this.params.onPrefetching(this.params)}onPrefetchResponse(t){this.params.onPrefetchResponse&&this.params.onPrefetchResponse(t)}onPrefetchError(t){this.params.onPrefetchError&&this.params.onPrefetchError(t)}all(){return this.params}headers(){const t={...this.params.headers};this.isPartial()&&(t["X-Inertia-Partial-Component"]=u.get().component);const r=this.params.only.concat(this.params.reset);return r.length>0&&(t["X-Inertia-Partial-Data"]=r.join(",")),this.params.except.length>0&&(t["X-Inertia-Partial-Except"]=this.params.except.join(",")),this.params.reset.length>0&&(t["X-Inertia-Reset"]=this.params.reset.join(",")),this.params.errorBag&&this.params.errorBag.length>0&&(t["X-Inertia-Error-Bag"]=this.params.errorBag),t}setPreserveOptions(t){this.params.preserveScroll=De.resolvePreserveOption(this.params.preserveScroll,t),this.params.preserveState=De.resolvePreserveOption(this.params.preserveState,t)}runCallbacks(){this.callbacks.forEach(({name:t,args:r})=>{this.params[t](...r)})}merge(t){this.params={...this.params,...t}}wrapCallback(t,r){return(...s)=>{this.recordCallback(r,s),t[r](...s)}}recordCallback(t,r){this.callbacks.push({name:t,args:r})}static resolvePreserveOption(t,r){return typeof t=="function"?t(r):t==="errors"?Object.keys(r.props.errors||{}).length>0:t}},Jn={createIframeAndPage(e){typeof e=="object"&&(e=`All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.<hr>${JSON.stringify(e)}`);const t=document.createElement("html");t.innerHTML=e,t.querySelectorAll("a").forEach(s=>s.setAttribute("target","_top"));const r=document.createElement("iframe");return r.style.backgroundColor="white",r.style.borderRadius="5px",r.style.width="100%",r.style.height="100%",r.setAttribute("sandbox","allow-scripts"),{iframe:r,page:t}},show(e){const{iframe:t,page:r}=this.createIframeAndPage(e);t.style.boxSizing="border-box",t.style.display="block";const s=document.createElement("dialog");s.id="inertia-error-dialog",Object.assign(s.style,{width:"calc(100vw - 100px)",height:"calc(100vh - 100px)",padding:"0",margin:"auto",border:"none",backgroundColor:"transparent"});const n=document.createElement("style");n.textContent=` 3 dialog#inertia-error-dialog::backdrop { 4 background-color: rgba(0, 0, 0, 0.6); 5 } 6 7 dialog#inertia-error-dialog:focus { 8 outline: none; 9 } 10 `;const a=le.get("nonce");a&&(n.nonce=a),document.head.appendChild(n),s.addEventListener("click",i=>{i.target===s&&s.close()}),s.addEventListener("close",()=>{n.remove(),s.remove()}),s.appendChild(t),document.body.prepend(s),s.showModal(),s.focus(),t.srcdoc=r.outerHTML}},Qt=(e,t)=>
10e===t||e.startsWith(`${t}.`),Yn=(e,t)=>{const{only:r,except:s}=e;return!(r.length===0&&s.length===0||r.length>0&&!r.some(n=>Qt(t,n))||s.length>0&&s.some(n=>Qt(t,n)))},Zn=new Qe,Gt=class Mr{constructor(t,r,s){this.requestParams=t,this.response=r,this.originatingPage=s}requestParams;response;originatingPage;wasPrefetched=!1;processed=!1;static create(t,r,s){return new Mr(t,r,s)}isProcessed(){return this.processed}async handlePrefetch(){We(this.requestParams.all().url,window.location)&&this.handle()}async handle(){return Zn.add(()=>this.process())}async process(){if(this.requestParams.all().prefetch)return this.wasPrefetched=!0,this.requestParams.all().prefetch=!1,this.requestParams.all().onPrefetched(this.response,this.requestParams.all()),ln(this.response,this.requestParams.all()),Promise.resolve();if(this.requestParams.runCallbacks(),this.processed=!0,!this.isInertiaResponse())return this.handleNonInertiaResponse();if(this.isHttpException()){const s={...this.response,data:this.getDataFromResponse(this.response.data)};if(this.requestParams.all().onHttpException(s)===!1||!Bt(s))return}await S.processQueue(),S.preserveUrl=this.requestParams.all().preserveUrl,await this.setPage();const{flash:t}=u.get();Object.keys(t).length>0&&!this.requestParams.isDeferredPropsRequest()&&(Me(t),this.requestParams.all().onFlash(t));const r=u.get().props.errors||{};if(Object.keys(r).length>0){const s=this.getScopedErrors(r);return en(s,{page:u.get(),visitId:this.requestParams.all().id}),this.requestParams.all().onError(s)}B.flushByCacheTags(this.requestParams.all().invalidateCacheTags||[]),this.wasPrefetched||B.flush(u.get().url),cn(u.get(),{visitId:this.requestParams.all().id}),await this.requestParams.all().onSuccess(u.get()),S.preserveUrl=!1}mergeParams(t){this.requestParams.merge(t)}getPageResponse(){const t=this.getDataFromResponse(this.response.data);return typeof t=="object"?this.response.data={...t,flash:t.flash??{},rescuedProps:t.rescuedProps??[]}:this.response.data=t}async handleNonInertiaResponse(){if(this.isInertiaRedirect()){B.visit(this.getHeader("x-inertia-redirect"),{...this.requestParams.all(),method:"get",data:{}});return}if(this.isLocationVisit()){const r=z(this.getHeader("x-inertia-location"));return $t(this.requestParams.all().url,r),this.locationVisit(r)}const t={...this.response,data:this.getDataFromResponse(this.response.data)};if(this.requestParams.all().onHttpException(t)!==!1&&Bt(t))return Jn.show(t.data)}isInertiaResponse(){return this.hasHeader("x-inertia")}isHttpException(){return this.response.status>=400}hasStatus(t){return this.response.status===t}getHeader(t){return this.response.headers[t]}hasHeader(t){return this.getHeader(t)!==void 0}isInertiaRedirect(){return this.hasStatus(409)&&this.hasHeader("x-inertia-redirect")}isLocationVisit(){return this.hasStatus(409)&&this.hasHeader("x-inertia-location")}locationVisit(t){try{if(typeof window>"u")return;const r=this.getHeader("x-inertia-version"),s=!!r&&r!==u.get().version;if(!fn(t,s)||s&&this.requestParams.all().async)return;k.set(k.locationVisitKey,{preserveScroll:this.requestParams.all().preserveScroll===!0}),We(window.location,t)?window.location.reload():window.location.href=t.href}catch{return!1}}async setPage(){const t=this.getPageResponse();return this.shouldSetPage(t)?(this.response=await xt.processResponse(this.requestParams.all(),this.response),this.mergeProps(t),u.mergeOncePropsIntoResponse(t),this.preserveOptimisticProps(t),this.preserveEqualProps(t),await this.setRememberedState(t),this.requestParams.setPreserveOptions(t),t.url=S.preserveUrl?u.get().url:this.pageUrl(t),this.requestParams.all().onBeforeUpdate(t),sn(t),u.set(t,{replace:this.requestParams.all().replace,preserveScroll:this.requestParams.all().preserveScroll,preserveState:this.requestParams.all().preserveState,viewTransition:this.requestParams.all().viewTransition,cached:this.requestParams.all().cached,visitId:this.requestParams.all().id})):Promise.resolve()}getDataFromResponse(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}
10shouldSetPage(t){if(!this.requestParams.all().async||this.originatingPage.component!==t.component)return!0;if(this.originatingPage.component!==u.get().component)return!1;const r=z(this.originatingPage.url),s=z(u.get().url);return r.origin===s.origin&&r.pathname===s.pathname}pageUrl(t){const r=z(t.url);return t.preserveFragment?r.hash=this.requestParams.all().url.hash:$t(this.requestParams.all().url,r),r.pathname+r.search+r.hash}preserveOptimisticProps(t){if(B.hasPendingOptimistic())for(const r of Object.keys(t.props))u.hasBaseline(r)&&(u.updateBaseline(r,t.props[r]),t.props[r]=u.get().props[r])}preserveEqualProps(t){if(t.component!==u.get().component)return;const r=u.get().props;Object.entries(t.props).forEach(([s,n])=>{ne(n,r[s])&&(t.props[s]=r[s])})}mergeProps(t){if(!this.requestParams.isPartial()||t.component!==u.get().component)return;const r=t.mergeProps||[],s=t.prependProps||[],n=t.deepMergeProps||[],a=t.matchPropsOn||[],i=(h,f)=>{const l=T(u.get().props,h),p=T(t.props,h);if(Array.isArray(p)){const d=this.mergeOrMatchItems(l||[],p,h,a,f);ie(t.props,h,d)}else if(typeof p=="object"&&p!==null){const d={...l||{},...p};ie(t.props,h,d)}};r.forEach(h=>i(h,!0)),s.forEach(h=>i(h,!1)),n.forEach(h=>{const f=T(u.get().props,h),l=T(t.props,h),p=(d,m,b)=>Array.isArray(m)?this.mergeOrMatchItems(d,m,b,a):typeof m=="object"&&m!==null?Object.keys(m).reduce((g,v)=>(g[v]=p(d?d[v]:void 0,m[v],`${b}.${v}`),g),{...d}):m;ie(t.props,h,p(f,l,h))});const o=new Set([...this.requestParams.all().only,...this.requestParams.all().except].filter(h=>h.includes(".")).map(h=>h.split(".")[0]));for(const h of o){const f=u.get().props[h];this.isObject(f)&&this.isObject(t.props[h])&&(t.props[h]=this.deepMergeObjects(f,t.props[h]))}t.props={...u.get().props,...t.props},this.shouldPreserveErrors(t)&&(t.props.errors=u.get().props.errors),u.get().scrollProps&&(t.scrollProps={...u.get().scrollProps||{},...t.scrollProps||{}}),u.hasOnceProps()&&(t.onceProps={...u.get().onceProps||{},...t.onceProps||{}}),this.requestParams.isDeferredPropsRequest()&&(t.flash={...u.get().flash});const c=u.get().initialDeferredProps;c&&Object.keys(c).length>0&&(t.initialDeferredProps=c),t.rescuedProps=this.mergeRescuedProps(t)}mergeRescuedProps(t){const r=u.get().rescuedProps??[],s=t.rescuedProps??[],n=new Set(r.filter(a=>!Yn(this.requestParams.all(),a)));return s.forEach(a=>n.add(a)),Array.from(n)}shouldPreserveErrors(t){if(!this.requestParams.all().preserveErrors)return!1;const r=u.get().props.errors;if(!r||Object.keys(r).length===0)return!1;const s=t.props.errors;return!(s&&Object.keys(s).length>0)}isObject(t){return t&&typeof t=="object"&&!Array.isArray(t)}deepMergeObjects(t,r){const s={...t};for(const n of Object.keys(r)){const a=t[n],i=r[n];this.isObject(a)&&this.isObject(i)?s[n]=this.deepMergeObjects(a,i):s[n]=i}return s}mergeOrMatchItems(t,r,s,n,a=!0){const i=Array.isArray(t)?t:[],o=n.find(f=>f.split(".").slice(0,-1).join(".")===s);if(!o)return a?[...i,...r]:[...r,...i];const c=o.split(".").pop()||"",h=new Map;return r.forEach(f=>{this.hasUniqueProperty(f,c)&&h.set(f[c],f)}),a?this.appendWithMatching(i,r,h,c):this.prependWithMatching(i,r,h,c)}appendWithMatching(t,r,s,n){const a=t.map(o=>this.hasUniqueProperty(o,n)&&s.has(o[n])?s.get(o[n]):o),i=r.filter(o=>this.hasUniqueProperty(o,n)?!t.some(c=>this.hasUniqueProperty(c,n)&&c[n]===o[n]):!0);return[...a,...i]}prependWithMatching(t,r,s,n){const a=t.filter(i=>this.hasUniqueProperty(i,n)?!s.has(i[n]):!0);return[...r,...a]}hasUniqueProperty(t,r){return t&&typeof t=="object"&&r in t}async setRememberedState(t){const r=await S.getState(S.rememberedState,{});this.requestParams.all().preserveState&&r&&t.component===u.get().component&&(t.rememberedState=r)}getScopedErrors(t){return this.requestParams.all().errorBag?t[this.requestParams.all().errorBag||""]||{}:t}},zt=class _r{constructor(t,r,{optimistic:s=!1}={}){this.page=r,this.requestParams=Te.create(t),this.cancelToken=new AbortController,this.optimistic=s}page;response;cancelToken;requestParams;requestHasFinished=!1;optimistic;static create(t,r,s){return new _r(t,r,s)}
10isPrefetch(){return this.requestParams.isPrefetch()}isOptimistic(){return this.optimistic}isPendingOptimistic(){return this.isOptimistic()&&(!this.response||!this.response.isProcessed())}async send(){this.requestParams.onCancelToken(()=>this.cancel({cancelled:!0})),an(this.requestParams.all()),this.requestParams.onStart(),this.requestParams.all().prefetch&&(this.requestParams.onPrefetching(),un(this.requestParams.all()));const t=this.requestParams.all().prefetch,r={method:this.requestParams.all().method,url:_e(this.requestParams.all().url).href,data:this.requestParams.data(),signal:this.cancelToken.signal,headers:this.getHeaders(),onUploadProgress:this.onProgress.bind(this)},s=await xt.processRequest(this.requestParams.all(),r);return Br.getClient().request(s).then(n=>(this.response=Gt.create(this.requestParams,n,this.page),this.response.handle())).catch(n=>n instanceof ht?(this.response=Gt.create(this.requestParams,n.response,this.page),this.response.handle()):Promise.reject(n)).catch(n=>{if(!(n instanceof dt)&&this.requestParams.all().onNetworkError(n)!==!1&&tn(n))return t&&this.requestParams.onPrefetchError(n),Promise.reject(n)}).finally(()=>{this.finish(),t&&this.response&&this.requestParams.onPrefetchResponse(this.response)})}finish(){this.requestParams.wasCancelledAtAll()||(this.requestParams.markAsFinished(),this.fireFinishEvents())}fireFinishEvents(){this.requestHasFinished||(this.requestHasFinished=!0,rn(this.requestParams.all()),this.requestParams.onFinish())}cancel({cancelled:t=!1,interrupted:r=!1}){this.requestHasFinished||(this.cancelToken.abort(),this.requestParams.markAsCancelled({cancelled:t,interrupted:r}),this.fireFinishEvents())}onProgress(t){this.requestParams.data()instanceof FormData&&(on(t),this.requestParams.all().onProgress(t))}getHeaders(){const t={...this.requestParams.headers(),Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0},r=u.get();r.version&&(t["X-Inertia-Version"]=r.version);const s=Object.entries(r.onceProps||{}).filter(([,n])=>T(r.props,n.prop)===void 0?!1:!n.expiresAt||n.expiresAt>Date.now()).map(([n])=>n);return s.length>0&&(t["X-Inertia-Except-Once-Props"]=s.join(",")),t}},Jt=class{requests=[];maxConcurrent;interruptible;constructor({maxConcurrent:e,interruptible:t}){this.maxConcurrent=e,this.interruptible=t}send(e){this.requests.push(e),e.send().finally(()=>{this.requests=this.requests.filter(t=>t!==e)})}interruptInFlight(){this.cancel({interrupted:!0},!1)}cancelInFlight({prefetch:e=!0,optimistic:t=!0}={}){this.requests.filter(r=>e||!r.isPrefetch()).filter(r=>t||!r.isOptimistic()).forEach(r=>r.cancel({cancelled:!0}))}cancel({cancelled:e=!1,interrupted:t=!1}={},r=!1){!r&&!this.shouldCancel()||this.requests.shift()?.cancel({cancelled:e,interrupted:t})}shouldCancel(){return this.interruptible&&this.requests.length>=this.maxConcurrent}hasPendingOptimistic(){return this.requests.some(e=>e.isPendingOptimistic())}},L=()=>{},ei=class{syncRequestStream=new Jt({maxConcurrent:1,interruptible:!0});asyncRequestStream=new Jt({maxConcurrent:1/0,interruptible:!1});clientVisitQueue=new Qe;pendingOptimisticCallback=void 0;init({initialPage:e,resolveComponent:t,swapComponent:r,onFlash:s}){u.init({initialPage:e,resolveComponent:t,swapComponent:r,onFlash:s}),Un.handle(),G.init(),G.on("missingHistoryItem",()=>{typeof window<"u"&&this.visit(window.location.href,{preserveState:!0,preserveScroll:!0,replace:!0})}),G.on("loadDeferredProps",n=>{this.loadDeferredProps(n)}),G.on("historyQuotaExceeded",n=>{window.location.href=n})}optimistic(e){return this.pendingOptimisticCallback=e,this}get(e,t={},r={}){return this.visit(e,{...r,method:"get",data:t})}post(e,t={},r={}){return this.visit(e,{preserveState:!0,...r,method:"post",data:t})}put(e,t={},r={}){return this.visit(e,{preserveState:!0,...r,method:"put",data:t})}patch(e,t={},r={}){return this.visit(e,{preserveState:!0,...r,method:"patch",data:t})}delete(e,t={}){return this.visit(e,{preserveState:!0,...t,method:"delete"})}reload(e={}){return this.doReload(e)}doReload(e={}){if(!(typeof window>"u"))return this.visit(window.location.href,{...e,preserveScroll:!0,preserveState:!0,async:!0,headers:{...e.headers||{},"Cache-Control":"no-cache"}})}remember(e,t="default"){S.remember(e,t)}restore(e="default"){return S.restore(e)}on(e,t){return typeof window>"u"?()=>{}:G.onGlobalEvent(e,t)}once(e,t){if(typeof window>"u")return()=>{};const r=this.on(e,s=>(r(),t(s)));return r}hasPendingOptimistic(){return this.asyncRequestStream.hasPendingOptimistic()}get activePolls(){return Xt.count}cancelAll({async:e=!0,prefetch:t=!0,sync:r=!0}={}){e&&this.asyncRequestStream.cancelInFlight({prefetch:t}),r&&this.syncRequestStream.cancelInFlight()}poll(e,t={},r={}){return Xt.add(e,({onStart:s,onFinish:n})=>{const a=typeof t=="function"?t():t;this.doReload({poll:!0,preserveErrors:!0,...a,onCancelToken:i=>{s(i.cancel),a.onCancelToken?.(i)},onFinish:i=>{n(),a.onFinish?.(i)}})},{autoStart:r.autoStart??!0,keepAlive:r.keepAlive??!1,mode:r.mode})}visit(e,t={}){t.optimistic=t.optimistic??this.pendingOptimisticCallback,this.pendingOptimisticCallback=void 0,t.optimistic&&(t.async=t.async??!0);const r=this.getPendingVisit(e,{...t,showProgress:t.showProgress??(!t.async||!!t.optimistic)}),s=this.getVisitEvents(t);if(s.onBefore(r)===!1||!Nt(r))return;const n=z(u.get().url);(r.only.length>0||r.except.length>0||r.reset.length>0?Cn(r.url,n):We(r.url,n))||this.asyncRequestStream.cancelInFlight({prefetch:!1,optimistic:!1}),r.async||this.syncRequestStream.interruptInFlight(),t.optimistic&&this.applyOptimisticUpdate(t.optimistic,s),!u.isCleared()&&!r.preserveUrl&&U.save();const a={...r,...s},i=()=>{const o=Q.get(a);o?(_.reveal(o.inFlight),Q.use(o,a)):(_.reveal(!0),(r.async?this.asyncRequestStream:this.syncRequestStream).send(zt.create(a,u.get(),{optimistic:!!t.optimistic})))};Array.isArray(r.component)&&(console.error(`The "component" prop received an array of components (${r.component.join(", ")}), but only a single component string is supported for instant visits. Pass an explicit component name instead.`),r.component=null),r.component?S.processQueue().then(()=>{this.performInstantSwap(r).then(()=>{a.preserveScroll=!0,a.preserveState=!0,a.replace=!0,a.viewTransition=!1,i()})}):i()}getCached(e,t={}){return Q.findCached(this.getPrefetchParams(e,t))}flush(e,t={}){Q.remove(this.getPrefetchParams(e,t))}flushAll(){Q.removeAll()}flushByCacheTags(e){Q.removeByTags(Array.isArray(e)?e:[e])}getPrefetching(e,t={}
10){return Q.findInFlight(this.getPrefetchParams(e,t))}prefetch(e,t={},r={}){if((t.method??(te(e)?e.method:"get"))!=="get")throw new Error("Prefetch requests must use the GET method");const s=this.getPendingVisit(e,{...t,async:!0,showProgress:!1,prefetch:!0,viewTransition:!1});if(s.url.origin+s.url.pathname+s.url.search===window.location.origin+window.location.pathname+window.location.search)return;const n=this.getVisitEvents(t);if(n.onBefore(s)===!1||!Nt(s))return;_.hide(),this.asyncRequestStream.interruptInFlight();const a={...s,...n};new Promise(o=>{const c=()=>{u.get()?o():setTimeout(c,50)};c()}).then(()=>{Q.add(a,o=>{this.asyncRequestStream.send(zt.create(o,u.get()))},{cacheFor:le.get("prefetch.cacheFor"),cacheTags:[],...r})})}clearHistory(){S.clear()}decryptHistory(){return S.decrypt()}resolveComponent(e,t){return u.resolve(e,t)}replace(e){this.clientVisit(e,{replace:!0})}replaceProp(e,t,r){this.replace({preserveScroll:!0,preserveState:!0,props(s){const n=typeof t=="function"?t(T(s,e),s):t;return ie(X(s),e,n)},...r||{}})}appendToProp(e,t,r){this.replaceProp(e,(s,n)=>{const a=typeof t=="function"?t(s,n):t;return Array.isArray(s)||(s=s!==void 0?[s]:[]),[...s,a]},r)}prependToProp(e,t,r){this.replaceProp(e,(s,n)=>{const a=typeof t=="function"?t(s,n):t;return Array.isArray(s)||(s=s!==void 0?[s]:[]),[a,...s]},r)}push(e){this.clientVisit(e)}flash(e,t){const r=u.get().flash;let s;if(typeof e=="function")s=e(r);else if(typeof e=="string")s={...r,[e]:t};else if(e&&Object.keys(e).length)s={...r,...e};else return;u.setFlash(s),Object.keys(s).length&&Me(s)}clientVisit(e,{replace:t=!1}={}){this.clientVisitQueue.add(()=>this.performClientVisit(e,{replace:t}))}performClientVisit(e,{replace:t=!1}={}){const r=u.get(),s=typeof e.props=="function"?Object.fromEntries(Object.values(r.onceProps??{}).map(g=>[g.prop,T(r.props,g.prop)])):{},n=typeof e.props=="function"?e.props(r.props,s):e.props??r.props,a=typeof e.flash=="function"?e.flash(r.flash):e.flash,{viewTransition:i,onError:o,onFinish:c,onFlash:h,onSuccess:f,...l}=e,p={...r,...l,flash:a??{},props:n},d=Te.resolvePreserveOption(e.preserveScroll??!1,p),m=Te.resolvePreserveOption(e.preserveState??!1,p),b=this.createVisitId();return u.set(p,{replace:t,preserveScroll:d,preserveState:m,viewTransition:i,visitId:b}).then(()=>{nn(u.get(),{replace:t,visitId:b});const g=u.get().flash;Object.keys(g).length>0&&(Me(g),h?.(g));const v=u.get().props.errors||{};if(Object.keys(v).length===0){f?.(u.get());return}const y=e.errorBag?v[e.errorBag||""]||{}:v;o?.(y)}).finally(()=>c?.(e))}performInstantSwap(e){const t=u.get(),r=Object.fromEntries((t.sharedProps??[]).filter(i=>i in t.props).map(i=>[i,t.props[i]])),s=typeof e.pageProps=="function"?e.pageProps(X(t.props),X(r)):e.pageProps,n=s!==null?{...s}:{...r},a={component:e.component,url:e.url.pathname+e.url.search+e.url.hash,version:t.version,props:{...n,errors:{}},flash:{},rescuedProps:[],clearHistory:!1,encryptHistory:t.encryptHistory,sharedProps:t.sharedProps,rememberedState:{}};return u.set(a,{replace:e.replace,preserveScroll:Te.resolvePreserveOption(e.preserveScroll,a),preserveState:!1,viewTransition:e.viewTransition,visitId:e.id})}getPrefetchParams(e,t){return{...this.getPendingVisit(e,{...t,async:!0,showProgress:!1,prefetch:!0,viewTransition:!1}),...this.getVisitEvents(t)}}createVisitId(){return je()}getPendingVisit(e,t){if(te(e)){const c=e;e=c.url,t.method=t.method??c.method}const r=le.get("visitOptions"),s=r?r(e.toString(),X(t))||{}:{},n={method:"get",data:{},replace:!1,preserveScroll:!1,preserveState:!1,only:[],except:[],headers:{},errorBag:"",forceFormData:!1,queryStringArrayFormat:"brackets",async:!1,showProgress:!0,fresh:!1,reset:[],preserveUrl:!1,preserveErrors:!1,prefetch:!1,invalidateCacheTags:[],viewTransition:!1,component:null,pageProps:null,cached:!1,...Mt(t),...Mt(s)},[a,i]=Hn(e,n.data,n.method,n.forceFormData,n.queryStringArrayFormat),o={id:this.createVisitId(),cancelled:!1,completed:!1,interrupted:!1,...n,url:a,data:i};return o.prefetch&&(o.headers.Purpose="prefetch"),o}getVisitEvents(e){return{onCancelToken:e.onCancelToken||L,onBefore:e.onBefore||L,onBeforeUpdate:e.onBeforeUpdate||L,onStart:e.onStart||L,onProgress:e.onProgress||L,onFinish:e.onFinish||L,onCancel:e.onCancel||L,onSuccess:e.onSuccess||L,onError:e.onError||L,onHttpException:e.onHttpException||L,onNetworkError:e.onNetworkError||L,onFlash:e.onFlash||L,onPrefetched:e.onPrefetched||L,onPrefetching:e.onPrefetching||L}}applyOptimisticUpdate(e,t){const r=u.get().props,s=e(X(r));if(!s)return;const n=[];for(const f of Object.keys(s))ne(r[f],s[f])||n.push(f);if(n.length===0)return;const a=u.nextOptimisticId(),i=u.get().component;for(const f of n)u.setBaseline(f,X(r[f]));u.registerOptimistic(a,e),u.setPropsQuietly({...r,...s});let o=!0;const c=t.onSuccess;t.onSuccess=f=>(o=!1,c(f));const h=t.onFinish;t.onFinish=f=>{if(u.unregisterOptimistic(a),o&&u.get().component===i){const l=u.replayOptimistics();Object.keys(l).length>0&&u.setPropsQuietly({...u.get().props,...l})}return u.pendingOptimisticCount()===0&&u.clearOptimisticState(),h(f)}}loadDeferredProps(e){e&&Object.values(e).forEach(t=>{this.doReload({only:t,deferredProps:!0,preserveErrors:!0})})}},ye="server";function ti(e,t){return e.match(/\sdata-inertia(=|\s|>)/)?e:e.replace(/^<([a-zA-Z][^\s/>]*)/,`<$1 data-inertia="server-head-${t}"`)}function xe(e,t){if(!t)return[];const r=typeof t=="function"?t(e):e.props[t===!0?"head":t];return Array.isArray(r)?r.map(s=>typeof s=="string"?s.trim():s).filter(s=>typeof s=="string"&&s.length>0).map(ti):[]}var ri={buildDOMElement(e){const t=document.createElement("template");t.innerHTML=e;const r=t.content.firstChild;if(!e.startsWith("<script "))return r;const s=document.createElement("script");
10return s.innerHTML=r.innerHTML,r.getAttributeNames().forEach(n=>{s.setAttribute(n,r.getAttribute(n)||"")}),s},isInertiaManagedElement(e){return e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("data-inertia")!==null},findMatchingElementIndex(e,t){const r=e.getAttribute("data-inertia");return r!==null?t.findIndex(s=>s.getAttribute("data-inertia")===r):-1},update:ct(function(e){const t=e.map(s=>this.buildDOMElement(s)),r=Array.from(document.head.childNodes).filter(s=>this.isInertiaManagedElement(s));t.some(s=>s instanceof HTMLTitleElement)&&document.head.querySelectorAll("title:not([data-inertia])").forEach(s=>s.remove()),r.forEach(s=>{const n=this.findMatchingElementIndex(s,t);if(n===-1){s.remove();return}const a=t.splice(n,1)[0];a&&!s.isEqualNode(a)&&s.replaceWith(a)}),t.forEach(s=>{document.head.appendChild(s)})},1)};function si(e,t,r,s=[]){const n=s.length?{[ye]:s}:{};let a=0;function i(){const d=a+=1;return n[d]=[],d.toString()}function o(d){d===null||Object.keys(n).indexOf(d)===-1||(delete n[d],p())}function c(d){Object.keys(n).indexOf(d)===-1&&(n[d]=[])}function h(d,m=[]){d!==null&&Object.keys(n).indexOf(d)>-1&&(n[d]=m),p()}function f(d=[]){d.length?n[ye]=d:delete n[ye],p()}function l(){const d=t(""),m=n[ye]||[],b=Object.keys(n).filter(y=>y!==ye).flatMap(y=>n[y]),g={...d?{title:`<title data-inertia="">${d}</title>`}:{}},v=m.concat(b).reduce((y,w)=>{if(w.indexOf("<")===-1)return y;if(w.indexOf("<title ")===0){const F=w.match(/(<title [^>]+>)(.*?)(<\/title>)/s);return y.title=F?`${F[1]}${t(F[2])}${F[3]}`:w,y}const O=w.match(/ data-inertia=(["'])[^"']+\1/);return O?y[O[0]]=w:y[Object.keys(y).length]=w,y},g);return Object.values(v)}function p(){e?r(l()):ri.update(l())}return p(),{forceUpdate:p,updateServerHead:f,createProvider:function(){const d=i();return{reconnect:()=>c(d),update:m=>h(d,m),disconnect:()=>o(d)}}}}var qi=new Qe;function ni(){let e={},t={},r={shared:e,named:t};const s=new Set;let n=!1;const a=()=>{r={shared:e,named:t}},i=()=>{n||(n=!0,queueMicrotask(()=>{n=!1,s.forEach(o=>o())}))};return{set(o){const c={...e,...o};ne(e,c)||(e=c,a(),i())},setFor(o,c){const h=t[o]||{},f={...h,...c};ne(h,f)||(t={...t,[o]:f},a(),i())},reset(){e={},t={},a(),i()},subscribe(o){return s.add(o),()=>s.delete(o)},get:()=>r}}function Ee(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Rt(e){return Ee(e)&&"component"in e}function It(e,t){return"component"in e&&t(e.component)}function Wr(e,t){return!Ee(e)||t(e)||It(e,t)?!1:Object.values(e).every(r=>t(r)||Array.isArray(r)&&t(r[0])||Rt(r)&&t(r.component))}function $r(e,t){return Ee(e)&&!t(e)&&!It(e,t)&&!Wr(e,t)}function ii(e,t){if($r(e,t))return!0;if(!Ee(e)||t(e)||It(e,t))return!1;const r=Object.values(e);return r.length>0&&r.every(s=>typeof s=="function")}function oi(e,t){return Array.isArray(e)&&e.length===2&&t(e[0])&&Ee(e[1])&&!t(e[1])}function Yt(e,t){if(Array.isArray(e)&&t(e[0]))return{component:e[0],props:e[1]??{}};if(Rt(e)&&t(e.component))return{component:e.component,props:e.props??{}};if(t(e))return{component:e,props:{}};throw new Error(`Invalid layout definition: received ${typeof e}`)}function ai(e,t,r){return!e||r&&r(e)?[]:Wr(e,t)?Object.entries(e).map(([s,n])=>({...Yt(n,t),name:s})):oi(e,t)?[{component:e[0],props:e[1]??{}}]:Array.isArray(e)?e.map(s=>Yt(s,t)):Rt(e)&&t(e.component)?[{component:e.component,props:e.props??{}}]:t(e)?[{component:e,props:{}}]:[]}function Vr(e){return e.target instanceof HTMLElement&&e.target.isContentEditable||e.defaultPrevented}function Re(e){const t=e.currentTarget.tagName.toLowerCase()==="a",r=t?e.currentTarget.target:"";return!(Vr(e)||t&&e.altKey||t&&e.ctrlKey||t&&e.metaKey||t&&e.shiftKey||t&&r!==""&&r!=="_self"||t&&"button"in e&&e.button!==0)}function Zt(e){const t=e.currentTarget.tagName.toLowerCase()==="button";return!Vr(e)&&(e.key==="Enter"||t&&e.key===" ")}var R="nprogress",oe,x,j={minimum:.08,easing:"linear",speed:200,trickle:!0,trickleSpeed:200,showSpinner:!0,barSelector:'.bar, [role="bar"]',spinnerSelector:'.spinner, [role="spinner"]',parent:"body",color:"#29d",includeCSS:!0,popover:null,template:['<div class="bar">','<div class="peg"></div>',"</div>",'<div class="spinner">','<div class="spinner-icon"></div>',"</div>"].join("")},re=null,$e=!1,ci=e=>{Object.assign(j,e),oe=j.popover??"popover"in HTMLElement.prototype,j.includeCSS&&di(j.color),x=document.createElement("div"),x.id=R,x.setAttribute("aria-hidden","true"),x.innerHTML=j.template,oe&&(x.popover="manual")},Ge=e=>{const t=Xr();e=Jr(e,j.minimum,1),re=e===1?null:e;const r=ui(!t),s=r.querySelector(j.barSelector),n=j.speed,a=j.easing;r.offsetWidth,hi(i=>{const o={transition:`all ${n}ms ${a}`,transform:`translate3d(${Yr(e)}%,0,0)`};for(const c in o)s.style[c]=o[c];if(e!==1)return setTimeout(i,n);r.style.transition="none",r.style.opacity="1",r.offsetWidth,setTimeout(()=>{r.style.transition=`all ${n}ms linear`,r.style.opacity="0",setTimeout(()=>{zr(),r.style.transition="",r.style.opacity="",i()},n)},n)})},Xr=()=>typeof re=="number",Kr=()=>{re||Ge(0);const e=function(){setTimeout(function(){re&&(Qr(),e())},j.trickleSpeed)};j.trickle&&e()},li=e=>{!e&&!re||(Qr(.3+.5*Math.random()),Ge(1))},Qr=e=>{const t=re;if(t===null)return Kr();if(!(t>1))return e=typeof e=="number"?e:(()=>{const r={.1:[0,.2],.04:[.2,.5],.02:[.5,.8],.005:[.8,.99]};for(const s in r)if(t>=r[s][0]&&t<r[s][1])return parseFloat(s);return 0})(),Ge(Jr(t+e,0,.994))},ui=e=>{if(fi())return document.getElementById(R);document.documentElement.classList.add(`${R}-busy`);const t=x.querySelector(j.barSelector),r=e?"-100":Yr(re||0);if(t.style.transition="all 0 linear",t.style.transform=`translate3d(${r}%,0,0)`,j.showSpinner||x.querySelector(j.spinnerSelector)?.remove(),oe)document.body.appendChild(x),$e||x.showPopover();else{const s=Gr();s!==document.body&&s.classList.add(`${R}-custom-parent`),s.appendChild(x),$e&&(x.style.display="none")}return x},Gr=()=>document.querySelector(j.parent),zr=()=>{if(document.documentElement.classList.remove(`${R}-busy`),oe&&x?.isConnected)try{x.hidePopover()}catch{}oe||Gr().classList.remove(`${R}-custom-parent`),x?.remove()},fi=()=>document.getElementById(R)!==null;function Jr(e,t,r){return e<t?t:e>r?r:e}var Yr=e=>(-1+e)*100,hi=(()=>{const e=[],t=()=>{const r=e.shift();r&&r(t)};return r=>{e.push(r),e.length===1&&t()}})(),di=e=>{const t=document.createElement("style"),r=le.get("nonce");r&&(t.nonce=r),t.textContent=` 11 #${R} { 12 pointer-events: none; 13 background: none; 14 border: none; 15 margin: 0; 16 padding: 0; 17 overflow: visible; 18 inset: unset; 19 width: 100%; 20 height: 0; 21 position: fixed; 22 top: 0; 23 left: 0; 24 } 25 26 #${R}::backdrop { 27 display: none; 28 } 29 30 #${R} .bar { 31 background: ${e}; 32 33 position: fixed; 34 z-index: 1031; 35 top: 0; 36 left: 0; 37 38 width: 100%; 39 height: 2px; 40 } 41 42 #${R} .peg { 43 display: block; 44 position: absolute; 45 right: 0px; 46 width: 100px; 47 height: 100%; 48 box-shadow: 0 0 10px ${e}, 0 0 5px ${e}; 49 opacity: 1.0; 50 51 transform: rotate(3deg) translate(0px, -4px); 52 } 53 54 #${R} .spinner { 55 display: block; 56 position: fixed; 57 z-index: 1031; 58 top: 15px; 59 right: 15px; 60 } 61 62 #${R} .spinner-icon { 63 width: 18px; 64 height: 18px; 65 box-sizing: border-box; 66 67 border: solid 2px transparent; 68 border-top-color: ${e}; 69 border-left-color: ${e}; 70 border-radius: 50%; 71 72 animation: ${R}-spinner 400ms linear infinite; 73 } 74 75 .${R}-custom-parent { 76 overflow: hidden; 77 position: relative; 78 } 79 80 .${R}-custom-parent #${R} .spinner, 81 .${R}-custom-parent #${R} .bar { 82 position: absolute; 83 } 84
85 @keyframes ${R}-spinner { 86 0% { transform: rotate(0deg); } 87 100% { transform: rotate(360deg); } 88 } 89 `,document.head.appendChild(t)},pi=()=>{if($e=!1,!!x?.isConnected)if(oe)try{x.showPopover()}catch{}else x.style.display=""},mi=()=>{if($e=!0,!!x?.isConnected)if(oe)try{x.hidePopover()}catch{}else x.style.display="none"},$={configure:ci,isStarted:Xr,done:li,set:Ge,remove:zr,start:Kr,status:re,show:pi,hide:mi},gi=class{hideCount=0;start(){$.start()}reveal(e=!1){this.hideCount=Math.max(0,this.hideCount-1),(e||this.hideCount===0)&&$.show()}hide(){this.hideCount++,$.hide()}set(e){$.set(Math.max(0,Math.min(1,e)))}finish(){$.done()}reset(){$.set(0)}remove(){$.done(),$.remove()}isStarted(){return $.isStarted()}getStatus(){return $.status}},_=new gi;function yi(e){document.addEventListener("inertia:start",t=>wi(t,e)),document.addEventListener("inertia:progress",Pi)}function wi(e,t){e.detail.visit.showProgress||_.hide();const r=setTimeout(()=>_.start(),t);document.addEventListener("inertia:finish",s=>vi(s,r),{once:!0})}function Pi(e){_.isStarted()&&e.detail.progress?.percentage&&_.set(Math.max(_.getStatus(),e.detail.progress.percentage/100*.9))}function vi(e,t){clearTimeout(t),_.isStarted()&&(e.detail.visit.completed?_.finish():e.detail.visit.interrupted?_.reset():e.detail.visit.cancelled&&_.remove())}function Si({delay:e=250,color:t="#29d",includeCSS:r=!0,showSpinner:s=!1,popover:n=null}={}){yi(e),$.configure({showSpinner:s,includeCSS:r,color:t,popover:n})}function er(e,t,r){return`<script data-page="${e}" type="application/json">${JSON.stringify(t).replace(/\//g,"\\/")}<\/script><div data-server-rendered="true" id="${e}">${r}</div>`}var B=new ei,Ve=ni(),fe=Le({shared:{},named:{}});Ve.subscribe(()=>{const e=Ve.get();fe.shared=e.shared,fe.named=e.named});function bi(){Ve.reset();const e=Ve.get();fe.shared=e.shared,fe.named=e.named}var Zr=Le({component:"",props:{},url:"",version:null});function st(e){Object.assign(Zr,e)}function xi(){return Zr}var Ie=(e,t,r,s=null)=>{const n=typeof t=="object"&&t!==null&&!Array.isArray(t);return{component:e,key:n?s:typeof r=="number"?r:null,props:n?t:{},children:n?Array.isArray(r)?r:r!==null?[r]:[]:Array.isArray(t)?t:t!==null?[t]:[]}};function es(e,t){pt(t,!0);const r=A(t,"props",19,()=>({})),s=A(t,"children",19,()=>[]),n=A(t,"key",3,null);var a=Y(),i=Z(a),o=c=>{var h=Y(),f=Z(h);ls(f,()=>s()?.length===0?n():null,l=>{var p=Y(),d=Z(p),m=g=>{const v=ee(()=>t.component);var y=Y(),w=Z(y);Ht(w,()=>q(v),(O,F)=>{F(O,Fe(r,{children:(W,M)=>{var P=Y(),E=Z(P);ss(E,17,s,os,(N,he)=>{es(N,Fe(()=>q(he)))}),J(W,P)},$$slots:{default:!0}}))}),J(g,y)},b=g=>{const v=ee(()=>t.component);var y=Y(),w=Z(y);Ht(w,()=>q(v),(O,F)=>{F(O,Fe(r))}),J(g,y)};Ft(d,g=>{s().length>0?g(m):g(b,-1)}),J(l,p)}),J(c,h)};Ft(i,c=>{t.component&&c(o)}),J(e,a),mt()}function ae(e,t){pt(t,!0);let r=Ye(Le(t.initialComponent)),s=Ye(null),n=Ye(Le({...t.initialPage,flash:t.initialPage.flash??{}})),a=ee(()=>h(q(r),q(n),q(s)));st(q(n)),cs(()=>{st(q(n))});const i=typeof window>"u";
89i||B.init({initialPage:t.initialPage,resolveComponent:t.resolveComponent,swapComponent:async l=>{st(l.page),qe(r,l.component,!0),qe(n,l.page,!0),qe(s,l.preserveState?q(s):Date.now(),!0),l.preserveState||bi()},onFlash:l=>{qe(n,{...q(n),flash:l},!0)}});function o(l){return l?typeof l=="function"?l.name!=="":typeof l=="object"&&"$$"in l:!1}function c(l){return typeof l=="function"&&l.length===2&&typeof l.prototype>"u"}function h(l,p,d=null){const m=Ie(l.default,p.props,[],d);if(l.layout&&c(l.layout))return l.layout(Ie,m);let b,g=null;const v=l.layout;if(typeof v=="function"&&v.length<=1&&typeof v.prototype>"u"){const y=v(p.props);ii(y,o)?(b=t.defaultLayout?.(p.component,p),g=y):b=y}else $r(v,o)?(b=t.defaultLayout?.(p.component,p),g=v):b=v??t.defaultLayout?.(p.component,p);return b?f(b,m,p.props,d,!!l.layout&&!g,g):m}function f(l,p,d,m,b=!0,g=null){if(b&&c(l))return l(Ie,p);let v=ai(l,o,b?c:void 0);if(g&&(v=v.map(y=>({...y,props:{...y.props,...g}}))),v.length>0){const y=i?{shared:{},named:{}}:{shared:fe.shared,named:fe.named};return v.reduceRight((w,O)=>({...Ie(O.component,{...d,...O.props,...y.shared,...O.name?y.named[O.name]||{}:{}},[w],m),name:O.name}),p)}return p}es(e,Fe(()=>q(a))),mt()}var[Ri,Ii]=hs(),Ei=new Set(["$$slots","$$events","$$legacy","href","as","data","method","replace","preserveScroll","preserveState","preserveUrl","only","except","headers","queryStringArrayFormat","async","prefetch","cacheFor","cacheTags","viewTransition","component","instant","pageProps","children"]);function Fi(e,t){pt(t,!0);let r=A(t,"href",3,""),s=A(t,"as",3,"a"),n=A(t,"data",19,()=>({})),a=A(t,"method",3,"get"),i=A(t,"replace",3,!1),o=A(t,"preserveScroll",3,!1),c=A(t,"preserveState",3,null),h=A(t,"preserveUrl",3,!1),f=A(t,"only",19,()=>[]),l=A(t,"except",19,()=>[]),p=A(t,"headers",19,()=>({})),d=A(t,"queryStringArrayFormat",3,"brackets"),m=A(t,"async",3,!1),b=A(t,"prefetch",3,!1),g=A(t,"cacheFor",3,0),v=A(t,"cacheTags",19,()=>[]),y=A(t,"viewTransition",3,!1),w=A(t,"component",3,void 0),O=A(t,"instant",3,!1),F=A(t,"pageProps",3,null),W=fs(t,Ei),M=ee(()=>te(r())?r().method:a()),P=ee(()=>te(r())?r().url:r()),E=ee(()=>w()?w():O()&&te(r())?kr(r()):null),N=ee(()=>q(M)!=="get"?"button":s().toLowerCase()),he=ee(()=>({a:{href:q(P)},button:{type:"button"}})[q(N)]||{});var de=Y(),ze=Z(de);rs(ze,()=>q(N),!1,(Ae,H)=>{ds(Ae,(Je,ts)=>Ai?.(Je,ts),()=>({...q(N)!=="a"?{href:q(P)}:{},data:n(),method:q(M),replace:i(),preserveScroll:o(),preserveState:c()??q(M)!=="get",preserveUrl:h(),only:f(),except:l(),headers:p(),queryStringArrayFormat:d(),async:m(),prefetch:b(),cacheFor:g(),cacheTags:v(),viewTransition:y(),component:q(E),pageProps:F()})),us(Ae,()=>({...W,...q(he)}));var Oe=Y(),I=Z(Oe);is(I,()=>t.children??ps),J(H,Oe)}),J(e,de),mt()}async function Hi({id:e="app",resolve:t,setup:r,progress:s={},page:n,defaults:a={},nonce:i,http:o,layout:c,serverHead:h,withApp:f,dev:l=!1}={}){Xe.replace(a),i&&Xe.set("nonce",i),o&&Br.setClient(o),l&&zn();const p=typeof window>"u",d=(w,O)=>Promise.resolve(t(w,O));if(p&&!n)return async(w,O)=>{const F={initialPage:w,initialComponent:await d(w.component,w),resolveComponent:d,defaultLayout:c};let W;if(r){const M=await r({el:null,App:ae,props:F});if(!M)throw new Error("Inertia SSR setup function must return a render result ({ body, head })");W=M}else{const M=new Map;f&&f(M,{ssr:!0,page:w}),W=await O(ae,{props:F,context:M})}return{body:er(e,w,W.body),head:[...xe(w,h),W.head]}};const m=n||bn(e),b=!p&&h?si(!1,w=>w,()=>{},xe(m,h)):null,[g]=await Promise.all([d(m.component,m),B.decryptHistory().catch(()=>{})]),v={initialPage:m,initialComponent:g,resolveComponent:d,defaultLayout:c};if(p){if(!r)throw new Error("Inertia SSR requires a setup function that returns a render result ({ body, head })");const w=await r({el:null,App:ae,props:v});return w?{body:er(e,m,w.body),head:[...xe(m,h),w.head]}:void 0}const y=document.getElementById(e);if(r)await r({el:y,App:ae,props:v});else{const w=new Map;f&&f(w,{ssr:!1,page:m}),y.hasAttribute("data-server-rendered")?as(ae,{target:y,props:v,context:w}):ns(ae,{target:y,props:v,context:w})}if(b){const w=O=>{b.updateServerHead(xe(O.detail.page,h))};B.on("navigate",w),B.on("clientVisit",w)}s&&Si(s)}function Ai(e,t={}){let r=0,s,n=[],a,i=[],o,c,h,f,l;const p={click:P=>{Re(P)&&(P.preventDefault(),B.visit(c,l))}},d={mouseenter:()=>s=setTimeout(()=>y(),Xe.get("prefetch.hoverDelay")),mouseleave:()=>clearTimeout(s),click:p.click},m={mousedown:P=>{Re(P)&&(P.preventDefault(),y())},keydown:P=>{Zt(P)&&(P.preventDefault(),y())},mouseup:P=>{Re(P)&&(P.preventDefault(),B.visit(c,l))},keyup:P=>{Zt(P)&&(P.preventDefault(),B.visit(c,l))},click:P=>{Re(P)&&P.preventDefault()}};function b({cacheFor:P=0,prefetch:E=!1,cacheTags:N=[],viewTransition:he=!1,component:de,instant:ze=!1,pageProps:Ae=null,...H}){n=E===!0?["hover"]:E===!1?[]:Array.isArray(E)?E:[E],a=P!==0?P:n.length===1&&n[0]==="click"?0:Xe.get("prefetch.cacheFor"),i=Array.isArray(N)?N:[N],o=te(H.href)?H.href.method:H.method?.toLowerCase()||"get",[c,h]=v(o,H);const Oe=de||(ze&&te(H.href)?kr(H.href):null);e.tagName==="A"&&(e.href=c),f={data:h,method:o,replace:H.replace||!1,preserveScroll:H.preserveScroll||!1,preserveState:H.preserveState??o!=="get",preserveUrl:H.preserveUrl||!1,only:H.only||[],except:H.except||[],headers:H.headers||{},async:H.async||!1,component:Oe,pageProps:Ae},l={...f,viewTransition:he,onStart:I=>(r++,w(),g("start",{detail:{visit:I}})),onProgress:I=>g("progress",{detail:{progress:I}}),onFinish:I=>(r--,w(),g("finish",{detail:{visit:I}})),onBefore:I=>g("before",{cancelable:!0,detail:{visit:I}}),onCancel:()=>g("cancel"),onSuccess:I=>g("success",{detail:{page:I}}),onError:I=>g("error",{detail:{errors:I}}),onCancelToken:I=>g("cancel-token",{detail:{token:I}}),onPrefetching:I=>g("prefetching",{detail:{visit:I}}),onPrefetched:(I,Je)=>g("prefetched",{detail:{response:I,visit:Je}})},O()}function g(P,E={}){return e.dispatchEvent(new CustomEvent(P,E))}function v(P,E){return Ot(P,te(E.href)?E.href.url:e.href||E.href||"",E.data||{},E.queryStringArrayFormat||"brackets")}function y(){B.prefetch(c,{...f,onPrefetching:P=>g("prefetching",{detail:{visit:P}}),onPrefetched:(P,E)=>g("prefetched",{detail:{response:P,visit:E}})},{cacheFor:a,cacheTags:i})}function w(){if(r>0){e.setAttribute("data-loading","");return}e.removeAttribute("data-loading")}function O(){if(W(),n.includes("hover")){F(d);return}if(n.includes("click")){F(m);return}F(p)}function F(P){Object.entries(P).forEach(([E,N])=>{e.addEventListener(E,N)})}
89function W(){[d,m,p].forEach(P=>{Object.entries(P).forEach(([E,N])=>{e.removeEventListener(E,N)})})}function M(){clearTimeout(s),W()}return b(t),n.includes("mount")&&y(),{update:b,destroy:M}}var Xe=le.extend({});export{B as a,Br as i,Fi as n,xi as r,Hi 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.