@luminix/mui-cms 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/mui-cms.bundle.iife.js +1 -1
- package/package.json +2 -2
- package/.eslintrc.cjs +0 -18
- package/CLAUDE.md +0 -8
- package/docs/acoes.md +0 -196
- package/docs/componentes.md +0 -166
- package/docs/configuracao.md +0 -160
- package/docs/extensibilidade.md +0 -261
- package/docs/facades.md +0 -195
- package/docs/hooks.md +0 -307
- package/docs/index.md +0 -25
- package/docs/instalacao.md +0 -95
- package/docs/introducao.md +0 -72
- package/docs/tipos.md +0 -248
- package/tsconfig.json +0 -26
- package/tsconfig.node.json +0 -11
- package/tsconfig.test.json +0 -16
- package/vitest.config.ts +0 -22
|
@@ -13,7 +13,7 @@ Error generating stack: `+C.message+`
|
|
|
13
13
|
`);return l===-1?"":o.stack.slice(l+1)})();try{if(!r.stack)r.stack=s;else if(s){const l=s.indexOf(`
|
|
14
14
|
`),c=l===-1?-1:s.indexOf(`
|
|
15
15
|
`,l+1),u=c===-1?"":s.slice(c+1);String(r.stack).endsWith(u)||(r.stack+=`
|
|
16
|
-
`+s)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ws(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&ad.assertOptions(r,{silentJSONParsing:Jr.transitional(Jr.boolean),forcedJSONParsing:Jr.transitional(Jr.boolean),clarifyTimeoutError:Jr.transitional(Jr.boolean),legacyInterceptorReqResOrdering:Jr.transitional(Jr.boolean)},!1),o!=null&&(le.isFunction(o)?n.paramsSerializer={serialize:o}:ad.assertOptions(o,{encode:Jr.function,serialize:Jr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ad.assertOptions(n,{baseUrl:Jr.spelling("baseURL"),withXsrfToken:Jr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=s&&le.merge(s.common,s[n.method]);s&&le.forEach(["delete","get","head","post","put","patch","query","common"],w=>{delete s[w]}),n.headers=rr.concat(l,s);const c=[];let u=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(n)===!1)return;u=u&&w.synchronous;const v=n.transitional||Th;v&&v.legacyInterceptorReqResOrdering?c.unshift(w.fulfilled,w.rejected):c.push(w.fulfilled,w.rejected)});const f=[];this.interceptors.response.forEach(function(w){f.push(w.fulfilled,w.rejected)});let p,m=0,g;if(!u){const w=[B0.bind(this),void 0];for(w.unshift(...c),w.push(...f),g=w.length,p=Promise.resolve(n);m<g;)p=p.then(w[m++],w[m++]);return p}g=c.length;let S=n;for(;m<g;){const w=c[m++],v=c[m++];try{S=w(S)}catch(x){v.call(this,x);break}}try{p=B0.call(this,S)}catch(w){return Promise.reject(w)}for(m=0,g=f.length;m<g;)p=p.then(f[m++],f[m++]);return p}getUri(t){t=ws(this.defaults,t);const n=j0(t.baseURL,t.url,t.allowAbsoluteUrls);return R0(n,t.params,t.paramsSerializer)}};le.forEach(["delete","get","head","options"],function(e){Ss.prototype[e]=function(t,n){return this.request(ws(n||{},{method:e,url:t,data:(n||{}).data}))}}),le.forEach(["post","put","patch","query"],function(e){function t(n){return function(r,o,s){return this.request(ws(s||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}Ss.prototype[e]=t(),e!=="query"&&(Ss.prototype[e+"Form"]=t(!0))});let Y$=class ZT{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const l=new Promise(c=>{r.subscribe(c),s=c}).then(o);return l.cancel=function(){r.unsubscribe(s)},l},t(function(o,s,l){r.reason||(r.reason=new Wl(o,s,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new ZT(function(n){t=n}),cancel:t}}};function J$(e){return function(t){return e.apply(null,t)}}function X$(e){return le.isObject(e)&&e.isAxiosError===!0}const Lh={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Lh).forEach(([e,t])=>{Lh[t]=e});function U0(e){const t=new Ss(e),n=u0(Ss.prototype.request,t);return le.extend(n,Ss.prototype,t,{allOwnKeys:!0}),le.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return U0(ws(e,r))},n}const wn=U0(Ul);wn.Axios=Ss,wn.CanceledError=Wl,wn.CancelToken=Y$,wn.isCancel=P0,wn.VERSION=Mh,wn.toFormData=rd,wn.AxiosError=Ze,wn.Cancel=wn.CanceledError,wn.all=function(e){return Promise.all(e)},wn.spread=J$,wn.isAxiosError=X$,wn.mergeConfig=ws,wn.AxiosHeaders=rr,wn.formToJSON=e=>k0(le.isHTMLForm(e)?new FormData(e):e),wn.getAdapter=F0.getAdapter,wn.HttpStatusCode=Lh,wn.default=wn;const{Axios:xne,AxiosError:wne,CanceledError:Sne,isCancel:Cne,CancelToken:Rne,VERSION:Ene,all:kne,Cancel:Pne,isAxiosError:Z$,spread:One,toFormData:W0,AxiosHeaders:Tne,HttpStatusCode:$ne,formToJSON:jne,getAdapter:Ane,mergeConfig:Mne,create:_ne}=wn;var ld=Symbol.for("immer-nothing"),ua=Symbol.for("immer-draftable"),zt=Symbol.for("immer-state");function _n(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Cs=Object.getPrototypeOf;function ii(e){return!!e&&!!e[zt]}function Xr(e){var t;return e?H0(e)||Array.isArray(e)||!!e[ua]||!!((t=e.constructor)!=null&&t[ua])||Vl(e)||Kl(e):!1}var ej=Object.prototype.constructor.toString();function H0(e){if(!e||typeof e!="object")return!1;const t=Cs(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===ej}function tj(e){return ii(e)||_n(15,e),e[zt].base_}function da(e,t){Rs(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Rs(e){const t=e[zt];return t?t.type_:Array.isArray(e)?1:Vl(e)?2:Kl(e)?3:0}function Hl(e,t){return Rs(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Nh(e,t){return Rs(e)===2?e.get(t):e[t]}function V0(e,t,n){const r=Rs(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function nj(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Vl(e){return e instanceof Map}function Kl(e){return e instanceof Set}function In(e){return e.copy_||e.base_}function Dh(e,t){if(Vl(e))return new Map(e);if(Kl(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=H0(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[zt];let o=Reflect.ownKeys(r);for(let s=0;s<o.length;s++){const l=o[s],c=r[l];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(r[l]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[l]})}return Object.create(Cs(e),r)}else{const r=Cs(e);if(r!==null&&n)return{...e};const o=Object.create(r);return Object.assign(o,e)}}function cd(e,t=!1){return ud(e)||ii(e)||!Xr(e)||(Rs(e)>1&&(e.set=e.add=e.clear=e.delete=rj),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>cd(r,!0))),e}function rj(){_n(2)}function ud(e){return Object.isFrozen(e)}var Fh={};function Es(e){const t=Fh[e];return t||_n(0,e),t}function K0(e,t){Fh[e]||(Fh[e]=t)}var ql;function dd(){return ql}function oj(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function q0(e,t){t&&(Es("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Bh(e){zh(e),e.drafts_.forEach(ij),e.drafts_=null}function zh(e){e===ql&&(ql=e.parent_)}function G0(e){return ql=oj(ql,e)}function ij(e){const t=e[zt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Q0(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[zt].modified_&&(Bh(t),_n(4)),Xr(e)&&(e=fd(t,e),t.parent_||pd(t,e)),t.patches_&&Es("Patches").generateReplacementPatches_(n[zt].base_,e,t.patches_,t.inversePatches_)):e=fd(t,n,[]),Bh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ld?e:void 0}function fd(e,t,n){if(ud(t))return t;const r=t[zt];if(!r)return da(t,(o,s)=>Y0(e,r,t,o,s,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return pd(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let s=o,l=!1;r.type_===3&&(s=new Set(o),o.clear(),l=!0),da(s,(c,u)=>Y0(e,r,o,c,u,n,l)),pd(e,o,!1),n&&e.patches_&&Es("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Y0(e,t,n,r,o,s,l){if(ii(o)){const c=s&&t&&t.type_!==3&&!Hl(t.assigned_,r)?s.concat(r):void 0,u=fd(e,o,c);if(V0(n,r,u),ii(u))e.canAutoFreeze_=!1;else return}else l&&n.add(o);if(Xr(o)&&!ud(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;fd(e,o),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&pd(e,o)}}function pd(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&cd(t,n)}function sj(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:dd(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,s=Uh;n&&(o=[r],s=Gl);const{revoke:l,proxy:c}=Proxy.revocable(o,s);return r.draft_=c,r.revoke_=l,c}var Uh={get(e,t){if(t===zt)return e;const n=In(e);if(!Hl(n,t))return aj(e,n,t);const r=n[t];return e.finalized_||!Xr(r)?r:r===Wh(e.base_,t)?(Hh(e),e.copy_[t]=Ql(r,e)):r},has(e,t){return t in In(e)},ownKeys(e){return Reflect.ownKeys(In(e))},set(e,t,n){const r=J0(In(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Wh(In(e),t),s=o==null?void 0:o[zt];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(nj(n,o)&&(n!==void 0||Hl(e.base_,t)))return!0;Hh(e),si(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Wh(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Hh(e),si(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=In(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){_n(11)},getPrototypeOf(e){return Cs(e.base_)},setPrototypeOf(){_n(12)}},Gl={};da(Uh,(e,t)=>{Gl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Gl.deleteProperty=function(e,t){return Gl.set.call(this,e,t,void 0)},Gl.set=function(e,t,n){return Uh.set.call(this,e[0],t,n,e[0])};function Wh(e,t){const n=e[zt];return(n?In(n):e)[t]}function aj(e,t,n){var r;const o=J0(t,n);return o?"value"in o?o.value:(r=o.get)==null?void 0:r.call(e.draft_):void 0}function J0(e,t){if(!(t in e))return;let n=Cs(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Cs(n)}}function si(e){e.modified_||(e.modified_=!0,e.parent_&&si(e.parent_))}function Hh(e){e.copy_||(e.copy_=Dh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var X0=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const s=n;n=t;const l=this;return function(c=s,...u){return l.produce(c,f=>n.call(this,f,...u))}}typeof n!="function"&&_n(6),r!==void 0&&typeof r!="function"&&_n(7);let o;if(Xr(t)){const s=G0(this),l=Ql(t,void 0);let c=!0;try{o=n(l),c=!1}finally{c?Bh(s):zh(s)}return q0(s,r),Q0(o,s)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===ld&&(o=void 0),this.autoFreeze_&&cd(o,!0),r){const s=[],l=[];Es("Patches").generateReplacementPatches_(t,o,s,l),r(s,l)}return o}else _n(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...l)=>this.produceWithPatches(s,c=>t(c,...l));let r,o;return[this.produce(t,n,(s,l)=>{r=s,o=l}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Xr(e)||_n(8),ii(e)&&(e=Z0(e));const t=G0(this),n=Ql(e,void 0);return n[zt].isManual_=!0,zh(t),n}finishDraft(e,t){const n=e&&e[zt];(!n||!n.isManual_)&&_n(9);const{scope_:r}=n;return q0(r,t),Q0(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=Es("Patches").applyPatches_;return ii(e)?r(e,t):this.produce(e,o=>r(o,t))}};function Ql(e,t){const n=Vl(e)?Es("MapSet").proxyMap_(e,t):Kl(e)?Es("MapSet").proxySet_(e,t):sj(e,t);return(t?t.scope_:dd()).drafts_.push(n),n}function Z0(e){return ii(e)||_n(10,e),ex(e)}function ex(e){if(!Xr(e)||ud(e))return e;const t=e[zt];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Dh(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Dh(e,!0);return da(n,(r,o)=>{V0(n,r,ex(o))}),t&&(t.finalized_=!1),n}function lj(){const e="replace",t="add",n="remove";function r(m,g,S,w){switch(m.type_){case 0:case 2:return s(m,g,S,w);case 1:return o(m,g,S,w);case 3:return l(m,g,S,w)}}function o(m,g,S,w){let{base_:v,assigned_:x}=m,R=m.copy_;R.length<v.length&&([v,R]=[R,v],[S,w]=[w,S]);for(let k=0;k<v.length;k++)if(x[k]&&R[k]!==v[k]){const O=g.concat([k]);S.push({op:e,path:O,value:p(R[k])}),w.push({op:e,path:O,value:p(v[k])})}for(let k=v.length;k<R.length;k++){const O=g.concat([k]);S.push({op:t,path:O,value:p(R[k])})}for(let k=R.length-1;v.length<=k;--k){const O=g.concat([k]);w.push({op:n,path:O})}}function s(m,g,S,w){const{base_:v,copy_:x}=m;da(m.assigned_,(R,k)=>{const O=Nh(v,R),$=Nh(x,R),j=k?Hl(v,R)?e:t:n;if(O===$&&j===e)return;const T=g.concat(R);S.push(j===n?{op:j,path:T}:{op:j,path:T,value:$}),w.push(j===t?{op:n,path:T}:j===n?{op:t,path:T,value:p(O)}:{op:e,path:T,value:p(O)})})}function l(m,g,S,w){let{base_:v,copy_:x}=m,R=0;v.forEach(k=>{if(!x.has(k)){const O=g.concat([R]);S.push({op:n,path:O,value:k}),w.unshift({op:t,path:O,value:k})}R++}),R=0,x.forEach(k=>{if(!v.has(k)){const O=g.concat([R]);S.push({op:t,path:O,value:k}),w.unshift({op:n,path:O,value:k})}R++})}function c(m,g,S,w){S.push({op:e,path:[],value:g===ld?void 0:g}),w.push({op:e,path:[],value:m})}function u(m,g){return g.forEach(S=>{const{path:w,op:v}=S;let x=m;for(let $=0;$<w.length-1;$++){const j=Rs(x);let T=w[$];typeof T!="string"&&typeof T!="number"&&(T=""+T),(j===0||j===1)&&(T==="__proto__"||T==="constructor")&&_n(19),typeof x=="function"&&T==="prototype"&&_n(19),x=Nh(x,T),typeof x!="object"&&_n(18,w.join("/"))}const R=Rs(x),k=f(S.value),O=w[w.length-1];switch(v){case e:switch(R){case 2:return x.set(O,k);case 3:_n(16);default:return x[O]=k}case t:switch(R){case 1:return O==="-"?x.push(k):x.splice(O,0,k);case 2:return x.set(O,k);case 3:return x.add(k);default:return x[O]=k}case n:switch(R){case 1:return x.splice(O,1);case 2:return x.delete(O);case 3:return x.delete(S.value);default:return delete x[O]}default:_n(17,v)}}),m}function f(m){if(!Xr(m))return m;if(Array.isArray(m))return m.map(f);if(Vl(m))return new Map(Array.from(m.entries()).map(([S,w])=>[S,f(w)]));if(Kl(m))return new Set(Array.from(m).map(f));const g=Object.create(Cs(m));for(const S in m)g[S]=f(m[S]);return Hl(m,ua)&&(g[ua]=m[ua]),g}function p(m){return ii(m)?f(m):m}K0("Patches",{applyPatches_:u,generatePatches_:r,generateReplacementPatches_:c})}function cj(){class e extends Map{constructor(u,f){super(),this[zt]={type_:2,parent_:f,scope_:f?f.scope_:dd(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:u,draft_:this,isManual_:!1,revoked_:!1}}get size(){return In(this[zt]).size}has(u){return In(this[zt]).has(u)}set(u,f){const p=this[zt];return l(p),(!In(p).has(u)||In(p).get(u)!==f)&&(n(p),si(p),p.assigned_.set(u,!0),p.copy_.set(u,f),p.assigned_.set(u,!0)),this}delete(u){if(!this.has(u))return!1;const f=this[zt];return l(f),n(f),si(f),f.base_.has(u)?f.assigned_.set(u,!1):f.assigned_.delete(u),f.copy_.delete(u),!0}clear(){const u=this[zt];l(u),In(u).size&&(n(u),si(u),u.assigned_=new Map,da(u.base_,f=>{u.assigned_.set(f,!1)}),u.copy_.clear())}forEach(u,f){const p=this[zt];In(p).forEach((m,g,S)=>{u.call(f,this.get(g),g,this)})}get(u){const f=this[zt];l(f);const p=In(f).get(u);if(f.finalized_||!Xr(p)||p!==f.base_.get(u))return p;const m=Ql(p,f);return n(f),f.copy_.set(u,m),m}keys(){return In(this[zt]).keys()}values(){const u=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{const f=u.next();return f.done?f:{done:!1,value:this.get(f.value)}}}}entries(){const u=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{const f=u.next();if(f.done)return f;const p=this.get(f.value);return{done:!1,value:[f.value,p]}}}}[Symbol.iterator](){return this.entries()}}function t(c,u){return new e(c,u)}function n(c){c.copy_||(c.assigned_=new Map,c.copy_=new Map(c.base_))}class r extends Set{constructor(u,f){super(),this[zt]={type_:3,parent_:f,scope_:f?f.scope_:dd(),modified_:!1,finalized_:!1,copy_:void 0,base_:u,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return In(this[zt]).size}has(u){const f=this[zt];return l(f),f.copy_?!!(f.copy_.has(u)||f.drafts_.has(u)&&f.copy_.has(f.drafts_.get(u))):f.base_.has(u)}add(u){const f=this[zt];return l(f),this.has(u)||(s(f),si(f),f.copy_.add(u)),this}delete(u){if(!this.has(u))return!1;const f=this[zt];return l(f),s(f),si(f),f.copy_.delete(u)||(f.drafts_.has(u)?f.copy_.delete(f.drafts_.get(u)):!1)}clear(){const u=this[zt];l(u),In(u).size&&(s(u),si(u),u.copy_.clear())}values(){const u=this[zt];return l(u),s(u),u.copy_.values()}entries(){const u=this[zt];return l(u),s(u),u.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(u,f){const p=this.values();let m=p.next();for(;!m.done;)u.call(f,m.value,m.value,this),m=p.next()}}function o(c,u){return new r(c,u)}function s(c){c.copy_||(c.copy_=new Set,c.base_.forEach(u=>{if(Xr(u)){const f=Ql(u,c);c.drafts_.set(u,f),c.copy_.add(f)}else c.copy_.add(u)}))}function l(c){c.revoked_&&_n(3,JSON.stringify(In(c)))}K0("MapSet",{proxyMap_:t,proxySet_:o})}var Mr=new X0,fa=Mr.produce,uj=Mr.produceWithPatches.bind(Mr),dj=Mr.setAutoFreeze.bind(Mr),fj=Mr.setUseStrictShallowCopy.bind(Mr),pj=Mr.applyPatches.bind(Mr),hj=Mr.createDraft.bind(Mr),mj=Mr.finishDraft.bind(Mr);function gj(e){return e}function yj(e){return e}const Vh=Object.freeze(Object.defineProperty({__proto__:null,Immer:X0,applyPatches:pj,castDraft:gj,castImmutable:yj,createDraft:hj,current:Z0,enableMapSet:cj,enablePatches:lj,finishDraft:mj,freeze:cd,immerable:ua,isDraft:ii,isDraftable:Xr,nothing:ld,original:tj,produce:fa,produceWithPatches:uj,setAutoFreeze:dj,setUseStrictShallowCopy:fj},Symbol.toStringTag,{value:"Module"}));let vj=()=>({emit(e,...t){for(let n=0,r=this.events[e]||[],o=r.length;n<o;n++)r[n](...t)},events:{},on(e,t){var n;return((n=this.events)[e]||(n[e]=[])).push(t),()=>{var r;this.events[e]=(r=this.events[e])==null?void 0:r.filter(o=>t!==o)}}});class pa{constructor(){Ar(this,"emitter"),this.emitter=vj()}on(t,n){return this.emitter.on(t,n)}once(t,n){const r=this.emitter.on(t,o=>{r(),n(o)})}emit(t,...n){this.emitter.emit(t,...n)}flushEvents(){this.emitter.events={}}}var tx,nx;class bj extends(nx=Error,tx=Symbol.toStringTag,nx){constructor(){super("[Luminix] Embed element not found. Make sure to include the `@luminixEmbed()` directive in your Blade template."),Ar(this,tx,"NoEmbedException")}}const rx=(e,t="data")=>{if(!document.querySelector("#luminix-embed"))throw new bj;const n=document.getElementById(`luminix-${t}::`+e);return n?n.dataset.json&&n.dataset.value?JSON.parse(n.dataset.value):n.dataset.value:null};var ox=typeof global=="object"&&global&&global.Object===Object&&global,xj=typeof self=="object"&&self&&self.Object===Object&&self,wo=ox||xj||Function("return this")(),Zr=wo.Symbol,ix=Object.prototype,wj=ix.hasOwnProperty,Sj=ix.toString,Yl=Zr?Zr.toStringTag:void 0;function Cj(e){var t=wj.call(e,Yl),n=e[Yl];try{e[Yl]=void 0;var r=!0}catch{}var o=Sj.call(e);return r&&(t?e[Yl]=n:delete e[Yl]),o}var Rj=Object.prototype,Ej=Rj.toString;function kj(e){return Ej.call(e)}var Pj="[object Null]",Oj="[object Undefined]",sx=Zr?Zr.toStringTag:void 0;function ks(e){return e==null?e===void 0?Oj:Pj:sx&&sx in Object(e)?Cj(e):kj(e)}function Fo(e){return e!=null&&typeof e=="object"}var Tj="[object Symbol]";function hd(e){return typeof e=="symbol"||Fo(e)&&ks(e)==Tj}function Kh(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var yr=Array.isArray,ax=Zr?Zr.prototype:void 0,lx=ax?ax.toString:void 0;function md(e){if(typeof e=="string")return e;if(yr(e))return Kh(e,md)+"";if(hd(e))return lx?lx.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var $j=/\s/;function jj(e){for(var t=e.length;t--&&$j.test(e.charAt(t)););return t}var Aj=/^\s+/;function cx(e){return e&&e.slice(0,jj(e)+1).replace(Aj,"")}function vr(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ux=NaN,Mj=/^[-+]0x[0-9a-f]+$/i,_j=/^0b[01]+$/i,Ij=/^0o[0-7]+$/i,Lj=parseInt;function qh(e){if(typeof e=="number")return e;if(hd(e))return ux;if(vr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=vr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=cx(e);var n=_j.test(e);return n||Ij.test(e)?Lj(e.slice(2),n?2:8):Mj.test(e)?ux:+e}var dx=1/0,Nj=17976931348623157e292;function Dj(e){if(!e)return e===0?e:0;if(e=qh(e),e===dx||e===-dx){var t=e<0?-1:1;return t*Nj}return e===e?e:0}function Gh(e){var t=Dj(e),n=t%1;return t===t?n?t-n:t:0}function fx(e){return e}var Fj="[object AsyncFunction]",Bj="[object Function]",zj="[object GeneratorFunction]",Uj="[object Proxy]";function Qh(e){if(!vr(e))return!1;var t=ks(e);return t==Bj||t==zj||t==Fj||t==Uj}var Yh=wo["__core-js_shared__"],px=function(){var e=/[^.]+$/.exec(Yh&&Yh.keys&&Yh.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Wj(e){return!!px&&px in e}var Hj=Function.prototype,Vj=Hj.toString;function Ps(e){if(e!=null){try{return Vj.call(e)}catch{}try{return e+""}catch{}}return""}var Kj=/[\\^$.*+?()[\]{}|]/g,qj=/^\[object .+?Constructor\]$/,Gj=Function.prototype,Qj=Object.prototype,Yj=Gj.toString,Jj=Qj.hasOwnProperty,Xj=RegExp("^"+Yj.call(Jj).replace(Kj,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Zj(e){if(!vr(e)||Wj(e))return!1;var t=Qh(e)?Xj:qj;return t.test(Ps(e))}function eA(e,t){return e==null?void 0:e[t]}function Os(e,t){var n=eA(e,t);return Zj(n)?n:void 0}var Jh=Os(wo,"WeakMap"),hx=Object.create,tA=function(){function e(){}return function(t){if(!vr(t))return{};if(hx)return hx(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function nA(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Xh(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var rA=800,oA=16,iA=Date.now;function sA(e){var t=0,n=0;return function(){var r=iA(),o=oA-(r-n);if(n=r,o>0){if(++t>=rA)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function aA(e){return function(){return e}}var gd=function(){try{var e=Os(Object,"defineProperty");return e({},"",{}),e}catch{}}(),lA=gd?function(e,t){return gd(e,"toString",{configurable:!0,enumerable:!1,value:aA(t),writable:!0})}:fx,mx=sA(lA);function cA(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function uA(e,t,n,r){for(var o=e.length,s=n+-1;++s<o;)if(t(e[s],s,e))return s;return-1}function dA(e){return e!==e}function fA(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}function gx(e,t,n){return t===t?fA(e,t,n):uA(e,dA,n)}var pA=9007199254740991,hA=/^(?:0|[1-9]\d*)$/;function yd(e,t){var n=typeof e;return t=t??pA,!!t&&(n=="number"||n!="symbol"&&hA.test(e))&&e>-1&&e%1==0&&e<t}function Zh(e,t,n){t=="__proto__"&&gd?gd(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Jl(e,t){return e===t||e!==e&&t!==t}var mA=Object.prototype,gA=mA.hasOwnProperty;function em(e,t,n){var r=e[t];(!(gA.call(e,t)&&Jl(r,n))||n===void 0&&!(t in e))&&Zh(e,t,n)}function ha(e,t,n,r){var o=!n;n||(n={});for(var s=-1,l=t.length;++s<l;){var c=t[s],u=void 0;u===void 0&&(u=e[c]),o?Zh(n,c,u):em(n,c,u)}return n}var yx=Math.max;function vx(e,t,n){return t=yx(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,s=yx(r.length-t,0),l=Array(s);++o<s;)l[o]=r[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=r[o];return c[t]=n(l),nA(e,this,c)}}function yA(e,t){return mx(vx(e,t,fx),e+"")}var vA=9007199254740991;function tm(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=vA}function Xl(e){return e!=null&&tm(e.length)&&!Qh(e)}function bA(e,t,n){if(!vr(n))return!1;var r=typeof t;return(r=="number"?Xl(n)&&yd(t,n.length):r=="string"&&t in n)?Jl(n[t],e):!1}function xA(e){return yA(function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:void 0,l=o>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(o--,s):void 0,l&&bA(n[0],n[1],l)&&(s=o<3?void 0:s,o=1),t=Object(t);++r<o;){var c=n[r];c&&e(t,c,r,s)}return t})}var wA=Object.prototype;function vd(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||wA;return e===n}function SA(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var CA="[object Arguments]";function bx(e){return Fo(e)&&ks(e)==CA}var xx=Object.prototype,RA=xx.hasOwnProperty,EA=xx.propertyIsEnumerable,ma=bx(function(){return arguments}())?bx:function(e){return Fo(e)&&RA.call(e,"callee")&&!EA.call(e,"callee")};function kA(){return!1}var wx=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Sx=wx&&typeof module=="object"&&module&&!module.nodeType&&module,PA=Sx&&Sx.exports===wx,Cx=PA?wo.Buffer:void 0,OA=Cx?Cx.isBuffer:void 0,ga=OA||kA,TA="[object Arguments]",$A="[object Array]",jA="[object Boolean]",AA="[object Date]",MA="[object Error]",_A="[object Function]",IA="[object Map]",LA="[object Number]",NA="[object Object]",DA="[object RegExp]",FA="[object Set]",BA="[object String]",zA="[object WeakMap]",UA="[object ArrayBuffer]",WA="[object DataView]",HA="[object Float32Array]",VA="[object Float64Array]",KA="[object Int8Array]",qA="[object Int16Array]",GA="[object Int32Array]",QA="[object Uint8Array]",YA="[object Uint8ClampedArray]",JA="[object Uint16Array]",XA="[object Uint32Array]",an={};an[HA]=an[VA]=an[KA]=an[qA]=an[GA]=an[QA]=an[YA]=an[JA]=an[XA]=!0,an[TA]=an[$A]=an[UA]=an[jA]=an[WA]=an[AA]=an[MA]=an[_A]=an[IA]=an[LA]=an[NA]=an[DA]=an[FA]=an[BA]=an[zA]=!1;function ZA(e){return Fo(e)&&tm(e.length)&&!!an[ks(e)]}function nm(e){return function(t){return e(t)}}var Rx=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Zl=Rx&&typeof module=="object"&&module&&!module.nodeType&&module,eM=Zl&&Zl.exports===Rx,rm=eM&&ox.process,ya=function(){try{var e=Zl&&Zl.require&&Zl.require("util").types;return e||rm&&rm.binding&&rm.binding("util")}catch{}}(),Ex=ya&&ya.isTypedArray,bd=Ex?nm(Ex):ZA,tM=Object.prototype,nM=tM.hasOwnProperty;function kx(e,t){var n=yr(e),r=!n&&ma(e),o=!n&&!r&&ga(e),s=!n&&!r&&!o&&bd(e),l=n||r||o||s,c=l?SA(e.length,String):[],u=c.length;for(var f in e)(t||nM.call(e,f))&&!(l&&(f=="length"||o&&(f=="offset"||f=="parent")||s&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||yd(f,u)))&&c.push(f);return c}function Px(e,t){return function(n){return e(t(n))}}var rM=Px(Object.keys,Object),oM=Object.prototype,iM=oM.hasOwnProperty;function Ox(e){if(!vd(e))return rM(e);var t=[];for(var n in Object(e))iM.call(e,n)&&n!="constructor"&&t.push(n);return t}function xd(e){return Xl(e)?kx(e):Ox(e)}function sM(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var aM=Object.prototype,lM=aM.hasOwnProperty;function cM(e){if(!vr(e))return sM(e);var t=vd(e),n=[];for(var r in e)r=="constructor"&&(t||!lM.call(e,r))||n.push(r);return n}function ec(e){return Xl(e)?kx(e,!0):cM(e)}var uM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dM=/^\w*$/;function fM(e,t){if(yr(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||hd(e)?!0:dM.test(e)||!uM.test(e)||t!=null&&e in Object(t)}var tc=Os(Object,"create");function pM(){this.__data__=tc?tc(null):{},this.size=0}function hM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var mM="__lodash_hash_undefined__",gM=Object.prototype,yM=gM.hasOwnProperty;function vM(e){var t=this.__data__;if(tc){var n=t[e];return n===mM?void 0:n}return yM.call(t,e)?t[e]:void 0}var bM=Object.prototype,xM=bM.hasOwnProperty;function wM(e){var t=this.__data__;return tc?t[e]!==void 0:xM.call(t,e)}var SM="__lodash_hash_undefined__";function CM(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=tc&&t===void 0?SM:t,this}function Ts(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ts.prototype.clear=pM,Ts.prototype.delete=hM,Ts.prototype.get=vM,Ts.prototype.has=wM,Ts.prototype.set=CM;function RM(){this.__data__=[],this.size=0}function wd(e,t){for(var n=e.length;n--;)if(Jl(e[n][0],t))return n;return-1}var EM=Array.prototype,kM=EM.splice;function PM(e){var t=this.__data__,n=wd(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():kM.call(t,n,1),--this.size,!0}function OM(e){var t=this.__data__,n=wd(t,e);return n<0?void 0:t[n][1]}function TM(e){return wd(this.__data__,e)>-1}function $M(e,t){var n=this.__data__,r=wd(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function ai(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ai.prototype.clear=RM,ai.prototype.delete=PM,ai.prototype.get=OM,ai.prototype.has=TM,ai.prototype.set=$M;var nc=Os(wo,"Map");function jM(){this.size=0,this.__data__={hash:new Ts,map:new(nc||ai),string:new Ts}}function AM(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Sd(e,t){var n=e.__data__;return AM(t)?n[typeof t=="string"?"string":"hash"]:n.map}function MM(e){var t=Sd(this,e).delete(e);return this.size-=t?1:0,t}function _M(e){return Sd(this,e).get(e)}function IM(e){return Sd(this,e).has(e)}function LM(e,t){var n=Sd(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function li(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}li.prototype.clear=jM,li.prototype.delete=MM,li.prototype.get=_M,li.prototype.has=IM,li.prototype.set=LM;var NM="Expected a function";function om(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(NM);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var l=e.apply(this,r);return n.cache=s.set(o,l)||s,l};return n.cache=new(om.Cache||li),n}om.Cache=li;var DM=500;function FM(e){var t=om(e,function(r){return n.size===DM&&n.clear(),r}),n=t.cache;return t}var BM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zM=/\\(\\)?/g,UM=FM(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(BM,function(n,r,o,s){t.push(o?s.replace(zM,"$1"):r||n)}),t});function ci(e){return e==null?"":md(e)}function va(e,t){return yr(e)?e:fM(e,t)?[e]:UM(ci(e))}function rc(e){if(typeof e=="string"||hd(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function im(e,t){t=va(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[rc(t[n++])];return n&&n==r?e:void 0}function WM(e,t,n){var r=e==null?void 0:im(e,t);return r===void 0?n:r}function sm(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var Tx=Zr?Zr.isConcatSpreadable:void 0;function HM(e){return yr(e)||ma(e)||!!(Tx&&e&&e[Tx])}function VM(e,t,n,r,o){var s=-1,l=e.length;for(n||(n=HM),o||(o=[]);++s<l;){var c=e[s];n(c)?sm(o,c):o[o.length]=c}return o}function KM(e){var t=e==null?0:e.length;return t?VM(e):[]}function $x(e){return mx(vx(e,void 0,KM),e+"")}var am=Px(Object.getPrototypeOf,Object),qM="[object Object]",GM=Function.prototype,QM=Object.prototype,jx=GM.toString,YM=QM.hasOwnProperty,JM=jx.call(Object);function Ax(e){if(!Fo(e)||ks(e)!=qM)return!1;var t=am(e);if(t===null)return!0;var n=YM.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&jx.call(n)==JM}function Mx(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(o);++r<o;)s[r]=e[r+t];return s}function lm(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Mx(e,t,n)}var XM="\\ud800-\\udfff",ZM="\\u0300-\\u036f",e_="\\ufe20-\\ufe2f",t_="\\u20d0-\\u20ff",n_=ZM+e_+t_,r_="\\ufe0e\\ufe0f",o_="\\u200d",i_=RegExp("["+o_+XM+n_+r_+"]");function Cd(e){return i_.test(e)}function s_(e){return e.split("")}var _x="\\ud800-\\udfff",a_="\\u0300-\\u036f",l_="\\ufe20-\\ufe2f",c_="\\u20d0-\\u20ff",u_=a_+l_+c_,d_="\\ufe0e\\ufe0f",f_="["+_x+"]",cm="["+u_+"]",um="\\ud83c[\\udffb-\\udfff]",p_="(?:"+cm+"|"+um+")",Ix="[^"+_x+"]",Lx="(?:\\ud83c[\\udde6-\\uddff]){2}",Nx="[\\ud800-\\udbff][\\udc00-\\udfff]",h_="\\u200d",Dx=p_+"?",Fx="["+d_+"]?",m_="(?:"+h_+"(?:"+[Ix,Lx,Nx].join("|")+")"+Fx+Dx+")*",g_=Fx+Dx+m_,y_="(?:"+[Ix+cm+"?",cm,Lx,Nx,f_].join("|")+")",v_=RegExp(um+"(?="+um+")|"+y_+g_,"g");function b_(e){return e.match(v_)||[]}function Rd(e){return Cd(e)?b_(e):s_(e)}function Bx(e){return function(t){t=ci(t);var n=Cd(t)?Rd(t):void 0,r=n?n[0]:t.charAt(0),o=n?lm(n,1).join(""):t.slice(1);return r[e]()+o}}var Ed=Bx("toUpperCase");function zx(e){return Ed(ci(e).toLowerCase())}function x_(e,t,n,r){for(var o=-1,s=e==null?0:e.length;++o<s;)n=t(n,e[o],o,e);return n}function w_(e){return function(t){return e==null?void 0:e[t]}}var S_={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},C_=w_(S_),R_=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,E_="\\u0300-\\u036f",k_="\\ufe20-\\ufe2f",P_="\\u20d0-\\u20ff",O_=E_+k_+P_,T_="["+O_+"]",$_=RegExp(T_,"g");function j_(e){return e=ci(e),e&&e.replace(R_,C_).replace($_,"")}var A_=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function M_(e){return e.match(A_)||[]}var __=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function I_(e){return __.test(e)}var Ux="\\ud800-\\udfff",L_="\\u0300-\\u036f",N_="\\ufe20-\\ufe2f",D_="\\u20d0-\\u20ff",F_=L_+N_+D_,Wx="\\u2700-\\u27bf",Hx="a-z\\xdf-\\xf6\\xf8-\\xff",B_="\\xac\\xb1\\xd7\\xf7",z_="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",U_="\\u2000-\\u206f",W_=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Vx="A-Z\\xc0-\\xd6\\xd8-\\xde",H_="\\ufe0e\\ufe0f",Kx=B_+z_+U_+W_,qx="['’]",Gx="["+Kx+"]",V_="["+F_+"]",Qx="\\d+",K_="["+Wx+"]",Yx="["+Hx+"]",Jx="[^"+Ux+Kx+Qx+Wx+Hx+Vx+"]",q_="\\ud83c[\\udffb-\\udfff]",G_="(?:"+V_+"|"+q_+")",Q_="[^"+Ux+"]",Xx="(?:\\ud83c[\\udde6-\\uddff]){2}",Zx="[\\ud800-\\udbff][\\udc00-\\udfff]",ba="["+Vx+"]",Y_="\\u200d",e1="(?:"+Yx+"|"+Jx+")",J_="(?:"+ba+"|"+Jx+")",t1="(?:"+qx+"(?:d|ll|m|re|s|t|ve))?",n1="(?:"+qx+"(?:D|LL|M|RE|S|T|VE))?",r1=G_+"?",o1="["+H_+"]?",X_="(?:"+Y_+"(?:"+[Q_,Xx,Zx].join("|")+")"+o1+r1+")*",Z_="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",eI="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",tI=o1+r1+X_,nI="(?:"+[K_,Xx,Zx].join("|")+")"+tI,rI=RegExp([ba+"?"+Yx+"+"+t1+"(?="+[Gx,ba,"$"].join("|")+")",J_+"+"+n1+"(?="+[Gx,ba+e1,"$"].join("|")+")",ba+"?"+e1+"+"+t1,ba+"+"+n1,eI,Z_,Qx,nI].join("|"),"g");function oI(e){return e.match(rI)||[]}function iI(e,t,n){return e=ci(e),t=t,t===void 0?I_(e)?oI(e):M_(e):e.match(t)||[]}var sI="['’]",aI=RegExp(sI,"g");function kd(e){return function(t){return x_(iI(j_(t).replace(aI,"")),e,"")}}var lI=kd(function(e,t,n){return t=t.toLowerCase(),e+(n?zx(t):t)});function cI(){this.__data__=new ai,this.size=0}function uI(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function dI(e){return this.__data__.get(e)}function fI(e){return this.__data__.has(e)}var pI=200;function hI(e,t){var n=this.__data__;if(n instanceof ai){var r=n.__data__;if(!nc||r.length<pI-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new li(r)}return n.set(e,t),this.size=n.size,this}function Bo(e){var t=this.__data__=new ai(e);this.size=t.size}Bo.prototype.clear=cI,Bo.prototype.delete=uI,Bo.prototype.get=dI,Bo.prototype.has=fI,Bo.prototype.set=hI;function mI(e,t){return e&&ha(t,xd(t),e)}function gI(e,t){return e&&ha(t,ec(t),e)}var i1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,s1=i1&&typeof module=="object"&&module&&!module.nodeType&&module,yI=s1&&s1.exports===i1,a1=yI?wo.Buffer:void 0,l1=a1?a1.allocUnsafe:void 0;function c1(e,t){if(t)return e.slice();var n=e.length,r=l1?l1(n):new e.constructor(n);return e.copy(r),r}function vI(e,t){for(var n=-1,r=e==null?0:e.length,o=0,s=[];++n<r;){var l=e[n];t(l,n,e)&&(s[o++]=l)}return s}function u1(){return[]}var bI=Object.prototype,xI=bI.propertyIsEnumerable,d1=Object.getOwnPropertySymbols,dm=d1?function(e){return e==null?[]:(e=Object(e),vI(d1(e),function(t){return xI.call(e,t)}))}:u1;function wI(e,t){return ha(e,dm(e),t)}var SI=Object.getOwnPropertySymbols,f1=SI?function(e){for(var t=[];e;)sm(t,dm(e)),e=am(e);return t}:u1;function CI(e,t){return ha(e,f1(e),t)}function p1(e,t,n){var r=t(e);return yr(e)?r:sm(r,n(e))}function fm(e){return p1(e,xd,dm)}function h1(e){return p1(e,ec,f1)}var pm=Os(wo,"DataView"),hm=Os(wo,"Promise"),mm=Os(wo,"Set"),m1="[object Map]",RI="[object Object]",g1="[object Promise]",y1="[object Set]",v1="[object WeakMap]",b1="[object DataView]",EI=Ps(pm),kI=Ps(nc),PI=Ps(hm),OI=Ps(mm),TI=Ps(Jh),eo=ks;(pm&&eo(new pm(new ArrayBuffer(1)))!=b1||nc&&eo(new nc)!=m1||hm&&eo(hm.resolve())!=g1||mm&&eo(new mm)!=y1||Jh&&eo(new Jh)!=v1)&&(eo=function(e){var t=ks(e),n=t==RI?e.constructor:void 0,r=n?Ps(n):"";if(r)switch(r){case EI:return b1;case kI:return m1;case PI:return g1;case OI:return y1;case TI:return v1}return t});var $I=Object.prototype,jI=$I.hasOwnProperty;function AI(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&jI.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Pd=wo.Uint8Array;function gm(e){var t=new e.constructor(e.byteLength);return new Pd(t).set(new Pd(e)),t}function MI(e,t){var n=t?gm(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var _I=/\w*$/;function II(e){var t=new e.constructor(e.source,_I.exec(e));return t.lastIndex=e.lastIndex,t}var x1=Zr?Zr.prototype:void 0,w1=x1?x1.valueOf:void 0;function LI(e){return w1?Object(w1.call(e)):{}}function S1(e,t){var n=t?gm(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var NI="[object Boolean]",DI="[object Date]",FI="[object Map]",BI="[object Number]",zI="[object RegExp]",UI="[object Set]",WI="[object String]",HI="[object Symbol]",VI="[object ArrayBuffer]",KI="[object DataView]",qI="[object Float32Array]",GI="[object Float64Array]",QI="[object Int8Array]",YI="[object Int16Array]",JI="[object Int32Array]",XI="[object Uint8Array]",ZI="[object Uint8ClampedArray]",eL="[object Uint16Array]",tL="[object Uint32Array]";function nL(e,t,n){var r=e.constructor;switch(t){case VI:return gm(e);case NI:case DI:return new r(+e);case KI:return MI(e,n);case qI:case GI:case QI:case YI:case JI:case XI:case ZI:case eL:case tL:return S1(e,n);case FI:return new r;case BI:case WI:return new r(e);case zI:return II(e);case UI:return new r;case HI:return LI(e)}}function C1(e){return typeof e.constructor=="function"&&!vd(e)?tA(am(e)):{}}var rL="[object Map]";function oL(e){return Fo(e)&&eo(e)==rL}var R1=ya&&ya.isMap,iL=R1?nm(R1):oL,sL="[object Set]";function aL(e){return Fo(e)&&eo(e)==sL}var E1=ya&&ya.isSet,lL=E1?nm(E1):aL,cL=1,uL=2,dL=4,k1="[object Arguments]",fL="[object Array]",pL="[object Boolean]",hL="[object Date]",mL="[object Error]",P1="[object Function]",gL="[object GeneratorFunction]",yL="[object Map]",vL="[object Number]",O1="[object Object]",bL="[object RegExp]",xL="[object Set]",wL="[object String]",SL="[object Symbol]",CL="[object WeakMap]",RL="[object ArrayBuffer]",EL="[object DataView]",kL="[object Float32Array]",PL="[object Float64Array]",OL="[object Int8Array]",TL="[object Int16Array]",$L="[object Int32Array]",jL="[object Uint8Array]",AL="[object Uint8ClampedArray]",ML="[object Uint16Array]",_L="[object Uint32Array]",tn={};tn[k1]=tn[fL]=tn[RL]=tn[EL]=tn[pL]=tn[hL]=tn[kL]=tn[PL]=tn[OL]=tn[TL]=tn[$L]=tn[yL]=tn[vL]=tn[O1]=tn[bL]=tn[xL]=tn[wL]=tn[SL]=tn[jL]=tn[AL]=tn[ML]=tn[_L]=!0,tn[mL]=tn[P1]=tn[CL]=!1;function oc(e,t,n,r,o,s){var l,c=t&cL,u=t&uL,f=t&dL;if(n&&(l=o?n(e,r,o,s):n(e)),l!==void 0)return l;if(!vr(e))return e;var p=yr(e);if(p){if(l=AI(e),!c)return Xh(e,l)}else{var m=eo(e),g=m==P1||m==gL;if(ga(e))return c1(e,c);if(m==O1||m==k1||g&&!o){if(l=u||g?{}:C1(e),!c)return u?CI(e,gI(l,e)):wI(e,mI(l,e))}else{if(!tn[m])return o?e:{};l=nL(e,m,c)}}s||(s=new Bo);var S=s.get(e);if(S)return S;s.set(e,l),lL(e)?e.forEach(function(x){l.add(oc(x,t,n,x,e,s))}):iL(e)&&e.forEach(function(x,R){l.set(R,oc(x,t,n,R,e,s))});var w=f?u?h1:fm:u?ec:xd,v=p?void 0:w(e);return cA(v||e,function(x,R){v&&(R=x,x=e[R]),em(l,R,oc(x,t,n,R,e,s))}),l}var IL=1,LL=4;function NL(e){return oc(e,IL|LL)}var DL="__lodash_hash_undefined__";function FL(e){return this.__data__.set(e,DL),this}function BL(e){return this.__data__.has(e)}function Od(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new li;++t<n;)this.add(e[t])}Od.prototype.add=Od.prototype.push=FL,Od.prototype.has=BL;function zL(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function UL(e,t){return e.has(t)}var WL=1,HL=2;function T1(e,t,n,r,o,s){var l=n&WL,c=e.length,u=t.length;if(c!=u&&!(l&&u>c))return!1;var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var m=-1,g=!0,S=n&HL?new Od:void 0;for(s.set(e,t),s.set(t,e);++m<c;){var w=e[m],v=t[m];if(r)var x=l?r(v,w,m,t,e,s):r(w,v,m,e,t,s);if(x!==void 0){if(x)continue;g=!1;break}if(S){if(!zL(t,function(R,k){if(!UL(S,k)&&(w===R||o(w,R,n,r,s)))return S.push(k)})){g=!1;break}}else if(!(w===v||o(w,v,n,r,s))){g=!1;break}}return s.delete(e),s.delete(t),g}function VL(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}function KL(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var qL=1,GL=2,QL="[object Boolean]",YL="[object Date]",JL="[object Error]",XL="[object Map]",ZL="[object Number]",eN="[object RegExp]",tN="[object Set]",nN="[object String]",rN="[object Symbol]",oN="[object ArrayBuffer]",iN="[object DataView]",$1=Zr?Zr.prototype:void 0,ym=$1?$1.valueOf:void 0;function sN(e,t,n,r,o,s,l){switch(n){case iN:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case oN:return!(e.byteLength!=t.byteLength||!s(new Pd(e),new Pd(t)));case QL:case YL:case ZL:return Jl(+e,+t);case JL:return e.name==t.name&&e.message==t.message;case eN:case nN:return e==t+"";case XL:var c=VL;case tN:var u=r&qL;if(c||(c=KL),e.size!=t.size&&!u)return!1;var f=l.get(e);if(f)return f==t;r|=GL,l.set(e,t);var p=T1(c(e),c(t),r,o,s,l);return l.delete(e),p;case rN:if(ym)return ym.call(e)==ym.call(t)}return!1}var aN=1,lN=Object.prototype,cN=lN.hasOwnProperty;function uN(e,t,n,r,o,s){var l=n&aN,c=fm(e),u=c.length,f=fm(t),p=f.length;if(u!=p&&!l)return!1;for(var m=u;m--;){var g=c[m];if(!(l?g in t:cN.call(t,g)))return!1}var S=s.get(e),w=s.get(t);if(S&&w)return S==t&&w==e;var v=!0;s.set(e,t),s.set(t,e);for(var x=l;++m<u;){g=c[m];var R=e[g],k=t[g];if(r)var O=l?r(k,R,g,t,e,s):r(R,k,g,e,t,s);if(!(O===void 0?R===k||o(R,k,n,r,s):O)){v=!1;break}x||(x=g=="constructor")}if(v&&!x){var $=e.constructor,j=t.constructor;$!=j&&"constructor"in e&&"constructor"in t&&!(typeof $=="function"&&$ instanceof $&&typeof j=="function"&&j instanceof j)&&(v=!1)}return s.delete(e),s.delete(t),v}var dN=1,j1="[object Arguments]",A1="[object Array]",Td="[object Object]",fN=Object.prototype,M1=fN.hasOwnProperty;function pN(e,t,n,r,o,s){var l=yr(e),c=yr(t),u=l?A1:eo(e),f=c?A1:eo(t);u=u==j1?Td:u,f=f==j1?Td:f;var p=u==Td,m=f==Td,g=u==f;if(g&&ga(e)){if(!ga(t))return!1;l=!0,p=!1}if(g&&!p)return s||(s=new Bo),l||bd(e)?T1(e,t,n,r,o,s):sN(e,t,u,n,r,o,s);if(!(n&dN)){var S=p&&M1.call(e,"__wrapped__"),w=m&&M1.call(t,"__wrapped__");if(S||w){var v=S?e.value():e,x=w?t.value():t;return s||(s=new Bo),o(v,x,n,r,s)}}return g?(s||(s=new Bo),uN(e,t,n,r,o,s)):!1}function _1(e,t,n,r,o){return e===t?!0:e==null||t==null||!Fo(e)&&!Fo(t)?e!==e&&t!==t:pN(e,t,n,r,_1,o)}function hN(e,t){return e!=null&&t in Object(e)}function I1(e,t,n){t=va(t,e);for(var r=-1,o=t.length,s=!1;++r<o;){var l=rc(t[r]);if(!(s=e!=null&&n(e,l)))break;e=e[l]}return s||++r!=o?s:(o=e==null?0:e.length,!!o&&tm(o)&&yd(l,o)&&(yr(e)||ma(e)))}function mN(e,t){return e!=null&&I1(e,t,hN)}function gN(e){return function(t){return t==null?void 0:t[e]}}function yN(e){return function(t,n,r){for(var o=-1,s=Object(t),l=r(t),c=l.length;c--;){var u=l[++o];if(n(s[u],u,s)===!1)break}return t}}var vN=yN(),vm=function(){return wo.Date.now()},bN="Expected a function",xN=Math.max,wN=Math.min;function L1(e,t,n){var r,o,s,l,c,u,f=0,p=!1,m=!1,g=!0;if(typeof e!="function")throw new TypeError(bN);t=qh(t)||0,vr(n)&&(p=!!n.leading,m="maxWait"in n,s=m?xN(qh(n.maxWait)||0,t):s,g="trailing"in n?!!n.trailing:g);function S(T){var M=r,N=o;return r=o=void 0,f=T,l=e.apply(N,M),l}function w(T){return f=T,c=setTimeout(R,t),p?S(T):l}function v(T){var M=T-u,N=T-f,F=t-M;return m?wN(F,s-N):F}function x(T){var M=T-u,N=T-f;return u===void 0||M>=t||M<0||m&&N>=s}function R(){var T=vm();if(x(T))return k(T);c=setTimeout(R,v(T))}function k(T){return c=void 0,g&&r?S(T):(r=o=void 0,l)}function O(){c!==void 0&&clearTimeout(c),f=0,r=u=o=c=void 0}function $(){return c===void 0?l:k(vm())}function j(){var T=vm(),M=x(T);if(r=arguments,o=this,u=T,M){if(c===void 0)return w(u);if(m)return clearTimeout(c),c=setTimeout(R,t),S(u)}return c===void 0&&(c=setTimeout(R,t)),l}return j.cancel=O,j.flush=$,j}function bm(e,t,n){(n!==void 0&&!Jl(e[t],n)||n===void 0&&!(t in e))&&Zh(e,t,n)}function SN(e){return Fo(e)&&Xl(e)}function xm(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function CN(e){return ha(e,ec(e))}function RN(e,t,n,r,o,s,l){var c=xm(e,n),u=xm(t,n),f=l.get(u);if(f){bm(e,n,f);return}var p=s?s(c,u,n+"",e,t,l):void 0,m=p===void 0;if(m){var g=yr(u),S=!g&&ga(u),w=!g&&!S&&bd(u);p=u,g||S||w?yr(c)?p=c:SN(c)?p=Xh(c):S?(m=!1,p=c1(u,!0)):w?(m=!1,p=S1(u,!0)):p=[]:Ax(u)||ma(u)?(p=c,ma(c)?p=CN(c):(!vr(c)||Qh(c))&&(p=C1(u))):m=!1}m&&(l.set(u,p),o(p,u,r,s,l),l.delete(u)),bm(e,n,p)}function N1(e,t,n,r,o){e!==t&&vN(t,function(s,l){if(o||(o=new Bo),vr(s))RN(e,t,l,n,N1,r,o);else{var c=r?r(xm(e,l),s,l+"",e,t,o):void 0;c===void 0&&(c=s),bm(e,l,c)}},ec)}function EN(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var kN=Object.prototype,PN=kN.hasOwnProperty;function ON(e,t){return e!=null&&PN.call(e,t)}function TN(e,t){return e!=null&&I1(e,t,ON)}function $N(e,t){return Kh(t,function(n){return e[n]})}function jN(e){return e==null?[]:$N(e,xd(e))}function AN(e,t){return t.length<2?e:im(e,Mx(t,0,-1))}var MN="[object Map]",_N="[object Set]",IN=Object.prototype,LN=IN.hasOwnProperty;function NN(e){if(e==null)return!0;if(Xl(e)&&(yr(e)||typeof e=="string"||typeof e.splice=="function"||ga(e)||bd(e)||ma(e)))return!e.length;var t=eo(e);if(t==MN||t==_N)return!e.size;if(vd(e))return!Ox(e).length;for(var n in e)if(LN.call(e,n))return!1;return!0}function DN(e,t){return _1(e,t)}var FN=kd(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),BN=Bx("toLowerCase"),D1=xA(function(e,t,n){N1(e,t,n)}),zN=Object.prototype,UN=zN.hasOwnProperty;function F1(e,t){t=va(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var o=rc(t[n]);if(o==="__proto__"&&!UN.call(e,"__proto__")||(o==="constructor"||o==="prototype")&&n<r-1)return!1}var s=AN(e,t);return s==null||delete s[rc(EN(t))]}function WN(e){return Ax(e)?void 0:e}var HN=1,VN=2,KN=4,qN=$x(function(e,t){var n={};if(e==null)return n;var r=!1;t=Kh(t,function(s){return s=va(s,e),r||(r=s.length>1),s}),ha(e,h1(e),n),r&&(n=oc(n,HN|VN|KN,WN));for(var o=t.length;o--;)F1(n,t[o]);return n});function B1(e,t,n,r){if(!vr(e))return e;t=va(t,e);for(var o=-1,s=t.length,l=s-1,c=e;c!=null&&++o<s;){var u=rc(t[o]),f=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(o!=l){var p=c[u];f=void 0,f===void 0&&(f=vr(p)?p:yd(t[o+1])?[]:{})}em(c,u,f),c=c[u]}return e}function GN(e,t,n){for(var r=-1,o=t.length,s={};++r<o;){var l=t[r],c=im(e,l);n(c,l)&&B1(s,va(l,e),c)}return s}var QN=9007199254740991,YN=Math.floor;function z1(e,t){var n="";if(!e||t<1||t>QN)return n;do t%2&&(n+=e),t=YN(t/2),t&&(e+=e);while(t);return n}var JN=gN("length"),U1="\\ud800-\\udfff",XN="\\u0300-\\u036f",ZN="\\ufe20-\\ufe2f",eD="\\u20d0-\\u20ff",tD=XN+ZN+eD,nD="\\ufe0e\\ufe0f",rD="["+U1+"]",wm="["+tD+"]",Sm="\\ud83c[\\udffb-\\udfff]",oD="(?:"+wm+"|"+Sm+")",W1="[^"+U1+"]",H1="(?:\\ud83c[\\udde6-\\uddff]){2}",V1="[\\ud800-\\udbff][\\udc00-\\udfff]",iD="\\u200d",K1=oD+"?",q1="["+nD+"]?",sD="(?:"+iD+"(?:"+[W1,H1,V1].join("|")+")"+q1+K1+")*",aD=q1+K1+sD,lD="(?:"+[W1+wm+"?",wm,H1,V1,rD].join("|")+")",G1=RegExp(Sm+"(?="+Sm+")|"+lD+aD,"g");function cD(e){for(var t=G1.lastIndex=0;G1.test(e);)++t;return t}function $d(e){return Cd(e)?cD(e):JN(e)}var uD=Math.ceil;function jd(e,t){t=t===void 0?" ":md(t);var n=t.length;if(n<2)return n?z1(t,e):t;var r=z1(t,uD(e/$d(t)));return Cd(t)?lm(Rd(r),0,e).join(""):r.slice(0,e)}var dD=Math.ceil,fD=Math.floor;function pD(e,t,n){e=ci(e),t=Gh(t);var r=t?$d(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return jd(fD(o),n)+e+jd(dD(o),n)}function hD(e,t,n){e=ci(e),t=Gh(t);var r=t?$d(e):0;return t&&r<t?e+jd(t-r,n):e}function mD(e,t,n){e=ci(e),t=Gh(t);var r=t?$d(e):0;return t&&r<t?jd(t-r,n)+e:e}function gD(e,t){return GN(e,t,function(n,r){return mN(e,r)})}var yD=$x(function(e,t){return e==null?{}:gD(e,t)}),vD=Math.floor,bD=Math.random;function xD(e,t){return e+vD(bD()*(t-e+1))}function Q1(e,t){var n=-1,r=e.length,o=r-1;for(t=t===void 0?r:t;++n<t;){var s=xD(n,o),l=e[s];e[s]=e[n],e[n]=l}return e.length=t,e}function wD(e,t,n){return e==null?e:B1(e,t,n)}function SD(e){return Q1(Xh(e))}function CD(e){return Q1(jN(e))}function RD(e){var t=yr(e)?SD:CD;return t(e)}var ED=kd(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Y1=kd(function(e,t,n){return e+(n?" ":"")+Ed(t)}),kD="Expected a function";function PD(e,t,n){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(kD);return vr(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),L1(e,t,{leading:r,maxWait:t,trailing:o})}function OD(e,t){for(var n=e.length;n--&&gx(t,e[n],0)>-1;);return n}function TD(e,t){for(var n=-1,r=e.length;++n<r&&gx(t,e[n],0)>-1;);return n}function $D(e,t,n){if(e=ci(e),e&&t===void 0)return cx(e);if(!e||!(t=md(t)))return e;var r=Rd(e),o=Rd(t),s=TD(r,o),l=OD(r,o)+1;return lm(r,s,l).join("")}function jD(e,t){return e==null?!0:F1(e,t)}class AD extends pa{constructor(t=[]){super(),Ar(this,"_configuration",{}),Ar(this,"singletons",{}),Ar(this,"loaders",{}),this.providers=t}get services(){return Object.entries(this.loaders).map(([t,n])=>({name:t,...n}))}get configuration(){return this._configuration}loadConfiguration(){if(document.getElementById("luminix-data::config")){const t=rx("config");t&&typeof t=="object"&&this.withConfiguration(t)}}bind(t,n){if(typeof t!="string")throw new TypeError("Service name must be a string.");this.loaders[t]={loader:n}}singleton(t,n){if(typeof t!="string")throw new TypeError("Service name must be a string.");this.loaders[t]={loader:n,singleton:!0}}instance(t,n){if(typeof t!="string")throw new TypeError("Service name must be a string.");this.loaders[t]={loader:()=>n,singleton:!0}}make(t){const n=this.loaders[t];if(!n)throw new Error(`Service '${t}' is not bound in the container.`);return n.singleton?(this.singletons[t]||(this.singletons[t]=n.loader()),this.singletons[t]):n.loader()}withConfiguration(t){return D1(this._configuration,t),this}withProviders(t){return this.providers.push(...t),this}create(){if(this.services.length>0){console.warn("[Luminix] Application already created. Skipping double invocation of `create()`. If you want to re-create the application, please flush it first.");return}this.loadConfiguration();const t=this.providers.map(n=>new n(this));this.emit("init",t),t.forEach(n=>{n.register&&n.register()}),this.emit("booting"),t.forEach(n=>{n.boot&&n.boot()}),this.emit("booted"),this.once("flushing",()=>{t.forEach(n=>{n.flush&&n.flush()})}),this.emit("ready")}flush(){this.emit("flushing"),this.singletons={},this.loaders={},this._configuration={},this.providers=[],this.emit("flushed"),this.flushEvents()}dump(t=!1){const n={configuration:this.configuration,services:this.services,providers:this.providers,singletons:this.singletons};if(t===!0)return n;const r=this.make("log");t===!1&&r.info(n),r.info(t,n)}}function Mi(e){return class extends e{constructor(...t){return super(...t),Ar(this,"_macros",{}),new Proxy(this,{get(n,r,o){return Reflect.has(n,r)?Reflect.get(n,r,o):typeof r=="string"&&n.hasMacro(r)?n._macros[r].bind(n):Reflect.get(n,r,o)}})}macro(t,n){if(typeof n!="function")throw new TypeError("Macro must be a function");this._macros[t]=n}hasMacro(t){return t in this._macros&&typeof this._macros[t]=="function"}flushMacros(){this._macros={}}}}class MD{get(t,n,r){return WM(t,n,r)}has(t,n){return TN(t,n)}isEmpty(t){return NN(t)}isEqual(t,n){return DN(t,n)}merge(t,...n){let r;try{r=structuredClone(t)}catch{r=NL(t)}return D1(r,...n),r}omit(t,...n){return qN(t,...n)}pick(t,...n){return yD(t,...n)}set(t,n,r){wD(t,n,r)}unset(t,n){jD(t,n)}fromQuery(t){const n={};for(const[r,o]of t.entries())this.set(n,r,o);return n}fromFormData(t){return this.fromQuery(t)}toQuery(t){return W0(t,new URLSearchParams)}toFormData(t){return W0(t,new FormData)}}const Me=new(Mi(MD));class Cm{constructor(t,n){this._response=t,this._error=n}error(){return this._error}body(){return typeof this._response.data=="object"?JSON.stringify(this._response.data):String(this._response.data)}json(t,n){return t?Me.get(this._response.data,t,n):this._response.data}has(t){return Me.has(this._response.data,t)}status(){return Number(this._response.status)}successful(){return this.status()>=200&&this.status()<300}redirect(){return this.status()>=300&&this.status()<400}clientError(){return this.status()>=400&&this.status()<500}serverError(){return this.status()>=500}failed(){return this.clientError()||this.serverError()}header(t){return this._response.headers[t]}headers(){return this._response.headers}ok(){return this.status()===200}created(){return this.status()===201}accepted(){return this.status()===202}noContent(){return this.status()===204}movedPermanently(){return this.status()===301}found(){return this.status()===302}badRequest(){return this.status()===400}unauthorized(){return this.status()===401}paymentRequired(){return this.status()===402}forbidden(){return this.status()===403}notFound(){return this.status()===404}requestTimeout(){return this.status()===408}conflict(){return this.status()===409}unprocessableEntity(){return this.status()===422}tooManyRequests(){return this.status()===429}throw(){if(this.failed())throw this._error||new Error(this.body());return this}throwIf(t){return typeof t=="function"?t(this)?this.throw():this:t?this.throw():this}throwUnless(t){return typeof t=="function"?t(this)?this:this.throw():t?this:this.throw()}throwIfStatus(t){return typeof t=="function"&&t(this.status(),this)?this.throw():this.status()===t?this.throw():this}throwUnlessStatus(t){return typeof t=="function"&&!t(this.status(),this)?this.throw():this.status()===t?this:this.throw()}throwIfClientError(){return this.clientError()?this.throw():this}throwIfServerError(){return this.serverError()?this.throw():this}}var J1;J1=Symbol.toStringTag;let ic=class{constructor(t){Ar(this,"promise"),Ar(this,"response"),Ar(this,J1,"Request"),this.promise=new Promise((n,r)=>{wn(t).then(o=>{this.response=new Cm(o),n(this.response)}).catch(o=>{Z$(o)&&o.response?(this.response=new Cm(o.response,o),n(this.response)):r(o)})})}then(t,n){return this.promise.then(t,n)}catch(t){return this.promise.catch(t)}finally(t){return this.promise.finally(t)}};class _D{constructor(t={}){this.options=t}parseData(t){return Me.get(this.options,"headers[Content-Type]","application/json")==="application/x-www-form-urlencoded"&&t?Me.toFormData(t||{}):t}baseUrl(t){return Me.set(this.options,"baseURL",t),this}asForm(){return Me.set(this.options,"headers[Content-Type]","application/x-www-form-urlencoded"),this}accept(t){return Me.set(this.options,"headers[Accept]",t),this}acceptJson(){return this.accept("application/json")}withHeaders(t){return Me.set(this.options,"headers",Me.merge(this.options.headers??{},t)),this}replaceHeaders(t){return Me.set(this.options,"headers",t),this}withOptions(t){return this.options=Me.merge(this.options,t),this}replaceOptions(t){return this.options=t,this}withQueryParameters(t){const n=typeof t=="string"?Me.fromQuery(new URLSearchParams(t)):t instanceof URLSearchParams?Me.fromQuery(t):t;return Me.set(this.options,"params",Me.merge(this.options.params||{},n)),this}replaceQueryParameters(t){return Me.set(this.options,"params",typeof t=="string"?Me.fromQuery(new URLSearchParams(t)):t instanceof URLSearchParams?Me.fromQuery(t):t),this}withData(t){const n=Me.get(this.options,"data",{}),r=n instanceof FormData?Me.fromFormData(n):n;return Me.set(this.options,"data",this.parseData(Me.merge(r,t))),this}replaceData(t){return Me.set(this.options,"data",this.parseData(t)),this}withBasicAuth(t,n){return Me.set(this.options,"headers.Authorization",`Basic ${btoa(`${t}:${n}`)}`),this}withToken(t){return Me.set(this.options,"headers.Authorization",`Bearer ${t}`),this}get(t,n){return new ic({...this.options,params:n??this.options.params,url:t})}post(t,n){return new ic({...this.options,method:"post",url:t,data:this.parseData(n??this.options.data)})}put(t,n){return new ic({...this.options,method:"put",url:t,data:this.parseData(n??this.options.data)})}patch(t,n){return new ic({...this.options,method:"patch",url:t,data:this.parseData(n??this.options.data)})}delete(t,n){return new ic({...this.options,method:"delete",params:n??this.options.params,url:t})}}class ID{cartesian(...t){return t.reduce((n,r)=>n.flatMap(o=>r.map(s=>[o,s].flat())))}sampleSize(t,n){return this.shuffle(t).slice(0,n)}shuffle(t){return RD(t)}}const Ad=new(Mi(ID)),ui=e=>{e.emit("change",{items:e.all(),source:e})},Md=(e,t)=>Array.isArray(e)?e[t]??null:e.get(t);function _d(e){return e instanceof Un}var X1,Z1,oe;const LD=class qe extends pa{constructor(t=[]){super(),u2(this,oe),Ar(this,X1,"Collection"),d2(this,oe,t)}get items(){return[...ae(this,oe)]}[(Z1=Symbol.iterator,X1=Symbol.toStringTag,Z1)](){return ae(this,oe)[Symbol.iterator]()}all(){return[...ae(this,oe)]}average(t){return typeof t=="string"?this.avg(t):this.avg()}avg(t){return typeof t=="string"?this.sum(t)/ae(this,oe).length:this.sum()/ae(this,oe).length}chunk(t){const n=[];for(let r=0;r<ae(this,oe).length;r+=t)n.push(ae(this,oe).slice(r,r+t));return new qe(n.map(r=>new qe(r)))}chunkWhile(t){const n=[];let r=new qe;for(let o=0;o<ae(this,oe).length;o++)t(ae(this,oe)[o],o,r)?r.push(ae(this,oe)[o]):(n.push(r),r=new qe);return r.count()>0&&n.push(r),new qe(n)}collapse(){return new qe(ae(this,oe).flat())}collect(){return new qe(ae(this,oe))}combine(t){const n={};return ae(this,oe).forEach((r,o)=>{if(typeof r!="string")throw new TypeError("The `combine` method expects the keys to be strings");n[r]=Md(t,o)}),n}concat(t){return Array.isArray(t)?new qe([...ae(this,oe),...t]):new qe([...ae(this,oe),...t.all()])}contains(t,n){return typeof t=="function"?ae(this,oe).some((r,o)=>t(r,o,this)):ae(this,oe).some(r=>{if(typeof n>"u")return r==t;if(typeof t!="string")throw new TypeError("The key must be a string");return r[t]==n})}containsOneItem(){return ae(this,oe).length===1}containsStrict(t,n){return typeof t=="function"?ae(this,oe).some((r,o)=>t(r,o,this)):ae(this,oe).some(r=>{if(typeof n>"u")return r===t;if(typeof t!="string")throw new TypeError("The key must be a string");return r[t]===n})}count(){return ae(this,oe).length}countBy(t){return typeof t=="function"?ae(this,oe).reduce((n,r,o)=>{const s=t(r,o,this);return n[s]=n[s]?n[s]+1:1,n},{}):ae(this,oe).reduce((n,r)=>{if(!["string","number"].includes(typeof r))throw new TypeError("The countBy method expects the items to be strings or numbers");return n[String(r)]=n[String(r)]?n[String(r)]+1:1,n},{})}crossJoin(...t){return new qe(Ad.cartesian(ae(this,oe),...t.map(n=>Array.isArray(n)?n:n.all())))}diff(t){return Array.isArray(t)?new qe(ae(this,oe).filter(n=>!t.includes(n))):new qe(ae(this,oe).filter(n=>!t.contains(n)))}doesntContain(t,n){return typeof t=="function"?ae(this,oe).every((r,o)=>!t(r,o,this)):ae(this,oe).every(r=>{if(typeof n>"u")return r!=t;if(typeof t!="string")throw new TypeError("The key must be a string");return r[t]!=n})}dump(){console.log(this.toArray())}duplicates(t){return typeof t=="string"?new qe(ae(this,oe).reduce((n,r,o)=>(ae(this,oe).slice(o+1).some(s=>s[t]==r[t])&&n.push(r[t]),n),[])):new qe(ae(this,oe).reduce((n,r,o)=>(ae(this,oe).slice(o+1).some(s=>s==r)&&n.push(r),n),[]))}duplicatesStrict(t){return typeof t=="string"?new qe(ae(this,oe).reduce((n,r,o)=>(ae(this,oe).slice(o+1).some(s=>s[t]===r[t])&&n.push(r[t]),n),[])):new qe(ae(this,oe).reduce((n,r,o)=>(ae(this,oe).slice(o+1).some(s=>s===r)&&n.push(r),n),[]))}each(t){let n=0;for(const r of this){if(t(r,n,this)===!1)break;n++}return this}eachSpread(t){for(const n of this){if(!Array.isArray(n)&&!_d(n))throw new TypeError("The items in the collection must be arrays or collections");const r=Array.isArray(n)?n:n.all();if(t(...r)===!1)break}return this}ensure(t){const n=Array.isArray(t)?t:[t];return ae(this,oe).forEach((r,o)=>{if(!n.some(s=>typeof s=="string"?typeof r===s:r instanceof s))throw new TypeError(`The item at index ${o} is not of the expected type`)}),this}every(t){return ae(this,oe).every((n,r)=>t(n,r,this))}except(t){return new qe(ae(this,oe).filter((n,r)=>!t.includes(r)))}filter(t){return new qe(ae(this,oe).filter((n,r)=>typeof t!="function"?!!n:t(n,r,this)))}first(t){return typeof t=="function"?ae(this,oe).find((n,r)=>t(n,r,this))??null:ae(this,oe)[0]??null}firstOrFail(t){const n=this.first(t);if(n===null)throw new Error("No matching item found");return n}firstWhere(t,n,r){if(typeof t!="string")throw new TypeError("The key must be a string");if(typeof n>"u")return this.first(o=>!!o[t]);if(typeof r>"u")return ae(this,oe).find(o=>o[t]==n)??null;if(typeof n!="string")throw new TypeError("The operator must be a string");return r===null?ae(this,oe).find(o=>o[t]===null)??null:ae(this,oe).find(o=>{switch(n){case"=":return o[t]==r;case"!=":return o[t]!=r;case">":return o[t]>r;case"<":return o[t]<r;case">=":return o[t]>=r;case"<=":return o[t]<=r;default:throw new Error("Unsupported operator")}})??null}flatMap(t){return new qe(ae(this,oe).flatMap((n,r)=>t(n,r,this)))}forget(t){return ae(this,oe).splice(t,1),ui(this),this}forPage(t,n){return new qe(ae(this,oe).slice((t-1)*n,t*n))}get(t,n){if(typeof t!="number")throw new TypeError("The key must be a number");return typeof n>"u"?ae(this,oe)[t]??null:typeof n=="function"?ae(this,oe)[t]??n():ae(this,oe)[t]??n}groupBy(t){const n=Array.isArray(t)?t:[t];return ae(this,oe).reduce((r,o,s)=>{const l=n.map(c=>{if(typeof c=="function"){const u=c(o,s,this);return Array.isArray(u)?u:[u]}return[String(o[c])]});return Ad.cartesian(...l).forEach(c=>{const u=Array.isArray(c)?c.join("."):c;Me.set(r,u,[...Me.get(r,u,[]),o])}),r},{})}has(t){return ae(this,oe).length>t}hasAny(t){return t.some(n=>this.has(n))}implode(t,n){if(typeof n>"u"){if(typeof t!="string")throw new TypeError("The glue must be a string");if(!ae(this,oe).every(r=>["string","number"].includes(typeof r)))throw new TypeError("The items must be strings or numbers");return ae(this,oe).join(t)}if(typeof t=="function")return ae(this,oe).map((r,o)=>t(r,o,this)).join(n);if(typeof t!="string")throw new TypeError("The key must be a string");if(!ae(this,oe).every(r=>typeof r=="object"))throw new TypeError("The items must be objects");return ae(this,oe).map(r=>r[t]).join(n)}intersect(t){return Array.isArray(t)?new qe(ae(this,oe).filter(n=>t.includes(n))):new qe(ae(this,oe).filter(n=>t.contains(n)))}isEmpty(){return ae(this,oe).length===0}isNotEmpty(){return!this.isEmpty()}join(t,n){return typeof n>"u"?ae(this,oe).join(t):ae(this,oe).slice(0,-1).join(t)+n+ae(this,oe)[ae(this,oe).length-1]}keyBy(t){if(typeof t=="function")return ae(this,oe).reduce((n,r,o)=>(n[t(r,o,this)]=r,n),{});if(typeof t!="string")throw new TypeError("The key must be a string");return ae(this,oe).reduce((n,r)=>(n[String(r[t])]=r,n),{})}last(t){return typeof t=="function"?ae(this,oe).toReversed().find((n,r)=>t(n,r,this))??null:ae(this,oe)[ae(this,oe).length-1]??null}map(t){return new qe(ae(this,oe).map((n,r)=>t(n,r,this)))}mapInto(t){return new qe(ae(this,oe).map(n=>new t(n)))}mapSpread(t){return new qe(ae(this,oe).map(n=>{if(!Array.isArray(n)&&!_d(n))throw new TypeError("The items in the collection must be arrays or collections");const r=Array.isArray(n)?n:n.all();return t(...r)}))}mapToGroups(t){return ae(this,oe).reduce((n,r,o)=>{const s=t(r,o,this);return Object.entries(s).forEach(([l,c])=>{n[l]=n[l]??[],n[l].push(c)}),n},{})}mapWithKeys(t){return ae(this,oe).reduce((n,r,o)=>{const s=t(r,o,this);return Object.entries(s).forEach(([l,c])=>{n[l]=c}),n},{})}max(t){return typeof t=="string"?ae(this,oe).reduce((n,r)=>r[t]>n?r[t]:n,ae(this,oe)[0][t]):ae(this,oe).reduce((n,r)=>r>n?r:n,ae(this,oe)[0])}median(t){if(typeof t=="string"){const o=this.pluck(t).sort(),s=Math.floor(o.count()/2);return o.count()%2===0?new qe([Md(o,s-1),Md(o,s)]).avg():Md(o,s)}const n=ae(this,oe).toSorted(),r=Math.floor(n.length/2);return n.length%2===0?new qe([n[r-1],n[r]]).avg():n[r]??null}merge(t){return Array.isArray(t)?new qe([...ae(this,oe),...t]):new qe([...ae(this,oe),...t.all()])}min(t){return typeof t=="string"?ae(this,oe).reduce((n,r)=>r[t]<n?r[t]:n,ae(this,oe)[0][t]):ae(this,oe).reduce((n,r)=>r<n?r:n,ae(this,oe)[0])}mode(t){const n=typeof t=="string"?this.filter(o=>["number","string"].includes(typeof o[t])).countBy(o=>o[t]):this.countBy(),r=Math.max(...Object.values(n));return Object.entries(n).filter(([,o])=>o===r).map(([o])=>o)}nth(t,n=0){return this.chunk(t).filter(r=>r.count()>n).map(r=>r.get(n))}only(t){return new qe(ae(this,oe).filter((n,r)=>t.includes(r)))}pad(t,n=null){const r=ae(this,oe).slice();for(;r.length<Math.abs(t);)t>0?r.push(n):r.unshift(n);return new qe(r)}partition(t){return[this.filter(t),this.reject(t)]}percentage(t,n=2){return Math.round(100*(10^n)*this.filter(t).count()/ae(this,oe).length)/(10^n)}pipe(t){return t(this)}pipeInto(t){return new t(this)}pipeThrough(t){return t.reduce((n,r)=>{if(!_d(n)&&!Array.isArray(n))throw new TypeError("The pipeline expects the carry to be a collection or an array");return r(_d(n)?n:new qe(n))},this)}pluck(t){return this.map(n=>n[t])}pop(t=1){const n=ae(this,oe).splice(ae(this,oe).length-t,t);return ui(this),t===1?n[0]??null:new qe(n)}prepend(t){const n=ae(this,oe).unshift(t);return ui(this),n}pull(t){const n=ae(this,oe).splice(t,1)[0]??null;return ui(this),n}push(...t){const n=ae(this,oe).push(...t);return ui(this),n}put(t,n){return ae(this,oe).splice(t,1,n),ui(this),this}random(t=1){if(ae(this,oe).length<t)throw new Error("The collection has fewer items than the requested amount");const n=new qe(Ad.sampleSize(ae(this,oe),t));return t===1?n.first():n}reduce(t,n=null){return ae(this,oe).reduce((r,o,s)=>t(r,o,s,this),n)}reject(t){return this.filter((n,r)=>!t(n,r,this))}replace(t){const n=ae(this,oe).slice();return Object.entries(t).forEach(([r,o])=>{n[parseInt(r)]=o}),new qe(n)}reverse(){return new qe(ae(this,oe).toReversed())}search(t,n=!1){if(typeof t!="function"||ae(this,oe).every(o=>typeof o=="function")){const o=ae(this,oe).findIndex(s=>n?s===t:s==t);return o===-1?!1:o}const r=ae(this,oe).findIndex((o,s)=>t(o,s,this));return r===-1?!1:r}select(t){return this.map(n=>t.reduce((r,o)=>(r[o]=n[o],r),{}))}shift(t=1){const n=ae(this,oe).splice(0,t);return ui(this),t===1?n[0]??null:new qe(n)}shuffle(){return new qe(Ad.shuffle(ae(this,oe)))}skip(t){return new qe(ae(this,oe).slice(t))}skipUntil(t){return typeof t=="function"?this.skip(ae(this,oe).findIndex((n,r)=>t(n,r,this))):this.skip(ae(this,oe).findIndex(n=>n==t))}skipWhile(t){return typeof t=="function"?this.skip(ae(this,oe).findIndex((n,r)=>!t(n,r,this))):this.skip(ae(this,oe).findIndex(n=>n!=t))}slice(t,n){return typeof n>"u"?new qe(ae(this,oe).slice(t)):typeof t>"u"?new qe(ae(this,oe).slice(0,n)):new qe(ae(this,oe).slice(t,t+n))}sliding(t,n=1){const r=[];for(let o=0;o<ae(this,oe).length&&!(o+t>ae(this,oe).length);o+=n)r.push(ae(this,oe).slice(o,o+t));return new qe(r.map(o=>new qe(o)))}sole(t,n){if(typeof t=="function"){const r=this.filter(t);return r.count()===1?r.first():null}if(typeof t=="string"){const r=this.where(t,n);return r.count()===1?r.first():null}return ae(this,oe).length===1?this.first():null}some(...t){return this.contains(...t)}sort(t){return new qe(ae(this,oe).toSorted(t))}sortBy(t,n="asc"){if(typeof t=="function"){let r=-1;return new qe(ae(this,oe).toSorted((o,s)=>(r++,t(o,r,this)-t(s,r,this))))}if(Array.isArray(t))return t.every(r=>Array.isArray(r))?new qe(ae(this,oe).toSorted((r,o)=>{for(const[s,l]of t){const c=r[s]??-1/0,u=o[s]??-1/0;if(c>u)return l==="asc"?1:-1;if(c<u)return l==="asc"?-1:1}return 0})):new qe(ae(this,oe).toSorted((r,o)=>{for(const s of t){const l=s(r,o);if(l!==0)return l}return 0}));if(typeof t!="string")throw new TypeError("The key must be a string");return new qe(ae(this,oe).toSorted((r,o)=>{const s=r[t]??-1/0,l=o[t]??-1/0;return s>l?n==="asc"?1:-1:s<l?n==="asc"?-1:1:0}))}sortDesc(){return this.sort((t,n)=>t>n?-1:t<n?1:0)}splice(t,n,...r){const o=n===void 0?ae(this,oe).length:n,s=ae(this,oe).splice(t,o,...r);return ui(this),new qe(s)}split(t){const n=[];for(let r=0;r<t;r++){const o=ae(this,oe).slice(n.flat().length,n.flat().length+Math.min(Math.ceil((ae(this,oe).length-n.flat().length)/(t-r)),ae(this,oe).length-n.flat().length));n.push(new qe(o))}return new qe(n)}splitIn(t){const n=Math.ceil(ae(this,oe).length/t);return this.chunk(n)}sum(t){return typeof t=="string"?ae(this,oe).reduce((n,r)=>{const o=r[t];if(typeof o!="number")throw new TypeError("The items must be numbers");return n+o},0):ae(this,oe).reduce((n,r)=>{if(typeof r!="number")throw new TypeError("The items must be numbers");return n+r},0)}take(t){return new qe(ae(this,oe).slice(0,t))}takeUntil(t){return typeof t=="function"?this.take(ae(this,oe).findIndex((n,r)=>t(n,r,this))):this.take(ae(this,oe).findIndex(n=>n==t))}takeWhile(t){return typeof t=="function"?this.take(ae(this,oe).findIndex((n,r)=>!t(n,r,this))):this.take(ae(this,oe).findIndex(n=>n!=t))}tap(t){return t(this),this}toArray(){const t=n=>typeof n!="object"?n:Array.isArray(n)?n.map(t):n&&"toArray"in n&&typeof n.toArray=="function"?n.toArray():n&&"toJson"in n&&typeof n.toJson=="function"?n.toJson():n;return ae(this,oe).map(t)}toJson(){return JSON.stringify(ae(this,oe))}transform(t){for(const[n,r]of ae(this,oe).entries())ae(this,oe).splice(n,1,t(r,n,this));return ui(this),this}unique(t){return typeof t=="string"?new qe([...new Set(ae(this,oe).map(n=>n[t]))].map(n=>ae(this,oe).find(r=>r[t]==n))):new qe([...new Set(ae(this,oe))])}uniqueStrict(t){return typeof t=="string"?new qe([...new Set(ae(this,oe).map(n=>n[t]))].map(n=>ae(this,oe).find(r=>r[t]===n))):new qe([...new Set(ae(this,oe))])}unless(t,n,r){return t?typeof r=="function"&&r(this):n(this),this}unlessEmpty(t,n){return this.whenNotEmpty(t,n)}unlessNotEmpty(t,n){return this.whenEmpty(t,n)}value(t){return ae(this,oe).length===0?null:ae(this,oe)[0][t]}when(t,n,r){return t?n(this):typeof r=="function"&&r(this),this}whenEmpty(t,n){return this.isEmpty()?t(this):typeof n=="function"&&n(this),this}whenNotEmpty(t,n){return this.isNotEmpty()?t(this):typeof n=="function"&&n(this),this}where(t,n,r){if(typeof r>"u")return new qe(ae(this,oe).filter(s=>s[t]==n));if(typeof n!="string")throw new TypeError("The operator must be a string");if(r===null)return new qe(ae(this,oe).filter(s=>s[t]===null));const o={"=":s=>s[t]==r,"!=":s=>s[t]!=r,">":s=>s[t]>r,"<":s=>s[t]<r,">=":s=>s[t]>=r,"<=":s=>s[t]<=r};if(!(n in o))throw new Error("Unsupported operator");return new qe(ae(this,oe).filter((s,l)=>o[n](s,l,this)))}whereStrict(t,n,r){if(typeof r>"u")return new qe(ae(this,oe).filter(s=>s[t]===n));if(typeof n!="string")throw new TypeError("The operator must be a string");if(r===null)return new qe(ae(this,oe).filter(s=>s[t]===null));const o={"=":s=>s[t]===r,"!=":s=>s[t]!==r,">":s=>s[t]>r,"<":s=>s[t]<r,">=":s=>s[t]>=r,"<=":s=>s[t]<=r};if(!(n in o))throw new Error("Unsupported operator");return new qe(ae(this,oe).filter((s,l)=>o[n](s,l,this)))}whereBetween(t,[n,r]){return new qe(ae(this,oe).filter(o=>o[t]>=n&&o[t]<=r))}whereNotBetween(t,[n,r]){return new qe(ae(this,oe).filter(o=>o[t]<n||o[t]>r))}whereIn(t,n){return new qe(ae(this,oe).filter(r=>n.includes(r[t])))}whereNotIn(t,n){return new qe(ae(this,oe).filter(r=>!n.includes(r[t])))}whereNull(t){return new qe(ae(this,oe).filter(n=>n[t]===null))}whereNotNull(t){return new qe(ae(this,oe).filter(n=>n[t]!==null))}whereInstanceOf(t){return new qe(ae(this,oe).filter(n=>n instanceof t))}zip(t){return Array.isArray(t)?new qe(ae(this,oe).map((n,r)=>[n,t[r]??null])):new qe(ae(this,oe).map((n,r)=>[n,t.get(r)]))}};oe=new WeakMap;let Un=LD;function So(e,t){return new class extends e{constructor(){return super(),new Proxy(this,{get(n,r){if(Reflect.has(n,r))return Reflect.get(n,r);const o=n.getFacadeAccessor(),s=typeof o=="string"?t.make(o):o;if(!s)throw new Error(`Service ${String(o)} does not exist.`);return Reflect.get(s,r,s)}})}}}class $s extends pa{constructor(t){super(),Ar(this,"locked",[]),this.bag=t,Object.freeze(this.bag)}get(t,n){return Me.get(this.bag,t,n)}set(t,n){if(this.locked.some(r=>t.startsWith(r)))throw new Error(`Cannot set a locked path "${t}"`);if(typeof n=="object"&&n!==null&&this.locked.some(r=>Me.has(n,r.slice(t.length+1))))throw new Error(`Cannot set a path "${t}" that would override a locked path`);if(t==="."){if(this.locked.length)throw new Error("Cannot set the root path when there are locked paths");if(typeof n!="object"||n===null)throw new TypeError("Value must be an object");this.bag=fa(this.bag,()=>n),this.emit("change",{path:t,value:n,type:"set",source:this});return}this.bag=fa(this.bag,r=>{Me.set(r,t,n)}),this.emit("change",{path:t,value:n,type:"set",source:this})}merge(t,n){if(typeof n!="object"||n===null)throw new TypeError("Value must be an object");if(t==="."){if(this.locked.some(o=>Me.has(n,o)))throw new Error(`Cannot merge a path "${t}" that would override a locked path`);this.bag=fa(this.bag,o=>({...o,...n})),this.emit("change",{path:t,value:n,type:"merge",source:this});return}const r=this.get(t);if(typeof r=="object"&&r!==null)return this.set(t,{...r,...n});if(r===null||typeof r>"u")return this.set(t,n);throw new Error(`Cannot merge a non-object path "${t}"`)}has(t){return Me.has(this.bag,t)}delete(t){if(this.locked.some(n=>t.startsWith(n)))throw new Error(`Cannot delete a locked path "${t}"`);this.bag=fa(this.bag,n=>{Me.unset(n,t)}),this.emit("change",{path:t,value:null,type:"delete",source:this})}lock(t){if(!this.has(t))throw new Error(`Cannot lock a non-existing path "${t}"`);this.locked.push(t)}clone(){return new $s(this.bag)}all(){return this.bag}isEmpty(){return Me.isEmpty(this.bag)}}var ew,tw;class ND extends(tw=Error,ew=Symbol.toStringTag,tw){constructor(t,n){super(`[Luminix] Cannot create reducer '${t}' on '${n}' as it is a reserved property`),Ar(this,ew,"ReducerOverrideException")}}function xa(e){return class extends e{constructor(...t){return super(...t),Ar(this,"_reducers",{}),new Proxy(this,{get(n,r,o){return typeof r=="symbol"||r in n?Reflect.get(n,r,o):(s,...l)=>{const{[r]:c=new Un}=n._reducers;return Xr(s)?fa(s,u=>c.sortBy("priority").reduce((f,p)=>p.callback(f,...l),u)):c.sortBy("priority").reduce((u,f)=>f.callback(u,...l),s)}}})}reducer(t,n,r=10){if(t in this)throw new ND(t,this);return this._reducers[t]||(this._reducers[t]=new Un),this._reducers[t].push({callback:n,priority:r}),()=>this.removeReducer(t,n)}removeReducer(t,n){const r=this._reducers[t].search(o=>o.callback===n);r!==!1&&this._reducers[t].pull(r)}getReducer(t){return this._reducers[t]||(this._reducers[t]=new Un),this._reducers[t]}hasReducer(t){return!!this._reducers[t]&&this._reducers[t].count()>0}clearReducer(t){this._reducers[t]&&this._reducers[t].splice(0,this._reducers[t].count())}flushReducers(){Object.values(this._reducers).forEach(t=>t.splice(0,t.count()))}}}class Id{constructor(t){this.app=t}}function nw(e){return e instanceof Cm&&e.unprocessableEntity()&&typeof e.json("message")=="string"&&typeof e.json("errors")=="object"&&e.json("errors")!==null&&Object.values(e.json("errors")).every(t=>Array.isArray(t)&&t.every(n=>typeof n=="string"))}class DD{after(t,n){return t.includes(n)?t.split(n).slice(1).join(""):""}afterLast(t,n){return t.includes(n)?t.split(n).slice(-1).join(""):""}before(t,n){return t.includes(n)?t.split(n).slice(0,1).join(""):""}beforeLast(t,n){return t.includes(n)?t.split(n).slice(0,-1).join(""):""}camel(t){return lI(t)}lcfirst(t){return BN(t)}lower(t){return t.toLowerCase()}kebab(t){return FN(t)}padBoth(t,n,r){return pD(t,n,r)}padLeft(t,n,r){return mD(t,n,r)}padRight(t,n,r){return hD(t,n,r)}human(t){return zx(Y1(t))}studly(t){return Ed(this.camel(t))}snake(t){return ED(t)}title(t){return Y1(t)}trim(t,n){return $D(t,n)}ucfirst(t){return Ed(t)}upper(t){return t.toUpperCase()}}const Ke=new(Mi(DD));class FD{parse(t){return t instanceof Date?t:new Date(t)}toDateTimeLocal(t){const n=this.parse(t),r=`${n.getFullYear()}`,o=`${Ke.padLeft(`${n.getMonth()+1}`,2,"0")}`,s=`${Ke.padLeft(`${n.getDate()}`,2,"0")}`,l=`${Ke.padLeft(`${n.getHours()}`,2,"0")}`,c=`${Ke.padLeft(`${n.getMinutes()}`,2,"0")}`;return`${r}-${o}-${s}T${l}:${c}`}}const sc=new(Mi(FD));class BD{throttle(t,n,r){return PD(t,n,r)}debounce(t,n,r){return L1(t,n,r)}}const Rm=new(Mi(BD));class zD{fromObject(t){return Me.toQuery(t)}toObject(t){return Me.fromQuery(t)}merge(...t){const n=new URLSearchParams;return t.forEach(r=>{(typeof r=="string"?new URLSearchParams(Ke.after(r,"?")):r).forEach((o,s)=>{n.set(s,o)})}),n}}const js=new(Mi(zD));var UD=Object.defineProperty,WD=(e,t,n)=>t in e?UD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zt=(e,t,n)=>WD(e,typeof t!="symbol"?t+"":t,n);class HD{constructor(t,n,r){Zt(this,"_user"),this.config=t,this.model=n,this.route=r}attempt(t,n=!1,r){const o=document.createElement("form");o.method="post",o.action=this.route.url("login"),o.style.display="none";const s=this.config.get("auth.csrf");if(typeof s=="string"){const u=document.createElement("input");u.type="hidden",u.name="_token",u.value=s,o.appendChild(u)}const l=document.createElement("input");l.type="email",l.name="email",l.value=t.email,o.appendChild(l);const c=document.createElement("input");if(c.type="password",c.name="password",c.value=t.password,o.appendChild(c),n){const u=document.createElement("input");u.type="checkbox",u.name="remember",u.value="1",u.checked=!0,o.appendChild(u)}r&&o.addEventListener("submit",r),document.body.appendChild(o),o.submit()}check(){return!!this.config.get("auth.user")}logout(t){const n=document.createElement("form");n.method="post",n.action=this.route.url("logout"),n.style.display="none";const r=this.config.get("auth.csrf");if(typeof r=="string"){const o=document.createElement("input");o.type="hidden",o.name="_token",o.value=r,n.appendChild(o)}document.body.appendChild(n),t&&n.addEventListener("submit",t),n.submit()}user(){if(!this._user){const t=this.model.make("user"),n=this.config.get("auth.user");if(!n)return;this._user=new t(n),this._user.exists=!0}return this._user}id(){var t;return((t=this.user())==null?void 0:t.getKey())||null}}let VD=class{constructor(){Zt(this,"bags");const t={};document.querySelectorAll('#luminix-embed [id^="luminix-error"]').forEach(n=>{const r=n.id.replace("luminix-error::","");t[r]=rx(r,"error")}),this.bags={default:new $s(t)}}bag(t="default"){return this.bags[t]||(this.bags[t]=new $s({})),this.bags[t]}add(t,n,r="default"){this.bag(r).set(t,n)}set(t,n="default"){this.bag(n).set(".",t)}all(t="default"){return this.bag(t).all()}get(t,n="default"){return this.bag(n).get(t,null)}clear(t="default"){this.bag(t).set(".",{})}};class KD{constructor(t){this._debug=t}emergency(...t){this._debug&&console.error(...t)}alert(...t){this._debug&&console.error(...t)}critical(...t){this._debug&&console.error(...t)}error(...t){this._debug&&console.error(...t)}warning(...t){this._debug&&console.warn(...t)}notice(...t){this._debug&&console.info(...t)}info(...t){this._debug&&console.info(...t)}debug(...t){this._debug&&console.debug(...t)}}var rw,ow;let qD=class extends(ow=Error,rw=Symbol.toStringTag,ow){constructor(t){super(`[Luminix] Model "${t}" does not have a primary key`),Zt(this,rw,"ModelWithoutPrimaryKeyException")}},GD=class extends pa{constructor(t,n,r={}){super(),Zt(this,"bag"),this.services=t,this.abstract=n,this.bag=new $s(r),this.bag.on("change",()=>{this.emit("change",{data:this.bag,source:this})})}lock(t){this.bag.lock(t)}whereBetween(t,n){return this.where(t,"between",n)}whereNotBetween(t,n){return this.where(t,"notBetween",n)}whereNull(t){return this.where(t,"null",null)}whereNotNull(t){return this.where(t,"notNull",null)}limit(t){return this.bag.set("per_page",t),this}where(t,n,r){if(this.bag.has("where")||this.bag.set("where",{}),typeof t=="function")return t(this)||this;if(typeof r>"u")return this.bag.set(`where.${t}`,n),this;if(typeof n!="string")throw new Error(`Invalid operator ${n} provided for where clause.`);const o={"=":"","!=":"notEquals",">":"greaterThan",">=":"greaterThanOrEquals","<":"lessThan","<=":"lessThanOrEquals"}[n]||n;return this.bag.set(`where.${t}:${o}`,r),this}with(t){const n=this.bag.get("with",[]);return(Array.isArray(t)?t:[t]).forEach(r=>{n.includes(r)||n.push(r)}),this.bag.set("with",n),this}withOnly(t){return this.bag.set("with",Array.isArray(t)?t:[t]),this}without(t){const n=this.bag.get("with",[]);return(Array.isArray(t)?t:[t]).forEach(r=>{n.includes(r)&&n.splice(n.indexOf(r),1)}),this.bag.set("with",n),this}orderBy(t,n="asc"){return this.bag.set("order_by",`${t}:${n}`),this}searchBy(t){return this.bag.set("q",t),this}minified(){return this.bag.set("minified",1),this}unset(t){return this.bag.delete(t),this}include(t){for(const[n,r]of t.entries())this.bag.set(n,r);return this}async exec(t={}){try{const{page:n=1,replaceLinks:r=!1}=t;this.bag.set("page",n),this.emit("submit",{data:this.bag,source:this});const o=await this.services.route.call(`luminix.${this.abstract}.index`,c=>c.withQueryParameters(this.bag.all())),s=this.services.model.make(this.abstract),l=new Un(o.json("data").map(c=>{const u=new s(c);return u.exists=!0,this.services.model.emit("fetch",{class:this.abstract,model:u,source:this.services.model}),u}));if(r){const c=window.location.href,[u]=c.split("?");return{...o.json(),data:l,links:{first:`${u}?${js.merge(c,o.json("links").first).toString()}`,last:`${u}?${js.merge(c,o.json("links").last).toString()}`,next:o.json("links").next&&`${u}?${js.merge(c,o.json("links").next??"").toString()}`,prev:o.json("links").prev&&`${u}?${js.merge(c,o.json("links").prev??"").toString()}`},meta:{...o.json("meta"),links:o.json("meta").links.map(f=>({...f,url:f.url&&`${u}?${js.merge(c,f.url).toString()}`}))}}}return{...o.json(),data:l}}catch(n){throw this.emit("error",{error:n,source:this}),n}}async get(t={}){const n=await this.exec(t);return this.emit("success",{response:n,items:n.data,source:this}),n}async first(){const t=await this.limit(1).exec();return this.emit("success",{response:t,items:t.data.first(),source:this}),t.data.first()}async find(t){const n=this.services.model.schema(this.abstract).primaryKey;if(!n)throw new qD(this.abstract);const r=await this.where(n,t).limit(1).exec();return this.emit("success",{response:r,items:r.data.sole(),source:this}),r.data.sole()}async all(){const t=this.services.config.get("luminix.backend.api.max_per_page",150),n=await this.limit(t).exec(),r=n.meta.last_page;if(r===1)return n.data;const o=Array.from({length:r-1},(c,u)=>u+2),s=await Promise.all(o.map(c=>this.limit(t).exec({page:c}))),l=new Un(s.reduce((c,u)=>(c.push(...u.data),c),n.data).all());return this.emit("success",{response:{...n,data:l},items:l,source:this}),l}};var iw,sw;class br extends(sw=TypeError,iw=Symbol.toStringTag,sw){constructor(t,n="Model"){super(`[Luminix] "${t}" expects ${n}`),Zt(this,iw,"NotModelException")}}var aw,lw;class QD extends(lw=Error,aw=Symbol.toStringTag,lw){constructor(t,n,r,o){super(`[Luminix] Could not determine inverse relation for "${n}" in model "${t}". Please specify a relation in model "${r}" of type ${o} that points back to "${t}".`),Zt(this,aw,"NoInverseRelationException")}}var cw,uw;let YD=class extends(uw=Error,cw=Symbol.toStringTag,uw){constructor(t){super(`[Luminix] Relation "${t}" is not supported`),Zt(this,cw,"UnsupportedRelationException")}},Ld=class{constructor(t,n,r,o=null){if(Zt(this,"unsubscribeQuery",null),this.services=t,this.meta=n,this.parent=r,this.items=o,o!==null&&!Me.isModel(o)&&!(o instanceof Un&&o.every(Me.isModel)))throw new br("Relation.constructor()","Model, Collection<Model> or null")}make(t){const n=this.getRelated();if(t===null||typeof t>"u"){this.set(null);return}if(this.isSingle()){if(typeof t!="object"||Array.isArray(t))throw new TypeError("Relation.make() expects an object");this.set(new n(t))}if(this.isMultiple()){if(!Array.isArray(t))throw new TypeError("Relation.make() expects an array");this.set(new Un(t.map(r=>new n(r))))}}guessInverseRelation(){const{relations:t}=this.getRelated().getSchema(),n=this.getType(),r=this.services.model.guessInverseRelation({HasOne:["BelongsTo"],HasMany:["BelongsTo"],BelongsTo:["HasOne","HasMany"],BelongsToMany:["BelongsToMany"],MorphTo:["MorphMany","MorphOne"],MorphOne:["MorphTo"],MorphMany:["MorphTo"],MorphToMany:["MorphToMany"]},this.parent,n,this.getRelated());if(!(n in r))throw new YD(n);for(const o in t){const s=t[o];if((s.model===this.parent.getType()||["MorphOne","MorphMany"].includes(n))&&r[n].includes(s.type))return o}throw new QD(this.parent.getType(),n,this.getRelated().getSchemaName(),r[n].join(" or "))}set(t){if(t!==null&&!Me.isModel(t)&&!(t instanceof Un&&t.every(Me.isModel)))throw new br("Relation.set()","Model, Collection<Model> or null");!this.items||Me.isModel(this.items)?this.items=t:t instanceof Un&&this.items.splice(0,this.items.count(),...t)}getForeignKey(){return this.meta.foreignKey}getName(){return this.meta.name}getType(){return this.meta.type}getModel(){return this.meta.model}getRelated(){return this.services.model.make(this.meta.model)}query(){const t=this.getRelated().query();return this.unsubscribeQuery&&this.unsubscribeQuery(),this.unsubscribeQuery=t.on("success",n=>{this.items=n.items}),t}isLoaded(){return this.items!==null}getLoadedItems(){return this.items}isSingle(){return Me.isModel(this.items)}isMultiple(){return this.items instanceof Un}getParent(){return this.parent}where(...t){return this.query().where(...t)}whereNull(t){return this.query().whereNull(t)}whereNotNull(t){return this.query().whereNotNull(t)}whereBetween(t,n){return this.query().whereBetween(t,n)}whereNotBetween(t,n){return this.query().whereNotBetween(t,n)}orderBy(t,n="asc"){return this.query().orderBy(t,n)}searchBy(t){return this.query().searchBy(t)}minified(){return this.query().minified()}limit(t){return this.query().limit(t)}};var dw,fw;class wa extends(fw=Error,dw=Symbol.toStringTag,fw){constructor(t){super(`[Luminix] Expected ${t} to be reducible.`),Zt(this,dw,"NotReducibleException")}}var pw,hw;class JD extends(hw=Error,pw=Symbol.toStringTag,hw){constructor(){super("[Luminix] Method not implemented."),Zt(this,pw,"MethodNotImplementedException")}}var mw,gw;class yw extends(gw=Error,mw=Symbol.toStringTag,gw){constructor(t,n){super(`[Luminix] Model "${t}" must be persisted before calling "${n}"`),Zt(this,mw,"ModelNotPersistedException")}}function XD(e,t,n,r,o){var s,l,c;return c=class extends(l=pa,s=Symbol.toStringTag,l){constructor(u={}){super(),Zt(this,"_attributes",new $s({})),Zt(this,"_original",{}),Zt(this,"_relations",{}),Zt(this,"_changedKeys",[]),Zt(this,"exists",!1),Zt(this,"wasRecentlyCreated",!1),Zt(this,s,Ke.studly(o)),this.makeRelations(),this.makeAttributes(u)}cast(u,f){return u==null||!f?u:["boolean","bool"].includes(f)?!!u&&u!=="0":["date","datetime","immutable_date","immutable_datetime"].includes(f)&&typeof u=="string"?new Date(u):["float","double","integer","int"].includes(f)||f.startsWith("decimal:")?Number(u):u}mutate(u,f){return u==null||!f?u:["boolean","bool"].includes(f)?!!u:["date","datetime","immutable_date","immutable_datetime"].includes(f)&&u instanceof Date?u.toISOString():["float","double","integer","int"].includes(f)||f.startsWith("decimal:")?Number(u):u}makeRelations(){const{relations:u}=n.schema(o);if(this._relations={},!u)return;const f=n.getRelationConstructors(o);Object.entries(u).forEach(([p,m])=>{const{type:g}=m,S=g in f?f[g]:Ld;this._relations[p]=new S({model:n,route:r},{name:p,...m},this,null)})}makeAttributes(u){const{relations:f,attributes:p=[]}=n.schema(o),m=Object.keys(f||{}),g=Me.omit(u,...m),S=w=>{const v=p.find(x=>x.name==w);return v?!(w in g)&&v.nullable:!1};if(this.fillable.filter(S).forEach(w=>{g[w]=null}),f&&Object.keys(f).forEach(w=>{this.relation(Ke.camel(w)).make(u[w])}),!this.validateJsonObject(g)){if(e.get("app.env","production")==="production")throw new TypeError(`[Luminix] Invalid attributes for model "${o}"`);t.warning(`Invalid attributes for model "${o}".
|
|
16
|
+
`+s)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ws(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&ad.assertOptions(r,{silentJSONParsing:Jr.transitional(Jr.boolean),forcedJSONParsing:Jr.transitional(Jr.boolean),clarifyTimeoutError:Jr.transitional(Jr.boolean),legacyInterceptorReqResOrdering:Jr.transitional(Jr.boolean)},!1),o!=null&&(le.isFunction(o)?n.paramsSerializer={serialize:o}:ad.assertOptions(o,{encode:Jr.function,serialize:Jr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ad.assertOptions(n,{baseUrl:Jr.spelling("baseURL"),withXsrfToken:Jr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=s&&le.merge(s.common,s[n.method]);s&&le.forEach(["delete","get","head","post","put","patch","query","common"],w=>{delete s[w]}),n.headers=rr.concat(l,s);const c=[];let u=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(n)===!1)return;u=u&&w.synchronous;const v=n.transitional||Th;v&&v.legacyInterceptorReqResOrdering?c.unshift(w.fulfilled,w.rejected):c.push(w.fulfilled,w.rejected)});const f=[];this.interceptors.response.forEach(function(w){f.push(w.fulfilled,w.rejected)});let p,m=0,g;if(!u){const w=[B0.bind(this),void 0];for(w.unshift(...c),w.push(...f),g=w.length,p=Promise.resolve(n);m<g;)p=p.then(w[m++],w[m++]);return p}g=c.length;let S=n;for(;m<g;){const w=c[m++],v=c[m++];try{S=w(S)}catch(x){v.call(this,x);break}}try{p=B0.call(this,S)}catch(w){return Promise.reject(w)}for(m=0,g=f.length;m<g;)p=p.then(f[m++],f[m++]);return p}getUri(t){t=ws(this.defaults,t);const n=j0(t.baseURL,t.url,t.allowAbsoluteUrls);return R0(n,t.params,t.paramsSerializer)}};le.forEach(["delete","get","head","options"],function(e){Ss.prototype[e]=function(t,n){return this.request(ws(n||{},{method:e,url:t,data:(n||{}).data}))}}),le.forEach(["post","put","patch","query"],function(e){function t(n){return function(r,o,s){return this.request(ws(s||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}Ss.prototype[e]=t(),e!=="query"&&(Ss.prototype[e+"Form"]=t(!0))});let Y$=class ZT{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const l=new Promise(c=>{r.subscribe(c),s=c}).then(o);return l.cancel=function(){r.unsubscribe(s)},l},t(function(o,s,l){r.reason||(r.reason=new Wl(o,s,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new ZT(function(n){t=n}),cancel:t}}};function J$(e){return function(t){return e.apply(null,t)}}function X$(e){return le.isObject(e)&&e.isAxiosError===!0}const Lh={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Lh).forEach(([e,t])=>{Lh[t]=e});function U0(e){const t=new Ss(e),n=u0(Ss.prototype.request,t);return le.extend(n,Ss.prototype,t,{allOwnKeys:!0}),le.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return U0(ws(e,r))},n}const wn=U0(Ul);wn.Axios=Ss,wn.CanceledError=Wl,wn.CancelToken=Y$,wn.isCancel=P0,wn.VERSION=Mh,wn.toFormData=rd,wn.AxiosError=Ze,wn.Cancel=wn.CanceledError,wn.all=function(e){return Promise.all(e)},wn.spread=J$,wn.isAxiosError=X$,wn.mergeConfig=ws,wn.AxiosHeaders=rr,wn.formToJSON=e=>k0(le.isHTMLForm(e)?new FormData(e):e),wn.getAdapter=F0.getAdapter,wn.HttpStatusCode=Lh,wn.default=wn;const{Axios:xne,AxiosError:wne,CanceledError:Sne,isCancel:Cne,CancelToken:Rne,VERSION:Ene,all:kne,Cancel:Pne,isAxiosError:Z$,spread:One,toFormData:W0,AxiosHeaders:Tne,HttpStatusCode:$ne,formToJSON:jne,getAdapter:Ane,mergeConfig:Mne,create:_ne}=wn;var ld=Symbol.for("immer-nothing"),ua=Symbol.for("immer-draftable"),zt=Symbol.for("immer-state");function _n(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Cs=Object.getPrototypeOf;function ii(e){return!!e&&!!e[zt]}function Xr(e){var t;return e?H0(e)||Array.isArray(e)||!!e[ua]||!!((t=e.constructor)!=null&&t[ua])||Vl(e)||Kl(e):!1}var ej=Object.prototype.constructor.toString();function H0(e){if(!e||typeof e!="object")return!1;const t=Cs(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===ej}function tj(e){return ii(e)||_n(15,e),e[zt].base_}function da(e,t){Rs(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Rs(e){const t=e[zt];return t?t.type_:Array.isArray(e)?1:Vl(e)?2:Kl(e)?3:0}function Hl(e,t){return Rs(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Nh(e,t){return Rs(e)===2?e.get(t):e[t]}function V0(e,t,n){const r=Rs(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function nj(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Vl(e){return e instanceof Map}function Kl(e){return e instanceof Set}function In(e){return e.copy_||e.base_}function Dh(e,t){if(Vl(e))return new Map(e);if(Kl(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=H0(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[zt];let o=Reflect.ownKeys(r);for(let s=0;s<o.length;s++){const l=o[s],c=r[l];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(r[l]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[l]})}return Object.create(Cs(e),r)}else{const r=Cs(e);if(r!==null&&n)return{...e};const o=Object.create(r);return Object.assign(o,e)}}function cd(e,t=!1){return ud(e)||ii(e)||!Xr(e)||(Rs(e)>1&&(e.set=e.add=e.clear=e.delete=rj),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>cd(r,!0))),e}function rj(){_n(2)}function ud(e){return Object.isFrozen(e)}var Fh={};function Es(e){const t=Fh[e];return t||_n(0,e),t}function K0(e,t){Fh[e]||(Fh[e]=t)}var ql;function dd(){return ql}function oj(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function q0(e,t){t&&(Es("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Bh(e){zh(e),e.drafts_.forEach(ij),e.drafts_=null}function zh(e){e===ql&&(ql=e.parent_)}function G0(e){return ql=oj(ql,e)}function ij(e){const t=e[zt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Q0(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[zt].modified_&&(Bh(t),_n(4)),Xr(e)&&(e=fd(t,e),t.parent_||pd(t,e)),t.patches_&&Es("Patches").generateReplacementPatches_(n[zt].base_,e,t.patches_,t.inversePatches_)):e=fd(t,n,[]),Bh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ld?e:void 0}function fd(e,t,n){if(ud(t))return t;const r=t[zt];if(!r)return da(t,(o,s)=>Y0(e,r,t,o,s,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return pd(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let s=o,l=!1;r.type_===3&&(s=new Set(o),o.clear(),l=!0),da(s,(c,u)=>Y0(e,r,o,c,u,n,l)),pd(e,o,!1),n&&e.patches_&&Es("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Y0(e,t,n,r,o,s,l){if(ii(o)){const c=s&&t&&t.type_!==3&&!Hl(t.assigned_,r)?s.concat(r):void 0,u=fd(e,o,c);if(V0(n,r,u),ii(u))e.canAutoFreeze_=!1;else return}else l&&n.add(o);if(Xr(o)&&!ud(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;fd(e,o),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&pd(e,o)}}function pd(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&cd(t,n)}function sj(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:dd(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,s=Uh;n&&(o=[r],s=Gl);const{revoke:l,proxy:c}=Proxy.revocable(o,s);return r.draft_=c,r.revoke_=l,c}var Uh={get(e,t){if(t===zt)return e;const n=In(e);if(!Hl(n,t))return aj(e,n,t);const r=n[t];return e.finalized_||!Xr(r)?r:r===Wh(e.base_,t)?(Hh(e),e.copy_[t]=Ql(r,e)):r},has(e,t){return t in In(e)},ownKeys(e){return Reflect.ownKeys(In(e))},set(e,t,n){const r=J0(In(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Wh(In(e),t),s=o==null?void 0:o[zt];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(nj(n,o)&&(n!==void 0||Hl(e.base_,t)))return!0;Hh(e),si(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Wh(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Hh(e),si(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=In(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){_n(11)},getPrototypeOf(e){return Cs(e.base_)},setPrototypeOf(){_n(12)}},Gl={};da(Uh,(e,t)=>{Gl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Gl.deleteProperty=function(e,t){return Gl.set.call(this,e,t,void 0)},Gl.set=function(e,t,n){return Uh.set.call(this,e[0],t,n,e[0])};function Wh(e,t){const n=e[zt];return(n?In(n):e)[t]}function aj(e,t,n){var r;const o=J0(t,n);return o?"value"in o?o.value:(r=o.get)==null?void 0:r.call(e.draft_):void 0}function J0(e,t){if(!(t in e))return;let n=Cs(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Cs(n)}}function si(e){e.modified_||(e.modified_=!0,e.parent_&&si(e.parent_))}function Hh(e){e.copy_||(e.copy_=Dh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var X0=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const s=n;n=t;const l=this;return function(c=s,...u){return l.produce(c,f=>n.call(this,f,...u))}}typeof n!="function"&&_n(6),r!==void 0&&typeof r!="function"&&_n(7);let o;if(Xr(t)){const s=G0(this),l=Ql(t,void 0);let c=!0;try{o=n(l),c=!1}finally{c?Bh(s):zh(s)}return q0(s,r),Q0(o,s)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===ld&&(o=void 0),this.autoFreeze_&&cd(o,!0),r){const s=[],l=[];Es("Patches").generateReplacementPatches_(t,o,s,l),r(s,l)}return o}else _n(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...l)=>this.produceWithPatches(s,c=>t(c,...l));let r,o;return[this.produce(t,n,(s,l)=>{r=s,o=l}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Xr(e)||_n(8),ii(e)&&(e=Z0(e));const t=G0(this),n=Ql(e,void 0);return n[zt].isManual_=!0,zh(t),n}finishDraft(e,t){const n=e&&e[zt];(!n||!n.isManual_)&&_n(9);const{scope_:r}=n;return q0(r,t),Q0(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=Es("Patches").applyPatches_;return ii(e)?r(e,t):this.produce(e,o=>r(o,t))}};function Ql(e,t){const n=Vl(e)?Es("MapSet").proxyMap_(e,t):Kl(e)?Es("MapSet").proxySet_(e,t):sj(e,t);return(t?t.scope_:dd()).drafts_.push(n),n}function Z0(e){return ii(e)||_n(10,e),ex(e)}function ex(e){if(!Xr(e)||ud(e))return e;const t=e[zt];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Dh(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Dh(e,!0);return da(n,(r,o)=>{V0(n,r,ex(o))}),t&&(t.finalized_=!1),n}function lj(){const e="replace",t="add",n="remove";function r(m,g,S,w){switch(m.type_){case 0:case 2:return s(m,g,S,w);case 1:return o(m,g,S,w);case 3:return l(m,g,S,w)}}function o(m,g,S,w){let{base_:v,assigned_:x}=m,R=m.copy_;R.length<v.length&&([v,R]=[R,v],[S,w]=[w,S]);for(let k=0;k<v.length;k++)if(x[k]&&R[k]!==v[k]){const O=g.concat([k]);S.push({op:e,path:O,value:p(R[k])}),w.push({op:e,path:O,value:p(v[k])})}for(let k=v.length;k<R.length;k++){const O=g.concat([k]);S.push({op:t,path:O,value:p(R[k])})}for(let k=R.length-1;v.length<=k;--k){const O=g.concat([k]);w.push({op:n,path:O})}}function s(m,g,S,w){const{base_:v,copy_:x}=m;da(m.assigned_,(R,k)=>{const O=Nh(v,R),$=Nh(x,R),j=k?Hl(v,R)?e:t:n;if(O===$&&j===e)return;const T=g.concat(R);S.push(j===n?{op:j,path:T}:{op:j,path:T,value:$}),w.push(j===t?{op:n,path:T}:j===n?{op:t,path:T,value:p(O)}:{op:e,path:T,value:p(O)})})}function l(m,g,S,w){let{base_:v,copy_:x}=m,R=0;v.forEach(k=>{if(!x.has(k)){const O=g.concat([R]);S.push({op:n,path:O,value:k}),w.unshift({op:t,path:O,value:k})}R++}),R=0,x.forEach(k=>{if(!v.has(k)){const O=g.concat([R]);S.push({op:t,path:O,value:k}),w.unshift({op:n,path:O,value:k})}R++})}function c(m,g,S,w){S.push({op:e,path:[],value:g===ld?void 0:g}),w.push({op:e,path:[],value:m})}function u(m,g){return g.forEach(S=>{const{path:w,op:v}=S;let x=m;for(let $=0;$<w.length-1;$++){const j=Rs(x);let T=w[$];typeof T!="string"&&typeof T!="number"&&(T=""+T),(j===0||j===1)&&(T==="__proto__"||T==="constructor")&&_n(19),typeof x=="function"&&T==="prototype"&&_n(19),x=Nh(x,T),typeof x!="object"&&_n(18,w.join("/"))}const R=Rs(x),k=f(S.value),O=w[w.length-1];switch(v){case e:switch(R){case 2:return x.set(O,k);case 3:_n(16);default:return x[O]=k}case t:switch(R){case 1:return O==="-"?x.push(k):x.splice(O,0,k);case 2:return x.set(O,k);case 3:return x.add(k);default:return x[O]=k}case n:switch(R){case 1:return x.splice(O,1);case 2:return x.delete(O);case 3:return x.delete(S.value);default:return delete x[O]}default:_n(17,v)}}),m}function f(m){if(!Xr(m))return m;if(Array.isArray(m))return m.map(f);if(Vl(m))return new Map(Array.from(m.entries()).map(([S,w])=>[S,f(w)]));if(Kl(m))return new Set(Array.from(m).map(f));const g=Object.create(Cs(m));for(const S in m)g[S]=f(m[S]);return Hl(m,ua)&&(g[ua]=m[ua]),g}function p(m){return ii(m)?f(m):m}K0("Patches",{applyPatches_:u,generatePatches_:r,generateReplacementPatches_:c})}function cj(){class e extends Map{constructor(u,f){super(),this[zt]={type_:2,parent_:f,scope_:f?f.scope_:dd(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:u,draft_:this,isManual_:!1,revoked_:!1}}get size(){return In(this[zt]).size}has(u){return In(this[zt]).has(u)}set(u,f){const p=this[zt];return l(p),(!In(p).has(u)||In(p).get(u)!==f)&&(n(p),si(p),p.assigned_.set(u,!0),p.copy_.set(u,f),p.assigned_.set(u,!0)),this}delete(u){if(!this.has(u))return!1;const f=this[zt];return l(f),n(f),si(f),f.base_.has(u)?f.assigned_.set(u,!1):f.assigned_.delete(u),f.copy_.delete(u),!0}clear(){const u=this[zt];l(u),In(u).size&&(n(u),si(u),u.assigned_=new Map,da(u.base_,f=>{u.assigned_.set(f,!1)}),u.copy_.clear())}forEach(u,f){const p=this[zt];In(p).forEach((m,g,S)=>{u.call(f,this.get(g),g,this)})}get(u){const f=this[zt];l(f);const p=In(f).get(u);if(f.finalized_||!Xr(p)||p!==f.base_.get(u))return p;const m=Ql(p,f);return n(f),f.copy_.set(u,m),m}keys(){return In(this[zt]).keys()}values(){const u=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{const f=u.next();return f.done?f:{done:!1,value:this.get(f.value)}}}}entries(){const u=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{const f=u.next();if(f.done)return f;const p=this.get(f.value);return{done:!1,value:[f.value,p]}}}}[Symbol.iterator](){return this.entries()}}function t(c,u){return new e(c,u)}function n(c){c.copy_||(c.assigned_=new Map,c.copy_=new Map(c.base_))}class r extends Set{constructor(u,f){super(),this[zt]={type_:3,parent_:f,scope_:f?f.scope_:dd(),modified_:!1,finalized_:!1,copy_:void 0,base_:u,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return In(this[zt]).size}has(u){const f=this[zt];return l(f),f.copy_?!!(f.copy_.has(u)||f.drafts_.has(u)&&f.copy_.has(f.drafts_.get(u))):f.base_.has(u)}add(u){const f=this[zt];return l(f),this.has(u)||(s(f),si(f),f.copy_.add(u)),this}delete(u){if(!this.has(u))return!1;const f=this[zt];return l(f),s(f),si(f),f.copy_.delete(u)||(f.drafts_.has(u)?f.copy_.delete(f.drafts_.get(u)):!1)}clear(){const u=this[zt];l(u),In(u).size&&(s(u),si(u),u.copy_.clear())}values(){const u=this[zt];return l(u),s(u),u.copy_.values()}entries(){const u=this[zt];return l(u),s(u),u.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(u,f){const p=this.values();let m=p.next();for(;!m.done;)u.call(f,m.value,m.value,this),m=p.next()}}function o(c,u){return new r(c,u)}function s(c){c.copy_||(c.copy_=new Set,c.base_.forEach(u=>{if(Xr(u)){const f=Ql(u,c);c.drafts_.set(u,f),c.copy_.add(f)}else c.copy_.add(u)}))}function l(c){c.revoked_&&_n(3,JSON.stringify(In(c)))}K0("MapSet",{proxyMap_:t,proxySet_:o})}var Mr=new X0,fa=Mr.produce,uj=Mr.produceWithPatches.bind(Mr),dj=Mr.setAutoFreeze.bind(Mr),fj=Mr.setUseStrictShallowCopy.bind(Mr),pj=Mr.applyPatches.bind(Mr),hj=Mr.createDraft.bind(Mr),mj=Mr.finishDraft.bind(Mr);function gj(e){return e}function yj(e){return e}const Vh=Object.freeze(Object.defineProperty({__proto__:null,Immer:X0,applyPatches:pj,castDraft:gj,castImmutable:yj,createDraft:hj,current:Z0,enableMapSet:cj,enablePatches:lj,finishDraft:mj,freeze:cd,immerable:ua,isDraft:ii,isDraftable:Xr,nothing:ld,original:tj,produce:fa,produceWithPatches:uj,setAutoFreeze:dj,setUseStrictShallowCopy:fj},Symbol.toStringTag,{value:"Module"}));let vj=()=>({emit(e,...t){for(let n=0,r=this.events[e]||[],o=r.length;n<o;n++)r[n](...t)},events:{},on(e,t){var n;return((n=this.events)[e]||(n[e]=[])).push(t),()=>{var r;this.events[e]=(r=this.events[e])==null?void 0:r.filter(o=>t!==o)}}});class pa{constructor(){Ar(this,"emitter"),this.emitter=vj()}on(t,n){return this.emitter.on(t,n)}once(t,n){const r=this.emitter.on(t,o=>{r(),n(o)})}emit(t,...n){this.emitter.emit(t,...n)}flushEvents(){this.emitter.events={}}}var tx,nx;class bj extends(nx=Error,tx=Symbol.toStringTag,nx){constructor(){super("[Luminix] Embed element not found. Make sure to include the `@luminixEmbed()` directive in your Blade template."),Ar(this,tx,"NoEmbedException")}}const rx=(e,t="data")=>{if(!document.querySelector("#luminix-embed"))throw new bj;const n=document.getElementById(`luminix-${t}::`+e);return n?n.dataset.json&&n.dataset.value?JSON.parse(n.dataset.value):n.dataset.value:null};var ox=typeof global=="object"&&global&&global.Object===Object&&global,xj=typeof self=="object"&&self&&self.Object===Object&&self,wo=ox||xj||Function("return this")(),Zr=wo.Symbol,ix=Object.prototype,wj=ix.hasOwnProperty,Sj=ix.toString,Yl=Zr?Zr.toStringTag:void 0;function Cj(e){var t=wj.call(e,Yl),n=e[Yl];try{e[Yl]=void 0;var r=!0}catch{}var o=Sj.call(e);return r&&(t?e[Yl]=n:delete e[Yl]),o}var Rj=Object.prototype,Ej=Rj.toString;function kj(e){return Ej.call(e)}var Pj="[object Null]",Oj="[object Undefined]",sx=Zr?Zr.toStringTag:void 0;function ks(e){return e==null?e===void 0?Oj:Pj:sx&&sx in Object(e)?Cj(e):kj(e)}function Fo(e){return e!=null&&typeof e=="object"}var Tj="[object Symbol]";function hd(e){return typeof e=="symbol"||Fo(e)&&ks(e)==Tj}function Kh(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var yr=Array.isArray,ax=Zr?Zr.prototype:void 0,lx=ax?ax.toString:void 0;function md(e){if(typeof e=="string")return e;if(yr(e))return Kh(e,md)+"";if(hd(e))return lx?lx.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var $j=/\s/;function jj(e){for(var t=e.length;t--&&$j.test(e.charAt(t)););return t}var Aj=/^\s+/;function cx(e){return e&&e.slice(0,jj(e)+1).replace(Aj,"")}function vr(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ux=NaN,Mj=/^[-+]0x[0-9a-f]+$/i,_j=/^0b[01]+$/i,Ij=/^0o[0-7]+$/i,Lj=parseInt;function qh(e){if(typeof e=="number")return e;if(hd(e))return ux;if(vr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=vr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=cx(e);var n=_j.test(e);return n||Ij.test(e)?Lj(e.slice(2),n?2:8):Mj.test(e)?ux:+e}var dx=1/0,Nj=17976931348623157e292;function Dj(e){if(!e)return e===0?e:0;if(e=qh(e),e===dx||e===-dx){var t=e<0?-1:1;return t*Nj}return e===e?e:0}function Gh(e){var t=Dj(e),n=t%1;return t===t?n?t-n:t:0}function fx(e){return e}var Fj="[object AsyncFunction]",Bj="[object Function]",zj="[object GeneratorFunction]",Uj="[object Proxy]";function Qh(e){if(!vr(e))return!1;var t=ks(e);return t==Bj||t==zj||t==Fj||t==Uj}var Yh=wo["__core-js_shared__"],px=function(){var e=/[^.]+$/.exec(Yh&&Yh.keys&&Yh.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Wj(e){return!!px&&px in e}var Hj=Function.prototype,Vj=Hj.toString;function Ps(e){if(e!=null){try{return Vj.call(e)}catch{}try{return e+""}catch{}}return""}var Kj=/[\\^$.*+?()[\]{}|]/g,qj=/^\[object .+?Constructor\]$/,Gj=Function.prototype,Qj=Object.prototype,Yj=Gj.toString,Jj=Qj.hasOwnProperty,Xj=RegExp("^"+Yj.call(Jj).replace(Kj,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Zj(e){if(!vr(e)||Wj(e))return!1;var t=Qh(e)?Xj:qj;return t.test(Ps(e))}function eA(e,t){return e==null?void 0:e[t]}function Os(e,t){var n=eA(e,t);return Zj(n)?n:void 0}var Jh=Os(wo,"WeakMap"),hx=Object.create,tA=function(){function e(){}return function(t){if(!vr(t))return{};if(hx)return hx(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function nA(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Xh(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var rA=800,oA=16,iA=Date.now;function sA(e){var t=0,n=0;return function(){var r=iA(),o=oA-(r-n);if(n=r,o>0){if(++t>=rA)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function aA(e){return function(){return e}}var gd=function(){try{var e=Os(Object,"defineProperty");return e({},"",{}),e}catch{}}(),lA=gd?function(e,t){return gd(e,"toString",{configurable:!0,enumerable:!1,value:aA(t),writable:!0})}:fx,mx=sA(lA);function cA(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function uA(e,t,n,r){for(var o=e.length,s=n+-1;++s<o;)if(t(e[s],s,e))return s;return-1}function dA(e){return e!==e}function fA(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}function gx(e,t,n){return t===t?fA(e,t,n):uA(e,dA,n)}var pA=9007199254740991,hA=/^(?:0|[1-9]\d*)$/;function yd(e,t){var n=typeof e;return t=t??pA,!!t&&(n=="number"||n!="symbol"&&hA.test(e))&&e>-1&&e%1==0&&e<t}function Zh(e,t,n){t=="__proto__"&&gd?gd(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Jl(e,t){return e===t||e!==e&&t!==t}var mA=Object.prototype,gA=mA.hasOwnProperty;function em(e,t,n){var r=e[t];(!(gA.call(e,t)&&Jl(r,n))||n===void 0&&!(t in e))&&Zh(e,t,n)}function ha(e,t,n,r){var o=!n;n||(n={});for(var s=-1,l=t.length;++s<l;){var c=t[s],u=void 0;u===void 0&&(u=e[c]),o?Zh(n,c,u):em(n,c,u)}return n}var yx=Math.max;function vx(e,t,n){return t=yx(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,s=yx(r.length-t,0),l=Array(s);++o<s;)l[o]=r[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=r[o];return c[t]=n(l),nA(e,this,c)}}function yA(e,t){return mx(vx(e,t,fx),e+"")}var vA=9007199254740991;function tm(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=vA}function Xl(e){return e!=null&&tm(e.length)&&!Qh(e)}function bA(e,t,n){if(!vr(n))return!1;var r=typeof t;return(r=="number"?Xl(n)&&yd(t,n.length):r=="string"&&t in n)?Jl(n[t],e):!1}function xA(e){return yA(function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:void 0,l=o>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(o--,s):void 0,l&&bA(n[0],n[1],l)&&(s=o<3?void 0:s,o=1),t=Object(t);++r<o;){var c=n[r];c&&e(t,c,r,s)}return t})}var wA=Object.prototype;function vd(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||wA;return e===n}function SA(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var CA="[object Arguments]";function bx(e){return Fo(e)&&ks(e)==CA}var xx=Object.prototype,RA=xx.hasOwnProperty,EA=xx.propertyIsEnumerable,ma=bx(function(){return arguments}())?bx:function(e){return Fo(e)&&RA.call(e,"callee")&&!EA.call(e,"callee")};function kA(){return!1}var wx=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Sx=wx&&typeof module=="object"&&module&&!module.nodeType&&module,PA=Sx&&Sx.exports===wx,Cx=PA?wo.Buffer:void 0,OA=Cx?Cx.isBuffer:void 0,ga=OA||kA,TA="[object Arguments]",$A="[object Array]",jA="[object Boolean]",AA="[object Date]",MA="[object Error]",_A="[object Function]",IA="[object Map]",LA="[object Number]",NA="[object Object]",DA="[object RegExp]",FA="[object Set]",BA="[object String]",zA="[object WeakMap]",UA="[object ArrayBuffer]",WA="[object DataView]",HA="[object Float32Array]",VA="[object Float64Array]",KA="[object Int8Array]",qA="[object Int16Array]",GA="[object Int32Array]",QA="[object Uint8Array]",YA="[object Uint8ClampedArray]",JA="[object Uint16Array]",XA="[object Uint32Array]",an={};an[HA]=an[VA]=an[KA]=an[qA]=an[GA]=an[QA]=an[YA]=an[JA]=an[XA]=!0,an[TA]=an[$A]=an[UA]=an[jA]=an[WA]=an[AA]=an[MA]=an[_A]=an[IA]=an[LA]=an[NA]=an[DA]=an[FA]=an[BA]=an[zA]=!1;function ZA(e){return Fo(e)&&tm(e.length)&&!!an[ks(e)]}function nm(e){return function(t){return e(t)}}var Rx=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Zl=Rx&&typeof module=="object"&&module&&!module.nodeType&&module,eM=Zl&&Zl.exports===Rx,rm=eM&&ox.process,ya=function(){try{var e=Zl&&Zl.require&&Zl.require("util").types;return e||rm&&rm.binding&&rm.binding("util")}catch{}}(),Ex=ya&&ya.isTypedArray,bd=Ex?nm(Ex):ZA,tM=Object.prototype,nM=tM.hasOwnProperty;function kx(e,t){var n=yr(e),r=!n&&ma(e),o=!n&&!r&&ga(e),s=!n&&!r&&!o&&bd(e),l=n||r||o||s,c=l?SA(e.length,String):[],u=c.length;for(var f in e)(t||nM.call(e,f))&&!(l&&(f=="length"||o&&(f=="offset"||f=="parent")||s&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||yd(f,u)))&&c.push(f);return c}function Px(e,t){return function(n){return e(t(n))}}var rM=Px(Object.keys,Object),oM=Object.prototype,iM=oM.hasOwnProperty;function Ox(e){if(!vd(e))return rM(e);var t=[];for(var n in Object(e))iM.call(e,n)&&n!="constructor"&&t.push(n);return t}function xd(e){return Xl(e)?kx(e):Ox(e)}function sM(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var aM=Object.prototype,lM=aM.hasOwnProperty;function cM(e){if(!vr(e))return sM(e);var t=vd(e),n=[];for(var r in e)r=="constructor"&&(t||!lM.call(e,r))||n.push(r);return n}function ec(e){return Xl(e)?kx(e,!0):cM(e)}var uM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dM=/^\w*$/;function fM(e,t){if(yr(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||hd(e)?!0:dM.test(e)||!uM.test(e)||t!=null&&e in Object(t)}var tc=Os(Object,"create");function pM(){this.__data__=tc?tc(null):{},this.size=0}function hM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var mM="__lodash_hash_undefined__",gM=Object.prototype,yM=gM.hasOwnProperty;function vM(e){var t=this.__data__;if(tc){var n=t[e];return n===mM?void 0:n}return yM.call(t,e)?t[e]:void 0}var bM=Object.prototype,xM=bM.hasOwnProperty;function wM(e){var t=this.__data__;return tc?t[e]!==void 0:xM.call(t,e)}var SM="__lodash_hash_undefined__";function CM(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=tc&&t===void 0?SM:t,this}function Ts(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ts.prototype.clear=pM,Ts.prototype.delete=hM,Ts.prototype.get=vM,Ts.prototype.has=wM,Ts.prototype.set=CM;function RM(){this.__data__=[],this.size=0}function wd(e,t){for(var n=e.length;n--;)if(Jl(e[n][0],t))return n;return-1}var EM=Array.prototype,kM=EM.splice;function PM(e){var t=this.__data__,n=wd(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():kM.call(t,n,1),--this.size,!0}function OM(e){var t=this.__data__,n=wd(t,e);return n<0?void 0:t[n][1]}function TM(e){return wd(this.__data__,e)>-1}function $M(e,t){var n=this.__data__,r=wd(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function ai(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ai.prototype.clear=RM,ai.prototype.delete=PM,ai.prototype.get=OM,ai.prototype.has=TM,ai.prototype.set=$M;var nc=Os(wo,"Map");function jM(){this.size=0,this.__data__={hash:new Ts,map:new(nc||ai),string:new Ts}}function AM(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Sd(e,t){var n=e.__data__;return AM(t)?n[typeof t=="string"?"string":"hash"]:n.map}function MM(e){var t=Sd(this,e).delete(e);return this.size-=t?1:0,t}function _M(e){return Sd(this,e).get(e)}function IM(e){return Sd(this,e).has(e)}function LM(e,t){var n=Sd(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function li(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}li.prototype.clear=jM,li.prototype.delete=MM,li.prototype.get=_M,li.prototype.has=IM,li.prototype.set=LM;var NM="Expected a function";function om(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(NM);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var l=e.apply(this,r);return n.cache=s.set(o,l)||s,l};return n.cache=new(om.Cache||li),n}om.Cache=li;var DM=500;function FM(e){var t=om(e,function(r){return n.size===DM&&n.clear(),r}),n=t.cache;return t}var BM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zM=/\\(\\)?/g,UM=FM(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(BM,function(n,r,o,s){t.push(o?s.replace(zM,"$1"):r||n)}),t});function ci(e){return e==null?"":md(e)}function va(e,t){return yr(e)?e:fM(e,t)?[e]:UM(ci(e))}function rc(e){if(typeof e=="string"||hd(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function im(e,t){t=va(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[rc(t[n++])];return n&&n==r?e:void 0}function WM(e,t,n){var r=e==null?void 0:im(e,t);return r===void 0?n:r}function sm(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var Tx=Zr?Zr.isConcatSpreadable:void 0;function HM(e){return yr(e)||ma(e)||!!(Tx&&e&&e[Tx])}function VM(e,t,n,r,o){var s=-1,l=e.length;for(n||(n=HM),o||(o=[]);++s<l;){var c=e[s];n(c)?sm(o,c):o[o.length]=c}return o}function KM(e){var t=e==null?0:e.length;return t?VM(e):[]}function $x(e){return mx(vx(e,void 0,KM),e+"")}var am=Px(Object.getPrototypeOf,Object),qM="[object Object]",GM=Function.prototype,QM=Object.prototype,jx=GM.toString,YM=QM.hasOwnProperty,JM=jx.call(Object);function Ax(e){if(!Fo(e)||ks(e)!=qM)return!1;var t=am(e);if(t===null)return!0;var n=YM.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&jx.call(n)==JM}function Mx(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(o);++r<o;)s[r]=e[r+t];return s}function lm(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Mx(e,t,n)}var XM="\\ud800-\\udfff",ZM="\\u0300-\\u036f",e_="\\ufe20-\\ufe2f",t_="\\u20d0-\\u20ff",n_=ZM+e_+t_,r_="\\ufe0e\\ufe0f",o_="\\u200d",i_=RegExp("["+o_+XM+n_+r_+"]");function Cd(e){return i_.test(e)}function s_(e){return e.split("")}var _x="\\ud800-\\udfff",a_="\\u0300-\\u036f",l_="\\ufe20-\\ufe2f",c_="\\u20d0-\\u20ff",u_=a_+l_+c_,d_="\\ufe0e\\ufe0f",f_="["+_x+"]",cm="["+u_+"]",um="\\ud83c[\\udffb-\\udfff]",p_="(?:"+cm+"|"+um+")",Ix="[^"+_x+"]",Lx="(?:\\ud83c[\\udde6-\\uddff]){2}",Nx="[\\ud800-\\udbff][\\udc00-\\udfff]",h_="\\u200d",Dx=p_+"?",Fx="["+d_+"]?",m_="(?:"+h_+"(?:"+[Ix,Lx,Nx].join("|")+")"+Fx+Dx+")*",g_=Fx+Dx+m_,y_="(?:"+[Ix+cm+"?",cm,Lx,Nx,f_].join("|")+")",v_=RegExp(um+"(?="+um+")|"+y_+g_,"g");function b_(e){return e.match(v_)||[]}function Rd(e){return Cd(e)?b_(e):s_(e)}function Bx(e){return function(t){t=ci(t);var n=Cd(t)?Rd(t):void 0,r=n?n[0]:t.charAt(0),o=n?lm(n,1).join(""):t.slice(1);return r[e]()+o}}var Ed=Bx("toUpperCase");function zx(e){return Ed(ci(e).toLowerCase())}function x_(e,t,n,r){for(var o=-1,s=e==null?0:e.length;++o<s;)n=t(n,e[o],o,e);return n}function w_(e){return function(t){return e==null?void 0:e[t]}}var S_={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},C_=w_(S_),R_=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,E_="\\u0300-\\u036f",k_="\\ufe20-\\ufe2f",P_="\\u20d0-\\u20ff",O_=E_+k_+P_,T_="["+O_+"]",$_=RegExp(T_,"g");function j_(e){return e=ci(e),e&&e.replace(R_,C_).replace($_,"")}var A_=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function M_(e){return e.match(A_)||[]}var __=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function I_(e){return __.test(e)}var Ux="\\ud800-\\udfff",L_="\\u0300-\\u036f",N_="\\ufe20-\\ufe2f",D_="\\u20d0-\\u20ff",F_=L_+N_+D_,Wx="\\u2700-\\u27bf",Hx="a-z\\xdf-\\xf6\\xf8-\\xff",B_="\\xac\\xb1\\xd7\\xf7",z_="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",U_="\\u2000-\\u206f",W_=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Vx="A-Z\\xc0-\\xd6\\xd8-\\xde",H_="\\ufe0e\\ufe0f",Kx=B_+z_+U_+W_,qx="['’]",Gx="["+Kx+"]",V_="["+F_+"]",Qx="\\d+",K_="["+Wx+"]",Yx="["+Hx+"]",Jx="[^"+Ux+Kx+Qx+Wx+Hx+Vx+"]",q_="\\ud83c[\\udffb-\\udfff]",G_="(?:"+V_+"|"+q_+")",Q_="[^"+Ux+"]",Xx="(?:\\ud83c[\\udde6-\\uddff]){2}",Zx="[\\ud800-\\udbff][\\udc00-\\udfff]",ba="["+Vx+"]",Y_="\\u200d",e1="(?:"+Yx+"|"+Jx+")",J_="(?:"+ba+"|"+Jx+")",t1="(?:"+qx+"(?:d|ll|m|re|s|t|ve))?",n1="(?:"+qx+"(?:D|LL|M|RE|S|T|VE))?",r1=G_+"?",o1="["+H_+"]?",X_="(?:"+Y_+"(?:"+[Q_,Xx,Zx].join("|")+")"+o1+r1+")*",Z_="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",eI="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",tI=o1+r1+X_,nI="(?:"+[K_,Xx,Zx].join("|")+")"+tI,rI=RegExp([ba+"?"+Yx+"+"+t1+"(?="+[Gx,ba,"$"].join("|")+")",J_+"+"+n1+"(?="+[Gx,ba+e1,"$"].join("|")+")",ba+"?"+e1+"+"+t1,ba+"+"+n1,eI,Z_,Qx,nI].join("|"),"g");function oI(e){return e.match(rI)||[]}function iI(e,t,n){return e=ci(e),t=t,t===void 0?I_(e)?oI(e):M_(e):e.match(t)||[]}var sI="['’]",aI=RegExp(sI,"g");function kd(e){return function(t){return x_(iI(j_(t).replace(aI,"")),e,"")}}var lI=kd(function(e,t,n){return t=t.toLowerCase(),e+(n?zx(t):t)});function cI(){this.__data__=new ai,this.size=0}function uI(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function dI(e){return this.__data__.get(e)}function fI(e){return this.__data__.has(e)}var pI=200;function hI(e,t){var n=this.__data__;if(n instanceof ai){var r=n.__data__;if(!nc||r.length<pI-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new li(r)}return n.set(e,t),this.size=n.size,this}function Bo(e){var t=this.__data__=new ai(e);this.size=t.size}Bo.prototype.clear=cI,Bo.prototype.delete=uI,Bo.prototype.get=dI,Bo.prototype.has=fI,Bo.prototype.set=hI;function mI(e,t){return e&&ha(t,xd(t),e)}function gI(e,t){return e&&ha(t,ec(t),e)}var i1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,s1=i1&&typeof module=="object"&&module&&!module.nodeType&&module,yI=s1&&s1.exports===i1,a1=yI?wo.Buffer:void 0,l1=a1?a1.allocUnsafe:void 0;function c1(e,t){if(t)return e.slice();var n=e.length,r=l1?l1(n):new e.constructor(n);return e.copy(r),r}function vI(e,t){for(var n=-1,r=e==null?0:e.length,o=0,s=[];++n<r;){var l=e[n];t(l,n,e)&&(s[o++]=l)}return s}function u1(){return[]}var bI=Object.prototype,xI=bI.propertyIsEnumerable,d1=Object.getOwnPropertySymbols,dm=d1?function(e){return e==null?[]:(e=Object(e),vI(d1(e),function(t){return xI.call(e,t)}))}:u1;function wI(e,t){return ha(e,dm(e),t)}var SI=Object.getOwnPropertySymbols,f1=SI?function(e){for(var t=[];e;)sm(t,dm(e)),e=am(e);return t}:u1;function CI(e,t){return ha(e,f1(e),t)}function p1(e,t,n){var r=t(e);return yr(e)?r:sm(r,n(e))}function fm(e){return p1(e,xd,dm)}function h1(e){return p1(e,ec,f1)}var pm=Os(wo,"DataView"),hm=Os(wo,"Promise"),mm=Os(wo,"Set"),m1="[object Map]",RI="[object Object]",g1="[object Promise]",y1="[object Set]",v1="[object WeakMap]",b1="[object DataView]",EI=Ps(pm),kI=Ps(nc),PI=Ps(hm),OI=Ps(mm),TI=Ps(Jh),eo=ks;(pm&&eo(new pm(new ArrayBuffer(1)))!=b1||nc&&eo(new nc)!=m1||hm&&eo(hm.resolve())!=g1||mm&&eo(new mm)!=y1||Jh&&eo(new Jh)!=v1)&&(eo=function(e){var t=ks(e),n=t==RI?e.constructor:void 0,r=n?Ps(n):"";if(r)switch(r){case EI:return b1;case kI:return m1;case PI:return g1;case OI:return y1;case TI:return v1}return t});var $I=Object.prototype,jI=$I.hasOwnProperty;function AI(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&jI.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Pd=wo.Uint8Array;function gm(e){var t=new e.constructor(e.byteLength);return new Pd(t).set(new Pd(e)),t}function MI(e,t){var n=t?gm(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var _I=/\w*$/;function II(e){var t=new e.constructor(e.source,_I.exec(e));return t.lastIndex=e.lastIndex,t}var x1=Zr?Zr.prototype:void 0,w1=x1?x1.valueOf:void 0;function LI(e){return w1?Object(w1.call(e)):{}}function S1(e,t){var n=t?gm(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var NI="[object Boolean]",DI="[object Date]",FI="[object Map]",BI="[object Number]",zI="[object RegExp]",UI="[object Set]",WI="[object String]",HI="[object Symbol]",VI="[object ArrayBuffer]",KI="[object DataView]",qI="[object Float32Array]",GI="[object Float64Array]",QI="[object Int8Array]",YI="[object Int16Array]",JI="[object Int32Array]",XI="[object Uint8Array]",ZI="[object Uint8ClampedArray]",eL="[object Uint16Array]",tL="[object Uint32Array]";function nL(e,t,n){var r=e.constructor;switch(t){case VI:return gm(e);case NI:case DI:return new r(+e);case KI:return MI(e,n);case qI:case GI:case QI:case YI:case JI:case XI:case ZI:case eL:case tL:return S1(e,n);case FI:return new r;case BI:case WI:return new r(e);case zI:return II(e);case UI:return new r;case HI:return LI(e)}}function C1(e){return typeof e.constructor=="function"&&!vd(e)?tA(am(e)):{}}var rL="[object Map]";function oL(e){return Fo(e)&&eo(e)==rL}var R1=ya&&ya.isMap,iL=R1?nm(R1):oL,sL="[object Set]";function aL(e){return Fo(e)&&eo(e)==sL}var E1=ya&&ya.isSet,lL=E1?nm(E1):aL,cL=1,uL=2,dL=4,k1="[object Arguments]",fL="[object Array]",pL="[object Boolean]",hL="[object Date]",mL="[object Error]",P1="[object Function]",gL="[object GeneratorFunction]",yL="[object Map]",vL="[object Number]",O1="[object Object]",bL="[object RegExp]",xL="[object Set]",wL="[object String]",SL="[object Symbol]",CL="[object WeakMap]",RL="[object ArrayBuffer]",EL="[object DataView]",kL="[object Float32Array]",PL="[object Float64Array]",OL="[object Int8Array]",TL="[object Int16Array]",$L="[object Int32Array]",jL="[object Uint8Array]",AL="[object Uint8ClampedArray]",ML="[object Uint16Array]",_L="[object Uint32Array]",tn={};tn[k1]=tn[fL]=tn[RL]=tn[EL]=tn[pL]=tn[hL]=tn[kL]=tn[PL]=tn[OL]=tn[TL]=tn[$L]=tn[yL]=tn[vL]=tn[O1]=tn[bL]=tn[xL]=tn[wL]=tn[SL]=tn[jL]=tn[AL]=tn[ML]=tn[_L]=!0,tn[mL]=tn[P1]=tn[CL]=!1;function oc(e,t,n,r,o,s){var l,c=t&cL,u=t&uL,f=t&dL;if(n&&(l=o?n(e,r,o,s):n(e)),l!==void 0)return l;if(!vr(e))return e;var p=yr(e);if(p){if(l=AI(e),!c)return Xh(e,l)}else{var m=eo(e),g=m==P1||m==gL;if(ga(e))return c1(e,c);if(m==O1||m==k1||g&&!o){if(l=u||g?{}:C1(e),!c)return u?CI(e,gI(l,e)):wI(e,mI(l,e))}else{if(!tn[m])return o?e:{};l=nL(e,m,c)}}s||(s=new Bo);var S=s.get(e);if(S)return S;s.set(e,l),lL(e)?e.forEach(function(x){l.add(oc(x,t,n,x,e,s))}):iL(e)&&e.forEach(function(x,R){l.set(R,oc(x,t,n,R,e,s))});var w=f?u?h1:fm:u?ec:xd,v=p?void 0:w(e);return cA(v||e,function(x,R){v&&(R=x,x=e[R]),em(l,R,oc(x,t,n,R,e,s))}),l}var IL=1,LL=4;function NL(e){return oc(e,IL|LL)}var DL="__lodash_hash_undefined__";function FL(e){return this.__data__.set(e,DL),this}function BL(e){return this.__data__.has(e)}function Od(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new li;++t<n;)this.add(e[t])}Od.prototype.add=Od.prototype.push=FL,Od.prototype.has=BL;function zL(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function UL(e,t){return e.has(t)}var WL=1,HL=2;function T1(e,t,n,r,o,s){var l=n&WL,c=e.length,u=t.length;if(c!=u&&!(l&&u>c))return!1;var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var m=-1,g=!0,S=n&HL?new Od:void 0;for(s.set(e,t),s.set(t,e);++m<c;){var w=e[m],v=t[m];if(r)var x=l?r(v,w,m,t,e,s):r(w,v,m,e,t,s);if(x!==void 0){if(x)continue;g=!1;break}if(S){if(!zL(t,function(R,k){if(!UL(S,k)&&(w===R||o(w,R,n,r,s)))return S.push(k)})){g=!1;break}}else if(!(w===v||o(w,v,n,r,s))){g=!1;break}}return s.delete(e),s.delete(t),g}function VL(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}function KL(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var qL=1,GL=2,QL="[object Boolean]",YL="[object Date]",JL="[object Error]",XL="[object Map]",ZL="[object Number]",eN="[object RegExp]",tN="[object Set]",nN="[object String]",rN="[object Symbol]",oN="[object ArrayBuffer]",iN="[object DataView]",$1=Zr?Zr.prototype:void 0,ym=$1?$1.valueOf:void 0;function sN(e,t,n,r,o,s,l){switch(n){case iN:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case oN:return!(e.byteLength!=t.byteLength||!s(new Pd(e),new Pd(t)));case QL:case YL:case ZL:return Jl(+e,+t);case JL:return e.name==t.name&&e.message==t.message;case eN:case nN:return e==t+"";case XL:var c=VL;case tN:var u=r&qL;if(c||(c=KL),e.size!=t.size&&!u)return!1;var f=l.get(e);if(f)return f==t;r|=GL,l.set(e,t);var p=T1(c(e),c(t),r,o,s,l);return l.delete(e),p;case rN:if(ym)return ym.call(e)==ym.call(t)}return!1}var aN=1,lN=Object.prototype,cN=lN.hasOwnProperty;function uN(e,t,n,r,o,s){var l=n&aN,c=fm(e),u=c.length,f=fm(t),p=f.length;if(u!=p&&!l)return!1;for(var m=u;m--;){var g=c[m];if(!(l?g in t:cN.call(t,g)))return!1}var S=s.get(e),w=s.get(t);if(S&&w)return S==t&&w==e;var v=!0;s.set(e,t),s.set(t,e);for(var x=l;++m<u;){g=c[m];var R=e[g],k=t[g];if(r)var O=l?r(k,R,g,t,e,s):r(R,k,g,e,t,s);if(!(O===void 0?R===k||o(R,k,n,r,s):O)){v=!1;break}x||(x=g=="constructor")}if(v&&!x){var $=e.constructor,j=t.constructor;$!=j&&"constructor"in e&&"constructor"in t&&!(typeof $=="function"&&$ instanceof $&&typeof j=="function"&&j instanceof j)&&(v=!1)}return s.delete(e),s.delete(t),v}var dN=1,j1="[object Arguments]",A1="[object Array]",Td="[object Object]",fN=Object.prototype,M1=fN.hasOwnProperty;function pN(e,t,n,r,o,s){var l=yr(e),c=yr(t),u=l?A1:eo(e),f=c?A1:eo(t);u=u==j1?Td:u,f=f==j1?Td:f;var p=u==Td,m=f==Td,g=u==f;if(g&&ga(e)){if(!ga(t))return!1;l=!0,p=!1}if(g&&!p)return s||(s=new Bo),l||bd(e)?T1(e,t,n,r,o,s):sN(e,t,u,n,r,o,s);if(!(n&dN)){var S=p&&M1.call(e,"__wrapped__"),w=m&&M1.call(t,"__wrapped__");if(S||w){var v=S?e.value():e,x=w?t.value():t;return s||(s=new Bo),o(v,x,n,r,s)}}return g?(s||(s=new Bo),uN(e,t,n,r,o,s)):!1}function _1(e,t,n,r,o){return e===t?!0:e==null||t==null||!Fo(e)&&!Fo(t)?e!==e&&t!==t:pN(e,t,n,r,_1,o)}function hN(e,t){return e!=null&&t in Object(e)}function I1(e,t,n){t=va(t,e);for(var r=-1,o=t.length,s=!1;++r<o;){var l=rc(t[r]);if(!(s=e!=null&&n(e,l)))break;e=e[l]}return s||++r!=o?s:(o=e==null?0:e.length,!!o&&tm(o)&&yd(l,o)&&(yr(e)||ma(e)))}function mN(e,t){return e!=null&&I1(e,t,hN)}function gN(e){return function(t){return t==null?void 0:t[e]}}function yN(e){return function(t,n,r){for(var o=-1,s=Object(t),l=r(t),c=l.length;c--;){var u=l[++o];if(n(s[u],u,s)===!1)break}return t}}var vN=yN(),vm=function(){return wo.Date.now()},bN="Expected a function",xN=Math.max,wN=Math.min;function L1(e,t,n){var r,o,s,l,c,u,f=0,p=!1,m=!1,g=!0;if(typeof e!="function")throw new TypeError(bN);t=qh(t)||0,vr(n)&&(p=!!n.leading,m="maxWait"in n,s=m?xN(qh(n.maxWait)||0,t):s,g="trailing"in n?!!n.trailing:g);function S(T){var M=r,N=o;return r=o=void 0,f=T,l=e.apply(N,M),l}function w(T){return f=T,c=setTimeout(R,t),p?S(T):l}function v(T){var M=T-u,N=T-f,F=t-M;return m?wN(F,s-N):F}function x(T){var M=T-u,N=T-f;return u===void 0||M>=t||M<0||m&&N>=s}function R(){var T=vm();if(x(T))return k(T);c=setTimeout(R,v(T))}function k(T){return c=void 0,g&&r?S(T):(r=o=void 0,l)}function O(){c!==void 0&&clearTimeout(c),f=0,r=u=o=c=void 0}function $(){return c===void 0?l:k(vm())}function j(){var T=vm(),M=x(T);if(r=arguments,o=this,u=T,M){if(c===void 0)return w(u);if(m)return clearTimeout(c),c=setTimeout(R,t),S(u)}return c===void 0&&(c=setTimeout(R,t)),l}return j.cancel=O,j.flush=$,j}function bm(e,t,n){(n!==void 0&&!Jl(e[t],n)||n===void 0&&!(t in e))&&Zh(e,t,n)}function SN(e){return Fo(e)&&Xl(e)}function xm(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function CN(e){return ha(e,ec(e))}function RN(e,t,n,r,o,s,l){var c=xm(e,n),u=xm(t,n),f=l.get(u);if(f){bm(e,n,f);return}var p=s?s(c,u,n+"",e,t,l):void 0,m=p===void 0;if(m){var g=yr(u),S=!g&&ga(u),w=!g&&!S&&bd(u);p=u,g||S||w?yr(c)?p=c:SN(c)?p=Xh(c):S?(m=!1,p=c1(u,!0)):w?(m=!1,p=S1(u,!0)):p=[]:Ax(u)||ma(u)?(p=c,ma(c)?p=CN(c):(!vr(c)||Qh(c))&&(p=C1(u))):m=!1}m&&(l.set(u,p),o(p,u,r,s,l),l.delete(u)),bm(e,n,p)}function N1(e,t,n,r,o){e!==t&&vN(t,function(s,l){if(o||(o=new Bo),vr(s))RN(e,t,l,n,N1,r,o);else{var c=r?r(xm(e,l),s,l+"",e,t,o):void 0;c===void 0&&(c=s),bm(e,l,c)}},ec)}function EN(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var kN=Object.prototype,PN=kN.hasOwnProperty;function ON(e,t){return e!=null&&PN.call(e,t)}function TN(e,t){return e!=null&&I1(e,t,ON)}function $N(e,t){return Kh(t,function(n){return e[n]})}function jN(e){return e==null?[]:$N(e,xd(e))}function AN(e,t){return t.length<2?e:im(e,Mx(t,0,-1))}var MN="[object Map]",_N="[object Set]",IN=Object.prototype,LN=IN.hasOwnProperty;function NN(e){if(e==null)return!0;if(Xl(e)&&(yr(e)||typeof e=="string"||typeof e.splice=="function"||ga(e)||bd(e)||ma(e)))return!e.length;var t=eo(e);if(t==MN||t==_N)return!e.size;if(vd(e))return!Ox(e).length;for(var n in e)if(LN.call(e,n))return!1;return!0}function DN(e,t){return _1(e,t)}var FN=kd(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),BN=Bx("toLowerCase"),D1=xA(function(e,t,n){N1(e,t,n)}),zN=Object.prototype,UN=zN.hasOwnProperty;function F1(e,t){t=va(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var o=rc(t[n]);if(o==="__proto__"&&!UN.call(e,"__proto__")||(o==="constructor"||o==="prototype")&&n<r-1)return!1}var s=AN(e,t);return s==null||delete s[rc(EN(t))]}function WN(e){return Ax(e)?void 0:e}var HN=1,VN=2,KN=4,qN=$x(function(e,t){var n={};if(e==null)return n;var r=!1;t=Kh(t,function(s){return s=va(s,e),r||(r=s.length>1),s}),ha(e,h1(e),n),r&&(n=oc(n,HN|VN|KN,WN));for(var o=t.length;o--;)F1(n,t[o]);return n});function B1(e,t,n,r){if(!vr(e))return e;t=va(t,e);for(var o=-1,s=t.length,l=s-1,c=e;c!=null&&++o<s;){var u=rc(t[o]),f=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(o!=l){var p=c[u];f=void 0,f===void 0&&(f=vr(p)?p:yd(t[o+1])?[]:{})}em(c,u,f),c=c[u]}return e}function GN(e,t,n){for(var r=-1,o=t.length,s={};++r<o;){var l=t[r],c=im(e,l);n(c,l)&&B1(s,va(l,e),c)}return s}var QN=9007199254740991,YN=Math.floor;function z1(e,t){var n="";if(!e||t<1||t>QN)return n;do t%2&&(n+=e),t=YN(t/2),t&&(e+=e);while(t);return n}var JN=gN("length"),U1="\\ud800-\\udfff",XN="\\u0300-\\u036f",ZN="\\ufe20-\\ufe2f",eD="\\u20d0-\\u20ff",tD=XN+ZN+eD,nD="\\ufe0e\\ufe0f",rD="["+U1+"]",wm="["+tD+"]",Sm="\\ud83c[\\udffb-\\udfff]",oD="(?:"+wm+"|"+Sm+")",W1="[^"+U1+"]",H1="(?:\\ud83c[\\udde6-\\uddff]){2}",V1="[\\ud800-\\udbff][\\udc00-\\udfff]",iD="\\u200d",K1=oD+"?",q1="["+nD+"]?",sD="(?:"+iD+"(?:"+[W1,H1,V1].join("|")+")"+q1+K1+")*",aD=q1+K1+sD,lD="(?:"+[W1+wm+"?",wm,H1,V1,rD].join("|")+")",G1=RegExp(Sm+"(?="+Sm+")|"+lD+aD,"g");function cD(e){for(var t=G1.lastIndex=0;G1.test(e);)++t;return t}function $d(e){return Cd(e)?cD(e):JN(e)}var uD=Math.ceil;function jd(e,t){t=t===void 0?" ":md(t);var n=t.length;if(n<2)return n?z1(t,e):t;var r=z1(t,uD(e/$d(t)));return Cd(t)?lm(Rd(r),0,e).join(""):r.slice(0,e)}var dD=Math.ceil,fD=Math.floor;function pD(e,t,n){e=ci(e),t=Gh(t);var r=t?$d(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return jd(fD(o),n)+e+jd(dD(o),n)}function hD(e,t,n){e=ci(e),t=Gh(t);var r=t?$d(e):0;return t&&r<t?e+jd(t-r,n):e}function mD(e,t,n){e=ci(e),t=Gh(t);var r=t?$d(e):0;return t&&r<t?jd(t-r,n)+e:e}function gD(e,t){return GN(e,t,function(n,r){return mN(e,r)})}var yD=$x(function(e,t){return e==null?{}:gD(e,t)}),vD=Math.floor,bD=Math.random;function xD(e,t){return e+vD(bD()*(t-e+1))}function Q1(e,t){var n=-1,r=e.length,o=r-1;for(t=t===void 0?r:t;++n<t;){var s=xD(n,o),l=e[s];e[s]=e[n],e[n]=l}return e.length=t,e}function wD(e,t,n){return e==null?e:B1(e,t,n)}function SD(e){return Q1(Xh(e))}function CD(e){return Q1(jN(e))}function RD(e){var t=yr(e)?SD:CD;return t(e)}var ED=kd(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Y1=kd(function(e,t,n){return e+(n?" ":"")+Ed(t)}),kD="Expected a function";function PD(e,t,n){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(kD);return vr(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),L1(e,t,{leading:r,maxWait:t,trailing:o})}function OD(e,t){for(var n=e.length;n--&&gx(t,e[n],0)>-1;);return n}function TD(e,t){for(var n=-1,r=e.length;++n<r&&gx(t,e[n],0)>-1;);return n}function $D(e,t,n){if(e=ci(e),e&&t===void 0)return cx(e);if(!e||!(t=md(t)))return e;var r=Rd(e),o=Rd(t),s=TD(r,o),l=OD(r,o)+1;return lm(r,s,l).join("")}function jD(e,t){return e==null?!0:F1(e,t)}class AD extends pa{constructor(t=[]){super(),Ar(this,"_configuration",{}),Ar(this,"singletons",{}),Ar(this,"loaders",{}),this.providers=t}get services(){return Object.entries(this.loaders).map(([t,n])=>({name:t,...n}))}get configuration(){return this._configuration}loadConfiguration(){if(document.getElementById("luminix-data::config")){const t=rx("config");t&&typeof t=="object"&&this.withConfiguration(t)}}bind(t,n){if(typeof t!="string")throw new TypeError("Service name must be a string.");this.loaders[t]={loader:n}}singleton(t,n){if(typeof t!="string")throw new TypeError("Service name must be a string.");this.loaders[t]={loader:n,singleton:!0}}instance(t,n){if(typeof t!="string")throw new TypeError("Service name must be a string.");this.loaders[t]={loader:()=>n,singleton:!0}}has(t){return t in this.loaders}make(t){const n=this.loaders[t];if(!n)throw new Error(`Service '${t}' is not bound in the container.`);return n.singleton?(this.singletons[t]||(this.singletons[t]=n.loader()),this.singletons[t]):n.loader()}withConfiguration(t){return D1(this._configuration,t),this}withProviders(t){return this.providers.push(...t),this}create(){if(this.services.length>0){console.warn("[Luminix] Application already created. Skipping double invocation of `create()`. If you want to re-create the application, please flush it first.");return}this.loadConfiguration();const t=this.providers.map(n=>new n(this));this.emit("init",t),t.forEach(n=>{n.register&&n.register()}),this.emit("booting"),t.forEach(n=>{n.boot&&n.boot()}),this.emit("booted"),this.once("flushing",()=>{t.forEach(n=>{n.flush&&n.flush()})}),this.emit("ready")}flush(){this.emit("flushing"),this.singletons={},this.loaders={},this._configuration={},this.providers=[],this.emit("flushed"),this.flushEvents()}dump(t=!1){const n={configuration:this.configuration,services:this.services,providers:this.providers,singletons:this.singletons};if(t===!0)return n;const r=this.make("log");t===!1&&r.info(n),r.info(t,n)}}function Mi(e){return class extends e{constructor(...t){return super(...t),Ar(this,"_macros",{}),new Proxy(this,{get(n,r,o){return Reflect.has(n,r)?Reflect.get(n,r,o):typeof r=="string"&&n.hasMacro(r)?n._macros[r].bind(n):Reflect.get(n,r,o)}})}macro(t,n){if(typeof n!="function")throw new TypeError("Macro must be a function");this._macros[t]=n}hasMacro(t){return t in this._macros&&typeof this._macros[t]=="function"}flushMacros(){this._macros={}}}}class MD{get(t,n,r){return WM(t,n,r)}has(t,n){return TN(t,n)}isEmpty(t){return NN(t)}isEqual(t,n){return DN(t,n)}merge(t,...n){let r;try{r=structuredClone(t)}catch{r=NL(t)}return D1(r,...n),r}omit(t,...n){return qN(t,...n)}pick(t,...n){return yD(t,...n)}set(t,n,r){wD(t,n,r)}unset(t,n){jD(t,n)}fromQuery(t){const n={};for(const[r,o]of t.entries())this.set(n,r,o);return n}fromFormData(t){return this.fromQuery(t)}toQuery(t){return W0(t,new URLSearchParams)}toFormData(t){return W0(t,new FormData)}}const Me=new(Mi(MD));class Cm{constructor(t,n){this._response=t,this._error=n}error(){return this._error}body(){return typeof this._response.data=="object"?JSON.stringify(this._response.data):String(this._response.data)}json(t,n){return t?Me.get(this._response.data,t,n):this._response.data}has(t){return Me.has(this._response.data,t)}status(){return Number(this._response.status)}successful(){return this.status()>=200&&this.status()<300}redirect(){return this.status()>=300&&this.status()<400}clientError(){return this.status()>=400&&this.status()<500}serverError(){return this.status()>=500}failed(){return this.clientError()||this.serverError()}header(t){return this._response.headers[t]}headers(){return this._response.headers}ok(){return this.status()===200}created(){return this.status()===201}accepted(){return this.status()===202}noContent(){return this.status()===204}movedPermanently(){return this.status()===301}found(){return this.status()===302}badRequest(){return this.status()===400}unauthorized(){return this.status()===401}paymentRequired(){return this.status()===402}forbidden(){return this.status()===403}notFound(){return this.status()===404}requestTimeout(){return this.status()===408}conflict(){return this.status()===409}unprocessableEntity(){return this.status()===422}tooManyRequests(){return this.status()===429}throw(){if(this.failed())throw this._error||new Error(this.body());return this}throwIf(t){return typeof t=="function"?t(this)?this.throw():this:t?this.throw():this}throwUnless(t){return typeof t=="function"?t(this)?this:this.throw():t?this:this.throw()}throwIfStatus(t){return typeof t=="function"&&t(this.status(),this)?this.throw():this.status()===t?this.throw():this}throwUnlessStatus(t){return typeof t=="function"&&!t(this.status(),this)?this.throw():this.status()===t?this:this.throw()}throwIfClientError(){return this.clientError()?this.throw():this}throwIfServerError(){return this.serverError()?this.throw():this}}var J1;J1=Symbol.toStringTag;let ic=class{constructor(t){Ar(this,"promise"),Ar(this,"response"),Ar(this,J1,"Request"),this.promise=new Promise((n,r)=>{wn(t).then(o=>{this.response=new Cm(o),n(this.response)}).catch(o=>{Z$(o)&&o.response?(this.response=new Cm(o.response,o),n(this.response)):r(o)})})}then(t,n){return this.promise.then(t,n)}catch(t){return this.promise.catch(t)}finally(t){return this.promise.finally(t)}};class _D{constructor(t={}){this.options=t}parseData(t){return Me.get(this.options,"headers[Content-Type]","application/json")==="application/x-www-form-urlencoded"&&t?Me.toFormData(t||{}):t}baseUrl(t){return Me.set(this.options,"baseURL",t),this}asForm(){return Me.set(this.options,"headers[Content-Type]","application/x-www-form-urlencoded"),this}accept(t){return Me.set(this.options,"headers[Accept]",t),this}acceptJson(){return this.accept("application/json")}withHeaders(t){return Me.set(this.options,"headers",Me.merge(this.options.headers??{},t)),this}replaceHeaders(t){return Me.set(this.options,"headers",t),this}withOptions(t){return this.options=Me.merge(this.options,t),this}replaceOptions(t){return this.options=t,this}withQueryParameters(t){const n=typeof t=="string"?Me.fromQuery(new URLSearchParams(t)):t instanceof URLSearchParams?Me.fromQuery(t):t;return Me.set(this.options,"params",Me.merge(this.options.params||{},n)),this}replaceQueryParameters(t){return Me.set(this.options,"params",typeof t=="string"?Me.fromQuery(new URLSearchParams(t)):t instanceof URLSearchParams?Me.fromQuery(t):t),this}withData(t){const n=Me.get(this.options,"data",{}),r=n instanceof FormData?Me.fromFormData(n):n;return Me.set(this.options,"data",this.parseData(Me.merge(r,t))),this}replaceData(t){return Me.set(this.options,"data",this.parseData(t)),this}withBasicAuth(t,n){return Me.set(this.options,"headers.Authorization",`Basic ${btoa(`${t}:${n}`)}`),this}withToken(t){return Me.set(this.options,"headers.Authorization",`Bearer ${t}`),this}get(t,n){return new ic({...this.options,params:n??this.options.params,url:t})}post(t,n){return new ic({...this.options,method:"post",url:t,data:this.parseData(n??this.options.data)})}put(t,n){return new ic({...this.options,method:"put",url:t,data:this.parseData(n??this.options.data)})}patch(t,n){return new ic({...this.options,method:"patch",url:t,data:this.parseData(n??this.options.data)})}delete(t,n){return new ic({...this.options,method:"delete",params:n??this.options.params,url:t})}}class ID{cartesian(...t){return t.reduce((n,r)=>n.flatMap(o=>r.map(s=>[o,s].flat())))}sampleSize(t,n){return this.shuffle(t).slice(0,n)}shuffle(t){return RD(t)}}const Ad=new(Mi(ID)),ui=e=>{e.emit("change",{items:e.all(),source:e})},Md=(e,t)=>Array.isArray(e)?e[t]??null:e.get(t);function _d(e){return e instanceof Un}var X1,Z1,oe;const LD=class qe extends pa{constructor(t=[]){super(),u2(this,oe),Ar(this,X1,"Collection"),d2(this,oe,t)}get items(){return[...ae(this,oe)]}[(Z1=Symbol.iterator,X1=Symbol.toStringTag,Z1)](){return ae(this,oe)[Symbol.iterator]()}all(){return[...ae(this,oe)]}average(t){return typeof t=="string"?this.avg(t):this.avg()}avg(t){return typeof t=="string"?this.sum(t)/ae(this,oe).length:this.sum()/ae(this,oe).length}chunk(t){const n=[];for(let r=0;r<ae(this,oe).length;r+=t)n.push(ae(this,oe).slice(r,r+t));return new qe(n.map(r=>new qe(r)))}chunkWhile(t){const n=[];let r=new qe;for(let o=0;o<ae(this,oe).length;o++)t(ae(this,oe)[o],o,r)?r.push(ae(this,oe)[o]):(n.push(r),r=new qe);return r.count()>0&&n.push(r),new qe(n)}collapse(){return new qe(ae(this,oe).flat())}collect(){return new qe(ae(this,oe))}combine(t){const n={};return ae(this,oe).forEach((r,o)=>{if(typeof r!="string")throw new TypeError("The `combine` method expects the keys to be strings");n[r]=Md(t,o)}),n}concat(t){return Array.isArray(t)?new qe([...ae(this,oe),...t]):new qe([...ae(this,oe),...t.all()])}contains(t,n){return typeof t=="function"?ae(this,oe).some((r,o)=>t(r,o,this)):ae(this,oe).some(r=>{if(typeof n>"u")return r==t;if(typeof t!="string")throw new TypeError("The key must be a string");return r[t]==n})}containsOneItem(){return ae(this,oe).length===1}containsStrict(t,n){return typeof t=="function"?ae(this,oe).some((r,o)=>t(r,o,this)):ae(this,oe).some(r=>{if(typeof n>"u")return r===t;if(typeof t!="string")throw new TypeError("The key must be a string");return r[t]===n})}count(){return ae(this,oe).length}countBy(t){return typeof t=="function"?ae(this,oe).reduce((n,r,o)=>{const s=t(r,o,this);return n[s]=n[s]?n[s]+1:1,n},{}):ae(this,oe).reduce((n,r)=>{if(!["string","number"].includes(typeof r))throw new TypeError("The countBy method expects the items to be strings or numbers");return n[String(r)]=n[String(r)]?n[String(r)]+1:1,n},{})}crossJoin(...t){return new qe(Ad.cartesian(ae(this,oe),...t.map(n=>Array.isArray(n)?n:n.all())))}diff(t){return Array.isArray(t)?new qe(ae(this,oe).filter(n=>!t.includes(n))):new qe(ae(this,oe).filter(n=>!t.contains(n)))}doesntContain(t,n){return typeof t=="function"?ae(this,oe).every((r,o)=>!t(r,o,this)):ae(this,oe).every(r=>{if(typeof n>"u")return r!=t;if(typeof t!="string")throw new TypeError("The key must be a string");return r[t]!=n})}dump(){console.log(this.toArray())}duplicates(t){return typeof t=="string"?new qe(ae(this,oe).reduce((n,r,o)=>(ae(this,oe).slice(o+1).some(s=>s[t]==r[t])&&n.push(r[t]),n),[])):new qe(ae(this,oe).reduce((n,r,o)=>(ae(this,oe).slice(o+1).some(s=>s==r)&&n.push(r),n),[]))}duplicatesStrict(t){return typeof t=="string"?new qe(ae(this,oe).reduce((n,r,o)=>(ae(this,oe).slice(o+1).some(s=>s[t]===r[t])&&n.push(r[t]),n),[])):new qe(ae(this,oe).reduce((n,r,o)=>(ae(this,oe).slice(o+1).some(s=>s===r)&&n.push(r),n),[]))}each(t){let n=0;for(const r of this){if(t(r,n,this)===!1)break;n++}return this}eachSpread(t){for(const n of this){if(!Array.isArray(n)&&!_d(n))throw new TypeError("The items in the collection must be arrays or collections");const r=Array.isArray(n)?n:n.all();if(t(...r)===!1)break}return this}ensure(t){const n=Array.isArray(t)?t:[t];return ae(this,oe).forEach((r,o)=>{if(!n.some(s=>typeof s=="string"?typeof r===s:r instanceof s))throw new TypeError(`The item at index ${o} is not of the expected type`)}),this}every(t){return ae(this,oe).every((n,r)=>t(n,r,this))}except(t){return new qe(ae(this,oe).filter((n,r)=>!t.includes(r)))}filter(t){return new qe(ae(this,oe).filter((n,r)=>typeof t!="function"?!!n:t(n,r,this)))}first(t){return typeof t=="function"?ae(this,oe).find((n,r)=>t(n,r,this))??null:ae(this,oe)[0]??null}firstOrFail(t){const n=this.first(t);if(n===null)throw new Error("No matching item found");return n}firstWhere(t,n,r){if(typeof t!="string")throw new TypeError("The key must be a string");if(typeof n>"u")return this.first(o=>!!o[t]);if(typeof r>"u")return ae(this,oe).find(o=>o[t]==n)??null;if(typeof n!="string")throw new TypeError("The operator must be a string");return r===null?ae(this,oe).find(o=>o[t]===null)??null:ae(this,oe).find(o=>{switch(n){case"=":return o[t]==r;case"!=":return o[t]!=r;case">":return o[t]>r;case"<":return o[t]<r;case">=":return o[t]>=r;case"<=":return o[t]<=r;default:throw new Error("Unsupported operator")}})??null}flatMap(t){return new qe(ae(this,oe).flatMap((n,r)=>t(n,r,this)))}forget(t){return ae(this,oe).splice(t,1),ui(this),this}forPage(t,n){return new qe(ae(this,oe).slice((t-1)*n,t*n))}get(t,n){if(typeof t!="number")throw new TypeError("The key must be a number");return typeof n>"u"?ae(this,oe)[t]??null:typeof n=="function"?ae(this,oe)[t]??n():ae(this,oe)[t]??n}groupBy(t){const n=Array.isArray(t)?t:[t];return ae(this,oe).reduce((r,o,s)=>{const l=n.map(c=>{if(typeof c=="function"){const u=c(o,s,this);return Array.isArray(u)?u:[u]}return[String(o[c])]});return Ad.cartesian(...l).forEach(c=>{const u=Array.isArray(c)?c.join("."):c;Me.set(r,u,[...Me.get(r,u,[]),o])}),r},{})}has(t){return ae(this,oe).length>t}hasAny(t){return t.some(n=>this.has(n))}implode(t,n){if(typeof n>"u"){if(typeof t!="string")throw new TypeError("The glue must be a string");if(!ae(this,oe).every(r=>["string","number"].includes(typeof r)))throw new TypeError("The items must be strings or numbers");return ae(this,oe).join(t)}if(typeof t=="function")return ae(this,oe).map((r,o)=>t(r,o,this)).join(n);if(typeof t!="string")throw new TypeError("The key must be a string");if(!ae(this,oe).every(r=>typeof r=="object"))throw new TypeError("The items must be objects");return ae(this,oe).map(r=>r[t]).join(n)}intersect(t){return Array.isArray(t)?new qe(ae(this,oe).filter(n=>t.includes(n))):new qe(ae(this,oe).filter(n=>t.contains(n)))}isEmpty(){return ae(this,oe).length===0}isNotEmpty(){return!this.isEmpty()}join(t,n){return typeof n>"u"?ae(this,oe).join(t):ae(this,oe).slice(0,-1).join(t)+n+ae(this,oe)[ae(this,oe).length-1]}keyBy(t){if(typeof t=="function")return ae(this,oe).reduce((n,r,o)=>(n[t(r,o,this)]=r,n),{});if(typeof t!="string")throw new TypeError("The key must be a string");return ae(this,oe).reduce((n,r)=>(n[String(r[t])]=r,n),{})}last(t){return typeof t=="function"?ae(this,oe).toReversed().find((n,r)=>t(n,r,this))??null:ae(this,oe)[ae(this,oe).length-1]??null}map(t){return new qe(ae(this,oe).map((n,r)=>t(n,r,this)))}mapInto(t){return new qe(ae(this,oe).map(n=>new t(n)))}mapSpread(t){return new qe(ae(this,oe).map(n=>{if(!Array.isArray(n)&&!_d(n))throw new TypeError("The items in the collection must be arrays or collections");const r=Array.isArray(n)?n:n.all();return t(...r)}))}mapToGroups(t){return ae(this,oe).reduce((n,r,o)=>{const s=t(r,o,this);return Object.entries(s).forEach(([l,c])=>{n[l]=n[l]??[],n[l].push(c)}),n},{})}mapWithKeys(t){return ae(this,oe).reduce((n,r,o)=>{const s=t(r,o,this);return Object.entries(s).forEach(([l,c])=>{n[l]=c}),n},{})}max(t){return typeof t=="string"?ae(this,oe).reduce((n,r)=>r[t]>n?r[t]:n,ae(this,oe)[0][t]):ae(this,oe).reduce((n,r)=>r>n?r:n,ae(this,oe)[0])}median(t){if(typeof t=="string"){const o=this.pluck(t).sort(),s=Math.floor(o.count()/2);return o.count()%2===0?new qe([Md(o,s-1),Md(o,s)]).avg():Md(o,s)}const n=ae(this,oe).toSorted(),r=Math.floor(n.length/2);return n.length%2===0?new qe([n[r-1],n[r]]).avg():n[r]??null}merge(t){return Array.isArray(t)?new qe([...ae(this,oe),...t]):new qe([...ae(this,oe),...t.all()])}min(t){return typeof t=="string"?ae(this,oe).reduce((n,r)=>r[t]<n?r[t]:n,ae(this,oe)[0][t]):ae(this,oe).reduce((n,r)=>r<n?r:n,ae(this,oe)[0])}mode(t){const n=typeof t=="string"?this.filter(o=>["number","string"].includes(typeof o[t])).countBy(o=>o[t]):this.countBy(),r=Math.max(...Object.values(n));return Object.entries(n).filter(([,o])=>o===r).map(([o])=>o)}nth(t,n=0){return this.chunk(t).filter(r=>r.count()>n).map(r=>r.get(n))}only(t){return new qe(ae(this,oe).filter((n,r)=>t.includes(r)))}pad(t,n=null){const r=ae(this,oe).slice();for(;r.length<Math.abs(t);)t>0?r.push(n):r.unshift(n);return new qe(r)}partition(t){return[this.filter(t),this.reject(t)]}percentage(t,n=2){return Math.round(100*(10^n)*this.filter(t).count()/ae(this,oe).length)/(10^n)}pipe(t){return t(this)}pipeInto(t){return new t(this)}pipeThrough(t){return t.reduce((n,r)=>{if(!_d(n)&&!Array.isArray(n))throw new TypeError("The pipeline expects the carry to be a collection or an array");return r(_d(n)?n:new qe(n))},this)}pluck(t){return this.map(n=>n[t])}pop(t=1){const n=ae(this,oe).splice(ae(this,oe).length-t,t);return ui(this),t===1?n[0]??null:new qe(n)}prepend(t){const n=ae(this,oe).unshift(t);return ui(this),n}pull(t){const n=ae(this,oe).splice(t,1)[0]??null;return ui(this),n}push(...t){const n=ae(this,oe).push(...t);return ui(this),n}put(t,n){return ae(this,oe).splice(t,1,n),ui(this),this}random(t=1){if(ae(this,oe).length<t)throw new Error("The collection has fewer items than the requested amount");const n=new qe(Ad.sampleSize(ae(this,oe),t));return t===1?n.first():n}reduce(t,n=null){return ae(this,oe).reduce((r,o,s)=>t(r,o,s,this),n)}reject(t){return this.filter((n,r)=>!t(n,r,this))}replace(t){const n=ae(this,oe).slice();return Object.entries(t).forEach(([r,o])=>{n[parseInt(r)]=o}),new qe(n)}reverse(){return new qe(ae(this,oe).toReversed())}search(t,n=!1){if(typeof t!="function"||ae(this,oe).every(o=>typeof o=="function")){const o=ae(this,oe).findIndex(s=>n?s===t:s==t);return o===-1?!1:o}const r=ae(this,oe).findIndex((o,s)=>t(o,s,this));return r===-1?!1:r}select(t){return this.map(n=>t.reduce((r,o)=>(r[o]=n[o],r),{}))}shift(t=1){const n=ae(this,oe).splice(0,t);return ui(this),t===1?n[0]??null:new qe(n)}shuffle(){return new qe(Ad.shuffle(ae(this,oe)))}skip(t){return new qe(ae(this,oe).slice(t))}skipUntil(t){return typeof t=="function"?this.skip(ae(this,oe).findIndex((n,r)=>t(n,r,this))):this.skip(ae(this,oe).findIndex(n=>n==t))}skipWhile(t){return typeof t=="function"?this.skip(ae(this,oe).findIndex((n,r)=>!t(n,r,this))):this.skip(ae(this,oe).findIndex(n=>n!=t))}slice(t,n){return typeof n>"u"?new qe(ae(this,oe).slice(t)):typeof t>"u"?new qe(ae(this,oe).slice(0,n)):new qe(ae(this,oe).slice(t,t+n))}sliding(t,n=1){const r=[];for(let o=0;o<ae(this,oe).length&&!(o+t>ae(this,oe).length);o+=n)r.push(ae(this,oe).slice(o,o+t));return new qe(r.map(o=>new qe(o)))}sole(t,n){if(typeof t=="function"){const r=this.filter(t);return r.count()===1?r.first():null}if(typeof t=="string"){const r=this.where(t,n);return r.count()===1?r.first():null}return ae(this,oe).length===1?this.first():null}some(...t){return this.contains(...t)}sort(t){return new qe(ae(this,oe).toSorted(t))}sortBy(t,n="asc"){if(typeof t=="function"){let r=-1;return new qe(ae(this,oe).toSorted((o,s)=>(r++,t(o,r,this)-t(s,r,this))))}if(Array.isArray(t))return t.every(r=>Array.isArray(r))?new qe(ae(this,oe).toSorted((r,o)=>{for(const[s,l]of t){const c=r[s]??-1/0,u=o[s]??-1/0;if(c>u)return l==="asc"?1:-1;if(c<u)return l==="asc"?-1:1}return 0})):new qe(ae(this,oe).toSorted((r,o)=>{for(const s of t){const l=s(r,o);if(l!==0)return l}return 0}));if(typeof t!="string")throw new TypeError("The key must be a string");return new qe(ae(this,oe).toSorted((r,o)=>{const s=r[t]??-1/0,l=o[t]??-1/0;return s>l?n==="asc"?1:-1:s<l?n==="asc"?-1:1:0}))}sortDesc(){return this.sort((t,n)=>t>n?-1:t<n?1:0)}splice(t,n,...r){const o=n===void 0?ae(this,oe).length:n,s=ae(this,oe).splice(t,o,...r);return ui(this),new qe(s)}split(t){const n=[];for(let r=0;r<t;r++){const o=ae(this,oe).slice(n.flat().length,n.flat().length+Math.min(Math.ceil((ae(this,oe).length-n.flat().length)/(t-r)),ae(this,oe).length-n.flat().length));n.push(new qe(o))}return new qe(n)}splitIn(t){const n=Math.ceil(ae(this,oe).length/t);return this.chunk(n)}sum(t){return typeof t=="string"?ae(this,oe).reduce((n,r)=>{const o=r[t];if(typeof o!="number")throw new TypeError("The items must be numbers");return n+o},0):ae(this,oe).reduce((n,r)=>{if(typeof r!="number")throw new TypeError("The items must be numbers");return n+r},0)}take(t){return new qe(ae(this,oe).slice(0,t))}takeUntil(t){return typeof t=="function"?this.take(ae(this,oe).findIndex((n,r)=>t(n,r,this))):this.take(ae(this,oe).findIndex(n=>n==t))}takeWhile(t){return typeof t=="function"?this.take(ae(this,oe).findIndex((n,r)=>!t(n,r,this))):this.take(ae(this,oe).findIndex(n=>n!=t))}tap(t){return t(this),this}toArray(){const t=n=>typeof n!="object"?n:Array.isArray(n)?n.map(t):n&&"toArray"in n&&typeof n.toArray=="function"?n.toArray():n&&"toJson"in n&&typeof n.toJson=="function"?n.toJson():n;return ae(this,oe).map(t)}toJson(){return JSON.stringify(ae(this,oe))}transform(t){for(const[n,r]of ae(this,oe).entries())ae(this,oe).splice(n,1,t(r,n,this));return ui(this),this}unique(t){return typeof t=="string"?new qe([...new Set(ae(this,oe).map(n=>n[t]))].map(n=>ae(this,oe).find(r=>r[t]==n))):new qe([...new Set(ae(this,oe))])}uniqueStrict(t){return typeof t=="string"?new qe([...new Set(ae(this,oe).map(n=>n[t]))].map(n=>ae(this,oe).find(r=>r[t]===n))):new qe([...new Set(ae(this,oe))])}unless(t,n,r){return t?typeof r=="function"&&r(this):n(this),this}unlessEmpty(t,n){return this.whenNotEmpty(t,n)}unlessNotEmpty(t,n){return this.whenEmpty(t,n)}value(t){return ae(this,oe).length===0?null:ae(this,oe)[0][t]}when(t,n,r){return t?n(this):typeof r=="function"&&r(this),this}whenEmpty(t,n){return this.isEmpty()?t(this):typeof n=="function"&&n(this),this}whenNotEmpty(t,n){return this.isNotEmpty()?t(this):typeof n=="function"&&n(this),this}where(t,n,r){if(typeof r>"u")return new qe(ae(this,oe).filter(s=>s[t]==n));if(typeof n!="string")throw new TypeError("The operator must be a string");if(r===null)return new qe(ae(this,oe).filter(s=>s[t]===null));const o={"=":s=>s[t]==r,"!=":s=>s[t]!=r,">":s=>s[t]>r,"<":s=>s[t]<r,">=":s=>s[t]>=r,"<=":s=>s[t]<=r};if(!(n in o))throw new Error("Unsupported operator");return new qe(ae(this,oe).filter((s,l)=>o[n](s,l,this)))}whereStrict(t,n,r){if(typeof r>"u")return new qe(ae(this,oe).filter(s=>s[t]===n));if(typeof n!="string")throw new TypeError("The operator must be a string");if(r===null)return new qe(ae(this,oe).filter(s=>s[t]===null));const o={"=":s=>s[t]===r,"!=":s=>s[t]!==r,">":s=>s[t]>r,"<":s=>s[t]<r,">=":s=>s[t]>=r,"<=":s=>s[t]<=r};if(!(n in o))throw new Error("Unsupported operator");return new qe(ae(this,oe).filter((s,l)=>o[n](s,l,this)))}whereBetween(t,[n,r]){return new qe(ae(this,oe).filter(o=>o[t]>=n&&o[t]<=r))}whereNotBetween(t,[n,r]){return new qe(ae(this,oe).filter(o=>o[t]<n||o[t]>r))}whereIn(t,n){return new qe(ae(this,oe).filter(r=>n.includes(r[t])))}whereNotIn(t,n){return new qe(ae(this,oe).filter(r=>!n.includes(r[t])))}whereNull(t){return new qe(ae(this,oe).filter(n=>n[t]===null))}whereNotNull(t){return new qe(ae(this,oe).filter(n=>n[t]!==null))}whereInstanceOf(t){return new qe(ae(this,oe).filter(n=>n instanceof t))}zip(t){return Array.isArray(t)?new qe(ae(this,oe).map((n,r)=>[n,t[r]??null])):new qe(ae(this,oe).map((n,r)=>[n,t.get(r)]))}};oe=new WeakMap;let Un=LD;function So(e,t){return new class extends e{constructor(){return super(),new Proxy(this,{get(n,r){if(Reflect.has(n,r))return Reflect.get(n,r);const o=n.getFacadeAccessor(),s=typeof o=="string"?t.make(o):o;if(!s)throw new Error(`Service ${String(o)} does not exist.`);const l=Reflect.get(s,r,s);return typeof l=="function"&&!Object.prototype.hasOwnProperty.call(s,r)?l.bind(s):l}})}}}class $s extends pa{constructor(t){super(),Ar(this,"locked",[]),this.bag=t,Object.freeze(this.bag)}get(t,n){return Me.get(this.bag,t,n)}set(t,n){if(this.locked.some(r=>t.startsWith(r)))throw new Error(`Cannot set a locked path "${t}"`);if(typeof n=="object"&&n!==null&&this.locked.some(r=>Me.has(n,r.slice(t.length+1))))throw new Error(`Cannot set a path "${t}" that would override a locked path`);if(t==="."){if(this.locked.length)throw new Error("Cannot set the root path when there are locked paths");if(typeof n!="object"||n===null)throw new TypeError("Value must be an object");this.bag=fa(this.bag,()=>n),this.emit("change",{path:t,value:n,type:"set",source:this});return}this.bag=fa(this.bag,r=>{Me.set(r,t,n)}),this.emit("change",{path:t,value:n,type:"set",source:this})}merge(t,n){if(typeof n!="object"||n===null)throw new TypeError("Value must be an object");if(t==="."){if(this.locked.some(o=>Me.has(n,o)))throw new Error(`Cannot merge a path "${t}" that would override a locked path`);this.bag=fa(this.bag,o=>({...o,...n})),this.emit("change",{path:t,value:n,type:"merge",source:this});return}const r=this.get(t);if(typeof r=="object"&&r!==null)return this.set(t,{...r,...n});if(r===null||typeof r>"u")return this.set(t,n);throw new Error(`Cannot merge a non-object path "${t}"`)}has(t){return Me.has(this.bag,t)}delete(t){if(this.locked.some(n=>t.startsWith(n)))throw new Error(`Cannot delete a locked path "${t}"`);this.bag=fa(this.bag,n=>{Me.unset(n,t)}),this.emit("change",{path:t,value:null,type:"delete",source:this})}lock(t){if(!this.has(t))throw new Error(`Cannot lock a non-existing path "${t}"`);this.locked.push(t)}clone(){return new $s(this.bag)}all(){return this.bag}isEmpty(){return Me.isEmpty(this.bag)}}var ew,tw;class ND extends(tw=Error,ew=Symbol.toStringTag,tw){constructor(t,n){super(`[Luminix] Cannot create reducer '${t}' on '${n}' as it is a reserved property`),Ar(this,ew,"ReducerOverrideException")}}function xa(e){return class extends e{constructor(...t){return super(...t),Ar(this,"_reducers",{}),new Proxy(this,{get(n,r,o){return typeof r=="symbol"||r in n?Reflect.get(n,r,o):(s,...l)=>{const{[r]:c=new Un}=n._reducers;return Xr(s)?fa(s,u=>c.sortBy("priority").reduce((f,p)=>p.callback(f,...l),u)):c.sortBy("priority").reduce((u,f)=>f.callback(u,...l),s)}}})}reducer(t,n,r=10){if(t in this)throw new ND(t,this);return this._reducers[t]||(this._reducers[t]=new Un),this._reducers[t].push({callback:n,priority:r}),()=>this.removeReducer(t,n)}removeReducer(t,n){const r=this._reducers[t].search(o=>o.callback===n);r!==!1&&this._reducers[t].pull(r)}getReducer(t){return this._reducers[t]||(this._reducers[t]=new Un),this._reducers[t]}hasReducer(t){return!!this._reducers[t]&&this._reducers[t].count()>0}clearReducer(t){this._reducers[t]&&this._reducers[t].splice(0,this._reducers[t].count())}flushReducers(){Object.values(this._reducers).forEach(t=>t.splice(0,t.count()))}}}class Id{constructor(t){this.app=t}}function nw(e){return e instanceof Cm&&e.unprocessableEntity()&&typeof e.json("message")=="string"&&typeof e.json("errors")=="object"&&e.json("errors")!==null&&Object.values(e.json("errors")).every(t=>Array.isArray(t)&&t.every(n=>typeof n=="string"))}class DD{after(t,n){return t.includes(n)?t.split(n).slice(1).join(""):""}afterLast(t,n){return t.includes(n)?t.split(n).slice(-1).join(""):""}before(t,n){return t.includes(n)?t.split(n).slice(0,1).join(""):""}beforeLast(t,n){return t.includes(n)?t.split(n).slice(0,-1).join(""):""}camel(t){return lI(t)}lcfirst(t){return BN(t)}lower(t){return t.toLowerCase()}kebab(t){return FN(t)}padBoth(t,n,r){return pD(t,n,r)}padLeft(t,n,r){return mD(t,n,r)}padRight(t,n,r){return hD(t,n,r)}human(t){return zx(Y1(t))}studly(t){return Ed(this.camel(t))}snake(t){return ED(t)}title(t){return Y1(t)}trim(t,n){return $D(t,n)}ucfirst(t){return Ed(t)}upper(t){return t.toUpperCase()}}const Ke=new(Mi(DD));class FD{parse(t){return t instanceof Date?t:new Date(t)}toDateTimeLocal(t){const n=this.parse(t),r=`${n.getFullYear()}`,o=`${Ke.padLeft(`${n.getMonth()+1}`,2,"0")}`,s=`${Ke.padLeft(`${n.getDate()}`,2,"0")}`,l=`${Ke.padLeft(`${n.getHours()}`,2,"0")}`,c=`${Ke.padLeft(`${n.getMinutes()}`,2,"0")}`;return`${r}-${o}-${s}T${l}:${c}`}}const sc=new(Mi(FD));class BD{throttle(t,n,r){return PD(t,n,r)}debounce(t,n,r){return L1(t,n,r)}}const Rm=new(Mi(BD));class zD{fromObject(t){return Me.toQuery(t)}toObject(t){return Me.fromQuery(t)}merge(...t){const n=new URLSearchParams;return t.forEach(r=>{(typeof r=="string"?new URLSearchParams(Ke.after(r,"?")):r).forEach((o,s)=>{n.set(s,o)})}),n}}const js=new(Mi(zD));var UD=Object.defineProperty,WD=(e,t,n)=>t in e?UD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zt=(e,t,n)=>WD(e,typeof t!="symbol"?t+"":t,n);class HD{constructor(t,n,r){Zt(this,"_user"),this.config=t,this.model=n,this.route=r}attempt(t,n=!1,r){const o=document.createElement("form");o.method="post",o.action=this.route.url("login"),o.style.display="none";const s=this.config.get("auth.csrf");if(typeof s=="string"){const u=document.createElement("input");u.type="hidden",u.name="_token",u.value=s,o.appendChild(u)}const l=document.createElement("input");l.type="email",l.name="email",l.value=t.email,o.appendChild(l);const c=document.createElement("input");if(c.type="password",c.name="password",c.value=t.password,o.appendChild(c),n){const u=document.createElement("input");u.type="checkbox",u.name="remember",u.value="1",u.checked=!0,o.appendChild(u)}r&&o.addEventListener("submit",r),document.body.appendChild(o),o.submit()}check(){return!!this.config.get("auth.user")}logout(t){const n=document.createElement("form");n.method="post",n.action=this.route.url("logout"),n.style.display="none";const r=this.config.get("auth.csrf");if(typeof r=="string"){const o=document.createElement("input");o.type="hidden",o.name="_token",o.value=r,n.appendChild(o)}document.body.appendChild(n),t&&n.addEventListener("submit",t),n.submit()}user(){if(!this._user){const t=this.model.make("user"),n=this.config.get("auth.user");if(!n)return;this._user=new t(n),this._user.exists=!0}return this._user}id(){var t;return((t=this.user())==null?void 0:t.getKey())||null}}let VD=class{constructor(){Zt(this,"bags");const t={};document.querySelectorAll('#luminix-embed [id^="luminix-error"]').forEach(n=>{const r=n.id.replace("luminix-error::","");t[r]=rx(r,"error")}),this.bags={default:new $s(t)}}bag(t="default"){return this.bags[t]||(this.bags[t]=new $s({})),this.bags[t]}add(t,n,r="default"){this.bag(r).set(t,n)}set(t,n="default"){this.bag(n).set(".",t)}all(t="default"){return this.bag(t).all()}get(t,n="default"){return this.bag(n).get(t,null)}clear(t="default"){this.bag(t).set(".",{})}};class KD{constructor(t){this._debug=t}emergency(...t){this._debug&&console.error(...t)}alert(...t){this._debug&&console.error(...t)}critical(...t){this._debug&&console.error(...t)}error(...t){this._debug&&console.error(...t)}warning(...t){this._debug&&console.warn(...t)}notice(...t){this._debug&&console.info(...t)}info(...t){this._debug&&console.info(...t)}debug(...t){this._debug&&console.debug(...t)}}var rw,ow;let qD=class extends(ow=Error,rw=Symbol.toStringTag,ow){constructor(t){super(`[Luminix] Model "${t}" does not have a primary key`),Zt(this,rw,"ModelWithoutPrimaryKeyException")}},GD=class extends pa{constructor(t,n,r={}){super(),Zt(this,"bag"),this.services=t,this.abstract=n,this.bag=new $s(r),this.bag.on("change",()=>{this.emit("change",{data:this.bag,source:this})})}lock(t){this.bag.lock(t)}whereBetween(t,n){return this.where(t,"between",n)}whereNotBetween(t,n){return this.where(t,"notBetween",n)}whereNull(t){return this.where(t,"null",null)}whereNotNull(t){return this.where(t,"notNull",null)}limit(t){return this.bag.set("per_page",t),this}where(t,n,r){if(this.bag.has("where")||this.bag.set("where",{}),typeof t=="function")return t(this)||this;if(typeof r>"u")return this.bag.set(`where.${t}`,n),this;if(typeof n!="string")throw new Error(`Invalid operator ${n} provided for where clause.`);const o={"=":"","!=":"notEquals",">":"greaterThan",">=":"greaterThanOrEquals","<":"lessThan","<=":"lessThanOrEquals"}[n]||n;return this.bag.set(`where.${t}:${o}`,r),this}with(t){const n=this.bag.get("with",[]);return(Array.isArray(t)?t:[t]).forEach(r=>{n.includes(r)||n.push(r)}),this.bag.set("with",n),this}withOnly(t){return this.bag.set("with",Array.isArray(t)?t:[t]),this}without(t){const n=this.bag.get("with",[]);return(Array.isArray(t)?t:[t]).forEach(r=>{n.includes(r)&&n.splice(n.indexOf(r),1)}),this.bag.set("with",n),this}orderBy(t,n="asc"){return this.bag.set("order_by",`${t}:${n}`),this}searchBy(t){return this.bag.set("q",t),this}minified(){return this.bag.set("minified",1),this}unset(t){return this.bag.delete(t),this}include(t){for(const[n,r]of t.entries())this.bag.set(n,r);return this}async exec(t={}){try{const{page:n=1,replaceLinks:r=!1}=t;this.bag.set("page",n),this.emit("submit",{data:this.bag,source:this});const o=await this.services.route.call(`luminix.${this.abstract}.index`,c=>c.withQueryParameters(this.bag.all())),s=this.services.model.make(this.abstract),l=new Un(o.json("data").map(c=>{const u=new s(c);return u.exists=!0,this.services.model.emit("fetch",{class:this.abstract,model:u,source:this.services.model}),u}));if(r){const c=window.location.href,[u]=c.split("?");return{...o.json(),data:l,links:{first:`${u}?${js.merge(c,o.json("links").first).toString()}`,last:`${u}?${js.merge(c,o.json("links").last).toString()}`,next:o.json("links").next&&`${u}?${js.merge(c,o.json("links").next??"").toString()}`,prev:o.json("links").prev&&`${u}?${js.merge(c,o.json("links").prev??"").toString()}`},meta:{...o.json("meta"),links:o.json("meta").links.map(f=>({...f,url:f.url&&`${u}?${js.merge(c,f.url).toString()}`}))}}}return{...o.json(),data:l}}catch(n){throw this.emit("error",{error:n,source:this}),n}}async get(t={}){const n=await this.exec(t);return this.emit("success",{response:n,items:n.data,source:this}),n}async first(){const t=await this.limit(1).exec();return this.emit("success",{response:t,items:t.data.first(),source:this}),t.data.first()}async find(t){const n=this.services.model.schema(this.abstract).primaryKey;if(!n)throw new qD(this.abstract);const r=await this.where(n,t).limit(1).exec();return this.emit("success",{response:r,items:r.data.sole(),source:this}),r.data.sole()}async all(){const t=this.services.config.get("luminix.backend.api.max_per_page",150),n=await this.limit(t).exec(),r=n.meta.last_page;if(r===1)return n.data;const o=Array.from({length:r-1},(c,u)=>u+2),s=await Promise.all(o.map(c=>this.limit(t).exec({page:c}))),l=new Un(s.reduce((c,u)=>(c.push(...u.data),c),n.data).all());return this.emit("success",{response:{...n,data:l},items:l,source:this}),l}};var iw,sw;class br extends(sw=TypeError,iw=Symbol.toStringTag,sw){constructor(t,n="Model"){super(`[Luminix] "${t}" expects ${n}`),Zt(this,iw,"NotModelException")}}var aw,lw;class QD extends(lw=Error,aw=Symbol.toStringTag,lw){constructor(t,n,r,o){super(`[Luminix] Could not determine inverse relation for "${n}" in model "${t}". Please specify a relation in model "${r}" of type ${o} that points back to "${t}".`),Zt(this,aw,"NoInverseRelationException")}}var cw,uw;let YD=class extends(uw=Error,cw=Symbol.toStringTag,uw){constructor(t){super(`[Luminix] Relation "${t}" is not supported`),Zt(this,cw,"UnsupportedRelationException")}},Ld=class{constructor(t,n,r,o=null){if(Zt(this,"unsubscribeQuery",null),this.services=t,this.meta=n,this.parent=r,this.items=o,o!==null&&!Me.isModel(o)&&!(o instanceof Un&&o.every(Me.isModel)))throw new br("Relation.constructor()","Model, Collection<Model> or null")}make(t){const n=this.getRelated();if(t===null||typeof t>"u"){this.set(null);return}if(this.isSingle()){if(typeof t!="object"||Array.isArray(t))throw new TypeError("Relation.make() expects an object");this.set(new n(t))}if(this.isMultiple()){if(!Array.isArray(t))throw new TypeError("Relation.make() expects an array");this.set(new Un(t.map(r=>new n(r))))}}guessInverseRelation(){const{relations:t}=this.getRelated().getSchema(),n=this.getType(),r=this.services.model.guessInverseRelation({HasOne:["BelongsTo"],HasMany:["BelongsTo"],BelongsTo:["HasOne","HasMany"],BelongsToMany:["BelongsToMany"],MorphTo:["MorphMany","MorphOne"],MorphOne:["MorphTo"],MorphMany:["MorphTo"],MorphToMany:["MorphToMany"]},this.parent,n,this.getRelated());if(!(n in r))throw new YD(n);for(const o in t){const s=t[o];if((s.model===this.parent.getType()||["MorphOne","MorphMany"].includes(n))&&r[n].includes(s.type))return o}throw new QD(this.parent.getType(),n,this.getRelated().getSchemaName(),r[n].join(" or "))}set(t){if(t!==null&&!Me.isModel(t)&&!(t instanceof Un&&t.every(Me.isModel)))throw new br("Relation.set()","Model, Collection<Model> or null");!this.items||Me.isModel(this.items)?this.items=t:t instanceof Un&&this.items.splice(0,this.items.count(),...t)}getForeignKey(){return this.meta.foreignKey}getName(){return this.meta.name}getType(){return this.meta.type}getModel(){return this.meta.model}getRelated(){return this.services.model.make(this.meta.model)}query(){const t=this.getRelated().query();return this.unsubscribeQuery&&this.unsubscribeQuery(),this.unsubscribeQuery=t.on("success",n=>{this.items=n.items}),t}isLoaded(){return this.items!==null}getLoadedItems(){return this.items}isSingle(){return Me.isModel(this.items)}isMultiple(){return this.items instanceof Un}getParent(){return this.parent}where(...t){return this.query().where(...t)}whereNull(t){return this.query().whereNull(t)}whereNotNull(t){return this.query().whereNotNull(t)}whereBetween(t,n){return this.query().whereBetween(t,n)}whereNotBetween(t,n){return this.query().whereNotBetween(t,n)}orderBy(t,n="asc"){return this.query().orderBy(t,n)}searchBy(t){return this.query().searchBy(t)}minified(){return this.query().minified()}limit(t){return this.query().limit(t)}};var dw,fw;class wa extends(fw=Error,dw=Symbol.toStringTag,fw){constructor(t){super(`[Luminix] Expected ${t} to be reducible.`),Zt(this,dw,"NotReducibleException")}}var pw,hw;class JD extends(hw=Error,pw=Symbol.toStringTag,hw){constructor(){super("[Luminix] Method not implemented."),Zt(this,pw,"MethodNotImplementedException")}}var mw,gw;class yw extends(gw=Error,mw=Symbol.toStringTag,gw){constructor(t,n){super(`[Luminix] Model "${t}" must be persisted before calling "${n}"`),Zt(this,mw,"ModelNotPersistedException")}}function XD(e,t,n,r,o){var s,l,c;return c=class extends(l=pa,s=Symbol.toStringTag,l){constructor(u={}){super(),Zt(this,"_attributes",new $s({})),Zt(this,"_original",{}),Zt(this,"_relations",{}),Zt(this,"_changedKeys",[]),Zt(this,"exists",!1),Zt(this,"wasRecentlyCreated",!1),Zt(this,s,Ke.studly(o)),this.makeRelations(),this.makeAttributes(u)}cast(u,f){return u==null||!f?u:["boolean","bool"].includes(f)?!!u&&u!=="0":["date","datetime","immutable_date","immutable_datetime"].includes(f)&&typeof u=="string"?new Date(u):["float","double","integer","int"].includes(f)||f.startsWith("decimal:")?Number(u):u}mutate(u,f){return u==null||!f?u:["boolean","bool"].includes(f)?!!u:["date","datetime","immutable_date","immutable_datetime"].includes(f)&&u instanceof Date?u.toISOString():["float","double","integer","int"].includes(f)||f.startsWith("decimal:")?Number(u):u}makeRelations(){const{relations:u}=n.schema(o);if(this._relations={},!u)return;const f=n.getRelationConstructors(o);Object.entries(u).forEach(([p,m])=>{const{type:g}=m,S=g in f?f[g]:Ld;this._relations[p]=new S({model:n,route:r},{name:p,...m},this,null)})}makeAttributes(u){const{relations:f,attributes:p=[]}=n.schema(o),m=Object.keys(f||{}),g=Me.omit(u,...m),S=w=>{const v=p.find(x=>x.name==w);return v?!(w in g)&&v.nullable:!1};if(this.fillable.filter(S).forEach(w=>{g[w]=null}),f&&Object.keys(f).forEach(w=>{this.relation(Ke.camel(w)).make(u[w])}),!this.validateJsonObject(g)){if(e.get("app.env","production")==="production")throw new TypeError(`[Luminix] Invalid attributes for model "${o}"`);t.warning(`Invalid attributes for model "${o}".
|
|
17
17
|
This will throw an error in production.`,{attributes:u,abstract:o})}this._attributes.set(".",g),this._original=g,this._changedKeys.splice(0,this._changedKeys.length)}makePrimaryKeyReplacer(){return{[this.getKeyName()]:this.getKey()}}dispatchChangeEvent(u){this.emit("change",{value:u,source:this})}dispatchCreateEvent(u){this.emit("create",{value:u,source:this}),n.emit("create",{class:o,model:this,source:n})}dispatchUpdateEvent(u){this.emit("update",{value:u,source:this}),n.emit("update",{class:o,model:this,source:n})}dispatchSaveEvent(){this.emit("save",{value:this.diff(),source:this}),n.emit("save",{class:o,model:this,source:n})}dispatchDeleteEvent(u=!1){this.emit("delete",{force:u,[this.getKeyName()]:this.getKey(),source:this}),n.emit("delete",{class:o,model:this,source:n,force:u})}dispatchRestoreEvent(){this.emit("restore",{value:this.attributes,source:this}),n.emit("restore",{class:o,model:this,source:n})}dispatchErrorEvent(u,f){this.emit("error",{error:u,operation:f,source:this}),n.emit("error",{class:o,model:this,source:n,error:u,operation:f})}updateChangedKeys(u){const f=(m,g)=>typeof m=="object"&&m!==null?Me.isEqual(m,g):m==g,p=u.includes(".")||u.includes("[")?u.split(/[.[]/)[0]:u;!this._changedKeys.includes(p)&&!f(Me.get(this._original,p),this._attributes.get(p))?this._changedKeys.push(p):this._changedKeys.includes(p)&&f(Me.get(this._original,p),this._attributes.get(p))&&this._changedKeys.splice(this._changedKeys.indexOf(p),1)}validateJsonObject(u){return typeof u!="object"||u===null?!1:Object.entries(u).every(([,f])=>["boolean","number","string"].includes(typeof f)||f===null||this.validateJsonObject(f)||Array.isArray(f)&&f.every(p=>this.validateJsonObject(p)))}get attributes(){return this._attributes.all()}get original(){return this._original}get relations(){return this._relations}get fillable(){return n.schema(o).fillable}get primaryKey(){return n.schema(o).primaryKey}get timestamps(){return n.schema(o).timestamps}get casts(){return{...n.schema(o).casts,...this.timestamps?{created_at:"datetime",updated_at:"datetime"}:{}}}get isDirty(){return this._changedKeys.length>0}getAttribute(u){let f=this._attributes.get(u,null);u in this.casts&&(f=this.cast(f,this.casts[u]));const p=n[`model${Ke.studly(o)}Get${Ke.studly(u)}Attribute`];if(typeof p!="function")throw new wa("ModelFacade");return p.bind(n)(f,this)}setAttribute(u,f){const p=n[`model${Ke.studly(o)}Set${Ke.studly(u)}Attribute`].bind(n)(this.mutate(f,this.casts[u]),this);if(!this.validateJsonObject({[u]:p})){if(e.get("app.env","production")==="production")throw new TypeError(`[Luminix] Attribute "${u}" in model "${o}" must be a boolean, number, string or null`);t.warning(`Invalid type for attribute "${u}" in model "${o}" after mutation.
|
|
18
18
|
This will throw an error in production.`,{key:u,value:f,mutated:p,cast:this.casts[u],item:this.toJson()});return}this._attributes.set(u,p),this.updateChangedKeys(u),this.dispatchChangeEvent({[u]:p})}getKey(){return this.getAttribute(this.primaryKey)}getKeyName(){return this.primaryKey}fill(u){const f=Me.pick(u,...this.fillable),p=Object.entries(f).reduce((m,[g,S])=>{const w=n[`model${Ke.studly(o)}Set${Ke.studly(g)}Attribute`];if(typeof w!="function")throw new wa("ModelFacade");return m[g]=w.bind(n)(this.mutate(S,this.casts[g]),this),m},{});if(!this.validateJsonObject(p)){if(e.get("app.env","production")==="production")throw new TypeError(`[Luminix] Invalid attributes for model "${o}"`);t.warning(`Invalid attributes for model "${o}" after mutation.
|
|
19
19
|
This will throw an error in production.`,{attributes:u,mutatedAttributes:p,item:this.toJson(),casts:this.casts});return}this._attributes.merge(".",p),Object.keys(p).forEach(m=>this.updateChangedKeys(m)),this.dispatchChangeEvent(p)}dump(){t.info({...this.toJson(),[Symbol.toStringTag]:Ke.studly(o)})}toJson(){const u=Object.entries(this.relations).reduce((p,[m,g])=>(g.isLoaded()&&(g.isSingle()?p[Ke.snake(m)]=g.getLoadedItems().toJson():g.isMultiple()&&(p[Ke.snake(m)]=g.getLoadedItems().map(S=>S.toJson()).all())),p),{}),f=n[`model${Ke.studly(o)}Json`];if(typeof f!="function")throw new wa("ModelFacade");return f.bind(n)({...this.attributes,...u},this)}diff(){return this._changedKeys.reduce((u,f)=>(u[f]=this._attributes.get(f),u),{})}getType(){return o}relation(u){if(u===Ke.camel(u))return this.relations[Ke.snake(u)]}getErrorBag(u){return`${this.exists?`${o}[${this.getKey()}].`:`${o}.`}${u}`}getRouteForSave(){return this.exists?[`luminix.${o}.update`,this.makePrimaryKeyReplacer()]:`luminix.${o}.store`}getRouteForUpdate(){return[`luminix.${o}.update`,this.makePrimaryKeyReplacer()]}getRouteForDelete(){return[`luminix.${o}.destroy`,this.makePrimaryKeyReplacer()]}getRouteForRefresh(){return[`luminix.${o}.show`,this.makePrimaryKeyReplacer()]}getLabel(){const{labeledBy:u}=n.schema(o);return this.getAttribute(u)}async refresh(u){if(!this.exists)throw new yw(o,"refresh");const f=await r.call(this.getRouteForRefresh(),u,this.getErrorBag("fetch"));this.makeAttributes(f.json())}async save(u={},f){try{const{additionalPayload:p={},sendsOnlyModifiedFields:m=!0}=u,g=this.exists,S={...Me.pick(m&&g?this.diff():this.attributes,...this.fillable),...p};if(Me.isEmpty(S))return;const w=await r.call(this.getRouteForSave(),v=>f?f(v.withData(S)):v.withData(S),this.getErrorBag(g?"update":"store"));if(w.successful())return this.makeAttributes(w.json()),this.exists=!0,this.dispatchSaveEvent(),g?this.dispatchUpdateEvent(w.json()):(this.wasRecentlyCreated=!0,this.dispatchCreateEvent(w.json())),w;throw w}catch(p){throw this.dispatchErrorEvent(p,"save"),p}}async push(){throw new JD}async delete(){try{const u=await r.call(this.getRouteForDelete(),void 0,this.getErrorBag("delete"));if(u.noContent())return this.dispatchDeleteEvent(),u;throw u}catch(u){throw this.dispatchErrorEvent(u,"delete"),u}}async update(u,f){try{const p=await r.call(this.getRouteForUpdate(),m=>f?f(m.withData(u)):m.withData(u),this.getErrorBag("update"));if(p.ok()){this.makeAttributes(p.json()),this.dispatchUpdateEvent(p.json());return}throw p}catch(p){throw this.dispatchErrorEvent(p,"save"),p}}async forceDelete(){try{const u=await r.call(this.getRouteForDelete(),f=>f.withQueryParameters({force:!0}),this.getErrorBag("forceDelete"));if(u.noContent())return this.dispatchDeleteEvent(!0),u;throw u}catch(u){throw this.dispatchErrorEvent(u,"forceDelete"),u}}async restore(){try{const u=await r.call(this.getRouteForUpdate(),f=>f.withQueryParameters({restore:!0}),this.getErrorBag("restore"));if(u.ok())return this.dispatchRestoreEvent(),u;throw u}catch(u){throw this.dispatchErrorEvent(u,"restore"),u}}static getSchemaName(){return o}static getSchema(){return n.schema(o)}static query(){return new GD({config:e,route:r,model:n},o)}static where(...u){return this.query().where(...u)}static whereNull(u){return this.query().whereNull(u)}static whereNotNull(u){return this.query().whereNotNull(u)}static whereBetween(u,f){return this.query().whereBetween(u,f)}static whereNotBetween(u,f){return this.query().whereNotBetween(u,f)}static orderBy(u,f="asc"){return this.query().orderBy(u,f)}static searchBy(u){return this.query().searchBy(u)}static minified(){return this.query().minified()}static limit(u){return this.query().limit(u)}static get(u){return this.query().get(u)}static find(u){return this.query().find(u)}static first(){return this.query().first()}static async create(u){const f=n.make(o),p=new f;return p.fill(u),await p.save(),p}static async update(u,f){const p=n.make(o),m=new p({id:u});return m.fill(f),m.exists=!0,await m.save(),m}static delete(u){if(Array.isArray(u))return r.call(`luminix.${o}.destroyMany`,p=>p.withQueryParameters({ids:u}),`${o}.deleteMany`);const f=n.make(o);return new f({id:u}).delete()}static async restore(u){if(Array.isArray(u))return r.call(`luminix.${o}.restoreMany`,p=>p.withData({ids:u}),`${o}.restoreMany`);const f=n.make(o);return new f({id:u}).restore()}static forceDelete(u){if(Array.isArray(u))return r.call(`luminix.${o}.destroyMany`,p=>p.withQueryParameters({ids:u,force:!0}),`${o}.forceDeleteMany`);const f=n.make(o);return new f({id:u}).forceDelete()}static singular(){return n.schema(o).displayName.singular}static plural(){return n.schema(o).displayName.plural}},Zt(c,"name",Ke.studly(o)),c}function ZD(e,t,n){var r,o;return class extends(o=n,r=Symbol.toStringTag,o){constructor(s={}){return super(s),Zt(this,r,Ke.studly(t)),new Proxy(this,{get:(l,c)=>{if(c==="__isModel")return!0;if(Reflect.has(l,c)||typeof c!="string")return Reflect.get(l,c);if(Object.keys(l.attributes).includes(c))return l.getAttribute(c);if(Object.keys(l.relations).includes(c))return l.relations[c].getLoadedItems();if(c.endsWith("Relation")&&Object.keys(l.relations).includes(Ke.snake(c.slice(0,-8))))return()=>l.relation(c.slice(0,-8));if(e.hasReducer(`model${Ke.studly(l.getType())}Get${Ke.studly(c)}Attribute`)){const u=e[`model${Ke.studly(l.getType())}Get${Ke.studly(c)}Attribute`];if(typeof u!="function")throw new wa("ModelFacade");return u.bind(e)(void 0,l)}return Reflect.get(l,c)},set:(l,c,u)=>c in l&&typeof l[c]!="function"?Reflect.set(l,c,u):(l.setAttribute(c,u),!0)})}}}var vw,bw;let xw=class extends(bw=Error,vw=Symbol.toStringTag,bw){constructor(t){super(`[Luminix] Model "${t}" not found`),Zt(this,vw,"ModelNotFoundException")}};var ww,Sw;class ac extends(Sw=TypeError,ww=Symbol.toStringTag,Sw){constructor(t,n,r){super(`[Luminix] "${t}" expects a related model of type "${n}". Received "${r}" instead.`),Zt(this,ww,"ModelInvalidRelatedTypeException")}}class Cw extends Ld{constructor(t,n,r,o=null){if(!Me.isModel(o)&&o!==null)throw new br("BelongsTo.constructor()","Model or null");super(t,n,r,o),this.services=t,this.meta=n,this.parent=r,this.items=o}isSingle(){return!0}isMultiple(){return!1}query(){const t=super.query(),n=this.guessInverseRelation();return t.where(n,this.parent.getKey()),t.lock(`where.${n}`),t}get(){return this.query().first()}async associate(t){if(!Me.isModel(t))throw new br("BelongsTo.associate()");if(t.getType()!==this.getRelated().getSchemaName())throw new ac("BelongsTo.associate()",this.getRelated().getSchemaName(),t.getType());if(!t.exists)throw new yw(this.getRelated().getSchemaName(),"save");return this.parent.update({[this.getForeignKey()]:t.getKey()})}dissociate(){return this.parent.update({[this.getForeignKey()]:null})}}let Rw=class extends Ld{constructor(t,n,r,o=null){if(o!==null&&!(o instanceof Un&&o.every(Me.isModel)))throw new br("BelongsToMany.constructor()","Collection<Model> or null");super(t,n,r,o),this.services=t,this.meta=n,this.parent=r,this.items=o}isSingle(){return!1}isMultiple(){return!0}query(){const t=super.query(),n=this.guessInverseRelation();return t.where(n,this.parent.getKey()),t.lock(`where.${n}`),t}get(t){return this.query().get(t)}all(){return this.query().all()}first(){return this.query().first()}find(t){return this.query().find(t)}attachQuietly(t,n={}){return this.services.route.call([`luminix.${this.parent.getType()}.${this.getName()}:attach`,{[this.parent.getKeyName()]:this.parent.getKey(),itemId:t}],r=>r.withData(n))}async attach(t,n={}){if(await this.attachQuietly(t,n),this.items){const r=this.items.search(s=>s.getKey()===t),o=await this.getRelated().find(t);if(!o)return;r!==!1?this.items.put(r,o):this.items.push(o)}else this.items=await this.all()}async detachQuietly(t){await this.services.route.call([`luminix.${this.parent.getType()}.${this.getName()}:detach`,{[this.parent.getKeyName()]:this.parent.getKey(),itemId:t}])}async detach(t){if(await this.detachQuietly(t),this.items){const n=this.items.search(r=>r.getKey()===t);n!==!1&&this.items.pull(n)}}async syncQuietly(t){await this.services.route.call([`luminix.${this.parent.getType()}.${this.getName()}:sync`,{[this.parent.getKeyName()]:this.parent.getKey()}],n=>n.withData(t))}async sync(t){await this.syncQuietly(t);const n=await this.all();this.items?this.items.splice(0,this.items.count(),...n):this.items=n}async syncWithPivotValuesQuietly(t,n){await this.services.route.call([`luminix.${this.parent.getType()}.${this.getName()}:sync`,{[this.parent.getKeyName()]:this.parent.getKey()}],r=>r.withData(t.map(o=>({[this.getRelated().getSchema().primaryKey]:o,...n}))))}async syncWithPivotValues(t,n){await this.syncWithPivotValuesQuietly(t,n);const r=await this.all();this.items?this.items.splice(0,this.items.count(),...r):this.items=r}};class Em extends Ld{query(){const t=super.query(),n=this.guessInverseRelation();return t.where(n,this.parent.getKey()),t.lock(`where.${n}`),t}async saveQuietly(t){if(!Me.isModel(t))throw new br("HasOneOrMany.saveQuietly()");if(t.getType()!==this.getRelated().getSchemaName())throw new ac("HasOneOrMany.saveQuietly()",this.getRelated().getSchemaName(),t.getType());t.setAttribute(this.getForeignKey(),this.parent.getKey()),await t.save()}}class eF extends Em{constructor(t,n,r,o=null){if(!Me.isModel(o)&&o!==null)throw new br("HasOne.constructor()","Model or null");super(t,n,r,o),this.services=t,this.meta=n,this.parent=r,this.items=o}isSingle(){return!0}isMultiple(){return!1}get(){return this.query().first()}async save(t){await this.saveQuietly(t),this.items=t}}function Wn(e){return new Un(e)}let tF=class extends Em{constructor(t,n,r,o=null){if(o!==null&&!(o instanceof Un&&o.every(Me.isModel)))throw new br("HasMany.constructor()","Collection<Model> or null");super(t,n,r,o),this.services=t,this.meta=n,this.parent=r,this.items=o}isSingle(){return!1}isMultiple(){return!0}get(t){return this.query().get(t)}all(){return this.query().all()}first(){return this.query().first()}find(t){return this.query().find(t)}async saveManyQuietly(t){if(!Array.isArray(t)||!t.every(Me.isModel))throw new br("HasMany.saveManyQuietly()","Model[]");if(!t.every(n=>n.getType()===this.getRelated().getSchemaName()))throw new ac("HasMany.saveManyQuietly()",this.getRelated().getSchemaName(),t.map(n=>n.getType()).join(", "));await Promise.all(t.map(n=>(n.setAttribute(this.getForeignKey(),this.parent.getKey()),n.save())))}async saveMany(t){await this.saveManyQuietly(t),this.items?this.items.splice(0,this.items.count(),...t):this.items=Wn(t)}async save(t){await this.saveQuietly(t),this.items===null?this.items=Wn([t]):this.items.push(t)}};class Ew extends Em{query(){const t=this.getRelated().query();t.once("success",r=>{this.items=r.items});const n=this.guessInverseRelation();return t.where(n+"_id",this.parent.getKey()),t.where(n+"_type",this.getRelated().getSchemaName()),t.lock(`where.${n}_id`),t.lock(`where.${n}_type`),t}async saveQuietly(t){if(!Me.isModel(t))throw new br("MorphOneOrMany.saveQuietly()");if(t.getType()!==this.getRelated().getSchemaName())throw new ac("MorphOneOrMany.saveQuietly()",this.getRelated().getSchemaName(),t.getType());const n=this.guessInverseRelation();t.setAttribute(n+"_id",this.parent.getKey()),t.setAttribute(n+"_type",this.parent.getType()),await t.save()}}class nF extends Ew{constructor(t,n,r,o=null){if(o!==null&&!(o instanceof Un&&o.every(Me.isModel)))throw new br("MorphMany.constructor()","Collection<Model> or null");super(t,n,r,o),this.services=t,this.meta=n,this.parent=r,this.items=o}isSingle(){return!1}isMultiple(){return!0}get(t){return this.query().get(t)}all(){return this.query().all()}first(){return this.query().first()}find(t){return this.query().find(t)}async saveManyQuietly(t){if(!Array.isArray(t)||!t.every(Me.isModel))throw new br("MorphMany.saveManyQuietly()");if(!t.every(n=>n.getType()===this.getRelated().getSchemaName()))throw new ac("MorphMany.saveManyQuietly()",this.getRelated().getSchemaName(),t.map(n=>n.getType()).join(", "));await Promise.all(t.map(n=>(n.setAttribute(this.getName()+"_id",this.parent.getKey()),n.setAttribute(this.getName()+"_type",this.parent.getType()),n.save())))}async saveMany(t){await this.saveManyQuietly(t);const n=await this.all();this.items?this.items.splice(0,this.items.count(),...n):this.items=n}async save(t){await this.saveQuietly(t),this.items?this.items.push(t):this.items=await this.all()}}class rF extends Ew{constructor(t,n,r,o=null){if(super(t,n,r,o),this.services=t,this.meta=n,this.parent=r,this.items=o,o!==null&&!Me.isModel(o))throw new br("MorphOne.constructor()","Model or null")}isSingle(){return!0}isMultiple(){return!1}get(){return this.query().first()}async save(t){await this.saveQuietly(t),this.items=t}}let oF=class extends Cw{getRelated(){return this.services.model.make(this.parent.getAttribute(this.getName()+"_type"))}async associate(t){if(!Me.isModel(t))throw new br("MorphTo.associate()");return t.exists||await t.save(),this.parent.update({[this.getName()+"_id"]:t.getKey(),[this.getName()+"_type"]:t.getType()})}dissociate(){return this.parent.update({[this.getName()+"_id"]:null,[this.getName()+"_type"]:null})}},iF=class extends Rw{query(){var t;const n=super.query(),r=`${(t=this.meta.morphType)==null?void 0:t.slice(0,-5)}_id`;return n.where(r,this.parent.getKey()),n.where(this.meta.morphType,this.parent.getType()),n.lock(`where.${r}`),n.lock(`where.${this.meta.morphType}`),n}};var kw,Pw;class sF extends(Pw=pa,kw=Symbol.toStringTag,Pw){constructor(t){super(),Zt(this,"_models",{}),Zt(this,kw,"ModelService"),this._schema=t}boot(t){this._schema&&Object.keys(this._schema).forEach(n=>{const r=this[`model${Ke.studly(n)}`],o=this.model(XD(t.make("config"),t.make("log"),t.make("model"),t.make("route"),n),n),s=r(o);this._models[n]=ZD(t.make("model"),n,s)})}schema(t){if(!this._schema||t&&!this._schema[t])throw new xw(t||"undefined");return t?this._schema[t]:this._schema}make(t){if(t&&!this._models[t])throw new xw(t);return t?this._models[t]:this._models}getRelationConstructors(t){return this.relationMap({BelongsTo:Cw,BelongsToMany:Rw,HasOne:eF,HasMany:tF,MorphMany:nF,MorphOne:rF,MorphTo:oF,MorphToMany:iF},t)}toString(){return"model"}}const aF=xa(sF);var Ow,Tw;let lF=class extends(Tw=Error,Ow=Symbol.toStringTag,Tw){constructor(t){super(`[Luminix] Route "${t}" not found`),Zt(this,Ow,"RouteNotFoundException")}};class cF{constructor(t,n,r,o=""){this.routes=t,this.error=n,this.http=r,this.appUrl=o}isRouteTuple(t){if(!Array.isArray(t)||t.length<2)return!1;const[n,...r]=t;if(typeof n!="string")return!1;const o=["get","post","put","patch","delete"];return!!r.every(s=>o.includes(s))}extractGenerator(t){let n,r=!1;return Array.isArray(t)?[n,r]=t:n=t,[n,r]}get(t){if(!this.exists(t))throw new lF(t);return Me.get(this.routes,t)}url(t){return this.appUrl+this.path(t)}path(t){const[n,r]=this.extractGenerator(t),o=this.get(n)[0].replace(/^\/|\/$/g,""),s=/{([^}]+)}/g;if(r===!1){if(typeof this.replaceRouteParams!="function")throw new wa("RouteFacade");return this.replaceRouteParams(`/${o}`)}const l=o.match(s),c=l?l.map(m=>m.slice(1,-1)):[],u=Object.keys(r),f=c.filter(m=>!u.includes(m)),p=u.filter(m=>!c.includes(m));if(f.length>0)throw new TypeError(`Missing values for parameter(s): ${f.join(", ")}`);if(p.length>0)throw new TypeError(`Unexpected parameters: ${p.join(", ")}`);return`/${c.reduce((m,g)=>m.replace(`{${g}}`,`${r[g]}`),o)}`}methods(t){const[n]=this.extractGenerator(t);return this.get(n).slice(1)}exists(t){return Me.has(this.routes,t)&&this.isRouteTuple(Me.get(this.routes,t))}async call(t,n=o=>o,r="default"){if(typeof this.clientOptions!="function"||typeof this.clientError!="function")throw new wa("RouteFacade");const[o,s]=this.extractGenerator(t),[,...l]=this.get(o),c=this.url(s?[o,s]:o),u=n(this.http()),f=this.clientOptions({},o);Me.isEmpty(f)||u.withOptions(f);const p=l[0]??f.method;this.error.clear(r);const m=await u[p](c);if(nw(m)){const g=m.json("errors");this.error.set(Object.entries(g).reduce((S,[w,v])=>(S[w]=v.join(" "),S),{}),r)}else m.failed()&&this.error.set(this.clientError({axios:m.json("message")},{response:m,name:o,replace:s,client:u}),r);return m}toString(){return"route"}}const uF=xa(cF);class dF{getClient(){return new _D}baseUrl(t){return this.getClient().baseUrl(t)}asForm(){return this.getClient().asForm()}accept(t){return this.getClient().accept(t)}acceptJson(){return this.getClient().acceptJson()}withHeaders(t){return this.getClient().withHeaders(t)}withOptions(t){return this.getClient().withOptions(t)}withData(t){return this.getClient().withData(t)}withQueryParameters(t){return this.getClient().withQueryParameters(t)}withBasicAuth(t,n){return this.getClient().withBasicAuth(t,n)}withToken(t){return this.getClient().withToken(t)}get(t,n){return this.getClient().get(t,n)}post(t,n){return this.getClient().post(t,n)}put(t,n){return this.getClient().put(t,n)}patch(t,n){return this.getClient().patch(t,n)}delete(t,n){return this.getClient().delete(t,n)}}const fF=Mi(dF);var $w,jw;let pF=class extends(jw=Id,$w=Symbol.toStringTag,jw){constructor(){super(...arguments),Zt(this,$w,"LuminixServiceProvider")}register(){this.registerServices(),this.registerMacros(),this.app.on("ready",()=>{this.app.dump("[Luminix] App boot completed")})}boot(){this.app.make("model").boot(this.app)}registerServices(){this.app.singleton("auth",()=>new HD(this.app.make("config"),this.app.make("model"),this.app.make("route"))),this.app.singleton("config",()=>{const t=new $s(Me.omit(this.app.configuration,"manifest"));return t.has("auth.user")||t.set("auth.user",null),t.lock("auth.user"),t}),this.app.singleton("error",()=>new VD),this.app.singleton("http",()=>new fF),this.app.singleton("log",()=>{var t;return new KD(((t=this.app.configuration.app)==null?void 0:t.debug)??!1)}),this.app.singleton("model",()=>{var t;return new aF(((t=this.app.configuration.manifest)==null?void 0:t.models)??{})}),this.app.singleton("route",()=>{var t,n;return new uF(((t=this.app.configuration.manifest)==null?void 0:t.routes)??{},this.app.make("error"),()=>this.app.make("http").getClient(),(n=this.app.configuration.app)==null?void 0:n.url)})}registerMacros(){this.app.macro("environment",(...t)=>t.length>0?t.includes(this.app.make("config").get("app.env","production")):this.app.make("config").get("app.env","production")),this.app.macro("getLocale",()=>this.app.make("config").get("app.locale","en")),this.app.macro("hasDebugModeEnabled",()=>this.app.make("config").get("app.debug",!1)),this.app.macro("isLocal",()=>this.app.make("config").get("app.env","production")==="local"),this.app.macro("isProduction",()=>this.app.make("config").get("app.env","production")==="production"),Me.macro("isModel",function(t){return typeof t=="object"&&t!==null&&t.__isModel===!0})}};class hF{constructor(){Zt(this,"app")}getFacadeAccessor(){return this.app||(this.app=new(Mi(AD))([pF])),this.app}down(){this.app&&(this.app.flush(),delete this.app)}setInstance(t){this.down(),this.app=t}}const _r=So(hF);function kt(e=void 0){return typeof e!="string"?_r:_r.make(e)}function mF(){return kt("auth")}function _i(e,t){const n=kt("config");return typeof e>"u"?n:n.get(e,t)}function km(e,t="default"){return e?kt().make("error").get(e,t):kt().make("error")}function Nd(...e){const t=kt("log");return e.length?t.debug(...e):t}function lc(e){const t=kt("model");return e?t.make(e):t}function Aw(e,t=!1){const n=kt("route");return e?t?n.url([e,t]):n.url(e):n}So(class{getFacadeAccessor(){return"auth"}},_r);const Ii=So(class{getFacadeAccessor(){return"config"}},_r);class gF{getFacadeAccessor(){return"error"}}So(gF,_r);class yF{getFacadeAccessor(){return"http"}}const vF=So(yF,_r);So(class{getFacadeAccessor(){return"log"}},_r);class bF{getFacadeAccessor(){return"model"}}const cc=So(bF,_r),Pm=So(class{getFacadeAccessor(){return"route"}},_r);function hn(){return hn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hn.apply(this,arguments)}var kn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(kn||(kn={}));const Mw="popstate";function xF(e){e===void 0&&(e={});function t(r,o){let{pathname:s,search:l,hash:c}=r.location;return uc("",{pathname:s,search:l,hash:c},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Li(o)}return SF(t,n,null,e)}function Ct(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Sa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function wF(){return Math.random().toString(36).substr(2,8)}function _w(e,t){return{usr:e.state,key:e.key,idx:t}}function uc(e,t,n,r){return n===void 0&&(n=null),hn({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ni(t):t,{state:n,key:t&&t.key||r||wF()})}function Li(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ni(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function SF(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:s=!1}=r,l=o.history,c=kn.Pop,u=null,f=p();f==null&&(f=0,l.replaceState(hn({},l.state,{idx:f}),""));function p(){return(l.state||{idx:null}).idx}function m(){c=kn.Pop;let x=p(),R=x==null?null:x-f;f=x,u&&u({action:c,location:v.location,delta:R})}function g(x,R){c=kn.Push;let k=uc(v.location,x,R);f=p()+1;let O=_w(k,f),$=v.createHref(k);try{l.pushState(O,"",$)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;o.location.assign($)}s&&u&&u({action:c,location:v.location,delta:1})}function S(x,R){c=kn.Replace;let k=uc(v.location,x,R);f=p();let O=_w(k,f),$=v.createHref(k);l.replaceState(O,"",$),s&&u&&u({action:c,location:v.location,delta:0})}function w(x){let R=o.location.origin!=="null"?o.location.origin:o.location.href,k=typeof x=="string"?x:Li(x);return k=k.replace(/ $/,"%20"),Ct(R,"No window.location.(origin|href) available to create URL for href: "+k),new URL(k,R)}let v={get action(){return c},get location(){return e(o,l)},listen(x){if(u)throw new Error("A history only accepts one active listener");return o.addEventListener(Mw,m),u=x,()=>{o.removeEventListener(Mw,m),u=null}},createHref(x){return t(o,x)},createURL:w,encodeLocation(x){let R=w(x);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:g,replace:S,go(x){return l.go(x)}};return v}var nn;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(nn||(nn={}));const CF=new Set(["lazy","caseSensitive","path","id","index","children"]);function RF(e){return e.index===!0}function dc(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,s)=>{let l=[...n,String(s)],c=typeof o.id=="string"?o.id:l.join("-");if(Ct(o.index!==!0||!o.children,"Cannot specify children on an index route"),Ct(!r[c],'Found a route id collision on id "'+c+`". Route id's must be globally unique within Data Router usages`),RF(o)){let u=hn({},o,t(o),{id:c});return r[c]=u,u}else{let u=hn({},o,t(o),{id:c,children:void 0});return r[c]=u,o.children&&(u.children=dc(o.children,t,l,r)),u}})}function As(e,t,n){return n===void 0&&(n="/"),Dd(e,t,n,!1)}function Dd(e,t,n,r){let o=typeof t=="string"?Ni(t):t,s=Di(o.pathname||"/",n);if(s==null)return null;let l=Iw(e);kF(l);let c=null;for(let u=0;c==null&&u<l.length;++u){let f=NF(s);c=IF(l[u],f,r)}return c}function EF(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}function Iw(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(s,l,c)=>{let u={relativePath:c===void 0?s.path||"":c,caseSensitive:s.caseSensitive===!0,childrenIndex:l,route:s};u.relativePath.startsWith("/")&&(Ct(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let f=zo([r,u.relativePath]),p=n.concat(u);s.children&&s.children.length>0&&(Ct(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),Iw(s.children,t,p,f)),!(s.path==null&&!s.index)&&t.push({path:f,score:MF(f,s.index),routesMeta:p})};return e.forEach((s,l)=>{var c;if(s.path===""||!((c=s.path)!=null&&c.includes("?")))o(s,l);else for(let u of Lw(s.path))o(s,l,u)}),t}function Lw(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return o?[s,""]:[s];let l=Lw(r.join("/")),c=[];return c.push(...l.map(u=>u===""?s:[s,u].join("/"))),o&&c.push(...l),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function kF(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:_F(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const PF=/^:[\w-]+$/,OF=3,TF=2,$F=1,jF=10,AF=-2,Nw=e=>e==="*";function MF(e,t){let n=e.split("/"),r=n.length;return n.some(Nw)&&(r+=AF),t&&(r+=TF),n.filter(o=>!Nw(o)).reduce((o,s)=>o+(PF.test(s)?OF:s===""?$F:jF),r)}function _F(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function IF(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},s="/",l=[];for(let c=0;c<r.length;++c){let u=r[c],f=c===r.length-1,p=s==="/"?t:t.slice(s.length)||"/",m=Dw({path:u.relativePath,caseSensitive:u.caseSensitive,end:f},p),g=u.route;if(!m&&f&&n&&!r[r.length-1].route.index&&(m=Dw({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},p)),!m)return null;Object.assign(o,m.params),l.push({params:o,pathname:zo([s,m.pathname]),pathnameBase:BF(zo([s,m.pathnameBase])),route:g}),m.pathnameBase!=="/"&&(s=zo([s,m.pathnameBase]))}return l}function Dw(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=LF(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let s=o[0],l=s.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:r.reduce((f,p,m)=>{let{paramName:g,isOptional:S}=p;if(g==="*"){let v=c[m]||"";l=s.slice(0,s.length-v.length).replace(/(.)\/+$/,"$1")}const w=c[m];return S&&!w?f[g]=void 0:f[g]=(w||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:l,pattern:e}}function LF(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Sa(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,u)=>(r.push({paramName:c,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function NF(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Sa(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Di(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function DF(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Ni(e):e;return{pathname:n?n.startsWith("/")?n:FF(n,t):t,search:zF(r),hash:UF(o)}}function FF(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Om(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Fw(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Tm(e,t){let n=Fw(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function $m(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Ni(e):(o=hn({},e),Ct(!o.pathname||!o.pathname.includes("?"),Om("?","pathname","search",o)),Ct(!o.pathname||!o.pathname.includes("#"),Om("#","pathname","hash",o)),Ct(!o.search||!o.search.includes("#"),Om("#","search","hash",o)));let s=e===""||o.pathname==="",l=s?"/":o.pathname,c;if(l==null)c=n;else{let m=t.length-1;if(!r&&l.startsWith("..")){let g=l.split("/");for(;g[0]==="..";)g.shift(),m-=1;o.pathname=g.join("/")}c=m>=0?t[m]:"/"}let u=DF(o,c),f=l&&l!=="/"&&l.endsWith("/"),p=(s||l===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(f||p)&&(u.pathname+="/"),u}const zo=e=>e.join("/").replace(/\/\/+/g,"/"),BF=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),zF=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,UF=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class jm{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Fd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Bw=["post","put","patch","delete"],WF=new Set(Bw),HF=["get",...Bw],VF=new Set(HF),KF=new Set([301,302,303,307,308]),qF=new Set([307,308]),Am={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},GF={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},fc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Mm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,QF=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),zw="remix-router-transitions";function YF(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Ct(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let B=e.detectErrorBoundary;o=G=>({hasErrorBoundary:B(G)})}else o=QF;let s={},l=dc(e.routes,o,void 0,s),c,u=e.basename||"/",f=e.unstable_dataStrategy||tB,p=e.unstable_patchRoutesOnMiss,m=hn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),g=null,S=new Set,w=null,v=null,x=null,R=e.hydrationData!=null,k=As(l,e.history.location,u),O=null;if(k==null&&!p){let B=or(404,{pathname:e.history.location.pathname}),{matches:G,route:ue}=Zw(l);k=G,O={[ue.id]:B}}k&&p&&!e.hydrationData&&fo(k,l,e.history.location.pathname).active&&(k=null);let $;if(!k)$=!1,k=[];else if(k.some(B=>B.route.lazy))$=!1;else if(!k.some(B=>B.route.loader))$=!0;else if(m.v7_partialHydration){let B=e.hydrationData?e.hydrationData.loaderData:null,G=e.hydrationData?e.hydrationData.errors:null,ue=ve=>ve.route.loader?typeof ve.route.loader=="function"&&ve.route.loader.hydrate===!0?!1:B&&B[ve.route.id]!==void 0||G&&G[ve.route.id]!==void 0:!0;if(G){let ve=k.findIndex(_e=>G[_e.route.id]!==void 0);$=k.slice(0,ve+1).every(ue)}else $=k.every(ue)}else $=e.hydrationData!=null;let j,T={historyAction:e.history.action,location:e.history.location,matches:k,initialized:$,navigation:Am,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||O,fetchers:new Map,blockers:new Map},M=kn.Pop,N=!1,F,D=!1,W=new Map,q=null,ee=!1,z=!1,ne=[],V=[],K=new Map,_=0,H=-1,X=new Map,I=new Set,ie=new Map,ye=new Map,he=new Set,ge=new Map,me=new Map,Pe=new Map,Y=!1;function Se(){if(g=e.history.listen(B=>{let{action:G,location:ue,delta:ve}=B;if(Y){Y=!1;return}Sa(me.size===0||ve!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let _e=_t({currentLocation:T.location,nextLocation:ue,historyAction:G});if(_e&&ve!=null){Y=!0,e.history.go(ve*-1),wt(_e,{state:"blocked",location:ue,proceed(){wt(_e,{state:"proceeding",proceed:void 0,reset:void 0,location:ue}),e.history.go(ve)},reset(){let Ge=new Map(T.blockers);Ge.set(_e,fc),Le({blockers:Ge})}});return}return We(G,ue)}),n){hB(t,W);let B=()=>mB(t,W);t.addEventListener("pagehide",B),q=()=>t.removeEventListener("pagehide",B)}return T.initialized||We(kn.Pop,T.location,{initialHydration:!0}),j}function Ue(){g&&g(),q&&q(),S.clear(),F&&F.abort(),T.fetchers.forEach((B,G)=>Ht(G)),T.blockers.forEach((B,G)=>bt(G))}function Ie(B){return S.add(B),()=>S.delete(B)}function Le(B,G){G===void 0&&(G={}),T=hn({},T,B);let ue=[],ve=[];m.v7_fetcherPersist&&T.fetchers.forEach((_e,Ge)=>{_e.state==="idle"&&(he.has(Ge)?ve.push(Ge):ue.push(Ge))}),[...S].forEach(_e=>_e(T,{deletedFetchers:ve,unstable_viewTransitionOpts:G.viewTransitionOpts,unstable_flushSync:G.flushSync===!0})),m.v7_fetcherPersist&&(ue.forEach(_e=>T.fetchers.delete(_e)),ve.forEach(_e=>Ht(_e)))}function Ye(B,G,ue){var ve,_e;let{flushSync:Ge}=ue===void 0?{}:ue,lt=T.actionData!=null&&T.navigation.formMethod!=null&&Co(T.navigation.formMethod)&&T.navigation.state==="loading"&&((ve=B.state)==null?void 0:ve._isRedirect)!==!0,je;G.actionData?Object.keys(G.actionData).length>0?je=G.actionData:je=null:lt?je=T.actionData:je=null;let ct=G.loaderData?Jw(T.loaderData,G.loaderData,G.matches||[],G.errors):T.loaderData,Z=T.blockers;Z.size>0&&(Z=new Map(Z),Z.forEach((we,Be)=>Z.set(Be,fc)));let J=N===!0||T.navigation.formMethod!=null&&Co(T.navigation.formMethod)&&((_e=B.state)==null?void 0:_e._isRedirect)!==!0;c&&(l=c,c=void 0),ee||M===kn.Pop||(M===kn.Push?e.history.push(B,B.state):M===kn.Replace&&e.history.replace(B,B.state));let Ce;if(M===kn.Pop){let we=W.get(T.location.pathname);we&&we.has(B.pathname)?Ce={currentLocation:T.location,nextLocation:B}:W.has(B.pathname)&&(Ce={currentLocation:B,nextLocation:T.location})}else if(D){let we=W.get(T.location.pathname);we?we.add(B.pathname):(we=new Set([B.pathname]),W.set(T.location.pathname,we)),Ce={currentLocation:T.location,nextLocation:B}}Le(hn({},G,{actionData:je,loaderData:ct,historyAction:M,location:B,initialized:!0,navigation:Am,revalidation:"idle",restoreScrollPosition:$o(B,G.matches||T.matches),preventScrollReset:J,blockers:Z}),{viewTransitionOpts:Ce,flushSync:Ge===!0}),M=kn.Pop,N=!1,D=!1,ee=!1,z=!1,ne=[],V=[]}async function rt(B,G){if(typeof B=="number"){e.history.go(B);return}let ue=_m(T.location,T.matches,u,m.v7_prependBasename,B,m.v7_relativeSplatPath,G==null?void 0:G.fromRouteId,G==null?void 0:G.relative),{path:ve,submission:_e,error:Ge}=Uw(m.v7_normalizeFormMethod,!1,ue,G),lt=T.location,je=uc(T.location,ve,G&&G.state);je=hn({},je,e.history.encodeLocation(je));let ct=G&&G.replace!=null?G.replace:void 0,Z=kn.Push;ct===!0?Z=kn.Replace:ct===!1||_e!=null&&Co(_e.formMethod)&&_e.formAction===T.location.pathname+T.location.search&&(Z=kn.Replace);let J=G&&"preventScrollReset"in G?G.preventScrollReset===!0:void 0,Ce=(G&&G.unstable_flushSync)===!0,we=_t({currentLocation:lt,nextLocation:je,historyAction:Z});if(we){wt(we,{state:"blocked",location:je,proceed(){wt(we,{state:"proceeding",proceed:void 0,reset:void 0,location:je}),rt(B,G)},reset(){let Be=new Map(T.blockers);Be.set(we,fc),Le({blockers:Be})}});return}return await We(Z,je,{submission:_e,pendingError:Ge,preventScrollReset:J,replace:G&&G.replace,enableViewTransition:G&&G.unstable_viewTransition,flushSync:Ce})}function at(){if(Gt(),Le({revalidation:"loading"}),T.navigation.state!=="submitting"){if(T.navigation.state==="idle"){We(T.historyAction,T.location,{startUninterruptedRevalidation:!0});return}We(M||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation})}}async function We(B,G,ue){F&&F.abort(),F=null,M=B,ee=(ue&&ue.startUninterruptedRevalidation)===!0,To(T.location,T.matches),N=(ue&&ue.preventScrollReset)===!0,D=(ue&&ue.enableViewTransition)===!0;let ve=c||l,_e=ue&&ue.overrideNavigation,Ge=As(ve,G,u),lt=(ue&&ue.flushSync)===!0,je=fo(Ge,ve,G.pathname);if(je.active&&je.matches&&(Ge=je.matches),!Ge){let{error:ke,notFoundMatches:it,route:jt}=It(G.pathname);Ye(G,{matches:it,loaderData:{},errors:{[jt.id]:ke}},{flushSync:lt});return}if(T.initialized&&!z&&aB(T.location,G)&&!(ue&&ue.submission&&Co(ue.submission.formMethod))){Ye(G,{matches:Ge},{flushSync:lt});return}F=new AbortController;let ct=Ca(e.history,G,F.signal,ue&&ue.submission),Z;if(ue&&ue.pendingError)Z=[Ra(Ge).route.id,{type:nn.error,error:ue.pendingError}];else if(ue&&ue.submission&&Co(ue.submission.formMethod)){let ke=await Tt(ct,G,ue.submission,Ge,je.active,{replace:ue.replace,flushSync:lt});if(ke.shortCircuited)return;if(ke.pendingActionResult){let[it,jt]=ke.pendingActionResult;if(Ir(jt)&&Fd(jt.error)&&jt.error.status===404){F=null,Ye(G,{matches:ke.matches,loaderData:{},errors:{[it]:jt.error}});return}}Ge=ke.matches||Ge,Z=ke.pendingActionResult,_e=Nm(G,ue.submission),lt=!1,je.active=!1,ct=Ca(e.history,ct.url,ct.signal)}let{shortCircuited:J,matches:Ce,loaderData:we,errors:Be}=await tt(ct,G,Ge,je.active,_e,ue&&ue.submission,ue&&ue.fetcherSubmission,ue&&ue.replace,ue&&ue.initialHydration===!0,lt,Z);J||(F=null,Ye(G,hn({matches:Ce||Ge},Xw(Z),{loaderData:we,errors:Be})))}async function Tt(B,G,ue,ve,_e,Ge){Ge===void 0&&(Ge={}),Gt();let lt=fB(G,ue);if(Le({navigation:lt},{flushSync:Ge.flushSync===!0}),_e){let Z=await Dn(ve,G.pathname,B.signal);if(Z.type==="aborted")return{shortCircuited:!0};if(Z.type==="error"){let{boundaryId:J,error:Ce}=en(G.pathname,Z);return{matches:Z.partialMatches,pendingActionResult:[J,{type:nn.error,error:Ce}]}}else if(Z.matches)ve=Z.matches;else{let{notFoundMatches:J,error:Ce,route:we}=It(G.pathname);return{matches:J,pendingActionResult:[we.id,{type:nn.error,error:Ce}]}}}let je,ct=pc(ve,G);if(!ct.route.action&&!ct.route.lazy)je={type:nn.error,error:or(405,{method:B.method,pathname:G.pathname,routeId:ct.route.id})};else if(je=(await Ft("action",B,[ct],ve))[0],B.signal.aborted)return{shortCircuited:!0};if(_s(je)){let Z;return Ge&&Ge.replace!=null?Z=Ge.replace:Z=Gw(je.response.headers.get("Location"),new URL(B.url),u)===T.location.pathname+T.location.search,await mt(B,je,{submission:ue,replace:Z}),{shortCircuited:!0}}if(Ms(je))throw or(400,{type:"defer-action"});if(Ir(je)){let Z=Ra(ve,ct.route.id);return(Ge&&Ge.replace)!==!0&&(M=kn.Push),{matches:ve,pendingActionResult:[Z.route.id,je]}}return{matches:ve,pendingActionResult:[ct.route.id,je]}}async function tt(B,G,ue,ve,_e,Ge,lt,je,ct,Z,J){let Ce=_e||Nm(G,Ge),we=Ge||lt||iS(Ce),Be=!ee&&(!m.v7_partialHydration||!ct);if(ve){if(Be){let Lt=$t(J);Le(hn({navigation:Ce},Lt!==void 0?{actionData:Lt}:{}),{flushSync:Z})}let xt=await Dn(ue,G.pathname,B.signal);if(xt.type==="aborted")return{shortCircuited:!0};if(xt.type==="error"){let{boundaryId:Lt,error:fr}=en(G.pathname,xt);return{matches:xt.partialMatches,loaderData:{},errors:{[Lt]:fr}}}else if(xt.matches)ue=xt.matches;else{let{error:Lt,notFoundMatches:fr,route:At}=It(G.pathname);return{matches:fr,loaderData:{},errors:{[At.id]:Lt}}}}let ke=c||l,[it,jt]=Ww(e.history,T,ue,we,G,m.v7_partialHydration&&ct===!0,m.v7_skipActionErrorRevalidation,z,ne,V,he,ie,I,ke,u,J);if(rn(xt=>!(ue&&ue.some(Lt=>Lt.route.id===xt))||it&&it.some(Lt=>Lt.route.id===xt)),H=++_,it.length===0&&jt.length===0){let xt=Oe();return Ye(G,hn({matches:ue,loaderData:{},errors:J&&Ir(J[1])?{[J[0]]:J[1].error}:null},Xw(J),xt?{fetchers:new Map(T.fetchers)}:{}),{flushSync:Z}),{shortCircuited:!0}}if(Be){let xt={};if(!ve){xt.navigation=Ce;let Lt=$t(J);Lt!==void 0&&(xt.actionData=Lt)}jt.length>0&&(xt.fetchers=vt(jt)),Le(xt,{flushSync:Z})}jt.forEach(xt=>{K.has(xt.key)&&He(xt.key),xt.controller&&K.set(xt.key,xt.controller)});let po=()=>jt.forEach(xt=>He(xt.key));F&&F.signal.addEventListener("abort",po);let{loaderResults:Zo,fetcherResults:Xt}=await Yt(T.matches,ue,it,jt,B);if(B.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener("abort",po),jt.forEach(xt=>K.delete(xt.key));let Zi=eS([...Zo,...Xt]);if(Zi){if(Zi.idx>=it.length){let xt=jt[Zi.idx-it.length].key;I.add(xt)}return await mt(B,Zi.result,{replace:je}),{shortCircuited:!0}}let{loaderData:ei,errors:Kr}=Yw(T,ue,it,Zo,J,jt,Xt,ge);ge.forEach((xt,Lt)=>{xt.subscribe(fr=>{(fr||xt.done)&&ge.delete(Lt)})}),m.v7_partialHydration&&ct&&T.errors&&Object.entries(T.errors).filter(xt=>{let[Lt]=xt;return!it.some(fr=>fr.route.id===Lt)}).forEach(xt=>{let[Lt,fr]=xt;Kr=Object.assign(Kr||{},{[Lt]:fr})});let Ci=Oe(),hl=Ve(H),Gs=Ci||hl||jt.length>0;return hn({matches:ue,loaderData:ei,errors:Kr},Gs?{fetchers:new Map(T.fetchers)}:{})}function $t(B){if(B&&!Ir(B[1]))return{[B[0]]:B[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function vt(B){return B.forEach(G=>{let ue=T.fetchers.get(G.key),ve=hc(void 0,ue?ue.data:void 0);T.fetchers.set(G.key,ve)}),new Map(T.fetchers)}function pt(B,G,ue,ve){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");K.has(B)&&He(B);let _e=(ve&&ve.unstable_flushSync)===!0,Ge=c||l,lt=_m(T.location,T.matches,u,m.v7_prependBasename,ue,m.v7_relativeSplatPath,G,ve==null?void 0:ve.relative),je=As(Ge,lt,u),ct=fo(je,Ge,lt);if(ct.active&&ct.matches&&(je=ct.matches),!je){Te(B,G,or(404,{pathname:lt}),{flushSync:_e});return}let{path:Z,submission:J,error:Ce}=Uw(m.v7_normalizeFormMethod,!0,lt,ve);if(Ce){Te(B,G,Ce,{flushSync:_e});return}let we=pc(je,Z);if(N=(ve&&ve.preventScrollReset)===!0,J&&Co(J.formMethod)){Mt(B,G,Z,we,je,ct.active,_e,J);return}ie.set(B,{routeId:G,path:Z}),Ot(B,G,Z,we,je,ct.active,_e,J)}async function Mt(B,G,ue,ve,_e,Ge,lt,je){Gt(),ie.delete(B);function ct(At){if(!At.route.action&&!At.route.lazy){let jo=or(405,{method:je.formMethod,pathname:ue,routeId:G});return Te(B,G,jo,{flushSync:lt}),!0}return!1}if(!Ge&&ct(ve))return;let Z=T.fetchers.get(B);nt(B,pB(je,Z),{flushSync:lt});let J=new AbortController,Ce=Ca(e.history,ue,J.signal,je);if(Ge){let At=await Dn(_e,ue,Ce.signal);if(At.type==="aborted")return;if(At.type==="error"){let{error:jo}=en(ue,At);Te(B,G,jo,{flushSync:lt});return}else if(At.matches){if(_e=At.matches,ve=pc(_e,ue),ct(ve))return}else{Te(B,G,or(404,{pathname:ue}),{flushSync:lt});return}}K.set(B,J);let we=_,ke=(await Ft("action",Ce,[ve],_e))[0];if(Ce.signal.aborted){K.get(B)===J&&K.delete(B);return}if(m.v7_fetcherPersist&&he.has(B)){if(_s(ke)||Ir(ke)){nt(B,Fi(void 0));return}}else{if(_s(ke))if(K.delete(B),H>we){nt(B,Fi(void 0));return}else return I.add(B),nt(B,hc(je)),mt(Ce,ke,{fetcherSubmission:je});if(Ir(ke)){Te(B,G,ke.error);return}}if(Ms(ke))throw or(400,{type:"defer-action"});let it=T.navigation.location||T.location,jt=Ca(e.history,it,J.signal),po=c||l,Zo=T.navigation.state!=="idle"?As(po,T.navigation.location,u):T.matches;Ct(Zo,"Didn't find any matches after fetcher action");let Xt=++_;X.set(B,Xt);let Zi=hc(je,ke.data);T.fetchers.set(B,Zi);let[ei,Kr]=Ww(e.history,T,Zo,je,it,!1,m.v7_skipActionErrorRevalidation,z,ne,V,he,ie,I,po,u,[ve.route.id,ke]);Kr.filter(At=>At.key!==B).forEach(At=>{let jo=At.key,gp=T.fetchers.get(jo),vv=hc(void 0,gp?gp.data:void 0);T.fetchers.set(jo,vv),K.has(jo)&&He(jo),At.controller&&K.set(jo,At.controller)}),Le({fetchers:new Map(T.fetchers)});let Ci=()=>Kr.forEach(At=>He(At.key));J.signal.addEventListener("abort",Ci);let{loaderResults:hl,fetcherResults:Gs}=await Yt(T.matches,Zo,ei,Kr,jt);if(J.signal.aborted)return;J.signal.removeEventListener("abort",Ci),X.delete(B),K.delete(B),Kr.forEach(At=>K.delete(At.key));let xt=eS([...hl,...Gs]);if(xt){if(xt.idx>=ei.length){let At=Kr[xt.idx-ei.length].key;I.add(At)}return mt(jt,xt.result)}let{loaderData:Lt,errors:fr}=Yw(T,T.matches,ei,hl,void 0,Kr,Gs,ge);if(T.fetchers.has(B)){let At=Fi(ke.data);T.fetchers.set(B,At)}Ve(Xt),T.navigation.state==="loading"&&Xt>H?(Ct(M,"Expected pending action"),F&&F.abort(),Ye(T.navigation.location,{matches:Zo,loaderData:Lt,errors:fr,fetchers:new Map(T.fetchers)})):(Le({errors:fr,loaderData:Jw(T.loaderData,Lt,Zo,fr),fetchers:new Map(T.fetchers)}),z=!1)}async function Ot(B,G,ue,ve,_e,Ge,lt,je){let ct=T.fetchers.get(B);nt(B,hc(je,ct?ct.data:void 0),{flushSync:lt});let Z=new AbortController,J=Ca(e.history,ue,Z.signal);if(Ge){let ke=await Dn(_e,ue,J.signal);if(ke.type==="aborted")return;if(ke.type==="error"){let{error:it}=en(ue,ke);Te(B,G,it,{flushSync:lt});return}else if(ke.matches)_e=ke.matches,ve=pc(_e,ue);else{Te(B,G,or(404,{pathname:ue}),{flushSync:lt});return}}K.set(B,Z);let Ce=_,Be=(await Ft("loader",J,[ve],_e))[0];if(Ms(Be)&&(Be=await oS(Be,J.signal,!0)||Be),K.get(B)===Z&&K.delete(B),!J.signal.aborted){if(he.has(B)){nt(B,Fi(void 0));return}if(_s(Be))if(H>Ce){nt(B,Fi(void 0));return}else{I.add(B),await mt(J,Be);return}if(Ir(Be)){Te(B,G,Be.error);return}Ct(!Ms(Be),"Unhandled fetcher deferred data"),nt(B,Fi(Be.data))}}async function mt(B,G,ue){let{submission:ve,fetcherSubmission:_e,replace:Ge}=ue===void 0?{}:ue;G.response.headers.has("X-Remix-Revalidate")&&(z=!0);let lt=G.response.headers.get("Location");Ct(lt,"Expected a Location header on the redirect Response"),lt=Gw(lt,new URL(B.url),u);let je=uc(T.location,lt,{_isRedirect:!0});if(n){let Be=!1;if(G.response.headers.has("X-Remix-Reload-Document"))Be=!0;else if(Mm.test(lt)){const ke=e.history.createURL(lt);Be=ke.origin!==t.location.origin||Di(ke.pathname,u)==null}if(Be){Ge?t.location.replace(lt):t.location.assign(lt);return}}F=null;let ct=Ge===!0?kn.Replace:kn.Push,{formMethod:Z,formAction:J,formEncType:Ce}=T.navigation;!ve&&!_e&&Z&&J&&Ce&&(ve=iS(T.navigation));let we=ve||_e;if(qF.has(G.response.status)&&we&&Co(we.formMethod))await We(ct,je,{submission:hn({},we,{formAction:lt}),preventScrollReset:N});else{let Be=Nm(je,ve);await We(ct,je,{overrideNavigation:Be,fetcherSubmission:_e,preventScrollReset:N})}}async function Ft(B,G,ue,ve){try{let _e=await nB(f,B,G,ue,ve,s,o);return await Promise.all(_e.map((Ge,lt)=>{if(cB(Ge)){let je=Ge.result;return{type:nn.redirect,response:iB(je,G,ue[lt].route.id,ve,u,m.v7_relativeSplatPath)}}return oB(Ge)}))}catch(_e){return ue.map(()=>({type:nn.error,error:_e}))}}async function Yt(B,G,ue,ve,_e){let[Ge,...lt]=await Promise.all([ue.length?Ft("loader",_e,ue,G):[],...ve.map(je=>{if(je.matches&&je.match&&je.controller){let ct=Ca(e.history,je.path,je.controller.signal);return Ft("loader",ct,[je.match],je.matches).then(Z=>Z[0])}else return Promise.resolve({type:nn.error,error:or(404,{pathname:je.path})})})]);return await Promise.all([rS(B,ue,Ge,Ge.map(()=>_e.signal),!1,T.loaderData),rS(B,ve.map(je=>je.match),lt,ve.map(je=>je.controller?je.controller.signal:null),!0)]),{loaderResults:Ge,fetcherResults:lt}}function Gt(){z=!0,ne.push(...rn()),ie.forEach((B,G)=>{K.has(G)&&(V.push(G),He(G))})}function nt(B,G,ue){ue===void 0&&(ue={}),T.fetchers.set(B,G),Le({fetchers:new Map(T.fetchers)},{flushSync:(ue&&ue.flushSync)===!0})}function Te(B,G,ue,ve){ve===void 0&&(ve={});let _e=Ra(T.matches,G);Ht(B),Le({errors:{[_e.route.id]:ue},fetchers:new Map(T.fetchers)},{flushSync:(ve&&ve.flushSync)===!0})}function St(B){return m.v7_fetcherPersist&&(ye.set(B,(ye.get(B)||0)+1),he.has(B)&&he.delete(B)),T.fetchers.get(B)||GF}function Ht(B){let G=T.fetchers.get(B);K.has(B)&&!(G&&G.state==="loading"&&X.has(B))&&He(B),ie.delete(B),X.delete(B),I.delete(B),he.delete(B),T.fetchers.delete(B)}function fn(B){if(m.v7_fetcherPersist){let G=(ye.get(B)||0)-1;G<=0?(ye.delete(B),he.add(B)):ye.set(B,G)}else Ht(B);Le({fetchers:new Map(T.fetchers)})}function He(B){let G=K.get(B);Ct(G,"Expected fetch controller: "+B),G.abort(),K.delete(B)}function ft(B){for(let G of B){let ue=St(G),ve=Fi(ue.data);T.fetchers.set(G,ve)}}function Oe(){let B=[],G=!1;for(let ue of I){let ve=T.fetchers.get(ue);Ct(ve,"Expected fetcher: "+ue),ve.state==="loading"&&(I.delete(ue),B.push(ue),G=!0)}return ft(B),G}function Ve(B){let G=[];for(let[ue,ve]of X)if(ve<B){let _e=T.fetchers.get(ue);Ct(_e,"Expected fetcher: "+ue),_e.state==="loading"&&(He(ue),X.delete(ue),G.push(ue))}return ft(G),G.length>0}function ht(B,G){let ue=T.blockers.get(B)||fc;return me.get(B)!==G&&me.set(B,G),ue}function bt(B){T.blockers.delete(B),me.delete(B)}function wt(B,G){let ue=T.blockers.get(B)||fc;Ct(ue.state==="unblocked"&&G.state==="blocked"||ue.state==="blocked"&&G.state==="blocked"||ue.state==="blocked"&&G.state==="proceeding"||ue.state==="blocked"&&G.state==="unblocked"||ue.state==="proceeding"&&G.state==="unblocked","Invalid blocker state transition: "+ue.state+" -> "+G.state);let ve=new Map(T.blockers);ve.set(B,G),Le({blockers:ve})}function _t(B){let{currentLocation:G,nextLocation:ue,historyAction:ve}=B;if(me.size===0)return;me.size>1&&Sa(!1,"A router only supports one blocker at a time");let _e=Array.from(me.entries()),[Ge,lt]=_e[_e.length-1],je=T.blockers.get(Ge);if(!(je&&je.state==="proceeding")&<({currentLocation:G,nextLocation:ue,historyAction:ve}))return Ge}function It(B){let G=or(404,{pathname:B}),ue=c||l,{matches:ve,route:_e}=Zw(ue);return rn(),{notFoundMatches:ve,route:_e,error:G}}function en(B,G){return{boundaryId:Ra(G.partialMatches).route.id,error:or(400,{type:"route-discovery",pathname:B,message:G.error!=null&&"message"in G.error?G.error:String(G.error)})}}function rn(B){let G=[];return ge.forEach((ue,ve)=>{(!B||B(ve))&&(ue.cancel(),G.push(ve),ge.delete(ve))}),G}function Xn(B,G,ue){if(w=B,x=G,v=ue||null,!R&&T.navigation===Am){R=!0;let ve=$o(T.location,T.matches);ve!=null&&Le({restoreScrollPosition:ve})}return()=>{w=null,x=null,v=null}}function Vr(B,G){return v&&v(B,G.map(ve=>EF(ve,T.loaderData)))||B.key}function To(B,G){if(w&&x){let ue=Vr(B,G);w[ue]=x()}}function $o(B,G){if(w){let ue=Vr(B,G),ve=w[ue];if(typeof ve=="number")return ve}return null}function fo(B,G,ue){if(p)if(B){let ve=B[B.length-1].route;if(ve.path&&(ve.path==="*"||ve.path.endsWith("/*")))return{active:!0,matches:Dd(G,ue,u,!0)}}else return{active:!0,matches:Dd(G,ue,u,!0)||[]};return{active:!1,matches:null}}async function Dn(B,G,ue){let ve=B,_e=ve.length>0?ve[ve.length-1].route:null;for(;;){let Ge=c==null,lt=c||l;try{await eB(p,G,ve,lt,s,o,Pe,ue)}catch(J){return{type:"error",error:J,partialMatches:ve}}finally{Ge&&(l=[...l])}if(ue.aborted)return{type:"aborted"};let je=As(lt,G,u),ct=!1;if(je){let J=je[je.length-1].route;if(J.index)return{type:"success",matches:je};if(J.path&&J.path.length>0)if(J.path==="*")ct=!0;else return{type:"success",matches:je}}let Z=Dd(lt,G,u,!0);if(!Z||ve.map(J=>J.route.id).join("-")===Z.map(J=>J.route.id).join("-"))return{type:"success",matches:ct?je:null};if(ve=Z,_e=ve[ve.length-1].route,_e.path==="*")return{type:"success",matches:ve}}}function on(B){s={},c=dc(B,o,void 0,s)}function Qt(B,G){let ue=c==null;Kw(B,G,c||l,s,o),ue&&(l=[...l],Le({}))}return j={get basename(){return u},get future(){return m},get state(){return T},get routes(){return l},get window(){return t},initialize:Se,subscribe:Ie,enableScrollRestoration:Xn,navigate:rt,fetch:pt,revalidate:at,createHref:B=>e.history.createHref(B),encodeLocation:B=>e.history.encodeLocation(B),getFetcher:St,deleteFetcher:fn,dispose:Ue,getBlocker:ht,deleteBlocker:bt,patchRoutes:Qt,_internalFetchControllers:K,_internalActiveDeferreds:ge,_internalSetRoutes:on},j}function JF(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function _m(e,t,n,r,o,s,l,c){let u,f;if(l){u=[];for(let m of t)if(u.push(m),m.route.id===l){f=m;break}}else u=t,f=t[t.length-1];let p=$m(o||".",Tm(u,s),Di(e.pathname,n)||e.pathname,c==="path");return o==null&&(p.search=e.search,p.hash=e.hash),(o==null||o===""||o===".")&&f&&f.route.index&&!Lm(p.search)&&(p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(p.pathname=p.pathname==="/"?n:zo([n,p.pathname])),Li(p)}function Uw(e,t,n,r){if(!r||!JF(r))return{path:n};if(r.formMethod&&!dB(r.formMethod))return{path:n,error:or(405,{method:r.formMethod})};let o=()=>({path:n,error:or(400,{type:"invalid-body"})}),s=r.formMethod||"get",l=e?s.toUpperCase():s.toLowerCase(),c=tS(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Co(l))return o();let g=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((S,w)=>{let[v,x]=w;return""+S+v+"="+x+`
|