%PDF- %PDF-
Direktori : /www/klubovnaostrava/www/wp-content/plugins/filebird/assets/dist/ |
Current File : /www/klubovnaostrava/www/wp-content/plugins/filebird/assets/dist/admin.tsx-5695c773.js |
import{r as p,aK as jn,aL as Un,X as qe,_ as w,j as P,F as Se,a as u,C as tr,a4 as Fn,a2 as $r,aa as In,a3 as Gr,a5 as An,ad as Bn,ae as Hn,aM as Jt,af as Xe,V as ne,aj as Vn,aN as zn,aO as Wn,T as wr,ar as Yt,ag as $n,aP as me,B as ue,aQ as Gn,aG as Kn,d as Jn,R as Yn}from"./ProBadge-98ad12ff.js";/** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},J.apply(this,arguments)}var X;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(X||(X={}));const xr="popstate";function Qn(e){e===void 0&&(e={});function t(a,o){let{pathname:i="/",search:c="",hash:s=""}=ge(a.location.hash.substr(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),ut("",{pathname:i,search:c,hash:s},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(a,o){let i=a.document.querySelector("base"),c="";if(i&&i.getAttribute("href")){let s=a.location.href,f=s.indexOf("#");c=f===-1?s:s.slice(0,f)}return c+"#"+(typeof o=="string"?o:Be(o))}function n(a,o){Ae(a.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(o)+")")}return Zn(t,r,n,e)}function A(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ae(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Xn(){return Math.random().toString(36).substr(2,8)}function _r(e,t){return{usr:e.state,key:e.key,idx:t}}function ut(e,t,r,n){return r===void 0&&(r=null),J({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ge(t):t,{state:r,key:t&&t.key||n||Xn()})}function Be(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ge(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Zn(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,c=X.Pop,s=null,f=h();f==null&&(f=0,i.replaceState(J({},i.state,{idx:f}),""));function h(){return(i.state||{idx:null}).idx}function b(){c=X.Pop;let x=h(),k=x==null?null:x-f;f=x,s&&s({action:c,location:E.location,delta:k})}function v(x,k){c=X.Push;let L=ut(E.location,x,k);r&&r(L,x),f=h()+1;let U=_r(L,f),B=E.createHref(L);try{i.pushState(U,"",B)}catch(K){if(K instanceof DOMException&&K.name==="DataCloneError")throw K;a.location.assign(B)}o&&s&&s({action:c,location:E.location,delta:1})}function _(x,k){c=X.Replace;let L=ut(E.location,x,k);r&&r(L,x),f=h();let U=_r(L,f),B=E.createHref(L);i.replaceState(U,"",B),o&&s&&s({action:c,location:E.location,delta:0})}function S(x){let k=a.location.origin!=="null"?a.location.origin:a.location.href,L=typeof x=="string"?x:Be(x);return L=L.replace(/ $/,"%20"),A(k,"No window.location.(origin|href) available to create URL for href: "+L),new URL(L,k)}let E={get action(){return c},get location(){return e(a,i)},listen(x){if(s)throw new Error("A history only accepts one active listener");return a.addEventListener(xr,b),s=x,()=>{a.removeEventListener(xr,b),s=null}},createHref(x){return t(a,x)},createURL:S,encodeLocation(x){let k=S(x);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:v,replace:_,go(x){return i.go(x)}};return E}var $;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})($||($={}));const qn=new Set(["lazy","caseSensitive","path","id","index","children"]);function ea(e){return e.index===!0}function Mt(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,o)=>{let i=[...r,String(o)],c=typeof a.id=="string"?a.id:i.join("-");if(A(a.index!==!0||!a.children,"Cannot specify children on an index route"),A(!n[c],'Found a route id collision on id "'+c+`". Route id's must be globally unique within Data Router usages`),ea(a)){let s=J({},a,t(a),{id:c});return n[c]=s,s}else{let s=J({},a,t(a),{id:c,children:void 0});return n[c]=s,a.children&&(s.children=Mt(a.children,t,i,n)),s}})}function Ue(e,t,r){return r===void 0&&(r="/"),Dt(e,t,r,!1)}function Dt(e,t,r,n){let a=typeof t=="string"?ge(t):t,o=Ce(a.pathname||"/",r);if(o==null)return null;let i=Kr(e);ra(i);let c=null;for(let s=0;c==null&&s<i.length;++s){let f=ha(o);c=fa(i[s],f,n)}return c}function ta(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function Kr(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(o,i,c)=>{let s={relativePath:c===void 0?o.path||"":c,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};s.relativePath.startsWith("/")&&(A(s.relativePath.startsWith(n),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(n.length));let f=_e([n,s.relativePath]),h=r.concat(s);o.children&&o.children.length>0&&(A(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),Kr(o.children,t,h,f)),!(o.path==null&&!o.index)&&t.push({path:f,score:ca(f,o.index),routesMeta:h})};return e.forEach((o,i)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))a(o,i);else for(let s of Jr(o.path))a(o,i,s)}),t}function Jr(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return a?[o,""]:[o];let i=Jr(n.join("/")),c=[];return c.push(...i.map(s=>s===""?o:[o,s].join("/"))),a&&c.push(...i),c.map(s=>e.startsWith("/")&&s===""?"/":s)}function ra(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:da(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const na=/^:[\w-]+$/,aa=3,ia=2,oa=1,la=10,sa=-2,Cr=e=>e==="*";function ca(e,t){let r=e.split("/"),n=r.length;return r.some(Cr)&&(n+=sa),t&&(n+=ia),r.filter(a=>!Cr(a)).reduce((a,o)=>a+(na.test(o)?aa:o===""?oa:la),n)}function da(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function fa(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,a={},o="/",i=[];for(let c=0;c<n.length;++c){let s=n[c],f=c===n.length-1,h=o==="/"?t:t.slice(o.length)||"/",b=kt({path:s.relativePath,caseSensitive:s.caseSensitive,end:f},h),v=s.route;if(!b&&f&&r&&!n[n.length-1].route.index&&(b=kt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},h)),!b)return null;Object.assign(a,b.params),i.push({params:a,pathname:_e([o,b.pathname]),pathnameBase:ba(_e([o,b.pathnameBase])),route:v}),b.pathnameBase!=="/"&&(o=_e([o,b.pathnameBase]))}return i}function kt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=ua(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:n.reduce((f,h,b)=>{let{paramName:v,isOptional:_}=h;if(v==="*"){let E=c[b]||"";i=o.slice(0,o.length-E.length).replace(/(.)\/+$/,"$1")}const S=c[b];return _&&!S?f[v]=void 0:f[v]=(S||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:i,pattern:e}}function ua(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Ae(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,c,s)=>(n.push({paramName:c,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function ha(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ae(!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 Ce(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function ma(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?ge(e):e;return{pathname:r?r.startsWith("/")?r:pa(r,t):t,search:ga(n),hash:va(a)}}function pa(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Wt(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Yr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function rr(e,t){let r=Yr(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function nr(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=ge(e):(a=J({},e),A(!a.pathname||!a.pathname.includes("?"),Wt("?","pathname","search",a)),A(!a.pathname||!a.pathname.includes("#"),Wt("#","pathname","hash",a)),A(!a.search||!a.search.includes("#"),Wt("#","search","hash",a)));let o=e===""||a.pathname==="",i=o?"/":a.pathname,c;if(i==null)c=r;else{let b=t.length-1;if(!n&&i.startsWith("..")){let v=i.split("/");for(;v[0]==="..";)v.shift(),b-=1;a.pathname=v.join("/")}c=b>=0?t[b]:"/"}let s=ma(a,c),f=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(f||h)&&(s.pathname+="/"),s}const _e=e=>e.join("/").replace(/\/\/+/g,"/"),ba=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ga=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,va=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Ot{constructor(t,r,n,a){a===void 0&&(a=!1),this.status=t,this.statusText=r||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function ht(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Qr=["post","put","patch","delete"],ya=new Set(Qr),wa=["get",...Qr],xa=new Set(wa),_a=new Set([301,302,303,307,308]),Ca=new Set([307,308]),$t={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Sa={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ot={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ar=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ea=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Xr="remix-router-transitions";function Ra(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;A(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let l=e.detectErrorBoundary;a=d=>({hasErrorBoundary:l(d)})}else a=Ea;let o={},i=Mt(e.routes,a,void 0,o),c,s=e.basename||"/",f=e.dataStrategy||Ta,h=e.patchRoutesOnNavigation,b=J({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),v=null,_=new Set,S=null,E=null,x=null,k=e.hydrationData!=null,L=Ue(i,e.history.location,s),U=!1,B=null;if(L==null&&!h){let l=le(404,{pathname:e.history.location.pathname}),{matches:d,route:m}=Or(i);L=d,B={[m.id]:l}}L&&!e.hydrationData&&St(L,i,e.history.location.pathname).active&&(L=null);let K;if(L)if(L.some(l=>l.route.lazy))K=!1;else if(!L.some(l=>l.route.loader))K=!0;else if(b.v7_partialHydration){let l=e.hydrationData?e.hydrationData.loaderData:null,d=e.hydrationData?e.hydrationData.errors:null;if(d){let m=L.findIndex(y=>d[y.route.id]!==void 0);K=L.slice(0,m+1).every(y=>!Xt(y.route,l,d))}else K=L.every(m=>!Xt(m.route,l,d))}else K=e.hydrationData!=null;else if(K=!1,L=[],b.v7_partialHydration){let l=St(null,i,e.history.location.pathname);l.active&&l.matches&&(U=!0,L=l.matches)}let ie,g={historyAction:e.history.action,location:e.history.location,matches:L,initialized:K,navigation:$t,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||B,fetchers:new Map,blockers:new Map},R=X.Pop,H=!1,I,ee=!1,Z=new Map,se=null,oe=!1,ve=!1,vt=[],yt=new Set,te=new Map,wt=0,et=-1,Ve=new Map,ye=new Set,ze=new Map,tt=new Map,de=new Set,De=new Map,Me=new Map,xt;function vn(){if(v=e.history.listen(l=>{let{action:d,location:m,delta:y}=l;if(xt){xt(),xt=void 0;return}Ae(Me.size===0||y!=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 C=br({currentLocation:g.location,nextLocation:m,historyAction:d});if(C&&y!=null){let O=new Promise(j=>{xt=j});e.history.go(y*-1),Ct(C,{state:"blocked",location:m,proceed(){Ct(C,{state:"proceeding",proceed:void 0,reset:void 0,location:m}),O.then(()=>e.history.go(y))},reset(){let j=new Map(g.blockers);j.set(C,ot),ae({blockers:j})}});return}return ke(d,m)}),r){Wa(t,Z);let l=()=>$a(t,Z);t.addEventListener("pagehide",l),se=()=>t.removeEventListener("pagehide",l)}return g.initialized||ke(X.Pop,g.location,{initialHydration:!0}),ie}function yn(){v&&v(),se&&se(),_.clear(),I&&I.abort(),g.fetchers.forEach((l,d)=>_t(d)),g.blockers.forEach((l,d)=>pr(d))}function wn(l){return _.add(l),()=>_.delete(l)}function ae(l,d){d===void 0&&(d={}),g=J({},g,l);let m=[],y=[];b.v7_fetcherPersist&&g.fetchers.forEach((C,O)=>{C.state==="idle"&&(de.has(O)?y.push(O):m.push(O))}),de.forEach(C=>{!g.fetchers.has(C)&&!te.has(C)&&y.push(C)}),[..._].forEach(C=>C(g,{deletedFetchers:y,viewTransitionOpts:d.viewTransitionOpts,flushSync:d.flushSync===!0})),b.v7_fetcherPersist?(m.forEach(C=>g.fetchers.delete(C)),y.forEach(C=>_t(C))):y.forEach(C=>de.delete(C))}function We(l,d,m){var y,C;let{flushSync:O}=m===void 0?{}:m,j=g.actionData!=null&&g.navigation.formMethod!=null&&fe(g.navigation.formMethod)&&g.navigation.state==="loading"&&((y=l.state)==null?void 0:y._isRedirect)!==!0,T;d.actionData?Object.keys(d.actionData).length>0?T=d.actionData:T=null:j?T=g.actionData:T=null;let D=d.loaderData?Mr(g.loaderData,d.loaderData,d.matches||[],d.errors):g.loaderData,N=g.blockers;N.size>0&&(N=new Map(N),N.forEach((V,re)=>N.set(re,ot)));let M=H===!0||g.navigation.formMethod!=null&&fe(g.navigation.formMethod)&&((C=l.state)==null?void 0:C._isRedirect)!==!0;c&&(i=c,c=void 0),oe||R===X.Pop||(R===X.Push?e.history.push(l,l.state):R===X.Replace&&e.history.replace(l,l.state));let F;if(R===X.Pop){let V=Z.get(g.location.pathname);V&&V.has(l.pathname)?F={currentLocation:g.location,nextLocation:l}:Z.has(l.pathname)&&(F={currentLocation:l,nextLocation:g.location})}else if(ee){let V=Z.get(g.location.pathname);V?V.add(l.pathname):(V=new Set([l.pathname]),Z.set(g.location.pathname,V)),F={currentLocation:g.location,nextLocation:l}}ae(J({},d,{actionData:T,loaderData:D,historyAction:R,location:l,initialized:!0,navigation:$t,revalidation:"idle",restoreScrollPosition:vr(l,d.matches||g.matches),preventScrollReset:M,blockers:N}),{viewTransitionOpts:F,flushSync:O===!0}),R=X.Pop,H=!1,ee=!1,oe=!1,ve=!1,vt=[]}async function sr(l,d){if(typeof l=="number"){e.history.go(l);return}let m=Qt(g.location,g.matches,s,b.v7_prependBasename,l,b.v7_relativeSplatPath,d==null?void 0:d.fromRouteId,d==null?void 0:d.relative),{path:y,submission:C,error:O}=Sr(b.v7_normalizeFormMethod,!1,m,d),j=g.location,T=ut(g.location,y,d&&d.state);T=J({},T,e.history.encodeLocation(T));let D=d&&d.replace!=null?d.replace:void 0,N=X.Push;D===!0?N=X.Replace:D===!1||C!=null&&fe(C.formMethod)&&C.formAction===g.location.pathname+g.location.search&&(N=X.Replace);let M=d&&"preventScrollReset"in d?d.preventScrollReset===!0:void 0,F=(d&&d.flushSync)===!0,V=br({currentLocation:j,nextLocation:T,historyAction:N});if(V){Ct(V,{state:"blocked",location:T,proceed(){Ct(V,{state:"proceeding",proceed:void 0,reset:void 0,location:T}),sr(l,d)},reset(){let re=new Map(g.blockers);re.set(V,ot),ae({blockers:re})}});return}return await ke(N,T,{submission:C,pendingError:O,preventScrollReset:M,replace:d&&d.replace,enableViewTransition:d&&d.viewTransition,flushSync:F})}function xn(){if(Bt(),ae({revalidation:"loading"}),g.navigation.state!=="submitting"){if(g.navigation.state==="idle"){ke(g.historyAction,g.location,{startUninterruptedRevalidation:!0});return}ke(R||g.historyAction,g.navigation.location,{overrideNavigation:g.navigation,enableViewTransition:ee===!0})}}async function ke(l,d,m){I&&I.abort(),I=null,R=l,oe=(m&&m.startUninterruptedRevalidation)===!0,Dn(g.location,g.matches),H=(m&&m.preventScrollReset)===!0,ee=(m&&m.enableViewTransition)===!0;let y=c||i,C=m&&m.overrideNavigation,O=m!=null&&m.initialHydration&&g.matches&&g.matches.length>0&&!U?g.matches:Ue(y,d,s),j=(m&&m.flushSync)===!0;if(O&&g.initialized&&!ve&&Ua(g.location,d)&&!(m&&m.submission&&fe(m.submission.formMethod))){We(d,{matches:O},{flushSync:j});return}let T=St(O,y,d.pathname);if(T.active&&T.matches&&(O=T.matches),!O){let{error:G,notFoundMatches:W,route:Y}=Ht(d.pathname);We(d,{matches:W,loaderData:{},errors:{[Y.id]:G}},{flushSync:j});return}I=new AbortController;let D=Je(e.history,d,I.signal,m&&m.submission),N;if(m&&m.pendingError)N=[Fe(O).route.id,{type:$.error,error:m.pendingError}];else if(m&&m.submission&&fe(m.submission.formMethod)){let G=await _n(D,d,m.submission,O,T.active,{replace:m.replace,flushSync:j});if(G.shortCircuited)return;if(G.pendingActionResult){let[W,Y]=G.pendingActionResult;if(ce(Y)&&ht(Y.error)&&Y.error.status===404){I=null,We(d,{matches:G.matches,loaderData:{},errors:{[W]:Y.error}});return}}O=G.matches||O,N=G.pendingActionResult,C=Gt(d,m.submission),j=!1,T.active=!1,D=Je(e.history,D.url,D.signal)}let{shortCircuited:M,matches:F,loaderData:V,errors:re}=await Cn(D,d,O,T.active,C,m&&m.submission,m&&m.fetcherSubmission,m&&m.replace,m&&m.initialHydration===!0,j,N);M||(I=null,We(d,J({matches:F||O},kr(N),{loaderData:V,errors:re})))}async function _n(l,d,m,y,C,O){O===void 0&&(O={}),Bt();let j=Va(d,m);if(ae({navigation:j},{flushSync:O.flushSync===!0}),C){let N=await Et(y,d.pathname,l.signal);if(N.type==="aborted")return{shortCircuited:!0};if(N.type==="error"){let M=Fe(N.partialMatches).route.id;return{matches:N.partialMatches,pendingActionResult:[M,{type:$.error,error:N.error}]}}else if(N.matches)y=N.matches;else{let{notFoundMatches:M,error:F,route:V}=Ht(d.pathname);return{matches:M,pendingActionResult:[V.id,{type:$.error,error:F}]}}}let T,D=ft(y,d);if(!D.route.action&&!D.route.lazy)T={type:$.error,error:le(405,{method:l.method,pathname:d.pathname,routeId:D.route.id})};else if(T=(await rt("action",g,l,[D],y,null))[D.route.id],l.signal.aborted)return{shortCircuited:!0};if(Ie(T)){let N;return O&&O.replace!=null?N=O.replace:N=Nr(T.response.headers.get("Location"),new URL(l.url),s)===g.location.pathname+g.location.search,await Oe(l,T,!0,{submission:m,replace:N}),{shortCircuited:!0}}if(Pe(T))throw le(400,{type:"defer-action"});if(ce(T)){let N=Fe(y,D.route.id);return(O&&O.replace)!==!0&&(R=X.Push),{matches:y,pendingActionResult:[N.route.id,T]}}return{matches:y,pendingActionResult:[D.route.id,T]}}async function Cn(l,d,m,y,C,O,j,T,D,N,M){let F=C||Gt(d,O),V=O||j||Ur(F),re=!oe&&(!b.v7_partialHydration||!D);if(y){if(re){let Q=cr(M);ae(J({navigation:F},Q!==void 0?{actionData:Q}:{}),{flushSync:N})}let z=await Et(m,d.pathname,l.signal);if(z.type==="aborted")return{shortCircuited:!0};if(z.type==="error"){let Q=Fe(z.partialMatches).route.id;return{matches:z.partialMatches,loaderData:{},errors:{[Q]:z.error}}}else if(z.matches)m=z.matches;else{let{error:Q,notFoundMatches:Ge,route:it}=Ht(d.pathname);return{matches:Ge,loaderData:{},errors:{[it.id]:Q}}}}let G=c||i,[W,Y]=Rr(e.history,g,m,V,d,b.v7_partialHydration&&D===!0,b.v7_skipActionErrorRevalidation,ve,vt,yt,de,ze,ye,G,s,M);if(Vt(z=>!(m&&m.some(Q=>Q.route.id===z))||W&&W.some(Q=>Q.route.id===z)),et=++wt,W.length===0&&Y.length===0){let z=hr();return We(d,J({matches:m,loaderData:{},errors:M&&ce(M[1])?{[M[0]]:M[1].error}:null},kr(M),z?{fetchers:new Map(g.fetchers)}:{}),{flushSync:N}),{shortCircuited:!0}}if(re){let z={};if(!y){z.navigation=F;let Q=cr(M);Q!==void 0&&(z.actionData=Q)}Y.length>0&&(z.fetchers=Sn(Y)),ae(z,{flushSync:N})}Y.forEach(z=>{Re(z.key),z.controller&&te.set(z.key,z.controller)});let $e=()=>Y.forEach(z=>Re(z.key));I&&I.signal.addEventListener("abort",$e);let{loaderResults:nt,fetcherResults:xe}=await dr(g,m,W,Y,l);if(l.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",$e),Y.forEach(z=>te.delete(z.key));let he=Pt(nt);if(he)return await Oe(l,he.result,!0,{replace:T}),{shortCircuited:!0};if(he=Pt(xe),he)return ye.add(he.key),await Oe(l,he.result,!0,{replace:T}),{shortCircuited:!0};let{loaderData:zt,errors:at}=Dr(g,m,nt,M,Y,xe,De);De.forEach((z,Q)=>{z.subscribe(Ge=>{(Ge||z.done)&&De.delete(Q)})}),b.v7_partialHydration&&D&&g.errors&&(at=J({},g.errors,at));let je=hr(),Rt=mr(et),Lt=je||Rt||Y.length>0;return J({matches:m,loaderData:zt,errors:at},Lt?{fetchers:new Map(g.fetchers)}:{})}function cr(l){if(l&&!ce(l[1]))return{[l[0]]:l[1].data};if(g.actionData)return Object.keys(g.actionData).length===0?null:g.actionData}function Sn(l){return l.forEach(d=>{let m=g.fetchers.get(d.key),y=lt(void 0,m?m.data:void 0);g.fetchers.set(d.key,y)}),new Map(g.fetchers)}function En(l,d,m,y){if(n)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.");Re(l);let C=(y&&y.flushSync)===!0,O=c||i,j=Qt(g.location,g.matches,s,b.v7_prependBasename,m,b.v7_relativeSplatPath,d,y==null?void 0:y.relative),T=Ue(O,j,s),D=St(T,O,j);if(D.active&&D.matches&&(T=D.matches),!T){we(l,d,le(404,{pathname:j}),{flushSync:C});return}let{path:N,submission:M,error:F}=Sr(b.v7_normalizeFormMethod,!0,j,y);if(F){we(l,d,F,{flushSync:C});return}let V=ft(T,N),re=(y&&y.preventScrollReset)===!0;if(M&&fe(M.formMethod)){Rn(l,d,N,V,T,D.active,C,re,M);return}ze.set(l,{routeId:d,path:N}),Ln(l,d,N,V,T,D.active,C,re,M)}async function Rn(l,d,m,y,C,O,j,T,D){Bt(),ze.delete(l);function N(q){if(!q.route.action&&!q.route.lazy){let Ke=le(405,{method:D.formMethod,pathname:m,routeId:d});return we(l,d,Ke,{flushSync:j}),!0}return!1}if(!O&&N(y))return;let M=g.fetchers.get(l);Ee(l,za(D,M),{flushSync:j});let F=new AbortController,V=Je(e.history,m,F.signal,D);if(O){let q=await Et(C,new URL(V.url).pathname,V.signal,l);if(q.type==="aborted")return;if(q.type==="error"){we(l,d,q.error,{flushSync:j});return}else if(q.matches){if(C=q.matches,y=ft(C,m),N(y))return}else{we(l,d,le(404,{pathname:m}),{flushSync:j});return}}te.set(l,F);let re=wt,W=(await rt("action",g,V,[y],C,l))[y.route.id];if(V.signal.aborted){te.get(l)===F&&te.delete(l);return}if(b.v7_fetcherPersist&&de.has(l)){if(Ie(W)||ce(W)){Ee(l,Le(void 0));return}}else{if(Ie(W))if(te.delete(l),et>re){Ee(l,Le(void 0));return}else return ye.add(l),Ee(l,lt(D)),Oe(V,W,!1,{fetcherSubmission:D,preventScrollReset:T});if(ce(W)){we(l,d,W.error);return}}if(Pe(W))throw le(400,{type:"defer-action"});let Y=g.navigation.location||g.location,$e=Je(e.history,Y,F.signal),nt=c||i,xe=g.navigation.state!=="idle"?Ue(nt,g.navigation.location,s):g.matches;A(xe,"Didn't find any matches after fetcher action");let he=++wt;Ve.set(l,he);let zt=lt(D,W.data);g.fetchers.set(l,zt);let[at,je]=Rr(e.history,g,xe,D,Y,!1,b.v7_skipActionErrorRevalidation,ve,vt,yt,de,ze,ye,nt,s,[y.route.id,W]);je.filter(q=>q.key!==l).forEach(q=>{let Ke=q.key,yr=g.fetchers.get(Ke),On=lt(void 0,yr?yr.data:void 0);g.fetchers.set(Ke,On),Re(Ke),q.controller&&te.set(Ke,q.controller)}),ae({fetchers:new Map(g.fetchers)});let Rt=()=>je.forEach(q=>Re(q.key));F.signal.addEventListener("abort",Rt);let{loaderResults:Lt,fetcherResults:z}=await dr(g,xe,at,je,$e);if(F.signal.aborted)return;F.signal.removeEventListener("abort",Rt),Ve.delete(l),te.delete(l),je.forEach(q=>te.delete(q.key));let Q=Pt(Lt);if(Q)return Oe($e,Q.result,!1,{preventScrollReset:T});if(Q=Pt(z),Q)return ye.add(Q.key),Oe($e,Q.result,!1,{preventScrollReset:T});let{loaderData:Ge,errors:it}=Dr(g,xe,Lt,void 0,je,z,De);if(g.fetchers.has(l)){let q=Le(W.data);g.fetchers.set(l,q)}mr(he),g.navigation.state==="loading"&&he>et?(A(R,"Expected pending action"),I&&I.abort(),We(g.navigation.location,{matches:xe,loaderData:Ge,errors:it,fetchers:new Map(g.fetchers)})):(ae({errors:it,loaderData:Mr(g.loaderData,Ge,xe,it),fetchers:new Map(g.fetchers)}),ve=!1)}async function Ln(l,d,m,y,C,O,j,T,D){let N=g.fetchers.get(l);Ee(l,lt(D,N?N.data:void 0),{flushSync:j});let M=new AbortController,F=Je(e.history,m,M.signal);if(O){let W=await Et(C,new URL(F.url).pathname,F.signal,l);if(W.type==="aborted")return;if(W.type==="error"){we(l,d,W.error,{flushSync:j});return}else if(W.matches)C=W.matches,y=ft(C,m);else{we(l,d,le(404,{pathname:m}),{flushSync:j});return}}te.set(l,M);let V=wt,G=(await rt("loader",g,F,[y],C,l))[y.route.id];if(Pe(G)&&(G=await ir(G,F.signal,!0)||G),te.get(l)===M&&te.delete(l),!F.signal.aborted){if(de.has(l)){Ee(l,Le(void 0));return}if(Ie(G))if(et>V){Ee(l,Le(void 0));return}else{ye.add(l),await Oe(F,G,!1,{preventScrollReset:T});return}if(ce(G)){we(l,d,G.error);return}A(!Pe(G),"Unhandled fetcher deferred data"),Ee(l,Le(G.data))}}async function Oe(l,d,m,y){let{submission:C,fetcherSubmission:O,preventScrollReset:j,replace:T}=y===void 0?{}:y;d.response.headers.has("X-Remix-Revalidate")&&(ve=!0);let D=d.response.headers.get("Location");A(D,"Expected a Location header on the redirect Response"),D=Nr(D,new URL(l.url),s);let N=ut(g.location,D,{_isRedirect:!0});if(r){let W=!1;if(d.response.headers.has("X-Remix-Reload-Document"))W=!0;else if(ar.test(D)){const Y=e.history.createURL(D);W=Y.origin!==t.location.origin||Ce(Y.pathname,s)==null}if(W){T?t.location.replace(D):t.location.assign(D);return}}I=null;let M=T===!0||d.response.headers.has("X-Remix-Replace")?X.Replace:X.Push,{formMethod:F,formAction:V,formEncType:re}=g.navigation;!C&&!O&&F&&V&&re&&(C=Ur(g.navigation));let G=C||O;if(Ca.has(d.response.status)&&G&&fe(G.formMethod))await ke(M,N,{submission:J({},G,{formAction:D}),preventScrollReset:j||H,enableViewTransition:m?ee:void 0});else{let W=Gt(N,C);await ke(M,N,{overrideNavigation:W,fetcherSubmission:O,preventScrollReset:j||H,enableViewTransition:m?ee:void 0})}}async function rt(l,d,m,y,C,O){let j,T={};try{j=await Da(f,l,d,m,y,C,O,o,a)}catch(D){return y.forEach(N=>{T[N.route.id]={type:$.error,error:D}}),T}for(let[D,N]of Object.entries(j))if(Fa(N)){let M=N.result;T[D]={type:$.redirect,response:Oa(M,m,D,C,s,b.v7_relativeSplatPath)}}else T[D]=await ka(N);return T}async function dr(l,d,m,y,C){let O=l.matches,j=rt("loader",l,C,m,d,null),T=Promise.all(y.map(async M=>{if(M.matches&&M.match&&M.controller){let V=(await rt("loader",l,Je(e.history,M.path,M.controller.signal),[M.match],M.matches,M.key))[M.match.route.id];return{[M.key]:V}}else return Promise.resolve({[M.key]:{type:$.error,error:le(404,{pathname:M.path})}})})),D=await j,N=(await T).reduce((M,F)=>Object.assign(M,F),{});return await Promise.all([Ba(d,D,C.signal,O,l.loaderData),Ha(d,N,y)]),{loaderResults:D,fetcherResults:N}}function Bt(){ve=!0,vt.push(...Vt()),ze.forEach((l,d)=>{te.has(d)&&yt.add(d),Re(d)})}function Ee(l,d,m){m===void 0&&(m={}),g.fetchers.set(l,d),ae({fetchers:new Map(g.fetchers)},{flushSync:(m&&m.flushSync)===!0})}function we(l,d,m,y){y===void 0&&(y={});let C=Fe(g.matches,d);_t(l),ae({errors:{[C.route.id]:m},fetchers:new Map(g.fetchers)},{flushSync:(y&&y.flushSync)===!0})}function fr(l){return tt.set(l,(tt.get(l)||0)+1),de.has(l)&&de.delete(l),g.fetchers.get(l)||Sa}function _t(l){let d=g.fetchers.get(l);te.has(l)&&!(d&&d.state==="loading"&&Ve.has(l))&&Re(l),ze.delete(l),Ve.delete(l),ye.delete(l),b.v7_fetcherPersist&&de.delete(l),yt.delete(l),g.fetchers.delete(l)}function Pn(l){let d=(tt.get(l)||0)-1;d<=0?(tt.delete(l),de.add(l),b.v7_fetcherPersist||_t(l)):tt.set(l,d),ae({fetchers:new Map(g.fetchers)})}function Re(l){let d=te.get(l);d&&(d.abort(),te.delete(l))}function ur(l){for(let d of l){let m=fr(d),y=Le(m.data);g.fetchers.set(d,y)}}function hr(){let l=[],d=!1;for(let m of ye){let y=g.fetchers.get(m);A(y,"Expected fetcher: "+m),y.state==="loading"&&(ye.delete(m),l.push(m),d=!0)}return ur(l),d}function mr(l){let d=[];for(let[m,y]of Ve)if(y<l){let C=g.fetchers.get(m);A(C,"Expected fetcher: "+m),C.state==="loading"&&(Re(m),Ve.delete(m),d.push(m))}return ur(d),d.length>0}function Nn(l,d){let m=g.blockers.get(l)||ot;return Me.get(l)!==d&&Me.set(l,d),m}function pr(l){g.blockers.delete(l),Me.delete(l)}function Ct(l,d){let m=g.blockers.get(l)||ot;A(m.state==="unblocked"&&d.state==="blocked"||m.state==="blocked"&&d.state==="blocked"||m.state==="blocked"&&d.state==="proceeding"||m.state==="blocked"&&d.state==="unblocked"||m.state==="proceeding"&&d.state==="unblocked","Invalid blocker state transition: "+m.state+" -> "+d.state);let y=new Map(g.blockers);y.set(l,d),ae({blockers:y})}function br(l){let{currentLocation:d,nextLocation:m,historyAction:y}=l;if(Me.size===0)return;Me.size>1&&Ae(!1,"A router only supports one blocker at a time");let C=Array.from(Me.entries()),[O,j]=C[C.length-1],T=g.blockers.get(O);if(!(T&&T.state==="proceeding")&&j({currentLocation:d,nextLocation:m,historyAction:y}))return O}function Ht(l){let d=le(404,{pathname:l}),m=c||i,{matches:y,route:C}=Or(m);return Vt(),{notFoundMatches:y,route:C,error:d}}function Vt(l){let d=[];return De.forEach((m,y)=>{(!l||l(y))&&(m.cancel(),d.push(y),De.delete(y))}),d}function Tn(l,d,m){if(S=l,x=d,E=m||null,!k&&g.navigation===$t){k=!0;let y=vr(g.location,g.matches);y!=null&&ae({restoreScrollPosition:y})}return()=>{S=null,x=null,E=null}}function gr(l,d){return E&&E(l,d.map(y=>ta(y,g.loaderData)))||l.key}function Dn(l,d){if(S&&x){let m=gr(l,d);S[m]=x()}}function vr(l,d){if(S){let m=gr(l,d),y=S[m];if(typeof y=="number")return y}return null}function St(l,d,m){if(h)if(l){if(Object.keys(l[0].params).length>0)return{active:!0,matches:Dt(d,m,s,!0)}}else return{active:!0,matches:Dt(d,m,s,!0)||[]};return{active:!1,matches:null}}async function Et(l,d,m,y){if(!h)return{type:"success",matches:l};let C=l;for(;;){let O=c==null,j=c||i,T=o;try{await h({signal:m,path:d,matches:C,fetcherKey:y,patch:(M,F)=>{m.aborted||Pr(M,F,j,T,a)}})}catch(M){return{type:"error",error:M,partialMatches:C}}finally{O&&!m.aborted&&(i=[...i])}if(m.aborted)return{type:"aborted"};let D=Ue(j,d,s);if(D)return{type:"success",matches:D};let N=Dt(j,d,s,!0);if(!N||C.length===N.length&&C.every((M,F)=>M.route.id===N[F].route.id))return{type:"success",matches:null};C=N}}function Mn(l){o={},c=Mt(l,a,void 0,o)}function kn(l,d){let m=c==null;Pr(l,d,c||i,o,a),m&&(i=[...i],ae({}))}return ie={get basename(){return s},get future(){return b},get state(){return g},get routes(){return i},get window(){return t},initialize:vn,subscribe:wn,enableScrollRestoration:Tn,navigate:sr,fetch:En,revalidate:xn,createHref:l=>e.history.createHref(l),encodeLocation:l=>e.history.encodeLocation(l),getFetcher:fr,deleteFetcher:Pn,dispose:yn,getBlocker:Nn,deleteBlocker:pr,patchRoutes:kn,_internalFetchControllers:te,_internalActiveDeferreds:De,_internalSetRoutes:Mn},ie}function La(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Qt(e,t,r,n,a,o,i,c){let s,f;if(i){s=[];for(let b of t)if(s.push(b),b.route.id===i){f=b;break}}else s=t,f=t[t.length-1];let h=nr(a||".",rr(s,o),Ce(e.pathname,r)||e.pathname,c==="path");if(a==null&&(h.search=e.search,h.hash=e.hash),(a==null||a===""||a===".")&&f){let b=or(h.search);if(f.route.index&&!b)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!f.route.index&&b){let v=new URLSearchParams(h.search),_=v.getAll("index");v.delete("index"),_.filter(E=>E).forEach(E=>v.append("index",E));let S=v.toString();h.search=S?"?"+S:""}}return n&&r!=="/"&&(h.pathname=h.pathname==="/"?r:_e([r,h.pathname])),Be(h)}function Sr(e,t,r,n){if(!n||!La(n))return{path:r};if(n.formMethod&&!Aa(n.formMethod))return{path:r,error:le(405,{method:n.formMethod})};let a=()=>({path:r,error:le(400,{type:"invalid-body"})}),o=n.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),c=en(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!fe(i))return a();let v=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((_,S)=>{let[E,x]=S;return""+_+E+"="+x+` `},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:v}}}else if(n.formEncType==="application/json"){if(!fe(i))return a();try{let v=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:v,text:void 0}}}catch{return a()}}}A(typeof FormData=="function","FormData is not available in this environment");let s,f;if(n.formData)s=Zt(n.formData),f=n.formData;else if(n.body instanceof FormData)s=Zt(n.body),f=n.body;else if(n.body instanceof URLSearchParams)s=n.body,f=Tr(s);else if(n.body==null)s=new URLSearchParams,f=new FormData;else try{s=new URLSearchParams(n.body),f=Tr(s)}catch{return a()}let h={formMethod:i,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(fe(h.formMethod))return{path:r,submission:h};let b=ge(r);return t&&b.search&&or(b.search)&&s.append("index",""),b.search="?"+s,{path:Be(b),submission:h}}function Er(e,t,r){r===void 0&&(r=!1);let n=e.findIndex(a=>a.route.id===t);return n>=0?e.slice(0,r?n+1:n):e}function Rr(e,t,r,n,a,o,i,c,s,f,h,b,v,_,S,E){let x=E?ce(E[1])?E[1].error:E[1].data:void 0,k=e.createURL(t.location),L=e.createURL(a),U=r;o&&t.errors?U=Er(r,Object.keys(t.errors)[0],!0):E&&ce(E[1])&&(U=Er(r,E[0]));let B=E?E[1].statusCode:void 0,K=i&&B&&B>=400,ie=U.filter((R,H)=>{let{route:I}=R;if(I.lazy)return!0;if(I.loader==null)return!1;if(o)return Xt(I,t.loaderData,t.errors);if(Pa(t.loaderData,t.matches[H],R)||s.some(se=>se===R.route.id))return!0;let ee=t.matches[H],Z=R;return Lr(R,J({currentUrl:k,currentParams:ee.params,nextUrl:L,nextParams:Z.params},n,{actionResult:x,actionStatus:B,defaultShouldRevalidate:K?!1:c||k.pathname+k.search===L.pathname+L.search||k.search!==L.search||Zr(ee,Z)}))}),g=[];return b.forEach((R,H)=>{if(o||!r.some(oe=>oe.route.id===R.routeId)||h.has(H))return;let I=Ue(_,R.path,S);if(!I){g.push({key:H,routeId:R.routeId,path:R.path,matches:null,match:null,controller:null});return}let ee=t.fetchers.get(H),Z=ft(I,R.path),se=!1;v.has(H)?se=!1:f.has(H)?(f.delete(H),se=!0):ee&&ee.state!=="idle"&&ee.data===void 0?se=c:se=Lr(Z,J({currentUrl:k,currentParams:t.matches[t.matches.length-1].params,nextUrl:L,nextParams:r[r.length-1].params},n,{actionResult:x,actionStatus:B,defaultShouldRevalidate:K?!1:c})),se&&g.push({key:H,routeId:R.routeId,path:R.path,matches:I,match:Z,controller:new AbortController})}),[ie,g]}function Xt(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let n=t!=null&&t[e.id]!==void 0,a=r!=null&&r[e.id]!==void 0;return!n&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!n&&!a}function Pa(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function Zr(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Lr(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Pr(e,t,r,n,a){var o;let i;if(e){let f=n[e];A(f,"No route found to patch children into: routeId = "+e),f.children||(f.children=[]),i=f.children}else i=r;let c=t.filter(f=>!i.some(h=>qr(f,h))),s=Mt(c,a,[e||"_","patch",String(((o=i)==null?void 0:o.length)||"0")],n);i.push(...s)}function qr(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,n)=>{var a;return(a=t.children)==null?void 0:a.some(o=>qr(r,o))}):!1}async function Na(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];A(a,"No route found in manifest");let o={};for(let i in n){let s=a[i]!==void 0&&i!=="hasErrorBoundary";Ae(!s,'Route "'+a.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!s&&!qn.has(i)&&(o[i]=n[i])}Object.assign(a,o),Object.assign(a,J({},t(a),{lazy:void 0}))}async function Ta(e){let{matches:t}=e,r=t.filter(a=>a.shouldLoad);return(await Promise.all(r.map(a=>a.resolve()))).reduce((a,o,i)=>Object.assign(a,{[r[i].route.id]:o}),{})}async function Da(e,t,r,n,a,o,i,c,s,f){let h=o.map(_=>_.route.lazy?Na(_.route,s,c):void 0),b=o.map((_,S)=>{let E=h[S],x=a.some(L=>L.route.id===_.route.id);return J({},_,{shouldLoad:x,resolve:async L=>(L&&n.method==="GET"&&(_.route.lazy||_.route.loader)&&(x=!0),x?Ma(t,n,_,E,L,f):Promise.resolve({type:$.data,result:void 0}))})}),v=await e({matches:b,request:n,params:o[0].params,fetcherKey:i,context:f});try{await Promise.all(h)}catch{}return v}async function Ma(e,t,r,n,a,o){let i,c,s=f=>{let h,b=new Promise((S,E)=>h=E);c=()=>h(),t.signal.addEventListener("abort",c);let v=S=>typeof f!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):f({request:t,params:r.params,context:o},...S!==void 0?[S]:[]),_=(async()=>{try{return{type:"data",result:await(a?a(E=>v(E)):v())}}catch(S){return{type:"error",result:S}}})();return Promise.race([_,b])};try{let f=r.route[e];if(n)if(f){let h,[b]=await Promise.all([s(f).catch(v=>{h=v}),n]);if(h!==void 0)throw h;i=b}else if(await n,f=r.route[e],f)i=await s(f);else if(e==="action"){let h=new URL(t.url),b=h.pathname+h.search;throw le(405,{method:t.method,pathname:b,routeId:r.route.id})}else return{type:$.data,result:void 0};else if(f)i=await s(f);else{let h=new URL(t.url),b=h.pathname+h.search;throw le(404,{pathname:b})}A(i.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(f){return{type:$.error,result:f}}finally{c&&t.signal.removeEventListener("abort",c)}return i}async function ka(e){let{result:t,type:r}=e;if(tn(t)){let b;try{let v=t.headers.get("Content-Type");v&&/\bapplication\/json\b/.test(v)?t.body==null?b=null:b=await t.json():b=await t.text()}catch(v){return{type:$.error,error:v}}return r===$.error?{type:$.error,error:new Ot(t.status,t.statusText,b),statusCode:t.status,headers:t.headers}:{type:$.data,data:b,statusCode:t.status,headers:t.headers}}if(r===$.error){if(jr(t)){var n,a;if(t.data instanceof Error){var o,i;return{type:$.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:$.error,error:new Ot(((n=t.init)==null?void 0:n.status)||500,void 0,t.data),statusCode:ht(t)?t.status:void 0,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}}return{type:$.error,error:t,statusCode:ht(t)?t.status:void 0}}if(Ia(t)){var c,s;return{type:$.deferred,deferredData:t,statusCode:(c=t.init)==null?void 0:c.status,headers:((s=t.init)==null?void 0:s.headers)&&new Headers(t.init.headers)}}if(jr(t)){var f,h;return{type:$.data,data:t.data,statusCode:(f=t.init)==null?void 0:f.status,headers:(h=t.init)!=null&&h.headers?new Headers(t.init.headers):void 0}}return{type:$.data,data:t}}function Oa(e,t,r,n,a,o){let i=e.headers.get("Location");if(A(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!ar.test(i)){let c=n.slice(0,n.findIndex(s=>s.route.id===r)+1);i=Qt(new URL(t.url),c,a,!0,i,o),e.headers.set("Location",i)}return e}function Nr(e,t,r){if(ar.test(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),o=Ce(a.pathname,r)!=null;if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function Je(e,t,r,n){let a=e.createURL(en(t)).toString(),o={signal:r};if(n&&fe(n.formMethod)){let{formMethod:i,formEncType:c}=n;o.method=i.toUpperCase(),c==="application/json"?(o.headers=new Headers({"Content-Type":c}),o.body=JSON.stringify(n.json)):c==="text/plain"?o.body=n.text:c==="application/x-www-form-urlencoded"&&n.formData?o.body=Zt(n.formData):o.body=n.formData}return new Request(a,o)}function Zt(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function Tr(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function ja(e,t,r,n,a){let o={},i=null,c,s=!1,f={},h=r&&ce(r[1])?r[1].error:void 0;return e.forEach(b=>{if(!(b.route.id in t))return;let v=b.route.id,_=t[v];if(A(!Ie(_),"Cannot handle redirect results in processLoaderData"),ce(_)){let S=_.error;if(h!==void 0&&(S=h,h=void 0),i=i||{},a)i[v]=S;else{let E=Fe(e,v);i[E.route.id]==null&&(i[E.route.id]=S)}o[v]=void 0,s||(s=!0,c=ht(_.error)?_.error.status:500),_.headers&&(f[v]=_.headers)}else Pe(_)?(n.set(v,_.deferredData),o[v]=_.deferredData.data,_.statusCode!=null&&_.statusCode!==200&&!s&&(c=_.statusCode),_.headers&&(f[v]=_.headers)):(o[v]=_.data,_.statusCode&&_.statusCode!==200&&!s&&(c=_.statusCode),_.headers&&(f[v]=_.headers))}),h!==void 0&&r&&(i={[r[0]]:h},o[r[0]]=void 0),{loaderData:o,errors:i,statusCode:c||200,loaderHeaders:f}}function Dr(e,t,r,n,a,o,i){let{loaderData:c,errors:s}=ja(t,r,n,i,!1);return a.forEach(f=>{let{key:h,match:b,controller:v}=f,_=o[h];if(A(_,"Did not find corresponding fetcher result"),!(v&&v.signal.aborted))if(ce(_)){let S=Fe(e.matches,b==null?void 0:b.route.id);s&&s[S.route.id]||(s=J({},s,{[S.route.id]:_.error})),e.fetchers.delete(h)}else if(Ie(_))A(!1,"Unhandled fetcher revalidation redirect");else if(Pe(_))A(!1,"Unhandled fetcher deferred data");else{let S=Le(_.data);e.fetchers.set(h,S)}}),{loaderData:c,errors:s}}function Mr(e,t,r,n){let a=J({},t);for(let o of r){let i=o.route.id;if(t.hasOwnProperty(i)?t[i]!==void 0&&(a[i]=t[i]):e[i]!==void 0&&o.route.loader&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function kr(e){return e?ce(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Fe(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function Or(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function le(e,t){let{pathname:r,routeId:n,method:a,type:o,message:i}=t===void 0?{}:t,c="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(c="Bad Request",a&&r&&n?s="You made a "+a+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":o==="defer-action"?s="defer() is not supported in actions":o==="invalid-body"&&(s="Unable to encode submission body")):e===403?(c="Forbidden",s='Route "'+n+'" does not match URL "'+r+'"'):e===404?(c="Not Found",s='No route matches URL "'+r+'"'):e===405&&(c="Method Not Allowed",a&&r&&n?s="You made a "+a.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":a&&(s='Invalid request method "'+a.toUpperCase()+'"')),new Ot(e||500,c,new Error(s),!0)}function Pt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[n,a]=t[r];if(Ie(a))return{key:n,result:a}}}function en(e){let t=typeof e=="string"?ge(e):e;return Be(J({},t,{hash:""}))}function Ua(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Fa(e){return tn(e.result)&&_a.has(e.result.status)}function Pe(e){return e.type===$.deferred}function ce(e){return e.type===$.error}function Ie(e){return(e&&e.type)===$.redirect}function jr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Ia(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function tn(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Aa(e){return xa.has(e.toLowerCase())}function fe(e){return ya.has(e.toLowerCase())}async function Ba(e,t,r,n,a){let o=Object.entries(t);for(let i=0;i<o.length;i++){let[c,s]=o[i],f=e.find(v=>(v==null?void 0:v.route.id)===c);if(!f)continue;let h=n.find(v=>v.route.id===f.route.id),b=h!=null&&!Zr(h,f)&&(a&&a[f.route.id])!==void 0;Pe(s)&&b&&await ir(s,r,!1).then(v=>{v&&(t[c]=v)})}}async function Ha(e,t,r){for(let n=0;n<r.length;n++){let{key:a,routeId:o,controller:i}=r[n],c=t[a];e.find(f=>(f==null?void 0:f.route.id)===o)&&Pe(c)&&(A(i,"Expected an AbortController for revalidating fetcher deferred result"),await ir(c,i.signal,!0).then(f=>{f&&(t[a]=f)}))}}async function ir(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:$.data,data:e.deferredData.unwrappedData}}catch(a){return{type:$.error,error:a}}return{type:$.data,data:e.deferredData.data}}}function or(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ft(e,t){let r=typeof t=="string"?ge(t).search:t.search;if(e[e.length-1].route.index&&or(r||""))return e[e.length-1];let n=Yr(e);return n[n.length-1]}function Ur(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function Gt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Va(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function lt(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function za(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Le(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Wa(e,t){try{let r=e.sessionStorage.getItem(Xr);if(r){let n=JSON.parse(r);for(let[a,o]of Object.entries(n||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function $a(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Xr,JSON.stringify(r))}catch(n){Ae(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/** * React Router v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function mt(){return mt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mt.apply(this,arguments)}const pt=p.createContext(null),lr=p.createContext(null),Ne=p.createContext(null),Ft=p.createContext(null),Te=p.createContext({outlet:null,matches:[],isDataRoute:!1}),rn=p.createContext(null);function Ga(e,t){let{relative:r}=t===void 0?{}:t;bt()||A(!1);let{basename:n,navigator:a}=p.useContext(Ne),{hash:o,pathname:i,search:c}=It(e,{relative:r}),s=i;return n!=="/"&&(s=i==="/"?n:_e([n,i])),a.createHref({pathname:s,search:c,hash:o})}function bt(){return p.useContext(Ft)!=null}function He(){return bt()||A(!1),p.useContext(Ft).location}function nn(e){p.useContext(Ne).static||p.useLayoutEffect(e)}function an(){let{isDataRoute:e}=p.useContext(Te);return e?oi():Ka()}function Ka(){bt()||A(!1);let e=p.useContext(pt),{basename:t,future:r,navigator:n}=p.useContext(Ne),{matches:a}=p.useContext(Te),{pathname:o}=He(),i=JSON.stringify(rr(a,r.v7_relativeSplatPath)),c=p.useRef(!1);return nn(()=>{c.current=!0}),p.useCallback(function(f,h){if(h===void 0&&(h={}),!c.current)return;if(typeof f=="number"){n.go(f);return}let b=nr(f,JSON.parse(i),o,h.relative==="path");e==null&&t!=="/"&&(b.pathname=b.pathname==="/"?t:_e([t,b.pathname])),(h.replace?n.replace:n.push)(b,h.state,h)},[t,n,i,o,e])}const Ja=p.createContext(null);function Ya(e){let t=p.useContext(Te).outlet;return t&&p.createElement(Ja.Provider,{value:e},t)}function It(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=p.useContext(Ne),{matches:a}=p.useContext(Te),{pathname:o}=He(),i=JSON.stringify(rr(a,n.v7_relativeSplatPath));return p.useMemo(()=>nr(e,JSON.parse(i),o,r==="path"),[e,i,o,r])}function Qa(e,t,r,n){bt()||A(!1);let{navigator:a}=p.useContext(Ne),{matches:o}=p.useContext(Te),i=o[o.length-1],c=i?i.params:{};i&&i.pathname;let s=i?i.pathnameBase:"/";i&&i.route;let f=He(),h;if(t){var b;let x=typeof t=="string"?ge(t):t;s==="/"||(b=x.pathname)!=null&&b.startsWith(s)||A(!1),h=x}else h=f;let v=h.pathname||"/",_=v;if(s!=="/"){let x=s.replace(/^\//,"").split("/");_="/"+v.replace(/^\//,"").split("/").slice(x.length).join("/")}let S=Ue(e,{pathname:_}),E=ti(S&&S.map(x=>Object.assign({},x,{params:Object.assign({},c,x.params),pathname:_e([s,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?s:_e([s,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),o,r,n);return t&&E?p.createElement(Ft.Provider,{value:{location:mt({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:X.Pop}},E):E}function Xa(){let e=ii(),t=ht(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),r?p.createElement("pre",{style:a},r):null,o)}const Za=p.createElement(Xa,null);class qa extends p.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?p.createElement(Te.Provider,{value:this.props.routeContext},p.createElement(rn.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ei(e){let{routeContext:t,match:r,children:n}=e,a=p.useContext(pt);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),p.createElement(Te.Provider,{value:t},n)}function ti(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if(!r)return null;if(r.errors)e=r.matches;else if((o=n)!=null&&o.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,c=(a=r)==null?void 0:a.errors;if(c!=null){let h=i.findIndex(b=>b.route.id&&(c==null?void 0:c[b.route.id])!==void 0);h>=0||A(!1),i=i.slice(0,Math.min(i.length,h+1))}let s=!1,f=-1;if(r&&n&&n.v7_partialHydration)for(let h=0;h<i.length;h++){let b=i[h];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(f=h),b.route.id){let{loaderData:v,errors:_}=r,S=b.route.loader&&v[b.route.id]===void 0&&(!_||_[b.route.id]===void 0);if(b.route.lazy||S){s=!0,f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}return i.reduceRight((h,b,v)=>{let _,S=!1,E=null,x=null;r&&(_=c&&b.route.id?c[b.route.id]:void 0,E=b.route.errorElement||Za,s&&(f<0&&v===0?(li("route-fallback",!1),S=!0,x=null):f===v&&(S=!0,x=b.route.hydrateFallbackElement||null)));let k=t.concat(i.slice(0,v+1)),L=()=>{let U;return _?U=E:S?U=x:b.route.Component?U=p.createElement(b.route.Component,null):b.route.element?U=b.route.element:U=h,p.createElement(ei,{match:b,routeContext:{outlet:h,matches:k,isDataRoute:r!=null},children:U})};return r&&(b.route.ErrorBoundary||b.route.errorElement||v===0)?p.createElement(qa,{location:r.location,revalidation:r.revalidation,component:E,error:_,children:L(),routeContext:{outlet:null,matches:k,isDataRoute:!0}}):L()},null)}var on=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(on||{}),jt=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(jt||{});function ri(e){let t=p.useContext(pt);return t||A(!1),t}function ni(e){let t=p.useContext(lr);return t||A(!1),t}function ai(e){let t=p.useContext(Te);return t||A(!1),t}function ln(e){let t=ai(),r=t.matches[t.matches.length-1];return r.route.id||A(!1),r.route.id}function ii(){var e;let t=p.useContext(rn),r=ni(jt.UseRouteError),n=ln(jt.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function oi(){let{router:e}=ri(on.UseNavigateStable),t=ln(jt.UseNavigateStable),r=p.useRef(!1);return nn(()=>{r.current=!0}),p.useCallback(function(a,o){o===void 0&&(o={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,mt({fromRouteId:t},o)))},[e,t])}const Fr={};function li(e,t,r){!t&&!Fr[e]&&(Fr[e]=!0)}function si(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function ci(e){return Ya(e.context)}function di(e){let{basename:t="/",children:r=null,location:n,navigationType:a=X.Pop,navigator:o,static:i=!1,future:c}=e;bt()&&A(!1);let s=t.replace(/^\/*/,"/"),f=p.useMemo(()=>({basename:s,navigator:o,static:i,future:mt({v7_relativeSplatPath:!1},c)}),[s,c,o,i]);typeof n=="string"&&(n=ge(n));let{pathname:h="/",search:b="",hash:v="",state:_=null,key:S="default"}=n,E=p.useMemo(()=>{let x=Ce(h,s);return x==null?null:{location:{pathname:x,search:b,hash:v,state:_,key:S},navigationType:a}},[s,h,b,v,_,S,a]);return E==null?null:p.createElement(Ne.Provider,{value:f},p.createElement(Ft.Provider,{children:r,value:E}))}new Promise(()=>{});function fi(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:p.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** * React Router DOM v6.30.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Ze(){return Ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ze.apply(this,arguments)}function sn(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,o;for(o=0;o<n.length;o++)a=n[o],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function ui(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function hi(e,t){return e.button===0&&(!t||t==="_self")&&!ui(e)}function qt(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function mi(e,t){let r=qt(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(o=>{r.append(a,o)})}),r}const pi=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],bi=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],gi="6";try{window.__reactRouterVersion=gi}catch{}function vi(e,t){return Ra({basename:t==null?void 0:t.basename,future:Ze({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:Qn({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||yi(),routes:e,mapRouteProperties:fi,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function yi(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Ze({},t,{errors:wi(t.errors)})),t}function wi(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,a]of t)if(a&&a.__type==="RouteErrorResponse")r[n]=new Ot(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let i=new o(a.message);i.stack="",r[n]=i}catch{}}if(r[n]==null){let o=new Error(a.message);o.stack="",r[n]=o}}else r[n]=a;return r}const cn=p.createContext({isTransitioning:!1}),xi=p.createContext(new Map),_i="startTransition",Ir=jn[_i],Ci="flushSync",Ar=Un[Ci];function Si(e){Ir?Ir(e):e()}function st(e){Ar?Ar(e):e()}class Ei{constructor(){this.status="pending",this.promise=new Promise((t,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function Ri(e){let{fallbackElement:t,router:r,future:n}=e,[a,o]=p.useState(r.state),[i,c]=p.useState(),[s,f]=p.useState({isTransitioning:!1}),[h,b]=p.useState(),[v,_]=p.useState(),[S,E]=p.useState(),x=p.useRef(new Map),{v7_startTransition:k}=n||{},L=p.useCallback(R=>{k?Si(R):R()},[k]),U=p.useCallback((R,H)=>{let{deletedFetchers:I,flushSync:ee,viewTransitionOpts:Z}=H;R.fetchers.forEach((oe,ve)=>{oe.data!==void 0&&x.current.set(ve,oe.data)}),I.forEach(oe=>x.current.delete(oe));let se=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!Z||se){ee?st(()=>o(R)):L(()=>o(R));return}if(ee){st(()=>{v&&(h&&h.resolve(),v.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:Z.currentLocation,nextLocation:Z.nextLocation})});let oe=r.window.document.startViewTransition(()=>{st(()=>o(R))});oe.finished.finally(()=>{st(()=>{b(void 0),_(void 0),c(void 0),f({isTransitioning:!1})})}),st(()=>_(oe));return}v?(h&&h.resolve(),v.skipTransition(),E({state:R,currentLocation:Z.currentLocation,nextLocation:Z.nextLocation})):(c(R),f({isTransitioning:!0,flushSync:!1,currentLocation:Z.currentLocation,nextLocation:Z.nextLocation}))},[r.window,v,h,x,L]);p.useLayoutEffect(()=>r.subscribe(U),[r,U]),p.useEffect(()=>{s.isTransitioning&&!s.flushSync&&b(new Ei)},[s]),p.useEffect(()=>{if(h&&i&&r.window){let R=i,H=h.promise,I=r.window.document.startViewTransition(async()=>{L(()=>o(R)),await H});I.finished.finally(()=>{b(void 0),_(void 0),c(void 0),f({isTransitioning:!1})}),_(I)}},[L,i,h,r.window]),p.useEffect(()=>{h&&i&&a.location.key===i.location.key&&h.resolve()},[h,v,a.location,i]),p.useEffect(()=>{!s.isTransitioning&&S&&(c(S.state),f({isTransitioning:!0,flushSync:!1,currentLocation:S.currentLocation,nextLocation:S.nextLocation}),E(void 0))},[s.isTransitioning,S]),p.useEffect(()=>{},[]);let B=p.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:R=>r.navigate(R),push:(R,H,I)=>r.navigate(R,{state:H,preventScrollReset:I==null?void 0:I.preventScrollReset}),replace:(R,H,I)=>r.navigate(R,{replace:!0,state:H,preventScrollReset:I==null?void 0:I.preventScrollReset})}),[r]),K=r.basename||"/",ie=p.useMemo(()=>({router:r,navigator:B,static:!1,basename:K}),[r,B,K]),g=p.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return p.useEffect(()=>si(n,r.future),[n,r.future]),p.createElement(p.Fragment,null,p.createElement(pt.Provider,{value:ie},p.createElement(lr.Provider,{value:a},p.createElement(xi.Provider,{value:x.current},p.createElement(cn.Provider,{value:s},p.createElement(di,{basename:K,location:a.location,navigationType:a.historyAction,navigator:B,future:g},a.initialized||r.future.v7_partialHydration?p.createElement(Li,{routes:r.routes,future:r.future,state:a}):t))))),null)}const Li=p.memo(Pi);function Pi(e){let{routes:t,future:r,state:n}=e;return Qa(t,void 0,n,r)}const Ni=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ti=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Di=p.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:o,replace:i,state:c,target:s,to:f,preventScrollReset:h,viewTransition:b}=t,v=sn(t,pi),{basename:_}=p.useContext(Ne),S,E=!1;if(typeof f=="string"&&Ti.test(f)&&(S=f,Ni))try{let U=new URL(window.location.href),B=f.startsWith("//")?new URL(U.protocol+f):new URL(f),K=Ce(B.pathname,_);B.origin===U.origin&&K!=null?f=K+B.search+B.hash:E=!0}catch{}let x=Ga(f,{relative:a}),k=Oi(f,{replace:i,state:c,target:s,preventScrollReset:h,relative:a,viewTransition:b});function L(U){n&&n(U),U.defaultPrevented||k(U)}return p.createElement("a",Ze({},v,{href:S||x,onClick:E||o?n:L,ref:r,target:s}))}),Mi=p.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:a=!1,className:o="",end:i=!1,style:c,to:s,viewTransition:f,children:h}=t,b=sn(t,bi),v=It(s,{relative:b.relative}),_=He(),S=p.useContext(lr),{navigator:E,basename:x}=p.useContext(Ne),k=S!=null&&Ui(v)&&f===!0,L=E.encodeLocation?E.encodeLocation(v).pathname:v.pathname,U=_.pathname,B=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;a||(U=U.toLowerCase(),B=B?B.toLowerCase():null,L=L.toLowerCase()),B&&x&&(B=Ce(B,x)||B);const K=L!=="/"&&L.endsWith("/")?L.length-1:L.length;let ie=U===L||!i&&U.startsWith(L)&&U.charAt(K)==="/",g=B!=null&&(B===L||!i&&B.startsWith(L)&&B.charAt(L.length)==="/"),R={isActive:ie,isPending:g,isTransitioning:k},H=ie?n:void 0,I;typeof o=="function"?I=o(R):I=[o,ie?"active":null,g?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let ee=typeof c=="function"?c(R):c;return p.createElement(Di,Ze({},b,{"aria-current":H,className:I,ref:r,style:ee,to:s,viewTransition:f}),typeof h=="function"?h(R):h)});var er;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(er||(er={}));var Br;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Br||(Br={}));function ki(e){let t=p.useContext(pt);return t||A(!1),t}function Oi(e,t){let{target:r,replace:n,state:a,preventScrollReset:o,relative:i,viewTransition:c}=t===void 0?{}:t,s=an(),f=He(),h=It(e,{relative:i});return p.useCallback(b=>{if(hi(b,r)){b.preventDefault();let v=n!==void 0?n:Be(f)===Be(h);s(e,{replace:v,state:a,preventScrollReset:o,relative:i,viewTransition:c})}},[f,s,h,n,a,r,e,o,i,c])}function ji(e){let t=p.useRef(qt(e)),r=p.useRef(!1),n=He(),a=p.useMemo(()=>mi(n.search,r.current?null:t.current),[n.search]),o=an(),i=p.useCallback((c,s)=>{const f=qt(typeof c=="function"?c(a):c);r.current=!0,o("?"+f,s)},[o,a]);return[a,i]}function Ui(e,t){t===void 0&&(t={});let r=p.useContext(cn);r==null&&A(!1);let{basename:n}=ki(er.useViewTransitionState),a=It(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=Ce(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=Ce(r.nextLocation.pathname,n)||r.nextLocation.pathname;return kt(a.pathname,i)!=null||kt(a.pathname,o)!=null}const Fi=qe.a.attrs({href:"#"})`fb-items-center fb-bg-[#81b441] fb-rounded fb-text-white fb-inline-flex fb-font-medium fb-leading-none fb-py-3 fb-px-5 fb-no-underline fb-cursor-pointer fb-mt-[10px] active:fb-text-white active:fb-shadow-none active:fb-outline-none hover:fb-shadow-none hover:fb-text-white hover:fb-outline-none hover:fb-bg-[#74a13a] `,Ii=[w("feature_1"),w("feature_2"),w("feature_3"),w("feature_4"),w("feature_5"),w("feature_6"),w("feature_7")],Ai=({buynow:e})=>P(Se,{children:[P("div",{children:[u("h1",{className:"fb-mt-0 fb-font-semibold",children:w("upgrade_to_pro")}),P("h2",{className:"fb-flex fb-items-center",children:[w("explore_filebird"),u("span",{className:"fb-ml-2 fb-bg-[#4caf51] fb-rounded-3xl fb-py-1 fb-font-normal fb-px-2 fb-text-sm fb-text-white",children:w("lifetime_license")})]})]}),u("ul",{className:"fb-my-3 fb-mx-0",children:Ii.map(t=>P("li",{className:"fb-flex fb-items-center",children:[u("svg",{className:"fb-text-[#4caf50] fb-mr-2 fb-flex-shrink-0",width:20,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:u("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z"})}),t]},t))}),P(Fi,{onClick:e,tabIndex:0,className:"focus:fb-shadow-admin-button",children:[u("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"currentColor",className:"fb-mr-[10px] fb-text-base",children:u("path",{d:"M26.2,2.1C22-2.8,8.4,6.7,8.5,19c0,0.3-0.3,0.6-0.6,0.6c-0.2,0-0.4-0.1-0.5-0.3c-1.4-3-1.6-6.5-0.5-9.6C7.1,9.4,6.9,9.1,6.6,9C6.4,8.9,6.2,9,6.1,9.1c-2.3,2.4-3.5,5.6-3.5,8.9c-0.1,7.2,5.7,13.1,12.8,13.1c0.1,0,0.2,0,0.3,0C34.2,30.7,29.9,6.5,26.2,2.1z"})}),u("span",{className:"fb-uppercase",children:w("go_pro")})]})]}),gt=({children:e,footer:t})=>u(Se,{children:P("div",{className:"fb-p-4 wp-md:fb-p-12 fb-flex-1",children:[e,t&&u("div",{className:"fb-flex fb-justify-end fb-mt-6",children:t})]})}),{asset_url:Bi}=window.fbv_data,Hi=qe.div`fb-max-w-[250px] fb-w-[250px] fb-h-[250px] fb-mb-4 fb-bg-no-repeat fb-object-cover fb-shrink-0 fb-grow-0`,Hr=()=>{const e=()=>{window.open("https://1.envato.market/GoPro-FileBird-Premium","_blank")},t=`${Bi}img/sad-bird.svg`;return u(gt,{children:P("div",{className:"fb-flex fb-flex-col wp-md:fb-flex-row fb-items-center fb-justify-center",children:[u(Hi,{style:{backgroundImage:`url(${t})`}}),u("div",{children:u(Ai,{buynow:e})})]})})},pe=tr.button(({$secondary:e,$danger:t})=>["button fb-flex fb-items-center fb-justify-center fb-gap-1 fb-min-w-24 fb-bg-admin-primary fb-font-medium fb-before-icon fb-text-white fb-outline-none hover:fb-bg-admin-primary-darker active:fb-bg-admin-primary-darker focus:fb-shadow-admin-button fb-transition-shadow",e&&"fb-bg-white fb-text-admin-primary hover:fb-bg-admin-primary hover:fb-text-white active:fb-text-white",t&&"danger fb-bg-admin-danger-lighter fb-border-transparent fb-text-admin-danger hover:fb-bg-red-200 active:fb-bg-red-200 focus:fb-shadow-[inset_0_0_0_1px_#fff,0_0_0_0.5px_#C82D270F]"]);var At="Switch",[Vi,Po]=Fn(At),[zi,Wi]=Vi(At),dn=p.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:a,defaultChecked:o,required:i,disabled:c,value:s="on",onCheckedChange:f,form:h,...b}=e,[v,_]=p.useState(null),S=$r(t,U=>_(U)),E=p.useRef(!1),x=v?h||!!v.closest("form"):!0,[k,L]=In({prop:a,defaultProp:o??!1,onChange:f,caller:At});return P(zi,{scope:r,checked:k,disabled:c,children:[u(Gr.button,{type:"button",role:"switch","aria-checked":k,"aria-required":i,"data-state":mn(k),"data-disabled":c?"":void 0,disabled:c,value:s,...b,ref:S,onClick:An(e.onClick,U=>{L(B=>!B),x&&(E.current=U.isPropagationStopped(),E.current||U.stopPropagation())})}),x&&u(hn,{control:v,bubbles:!E.current,name:n,value:s,checked:k,required:i,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});dn.displayName=At;var fn="SwitchThumb",un=p.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,a=Wi(fn,r);return u(Gr.span,{"data-state":mn(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t})});un.displayName=fn;var $i="SwitchBubbleInput",hn=p.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...a},o)=>{const i=p.useRef(null),c=$r(i,o),s=Bn(r),f=Hn(t);return p.useEffect(()=>{const h=i.current;if(!h)return;const b=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(b,"checked").set;if(s!==r&&_){const S=new Event("click",{bubbles:n});_.call(h,r),h.dispatchEvent(S)}},[s,r,n]),u("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:c,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});hn.displayName=$i;function mn(e){return e?"checked":"unchecked"}var pn=dn,Gi=un;const Qe=p.forwardRef(({className:e,...t},r)=>u(pn,{className:Jt("fb-peer fb-p-0 fb-inline-flex fb-h-[18px] fb-w-9 fb-shrink-0 fb-cursor-pointer fb-items-center fb-rounded-full fb-border fb-border-teal-950 fb-border-solid fb-bg-transparent fb-shadow-sm fb-transition-colors focus-visible:fb-outline-none focus-visible:fb-ring-2 focus-visible:fb-ring-ring focus-visible:fb-ring-offset-2 focus-visible:fb-ring-offset-white disabled:fb-cursor-not-allowed disabled:fb-opacity-50 data-[state=checked]:fb-bg-admin-primary data-[state=unchecked]:fb-bg-input data-[state=checked]:fb-border-transparent",e),...t,ref:r,children:u(Gi,{className:Jt("fb-pointer-events-none fb-block fb-h-3 fb-w-3 fb-rounded-full fb-bg-teal-950 fb-shadow-lg fb-ring-0 fb-transition-transform data-[state=checked]:fb-translate-x-5 data-[state=checked]:fb-bg-white data-[state=unchecked]:fb-translate-x-0.5")})}));Qe.displayName=pn.displayName;const Ki=()=>{const e=Xe(i=>i.settings),t=Xe(i=>i.setSettings),r=Xe(i=>i.updateSetting),[n,a]=p.useState(!1);return u(Se,{children:P(gt,{footer:u(pe,{disabled:n,className:n?"updating-message":"",onClick:async()=>{a(!0);try{await r(e)}catch(i){ne.error(w("set_setting_fail")),console.log({error:i})}finally{a(!1)}},children:w("save_changes")}),children:[u("h3",{className:"fb-mt-0 fb-p-0",children:w("document_library")}),u("div",{className:"fb-flex fb-flex-col fb-gap-[10px]",children:P("div",{className:"fb-flex fb-gap-[10px]",children:[u(Qe,{checked:!!e.enable_cache_optimization,onCheckedChange:i=>t("enable_cache_optimization",i)}),u("span",{children:w("enable_cache_optimization")})]})})]})})},Ji=p.forwardRef((e,t)=>P("svg",{...e,ref:t,width:"18",height:"21",viewBox:"0 0 18 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u("path",{d:"M7.58605 1.2209L2.94419 3.00713C1.87442 3.41568 1 4.70784 1 5.86698V12.9264C1 14.0475 1.72558 15.5202 2.6093 16.1948L6.6093 19.2447C7.92093 20.2518 10.0791 20.2518 11.3907 19.2447L15.3907 16.1948C16.2744 15.5202 17 14.0475 17 12.9264V5.86698C17 4.69834 16.1256 3.40618 15.0558 2.99762L10.414 1.2209C9.62326 0.926366 8.35814 0.926366 7.58605 1.2209Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),u("path",{d:"M6.24652 10.8864L7.7442 12.3356L11.7442 8.46509",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})),Yi=p.forwardRef((e,t)=>P("svg",{...e,ref:t,width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.7381 6.28381L18.1082 5.21619C17.5753 4.31282 16.3944 4.00118 15.4682 4.51952V4.51952C15.0274 4.77319 14.5013 4.84516 14.0061 4.71956C13.5109 4.59396 13.0871 4.28111 12.8283 3.85C12.6618 3.57598 12.5723 3.26387 12.5689 2.94524V2.94524C12.584 2.43439 12.3866 1.93935 12.0219 1.5729C11.6572 1.20645 11.1562 0.99979 10.633 1H9.36394C8.85134 0.999994 8.35987 1.19951 7.99828 1.55439C7.63668 1.90928 7.43478 2.39027 7.43725 2.89095V2.89095C7.42205 3.92468 6.55973 4.75487 5.50129 4.75476C5.17507 4.75145 4.85553 4.66406 4.57499 4.50143V4.50143C3.64885 3.98309 2.46792 4.29473 1.93504 5.1981L1.25885 6.28381C0.726609 7.18605 1.04132 8.33879 1.96283 8.86238V8.86238C2.56183 9.20017 2.93082 9.82442 2.93082 10.5C2.93082 11.1756 2.56183 11.7998 1.96283 12.1376V12.1376C1.0425 12.6577 0.727436 13.8076 1.25885 14.7071V14.7071L1.89799 15.7838C2.14767 16.2239 2.56658 16.5486 3.06204 16.6861C3.55749 16.8237 4.08864 16.7627 4.53794 16.5167V16.5167C4.97962 16.2649 5.50596 16.196 5.99996 16.3251C6.49396 16.4542 6.91469 16.7707 7.16862 17.2043C7.33512 17.4783 7.42459 17.7904 7.42798 18.109V18.109C7.42798 19.1534 8.29474 20 9.36394 20H10.633C11.6986 20 12.5638 19.1589 12.5689 18.1181V18.1181C12.5665 17.6158 12.7696 17.1335 13.1332 16.7783C13.4968 16.4232 13.9907 16.2247 14.5049 16.2271C14.8303 16.2357 15.1485 16.3227 15.4312 16.4805V16.4805C16.3549 17.0003 17.5351 16.6929 18.0711 15.7929V15.7929L18.7381 14.7071C18.9962 14.2743 19.0671 13.7589 18.9349 13.2749C18.8028 12.7909 18.4786 12.3784 18.0341 12.1286V12.1286C17.5896 11.8788 17.2654 11.4662 17.1332 10.9822C17.0011 10.4983 17.0719 9.9828 17.3301 9.55C17.498 9.26372 17.741 9.02635 18.0341 8.86238V8.86238C18.9501 8.33908 19.264 7.19307 18.7381 6.29286V6.29286V6.28381Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),u("ellipse",{cx:"10.003",cy:"10.5",rx:"2.66773",ry:"2.60571",fill:"currentColor"})]})),Qi=p.forwardRef((e,t)=>P("svg",{...e,ref:t,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u("path",{d:"M7.03899 10.648H8.60499V14.293C8.60499 14.833 9.27099 15.085 9.63099 14.68L13.465 10.324C13.798 9.946 13.528 9.352 13.024 9.352H11.458V5.707C11.458 5.167 10.792 4.915 10.432 5.32L6.59799 9.676C6.26499 10.054 6.53499 10.648 7.03899 10.648Z",fill:"currentColor"}),u("path",{d:"M10 19C14.9706 19 19 14.9706 19 10C19 5.02944 14.9706 1 10 1C5.02944 1 1 5.02944 1 10C1 14.9706 5.02944 19 10 19Z",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})]})),Xi=p.forwardRef((e,t)=>P("svg",{...e,ref:t,width:"20",height:"19",viewBox:"0 0 20 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u("path",{d:"M3 4.21429L6 1L9 4.21429",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),u("path",{d:"M5.99963 1V11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),u("path",{d:"M16 7.78571L13 11L10 7.78571",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),u("path",{d:"M13.0004 11L13.0004 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),u("path",{d:"M1 16C6.835 18 13.165 18 19 16",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})),Zi=p.forwardRef((e,t)=>P("svg",{...e,ref:t,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u("path",{d:"M11 1H4C3.46957 1 2.96086 1.21071 2.58579 1.58579C2.21071 1.96086 2 2.46957 2 3V17C2 17.5304 2.21071 18.0391 2.58579 18.4142C2.96086 18.7893 3.46957 19 4 19H16C16.5304 19 17.0391 18.7893 17.4142 18.4142C17.7893 18.0391 18 17.5304 18 17V7L11 1Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),u("path",{d:"M11 1V7H18",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),u("path",{d:"M14 11H6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),u("path",{d:"M14 15H6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})),{is_fbdl_activated:qi}=window.fbv_admin,bn=[{hash:"/",icon:Ji,label:w("go_pro")},{hash:"settings",icon:Yi,label:w("settings")},{hash:"tools",icon:Xi,label:w("tools")},{hash:"import-export",icon:Qi,label:w("import_export")}];qi&&bn.push({hash:"document-library",icon:Zi,label:w("document_library")});const eo=()=>u("aside",{className:"fb-fixed fb-border-solid fb-border-0 fb-bottom-0 fb-left-0 fb-z-50 fb-w-full fb-h-16 fb-bg-white fb-border-gray-200 wp-md:fb-static wp-md:fb-max-w-64 wp-md:fb-h-auto wp-md:fb-pt-4 wp-md:fb-border-r wp-md:fb-border-[rgba(177,187,202,0.15)]","aria-label":"Sidebar",children:u("div",{className:"fb-overflow-y-auto fb-bg-white fb-h-full fb-shadow-[0px_-5px_20px_20px_rgba(0,0,0,0.031372549)] wp-md:fb-shadow-none wp-md:fb-h-auto",children:u("ul",{className:"fb-grid fb-m-0 fb-h-full fb-grid-cols-4 fb-mx-auto fb-font-medium wp-md:fb-block",children:bn.map(e=>u("li",{className:"fb-m-0 fb-flex wp-md:fb-mb-1",children:P(Mi,{to:e.hash,className:({isActive:t})=>Jt("fb-transition-shadow fb-duration-150 fb-ease-linear fb-inline-flex fb-flex-1 fb-outline-none fb-no-underline fb-text-teal-950 fb-flex-col fb-items-center fb-justify-center hover:fb-bg-gray-50 fb-group focus:fb-shadow-admin-mobile-menu focus:fb-bg-admin-light focus:fb-text-admin-primary wp-md:fb-flex-row wp-md:fb-justify-start wp-md:fb-py-3 wp-md:fb-px-5 wp-md:focus:fb-shadow-admin-menu",{"fb-shadow-admin-mobile-menu fb-bg-admin-light fb-text-admin-primary wp-md:fb-shadow-admin-menu":t}),children:[u(e.icon,{className:"fb-flex-shrink-0 fb-mb-2 fb-w-5 fb-h-5 fb-transition fb-duration-75 group-hover:fb-text-admin-primary wp-md:fb-mr-3 wp-md:fb-mb-0"}),u("span",{className:"fb-text-xs group-hover:fb-text-blue-600 wp-md:fb-text-base",children:e.label})]})},e.hash))})})}),to=()=>{const e=He();return p.useEffect(()=>{let t=e.pathname;e.pathname==="/"&&(t="/activation"),jQuery(".filebird-admin-menu-item").removeClass("selected"),jQuery(`.filebird-admin-menu-item:has(a[href*="${t}"])`).addClass("selected")},[e.pathname]),P(Se,{children:[u("div",{className:"wp-md:fb-max-w-[1060px] fb-m-auto",children:P("div",{className:"fb-flex fb-bg-white fb-rounded-xl wp-md:fb-min-h-[675px] fb-overflow-hidden",children:[u(eo,{}),u(ci,{})]})}),u(Vn,{containerStyle:{top:40}})]})},ro=()=>u("h3",{children:" There is not available"}),be=tr.div`fb-h-[1px] fb-w-full fb-bg-[#EEF3F9] fb-my-5 wp-md:fb-my-9`,{enabled_post_types:no}=window.fbv_admin,Vr=zn(Wn(e=>({postTypes:{enabledSlugs:no},setEnabledPostTypes:t=>e(r=>{r.postTypes.enabledSlugs=t})}))),{post_types:gn}=window.fbv_admin,ao=Object.keys(gn),io=p.forwardRef((e,t)=>{const r=Vr(o=>o.postTypes.enabledSlugs),n=Vr(o=>o.setEnabledPostTypes),a=o=>{const{value:i}=o.target,c=r.indexOf(i),s=[...r];c===-1?s.push(i):s.splice(c,1),n(s)};return u("div",{className:"fb-flex fb-flex-col fb-gap-3",children:ao.map(o=>P("div",{className:"fb-gap-3 fb-flex fb-items-center",children:[u("input",{className:"fb-m-0 fb-relative fb-border-admin-secondary fb-shadow-none checked:before:fb-content-checked-box checked:before:fb-w-3 checked:before:fb-h-2 checked:before:fb-float-none checked:before:fb-absolute checked:before:fb-transform-checked-box checked:before:fb-inset-0 checked:before:fb-m-auto checked:fb-border-admin-primary",defaultChecked:r.indexOf(o)!==-1,type:"checkbox",value:o,id:o,onChange:a,disabled:!0}),u("label",{htmlFor:o,children:gn[o]})]},o))})}),{asset_url:Kt,license:oo}=window.fbv_data,lo={default:{img:`${Kt}img/default.svg`,title:w("default"),needActive:!1},windows:{img:`${Kt}img/windows.svg`,title:"Windows",needActive:!0},dropbox:{img:`${Kt}img/dropbox.svg`,title:"Dropbox",needActive:!0}},so=qe.div`fb-flex fb-gap-[10px] fb-w-full`,zr=tr.img`hover:fb-border-admin-primary fb-flex-grow fb-flex-shrink-0 fb-basis-0 fb-p-[10px] fb-rounded fb-border fb-border-[#E1E9F4] fb-border-solid fb-duration-200 fb-transition-colors fb-ease-in-out`,co=()=>{const e=Xe(f=>f.settings),t=Xe(f=>f.setSettings),r=Xe(f=>f.updateSetting),[n,a]=p.useState(!1),o=p.useRef(null),[i,c]=p.useState(!1);return u(Se,{children:P(gt,{footer:u(pe,{disabled:n,className:n?"updating-message":"",onClick:async()=>{a(!0);try{await r(e)}catch(f){ne.error(w("set_setting_fail")),console.log({error:f})}finally{a(!1)}},children:w("save_changes")}),children:[u("h3",{className:"fb-mt-0 fb-p-0",children:w("general")}),P("div",{className:"fb-flex fb-flex-col fb-gap-[10px]",children:[P("div",{className:"fb-flex fb-gap-[10px]",children:[u(Qe,{checked:!!e.USER_MODE,onCheckedChange:f=>t("USER_MODE",f)}),P("span",{children:[w("each_user_has_own_folder"),"?"]})]}),P("div",{className:"fb-flex fb-gap-[10px]",children:[u(Qe,{checked:!!e.SHOW_BREAD_CRUMB,onCheckedChange:f=>t("SHOW_BREAD_CRUMB",f)}),u("span",{children:w("show_breadcrumb")})]}),P("div",{className:"fb-flex fb-gap-[10px]",children:[u(Qe,{checked:!!e.SVG_SUPPORT,onCheckedChange:f=>t("SVG_SUPPORT",f)}),u("span",{children:w("svg_upload_desc")})]}),P("div",{className:"fb-flex fb-gap-[10px] fb-items-center",children:[u(Qe,{checked:!!e.IS_SEARCH_USING_API,onCheckedChange:f=>t("IS_SEARCH_USING_API",f)}),u("span",{children:w("searching_folder_api")}),u(wr,{sideOffset:5,content:w("searching_folder_api"),children:()=>u("svg",{className:"fb-w-4 fb-h-4 fb-cursor-pointer",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:u("path",{d:"M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z"})})})]})]}),u(be,{}),u("h3",{children:w("folder_counter")}),P("div",{className:"fb-flex fb-flex-col fb-gap-[10px]",children:[P("div",{className:"fb-flex fb-gap-[10px] fb-items-center",children:[u("input",{className:"fb-m-0 fb-shadow-none checked:before:fb-bg-admin-primary checked:before:fb-content-[''] fb-border-admin-secondary checked:fb-border-admin-primary",id:"counter_file_in_folder",checked:e.FOLDER_COUNTER_TYPE=="counter_file_in_folder",type:"radio",name:"counter_type",onChange:()=>t("FOLDER_COUNTER_TYPE","counter_file_in_folder")}),u("label",{htmlFor:"counter_file_in_folder",children:w("count_in_folder")})]}),P("div",{className:"fb-flex fb-gap-[10px] fb-items-center",children:[u("input",{className:"fb-peer disabled:fb-cursor-not-allowed disabled:fb-opacity-50 fb-m-0 fb-shadow-none checked:before:fb-bg-admin-primary checked:before:fb-content-[''] fb-border-admin-secondary checked:fb-border-admin-primary",id:"counter_file_in_folder_and_sub",checked:e.FOLDER_COUNTER_TYPE=="counter_file_in_folder_and_sub",type:"radio",name:"counter_type",disabled:!0,onChange:()=>t("FOLDER_COUNTER_TYPE","counter_file_in_folder_and_sub")}),P("label",{className:"fb-flex fb-items-center peer-disabled:fb-cursor-not-allowed peer-disabled:fb-opacity-70",htmlFor:"counter_file_in_folder_and_sub",children:[w("count_nested")," ",u(Yt,{})]})]})]}),u(be,{}),u("h3",{children:w("select_theme")}),i&&u("div",{className:"fb-p-4 fb-mb-4 fb-text-sm fb-text-red-800 fb-rounded-lg fb-bg-red-50 ",role:"alert",children:u("span",{className:"fb-font-medium",children:w("active_to_use_feature")})}),u(so,{children:Object.entries(lo).map(([f,h])=>u(p.Fragment,{children:h.needActive&&!oo.status?u(wr,{sideOffset:5,content:w("active_to_update"),children:()=>P("div",{className:"fb-flex fb-flex-col fb-w-1/3 fb-cursor-pointer fb-text-center",onClick:()=>$n&&c(!0),children:[u(zr,{className:f===e.THEME.name&&"fb-border-admin-primary",src:h.img,alt:h.title}),u("span",{className:"fb-mt-3",children:h.title})]},f)}):P("div",{className:"fb-flex fb-flex-col fb-w-1/3 fb-cursor-pointer fb-text-center",onClick:()=>{t("THEME",{...e.THEME,name:f}),c(!1)},children:[u(zr,{className:f===e.THEME.name&&"fb-border-primary",src:h.img,alt:h.title}),u("span",{className:"fb-mt-3",children:h.title})]},f)},f))}),u(be,{}),P("div",{className:"fb-opacity-50 fb-cursor-not-allowed fb-pointer-events-none",children:[P("h3",{className:"fb-flex fb-items-center",children:[w("which_post_types_do_you_want")," ",u(Yt,{})]}),u(io,{ref:o}),u(be,{})]})]})})},{fbv_data:Nt}=window,Ut={async exportCSV(e=""){const t=e==""?"/export-csv":"/export-csv/?id="+e;return me("GET",t)},async importCSV(e){return jQuery.ajax({url:Nt.json_url+"/import-csv",beforeSend:()=>{},method:"POST",processData:!1,contentType:!1,cache:!1,data:e,headers:{"X-WP-Nonce":Nt.rest_nonce}})},async getCSVDetail(e){return jQuery.ajax({url:Nt.json_url+"/import-csv-detail",method:"POST",processData:!1,contentType:!1,beforeSend:function(t){t.setRequestHeader("X-WP-Nonce",Nt.rest_nonce)},data:e})},async importPlugin(e){try{return await me("GET",`/import/get-folders/${e}`),await me("GET",`/import/get-attachments/${e}`),await me("GET",`/import/run/${e}`)}catch(t){console.log({error:t})}}};function fo(e){const t=e.data;if(!t||!t.length)return;const r=e.columnDelimiter||",",n=e.lineDelimiter||` `,a=Object.keys(t[0]);let o="";return o+=a.join(r),o+=n,t.forEach(i=>{let c=0;a.forEach(s=>{c>0&&(o+=r),o+=i[s],c++}),o+=n}),o}const uo=e=>{const t=fo({data:e.data}),r=new Blob([t],{type:"text/csv;charset=utf-8;"});if(!t)return;const n=e.filename||"export.csv",a=document.createElement("a");a.setAttribute("href",URL.createObjectURL(r)),a.setAttribute("download",n),a.click()};async function ho(e){const t=new FormData;if(!e.length)return Promise.reject("There is no file!");if(e.length){t.append("file",e[0]);const r=await Ut.getCSVDetail(t);let n={"":"","-1":w("all_folders"),0:w("common_folders")};return Object.entries(r).length&&(n={...n,...r}),n}return null}const mo=()=>{const[e,t]=p.useState(!1),[r,n]=p.useState(!1),[a,o]=p.useState(""),[i,c]=p.useState(!1),[s,f]=p.useState(null),h=p.useRef(new FormData),b=async()=>{t(!0);const x=document.querySelector("#filebird-export-btn").getAttribute("data-id");await ne.promise(Ut.exportCSV(x),{loading:w("loading"),success:k=>(t(!1),k.folders.length?(v(k.folders),w("successfully_exported")):w("no_folders_export")),error:()=>w("please_try_again")})},v=x=>{uo({filename:"filebird.csv",data:x})},_=async x=>{const k=x.target.files,L=await ho(k);f(L),k.length&&h.current.append("file",k[0])},S=x=>{const k=x.target.value;h.current.append("userId",k),o(k?k==="-1"?w("all_folders_description"):k==="0"?w("common_folders_description"):`${w("user_folders_description")} ${x.target.options[x.target.selectedIndex].text}.`:"")},E=async()=>{n(!0);try{const x=await Ut.importCSV(h.current);if(n(!1),x.success)c(!0),ne.success(w("successfully_imported"));else{if(x.message){ne.error(x.message);return}ne.error(w("please_try_again"))}}catch{n(!1),ne.error(w("please_try_again"))}};return P(Se,{children:[u("h2",{children:w("folders_for_media_library")}),P("div",{className:"fb-flex fb-flex-col wp-md:fb-flex-row wp-md:fb-items-center fb-justify-between fb-mb-5 wp-md:fb-mb-9",children:[P("div",{className:"fb-mb-4 wp-md:fb-mb-0",children:[u("h4",{className:"fb-mt-0 fb-mb-4 fb-p-0",children:w("export_csv")}),u("p",{className:"description wp-md:fb-m-0",children:w("export_csv_desc")})]}),u(pe,{disabled:e,className:ue("wp-md:fb-ml-0 fb-ml-auto",{"updating-message":e}),onClick:()=>b(),id:"filebird-export-btn","data-id":"",children:w("export_csv_now")})]}),u("h4",{className:"fb-mt-0 fb-mb-4 fb-p-0",children:w("import_csv")}),u("div",{className:"flex-item-center",children:u("input",{className:"fb-max-w-80",type:"file",accept:".csv",name:"csv_file",onChange:_})}),s&&P("p",{className:ue({hidden:!s}),children:[u("span",{children:w("choose_user_folder")})," ",u("select",{onChange:S,children:Object.entries(s).sort().map(([x,k])=>u("option",{value:x,children:k},x))})," ",u("button",{disabled:!a||r||i,className:ue("button button-large",{hidden:!s,"updating-message":r}),type:"button",onClick:E,children:i?w("imported"):w("update_noti_btn")})]}),u("p",{children:a}),u("p",{className:"description",children:u("span",{className:"[&_a]:fb-text-admin-primary",dangerouslySetInnerHTML:{__html:w("import_csv_desc")}})})]})},po=()=>{const e={folders:14,items:2};return P(Se,{children:[P("div",{className:"fb-inline-block fb-bg-gray-200 fb-mr-2 fb-rounded-full fb-px-2 fb-py-1",children:[e.folders," folders"]}),P("div",{className:"fb-bg-gray-200 fb-inline-block fb-rounded-full fb-px-2 fb-py-1",children:[e.items," items"]})]})},Wr=[],bo={wf:{name:"Wicked Folders",author:"Wicked Plugins"},premio:{name:"Folders",author:"Premio"}},go=()=>P("div",{className:"fb-opacity-50 fb-cursor-not-allowed fb-pointer-events-none",children:[P("h2",{children:[w("folders_for_post_types")," ",u(Yt,{})]}),Object.entries(bo).map(([e,t])=>u("ul",{children:P("li",{className:"fb-bg-[#f6f7f7] fb-flex fb-items-center fb-p-3 fb-rounded-md fb-flex-wrap",children:[P("div",{className:"fb-w-1/2 wp-md:fb-w-1/3 wp-md:fb-mb-0 fb-mb-2",children:[u("h3",{className:"fb-mt-0 fb-mb-2",children:t.name}),P("p",{className:"fb-m-0 fb-font-medium description",children:[w("by")," (",t.author,")"]})]}),u("div",{className:"fb-w-1/2 wp-md:fb-w-1/3 wp-md:fb-text-center fb-text-right",children:u(po,{})}),u("div",{className:"wp-md:fb-w-1/3 fb-w-full",children:u(pe,{onClick:r=>{r.preventDefault(),r.stopPropagation()},tabIndex:-1,disabled:Wr.includes(e),className:ue("fb-ml-auto"),children:Wr.includes(e)?w("imported"):w("import")})})]})},e))]}),{data_import:vo}=window.fbv_data,yo=()=>{const[e,t]=p.useState(vo.plugins),[r,n]=p.useState(!1),[a,o]=p.useState(""),i=async c=>{n(!0),o(c);try{const s=await Ut.importPlugin(c),f={...e},h='<div class="njt-success-notice notice notice-success is-dismissible"><p>'+s.mess+`</p><button type="button" class="notice-dismiss" onClick="jQuery('.njt-success-notice').remove()"><span class="screen-reader-text">Dismiss this notice.</span></button></div>`;jQuery(".wrap").prepend(h),n(!1),o(""),f[c].completed=!0,t(f)}catch(s){console.log({error:s}),ne.error(w("please_try_again")),n(!1),o("")}};return P(Se,{children:[u("h3",{className:"fb-mt-0 fb-mb-4 fb-p-0",children:w("import")}),u("p",{className:"description fb-mb-4",children:w("import_folders_desc")}),!!Object.keys(e).length&&u("table",{className:"widefat striped fb-rounded-xl fb-overflow-hidden fb-shadow-none fb-border-[#EEF3F9]",children:u("tbody",{children:Object.values(e).map(c=>P("tr",{className:"importer-item",children:[P("td",{className:"import-system fb-block fb-p-3 wp-md:fb-table-cell wp-md:fb-p-6",children:[u("span",{className:"importer-title",children:u("b",{children:c.name})}),P("span",{children:[w("by")," (",c.author,")"]})]}),P("td",{className:"desc fb-block fb-p-3 wp-md:fb-p-5 wp-md:fb-table-cell",children:[u("span",{className:"importer-desc wp-md:fb-table-cell fb-mb-5 wp-md:fb-mb-5",dangerouslySetInnerHTML:{__html:c.description}}),u("span",{className:"importer-action fb-m-0 wp-md:fb-mt-4",children:u(pe,{$secondary:!0,onClick:()=>i(c.prefix),className:ue("fb-m-0 fb-ml-auto wp-md:fb-ml-0",{"updating-message":c.prefix===a&&r}),disabled:r&&c.prefix===a||c.completed,children:c.completed?w("imported"):w("update_noti_btn")})})]})]},c.prefix))})})]})},wo=()=>P(gt,{children:[u(yo,{}),u(be,{}),u(mo,{}),u(be,{}),u(go,{})]}),Ye={cleanData(){return me("GET","/wipe-data")},async generateApi(){return me("POST","/fbv-api",{act:"generate-key"})},async wipeData(){return me("POST","/fb-wipe-clear-all-data")},async getOldFolders(){return me("POST","/fb-get-old-data")},async insertOldFolders(e){return me("POST","/fb-insert-old-data",e)},async generateAttachmentSize(e){return me("POST","/generate-attachment-size",e)},async syncWPML(e){return Gn("POST",e)}},{update_database_notice:xo}=window.fbv_data,{rest_api_key:_o}=window.fbv_admin,{media_url:Co}=window.fbv_data,{wpml:So}=window.fbv_admin,ct=qe.div`fb-flex fb-flex-col wp-md:fb-flex-row wp-md:fb-items-center fb-justify-between wp-md:fb-gap-10`,dt=qe.h3`fb-mt-0 fb-mb-4 fb-p-0`,Tt=qe.p`wp-md:fb-m-0`,Eo=()=>{const[e,t]=p.useState(!1),[r,n]=p.useState(!1),[a,o]=p.useState(_o),[i,c]=p.useState(!1),[s,f]=p.useState(!1),[h,b]=p.useState(!1),[v,_]=p.useState(""),[S]=ji(),E=p.useRef(!1),x=!!S.get("autorun")&&xo,k=()=>{if(!confirm(w("are_you_sure")))return!1;t(!0),ne.promise(Ye.generateApi(),{loading:w("generating"),success:R=>(t(!1),R.success&&o(R.data.key),w("generated")),error:R=>(t(!1),R.responseJSON.message)})},L=async()=>{if(!confirm(w("are_you_sure")))return!1;n(!0),ne.promise(Ye.wipeData(),{loading:w("loading"),success:R=>(n(!1),location.reload(),R.data.mess),error:R=>(n(!1),R.data.mess)})},U=async(R,H)=>{if(typeof R[H]<"u")try{await Ye.insertOldFolders({folders:R[H]}),await U(R,H+1)}catch{E.current=!0,ne.error(w("please_try_again"))}else c(!1)},B=async()=>{E.current=!1;try{c(!0);const R=await Ye.getOldFolders();if(R.success)try{if(await U(R.data.folders,0),c(!1),E.current)return;ne.success(P("span",{children:[w("filebird_db_updated")," ",u("a",{href:Co,children:w("go_to_media")})]}),{style:{minWidth:"365px"}}),jQuery("#njt-fb-update-db-noti .notice-dismiss").trigger("click")}catch(H){console.log({err:H}),c(!1)}}catch{c(!1),ne.error(w("import_failed"))}},K=async()=>{f(!0);try{await ie(1),ne.success(w("generated")),f(!1)}catch{ne.error(w("please_try_again")),f(!1)}},ie=async R=>{try{const H=await Ye.generateAttachmentSize({page:R});H.success&&H.next=="1"&&await ie(R+1)}catch{ne.error(w("please_try_again"))}},g=async()=>{b(!0);try{const R=await Ye.syncWPML({action:"fbv_sync_wpml"});_(R.message),b(!1)}catch{b(!1)}};return p.useEffect(()=>{x&&B()},[x]),P(gt,{children:[P(ct,{children:[P("div",{className:"fb-flex-1",children:[u(dt,{children:w("import_from_old_version")}),u(Tt,{children:w("update_old_folder_desc")})]}),u(pe,{disabled:i,className:ue("fb-ml-auto wp-md:fb-w-0",{"updating-message":i}),onClick:()=>B(),children:w("update")})]}),u(be,{}),P(ct,{children:[P("div",{className:"fb-flex-1",children:[u(dt,{children:w("rest_api_key")}),u("p",{dangerouslySetInnerHTML:{__html:w("generate_api_desc")}}),u("input",{className:ue({hidden:!a,"large-text":!0}),readOnly:!0,value:a,type:"text",autoComplete:"off"})]}),u(pe,{className:ue("fb-ml-auto fb-mt-4 wp-md:fb-w-0 wp-md:fb-m-0",{"updating-message":e}),disabled:e,onClick:k,children:w("generate")})]}),u(be,{}),P(ct,{children:[P("div",{className:"fb-flex-1",children:[u(dt,{children:w("attachment_size")}),u(Tt,{dangerouslySetInnerHTML:{__html:w("generate_attachment_size_desc")}})]}),u(pe,{className:ue("fb-ml-auto wp-md:fb-w-0",{"updating-message":s}),disabled:s,onClick:K,children:s?w("generating"):w("generate")})]}),u(be,{}),So.display_sync&&P(Se,{children:[P(ct,{children:[P("div",{className:"fb-flex-1",children:[u(dt,{children:w("sync_wpml")}),u(Tt,{dangerouslySetInnerHTML:{__html:w("sync_wpml_desc")}})]}),u(pe,{className:ue("fb-ml-auto wp-md:fb-w-0",{"updating-message":h}),disabled:h||!!v,onClick:g,type:"button",children:v||w("sync")})]}),u(be,{})]}),P(ct,{children:[P("div",{className:"fb-flex-1",children:[u(dt,{children:w("clear_all_data")}),u(Tt,{dangerouslySetInnerHTML:{__html:w("clear_all_data_desc")}})]}),u(pe,{className:ue("fb-ml-auto wp-md:fb-w-0",{"updating-message":r}),$danger:!0,disabled:r,onClick:L,children:w("clear")})]})]})},Ro=vi([{path:"/",element:u(to,{}),errorElement:u(ro,{}),children:[{index:!0,element:u(Hr,{})},{path:"activation",element:u(Hr,{})},{path:":tools",element:u(Eo,{})},{path:"import-export",element:u(wo,{})},{path:"settings",element:u(co,{})},{path:"document-library",element:u(Ki,{})}]}]);document.addEventListener("DOMContentLoaded",()=>{Kn();const e=document.getElementById("filebird-setting");e&&Jn.createRoot(e).render(u(Yn.StrictMode,{children:u(Ri,{router:Ro})}))});