@refinedev/core 4.36.1 → 4.36.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/iife/index.js +1 -1
- package/dist/iife/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @refinedev/core
|
|
2
2
|
|
|
3
|
+
## 4.36.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#4896](https://github.com/refinedev/refine/pull/4896) [`daabcd666be`](https://github.com/refinedev/refine/commit/daabcd666be13119a482a39874844a94a1e7bd13) Thanks [@aliemir](https://github.com/aliemir)! - `useInvalidate` now returns a promise that resolves when the invalidation is completed.
|
|
8
|
+
|
|
9
|
+
- [#4896](https://github.com/refinedev/refine/pull/4896) [`daabcd666be`](https://github.com/refinedev/refine/commit/daabcd666be13119a482a39874844a94a1e7bd13) Thanks [@aliemir](https://github.com/aliemir)! - Fine-tuning the invalidation process by setting up additional filters and options for the invalidation.
|
|
10
|
+
|
|
11
|
+
Now after a successful mutation, refine will invalidate all the queries in the scope but trigger a refetch only for the active queries. If there are any ongoing queries, they will be kept as they are.
|
|
12
|
+
|
|
13
|
+
After receiving a realtime subscription event, refine will invalidate and refetch only the active queries.
|
|
14
|
+
|
|
3
15
|
## 4.36.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/esm/index.js
CHANGED
|
@@ -8,7 +8,7 @@ See https://refine.dev/docs/api-reference/core/hooks/useForm/#resource`);let z=F
|
|
|
8
8
|
If you don't use the \`setShowId\` method to set the \`showId\`, you should pass the \`id\` prop to \`useShow\`. Otherwise, \`useShow\` will not be able to infer the \`id\` from the current URL.
|
|
9
9
|
|
|
10
10
|
See https://refine.dev/docs/api-reference/core/hooks/show/useShow/#resource`);let x=Kt({resource:g,id:h??"",queryOptions:{enabled:h!==void 0,...u},successNotification:r,errorNotification:o,meta:w,metaData:w,liveMode:n,onLiveEvent:i,dataProviderName:c}),{elapsedTime:d}=J({isLoading:x.isFetching,interval:p==null?void 0:p.interval,onInterval:p==null?void 0:p.onInterval});return{queryResult:x,showId:h,setShowId:D,overtime:{elapsedTime:d}}};import{useEffect as Wa,useState as oo}from"react";import{parse as Ga}from"papaparse";import za from"lodash-es/chunk";var $T=({resourceName:e,resource:t,mapData:r=p=>p,paparseOptions:o,batchSize:s=Number.MAX_SAFE_INTEGER,onFinish:a,meta:n,metaData:i,onProgress:c,dataProviderName:u}={})=>{let[p,l]=oo(0),[y,g]=oo(0),[P,v]=oo(!1),{resource:M,identifier:m}=B(t??e),h=_(),D=qr(),w=Ht(),x=h({resource:M,meta:I(n,i)}),d;s===1?d=w:d=D;let f=()=>{g(0),l(0),v(!1)},C=R=>{let L={succeeded:R.filter(b=>b.type==="success"),errored:R.filter(b=>b.type==="error")};a==null||a(L),v(!1)};Wa(()=>{c==null||c({totalAmount:y,processedAmount:p})},[y,p]);let T=({file:R})=>(f(),new Promise(L=>{v(!0),Ga(R,{complete:async({data:b})=>{let E=qt(b,r);if(g(E.length),s===1){let F=E.map(A=>async()=>({response:await w.mutateAsync({resource:m??"",values:A,successNotification:!1,errorNotification:!1,dataProviderName:u,meta:x,metaData:x}),value:A})),U=await rr(F,({response:A,value:S})=>(l(k=>k+1),{response:[A.data],type:"success",request:[S]}),(A,S)=>({response:[A],type:"error",request:[E[S]]}));L(U)}else{let F=za(E,s),U=F.map(S=>async()=>({response:await D.mutateAsync({resource:m??"",values:S,successNotification:!1,errorNotification:!1,dataProviderName:u,meta:x,metaData:x}),value:S,currentBatchLength:S.length})),A=await rr(U,({response:S,currentBatchLength:k,value:V})=>(l(Q=>Q+k),{response:S.data,type:"success",request:V}),(S,k)=>({response:[S],type:"error",request:F[k]}));L(A)}},...o})}).then(L=>(C(L),L)));return{inputProps:{type:"file",accept:".csv",onChange:R=>{R.target.files&&R.target.files.length>0&&T({file:R.target.files[0]})}},mutationResult:d,isLoading:P,handleChange:T}};import{useCallback as Rs,useState as ja}from"react";var zT=({defaultVisible:e=!1}={})=>{let[t,r]=ja(e),o=Rs(()=>r(!0),[t]),s=Rs(()=>r(!1),[t]);return{visible:t,show:o,close:s}};import _a from"react";var Wt=()=>{let e=Z(),{resource:t,resources:r}=B(),o=le();return _a.useCallback(({resource:a,action:n,meta:i})=>{var y;let c=a||t;if(!c)return;let p=(y=ge(c,r,e==="legacy").find(g=>g.action===n))==null?void 0:y.route;return p?be(p,c==null?void 0:c.meta,o,i):void 0},[r,t,o])};var Za=({resource:e,action:t,meta:r,legacy:o})=>Wt()({resource:e,action:t,meta:r,legacy:o});import Ya,{useContext as Ja}from"react";var ct=()=>{let e=Ja(Xe);return e!=null&&e.Link?e.Link:({to:r,...o})=>Ya.createElement("a",{href:r,...o})};import{useContext as qa}from"react";import Ps from"react";var qe={useHistory:()=>!1,useLocation:()=>!1,useParams:()=>({}),Prompt:()=>null,Link:()=>null},Xa=Ps.createContext(qe),Gt=Xa,xs=({children:e,useHistory:t,useLocation:r,useParams:o,Prompt:s,Link:a,routes:n})=>Ps.createElement(Gt.Provider,{value:{useHistory:t??qe.useHistory,useLocation:r??qe.useLocation,useParams:o??qe.useParams,Prompt:s??qe.Prompt,Link:a??qe.Link,routes:n??qe.routes}},e);var oe=()=>{let e=qa(Gt),{useHistory:t,useLocation:r,useParams:o,Prompt:s,Link:a,routes:n}=e??qe;return{useHistory:t,useLocation:r,useParams:o,Prompt:s,Link:a,routes:n}};import{useQuery as ei}from"@tanstack/react-query";import{useContext as ti}from"react";import Cs from"react";var ot=Cs.createContext({options:{buttons:{enableAccessControl:!0,hideIfUnauthorized:!1}}});var hs=({can:e,children:t,options:r})=>Cs.createElement(ot.Provider,{value:{can:e,options:r?{...r,buttons:{enableAccessControl:!0,hideIfUnauthorized:!1,...r.buttons}}:{buttons:{enableAccessControl:!0,hideIfUnauthorized:!1}}}},t);var ht=e=>{if(!e)return;let{icon:t,list:r,edit:o,create:s,show:a,clone:n,children:i,meta:c,options:u,...p}=e,{icon:l,...y}=c??{},{icon:g,...P}=u??{};return{...p,...c?{meta:y}:{},...u?{options:P}:{}}};var bs=({action:e,resource:t,params:r,queryOptions:o})=>{let{can:s}=ti(ot),{keys:a,preferLegacyKeys:n}=O(),{resource:i,...c}=r??{},u=ht(i),p=ei(a().access().resource(t).action(e).params({params:{...c,resource:u},enabled:o==null?void 0:o.enabled}).get(n),()=>(s==null?void 0:s({action:e,resource:t,params:{...c,resource:u}}))??Promise.resolve({can:!0}),{enabled:typeof s<"u",...o,retry:!1});return typeof s>"u"?{data:{can:!0}}:p};import vs from"react";var AR=()=>{let{can:e}=vs.useContext(ot);return{can:vs.useMemo(()=>e?async({params:o,...s})=>{let a=o!=null&&o.resource?ht(o.resource):void 0;return e({...s,...o?{params:{...o,resource:a}}:{}})}:void 0,[e])}};import{useCallback as Ds,useMemo as ri,useState as so}from"react";import oi from"lodash/uniqBy";import si from"lodash/debounce";import Rr from"lodash/get";var GR=e=>{let[t,r]=so([]),[o,s]=so([]),[a,n]=so([]),{resource:i,sort:c,sorters:u,filters:p=[],optionLabel:l="title",optionValue:y="id",debounce:g=300,successNotification:P,errorNotification:v,defaultValueQueryOptions:M,queryOptions:m,fetchSize:h,pagination:D,hasPagination:w=!1,liveMode:x,defaultValue:d=[],onLiveEvent:f,onSearch:C,liveParams:T,meta:R,metaData:L,dataProviderName:b,overtimeOptions:E}=e,{resource:F,identifier:U}=B(i),S=_()({resource:F,meta:I(R,L)}),k=Array.isArray(d)?d:[d],V=Ds(K=>{n(K.data.map(z=>({label:Rr(z,l),value:Rr(z,y)})))},[l,y]),Q=M??m,H=Zr({resource:U,ids:k,queryOptions:{...Q,enabled:k.length>0&&((Q==null?void 0:Q.enabled)??!0),onSuccess:K=>{var z;V(K),(z=Q==null?void 0:Q.onSuccess)==null||z.call(Q,K)}},meta:S,metaData:S,liveMode:"off",dataProviderName:b}),Y=Ds(K=>{s(K.data.map(z=>({label:Rr(z,l),value:Rr(z,y)})))},[l,y]),X=Nt({resource:U,sorters:I(u,c),filters:p.concat(t),pagination:{current:D==null?void 0:D.current,pageSize:(D==null?void 0:D.pageSize)??h,mode:D==null?void 0:D.mode},hasPagination:w,queryOptions:{...m,onSuccess:K=>{var z;Y(K),(z=m==null?void 0:m.onSuccess)==null||z.call(m,K)}},successNotification:P,errorNotification:v,meta:S,metaData:S,liveMode:x,liveParams:T,onLiveEvent:f,dataProviderName:b}),N=K=>{if(C){r(C(K));return}if(K)r([{field:l,operator:"contains",value:K}]);else{r([]);return}},{elapsedTime:$}=J({isLoading:X.isFetching||H.isFetching,interval:E==null?void 0:E.interval,onInterval:E==null?void 0:E.onInterval});return{queryResult:X,defaultValueQueryResult:H,options:ri(()=>oi([...o,...a],"value"),[o,a]),onSearch:si(N,g),overtime:{elapsedTime:$}}};import ni,{useState as Pr,useEffect as Ls}from"react";import Es from"qs";import xr from"lodash/differenceWith";import Cr from"lodash/isEqual";import ai from"warn-once";var Us=[],Ms=[];function nP({initialCurrent:e,initialPageSize:t,hasPagination:r=!0,pagination:o,initialSorter:s,permanentSorter:a=Ms,defaultSetFilterBehavior:n,initialFilter:i,permanentFilter:c=Us,filters:u,sorters:p,syncWithLocation:l,resource:y,successNotification:g,errorNotification:P,queryOptions:v,liveMode:M,onLiveEvent:m,liveParams:h,meta:D,metaData:w,dataProviderName:x,overtimeOptions:d}={}){var po,lo,mo,fo,yo;let{syncWithLocation:f}=Vr(),C=l??f,T=ms(M),R=Z(),{useLocation:L}=oe(),{search:b,pathname:E}=L(),F=_(),U=le(),A=((u==null?void 0:u.mode)||"server")==="server",S=((p==null?void 0:p.mode)||"server")==="server",k=r===!1?"off":"server",V=((o==null?void 0:o.mode)??k)!=="off",Q=I(o==null?void 0:o.current,e),H=I(o==null?void 0:o.pageSize,t),Y=I(D,w),{parsedCurrent:X,parsedPageSize:N,parsedSorter:$,parsedFilters:K}=ur(b??"?"),z=I(u==null?void 0:u.initial,i),fe=I(u==null?void 0:u.permanent,c)??Us,ve=I(p==null?void 0:p.initial,s),Ve=I(p==null?void 0:p.permanent,a)??Ms,jt=I(u==null?void 0:u.defaultBehavior,n)??"merge",lt,mt,st,ft;C?(lt=((po=U==null?void 0:U.params)==null?void 0:po.current)||X||Q||1,mt=((lo=U==null?void 0:U.params)==null?void 0:lo.pageSize)||N||H||10,st=((mo=U==null?void 0:U.params)==null?void 0:mo.sorters)||($.length?$:ve),ft=((fo=U==null?void 0:U.params)==null?void 0:fo.filters)||(K.length?K:z)):(lt=Q||1,mt=H||10,st=ve,ft=z);let{replace:Et}=ue(),nt=pe(),{resource:_t,identifier:at}=B(y),Zt=F({resource:_t,meta:Y});ni.useEffect(()=>{ai(typeof at>"u","useTable: `resource` is not defined.")},[at]);let[ze,Yt]=Pr(lr(Ve,st??[])),[yt,Ut]=Pr(dr(fe,ft??[])),[gt,Mt]=Pr(lt),[je,de]=Pr(mt),He=({pagination:{current:ye,pageSize:Se},sorter:Jt,filters:Xt})=>{if(R==="new")return nt({type:"path",options:{keepHash:!0,keepQuery:!0},query:{...V?{current:ye,pageSize:Se}:{},sorters:Jt,filters:Xt,...De()}})??"";{let wt=Es.parse(b==null?void 0:b.substring(1)),Xs=cr({pagination:{pageSize:Se,current:ye},sorters:ze??Jt,filters:Xt,...wt});return`${E??""}?${Xs??""}`}};Ls(()=>{b===""&&(Mt(lt),de(mt),Yt(lr(Ve,st??[])),Ut(dr(fe,ft??[])))},[b]);let De=()=>{if(R==="new"){let{sorters:ye,filters:Se,pageSize:Jt,current:Xt,...wt}=(U==null?void 0:U.params)??{};return wt}else{let{sorter:ye,filters:Se,pageSize:Jt,current:Xt,...wt}=Es.parse(b,{ignoreQueryPrefix:!0});return wt}};Ls(()=>{if(C){let ye=De();if(R==="new")nt({type:"replace",options:{keepQuery:!0},query:{...V?{pageSize:je,current:gt}:{},sorters:xr(ze,Ve,Cr),filters:xr(yt,fe,Cr)}});else{let Se=cr({...V?{pagination:{pageSize:je,current:gt}}:{},sorters:xr(ze,Ve,Cr),filters:xr(yt,fe,Cr),...ye});return Et==null?void 0:Et(`${E}?${Se}`,void 0,{shallow:!0})}}},[C,gt,je,ze,yt]);let Oe=Nt({resource:at,hasPagination:r,pagination:{current:gt,pageSize:je,mode:o==null?void 0:o.mode},filters:A?xt(fe,yt):void 0,sorters:S?pr(Ve,ze):void 0,queryOptions:v,successNotification:g,errorNotification:P,meta:Zt,metaData:Zt,liveMode:T,liveParams:h,onLiveEvent:m,dataProviderName:x}),xe=ye=>{Ut(Se=>xt(fe,ye,Se))},et=ye=>{Ut(xt(fe,ye))},it=ye=>{Ut(Se=>xt(fe,ye(Se)))},ut=(ye,Se=jt)=>{typeof ye=="function"?it(ye):Se==="replace"?et(ye):xe(ye)},It=ye=>{Yt(()=>pr(Ve,ye))},{elapsedTime:Js}=J({isLoading:Oe.isFetching,interval:d==null?void 0:d.interval,onInterval:d==null?void 0:d.onInterval});return{tableQueryResult:Oe,sorters:ze,setSorters:It,sorter:ze,setSorter:It,filters:yt,setFilters:ut,current:gt,setCurrent:Mt,pageSize:je,setPageSize:de,pageCount:je?Math.ceil((((yo=Oe.data)==null?void 0:yo.total)??0)/je):1,createLinkForSyncWithLocation:He,overtime:{elapsedTime:Js}}}import{useContext as Ss}from"react";import{useMutation as As,useQueryClient as ii}from"@tanstack/react-query";import Is from"react";var pt=Is.createContext({}),ws=({create:e,get:t,update:r,children:o})=>Is.createElement(pt.Provider,{value:{create:e,get:t,update:r}},o);var ke=({logMutationOptions:e,renameMutationOptions:t}={})=>{let r=ii(),o=Ss(pt),{keys:s,preferLegacyKeys:a}=O(),n=j(),{resources:i}=Ss(rt),{data:c,refetch:u,isLoading:p}=Nr({v3LegacyAuthProviderCompatible:!!(n!=null&&n.isLegacy),queryOptions:{enabled:!!o}}),l=As(async g=>{var m,h,D,w,x;let P=ce(g.resource,i),v=I((m=P==null?void 0:P.meta)==null?void 0:m.audit,(h=P==null?void 0:P.options)==null?void 0:h.audit,(w=(D=P==null?void 0:P.options)==null?void 0:D.auditLog)==null?void 0:w.permissions);if(v&&!wr(v,g.action))return;let M;return p&&(M=await u()),await((x=o.create)==null?void 0:x.call(o,{...g,author:c??(M==null?void 0:M.data)}))},{mutationKey:s().audit().action("log").get(),...e}),y=As(async g=>{var P;return await((P=o.update)==null?void 0:P.call(o,g))},{onSuccess:g=>{g!=null&&g.resource&&r.invalidateQueries(s().audit().resource((g==null?void 0:g.resource)??"").action("list").get(a))},mutationKey:s().audit().action("rename").get(),...t});return{log:l,rename:y}};import{useContext as ui}from"react";import{useQuery as ci}from"@tanstack/react-query";var EP=({resource:e,action:t,meta:r,author:o,metaData:s,queryOptions:a})=>{let{get:n}=ui(pt),{keys:i,preferLegacyKeys:c}=O();return ci(i().audit().resource(e).action("list").params(r).get(c),()=>(n==null?void 0:n({resource:e,action:t,author:o,meta:r,metaData:s}))??Promise.resolve([]),{enabled:typeof n<"u",...a,retry:!1})};import{useContext as pi}from"react";import di from"warn-once";var KP=({meta:e={}}={})=>{let t=Z(),{i18nProvider:r}=pi(Fe),o=le(),s=G(),{resources:a,resource:n,action:i}=B(),{options:{textTransformers:c}}=te(),u=[];if(!(n!=null&&n.name))return{breadcrumbs:u};let p=l=>{var g,P,v,M,m,h;let y=typeof l=="string"?ce(l,a,t==="legacy")??{name:l}:l;if(y){let D=I((g=y==null?void 0:y.meta)==null?void 0:g.parent,y==null?void 0:y.parentName);D&&p(D);let w=ge(y,a,t==="legacy").find(f=>f.action==="list"),x=(P=w==null?void 0:w.resource)!=null&&P.list?w==null?void 0:w.route:void 0,d=x?t==="legacy"?x:be(x,y==null?void 0:y.meta,o,e):void 0;u.push({label:I((v=y.meta)==null?void 0:v.label,(M=y.options)==null?void 0:M.label)??s(`${y.name}.${y.name}`,c.humanize(y.name)),href:d,icon:I((m=y.meta)==null?void 0:m.icon,(h=y.options)==null?void 0:h.icon,y.icon)})}};if(p(n),i&&i!=="list"){let l=`actions.${i}`,y=s(l);typeof r<"u"&&y===l?(di(!0,`[useBreadcrumb]: Breadcrumb missing translate key for the "${i}" action. Please add "actions.${i}" key to your translation file.
|
|
11
|
-
For more information, see https://refine.dev/docs/api-reference/core/hooks/useBreadcrumb/#i18n-support`),u.push({label:s(`buttons.${i}`,c.humanize(i))})):u.push({label:s(l,c.humanize(i))})}return{breadcrumbs:u}};import no from"react";var bt=(e,t,r=!1)=>{let o=[],s=Ie(e,t);for(;s;)o.push(s),s=Ie(s,t);return o.reverse(),`/${[...o,e].map(n=>Re((r?n.route:void 0)??n.identifier??n.name)).join("/").replace(/^\//,"")}`};var ks=(e,t=!1)=>{let r={item:{name:"__root__"},children:{}};e.forEach(s=>{let a=[],n=Ie(s,e);for(;n;)a.push(n),n=Ie(n,e);a.reverse();let i=r;a.forEach(u=>{let p=(t?u.route:void 0)??u.identifier??u.name;i.children[p]||(i.children[p]={item:u,children:{}}),i=i.children[p]});let c=(t?s.route:void 0)??s.identifier??s.name;i.children[c]||(i.children[c]={item:s,children:{}})});let o=s=>{let a=[];return Object.keys(s.children).forEach(n=>{let i=bt(s.children[n].item,e,t),c={...s.children[n].item,key:i,children:o(s.children[n])};a.push(c)}),a};return o(r)};var Fs=e=>e.split("?")[0].split("#")[0].replace(/(.+)(\/$)/,"$1"),li=({meta:e,hideOnMissingParameter:t}={hideOnMissingParameter:!0})=>{let r=G(),o=Wt(),s=Z(),{resource:a,resources:n}=B(),{pathname:i}=le(),{useLocation:c}=oe(),{pathname:u}=c(),p=Pt(),y=`/${((s==="legacy"?Fs(u):i?Fs(i):void 0)??"").replace(/^\//,"")}`,g=a?bt(a,n,s==="legacy"):y??"",P=no.useMemo(()=>{if(!a)return[];let m=Ie(a,n),h=[bt(a,n)];for(;m;)h.push(bt(m,n)),m=Ie(m,n);return h},[]),v=no.useCallback(m=>{var D,w,x,d,f,C;if((((D=m==null?void 0:m.meta)==null?void 0:D.hide)??((w=m==null?void 0:m.options)==null?void 0:w.hide))||!(m!=null&&m.list)&&m.children.length===0)return;let h=m.list?o({resource:m,action:"list",legacy:s==="legacy",meta:e}):void 0;if(!(t&&h&&h.match(/(\/|^):(.+?)(\/|$){1}/)))return{...m,route:h,icon:I((x=m.meta)==null?void 0:x.icon,(d=m.options)==null?void 0:d.icon,m.icon),label:I((f=m==null?void 0:m.meta)==null?void 0:f.label,(C=m==null?void 0:m.options)==null?void 0:C.label)??r(`${m.name}.${m.name}`,p(m.name,"plural"))}},[s,e,r,t]),M=no.useMemo(()=>{let m=ks(n,s==="legacy"),h=D=>D.flatMap(w=>{let x=h(w.children),d=v({...w,children:x});return d?[d]:[]});return h(m)},[n,s,v]);return{defaultOpenKeys:P,selectedKey:g,menuItems:M}};var _=()=>{let{params:e}=le();return({resource:r,meta:o}={})=>{let{meta:s}=ht(r)??{meta:{}},{filters:a,sorters:n,current:i,pageSize:c,...u}=e??{};return{...s,...u,...o}}};var yi=()=>{let[e,t]=fi(),r=G(),{push:o}=ue(),s=pe(),a=Z(),{resource:n,action:i}=B();return mi(()=>{n&&i&&t(r("pages.error.info",{action:i,resource:n.name},`You may have forgotten to add the "${i}" component to "${n.name}" resource.`))},[n,i]),zt.createElement(zt.Fragment,null,zt.createElement("h1",null,r("pages.error.404",void 0,"Sorry, the page you visited does not exist.")),e&&zt.createElement("p",null,e),zt.createElement("button",{onClick:()=>{a==="legacy"?o("/"):s({to:"/"})}},r("pages.error.backHome",void 0,"Back Home")))};import Pe,{useState as Qs}from"react";var Ar=()=>{let[e,t]=Qs(""),[r,o]=Qs(""),s=G(),a=j(),{mutate:n}=Bt({v3LegacyAuthProviderCompatible:!!(a!=null&&a.isLegacy)});return Pe.createElement(Pe.Fragment,null,Pe.createElement("h1",null,s("pages.login.title","Sign in your account")),Pe.createElement("form",{onSubmit:i=>{i.preventDefault(),n({username:e,password:r})}},Pe.createElement("table",null,Pe.createElement("tbody",null,Pe.createElement("tr",null,Pe.createElement("td",null,s("pages.login.username",void 0,"username"),":"),Pe.createElement("td",null,Pe.createElement("input",{type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",autoFocus:!0,required:!0,value:e,onChange:i=>t(i.target.value)}))),Pe.createElement("tr",null,Pe.createElement("td",null,s("pages.login.password",void 0,"password"),":"),Pe.createElement("td",null,Pe.createElement("input",{type:"password",required:!0,size:20,value:r,onChange:i=>o(i.target.value)}))))),Pe.createElement("br",null),Pe.createElement("input",{type:"submit",value:"login"})))};import vt from"react";import me,{useState as ao}from"react";var Vs=({providers:e,registerLink:t,forgotPasswordLink:r,rememberMe:o,contentProps:s,wrapperProps:a,renderContent:n,formProps:i,title:c=void 0})=>{let u=Z(),p=ct(),{Link:l}=oe(),y=u==="legacy"?l:p,[g,P]=ao(""),[v,M]=ao(""),[m,h]=ao(!1),D=G(),w=j(),{mutate:x}=Bt({v3LegacyAuthProviderCompatible:!!(w!=null&&w.isLegacy)}),d=(T,R)=>me.createElement(y,{to:T},R),f=()=>e?e.map(T=>me.createElement("div",{key:T.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},me.createElement("button",{onClick:()=>x({providerName:T.name}),style:{display:"flex",alignItems:"center"}},T==null?void 0:T.icon,T.label??me.createElement("label",null,T.label)))):null,C=me.createElement("div",{...s},me.createElement("h1",{style:{textAlign:"center"}},D("pages.login.title","Sign in to your account")),f(),me.createElement("hr",null),me.createElement("form",{onSubmit:T=>{T.preventDefault(),x({email:g,password:v,remember:m})},...i},me.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},me.createElement("label",{htmlFor:"email-input"},D("pages.login.fields.email","Email")),me.createElement("input",{id:"email-input",name:"email",type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:g,onChange:T=>P(T.target.value)}),me.createElement("label",{htmlFor:"password-input"},D("pages.login.fields.password","Password")),me.createElement("input",{id:"password-input",type:"password",name:"password",required:!0,size:20,value:v,onChange:T=>M(T.target.value)}),o??me.createElement(me.Fragment,null,me.createElement("label",{htmlFor:"remember-me-input"},D("pages.login.buttons.rememberMe","Remember me"),me.createElement("input",{id:"remember-me-input",name:"remember",type:"checkbox",size:20,checked:m,value:m.toString(),onChange:()=>{h(!m)}}))),me.createElement("br",null),r??d("/forgot-password",D("pages.login.buttons.forgotPassword","Forgot password?")),me.createElement("input",{type:"submit",value:D("pages.login.signin","Sign in")}),t??me.createElement("span",null,D("pages.login.buttons.noAccount","Don\u2019t have an account?")," ",d("/register",D("pages.login.register","Sign up"))))));return me.createElement("div",{...a},n?n(C,c):C)};import Te,{useState as Bs}from"react";var Ns=({providers:e,loginLink:t,wrapperProps:r,contentProps:o,renderContent:s,formProps:a,title:n=void 0})=>{let i=Z(),c=ct(),{Link:u}=oe(),p=i==="legacy"?u:c,[l,y]=Bs(""),[g,P]=Bs(""),v=G(),M=j(),{mutate:m,isLoading:h}=$r({v3LegacyAuthProviderCompatible:!!(M!=null&&M.isLegacy)}),D=(d,f)=>Te.createElement(p,{to:d},f),w=()=>e?e.map(d=>Te.createElement("div",{key:d.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},Te.createElement("button",{onClick:()=>m({providerName:d.name}),style:{display:"flex",alignItems:"center"}},d==null?void 0:d.icon,d.label??Te.createElement("label",null,d.label)))):null,x=Te.createElement("div",{...o},Te.createElement("h1",{style:{textAlign:"center"}},v("pages.register.title","Sign up for your account")),w(),Te.createElement("hr",null),Te.createElement("form",{onSubmit:d=>{d.preventDefault(),m({email:l,password:g})},...a},Te.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},Te.createElement("label",{htmlFor:"email-input"},v("pages.register.fields.email","Email")),Te.createElement("input",{id:"email-input",name:"email",type:"email",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:l,onChange:d=>y(d.target.value)}),Te.createElement("label",{htmlFor:"password-input"},v("pages.register.fields.password","Password")),Te.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:g,onChange:d=>P(d.target.value)}),Te.createElement("input",{type:"submit",value:v("pages.register.buttons.submit","Sign up"),disabled:h}),t??Te.createElement(Te.Fragment,null,Te.createElement("span",null,v("pages.login.buttons.haveAccount","Have an account?")," ",D("/login",v("pages.login.signin","Sign in")))))));return Te.createElement("div",{...r},s?s(x,n):x)};import Qe,{useState as gi}from"react";var Ks=({loginLink:e,wrapperProps:t,contentProps:r,renderContent:o,formProps:s,title:a=void 0})=>{let n=G(),i=Z(),c=ct(),{Link:u}=oe(),p=i==="legacy"?u:c,[l,y]=gi(""),{mutate:g,isLoading:P}=Gr(),v=(m,h)=>Qe.createElement(p,{to:m},h),M=Qe.createElement("div",{...r},Qe.createElement("h1",{style:{textAlign:"center"}},n("pages.forgotPassword.title","Forgot your password?")),Qe.createElement("hr",null),Qe.createElement("form",{onSubmit:m=>{m.preventDefault(),g({email:l})},...s},Qe.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},Qe.createElement("label",{htmlFor:"email-input"},n("pages.forgotPassword.fields.email","Email")),Qe.createElement("input",{id:"email-input",name:"email",type:"mail",autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:l,onChange:m=>y(m.target.value)}),Qe.createElement("input",{type:"submit",disabled:P,value:n("pages.forgotPassword.buttons.submit","Send reset instructions")}),Qe.createElement("br",null),e??Qe.createElement("span",null,n("pages.register.buttons.haveAccount","Have an account? ")," ",v("/login",n("pages.login.signin","Sign in"))))));return Qe.createElement("div",{...t},o?o(M,a):M)};import Ke,{useState as Hs}from"react";var Os=({wrapperProps:e,contentProps:t,renderContent:r,formProps:o,title:s=void 0})=>{let a=G(),n=j(),{mutate:i,isLoading:c}=jr({v3LegacyAuthProviderCompatible:!!(n!=null&&n.isLegacy)}),[u,p]=Hs(""),[l,y]=Hs(""),g=Ke.createElement("div",{...t},Ke.createElement("h1",{style:{textAlign:"center"}},a("pages.updatePassword.title","Update Password")),Ke.createElement("hr",null),Ke.createElement("form",{onSubmit:P=>{P.preventDefault(),i({password:u,confirmPassword:l})},...o},Ke.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},Ke.createElement("label",{htmlFor:"password-input"},a("pages.updatePassword.fields.password","New Password")),Ke.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:u,onChange:P=>p(P.target.value)}),Ke.createElement("label",{htmlFor:"confirm-password-input"},a("pages.updatePassword.fields.confirmPassword","Confirm New Password")),Ke.createElement("input",{id:"confirm-password-input",name:"confirmPassword",type:"password",required:!0,size:20,value:l,onChange:P=>y(P.target.value)}),Ke.createElement("input",{type:"submit",disabled:c,value:a("pages.updatePassword.buttons.submit","Update")}))));return Ke.createElement("div",{...e},r?r(g,s):g)};var Ti=e=>{let{type:t}=e;return vt.createElement(vt.Fragment,null,(()=>{switch(t){case"register":return vt.createElement(Ns,{...e});case"forgotPassword":return vt.createElement(Ks,{...e});case"updatePassword":return vt.createElement(Os,{...e});default:return vt.createElement(Vs,{...e})}})())};import Me from"react";var io=()=>Me.createElement(Me.Fragment,null,Me.createElement("h1",null,"Welcome on board"),Me.createElement("p",null,"Your configuration is completed."),Me.createElement("p",null,"Now you can get started by adding your resources to the"," ",Me.createElement("code",null,"`resources`")," property of ",Me.createElement("code",null,"`<Refine>`")),Me.createElement("div",{style:{display:"flex",gap:8}},Me.createElement("a",{href:"https://refine.dev",target:"_blank",rel:"noreferrer"},Me.createElement("button",null,"Documentation")),Me.createElement("a",{href:"https://refine.dev/examples",target:"_blank",rel:"noreferrer"},Me.createElement("button",null,"Examples")),Me.createElement("a",{href:"https://discord.gg/refine",target:"_blank",rel:"noreferrer"},Me.createElement("button",null,"Community"))));import ee,{useState as Ri}from"react";var Pi=[{title:"Documentation",description:"Learn about the technical details of using refine in your projects.",link:"https://refine.dev/",icon:ee.createElement("svg",{width:"14",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ee.createElement("path",{d:"M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V5a1 1 0 0 0-1-1H3a1 1 0 0 1 0-2h10a1 1 0 1 0 0-2H2Z",fill:"#fff"}))},{title:"Tutorial",description:"Learn how to use refine by building a fully-functioning CRUD app, from scratch to full launch.",link:"https://refine.dev/docs/tutorial/introduction/index/",icon:ee.createElement("svg",{width:"16",height:"14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ee.createElement("path",{d:"M0 4.573c0-.475.163-.948.53-1.25a4.57 4.57 0 0 1 .854-.553L5.956.485a4.571 4.571 0 0 1 4.088 0l4.572 2.285c.308.154.594.34.853.553.306.251.47.62.517 1.01.01.055.014.112.014.169v6.5a1 1 0 0 1-2 0V6.684l-3.956 1.978a4.571 4.571 0 0 1-4.088 0L1.384 6.376a4.57 4.57 0 0 1-.853-.553C.163 5.522 0 5.05 0 4.573Z",fill:"#fff"}),ee.createElement("path",{d:"M5.061 13.305 3 12.274V9.42l2.061 1.031a6.571 6.571 0 0 0 5.878 0L13 9.421v2.853l-2.061 1.03a6.571 6.571 0 0 1-5.878 0Z",fill:"#fff"}))},{title:"Examples",description:"A collection of reference applications you can use as a starting point.",link:"https://refine.dev/examples",icon:ee.createElement("svg",{width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ee.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4H0V2Zm3 2a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm4-1a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm2 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",fill:"#fff"}),ee.createElement("path",{d:"M0 14V8h16v6a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2Z",fill:"#fff"}))},{title:"Community",description:"Join our Discord community and keep up with the latest news.",link:"https://discord.gg/refine",icon:ee.createElement("svg",{width:"16",height:"12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ee.createElement("path",{d:"M13.553 1.005A13.334 13.334 0 0 0 10.253 0c-.156.276-.298.56-.423.85a12.42 12.42 0 0 0-3.664 0A8.975 8.975 0 0 0 5.744 0 13.43 13.43 0 0 0 2.44 1.007C.351 4.066-.215 7.05.068 9.99A13.36 13.36 0 0 0 4.116 12c.328-.436.618-.9.867-1.384a8.647 8.647 0 0 1-1.365-.645c.115-.082.227-.167.335-.249a9.594 9.594 0 0 0 8.094 0c.11.089.222.173.335.25-.436.254-.894.47-1.368.646.249.484.539.946.867 1.382a13.3 13.3 0 0 0 4.051-2.01c.332-3.41-.568-6.365-2.379-8.985Zm-8.21 7.176c-.79 0-1.442-.709-1.442-1.58 0-.872.63-1.587 1.439-1.587s1.456.715 1.442 1.586c-.014.872-.636 1.58-1.44 1.58Zm5.315 0c-.79 0-1.44-.709-1.44-1.58 0-.872.63-1.587 1.44-1.587.81 0 1.452.715 1.438 1.586-.014.872-.634 1.58-1.438 1.58Z",fill:"#fff"}))}],xi=()=>{let e=ar("(max-width: 1010px)"),t=ar("(max-width: 650px)"),r=()=>t?"1, 280px":e?"2, 280px":"4, 208px",o=()=>t?"32px":e?"40px":"48px",s=()=>t?"16px":e?"20px":"24px";return ee.createElement("div",{style:{backgroundImage:"url(https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/welcome-page.webp)",backgroundPosition:"center top",backgroundSize:"cover",backgroundRepeat:"no-repeat",minHeight:"100vh",backgroundColor:"#0D0D12",fontFamily:"Arial",color:"#FFFFFF"}},ee.createElement("div",{style:{height:"89px"}}),ee.createElement("div",{style:{display:"flex",justifyContent:"center"}},ee.createElement("img",{src:"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/welcome-logo.webp",width:"198",height:"54"})),ee.createElement("div",{style:{height:e?"270px":"22vw",minHeight:e?"270px":"313px"}}),ee.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px",textAlign:"center"}},ee.createElement("h1",{style:{fontSize:o(),fontWeight:700,margin:"0px"}},"Welcome Aboard!"),ee.createElement("h4",{style:{fontSize:s(),fontWeight:400,margin:"0px"}},"Your configuration is completed.")),ee.createElement("div",{style:{height:"64px"}}),ee.createElement("div",{style:{display:"grid",gridTemplateColumns:`repeat(${r()})`,justifyContent:"center",gap:"48px",paddingRight:"16px",paddingLeft:"16px",maxWidth:"976px",margin:"auto"}},Pi.map(a=>ee.createElement(Ci,{key:`welcome-page-${a.title}`,card:a}))),ee.createElement("div",{style:{height:"64px"}}))},Ci=({card:e})=>{let{title:t,description:r,icon:o,link:s}=e,[a,n]=Ri(!1);return ee.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},ee.createElement("div",{style:{display:"flex",alignItems:"center"}},ee.createElement("a",{onPointerEnter:()=>n(!0),onPointerLeave:()=>n(!1),style:{display:"flex",alignItems:"center",color:"#fff",textDecoration:"none"},href:s},o,ee.createElement("span",{style:{fontSize:"16px",fontWeight:700,marginLeft:"13px",marginRight:"14px"}},t),ee.createElement("svg",{style:{transition:"transform 0.5s ease-in-out, opacity 0.2s ease-in-out",...a&&{transform:"translateX(4px)",opacity:1}},width:"12",height:"8",fill:"none",opacity:"0.5",xmlns:"http://www.w3.org/2000/svg"},ee.createElement("path",{d:"M7.293.293a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-3 3a1 1 0 0 1-1.414-1.414L8.586 5H1a1 1 0 0 1 0-2h7.586L7.293 1.707a1 1 0 0 1 0-1.414Z",fill:"#fff"})))),ee.createElement("span",{style:{fontSize:"12px",opacity:.5,lineHeight:"16px"}},r))};import{QueryClient as Zs,QueryClientProvider as Ei}from"@tanstack/react-query";import ae from"react";import Ws from"react";import{useContext as dt}from"react";var hi="4.36.1",$s=()=>{var h;let e=_r(),t=dt(pt),r=dt(Je),o=dt(Gt),s=dt(Ot),{i18nProvider:a}=dt(Fe),n=dt($t),i=dt(ot),{resources:c}=B(),u=te(),p=!!t.create||!!t.get||!!t.update,l=!!(r!=null&&r.publish)||!!(r!=null&&r.subscribe)||!!(r!=null&&r.unsubscribe),y=!!o.useHistory||!!o.Link||!!o.Prompt||!!o.useLocation||!!o.useParams,g=!!s,P=!!(a!=null&&a.changeLocale)||!!(a!=null&&a.getLocale)||!!(a!=null&&a.translate),v=!!n.close||!!n.open,M=!!i.can,m=(h=u==null?void 0:u.options)==null?void 0:h.projectId;return{providers:{auth:e,auditLog:p,live:l,router:y,data:g,i18n:P,notification:v,accessControl:M},version:hi,resourceCount:c.length,projectId:m}};var bi=e=>{try{let t=JSON.stringify(e||{});return typeof btoa<"u"?btoa(t):Buffer.from(t).toString("base64")}catch{return}},vi=e=>{let t=new Image;t.src=e},Di=e=>{fetch(e)},Li=e=>{typeof Image<"u"?vi(e):typeof fetch<"u"&&Di(e)},Gs=()=>{let e=$s(),t=Ws.useRef(!1);return Ws.useEffect(()=>{if(t.current)return;let r=bi(e);r&&(Li(`https://telemetry.refine.dev/telemetry?payload=${r}`),t.current=!0)},[]),null};var zs=e=>{let t=["go","parse","back","Link"],r=Object.keys(e).filter(s=>!t.includes(s));return r.length>0?(console.warn(`Unsupported properties are found in \`routerProvider\` prop. You provided \`${r.join(", ")}\`. Supported properties are \`${t.join(", ")}\`. You may wanted to use \`legacyRouterProvider\` prop instead.`),!0):!1};import js from"react";var _s=e=>{let t=js.useRef(!1);js.useEffect(()=>{t.current===!1&&e&&zs(e)&&(t.current=!0)},[e])};var Ui=({legacyAuthProvider:e,authProvider:t,dataProvider:r,legacyRouterProvider:o,routerProvider:s,notificationProvider:a,accessControlProvider:n,auditLogProvider:i,resources:c,DashboardPage:u,ReadyPage:p,LoginPage:l,catchAll:y,children:g,liveProvider:P,i18nProvider:v,Title:M,Layout:m,Sider:h,Header:D,Footer:w,OffLayoutArea:x,onLiveEvent:d,options:f})=>{let{optionsWithDefaults:C,disableTelemetryWithDefault:T,reactQueryWithDefaults:R}=kr({options:f}),L=Tr(()=>{var U;return R.clientConfig instanceof Zs?R.clientConfig:new Zs({...R.clientConfig,defaultOptions:{...R.clientConfig.defaultOptions,queries:{refetchOnWindowFocus:!1,keepPreviousData:!0,...(U=R.clientConfig.defaultOptions)==null?void 0:U.queries}}})},[R.clientConfig]),E=ae.useMemo(()=>typeof a=="function"?a:()=>a??{},[a])();if(_s(s),o&&!s&&(c??[]).length===0)return p?ae.createElement(p,null):ae.createElement(io,null);let{RouterComponent:F=ae.Fragment}=s?{}:o??{};return ae.createElement(Ei,{client:L},ae.createElement(fs,{...E},ae.createElement(To,{...e??{},isProvided:!!e},ae.createElement(Po,{...t??{},isProvided:!!t},ae.createElement(es,{...r},ae.createElement(rs,{liveProvider:P},ae.createElement(us,{value:o&&!s?"legacy":"new"},ae.createElement(ps,{router:s},ae.createElement(xs,{...o},ae.createElement(ns,{resources:c??[]},ae.createElement(gs,{i18nProvider:v},ae.createElement(hs,{...n??{}},ae.createElement(ws,{...i??{}},ae.createElement(Xr,null,ae.createElement(wo,{mutationMode:C.mutationMode,warnWhenUnsavedChanges:C.warnWhenUnsavedChanges,syncWithLocation:C.syncWithLocation,Title:M,undoableTimeout:C.undoableTimeout,catchAll:y,DashboardPage:u,LoginPage:l,Layout:m,Sider:h,Footer:w,Header:D,OffLayoutArea:x,hasDashboard:!!u,liveMode:C.liveMode,onLiveEvent:d,options:C},ae.createElement(Qo,null,ae.createElement(F,null,g,!T&&ae.createElement(Gs,null),ae.createElement(uo,null))))))))))))))))))};import{useEffect as Mi,useState as Ii}from"react";var Xo=({notification:e})=>{let t=G(),{notificationDispatch:r}=Ge(),{open:o}=Ee(),[s,a]=Ii(),n=()=>{if(e.isRunning===!0&&(e.seconds===0&&e.doMutation(),e.isSilent||o==null||o({key:`${e.id}-${e.resource}-notification`,type:"progress",message:t("notifications.undoable",{seconds:St(e.seconds)},`You have ${St(e.seconds)} seconds to undo`),cancelMutation:e.cancelMutation,undoableTimeout:St(e.seconds)}),e.seconds>0)){s&&clearTimeout(s);let i=setTimeout(()=>{r({type:"DECREASE_NOTIFICATION_SECOND",payload:{id:e.id,seconds:e.seconds,resource:e.resource}})},1e3);a(i)}};return Mi(()=>{n()},[e]),null};import co,{useEffect as wi}from"react";var Si=({children:e,Layout:t,Sider:r,Header:o,Title:s,Footer:a,OffLayoutArea:n})=>{let{Layout:i,Footer:c,Header:u,Sider:p,Title:l,OffLayoutArea:y}=te();return co.createElement(t??i,{Sider:r??p,Header:o??u,Footer:a??c,Title:s??l,OffLayoutArea:n??y},e,co.createElement(Ai,null))},Ai=()=>{let{Prompt:e}=oe(),t=G(),{warnWhen:r,setWarnWhen:o}=Vt(),s=a=>(a.preventDefault(),a.returnValue=t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),a.returnValue);return wi(()=>(r&&window.addEventListener("beforeunload",s),window.removeEventListener("beforeunload",s)),[r]),co.createElement(e,{when:r,message:t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),setWarnWhen:o})};import we from"react";var ki=()=>{let e=pe(),[t,r]=we.useState(void 0);return we.useEffect(()=>{t&&e(t)},[t]),we.useCallback(s=>{t||r(s)},[t])};function Fi({redirectOnFail:e=!0,appendCurrentPathToQuery:t=!0,children:r,fallback:o,loading:s}){var C;let a=j(),n=Z(),i=!!(a!=null&&a.isProvided),c=!!(a!=null&&a.isLegacy),u=n==="legacy",p=le(),l=pe(),y=ki(),{replace:g}=ue(),{useLocation:P}=oe(),v=P(),{isLoading:M,isFetching:m,isSuccess:h,data:{authenticated:D,redirectTo:w}={},refetch:x}=fr({v3LegacyAuthProviderCompatible:c});we.useEffect(()=>{x()},[r,o]);let d=we.useRef({status:M?"initial":"pending",content:s??null});m?d.current.status="pending":m||(d.current.status="settled");let f=i?c?h:D:!0;if(d.current.status==="settled")if(f)d.current.content=we.createElement(we.Fragment,null,r??null);else if(typeof o<"u")d.current.content=we.createElement(we.Fragment,null,o);else{let T=`${u?v==null?void 0:v.pathname:p.pathname}`.replace(/(\?.*|#.*)$/,""),R=c?typeof e=="string"?e:"/login":typeof e=="string"?e:w;if(R)if(u){let L=t?`?to=${encodeURIComponent(T)}`:"";g(`${R}${L}`)}else y({to:R,query:t?{to:(C=p.params)!=null&&C.to?p.params.to:l({to:T,options:{keepQuery:!0},type:"path"})}:void 0,type:"replace"})}return i?we.createElement(we.Fragment,null,d.current.content):we.createElement(we.Fragment,null,r??null)}import{useEffect as Qi}from"react";var uo=()=>{let{useLocation:e}=oe(),{checkAuth:t}=re(),r=e();return Qi(()=>{t==null||t().catch(()=>!1)},[r==null?void 0:r.pathname]),null};import Dt from"react";var Vi=({resource:e,action:t,params:r,fallback:o,children:s,...a})=>{let{resource:n,id:i,action:c}=B(e),{identifier:u}=B(),l=(()=>{let g=(r==null?void 0:r.id)??i;return e&&e!==u?r==null?void 0:r.id:g})(),{data:y}=bs({resource:e??(n==null?void 0:n.name),action:t??c??"",params:r??{id:l,resource:n}});return y!=null&&y.can?Dt.isValidElement(s)?Dt.cloneElement(s,a):Dt.createElement(Dt.Fragment,null,s):(y==null?void 0:y.can)===!1?Dt.createElement(Dt.Fragment,null,o??null):null};import Lt,{useEffect as Bi}from"react";var Ys=[`
|
|
11
|
+
For more information, see https://refine.dev/docs/api-reference/core/hooks/useBreadcrumb/#i18n-support`),u.push({label:s(`buttons.${i}`,c.humanize(i))})):u.push({label:s(l,c.humanize(i))})}return{breadcrumbs:u}};import no from"react";var bt=(e,t,r=!1)=>{let o=[],s=Ie(e,t);for(;s;)o.push(s),s=Ie(s,t);return o.reverse(),`/${[...o,e].map(n=>Re((r?n.route:void 0)??n.identifier??n.name)).join("/").replace(/^\//,"")}`};var ks=(e,t=!1)=>{let r={item:{name:"__root__"},children:{}};e.forEach(s=>{let a=[],n=Ie(s,e);for(;n;)a.push(n),n=Ie(n,e);a.reverse();let i=r;a.forEach(u=>{let p=(t?u.route:void 0)??u.identifier??u.name;i.children[p]||(i.children[p]={item:u,children:{}}),i=i.children[p]});let c=(t?s.route:void 0)??s.identifier??s.name;i.children[c]||(i.children[c]={item:s,children:{}})});let o=s=>{let a=[];return Object.keys(s.children).forEach(n=>{let i=bt(s.children[n].item,e,t),c={...s.children[n].item,key:i,children:o(s.children[n])};a.push(c)}),a};return o(r)};var Fs=e=>e.split("?")[0].split("#")[0].replace(/(.+)(\/$)/,"$1"),li=({meta:e,hideOnMissingParameter:t}={hideOnMissingParameter:!0})=>{let r=G(),o=Wt(),s=Z(),{resource:a,resources:n}=B(),{pathname:i}=le(),{useLocation:c}=oe(),{pathname:u}=c(),p=Pt(),y=`/${((s==="legacy"?Fs(u):i?Fs(i):void 0)??"").replace(/^\//,"")}`,g=a?bt(a,n,s==="legacy"):y??"",P=no.useMemo(()=>{if(!a)return[];let m=Ie(a,n),h=[bt(a,n)];for(;m;)h.push(bt(m,n)),m=Ie(m,n);return h},[]),v=no.useCallback(m=>{var D,w,x,d,f,C;if((((D=m==null?void 0:m.meta)==null?void 0:D.hide)??((w=m==null?void 0:m.options)==null?void 0:w.hide))||!(m!=null&&m.list)&&m.children.length===0)return;let h=m.list?o({resource:m,action:"list",legacy:s==="legacy",meta:e}):void 0;if(!(t&&h&&h.match(/(\/|^):(.+?)(\/|$){1}/)))return{...m,route:h,icon:I((x=m.meta)==null?void 0:x.icon,(d=m.options)==null?void 0:d.icon,m.icon),label:I((f=m==null?void 0:m.meta)==null?void 0:f.label,(C=m==null?void 0:m.options)==null?void 0:C.label)??r(`${m.name}.${m.name}`,p(m.name,"plural"))}},[s,e,r,t]),M=no.useMemo(()=>{let m=ks(n,s==="legacy"),h=D=>D.flatMap(w=>{let x=h(w.children),d=v({...w,children:x});return d?[d]:[]});return h(m)},[n,s,v]);return{defaultOpenKeys:P,selectedKey:g,menuItems:M}};var _=()=>{let{params:e}=le();return({resource:r,meta:o}={})=>{let{meta:s}=ht(r)??{meta:{}},{filters:a,sorters:n,current:i,pageSize:c,...u}=e??{};return{...s,...u,...o}}};var yi=()=>{let[e,t]=fi(),r=G(),{push:o}=ue(),s=pe(),a=Z(),{resource:n,action:i}=B();return mi(()=>{n&&i&&t(r("pages.error.info",{action:i,resource:n.name},`You may have forgotten to add the "${i}" component to "${n.name}" resource.`))},[n,i]),zt.createElement(zt.Fragment,null,zt.createElement("h1",null,r("pages.error.404",void 0,"Sorry, the page you visited does not exist.")),e&&zt.createElement("p",null,e),zt.createElement("button",{onClick:()=>{a==="legacy"?o("/"):s({to:"/"})}},r("pages.error.backHome",void 0,"Back Home")))};import Pe,{useState as Qs}from"react";var Ar=()=>{let[e,t]=Qs(""),[r,o]=Qs(""),s=G(),a=j(),{mutate:n}=Bt({v3LegacyAuthProviderCompatible:!!(a!=null&&a.isLegacy)});return Pe.createElement(Pe.Fragment,null,Pe.createElement("h1",null,s("pages.login.title","Sign in your account")),Pe.createElement("form",{onSubmit:i=>{i.preventDefault(),n({username:e,password:r})}},Pe.createElement("table",null,Pe.createElement("tbody",null,Pe.createElement("tr",null,Pe.createElement("td",null,s("pages.login.username",void 0,"username"),":"),Pe.createElement("td",null,Pe.createElement("input",{type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",autoFocus:!0,required:!0,value:e,onChange:i=>t(i.target.value)}))),Pe.createElement("tr",null,Pe.createElement("td",null,s("pages.login.password",void 0,"password"),":"),Pe.createElement("td",null,Pe.createElement("input",{type:"password",required:!0,size:20,value:r,onChange:i=>o(i.target.value)}))))),Pe.createElement("br",null),Pe.createElement("input",{type:"submit",value:"login"})))};import vt from"react";import me,{useState as ao}from"react";var Vs=({providers:e,registerLink:t,forgotPasswordLink:r,rememberMe:o,contentProps:s,wrapperProps:a,renderContent:n,formProps:i,title:c=void 0})=>{let u=Z(),p=ct(),{Link:l}=oe(),y=u==="legacy"?l:p,[g,P]=ao(""),[v,M]=ao(""),[m,h]=ao(!1),D=G(),w=j(),{mutate:x}=Bt({v3LegacyAuthProviderCompatible:!!(w!=null&&w.isLegacy)}),d=(T,R)=>me.createElement(y,{to:T},R),f=()=>e?e.map(T=>me.createElement("div",{key:T.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},me.createElement("button",{onClick:()=>x({providerName:T.name}),style:{display:"flex",alignItems:"center"}},T==null?void 0:T.icon,T.label??me.createElement("label",null,T.label)))):null,C=me.createElement("div",{...s},me.createElement("h1",{style:{textAlign:"center"}},D("pages.login.title","Sign in to your account")),f(),me.createElement("hr",null),me.createElement("form",{onSubmit:T=>{T.preventDefault(),x({email:g,password:v,remember:m})},...i},me.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},me.createElement("label",{htmlFor:"email-input"},D("pages.login.fields.email","Email")),me.createElement("input",{id:"email-input",name:"email",type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:g,onChange:T=>P(T.target.value)}),me.createElement("label",{htmlFor:"password-input"},D("pages.login.fields.password","Password")),me.createElement("input",{id:"password-input",type:"password",name:"password",required:!0,size:20,value:v,onChange:T=>M(T.target.value)}),o??me.createElement(me.Fragment,null,me.createElement("label",{htmlFor:"remember-me-input"},D("pages.login.buttons.rememberMe","Remember me"),me.createElement("input",{id:"remember-me-input",name:"remember",type:"checkbox",size:20,checked:m,value:m.toString(),onChange:()=>{h(!m)}}))),me.createElement("br",null),r??d("/forgot-password",D("pages.login.buttons.forgotPassword","Forgot password?")),me.createElement("input",{type:"submit",value:D("pages.login.signin","Sign in")}),t??me.createElement("span",null,D("pages.login.buttons.noAccount","Don\u2019t have an account?")," ",d("/register",D("pages.login.register","Sign up"))))));return me.createElement("div",{...a},n?n(C,c):C)};import Te,{useState as Bs}from"react";var Ns=({providers:e,loginLink:t,wrapperProps:r,contentProps:o,renderContent:s,formProps:a,title:n=void 0})=>{let i=Z(),c=ct(),{Link:u}=oe(),p=i==="legacy"?u:c,[l,y]=Bs(""),[g,P]=Bs(""),v=G(),M=j(),{mutate:m,isLoading:h}=$r({v3LegacyAuthProviderCompatible:!!(M!=null&&M.isLegacy)}),D=(d,f)=>Te.createElement(p,{to:d},f),w=()=>e?e.map(d=>Te.createElement("div",{key:d.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},Te.createElement("button",{onClick:()=>m({providerName:d.name}),style:{display:"flex",alignItems:"center"}},d==null?void 0:d.icon,d.label??Te.createElement("label",null,d.label)))):null,x=Te.createElement("div",{...o},Te.createElement("h1",{style:{textAlign:"center"}},v("pages.register.title","Sign up for your account")),w(),Te.createElement("hr",null),Te.createElement("form",{onSubmit:d=>{d.preventDefault(),m({email:l,password:g})},...a},Te.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},Te.createElement("label",{htmlFor:"email-input"},v("pages.register.fields.email","Email")),Te.createElement("input",{id:"email-input",name:"email",type:"email",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:l,onChange:d=>y(d.target.value)}),Te.createElement("label",{htmlFor:"password-input"},v("pages.register.fields.password","Password")),Te.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:g,onChange:d=>P(d.target.value)}),Te.createElement("input",{type:"submit",value:v("pages.register.buttons.submit","Sign up"),disabled:h}),t??Te.createElement(Te.Fragment,null,Te.createElement("span",null,v("pages.login.buttons.haveAccount","Have an account?")," ",D("/login",v("pages.login.signin","Sign in")))))));return Te.createElement("div",{...r},s?s(x,n):x)};import Qe,{useState as gi}from"react";var Ks=({loginLink:e,wrapperProps:t,contentProps:r,renderContent:o,formProps:s,title:a=void 0})=>{let n=G(),i=Z(),c=ct(),{Link:u}=oe(),p=i==="legacy"?u:c,[l,y]=gi(""),{mutate:g,isLoading:P}=Gr(),v=(m,h)=>Qe.createElement(p,{to:m},h),M=Qe.createElement("div",{...r},Qe.createElement("h1",{style:{textAlign:"center"}},n("pages.forgotPassword.title","Forgot your password?")),Qe.createElement("hr",null),Qe.createElement("form",{onSubmit:m=>{m.preventDefault(),g({email:l})},...s},Qe.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},Qe.createElement("label",{htmlFor:"email-input"},n("pages.forgotPassword.fields.email","Email")),Qe.createElement("input",{id:"email-input",name:"email",type:"mail",autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:l,onChange:m=>y(m.target.value)}),Qe.createElement("input",{type:"submit",disabled:P,value:n("pages.forgotPassword.buttons.submit","Send reset instructions")}),Qe.createElement("br",null),e??Qe.createElement("span",null,n("pages.register.buttons.haveAccount","Have an account? ")," ",v("/login",n("pages.login.signin","Sign in"))))));return Qe.createElement("div",{...t},o?o(M,a):M)};import Ke,{useState as Hs}from"react";var Os=({wrapperProps:e,contentProps:t,renderContent:r,formProps:o,title:s=void 0})=>{let a=G(),n=j(),{mutate:i,isLoading:c}=jr({v3LegacyAuthProviderCompatible:!!(n!=null&&n.isLegacy)}),[u,p]=Hs(""),[l,y]=Hs(""),g=Ke.createElement("div",{...t},Ke.createElement("h1",{style:{textAlign:"center"}},a("pages.updatePassword.title","Update Password")),Ke.createElement("hr",null),Ke.createElement("form",{onSubmit:P=>{P.preventDefault(),i({password:u,confirmPassword:l})},...o},Ke.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},Ke.createElement("label",{htmlFor:"password-input"},a("pages.updatePassword.fields.password","New Password")),Ke.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:u,onChange:P=>p(P.target.value)}),Ke.createElement("label",{htmlFor:"confirm-password-input"},a("pages.updatePassword.fields.confirmPassword","Confirm New Password")),Ke.createElement("input",{id:"confirm-password-input",name:"confirmPassword",type:"password",required:!0,size:20,value:l,onChange:P=>y(P.target.value)}),Ke.createElement("input",{type:"submit",disabled:c,value:a("pages.updatePassword.buttons.submit","Update")}))));return Ke.createElement("div",{...e},r?r(g,s):g)};var Ti=e=>{let{type:t}=e;return vt.createElement(vt.Fragment,null,(()=>{switch(t){case"register":return vt.createElement(Ns,{...e});case"forgotPassword":return vt.createElement(Ks,{...e});case"updatePassword":return vt.createElement(Os,{...e});default:return vt.createElement(Vs,{...e})}})())};import Me from"react";var io=()=>Me.createElement(Me.Fragment,null,Me.createElement("h1",null,"Welcome on board"),Me.createElement("p",null,"Your configuration is completed."),Me.createElement("p",null,"Now you can get started by adding your resources to the"," ",Me.createElement("code",null,"`resources`")," property of ",Me.createElement("code",null,"`<Refine>`")),Me.createElement("div",{style:{display:"flex",gap:8}},Me.createElement("a",{href:"https://refine.dev",target:"_blank",rel:"noreferrer"},Me.createElement("button",null,"Documentation")),Me.createElement("a",{href:"https://refine.dev/examples",target:"_blank",rel:"noreferrer"},Me.createElement("button",null,"Examples")),Me.createElement("a",{href:"https://discord.gg/refine",target:"_blank",rel:"noreferrer"},Me.createElement("button",null,"Community"))));import ee,{useState as Ri}from"react";var Pi=[{title:"Documentation",description:"Learn about the technical details of using refine in your projects.",link:"https://refine.dev/",icon:ee.createElement("svg",{width:"14",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ee.createElement("path",{d:"M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V5a1 1 0 0 0-1-1H3a1 1 0 0 1 0-2h10a1 1 0 1 0 0-2H2Z",fill:"#fff"}))},{title:"Tutorial",description:"Learn how to use refine by building a fully-functioning CRUD app, from scratch to full launch.",link:"https://refine.dev/docs/tutorial/introduction/index/",icon:ee.createElement("svg",{width:"16",height:"14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ee.createElement("path",{d:"M0 4.573c0-.475.163-.948.53-1.25a4.57 4.57 0 0 1 .854-.553L5.956.485a4.571 4.571 0 0 1 4.088 0l4.572 2.285c.308.154.594.34.853.553.306.251.47.62.517 1.01.01.055.014.112.014.169v6.5a1 1 0 0 1-2 0V6.684l-3.956 1.978a4.571 4.571 0 0 1-4.088 0L1.384 6.376a4.57 4.57 0 0 1-.853-.553C.163 5.522 0 5.05 0 4.573Z",fill:"#fff"}),ee.createElement("path",{d:"M5.061 13.305 3 12.274V9.42l2.061 1.031a6.571 6.571 0 0 0 5.878 0L13 9.421v2.853l-2.061 1.03a6.571 6.571 0 0 1-5.878 0Z",fill:"#fff"}))},{title:"Examples",description:"A collection of reference applications you can use as a starting point.",link:"https://refine.dev/examples",icon:ee.createElement("svg",{width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ee.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4H0V2Zm3 2a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm4-1a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm2 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",fill:"#fff"}),ee.createElement("path",{d:"M0 14V8h16v6a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2Z",fill:"#fff"}))},{title:"Community",description:"Join our Discord community and keep up with the latest news.",link:"https://discord.gg/refine",icon:ee.createElement("svg",{width:"16",height:"12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ee.createElement("path",{d:"M13.553 1.005A13.334 13.334 0 0 0 10.253 0c-.156.276-.298.56-.423.85a12.42 12.42 0 0 0-3.664 0A8.975 8.975 0 0 0 5.744 0 13.43 13.43 0 0 0 2.44 1.007C.351 4.066-.215 7.05.068 9.99A13.36 13.36 0 0 0 4.116 12c.328-.436.618-.9.867-1.384a8.647 8.647 0 0 1-1.365-.645c.115-.082.227-.167.335-.249a9.594 9.594 0 0 0 8.094 0c.11.089.222.173.335.25-.436.254-.894.47-1.368.646.249.484.539.946.867 1.382a13.3 13.3 0 0 0 4.051-2.01c.332-3.41-.568-6.365-2.379-8.985Zm-8.21 7.176c-.79 0-1.442-.709-1.442-1.58 0-.872.63-1.587 1.439-1.587s1.456.715 1.442 1.586c-.014.872-.636 1.58-1.44 1.58Zm5.315 0c-.79 0-1.44-.709-1.44-1.58 0-.872.63-1.587 1.44-1.587.81 0 1.452.715 1.438 1.586-.014.872-.634 1.58-1.438 1.58Z",fill:"#fff"}))}],xi=()=>{let e=ar("(max-width: 1010px)"),t=ar("(max-width: 650px)"),r=()=>t?"1, 280px":e?"2, 280px":"4, 208px",o=()=>t?"32px":e?"40px":"48px",s=()=>t?"16px":e?"20px":"24px";return ee.createElement("div",{style:{backgroundImage:"url(https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/welcome-page.webp)",backgroundPosition:"center top",backgroundSize:"cover",backgroundRepeat:"no-repeat",minHeight:"100vh",backgroundColor:"#0D0D12",fontFamily:"Arial",color:"#FFFFFF"}},ee.createElement("div",{style:{height:"89px"}}),ee.createElement("div",{style:{display:"flex",justifyContent:"center"}},ee.createElement("img",{src:"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/welcome-logo.webp",width:"198",height:"54"})),ee.createElement("div",{style:{height:e?"270px":"22vw",minHeight:e?"270px":"313px"}}),ee.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px",textAlign:"center"}},ee.createElement("h1",{style:{fontSize:o(),fontWeight:700,margin:"0px"}},"Welcome Aboard!"),ee.createElement("h4",{style:{fontSize:s(),fontWeight:400,margin:"0px"}},"Your configuration is completed.")),ee.createElement("div",{style:{height:"64px"}}),ee.createElement("div",{style:{display:"grid",gridTemplateColumns:`repeat(${r()})`,justifyContent:"center",gap:"48px",paddingRight:"16px",paddingLeft:"16px",maxWidth:"976px",margin:"auto"}},Pi.map(a=>ee.createElement(Ci,{key:`welcome-page-${a.title}`,card:a}))),ee.createElement("div",{style:{height:"64px"}}))},Ci=({card:e})=>{let{title:t,description:r,icon:o,link:s}=e,[a,n]=Ri(!1);return ee.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},ee.createElement("div",{style:{display:"flex",alignItems:"center"}},ee.createElement("a",{onPointerEnter:()=>n(!0),onPointerLeave:()=>n(!1),style:{display:"flex",alignItems:"center",color:"#fff",textDecoration:"none"},href:s},o,ee.createElement("span",{style:{fontSize:"16px",fontWeight:700,marginLeft:"13px",marginRight:"14px"}},t),ee.createElement("svg",{style:{transition:"transform 0.5s ease-in-out, opacity 0.2s ease-in-out",...a&&{transform:"translateX(4px)",opacity:1}},width:"12",height:"8",fill:"none",opacity:"0.5",xmlns:"http://www.w3.org/2000/svg"},ee.createElement("path",{d:"M7.293.293a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1 0 1.414l-3 3a1 1 0 0 1-1.414-1.414L8.586 5H1a1 1 0 0 1 0-2h7.586L7.293 1.707a1 1 0 0 1 0-1.414Z",fill:"#fff"})))),ee.createElement("span",{style:{fontSize:"12px",opacity:.5,lineHeight:"16px"}},r))};import{QueryClient as Zs,QueryClientProvider as Ei}from"@tanstack/react-query";import ae from"react";import Ws from"react";import{useContext as dt}from"react";var hi="4.36.2",$s=()=>{var h;let e=_r(),t=dt(pt),r=dt(Je),o=dt(Gt),s=dt(Ot),{i18nProvider:a}=dt(Fe),n=dt($t),i=dt(ot),{resources:c}=B(),u=te(),p=!!t.create||!!t.get||!!t.update,l=!!(r!=null&&r.publish)||!!(r!=null&&r.subscribe)||!!(r!=null&&r.unsubscribe),y=!!o.useHistory||!!o.Link||!!o.Prompt||!!o.useLocation||!!o.useParams,g=!!s,P=!!(a!=null&&a.changeLocale)||!!(a!=null&&a.getLocale)||!!(a!=null&&a.translate),v=!!n.close||!!n.open,M=!!i.can,m=(h=u==null?void 0:u.options)==null?void 0:h.projectId;return{providers:{auth:e,auditLog:p,live:l,router:y,data:g,i18n:P,notification:v,accessControl:M},version:hi,resourceCount:c.length,projectId:m}};var bi=e=>{try{let t=JSON.stringify(e||{});return typeof btoa<"u"?btoa(t):Buffer.from(t).toString("base64")}catch{return}},vi=e=>{let t=new Image;t.src=e},Di=e=>{fetch(e)},Li=e=>{typeof Image<"u"?vi(e):typeof fetch<"u"&&Di(e)},Gs=()=>{let e=$s(),t=Ws.useRef(!1);return Ws.useEffect(()=>{if(t.current)return;let r=bi(e);r&&(Li(`https://telemetry.refine.dev/telemetry?payload=${r}`),t.current=!0)},[]),null};var zs=e=>{let t=["go","parse","back","Link"],r=Object.keys(e).filter(s=>!t.includes(s));return r.length>0?(console.warn(`Unsupported properties are found in \`routerProvider\` prop. You provided \`${r.join(", ")}\`. Supported properties are \`${t.join(", ")}\`. You may wanted to use \`legacyRouterProvider\` prop instead.`),!0):!1};import js from"react";var _s=e=>{let t=js.useRef(!1);js.useEffect(()=>{t.current===!1&&e&&zs(e)&&(t.current=!0)},[e])};var Ui=({legacyAuthProvider:e,authProvider:t,dataProvider:r,legacyRouterProvider:o,routerProvider:s,notificationProvider:a,accessControlProvider:n,auditLogProvider:i,resources:c,DashboardPage:u,ReadyPage:p,LoginPage:l,catchAll:y,children:g,liveProvider:P,i18nProvider:v,Title:M,Layout:m,Sider:h,Header:D,Footer:w,OffLayoutArea:x,onLiveEvent:d,options:f})=>{let{optionsWithDefaults:C,disableTelemetryWithDefault:T,reactQueryWithDefaults:R}=kr({options:f}),L=Tr(()=>{var U;return R.clientConfig instanceof Zs?R.clientConfig:new Zs({...R.clientConfig,defaultOptions:{...R.clientConfig.defaultOptions,queries:{refetchOnWindowFocus:!1,keepPreviousData:!0,...(U=R.clientConfig.defaultOptions)==null?void 0:U.queries}}})},[R.clientConfig]),E=ae.useMemo(()=>typeof a=="function"?a:()=>a??{},[a])();if(_s(s),o&&!s&&(c??[]).length===0)return p?ae.createElement(p,null):ae.createElement(io,null);let{RouterComponent:F=ae.Fragment}=s?{}:o??{};return ae.createElement(Ei,{client:L},ae.createElement(fs,{...E},ae.createElement(To,{...e??{},isProvided:!!e},ae.createElement(Po,{...t??{},isProvided:!!t},ae.createElement(es,{...r},ae.createElement(rs,{liveProvider:P},ae.createElement(us,{value:o&&!s?"legacy":"new"},ae.createElement(ps,{router:s},ae.createElement(xs,{...o},ae.createElement(ns,{resources:c??[]},ae.createElement(gs,{i18nProvider:v},ae.createElement(hs,{...n??{}},ae.createElement(ws,{...i??{}},ae.createElement(Xr,null,ae.createElement(wo,{mutationMode:C.mutationMode,warnWhenUnsavedChanges:C.warnWhenUnsavedChanges,syncWithLocation:C.syncWithLocation,Title:M,undoableTimeout:C.undoableTimeout,catchAll:y,DashboardPage:u,LoginPage:l,Layout:m,Sider:h,Footer:w,Header:D,OffLayoutArea:x,hasDashboard:!!u,liveMode:C.liveMode,onLiveEvent:d,options:C},ae.createElement(Qo,null,ae.createElement(F,null,g,!T&&ae.createElement(Gs,null),ae.createElement(uo,null))))))))))))))))))};import{useEffect as Mi,useState as Ii}from"react";var Xo=({notification:e})=>{let t=G(),{notificationDispatch:r}=Ge(),{open:o}=Ee(),[s,a]=Ii(),n=()=>{if(e.isRunning===!0&&(e.seconds===0&&e.doMutation(),e.isSilent||o==null||o({key:`${e.id}-${e.resource}-notification`,type:"progress",message:t("notifications.undoable",{seconds:St(e.seconds)},`You have ${St(e.seconds)} seconds to undo`),cancelMutation:e.cancelMutation,undoableTimeout:St(e.seconds)}),e.seconds>0)){s&&clearTimeout(s);let i=setTimeout(()=>{r({type:"DECREASE_NOTIFICATION_SECOND",payload:{id:e.id,seconds:e.seconds,resource:e.resource}})},1e3);a(i)}};return Mi(()=>{n()},[e]),null};import co,{useEffect as wi}from"react";var Si=({children:e,Layout:t,Sider:r,Header:o,Title:s,Footer:a,OffLayoutArea:n})=>{let{Layout:i,Footer:c,Header:u,Sider:p,Title:l,OffLayoutArea:y}=te();return co.createElement(t??i,{Sider:r??p,Header:o??u,Footer:a??c,Title:s??l,OffLayoutArea:n??y},e,co.createElement(Ai,null))},Ai=()=>{let{Prompt:e}=oe(),t=G(),{warnWhen:r,setWarnWhen:o}=Vt(),s=a=>(a.preventDefault(),a.returnValue=t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),a.returnValue);return wi(()=>(r&&window.addEventListener("beforeunload",s),window.removeEventListener("beforeunload",s)),[r]),co.createElement(e,{when:r,message:t("warnWhenUnsavedChanges","Are you sure you want to leave? You have unsaved changes."),setWarnWhen:o})};import we from"react";var ki=()=>{let e=pe(),[t,r]=we.useState(void 0);return we.useEffect(()=>{t&&e(t)},[t]),we.useCallback(s=>{t||r(s)},[t])};function Fi({redirectOnFail:e=!0,appendCurrentPathToQuery:t=!0,children:r,fallback:o,loading:s}){var C;let a=j(),n=Z(),i=!!(a!=null&&a.isProvided),c=!!(a!=null&&a.isLegacy),u=n==="legacy",p=le(),l=pe(),y=ki(),{replace:g}=ue(),{useLocation:P}=oe(),v=P(),{isLoading:M,isFetching:m,isSuccess:h,data:{authenticated:D,redirectTo:w}={},refetch:x}=fr({v3LegacyAuthProviderCompatible:c});we.useEffect(()=>{x()},[r,o]);let d=we.useRef({status:M?"initial":"pending",content:s??null});m?d.current.status="pending":m||(d.current.status="settled");let f=i?c?h:D:!0;if(d.current.status==="settled")if(f)d.current.content=we.createElement(we.Fragment,null,r??null);else if(typeof o<"u")d.current.content=we.createElement(we.Fragment,null,o);else{let T=`${u?v==null?void 0:v.pathname:p.pathname}`.replace(/(\?.*|#.*)$/,""),R=c?typeof e=="string"?e:"/login":typeof e=="string"?e:w;if(R)if(u){let L=t?`?to=${encodeURIComponent(T)}`:"";g(`${R}${L}`)}else y({to:R,query:t?{to:(C=p.params)!=null&&C.to?p.params.to:l({to:T,options:{keepQuery:!0},type:"path"})}:void 0,type:"replace"})}return i?we.createElement(we.Fragment,null,d.current.content):we.createElement(we.Fragment,null,r??null)}import{useEffect as Qi}from"react";var uo=()=>{let{useLocation:e}=oe(),{checkAuth:t}=re(),r=e();return Qi(()=>{t==null||t().catch(()=>!1)},[r==null?void 0:r.pathname]),null};import Dt from"react";var Vi=({resource:e,action:t,params:r,fallback:o,children:s,...a})=>{let{resource:n,id:i,action:c}=B(e),{identifier:u}=B(),l=(()=>{let g=(r==null?void 0:r.id)??i;return e&&e!==u?r==null?void 0:r.id:g})(),{data:y}=bs({resource:e??(n==null?void 0:n.name),action:t??c??"",params:r??{id:l,resource:n}});return y!=null&&y.can?Dt.isValidElement(s)?Dt.cloneElement(s,a):Dt.createElement(Dt.Fragment,null,s):(y==null?void 0:y.can)===!1?Dt.createElement(Dt.Fragment,null,o??null):null};import Lt,{useEffect as Bi}from"react";var Ys=[`
|
|
12
12
|
.banner {
|
|
13
13
|
display: flex;
|
|
14
14
|
@media (max-width: 1000px) {
|