@tracktor/shared-module 2.0.0-beta.7 → 2.0.0-beta.9
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 +3 -2
- package/dist/context/InjectDependenciesProvider.d.ts +10 -28
- package/dist/main.js +446 -417
- package/dist/main.umd.cjs +10 -10
- package/dist/type/TypeQuard.d.ts +56 -0
- package/dist/utils/adapter/dateAdapter.d.ts +7 -4
- package/package.json +1 -1
package/dist/main.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(C,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],p):(C=typeof globalThis<"u"?globalThis:C||self,p(C["@tracktor/shared-module"]={},C.React))})(this,function(C,p){"use strict";var ee={exports:{}},G={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.development.js
|
|
4
4
|
*
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
10
|
-
`+
|
|
11
|
-
`),
|
|
12
|
-
`),
|
|
13
|
-
`+
|
|
9
|
+
*/var le;function ze(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var t=p,n=Symbol.for("react.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),s=Symbol.for("react.offscreen"),x=Symbol.iterator,D="@@iterator";function O(e){if(e===null||typeof e!="object")return null;var r=x&&e[x]||e[D];return typeof r=="function"?r:null}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function P(e){{for(var r=arguments.length,o=new Array(r>1?r-1:0),f=1;f<r;f++)o[f-1]=arguments[f];M("error",e,o)}}function M(e,r,o){{var f=k.ReactDebugCurrentFrame,m=f.getStackAddendum();m!==""&&(r+="%s",o=o.concat([m]));var R=o.map(function(h){return String(h)});R.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,R)}}var W=!1,L=!1,S=!1,ge=!1,pe=!1,Q;Q=Symbol.for("react.module.reference");function yt(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===v||pe||e===l||e===g||e===E||ge||e===s||W||L||S||typeof e=="object"&&e!==null&&(e.$$typeof===w||e.$$typeof===_||e.$$typeof===d||e.$$typeof===c||e.$$typeof===u||e.$$typeof===Q||e.getModuleId!==void 0))}function ht(e,r,o){var f=e.displayName;if(f)return f;var m=r.displayName||r.name||"";return m!==""?o+"("+m+")":o}function me(e){return e.displayName||"Context"}function N(e){if(e==null)return null;if(typeof e.tag=="number"&&P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case a:return"Fragment";case i:return"Portal";case v:return"Profiler";case l:return"StrictMode";case g:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case c:var r=e;return me(r)+".Consumer";case d:var o=e;return me(o._context)+".Provider";case u:return ht(e,e.render,"ForwardRef");case _:var f=e.displayName||null;return f!==null?f:N(e.type)||"Memo";case w:{var m=e,R=m._payload,h=m._init;try{return N(h(R))}catch{return null}}}return null}var z=Object.assign,J=0,Ee,Re,we,Ce,_e,Pe,Te;function Se(){}Se.__reactDisabledLog=!0;function gt(){{if(J===0){Ee=console.log,Re=console.info,we=console.warn,Ce=console.error,_e=console.group,Pe=console.groupCollapsed,Te=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Se,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}J++}}function pt(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},e,{value:Ee}),info:z({},e,{value:Re}),warn:z({},e,{value:we}),error:z({},e,{value:Ce}),group:z({},e,{value:_e}),groupCollapsed:z({},e,{value:Pe}),groupEnd:z({},e,{value:Te})})}J<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ne=k.ReactCurrentDispatcher,oe;function H(e,r,o){{if(oe===void 0)try{throw Error()}catch(m){var f=m.stack.trim().match(/\n( *(at )?)/);oe=f&&f[1]||""}return`
|
|
10
|
+
`+oe+e}}var ie=!1,K;{var mt=typeof WeakMap=="function"?WeakMap:Map;K=new mt}function be(e,r){if(!e||ie)return"";{var o=K.get(e);if(o!==void 0)return o}var f;ie=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var R;R=ne.current,ne.current=null,gt();try{if(r){var h=function(){throw Error()};if(Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(Y){f=Y}Reflect.construct(e,[],h)}else{try{h.call()}catch(Y){f=Y}e.call(h.prototype)}}else{try{throw Error()}catch(Y){f=Y}e()}}catch(Y){if(Y&&f&&typeof Y.stack=="string"){for(var y=Y.stack.split(`
|
|
11
|
+
`),j=f.stack.split(`
|
|
12
|
+
`),T=y.length-1,b=j.length-1;T>=1&&b>=0&&y[T]!==j[b];)b--;for(;T>=1&&b>=0;T--,b--)if(y[T]!==j[b]){if(T!==1||b!==1)do if(T--,b--,b<0||y[T]!==j[b]){var I=`
|
|
13
|
+
`+y[T].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,I),I}while(T>=1&&b>=0);break}}}finally{ie=!1,ne.current=R,pt(),Error.prepareStackTrace=m}var U=e?e.displayName||e.name:"",Le=U?H(U):"";return typeof e=="function"&&K.set(e,Le),Le}function Et(e,r,o){return be(e,!1)}function Rt(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Z(e,r,o){if(e==null)return"";if(typeof e=="function")return be(e,Rt(e));if(typeof e=="string")return H(e);switch(e){case g:return H("Suspense");case E:return H("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return Et(e.render);case _:return Z(e.type,r,o);case w:{var f=e,m=f._payload,R=f._init;try{return Z(R(m),r,o)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,xe={},Oe=k.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,o=Z(e.type,e._source,r?r.type:null);Oe.setExtraStackFrame(o)}else Oe.setExtraStackFrame(null)}function wt(e,r,o,f,m){{var R=Function.call.bind($);for(var h in e)if(R(e,h)){var y=void 0;try{if(typeof e[h]!="function"){var j=Error((f||"React class")+": "+o+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw j.name="Invariant Violation",j}y=e[h](r,h,f,o,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(T){y=T}y&&!(y instanceof Error)&&(q(m),P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",f||"React class",o,h,typeof y),q(null)),y instanceof Error&&!(y.message in xe)&&(xe[y.message]=!0,q(m),P("Failed %s type: %s",o,y.message),q(null))}}}var Ct=Array.isArray;function ae(e){return Ct(e)}function _t(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,o=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o}}function Pt(e){try{return je(e),!1}catch{return!0}}function je(e){return""+e}function Ae(e){if(Pt(e))return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",_t(e)),je(e)}var X=k.ReactCurrentOwner,Tt={key:!0,ref:!0,__self:!0,__source:!0},De,Ie,se;se={};function St(e){if($.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function bt(e){if($.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function xt(e,r){if(typeof e.ref=="string"&&X.current&&r&&X.current.stateNode!==r){var o=N(X.current.type);se[o]||(P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',N(X.current.type),e.ref),se[o]=!0)}}function Ot(e,r){{var o=function(){De||(De=!0,P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}}function jt(e,r){{var o=function(){Ie||(Ie=!0,P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};o.isReactWarning=!0,Object.defineProperty(e,"ref",{get:o,configurable:!0})}}var At=function(e,r,o,f,m,R,h){var y={$$typeof:n,type:e,key:r,ref:o,props:h,_owner:R};return y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(y,"_self",{configurable:!1,enumerable:!1,writable:!1,value:f}),Object.defineProperty(y,"_source",{configurable:!1,enumerable:!1,writable:!1,value:m}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y};function Dt(e,r,o,f,m){{var R,h={},y=null,j=null;o!==void 0&&(Ae(o),y=""+o),bt(r)&&(Ae(r.key),y=""+r.key),St(r)&&(j=r.ref,xt(r,m));for(R in r)$.call(r,R)&&!Tt.hasOwnProperty(R)&&(h[R]=r[R]);if(e&&e.defaultProps){var T=e.defaultProps;for(R in T)h[R]===void 0&&(h[R]=T[R])}if(y||j){var b=typeof e=="function"?e.displayName||e.name||"Unknown":e;y&&Ot(h,b),j&&jt(h,b)}return At(e,y,j,m,f,X.current,h)}}var ce=k.ReactCurrentOwner,ke=k.ReactDebugCurrentFrame;function V(e){if(e){var r=e._owner,o=Z(e.type,e._source,r?r.type:null);ke.setExtraStackFrame(o)}else ke.setExtraStackFrame(null)}var ue;ue=!1;function fe(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function Fe(){{if(ce.current){var e=N(ce.current.type);if(e)return`
|
|
14
14
|
|
|
15
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
15
|
+
Check the render method of \``+e+"`."}return""}}function It(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),o=e.lineNumber;return`
|
|
16
16
|
|
|
17
|
-
Check your code at `+
|
|
17
|
+
Check your code at `+r+":"+o+"."}return""}}var Ne={};function kt(e){{var r=Fe();if(!r){var o=typeof e=="string"?e:e.displayName||e.name;o&&(r=`
|
|
18
18
|
|
|
19
|
-
Check the top-level render call using <`+o+">.")}return
|
|
19
|
+
Check the top-level render call using <`+o+">.")}return r}}function Ye(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var o=kt(r);if(Ne[o])return;Ne[o]=!0;var f="";e&&e._owner&&e._owner!==ce.current&&(f=" It was passed a child from "+N(e._owner.type)+"."),V(e),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',o,f),V(null)}}function Me(e,r){{if(typeof e!="object")return;if(ae(e))for(var o=0;o<e.length;o++){var f=e[o];fe(f)&&Ye(f,r)}else if(fe(e))e._store&&(e._store.validated=!0);else if(e){var m=O(e);if(typeof m=="function"&&m!==e.entries)for(var R=m.call(e),h;!(h=R.next()).done;)fe(h.value)&&Ye(h.value,r)}}}function Ft(e){{var r=e.type;if(r==null||typeof r=="string")return;var o;if(typeof r=="function")o=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===_))o=r.propTypes;else return;if(o){var f=N(r);wt(o,e.props,"prop",f,e)}else if(r.PropTypes!==void 0&&!ue){ue=!0;var m=N(r);P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",m||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Nt(e){{for(var r=Object.keys(e.props),o=0;o<r.length;o++){var f=r[o];if(f!=="children"&&f!=="key"){V(e),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",f),V(null);break}}e.ref!==null&&(V(e),P("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function We(e,r,o,f,m,R){{var h=yt(e);if(!h){var y="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(y+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var j=It(m);j?y+=j:y+=Fe();var T;e===null?T="null":ae(e)?T="array":e!==void 0&&e.$$typeof===n?(T="<"+(N(e.type)||"Unknown")+" />",y=" Did you accidentally export a JSX literal instead of a component?"):T=typeof e,P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",T,y)}var b=Dt(e,r,o,m,R);if(b==null)return b;if(h){var I=r.children;if(I!==void 0)if(f)if(ae(I)){for(var U=0;U<I.length;U++)Me(I[U],e);Object.freeze&&Object.freeze(I)}else P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Me(I,e)}return e===a?Nt(b):Ft(b),b}}function Yt(e,r,o){return We(e,r,o,!0)}function Mt(e,r,o){return We(e,r,o,!1)}var Wt=Mt,Lt=Yt;G.Fragment=a,G.jsx=Wt,G.jsxs=Lt}()),G}var B={};/**
|
|
20
20
|
* @license React
|
|
21
21
|
* react-jsx-runtime.production.min.js
|
|
22
22
|
*
|
|
@@ -24,4 +24,4 @@ Check the top-level render call using <`+o+">.")}return t}}function ke(e,t){{if(
|
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the MIT license found in the
|
|
26
26
|
* LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/var le;function Le(){if(le)return G;le=1;var n=m,r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,f=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function d(c,l,y){var E,C={},w=null,u=null;y!==void 0&&(w=""+y),l.key!==void 0&&(w=""+l.key),l.ref!==void 0&&(u=l.ref);for(E in l)a.call(l,E)&&!v.hasOwnProperty(E)&&(C[E]=l[E]);if(c&&c.defaultProps)for(E in l=c.defaultProps,l)C[E]===void 0&&(C[E]=l[E]);return{$$typeof:r,type:c,key:w,ref:u,props:C,_owner:f.current}}return G.Fragment=i,G.jsx=d,G.jsxs=d,G}process.env.NODE_ENV==="production"?ee.exports=Le():ee.exports=Ne();var F=ee.exports;const A=m.createContext({}),Me=({children:n,apiURL:r,libraries:i})=>{const a=m.useMemo(()=>({apiURL:r,libraries:i}),[r,i]);return F.jsx(A.Provider,{value:a,children:n})},ze=({Fallback:n,isLogged:r,loginPath:i="/login",localStorageKey:a="user",redirect401Path:f="/login",...v})=>{var b,N,L,M;const{libraries:d}=m.useContext(A),c=(v==null?void 0:v.axios)||(d==null?void 0:d.axios),l=(v==null?void 0:v.reactRouter)||(d==null?void 0:d.reactRouter);if(l===void 0)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(c===void 0)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[y,E]=m.useState(null),{useLocation:C,Navigate:w,Outlet:u}=l,S=C(),D=m.useRef(!1),x=typeof r=="function"?r():!!r,k=typeof x=="boolean"?x:x==null?void 0:x.isLogged;return m.useEffect(()=>{D.current||(D.current=!0,c==null||c.interceptors.response.use(P=>P,async P=>{var J;return typeof P=="object"&&P&&"response"in P&&P.response&&typeof P.response=="object"&&"status"in P.response&&P.response&&typeof P.response=="object"&&"status"in P.response&&((J=P==null?void 0:P.response)==null?void 0:J.status)===401&&(c.defaults.headers.common.Authorization=null,localStorage.removeItem(a),E(f)),Promise.reject(P)}))},[c==null?void 0:c.defaults.headers.common,c==null?void 0:c.interceptors.response,a,f]),k&&!y?F.jsx(m.Suspense,{fallback:n,children:(N=(b=S.state)==null?void 0:b.from)!=null&&N.state&&((M=(L=S.state)==null?void 0:L.from)==null?void 0:M.pathname)===i?F.jsx(w,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):F.jsx(u,{})}):F.jsx(w,{to:i,state:{from:S},replace:!0})},Ve=({...n})=>{const{libraries:r}=m.useContext(A),i=(n==null?void 0:n.reactRouter)||(r==null?void 0:r.reactRouter),a=(n==null?void 0:n.gtm)||(r==null?void 0:r.gtm);if(i===void 0)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(a===void 0)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const{useGoogleTagManager:f}=a,{useLocation:v,Outlet:d}=i,{pathname:c}=v(),{sendEvent:l}=f();return m.useEffect(()=>{l({event:"pageView",pathname:c})},[c,l]),F.jsx(d,{})},Ue=({tokenTypeKey:n="tokenType",userLocalStorageKey:r="user",tokenKey:i="accessToken",postContentType:a="application/json",...f})=>{const{apiURL:v=f.apiURL,libraries:d}=m.useContext(A),c=(f==null?void 0:f.axios)||(d==null?void 0:d.axios);if(c===void 0)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!c.defaults)return null;const l=localStorage.getItem(r),y=l?JSON.parse(l):null,E=y!=null&&y[n]?y[n]:null,C=y!=null&&y[i]?y[i]:null,w=l?`${E} ${C}`:null;return c.defaults.baseURL=v,c.defaults.headers.post["Content-Type"]=a,w&&(c.defaults.headers.common.Authorization=w),null},Be=({debug:n,resources:r,...i})=>{const{libraries:a}=m.useContext(A),f=(i==null?void 0:i.i18)||(a==null?void 0:a.i18),{i18next:v,initReactI18next:d,languageDetector:c}=f||{};if(f===void 0)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return v!=null&&v.isInitialized||(v.use(c).use(d).init({debug:n,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:r,returnNull:!1}).then(()=>{document.documentElement.lang!==v.resolvedLanguage&&v.resolvedLanguage&&document.documentElement.setAttribute("lang",v.resolvedLanguage)}),v.on("languageChanged",l=>{document.documentElement.setAttribute("lang",l)})),null},Ge=({dsn:n,integrations:r,tracesSampleRate:i,replaysSessionSampleRate:a,replaysOnErrorSampleRate:f,tracePropagationTargets:v,ignoreErrors:d,debug:c,environment:l,...y})=>{const{libraries:E}=m.useContext(A),C=(y==null?void 0:y.sentry)||(E==null?void 0:E.sentry),w=(y==null?void 0:y.reactRouter)||(E==null?void 0:E.reactRouter),{createRoutesFromChildren:u,matchRoutes:S,useLocation:D,useNavigationType:x}=w;if(C===void 0)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(w===void 0)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return C.isInitialized()||(c||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&C.init({debug:c,dsn:n,environment:l||"production",ignoreErrors:[...d||[],/dynamically imported module/],integrations:[C.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:u,matchRoutes:S,useEffect:m.useEffect,useLocation:D,useNavigationType:x}),...r||[]],replaysOnErrorSampleRate:f||1,replaysSessionSampleRate:a||.1,tracePropagationTargets:v,tracesSampleRate:i||1}),null},Je=({IMaskMixin:n,...r})=>{const i=m.useMemo(()=>n(({TextField:a,...f})=>F.jsx(a,{...f})),[n]);return F.jsx(i,{...r})},Qe=({accessToken:n,...r})=>{const{libraries:i}=m.useContext(A),a=(r==null?void 0:r.mapbox)||(i==null?void 0:i.mapbox);if(a===void 0)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return n&&(a.accessToken=n),null},Xe=({language:n,...r})=>{const{libraries:i}=m.useContext(A),a=(r==null?void 0:r.dayjs)||(i==null?void 0:i.dayjs),f=(r==null?void 0:r.dayjsPlugin)||(i==null?void 0:i.dayjsPlugin);if(a===void 0)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return m.useEffect(()=>{(async()=>{var c;const d=n||((c=navigator.language)==null?void 0:c.slice(0,2))||"en";f&&f.forEach(l=>{a.extend(l.default)}),a.locale(d)})().then()},[a,f,n]),null},He=({children:n,defaultQueriesOptions:r,defaultMutationsOptions:i,...a})=>{var l,y;const{libraries:f}=m.useContext(A),v=(a==null?void 0:a.QueryClient)||((l=f==null?void 0:f.reactQuery)==null?void 0:l.QueryClient),d=(a==null?void 0:a.QueryClientProvider)||((y=f==null?void 0:f.reactQuery)==null?void 0:y.QueryClientProvider);if(v===void 0)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(d===void 0)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const c=new v({defaultOptions:{mutations:{...i},queries:{getNextPageParam:(E,C,w)=>E.length+(w||0),refetchOnWindowFocus:!1,retry:3,...r}}});return F.jsx(d,{client:c,children:n})},Ke=n=>{var y,E,C;const{libraries:r}=m.useContext(A),i=(n==null?void 0:n.i18)||(r==null?void 0:r.i18),a=((y=n==null?void 0:n.i18)==null?void 0:y.translateFunction)||((E=r==null?void 0:r.i18)==null?void 0:E.translateFunction),f=((C=i==null?void 0:i.i18next)==null?void 0:C.t)||a||(w=>w),{unknownErrorTranslationKey:v="error.unknownError"}=n||{},d=f(v),c=m.useCallback(w=>{var S,D,x,k,b,N,L,M,P;const{response:u}=w||{};return u!=null&&u.reason?String(u.reason):(S=u==null?void 0:u.data)!=null&&S.reason?String(u.data.reason):(D=u==null?void 0:u.data)!=null&&D.message?String(u.data.message):(k=(x=u==null?void 0:u.data)==null?void 0:x.detail)!=null&&k.length&&Array.isArray((b=u==null?void 0:u.data)==null?void 0:b.detail)&&((L=(N=u==null?void 0:u.data)==null?void 0:N.detail[0])!=null&&L.msg)&&typeof((P=(M=u==null?void 0:u.data)==null?void 0:M.detail[0])==null?void 0:P.msg)=="string"?String(u.data.detail[0].msg):d},[d]);return{getErrorCode:m.useCallback(w=>{var S,D,x;const{response:u}=w||{};return u!=null&&u.error_code?String(u==null?void 0:u.error_code):(S=u==null?void 0:u.data)!=null&&S.error_code?String((D=u==null?void 0:u.data)==null?void 0:D.error_code):u!=null&&u.error_code?String(u==null?void 0:u.error_code):(x=u==null?void 0:u.data)!=null&&x.error_code?String(u.data.error_code):"unknown_error_code"},[]),printError:c}},Ze=({data:n,fetchNextPage:r,isFetchingNextPage:i,isInitialLoading:a,isLoading:f,enabled:v=!0})=>{const d=m.useCallback(async l=>{i||!v||await r({pageParam:(l==null?void 0:l.pageParam)||l.visibleRowsCount})},[v,r,i]),c=m.useMemo(()=>{if(n)return n.pages.reduce((l,y)=>[...l,...y],[])},[n]);return{fetchNextPageOnRowsScrollEnd:d,isLoading:i||f,loadingVariant:a?"skeleton":"linear",rows:c}},$e=n=>{const{libraries:r}=m.useContext(A),i=(n==null?void 0:n.axios)||(r==null?void 0:r.axios);if(i===void 0)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");return{clearAuthenticationToken:()=>{i.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:v,accessToken:d})=>{i.defaults.headers.common.Authorization=`${v} ${d}`}}},fe=(n,r="km")=>{const i=Number(n);return Number.isNaN(i)?`0 ${r}`:`${i.toFixed(2)} ${r}`},qe=n=>{const r=n&&typeof n=="object"&&"pathname"in n&&n.pathname?n.pathname:n;return typeof r=="string"?r!=null&&r.startsWith("/")?r!=null&&r.startsWith("/files")?r:`/files${r}`:r!=null&&r.startsWith("files")?`/${r}`:r!=null&&r.startsWith("files")?`/${r}`:`/files/${r}`:r},de=(n,r)=>{if(!n)return"";const i=qe(n),a=typeof n=="object"&&"pathname"in n?`${n.origin}${i}`:n;return typeof r=="number"?`${a.replace("/files",`/thumbs/${r}`)}`:a},et=n=>{const{apiURL:r,libraries:i}=m.useContext(A),a=(n==null?void 0:n.dayjs)||(i==null?void 0:i.dayjs);return{dateAdapter:(d,c="ll")=>{if(a===void 0)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return a(d).format(c)},distanceAdapter:fe,filePathAdapter:(d,c)=>de(r&&typeof d=="string"?{origin:r,pathname:d}:d,c)}},tt=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),rt=n=>{const a=n.split("/").filter(f=>f.length>0).map(f=>f.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("")).join("");return a.charAt(0).toLowerCase()+a.slice(1)},nt=(n,r,i)=>{const a=rt(r),f=tt(i);return`${a}${f}`},ot=n=>{if(n)return(n==null?void 0:n.reduce((r,i)=>(r[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},r),{}))||{}},it=n=>{const{input:r="./openapi.json",operationsToGenerateInfiniteQueryHook:i=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:r,output:{client:"react-query",mode:"tags-split",override:{header:a=>["Generated by orval 🍺",...a.title?[a.title]:[],...a.description?[a.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:nt,...(i==null?void 0:i.length)&&{operations:ot(i)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}},at=(n,r,i="ll")=>String(n(r).format(i));_.GTMSendPageView=Ve,_.InitializeAxiosConfig=Ue,_.InitializeDaysJSConfig=Xe,_.InitializeI18nConfig=Be,_.InitializeMapBoxConfig=Qe,_.InitializeSentryConfig=Ge,_.InjectDependenciesContext=A,_.InjectDependenciesProvider=Me,_.MaskTextField=Je,_.QueryClientProviderWithConfig=He,_.RequireAuth=ze,_.dateAdapter=at,_.distanceAdapter=fe,_.getOrvalConfig=it,_.useAdapter=et,_.useAuth=$e,_.useInfiniteDataGrid=Ze,_.useResponseError=Ke,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
|
|
27
|
+
*/var de;function Ve(){if(de)return B;de=1;var t=p,n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function d(c,u,g){var E,_={},w=null,s=null;g!==void 0&&(w=""+g),u.key!==void 0&&(w=""+u.key),u.ref!==void 0&&(s=u.ref);for(E in u)a.call(u,E)&&!v.hasOwnProperty(E)&&(_[E]=u[E]);if(c&&c.defaultProps)for(E in u=c.defaultProps,u)_[E]===void 0&&(_[E]=u[E]);return{$$typeof:n,type:c,key:w,ref:s,props:_,_owner:l.current}}return B.Fragment=i,B.jsx=d,B.jsxs=d,B}process.env.NODE_ENV==="production"?ee.exports=Ve():ee.exports=ze();var F=ee.exports;const A=p.createContext({}),Ue=({children:t,apiURL:n,libraries:i})=>{const a=p.useMemo(()=>({apiURL:n,libraries:i}),[n,i]);return F.jsx(A.Provider,{value:a,children:t})},Ge=t=>t&&typeof t=="object"&&typeof t.useGoogleTagManager=="function",ve=t=>t&&typeof t=="object"&&typeof t.locale=="function"&&typeof t.extend=="function"&&typeof t.format=="function"&&typeof t()=="function"&&typeof t().format=="function",te=t=>t&&typeof t=="object"&&typeof t.useLocation=="function"&&typeof t.Outlet=="function"&&t.Outlet.prototype&&t.Outlet.prototype.isReactComponent&&typeof t.Navigate=="function"&&t.Navigate.prototype&&t.Navigate.prototype.isReactComponent&&typeof t.createRoutesFromChildren=="function"&&typeof t.matchRoutes=="function"&&typeof t.useNavigationType=="function",re=t=>t&&typeof t=="object"&&typeof t.defaults=="object"&&typeof t.defaults.baseURL=="string"&&typeof t.defaults.headers=="object"&&typeof t.defaults.headers.post=="object"&&typeof t.defaults.headers.post["Content-Type"]=="string"&&typeof t.defaults.headers.common=="object"&&typeof t.defaults.headers.common.Authorization=="string"&&typeof t.interceptors=="object"&&typeof t.interceptors.response=="object"&&typeof t.interceptors.response.use=="function",Be=({Fallback:t,isLogged:n,loginPath:i="/login",localStorageKey:a="user",redirect401Path:l="/login",...v})=>{var P,M,W,L;const{libraries:d}=p.useContext(A),c=(v==null?void 0:v.axios)||(d==null?void 0:d.axios),u=(v==null?void 0:v.reactRouter)||(d==null?void 0:d.reactRouter);if(!u)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!re(c))throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!te(u))throw new Error("Provided React Router dependencies are not valid.");const[g,E]=p.useState(null),{useLocation:_,Navigate:w,Outlet:s}=u,x=_(),D=p.useRef(!1),O=typeof n=="function"?n():!!n,k=typeof O=="boolean"?O:O==null?void 0:O.isLogged;return p.useEffect(()=>{D.current||(D.current=!0,c==null||c.interceptors.response.use(S=>S,async S=>{var Q;return typeof S=="object"&&S&&"response"in S&&S.response&&typeof S.response=="object"&&"status"in S.response&&S.response&&typeof S.response=="object"&&"status"in S.response&&((Q=S==null?void 0:S.response)==null?void 0:Q.status)===401&&(c.defaults.headers.common.Authorization=null,localStorage.removeItem(a),E(l)),Promise.reject(S)}))},[c==null?void 0:c.defaults.headers.common,c==null?void 0:c.interceptors.response,a,l]),k&&!g?F.jsx(p.Suspense,{fallback:t,children:(M=(P=x.state)==null?void 0:P.from)!=null&&M.state&&((L=(W=x.state)==null?void 0:W.from)==null?void 0:L.pathname)===i?F.jsx(w,{to:x.state.from.state.from.pathname+x.state.from.state.from.search,replace:!0}):F.jsx(s,{})}):F.jsx(w,{to:i,state:{from:x},replace:!0})},Qe=({...t})=>{const{libraries:n}=p.useContext(A),i=(t==null?void 0:t.reactRouter)||(n==null?void 0:n.reactRouter),a=(t==null?void 0:t.gtm)||(n==null?void 0:n.gtm);if(!i)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!a)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!Ge(a))throw new Error("Provided GTM dependencies are not valid.");if(!te(i))throw new Error("Provided React Router dependencies are not valid.");const{useGoogleTagManager:l}=a,{useLocation:v,Outlet:d}=i,{pathname:c}=v(),{sendEvent:u}=l();return p.useEffect(()=>{u({event:"pageView",pathname:c})},[c,u]),F.jsx(d,{})},Je=({tokenTypeKey:t="tokenType",userLocalStorageKey:n="user",tokenKey:i="accessToken",postContentType:a="application/json",...l})=>{const{apiURL:v=l.apiURL,libraries:d}=p.useContext(A),c=(l==null?void 0:l.axios)||(d==null?void 0:d.axios);if(!c)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!re(c))throw new Error("Provided Axios dependencies are not valid.");if(!(c!=null&&c.defaults))return null;const u=localStorage.getItem(n),g=u?JSON.parse(u):null,E=g!=null&&g[t]?g[t]:null,_=g!=null&&g[i]?g[i]:null,w=u?`${E} ${_}`:null;return c.defaults.baseURL=v,c.defaults.headers.post["Content-Type"]=a,w&&(c.defaults.headers.common.Authorization=w),null},Xe=({debug:t,resources:n,...i})=>{const{libraries:a}=p.useContext(A),l=(i==null?void 0:i.i18)||(a==null?void 0:a.i18),{i18next:v,initReactI18next:d,languageDetector:c}=l||{};if(!l)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return v!=null&&v.isInitialized||(v.use(c).use(d).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==v.resolvedLanguage&&v.resolvedLanguage&&document.documentElement.setAttribute("lang",v.resolvedLanguage)}),v.on("languageChanged",u=>{document.documentElement.setAttribute("lang",u)})),null},He=({dsn:t,integrations:n,tracesSampleRate:i,replaysSessionSampleRate:a,replaysOnErrorSampleRate:l,tracePropagationTargets:v,ignoreErrors:d,debug:c,environment:u,...g})=>{const{libraries:E}=p.useContext(A),_=(g==null?void 0:g.sentry)||(E==null?void 0:E.sentry),w=(g==null?void 0:g.reactRouter)||(E==null?void 0:E.reactRouter);if(!_)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!w)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!te(w))throw new Error("Provided React Router dependencies are not valid.");if(_.isInitialized())return null;const{createRoutesFromChildren:s,matchRoutes:x,useLocation:D,useNavigationType:O}=w;return(c||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&_.init({debug:c,dsn:t,environment:u||"production",ignoreErrors:[...d||[],/dynamically imported module/],integrations:[_.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:s,matchRoutes:x,useEffect:p.useEffect,useLocation:D,useNavigationType:O}),...n||[]],replaysOnErrorSampleRate:l||1,replaysSessionSampleRate:a||.1,tracePropagationTargets:v,tracesSampleRate:i||1}),null},Ke=({IMaskMixin:t,...n})=>{const i=p.useMemo(()=>t(({TextField:a,...l})=>F.jsx(a,{...l})),[t]);return F.jsx(i,{...n})},Ze=t=>t&&typeof t=="object"&&typeof t.accessToken=="string",$e=({accessToken:t,...n})=>{const{libraries:i}=p.useContext(A),a=(n==null?void 0:n.mapbox)||(i==null?void 0:i.mapbox);if(!a)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!Ze(a))throw new Error("Provided Mapbox instance is not valid.");return t&&(a.accessToken=t),null},qe=({language:t,...n})=>{const{libraries:i}=p.useContext(A),a=(n==null?void 0:n.dayjs)||(i==null?void 0:i.dayjs),l=(n==null?void 0:n.dayjsPlugin)||(i==null?void 0:i.dayjsPlugin);if(!a)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");if(!ve(a))throw new Error("Provided dayjs instance is not valid.");return p.useEffect(()=>{(async()=>{var c;const d=t||((c=navigator.language)==null?void 0:c.slice(0,2))||"en";l&&l.forEach(u=>{u&&typeof u=="object"&&"default"in u&&a.extend(u.default)}),a.locale(d)})().then()},[a,l,t]),null},et=t=>t&&typeof t=="function",tt=t=>t&&typeof t=="function",rt=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:i,...a})=>{var u,g;const{libraries:l}=p.useContext(A),v=(a==null?void 0:a.QueryClient)||((u=l==null?void 0:l.reactQuery)==null?void 0:u.QueryClient),d=(a==null?void 0:a.QueryClientProvider)||((g=l==null?void 0:l.reactQuery)==null?void 0:g.QueryClientProvider);if(!v)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!d)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!et(d))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!tt(v))throw new Error("Provided QueryClient dependencies are not valid.");const c=new v({defaultOptions:{mutations:{...i},queries:{getNextPageParam:(E,_,w)=>E.length+(w||0),refetchOnWindowFocus:!1,retry:3,...n}}});return F.jsx(d,{client:c,children:t})},nt=t=>{var g,E,_;const{libraries:n}=p.useContext(A),i=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),a=((g=t==null?void 0:t.i18)==null?void 0:g.translateFunction)||((E=n==null?void 0:n.i18)==null?void 0:E.translateFunction),l=((_=i==null?void 0:i.i18next)==null?void 0:_.t)||a||(w=>w),{unknownErrorTranslationKey:v="error.unknownError"}=t||{},d=l(v),c=p.useCallback(w=>{var x,D,O,k,P,M,W,L,S;const{response:s}=w||{};return s!=null&&s.reason?String(s.reason):(x=s==null?void 0:s.data)!=null&&x.reason?String(s.data.reason):(D=s==null?void 0:s.data)!=null&&D.message?String(s.data.message):(k=(O=s==null?void 0:s.data)==null?void 0:O.detail)!=null&&k.length&&Array.isArray((P=s==null?void 0:s.data)==null?void 0:P.detail)&&((W=(M=s==null?void 0:s.data)==null?void 0:M.detail[0])!=null&&W.msg)&&typeof((S=(L=s==null?void 0:s.data)==null?void 0:L.detail[0])==null?void 0:S.msg)=="string"?String(s.data.detail[0].msg):d},[d]);return{getErrorCode:p.useCallback(w=>{var x,D,O;const{response:s}=w||{};return s!=null&&s.error_code?String(s==null?void 0:s.error_code):(x=s==null?void 0:s.data)!=null&&x.error_code?String((D=s==null?void 0:s.data)==null?void 0:D.error_code):s!=null&&s.error_code?String(s==null?void 0:s.error_code):(O=s==null?void 0:s.data)!=null&&O.error_code?String(s.data.error_code):"unknown_error_code"},[]),printError:c}},ot=({data:t,fetchNextPage:n,isFetchingNextPage:i,isInitialLoading:a,isLoading:l,enabled:v=!0})=>{const d=p.useCallback(async u=>{i||!v||await n({pageParam:(u==null?void 0:u.pageParam)||u.visibleRowsCount})},[v,n,i]),c=p.useMemo(()=>{if(t)return t.pages.reduce((u,g)=>[...u,...g],[])},[t]);return{fetchNextPageOnRowsScrollEnd:d,isLoading:i||l,loadingVariant:a?"skeleton":"linear",rows:c}},it=t=>{const{libraries:n}=p.useContext(A),i=(t==null?void 0:t.axios)||(n==null?void 0:n.axios);if(i===void 0)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");if(!re(i))throw new Error("Provided Axios dependencies are not valid.");return{clearAuthenticationToken:()=>{i.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:v,accessToken:d})=>{i.defaults.headers.common.Authorization=`${v} ${d}`}}},ye=(t,n="km")=>{const i=Number(t);return Number.isNaN(i)?`0 ${n}`:`${i.toFixed(2)} ${n}`},at=t=>{const n=t&&typeof t=="object"&&"pathname"in t&&t.pathname?t.pathname:t;return typeof n=="string"?n!=null&&n.startsWith("/")?n!=null&&n.startsWith("/files")?n:`/files${n}`:n!=null&&n.startsWith("files")?`/${n}`:n!=null&&n.startsWith("files")?`/${n}`:`/files/${n}`:n},he=(t,n)=>{if(!t)return"";const i=at(t),a=typeof t=="object"&&"pathname"in t?`${t.origin}${i}`:t;return typeof n=="number"?`${a.replace("/files",`/thumbs/${n}`)}`:a},st=t=>{const{apiURL:n,libraries:i}=p.useContext(A),a=(t==null?void 0:t.dayjs)||(i==null?void 0:i.dayjs);return{dateAdapter:(d,c="ll")=>{if(a===void 0)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!ve(a))throw new Error("Provided dayjs instance is not valid.");return a(d).format(c)},distanceAdapter:ye,filePathAdapter:(d,c)=>he(n&&typeof d=="string"?{origin:n,pathname:d}:d,c)}},ct=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),ut=t=>{const a=t.split("/").filter(l=>l.length>0).map(l=>l.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("")).join("");return a.charAt(0).toLowerCase()+a.slice(1)},ft=(t,n,i)=>{const a=ut(n),l=ct(i);return`${a}${l}`},lt=t=>{if(t)return(t==null?void 0:t.reduce((n,i)=>(n[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},dt=t=>{const{input:n="./openapi.json",operationsToGenerateInfiniteQueryHook:i=void 0}=t||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:n,output:{client:"react-query",mode:"tags-split",override:{header:a=>["Generated by orval 🍺",...a.title?[a.title]:[],...a.description?[a.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:ft,...(i==null?void 0:i.length)&&{operations:lt(i)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}},vt=(t,n,i="ll")=>t(n).format(i);C.GTMSendPageView=Qe,C.InitializeAxiosConfig=Je,C.InitializeDaysJSConfig=qe,C.InitializeI18nConfig=Xe,C.InitializeMapBoxConfig=$e,C.InitializeSentryConfig=He,C.InjectDependenciesContext=A,C.InjectDependenciesProvider=Ue,C.MaskTextField=Ke,C.QueryClientProviderWithConfig=rt,C.RequireAuth=Be,C.dateAdapter=vt,C.distanceAdapter=ye,C.getOrvalConfig=dt,C.useAdapter=st,C.useAuth=it,C.useInfiniteDataGrid=ot,C.useResponseError=nt,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComponentType } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Type guard check if provided object is GTM library
|
|
4
|
+
* @param obj
|
|
5
|
+
*/
|
|
6
|
+
export declare const isGTM: (obj: any) => obj is {
|
|
7
|
+
useGoogleTagManager: () => any;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Type guard check if provided object is dayjs library
|
|
11
|
+
* @param obj
|
|
12
|
+
*/
|
|
13
|
+
export declare const isDayjs: (obj: any) => obj is {
|
|
14
|
+
(date: any): any;
|
|
15
|
+
locale: (locale: string) => void;
|
|
16
|
+
extend: (plugin: any) => void;
|
|
17
|
+
format: (format: string) => string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Type guard check if provided object is react router library
|
|
21
|
+
* @param obj
|
|
22
|
+
*/
|
|
23
|
+
export declare const isReactRouter: (obj: any) => obj is {
|
|
24
|
+
useLocation: () => any;
|
|
25
|
+
Outlet: ComponentType;
|
|
26
|
+
createRoutesFromChildren: (children: any) => any;
|
|
27
|
+
matchRoutes: (routes: any, pathname: string) => any;
|
|
28
|
+
useNavigationType: () => any;
|
|
29
|
+
Navigate: ComponentType<{
|
|
30
|
+
to: string;
|
|
31
|
+
replace?: boolean;
|
|
32
|
+
state?: any;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Type guard check if provided object is axios library
|
|
37
|
+
* @param obj
|
|
38
|
+
*/
|
|
39
|
+
export declare const isAxios: (obj: any) => obj is {
|
|
40
|
+
interceptors: {
|
|
41
|
+
response: {
|
|
42
|
+
use: (onFulfilled: any, onRejected: any) => void;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
defaults: {
|
|
46
|
+
baseURL?: string;
|
|
47
|
+
headers: {
|
|
48
|
+
post: {
|
|
49
|
+
"Content-Type": string;
|
|
50
|
+
};
|
|
51
|
+
common: {
|
|
52
|
+
Authorization: string | null;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
type
|
|
1
|
+
type DateType = string | number | Date | null | undefined;
|
|
2
|
+
interface Library {
|
|
3
|
+
(date: DateType): {
|
|
4
|
+
format: (format: string) => string;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
2
7
|
/**
|
|
3
8
|
* Format date to own specific format
|
|
4
9
|
* @param library
|
|
5
10
|
* @param date
|
|
6
11
|
* @param format
|
|
7
12
|
*/
|
|
8
|
-
export declare const dateAdapter: <T extends (date:
|
|
9
|
-
format: (f: string) => {};
|
|
10
|
-
}>(library: T, date: DateAdapterDate, format?: string) => string;
|
|
13
|
+
export declare const dateAdapter: <T extends Library>(library: T, date: DateType, format?: string) => string;
|
|
11
14
|
export default dateAdapter;
|