@refinedev/core 4.26.3 → 4.26.4
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 +6 -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,11 @@
|
|
|
1
1
|
# @pankod/refine-core
|
|
2
2
|
|
|
3
|
+
## 4.26.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#4626](https://github.com/refinedev/refine/pull/4626) [`03597ed8a9a`](https://github.com/refinedev/refine/commit/03597ed8a9ad1bd2a6d51e6d7181de76b16c38f9) Thanks [@aliemir](https://github.com/aliemir)! - Added `resource` sanitization to the `useCanWithoutCache` hook to avoid cyclic value errors.
|
|
8
|
+
|
|
3
9
|
## 4.26.3
|
|
4
10
|
|
|
5
11
|
### 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=I
|
|
|
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 i=It({resource:P,id:U??"",queryOptions:{enabled:U!==void 0,...d},successNotification:r,errorNotification:o,meta:h,metaData:h,liveMode:s,onLiveEvent:u,dataProviderName:p}),{elapsedTime:f}=_({isLoading:i.isFetching,interval:l==null?void 0:l.interval,onInterval:l==null?void 0:l.onInterval});return{queryResult:i,showId:U,setShowId:S,overtime:{elapsedTime:f}}};import{useEffect as Da,useState as Or}from"react";import{parse as La}from"papaparse";import Ea from"lodash-es/chunk";var xT=({resourceName:e,resource:t,mapData:r=l=>l,paparseOptions:o,batchSize:n=Number.MAX_SAFE_INTEGER,onFinish:a,meta:s,metaData:u,onProgress:p,dataProviderName:d}={})=>{let[l,c]=Or(0),[m,P]=Or(0),[x,C]=Or(!1),{resource:v,identifier:g}=k(t??e),U=K(),S=Br(),h=wt(),i=U({resource:v,meta:M(s,u)}),f;n===1?f=h:f=S;let R=()=>{P(0),c(0),C(!1)},b=y=>{let D={succeeded:y.filter(L=>L.type==="success"),errored:y.filter(L=>L.type==="error")};a==null||a(D),C(!1)};Da(()=>{p==null||p({totalAmount:m,processedAmount:l})},[m,l]);let T=({file:y})=>(R(),new Promise(D=>{C(!0),La(y,{complete:async({data:L})=>{let A=Gt(L,r);if(P(A.length),n===1){let w=A.map(I=>async()=>({response:await h.mutateAsync({resource:g??"",values:I,successNotification:!1,errorNotification:!1,dataProviderName:d,meta:i,metaData:i}),value:I})),E=await Jt(w,({response:I,value:F})=>(c(V=>V+1),{response:[I.data],type:"success",request:[F]}),(I,F)=>({response:[I],type:"error",request:[A[F]]}));D(E)}else{let w=Ea(A,n),E=w.map(F=>async()=>({response:await S.mutateAsync({resource:g??"",values:F,successNotification:!1,errorNotification:!1,dataProviderName:d,meta:i,metaData:i}),value:F,currentBatchLength:F.length})),I=await Jt(E,({response:F,currentBatchLength:V,value:O})=>(c(G=>G+V),{response:F.data,type:"success",request:O}),(F,V)=>({response:[F],type:"error",request:w[V]}));D(I)}},...o})}).then(D=>(b(D),D)));return{inputProps:{type:"file",accept:".csv",onChange:y=>{y.target.files&&y.target.files.length>0&&T({file:y.target.files[0]})}},mutationResult:f,isLoading:x,handleChange:T}};import{useCallback as en,useState as Ua}from"react";var bT=({defaultVisible:e=!1}={})=>{let[t,r]=Ua(e),o=en(()=>r(!0),[t]),n=en(()=>r(!1),[t]);return{visible:t,show:o,close:n}};import Ma from"react";var Ft=()=>{let e=z(),{resource:t,resources:r}=k(),o=de();return Ma.useCallback(({resource:a,action:s,meta:u})=>{var m;let p=a||t;if(!p)return;let l=(m=fe(p,r,e==="legacy").find(P=>P.action===s))==null?void 0:m.route;return l?Pe(l,p==null?void 0:p.meta,o,u):void 0},[r,t,o])};var Ia=({resource:e,action:t,meta:r,legacy:o})=>Ft()({resource:e,action:t,meta:r,legacy:o});import wa,{useContext as Sa}from"react";var ot=()=>{let e=Sa(Ke);return e!=null&&e.Link?e.Link:({to:r,...o})=>wa.createElement("a",{href:r,...o})};import{useContext as Fa}from"react";import tn from"react";var ze={useHistory:()=>!1,useLocation:()=>!1,useParams:()=>({}),Prompt:()=>null,Link:()=>null},Aa=tn.createContext(ze),Qt=Aa,rn=({children:e,useHistory:t,useLocation:r,useParams:o,Prompt:n,Link:a,routes:s})=>tn.createElement(Qt.Provider,{value:{useHistory:t??ze.useHistory,useLocation:r??ze.useLocation,useParams:o??ze.useParams,Prompt:n??ze.Prompt,Link:a??ze.Link,routes:s??ze.routes}},e);var te=()=>{let e=Fa(Qt),{useHistory:t,useLocation:r,useParams:o,Prompt:n,Link:a,routes:s}=e??ze;return{useHistory:t,useLocation:r,useParams:o,Prompt:n,Link:a,routes:s}};import{useQuery as Qa}from"@tanstack/react-query";import{useContext as ka}from"react";import on from"react";var Xe=on.createContext({options:{buttons:{enableAccessControl:!0,hideIfUnauthorized:!1}}});var nn=({can:e,children:t,options:r})=>on.createElement(Xe.Provider,{value:{can:e,options:r?{...r,buttons:{enableAccessControl:!0,hideIfUnauthorized:!1,...r.buttons}}:{buttons:{enableAccessControl:!0,hideIfUnauthorized:!1}}}},t);var gt=e=>{if(!e)return;let{icon:t,list:r,edit:o,create:n,show:a,clone:s,children:u,meta:p,options:d,...l}=e,{icon:c,...m}=p??{},{icon:P,...x}=d??{};return{...l,...p?{meta:m}:{},...d?{options:x}:{}}};var sn=({action:e,resource:t,params:r,queryOptions:o})=>{let{can:n}=ka(Xe),{resource:a,...s}=r??{},u=gt(a),p=Qa(["useCan",{action:e,resource:t,params:{...s,resource:u},enabled:o==null?void 0:o.enabled}],()=>(n==null?void 0:n({action:e,resource:t,params:{...s,resource:u}}))??Promise.resolve({can:!0}),{enabled:typeof n<"u",...o,retry:!1});return typeof n>"u"?{data:{can:!0}}:p};import an from"react";var mR=()=>{let{can:e}=an.useContext(Xe);return{can:an.useMemo(()=>e?async({params:o,...n})=>{let a=o!=null&&o.resource?gt(o.resource):void 0;return e({...n,...o?{params:{...o,resource:a}}:{}})}:void 0,[e])}};import{useCallback as un,useMemo as Va,useState as $r}from"react";import Ba from"lodash/uniqBy";import Na from"lodash/debounce";import sr from"lodash/get";var UR=e=>{let[t,r]=$r([]),[o,n]=$r([]),[a,s]=$r([]),{resource:u,sort:p,sorters:d,filters:l=[],optionLabel:c="title",optionValue:m="id",debounce:P=300,successNotification:x,errorNotification:C,defaultValueQueryOptions:v,queryOptions:g,fetchSize:U,pagination:S,hasPagination:h=!1,liveMode:i,defaultValue:f=[],onLiveEvent:R,onSearch:b,liveParams:T,meta:y,metaData:D,dataProviderName:L,overtimeOptions:A}=e,{resource:w,identifier:E}=k(u),F=K()({resource:w,meta:M(y,D)}),V=Array.isArray(f)?f:[f],O=un(Z=>{s(Z.data.map(se=>({label:sr(se,c),value:sr(se,m)})))},[c,m]),G=v??g,X=Ar({resource:E,ids:V,queryOptions:{...G,enabled:V.length>0&&((G==null?void 0:G.enabled)??!0),onSuccess:Z=>{var se;O(Z),(se=G==null?void 0:G.onSuccess)==null||se.call(G,Z)}},meta:F,metaData:F,liveMode:"off",dataProviderName:L}),j=un(Z=>{n(Z.data.map(se=>({label:sr(se,c),value:sr(se,m)})))},[c,m]),Q=Mt({resource:E,sorters:M(d,p),filters:l.concat(t),pagination:{current:S==null?void 0:S.current,pageSize:(S==null?void 0:S.pageSize)??U,mode:S==null?void 0:S.mode},hasPagination:h,queryOptions:{...g,onSuccess:Z=>{var se;j(Z),(se=g==null?void 0:g.onSuccess)==null||se.call(g,Z)}},successNotification:x,errorNotification:C,meta:F,metaData:F,liveMode:i,liveParams:T,onLiveEvent:R,dataProviderName:L}),$=Z=>{if(b){r(b(Z));return}if(Z)r([{field:c,operator:"contains",value:Z}]);else{r([]);return}},{elapsedTime:H}=_({isLoading:Q.isFetching||X.isFetching,interval:A==null?void 0:A.interval,onInterval:A==null?void 0:A.onInterval});return{queryResult:Q,defaultValueQueryResult:X,options:Va(()=>Ba([...o,...a],"value"),[o,a]),onSearch:Na($,P),overtime:{elapsedTime:H}}};import Ha,{useState as ar,useEffect as cn}from"react";import pn from"qs";import ir from"lodash/differenceWith";import ur from"lodash/isEqual";import Oa from"warn-once";var dn=[],ln=[];function $R({initialCurrent:e,initialPageSize:t,hasPagination:r=!0,pagination:o,initialSorter:n,permanentSorter:a=ln,defaultSetFilterBehavior:s,initialFilter:u,permanentFilter:p=dn,filters:d,sorters:l,syncWithLocation:c,resource:m,successNotification:P,errorNotification:x,queryOptions:C,liveMode:v,onLiveEvent:g,liveParams:U,meta:S,metaData:h,dataProviderName:i,overtimeOptions:f}={}){var Yr,Jr,Xr,qr,eo;let{syncWithLocation:R}=Sr(),b=c??R,T=jo(v),y=z(),{useLocation:D}=te(),{search:L,pathname:A}=D(),w=K(),E=de(),I=((d==null?void 0:d.mode)||"server")==="server",F=((l==null?void 0:l.mode)||"server")==="server",V=r===!1?"off":"server",O=((o==null?void 0:o.mode)??V)!=="off",G=M(o==null?void 0:o.current,e),X=M(o==null?void 0:o.pageSize,t),j=M(S,h),{parsedCurrent:Q,parsedPageSize:$,parsedSorter:H,parsedFilters:Z}=Wt(L??"?"),se=M(d==null?void 0:d.initial,u),ge=M(d==null?void 0:d.permanent,p)??dn,qe=M(l==null?void 0:l.initial,n),Oe=M(l==null?void 0:l.permanent,a)??ln,cr=M(d==null?void 0:d.defaultBehavior,s)??"merge",at,et,it,ut;b?(at=((Yr=E==null?void 0:E.params)==null?void 0:Yr.current)||Q||G||1,et=((Jr=E==null?void 0:E.params)==null?void 0:Jr.pageSize)||$||X||10,it=((Xr=E==null?void 0:E.params)==null?void 0:Xr.sorters)||(H.length?H:qe),ut=((qr=E==null?void 0:E.params)==null?void 0:qr.filters)||(Z.length?Z:se)):(at=G||1,et=X||10,it=qe,ut=se);let{replace:ct}=ue(),pt=ce(),{resource:jr,identifier:Vt}=k(m),pr=w({resource:jr,meta:j});Ha.useEffect(()=>{Oa(typeof Vt>"u","useTable: `resource` is not defined.")},[Vt]);let[_e,Ct]=ar(jt(Oe,it??[])),[tt,Te]=ar(_t(ge,ut??[])),[Ee,Be]=ar(at),[Ue,Me]=ar(et),je=({pagination:{current:me,pageSize:Ie},sorter:Nt,filters:Ht})=>{if(y==="new")return pt({type:"path",options:{keepHash:!0,keepQuery:!0},query:{...O?{current:me,pageSize:Ie}:{},sorters:Nt,filters:Ht,...Ze()}})??"";{let ht=pn.parse(L==null?void 0:L.substring(1)),Vn=Kt({pagination:{pageSize:Ie,current:me},sorters:_e??Nt,filters:Ht,...ht});return`${A??""}?${Vn??""}`}};cn(()=>{L===""&&(Be(at),Me(et),Ct(jt(Oe,it??[])),Te(_t(ge,ut??[])))},[L]);let Ze=()=>{if(y==="new"){let{sorters:me,filters:Ie,pageSize:Nt,current:Ht,...ht}=(E==null?void 0:E.params)??{};return ht}else{let{sorter:me,filters:Ie,pageSize:Nt,current:Ht,...ht}=pn.parse(L,{ignoreQueryPrefix:!0});return ht}};cn(()=>{if(b){let me=Ze();if(y==="new")pt({type:"replace",options:{keepQuery:!0},query:{...O?{pageSize:Ue,current:Ee}:{},sorters:ir(_e,Oe,ur),filters:ir(tt,ge,ur)}});else{let Ie=Kt({...O?{pagination:{pageSize:Ue,current:Ee}}:{},sorters:ir(_e,Oe,ur),filters:ir(tt,ge,ur),...me});return ct==null?void 0:ct(`${A}?${Ie}`,void 0,{shallow:!0})}}},[b,Ee,Ue,_e,tt]);let $e=Mt({resource:Vt,hasPagination:r,pagination:{current:Ee,pageSize:Ue,mode:o==null?void 0:o.mode},filters:I?mt(ge,tt):void 0,sorters:F?zt(Oe,_e):void 0,queryOptions:C,successNotification:P,errorNotification:x,meta:pr,metaData:pr,liveMode:T,liveParams:U,onLiveEvent:g,dataProviderName:i}),Bt=me=>{Te(Ie=>mt(ge,me,Ie))},An=me=>{Te(mt(ge,me))},Fn=me=>{Te(Ie=>mt(ge,me(Ie)))},Qn=(me,Ie=cr)=>{typeof me=="function"?Fn(me):Ie==="replace"?An(me):Bt(me)},Zr=me=>{Ct(()=>zt(Oe,me))},{elapsedTime:kn}=_({isLoading:$e.isFetching,interval:f==null?void 0:f.interval,onInterval:f==null?void 0:f.onInterval});return{tableQueryResult:$e,sorters:_e,setSorters:Zr,sorter:_e,setSorter:Zr,filters:tt,setFilters:Qn,current:Ee,setCurrent:Be,pageSize:Ue,setPageSize:Me,pageCount:Ue?Math.ceil((((eo=$e.data)==null?void 0:eo.total)??0)/Ue):1,createLinkForSyncWithLocation:je,overtime:{elapsedTime:kn}}}import{useContext as yn}from"react";import{useMutation as gn,useQueryClient as $a}from"@tanstack/react-query";import mn from"react";var nt=mn.createContext({}),fn=({create:e,get:t,update:r,children:o})=>mn.createElement(nt.Provider,{value:{create:e,get:t,update:r}},o);var Se=({logMutationOptions:e,renameMutationOptions:t}={})=>{let r=$a(),o=yn(nt),n=W(),{resources:a}=yn(Je),{data:s,refetch:u,isLoading:p}=dr({v3LegacyAuthProviderCompatible:!!(n!=null&&n.isLegacy),queryOptions:{enabled:!!o}}),d=gn(async c=>{var C,v,g,U,S;let m=pe(c.resource,a),P=M((C=m==null?void 0:m.meta)==null?void 0:C.audit,(v=m==null?void 0:m.options)==null?void 0:v.audit,(U=(g=m==null?void 0:m.options)==null?void 0:g.auditLog)==null?void 0:U.permissions);if(P&&!hr(P,c.action))return;let x;return p&&(x=await u()),await((S=o.create)==null?void 0:S.call(o,{...c,author:s??(x==null?void 0:x.data)}))},e),l=gn(async c=>{var m;return await((m=o.update)==null?void 0:m.call(o,c))},{onSuccess:c=>{if(c!=null&&c.resource){let m=q(c==null?void 0:c.resource);r.invalidateQueries(m.logList())}},...t});return{log:d,rename:l}};import{useContext as Ga}from"react";import{useQuery as Wa}from"@tanstack/react-query";var cP=({resource:e,action:t,meta:r,author:o,metaData:n,queryOptions:a})=>{let{get:s}=Ga(nt),u=q(e,void 0,n);return Wa(u.logList(r),()=>(s==null?void 0:s({resource:e,action:t,author:o,meta:r,metaData:n}))??Promise.resolve([]),{enabled:typeof s<"u",...a,retry:!1})};import{useCallback as Ka}from"react";import{useQueryClient as za}from"@tanstack/react-query";var Ae=()=>{let{resources:e}=k(),t=za();return Ka(({resource:o,dataProviderName:n,invalidates:a,id:s})=>{if(a===!1)return;let u=q(o,N(o,n,e));a.forEach(p=>{switch(p){case"all":t.invalidateQueries(u.all);break;case"list":t.invalidateQueries(u.list());break;case"many":t.invalidateQueries(u.many());break;case"resourceAll":t.invalidateQueries(u.resourceAll);break;case"detail":t.invalidateQueries(u.detail(s||""));break;default:break}})},[])};import{useContext as _a}from"react";import ja from"warn-once";var IP=({meta:e={}}={})=>{let t=z(),{i18nProvider:r}=_a(Fe),o=de(),n=B(),{resources:a,resource:s,action:u}=k(),{options:{textTransformers:p}}=ae(),d=[];if(!(s!=null&&s.name))return{breadcrumbs:d};let l=c=>{var P,x,C,v,g,U;let m=typeof c=="string"?pe(c,a,t==="legacy")??{name:c}:c;if(m){let S=M((P=m==null?void 0:m.meta)==null?void 0:P.parent,m==null?void 0:m.parentName);S&&l(S);let h=fe(m,a,t==="legacy").find(R=>R.action==="list"),i=(x=h==null?void 0:h.resource)!=null&&x.list?h==null?void 0:h.route:void 0,f=i?t==="legacy"?i:Pe(i,m==null?void 0:m.meta,o,e):void 0;d.push({label:M((C=m.meta)==null?void 0:C.label,(v=m.options)==null?void 0:v.label)??n(`${m.name}.${m.name}`,p.humanize(m.name)),href:f,icon:M((g=m.meta)==null?void 0:g.icon,(U=m.options)==null?void 0:U.icon,m.icon)})}};if(l(s),u&&u!=="list"){let c=`actions.${u}`,m=n(c);typeof r<"u"&&m===c?(ja(!0,`[useBreadcrumb]: Breadcrumb missing translate key for the "${u}" action. Please add "actions.${u}" key to your translation file.
|
|
11
|
-
For more information, see https://refine.dev/docs/api-reference/core/hooks/useBreadcrumb/#i18n-support`),d.push({label:n(`buttons.${u}`,p.humanize(u))})):d.push({label:n(c,p.humanize(u))})}return{breadcrumbs:d}};import Gr from"react";var Tt=(e,t,r=!1)=>{let o=[],n=De(e,t);for(;n;)o.push(n),n=De(n,t);return o.reverse(),`/${[...o,e].map(s=>Re((r?s.route:void 0)??s.identifier??s.name)).join("/").replace(/^\//,"")}`};var Tn=(e,t=!1)=>{let r={item:{name:"__root__"},children:{}};e.forEach(n=>{let a=[],s=De(n,e);for(;s;)a.push(s),s=De(s,e);a.reverse();let u=r;a.forEach(d=>{let l=(t?d.route:void 0)??d.identifier??d.name;u.children[l]||(u.children[l]={item:d,children:{}}),u=u.children[l]});let p=(t?n.route:void 0)??n.identifier??n.name;u.children[p]||(u.children[p]={item:n,children:{}})});let o=n=>{let a=[];return Object.keys(n.children).forEach(s=>{let u=Tt(n.children[s].item,e,t),p={...n.children[s].item,key:u,children:o(n.children[s])};a.push(p)}),a};return o(r)};var Rn=e=>e.split("?")[0].split("#")[0].replace(/(.+)(\/$)/,"$1"),Za=({meta:e,hideOnMissingParameter:t}={hideOnMissingParameter:!0})=>{let r=B(),o=Ft(),n=z(),{resource:a,resources:s}=k(),{pathname:u}=de(),{useLocation:p}=te(),{pathname:d}=p(),l=ft(),m=`/${((n==="legacy"?Rn(d):u?Rn(u):void 0)??"").replace(/^\//,"")}`,P=a?Tt(a,s,n==="legacy"):m??"",x=Gr.useMemo(()=>{if(!a)return[];let g=De(a,s),U=[Tt(a,s)];for(;g;)U.push(Tt(g,s)),g=De(g,s);return U},[]),C=Gr.useCallback(g=>{var S,h,i,f,R,b;if((((S=g==null?void 0:g.meta)==null?void 0:S.hide)??((h=g==null?void 0:g.options)==null?void 0:h.hide))||!(g!=null&&g.list)&&g.children.length===0)return;let U=g.list?o({resource:g,action:"list",legacy:n==="legacy",meta:e}):void 0;if(!(t&&U&&U.match(/(\/|^):(.+?)(\/|$){1}/)))return{...g,route:U,icon:M((i=g.meta)==null?void 0:i.icon,(f=g.options)==null?void 0:f.icon,g.icon),label:M((R=g==null?void 0:g.meta)==null?void 0:R.label,(b=g==null?void 0:g.options)==null?void 0:b.label)??r(`${g.name}.${g.name}`,l(g.name,"plural"))}},[n,e,r,t]),v=Gr.useMemo(()=>{let g=Tn(s,n==="legacy"),U=S=>S.flatMap(h=>{let i=U(h.children),f=C({...h,children:i});return f?[f]:[]});return U(g)},[s,n,C]);return{defaultOpenKeys:x,selectedKey:P,menuItems:v}};var K=()=>{let{params:e}=de();return({resource:r,meta:o}={})=>{let{meta:n}=gt(r)??{meta:{}},{filters:a,sorters:s,current:u,pageSize:p,...d}=e??{};return{...n,...d,...o}}};var Xa=()=>{let[e,t]=Ja(),r=B(),{push:o}=ue(),n=ce(),a=z(),{resource:s,action:u}=k();return Ya(()=>{s&&u&&t(r("pages.error.info",{action:u,resource:s.name},`You may have forgotten to add the "${u}" component to "${s.name}" resource.`))},[s,u]),kt.createElement(kt.Fragment,null,kt.createElement("h1",null,r("pages.error.404",void 0,"Sorry, the page you visited does not exist.")),e&&kt.createElement("p",null,e),kt.createElement("button",{onClick:()=>{a==="legacy"?o("/"):n({to:"/"})}},r("pages.error.backHome",void 0,"Back Home")))};import xe,{useState as Pn}from"react";var Ur=()=>{let[e,t]=Pn(""),[r,o]=Pn(""),n=B(),a=W(),{mutate:s}=bt({v3LegacyAuthProviderCompatible:!!(a!=null&&a.isLegacy)});return xe.createElement(xe.Fragment,null,xe.createElement("h1",null,n("pages.login.title","Sign in your account")),xe.createElement("form",{onSubmit:u=>{u.preventDefault(),s({username:e,password:r})}},xe.createElement("table",null,xe.createElement("tbody",null,xe.createElement("tr",null,xe.createElement("td",null,n("pages.login.username",void 0,"username"),":"),xe.createElement("td",null,xe.createElement("input",{type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",autoFocus:!0,required:!0,value:e,onChange:u=>t(u.target.value)}))),xe.createElement("tr",null,xe.createElement("td",null,n("pages.login.password",void 0,"password"),":"),xe.createElement("td",null,xe.createElement("input",{type:"password",required:!0,size:20,value:r,onChange:u=>o(u.target.value)}))))),xe.createElement("br",null),xe.createElement("input",{type:"submit",value:"login"})))};import Rt from"react";import le,{useState as Wr}from"react";var xn=({providers:e,registerLink:t,forgotPasswordLink:r,rememberMe:o,contentProps:n,wrapperProps:a,renderContent:s,formProps:u,title:p=void 0})=>{let d=z(),l=ot(),{Link:c}=te(),m=d==="legacy"?c:l,[P,x]=Wr(""),[C,v]=Wr(""),[g,U]=Wr(!1),S=B(),h=W(),{mutate:i}=bt({v3LegacyAuthProviderCompatible:!!(h!=null&&h.isLegacy)}),f=(T,y)=>le.createElement(m,{to:T},y),R=()=>e?e.map(T=>le.createElement("div",{key:T.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},le.createElement("button",{onClick:()=>i({providerName:T.name}),style:{display:"flex",alignItems:"center"}},T==null?void 0:T.icon,T.label??le.createElement("label",null,T.label)))):null,b=le.createElement("div",{...n},le.createElement("h1",{style:{textAlign:"center"}},S("pages.login.title","Sign in to your account")),R(),le.createElement("hr",null),le.createElement("form",{onSubmit:T=>{T.preventDefault(),i({email:P,password:C,remember:g})},...u},le.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},le.createElement("label",{htmlFor:"email-input"},S("pages.login.fields.email","Email")),le.createElement("input",{id:"email-input",name:"email",type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:P,onChange:T=>x(T.target.value)}),le.createElement("label",{htmlFor:"password-input"},S("pages.login.fields.password","Password")),le.createElement("input",{id:"password-input",type:"password",name:"password",required:!0,size:20,value:C,onChange:T=>v(T.target.value)}),o??le.createElement(le.Fragment,null,le.createElement("label",{htmlFor:"remember-me-input"},S("pages.login.buttons.rememberMe","Remember me"),le.createElement("input",{id:"remember-me-input",name:"remember",type:"checkbox",size:20,checked:g,value:g.toString(),onChange:()=>{U(!g)}}))),le.createElement("br",null),r??f("/forgot-password",S("pages.login.buttons.forgotPassword","Forgot password?")),le.createElement("input",{type:"submit",value:S("pages.login.signin","Sign in")}),t??le.createElement("span",null,S("pages.login.buttons.noAccount","Don\u2019t have an account?")," ",f("/register",S("pages.login.register","Sign up"))))));return le.createElement("div",{...a},s?s(b,p):b)};import ye,{useState as Cn}from"react";var hn=({providers:e,loginLink:t,wrapperProps:r,contentProps:o,renderContent:n,formProps:a,title:s=void 0})=>{let u=z(),p=ot(),{Link:d}=te(),l=u==="legacy"?d:p,[c,m]=Cn(""),[P,x]=Cn(""),C=B(),v=W(),{mutate:g,isLoading:U}=yr({v3LegacyAuthProviderCompatible:!!(v!=null&&v.isLegacy)}),S=(f,R)=>ye.createElement(l,{to:f},R),h=()=>e?e.map(f=>ye.createElement("div",{key:f.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},ye.createElement("button",{onClick:()=>g({providerName:f.name}),style:{display:"flex",alignItems:"center"}},f==null?void 0:f.icon,f.label??ye.createElement("label",null,f.label)))):null,i=ye.createElement("div",{...o},ye.createElement("h1",{style:{textAlign:"center"}},C("pages.register.title","Sign up for your account")),h(),ye.createElement("hr",null),ye.createElement("form",{onSubmit:f=>{f.preventDefault(),g({email:c,password:P})},...a},ye.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},ye.createElement("label",{htmlFor:"email-input"},C("pages.register.fields.email","Email")),ye.createElement("input",{id:"email-input",name:"email",type:"email",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:c,onChange:f=>m(f.target.value)}),ye.createElement("label",{htmlFor:"password-input"},C("pages.register.fields.password","Password")),ye.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:P,onChange:f=>x(f.target.value)}),ye.createElement("input",{type:"submit",value:C("pages.register.buttons.submit","Sign up"),disabled:U}),t??ye.createElement(ye.Fragment,null,ye.createElement("span",null,C("pages.login.buttons.haveAccount","Have an account?")," ",S("/login",C("pages.login.signin","Sign in")))))));return ye.createElement("div",{...r},n?n(i,s):i)};import Qe,{useState as qa}from"react";var bn=({loginLink:e,wrapperProps:t,contentProps:r,renderContent:o,formProps:n,title:a=void 0})=>{let s=B(),u=z(),p=ot(),{Link:d}=te(),l=u==="legacy"?d:p,[c,m]=qa(""),{mutate:P,isLoading:x}=Tr(),C=(g,U)=>Qe.createElement(l,{to:g},U),v=Qe.createElement("div",{...r},Qe.createElement("h1",{style:{textAlign:"center"}},s("pages.forgotPassword.title","Forgot your password?")),Qe.createElement("hr",null),Qe.createElement("form",{onSubmit:g=>{g.preventDefault(),P({email:c})},...n},Qe.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},Qe.createElement("label",{htmlFor:"email-input"},s("pages.forgotPassword.fields.email","Email")),Qe.createElement("input",{id:"email-input",name:"email",type:"mail",autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:c,onChange:g=>m(g.target.value)}),Qe.createElement("input",{type:"submit",disabled:x,value:s("pages.forgotPassword.buttons.submit","Send reset instructions")}),Qe.createElement("br",null),e??Qe.createElement("span",null,s("pages.register.buttons.haveAccount","Have an account? ")," ",C("/login",s("pages.login.signin","Sign in"))))));return Qe.createElement("div",{...t},o?o(v,a):v)};import Ve,{useState as vn}from"react";var Dn=({wrapperProps:e,contentProps:t,renderContent:r,formProps:o,title:n=void 0})=>{let a=B(),s=W(),{mutate:u,isLoading:p}=Pr({v3LegacyAuthProviderCompatible:!!(s!=null&&s.isLegacy)}),[d,l]=vn(""),[c,m]=vn(""),P=Ve.createElement("div",{...t},Ve.createElement("h1",{style:{textAlign:"center"}},a("pages.updatePassword.title","Update Password")),Ve.createElement("hr",null),Ve.createElement("form",{onSubmit:x=>{x.preventDefault(),u({password:d,confirmPassword:c})},...o},Ve.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},Ve.createElement("label",{htmlFor:"password-input"},a("pages.updatePassword.fields.password","New Password")),Ve.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:d,onChange:x=>l(x.target.value)}),Ve.createElement("label",{htmlFor:"confirm-password-input"},a("pages.updatePassword.fields.confirmPassword","Confirm New Password")),Ve.createElement("input",{id:"confirm-password-input",name:"confirmPassword",type:"password",required:!0,size:20,value:c,onChange:x=>m(x.target.value)}),Ve.createElement("input",{type:"submit",disabled:p,value:a("pages.updatePassword.buttons.submit","Update")}))));return Ve.createElement("div",{...e},r?r(P,n):P)};var ei=e=>{let{type:t}=e;return Rt.createElement(Rt.Fragment,null,(()=>{switch(t){case"register":return Rt.createElement(hn,{...e});case"forgotPassword":return Rt.createElement(bn,{...e});case"updatePassword":return Rt.createElement(Dn,{...e});default:return Rt.createElement(xn,{...e})}})())};import ve from"react";var Kr=()=>ve.createElement(ve.Fragment,null,ve.createElement("h1",null,"Welcome on board"),ve.createElement("p",null,"Your configuration is completed."),ve.createElement("p",null,"Now you can get started by adding your resources to the"," ",ve.createElement("code",null,"`resources`")," property of ",ve.createElement("code",null,"`<Refine>`")),ve.createElement("div",{style:{display:"flex",gap:8}},ve.createElement("a",{href:"https://refine.dev",target:"_blank",rel:"noreferrer"},ve.createElement("button",null,"Documentation")),ve.createElement("a",{href:"https://refine.dev/examples",target:"_blank",rel:"noreferrer"},ve.createElement("button",null,"Examples")),ve.createElement("a",{href:"https://discord.gg/refine",target:"_blank",rel:"noreferrer"},ve.createElement("button",null,"Community"))));import J,{useState as ti}from"react";var ri=[{title:"Documentation",description:"Learn about the technical details of using refine in your projects.",link:"https://refine.dev/",icon:J.createElement("svg",{width:"14",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J.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:J.createElement("svg",{width:"16",height:"14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J.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"}),J.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:J.createElement("svg",{width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J.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"}),J.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:J.createElement("svg",{width:"16",height:"12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J.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"}))}],oi=()=>{let e=tr("(max-width: 1010px)"),t=tr("(max-width: 650px)"),r=()=>t?"1, 280px":e?"2, 280px":"4, 208px",o=()=>t?"32px":e?"40px":"48px",n=()=>t?"16px":e?"20px":"24px";return J.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"}},J.createElement("div",{style:{height:"89px"}}),J.createElement("div",{style:{display:"flex",justifyContent:"center"}},J.createElement("img",{src:"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/welcome-logo.webp",width:"198",height:"54"})),J.createElement("div",{style:{height:e?"270px":"22vw",minHeight:e?"270px":"313px"}}),J.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px",textAlign:"center"}},J.createElement("h1",{style:{fontSize:o(),fontWeight:700,margin:"0px"}},"Welcome Aboard!"),J.createElement("h4",{style:{fontSize:n(),fontWeight:400,margin:"0px"}},"Your configuration is completed.")),J.createElement("div",{style:{height:"64px"}}),J.createElement("div",{style:{display:"grid",gridTemplateColumns:`repeat(${r()})`,justifyContent:"center",gap:"48px",paddingRight:"16px",paddingLeft:"16px",maxWidth:"976px",margin:"auto"}},ri.map(a=>J.createElement(ni,{key:`welcome-page-${a.title}`,card:a}))),J.createElement("div",{style:{height:"64px"}}))},ni=({card:e})=>{let{title:t,description:r,icon:o,link:n}=e,[a,s]=ti(!1);return J.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},J.createElement("div",{style:{display:"flex",alignItems:"center"}},J.createElement("a",{onPointerEnter:()=>s(!0),onPointerLeave:()=>s(!1),style:{display:"flex",alignItems:"center",color:"#fff",textDecoration:"none"},href:n},o,J.createElement("span",{style:{fontSize:"16px",fontWeight:700,marginLeft:"13px",marginRight:"14px"}},t),J.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"},J.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"})))),J.createElement("span",{style:{fontSize:"12px",opacity:.5,lineHeight:"16px"}},r))};import{QueryClient as wn,QueryClientProvider as ui}from"@tanstack/react-query";import{ReactQueryDevtools as ci}from"@tanstack/react-query-devtools";import ne from"react";import{useEffect as ai}from"react";import{useContext as st}from"react";var si="4.26.3",Ln=()=>{let e=xr(),t=st(nt),r=st(We),o=st(Qt),n=st(St),{i18nProvider:a}=st(Fe),s=st(At),u=st(Xe),{resources:p}=k(),d=!!t.create||!!t.get||!!t.update,l=!!(r!=null&&r.publish)||!!(r!=null&&r.subscribe)||!!(r!=null&&r.unsubscribe),c=!!o.useHistory||!!o.Link||!!o.Prompt||!!o.useLocation||!!o.useParams,m=!!n,P=!!(a!=null&&a.changeLocale)||!!(a!=null&&a.getLocale)||!!(a!=null&&a.translate),x=!!s.close||!!s.open,C=!!u.can;return{providers:{auth:e,auditLog:d,live:l,router:c,data:m,i18n:P,notification:x,accessControl:C},version:si,resourceCount:p.length}};var ii=e=>{let t=JSON.stringify(e||{});return typeof btoa<"u"?btoa(t):Buffer.from(t).toString("base64")},En=()=>{let e=Ln();return ai(()=>{if(typeof window>"u"&&!Image)return;let t=new Image;t.src=`https://telemetry.refine.dev/telemetry?payload=${ii(e)}`},[]),null};import pi from"warn-once";var Un=e=>{let t=["go","parse","back","Link"],r=Object.keys(e).filter(n=>!t.includes(n));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 Mn from"react";var In=e=>{let t=Mn.useRef(!1);Mn.useEffect(()=>{t.current===!1&&e&&Un(e)&&(t.current=!0)},[e])};var di=({legacyAuthProvider:e,authProvider:t,dataProvider:r,legacyRouterProvider:o,routerProvider:n,notificationProvider:a,accessControlProvider:s,auditLogProvider:u,resources:p,DashboardPage:d,ReadyPage:l,LoginPage:c,catchAll:m,children:P,liveProvider:x,i18nProvider:C,Title:v,Layout:g,Sider:U,Header:S,Footer:h,OffLayoutArea:i,onLiveEvent:f,options:R})=>{var E;let{optionsWithDefaults:b,disableTelemetryWithDefault:T,reactQueryWithDefaults:y}=Mr({options:R}),D=nr(()=>{var I;return y.clientConfig instanceof wn?y.clientConfig:new wn({...y.clientConfig,defaultOptions:{...y.clientConfig.defaultOptions,queries:{refetchOnWindowFocus:!1,keepPreviousData:!0,...(I=y.clientConfig.defaultOptions)==null?void 0:I.queries}}})},[y.clientConfig]),A=ne.useMemo(()=>typeof a=="function"?a:()=>a??{},[a])();if(In(n),o&&!n&&(p??[]).length===0)return l?ne.createElement(l,null):ne.createElement(Kr,null);let{RouterComponent:w=ne.Fragment}=n?{}:o??{};return typeof window<"u"&&((E=window==null?void 0:window.location)==null?void 0:E.hostname)==="localhost"&&pi(!0,`%c
|
|
11
|
+
For more information, see https://refine.dev/docs/api-reference/core/hooks/useBreadcrumb/#i18n-support`),d.push({label:n(`buttons.${u}`,p.humanize(u))})):d.push({label:n(c,p.humanize(u))})}return{breadcrumbs:d}};import Gr from"react";var Tt=(e,t,r=!1)=>{let o=[],n=De(e,t);for(;n;)o.push(n),n=De(n,t);return o.reverse(),`/${[...o,e].map(s=>Re((r?s.route:void 0)??s.identifier??s.name)).join("/").replace(/^\//,"")}`};var Tn=(e,t=!1)=>{let r={item:{name:"__root__"},children:{}};e.forEach(n=>{let a=[],s=De(n,e);for(;s;)a.push(s),s=De(s,e);a.reverse();let u=r;a.forEach(d=>{let l=(t?d.route:void 0)??d.identifier??d.name;u.children[l]||(u.children[l]={item:d,children:{}}),u=u.children[l]});let p=(t?n.route:void 0)??n.identifier??n.name;u.children[p]||(u.children[p]={item:n,children:{}})});let o=n=>{let a=[];return Object.keys(n.children).forEach(s=>{let u=Tt(n.children[s].item,e,t),p={...n.children[s].item,key:u,children:o(n.children[s])};a.push(p)}),a};return o(r)};var Rn=e=>e.split("?")[0].split("#")[0].replace(/(.+)(\/$)/,"$1"),Za=({meta:e,hideOnMissingParameter:t}={hideOnMissingParameter:!0})=>{let r=B(),o=Ft(),n=z(),{resource:a,resources:s}=k(),{pathname:u}=de(),{useLocation:p}=te(),{pathname:d}=p(),l=ft(),m=`/${((n==="legacy"?Rn(d):u?Rn(u):void 0)??"").replace(/^\//,"")}`,P=a?Tt(a,s,n==="legacy"):m??"",x=Gr.useMemo(()=>{if(!a)return[];let g=De(a,s),U=[Tt(a,s)];for(;g;)U.push(Tt(g,s)),g=De(g,s);return U},[]),C=Gr.useCallback(g=>{var S,h,i,f,R,b;if((((S=g==null?void 0:g.meta)==null?void 0:S.hide)??((h=g==null?void 0:g.options)==null?void 0:h.hide))||!(g!=null&&g.list)&&g.children.length===0)return;let U=g.list?o({resource:g,action:"list",legacy:n==="legacy",meta:e}):void 0;if(!(t&&U&&U.match(/(\/|^):(.+?)(\/|$){1}/)))return{...g,route:U,icon:M((i=g.meta)==null?void 0:i.icon,(f=g.options)==null?void 0:f.icon,g.icon),label:M((R=g==null?void 0:g.meta)==null?void 0:R.label,(b=g==null?void 0:g.options)==null?void 0:b.label)??r(`${g.name}.${g.name}`,l(g.name,"plural"))}},[n,e,r,t]),v=Gr.useMemo(()=>{let g=Tn(s,n==="legacy"),U=S=>S.flatMap(h=>{let i=U(h.children),f=C({...h,children:i});return f?[f]:[]});return U(g)},[s,n,C]);return{defaultOpenKeys:x,selectedKey:P,menuItems:v}};var K=()=>{let{params:e}=de();return({resource:r,meta:o}={})=>{let{meta:n}=gt(r)??{meta:{}},{filters:a,sorters:s,current:u,pageSize:p,...d}=e??{};return{...n,...d,...o}}};var Xa=()=>{let[e,t]=Ja(),r=B(),{push:o}=ue(),n=ce(),a=z(),{resource:s,action:u}=k();return Ya(()=>{s&&u&&t(r("pages.error.info",{action:u,resource:s.name},`You may have forgotten to add the "${u}" component to "${s.name}" resource.`))},[s,u]),kt.createElement(kt.Fragment,null,kt.createElement("h1",null,r("pages.error.404",void 0,"Sorry, the page you visited does not exist.")),e&&kt.createElement("p",null,e),kt.createElement("button",{onClick:()=>{a==="legacy"?o("/"):n({to:"/"})}},r("pages.error.backHome",void 0,"Back Home")))};import xe,{useState as Pn}from"react";var Ur=()=>{let[e,t]=Pn(""),[r,o]=Pn(""),n=B(),a=W(),{mutate:s}=bt({v3LegacyAuthProviderCompatible:!!(a!=null&&a.isLegacy)});return xe.createElement(xe.Fragment,null,xe.createElement("h1",null,n("pages.login.title","Sign in your account")),xe.createElement("form",{onSubmit:u=>{u.preventDefault(),s({username:e,password:r})}},xe.createElement("table",null,xe.createElement("tbody",null,xe.createElement("tr",null,xe.createElement("td",null,n("pages.login.username",void 0,"username"),":"),xe.createElement("td",null,xe.createElement("input",{type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",autoFocus:!0,required:!0,value:e,onChange:u=>t(u.target.value)}))),xe.createElement("tr",null,xe.createElement("td",null,n("pages.login.password",void 0,"password"),":"),xe.createElement("td",null,xe.createElement("input",{type:"password",required:!0,size:20,value:r,onChange:u=>o(u.target.value)}))))),xe.createElement("br",null),xe.createElement("input",{type:"submit",value:"login"})))};import Rt from"react";import le,{useState as Wr}from"react";var xn=({providers:e,registerLink:t,forgotPasswordLink:r,rememberMe:o,contentProps:n,wrapperProps:a,renderContent:s,formProps:u,title:p=void 0})=>{let d=z(),l=ot(),{Link:c}=te(),m=d==="legacy"?c:l,[P,x]=Wr(""),[C,v]=Wr(""),[g,U]=Wr(!1),S=B(),h=W(),{mutate:i}=bt({v3LegacyAuthProviderCompatible:!!(h!=null&&h.isLegacy)}),f=(T,y)=>le.createElement(m,{to:T},y),R=()=>e?e.map(T=>le.createElement("div",{key:T.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},le.createElement("button",{onClick:()=>i({providerName:T.name}),style:{display:"flex",alignItems:"center"}},T==null?void 0:T.icon,T.label??le.createElement("label",null,T.label)))):null,b=le.createElement("div",{...n},le.createElement("h1",{style:{textAlign:"center"}},S("pages.login.title","Sign in to your account")),R(),le.createElement("hr",null),le.createElement("form",{onSubmit:T=>{T.preventDefault(),i({email:P,password:C,remember:g})},...u},le.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},le.createElement("label",{htmlFor:"email-input"},S("pages.login.fields.email","Email")),le.createElement("input",{id:"email-input",name:"email",type:"text",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:P,onChange:T=>x(T.target.value)}),le.createElement("label",{htmlFor:"password-input"},S("pages.login.fields.password","Password")),le.createElement("input",{id:"password-input",type:"password",name:"password",required:!0,size:20,value:C,onChange:T=>v(T.target.value)}),o??le.createElement(le.Fragment,null,le.createElement("label",{htmlFor:"remember-me-input"},S("pages.login.buttons.rememberMe","Remember me"),le.createElement("input",{id:"remember-me-input",name:"remember",type:"checkbox",size:20,checked:g,value:g.toString(),onChange:()=>{U(!g)}}))),le.createElement("br",null),r??f("/forgot-password",S("pages.login.buttons.forgotPassword","Forgot password?")),le.createElement("input",{type:"submit",value:S("pages.login.signin","Sign in")}),t??le.createElement("span",null,S("pages.login.buttons.noAccount","Don\u2019t have an account?")," ",f("/register",S("pages.login.register","Sign up"))))));return le.createElement("div",{...a},s?s(b,p):b)};import ye,{useState as Cn}from"react";var hn=({providers:e,loginLink:t,wrapperProps:r,contentProps:o,renderContent:n,formProps:a,title:s=void 0})=>{let u=z(),p=ot(),{Link:d}=te(),l=u==="legacy"?d:p,[c,m]=Cn(""),[P,x]=Cn(""),C=B(),v=W(),{mutate:g,isLoading:U}=yr({v3LegacyAuthProviderCompatible:!!(v!=null&&v.isLegacy)}),S=(f,R)=>ye.createElement(l,{to:f},R),h=()=>e?e.map(f=>ye.createElement("div",{key:f.name,style:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"1rem"}},ye.createElement("button",{onClick:()=>g({providerName:f.name}),style:{display:"flex",alignItems:"center"}},f==null?void 0:f.icon,f.label??ye.createElement("label",null,f.label)))):null,i=ye.createElement("div",{...o},ye.createElement("h1",{style:{textAlign:"center"}},C("pages.register.title","Sign up for your account")),h(),ye.createElement("hr",null),ye.createElement("form",{onSubmit:f=>{f.preventDefault(),g({email:c,password:P})},...a},ye.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},ye.createElement("label",{htmlFor:"email-input"},C("pages.register.fields.email","Email")),ye.createElement("input",{id:"email-input",name:"email",type:"email",size:20,autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:c,onChange:f=>m(f.target.value)}),ye.createElement("label",{htmlFor:"password-input"},C("pages.register.fields.password","Password")),ye.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:P,onChange:f=>x(f.target.value)}),ye.createElement("input",{type:"submit",value:C("pages.register.buttons.submit","Sign up"),disabled:U}),t??ye.createElement(ye.Fragment,null,ye.createElement("span",null,C("pages.login.buttons.haveAccount","Have an account?")," ",S("/login",C("pages.login.signin","Sign in")))))));return ye.createElement("div",{...r},n?n(i,s):i)};import Qe,{useState as qa}from"react";var bn=({loginLink:e,wrapperProps:t,contentProps:r,renderContent:o,formProps:n,title:a=void 0})=>{let s=B(),u=z(),p=ot(),{Link:d}=te(),l=u==="legacy"?d:p,[c,m]=qa(""),{mutate:P,isLoading:x}=Tr(),C=(g,U)=>Qe.createElement(l,{to:g},U),v=Qe.createElement("div",{...r},Qe.createElement("h1",{style:{textAlign:"center"}},s("pages.forgotPassword.title","Forgot your password?")),Qe.createElement("hr",null),Qe.createElement("form",{onSubmit:g=>{g.preventDefault(),P({email:c})},...n},Qe.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},Qe.createElement("label",{htmlFor:"email-input"},s("pages.forgotPassword.fields.email","Email")),Qe.createElement("input",{id:"email-input",name:"email",type:"mail",autoCorrect:"off",spellCheck:!1,autoCapitalize:"off",required:!0,value:c,onChange:g=>m(g.target.value)}),Qe.createElement("input",{type:"submit",disabled:x,value:s("pages.forgotPassword.buttons.submit","Send reset instructions")}),Qe.createElement("br",null),e??Qe.createElement("span",null,s("pages.register.buttons.haveAccount","Have an account? ")," ",C("/login",s("pages.login.signin","Sign in"))))));return Qe.createElement("div",{...t},o?o(v,a):v)};import Ve,{useState as vn}from"react";var Dn=({wrapperProps:e,contentProps:t,renderContent:r,formProps:o,title:n=void 0})=>{let a=B(),s=W(),{mutate:u,isLoading:p}=Pr({v3LegacyAuthProviderCompatible:!!(s!=null&&s.isLegacy)}),[d,l]=vn(""),[c,m]=vn(""),P=Ve.createElement("div",{...t},Ve.createElement("h1",{style:{textAlign:"center"}},a("pages.updatePassword.title","Update Password")),Ve.createElement("hr",null),Ve.createElement("form",{onSubmit:x=>{x.preventDefault(),u({password:d,confirmPassword:c})},...o},Ve.createElement("div",{style:{display:"flex",flexDirection:"column",padding:25}},Ve.createElement("label",{htmlFor:"password-input"},a("pages.updatePassword.fields.password","New Password")),Ve.createElement("input",{id:"password-input",name:"password",type:"password",required:!0,size:20,value:d,onChange:x=>l(x.target.value)}),Ve.createElement("label",{htmlFor:"confirm-password-input"},a("pages.updatePassword.fields.confirmPassword","Confirm New Password")),Ve.createElement("input",{id:"confirm-password-input",name:"confirmPassword",type:"password",required:!0,size:20,value:c,onChange:x=>m(x.target.value)}),Ve.createElement("input",{type:"submit",disabled:p,value:a("pages.updatePassword.buttons.submit","Update")}))));return Ve.createElement("div",{...e},r?r(P,n):P)};var ei=e=>{let{type:t}=e;return Rt.createElement(Rt.Fragment,null,(()=>{switch(t){case"register":return Rt.createElement(hn,{...e});case"forgotPassword":return Rt.createElement(bn,{...e});case"updatePassword":return Rt.createElement(Dn,{...e});default:return Rt.createElement(xn,{...e})}})())};import ve from"react";var Kr=()=>ve.createElement(ve.Fragment,null,ve.createElement("h1",null,"Welcome on board"),ve.createElement("p",null,"Your configuration is completed."),ve.createElement("p",null,"Now you can get started by adding your resources to the"," ",ve.createElement("code",null,"`resources`")," property of ",ve.createElement("code",null,"`<Refine>`")),ve.createElement("div",{style:{display:"flex",gap:8}},ve.createElement("a",{href:"https://refine.dev",target:"_blank",rel:"noreferrer"},ve.createElement("button",null,"Documentation")),ve.createElement("a",{href:"https://refine.dev/examples",target:"_blank",rel:"noreferrer"},ve.createElement("button",null,"Examples")),ve.createElement("a",{href:"https://discord.gg/refine",target:"_blank",rel:"noreferrer"},ve.createElement("button",null,"Community"))));import J,{useState as ti}from"react";var ri=[{title:"Documentation",description:"Learn about the technical details of using refine in your projects.",link:"https://refine.dev/",icon:J.createElement("svg",{width:"14",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J.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:J.createElement("svg",{width:"16",height:"14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J.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"}),J.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:J.createElement("svg",{width:"16",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J.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"}),J.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:J.createElement("svg",{width:"16",height:"12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J.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"}))}],oi=()=>{let e=tr("(max-width: 1010px)"),t=tr("(max-width: 650px)"),r=()=>t?"1, 280px":e?"2, 280px":"4, 208px",o=()=>t?"32px":e?"40px":"48px",n=()=>t?"16px":e?"20px":"24px";return J.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"}},J.createElement("div",{style:{height:"89px"}}),J.createElement("div",{style:{display:"flex",justifyContent:"center"}},J.createElement("img",{src:"https://refine.ams3.cdn.digitaloceanspaces.com/welcome-page/welcome-logo.webp",width:"198",height:"54"})),J.createElement("div",{style:{height:e?"270px":"22vw",minHeight:e?"270px":"313px"}}),J.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px",textAlign:"center"}},J.createElement("h1",{style:{fontSize:o(),fontWeight:700,margin:"0px"}},"Welcome Aboard!"),J.createElement("h4",{style:{fontSize:n(),fontWeight:400,margin:"0px"}},"Your configuration is completed.")),J.createElement("div",{style:{height:"64px"}}),J.createElement("div",{style:{display:"grid",gridTemplateColumns:`repeat(${r()})`,justifyContent:"center",gap:"48px",paddingRight:"16px",paddingLeft:"16px",maxWidth:"976px",margin:"auto"}},ri.map(a=>J.createElement(ni,{key:`welcome-page-${a.title}`,card:a}))),J.createElement("div",{style:{height:"64px"}}))},ni=({card:e})=>{let{title:t,description:r,icon:o,link:n}=e,[a,s]=ti(!1);return J.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},J.createElement("div",{style:{display:"flex",alignItems:"center"}},J.createElement("a",{onPointerEnter:()=>s(!0),onPointerLeave:()=>s(!1),style:{display:"flex",alignItems:"center",color:"#fff",textDecoration:"none"},href:n},o,J.createElement("span",{style:{fontSize:"16px",fontWeight:700,marginLeft:"13px",marginRight:"14px"}},t),J.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"},J.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"})))),J.createElement("span",{style:{fontSize:"12px",opacity:.5,lineHeight:"16px"}},r))};import{QueryClient as wn,QueryClientProvider as ui}from"@tanstack/react-query";import{ReactQueryDevtools as ci}from"@tanstack/react-query-devtools";import ne from"react";import{useEffect as ai}from"react";import{useContext as st}from"react";var si="4.26.4",Ln=()=>{let e=xr(),t=st(nt),r=st(We),o=st(Qt),n=st(St),{i18nProvider:a}=st(Fe),s=st(At),u=st(Xe),{resources:p}=k(),d=!!t.create||!!t.get||!!t.update,l=!!(r!=null&&r.publish)||!!(r!=null&&r.subscribe)||!!(r!=null&&r.unsubscribe),c=!!o.useHistory||!!o.Link||!!o.Prompt||!!o.useLocation||!!o.useParams,m=!!n,P=!!(a!=null&&a.changeLocale)||!!(a!=null&&a.getLocale)||!!(a!=null&&a.translate),x=!!s.close||!!s.open,C=!!u.can;return{providers:{auth:e,auditLog:d,live:l,router:c,data:m,i18n:P,notification:x,accessControl:C},version:si,resourceCount:p.length}};var ii=e=>{let t=JSON.stringify(e||{});return typeof btoa<"u"?btoa(t):Buffer.from(t).toString("base64")},En=()=>{let e=Ln();return ai(()=>{if(typeof window>"u"&&!Image)return;let t=new Image;t.src=`https://telemetry.refine.dev/telemetry?payload=${ii(e)}`},[]),null};import pi from"warn-once";var Un=e=>{let t=["go","parse","back","Link"],r=Object.keys(e).filter(n=>!t.includes(n));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 Mn from"react";var In=e=>{let t=Mn.useRef(!1);Mn.useEffect(()=>{t.current===!1&&e&&Un(e)&&(t.current=!0)},[e])};var di=({legacyAuthProvider:e,authProvider:t,dataProvider:r,legacyRouterProvider:o,routerProvider:n,notificationProvider:a,accessControlProvider:s,auditLogProvider:u,resources:p,DashboardPage:d,ReadyPage:l,LoginPage:c,catchAll:m,children:P,liveProvider:x,i18nProvider:C,Title:v,Layout:g,Sider:U,Header:S,Footer:h,OffLayoutArea:i,onLiveEvent:f,options:R})=>{var E;let{optionsWithDefaults:b,disableTelemetryWithDefault:T,reactQueryWithDefaults:y}=Mr({options:R}),D=nr(()=>{var I;return y.clientConfig instanceof wn?y.clientConfig:new wn({...y.clientConfig,defaultOptions:{...y.clientConfig.defaultOptions,queries:{refetchOnWindowFocus:!1,keepPreviousData:!0,...(I=y.clientConfig.defaultOptions)==null?void 0:I.queries}}})},[y.clientConfig]),A=ne.useMemo(()=>typeof a=="function"?a:()=>a??{},[a])();if(In(n),o&&!n&&(p??[]).length===0)return l?ne.createElement(l,null):ne.createElement(Kr,null);let{RouterComponent:w=ne.Fragment}=n?{}:o??{};return typeof window<"u"&&((E=window==null?void 0:window.location)==null?void 0:E.hostname)==="localhost"&&pi(!0,`%c
|
|
12
12
|
\u2705 Zero-trust security model
|
|
13
13
|
\u2705 User/role management
|
|
14
14
|
\u2705 Granular access control
|