@tracktor/shared-module 0.17.2 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/dist/main.js +367 -343
  3. package/dist/main.umd.cjs +15 -15
  4. package/dist/{main.d.ts → src/main.d.ts} +2 -0
  5. package/dist/src/utils/adapter/filePathAdapter.d.ts +7 -0
  6. package/package.json +4 -4
  7. /package/dist/{components → src/components}/Inputs/MaskTextField.d.ts +0 -0
  8. /package/dist/{components → src/components}/Utils/AxiosConfig.d.ts +0 -0
  9. /package/dist/{components → src/components}/Utils/GTMSendPageView.d.ts +0 -0
  10. /package/dist/{components → src/components}/Utils/I18nConfig.d.ts +0 -0
  11. /package/dist/{components → src/components}/Utils/MapBoxConfig.d.ts +0 -0
  12. /package/dist/{components → src/components}/Utils/RequireAuth.d.ts +0 -0
  13. /package/dist/{components → src/components}/Utils/SentryConfig.d.ts +0 -0
  14. /package/dist/{config → src/config}/orval/index.d.ts +0 -0
  15. /package/dist/{config → src/config}/orval/mutator/axiosCustomInstance.d.ts +0 -0
  16. /package/dist/{config → src/config}/orval/orval.d.ts +0 -0
  17. /package/dist/{config → src/config}/orval/orval.test.d.ts +0 -0
  18. /package/dist/{context → src/context}/InjectDependenciesProvider.d.ts +0 -0
  19. /package/dist/{context → src/context}/QueryClientConfigProvider.d.ts +0 -0
  20. /package/dist/{hooks → src/hooks}/useAuth/index.d.ts +0 -0
  21. /package/dist/{hooks → src/hooks}/useAuth/useAuth.d.ts +0 -0
  22. /package/dist/{hooks → src/hooks}/useInfiniteDataGrid/index.d.ts +0 -0
  23. /package/dist/{hooks → src/hooks}/useInfiniteDataGrid/useInfiniteDataGrid.d.ts +0 -0
  24. /package/dist/{hooks → src/hooks}/useResponseError/index.d.ts +0 -0
  25. /package/dist/{hooks → src/hooks}/useResponseError/useResponseError.d.ts +0 -0
  26. /package/dist/{hooks → src/hooks}/useResponseError/useResponseError.test.d.ts +0 -0
package/dist/main.umd.cjs CHANGED
@@ -1,27 +1,27 @@
1
- (function(b,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],E):(b=typeof globalThis<"u"?globalThis:b||self,E(b["@tracktor/shared-module"]={},b.React))})(this,function(b,E){"use strict";var $={exports:{}},V={};/**
1
+ (function(b,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],E):(b=typeof globalThis<"u"?globalThis:b||self,E(b["@tracktor/shared-module"]={},b.React))})(this,function(b,E){"use strict";var Q={exports:{}},Y={};/**
2
2
  * @license React
3
- * react-jsx-runtime.production.min.js
3
+ * react-jsx-runtime.development.js
4
4
  *
5
5
  * Copyright (c) Facebook, Inc. and its affiliates.
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 se;function Le(){if(se)return V;se=1;var a=E,u=Symbol.for("react.element"),o=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,c=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function m(t,l,y){var h,O={},j=null,S=null;y!==void 0&&(j=""+y),l.key!==void 0&&(j=""+l.key),l.ref!==void 0&&(S=l.ref);for(h in l)s.call(l,h)&&!v.hasOwnProperty(h)&&(O[h]=l[h]);if(t&&t.defaultProps)for(h in l=t.defaultProps,l)O[h]===void 0&&(O[h]=l[h]);return{$$typeof:u,type:t,key:j,ref:S,props:O,_owner:c.current}}return V.Fragment=o,V.jsx=m,V.jsxs=m,V}var Y={};/**
9
+ */var ce;function We(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&function(){var a=E,i=Symbol.for("react.element"),o=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),t=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),I=Symbol.iterator,F="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var r=I&&e[I]||e[F];return typeof r=="function"?r:null}var A=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];w("error",e,n)}}function w(e,r,n){{var s=A.ReactDebugCurrentFrame,p=s.getStackAddendum();p!==""&&(r+="%s",n=n.concat([p]));var g=n.map(function(d){return String(d)});g.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,g)}}var de=!1,ve=!1,$=!1,or=!1,ir=!1,pe;pe=Symbol.for("react.module.reference");function ur(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===v||ir||e===c||e===y||e===h||or||e===S||de||ve||$||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===O||e.$$typeof===m||e.$$typeof===t||e.$$typeof===l||e.$$typeof===pe||e.getModuleId!==void 0))}function sr(e,r,n){var s=e.displayName;if(s)return s;var p=r.displayName||r.name||"";return p!==""?n+"("+p+")":n}function ge(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&C("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 u:return"Fragment";case o:return"Portal";case v:return"Profiler";case c:return"StrictMode";case y:return"Suspense";case h:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case t:var r=e;return ge(r)+".Consumer";case m:var n=e;return ge(n._context)+".Provider";case l:return sr(e,e.render,"ForwardRef");case O:var s=e.displayName||null;return s!==null?s:x(e.type)||"Memo";case j:{var p=e,g=p._payload,d=p._init;try{return x(d(g))}catch{return null}}}return null}var M=Object.assign,B=0,me,he,Ee,ye,be,Re,_e;function Ce(){}Ce.__reactDisabledLog=!0;function cr(){{if(B===0){me=console.log,he=console.info,Ee=console.warn,ye=console.error,be=console.group,Re=console.groupCollapsed,_e=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ce,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}B++}}function lr(){{if(B--,B===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:me}),info:M({},e,{value:he}),warn:M({},e,{value:Ee}),error:M({},e,{value:ye}),group:M({},e,{value:be}),groupCollapsed:M({},e,{value:Re}),groupEnd:M({},e,{value:_e})})}B<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=A.ReactCurrentDispatcher,te;function X(e,r,n){{if(te===void 0)try{throw Error()}catch(p){var s=p.stack.trim().match(/\n( *(at )?)/);te=s&&s[1]||""}return`
10
+ `+te+e}}var ne=!1,H;{var fr=typeof WeakMap=="function"?WeakMap:Map;H=new fr}function we(e,r){if(!e||ne)return"";{var n=H.get(e);if(n!==void 0)return n}var s;ne=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var g;g=re.current,re.current=null,cr();try{if(r){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(D){s=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){s=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){s=D}e()}}catch(D){if(D&&s&&typeof D.stack=="string"){for(var f=D.stack.split(`
11
+ `),T=s.stack.split(`
12
+ `),R=f.length-1,_=T.length-1;R>=1&&_>=0&&f[R]!==T[_];)_--;for(;R>=1&&_>=0;R--,_--)if(f[R]!==T[_]){if(R!==1||_!==1)do if(R--,_--,_<0||f[R]!==T[_]){var P=`
13
+ `+f[R].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,P),P}while(R>=1&&_>=0);break}}}finally{ne=!1,re.current=g,lr(),Error.prepareStackTrace=p}var V=e?e.displayName||e.name:"",Me=V?X(V):"";return typeof e=="function"&&H.set(e,Me),Me}function dr(e,r,n){return we(e,!1)}function vr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,n){if(e==null)return"";if(typeof e=="function")return we(e,vr(e));if(typeof e=="string")return X(e);switch(e){case y:return X("Suspense");case h:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return dr(e.render);case O:return K(e.type,r,n);case j:{var s=e,p=s._payload,g=s._init;try{return K(g(p),r,n)}catch{}}}return""}var Z=Object.prototype.hasOwnProperty,Te={},Oe=A.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,n=K(e.type,e._source,r?r.type:null);Oe.setExtraStackFrame(n)}else Oe.setExtraStackFrame(null)}function pr(e,r,n,s,p){{var g=Function.call.bind(Z);for(var d in e)if(g(e,d)){var f=void 0;try{if(typeof e[d]!="function"){var T=Error((s||"React class")+": "+n+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}f=e[d](r,d,s,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(R){f=R}f&&!(f instanceof Error)&&(q(p),C("%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).",s||"React class",n,d,typeof f),q(null)),f instanceof Error&&!(f.message in Te)&&(Te[f.message]=!0,q(p),C("Failed %s type: %s",n,f.message),q(null))}}}var gr=Array.isArray;function ae(e){return gr(e)}function mr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function hr(e){try{return Se(e),!1}catch{return!0}}function Se(e){return""+e}function je(e){if(hr(e))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",mr(e)),Se(e)}var G=A.ReactCurrentOwner,Er={key:!0,ref:!0,__self:!0,__source:!0},Pe,ke,oe;oe={};function yr(e){if(Z.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function br(e){if(Z.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Rr(e,r){if(typeof e.ref=="string"&&G.current&&r&&G.current.stateNode!==r){var n=x(G.current.type);oe[n]||(C('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',x(G.current.type),e.ref),oe[n]=!0)}}function _r(e,r){{var n=function(){Pe||(Pe=!0,C("%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))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function Cr(e,r){{var n=function(){ke||(ke=!0,C("%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))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var wr=function(e,r,n,s,p,g,d){var f={$$typeof:i,type:e,key:r,ref:n,props:d,_owner:g};return f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(f,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function Tr(e,r,n,s,p){{var g,d={},f=null,T=null;n!==void 0&&(je(n),f=""+n),br(r)&&(je(r.key),f=""+r.key),yr(r)&&(T=r.ref,Rr(r,p));for(g in r)Z.call(r,g)&&!Er.hasOwnProperty(g)&&(d[g]=r[g]);if(e&&e.defaultProps){var R=e.defaultProps;for(g in R)d[g]===void 0&&(d[g]=R[g])}if(f||T){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&_r(d,_),T&&Cr(d,_)}return wr(e,f,T,p,s,G.current,d)}}var ie=A.ReactCurrentOwner,Ae=A.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,n=K(e.type,e._source,r?r.type:null);Ae.setExtraStackFrame(n)}else Ae.setExtraStackFrame(null)}var ue;ue=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===i}function xe(){{if(ie.current){var e=x(ie.current.type);if(e)return`
14
+
15
+ Check the render method of \``+e+"`."}return""}}function Or(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),n=e.lineNumber;return`
16
+
17
+ Check your code at `+r+":"+n+"."}return""}}var De={};function Sr(e){{var r=xe();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(r=`
18
+
19
+ Check the top-level render call using <`+n+">.")}return r}}function Ie(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=Sr(r);if(De[n])return;De[n]=!0;var s="";e&&e._owner&&e._owner!==ie.current&&(s=" It was passed a child from "+x(e._owner.type)+"."),N(e),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,s),N(null)}}function Fe(e,r){{if(typeof e!="object")return;if(ae(e))for(var n=0;n<e.length;n++){var s=e[n];se(s)&&Ie(s,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var p=L(e);if(typeof p=="function"&&p!==e.entries)for(var g=p.call(e),d;!(d=g.next()).done;)se(d.value)&&Ie(d.value,r)}}}function jr(e){{var r=e.type;if(r==null||typeof r=="string")return;var n;if(typeof r=="function")n=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===O))n=r.propTypes;else return;if(n){var s=x(r);pr(n,e.props,"prop",s,e)}else if(r.PropTypes!==void 0&&!ue){ue=!0;var p=x(r);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Pr(e){{for(var r=Object.keys(e.props),n=0;n<r.length;n++){var s=r[n];if(s!=="children"&&s!=="key"){N(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",s),N(null);break}}e.ref!==null&&(N(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),N(null))}}function Le(e,r,n,s,p,g){{var d=ur(e);if(!d){var f="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(f+=" 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 T=Or(p);T?f+=T:f+=xe();var R;e===null?R="null":ae(e)?R="array":e!==void 0&&e.$$typeof===i?(R="<"+(x(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):R=typeof e,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,f)}var _=Tr(e,r,n,p,g);if(_==null)return _;if(d){var P=r.children;if(P!==void 0)if(s)if(ae(P)){for(var V=0;V<P.length;V++)Fe(P[V],e);Object.freeze&&Object.freeze(P)}else C("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 Fe(P,e)}return e===u?Pr(_):jr(_),_}}function kr(e,r,n){return Le(e,r,n,!0)}function Ar(e,r,n){return Le(e,r,n,!1)}var xr=Ar,Dr=kr;Y.Fragment=u,Y.jsx=xr,Y.jsxs=Dr}()),Y}var U={};/**
10
20
  * @license React
11
- * react-jsx-runtime.development.js
21
+ * react-jsx-runtime.production.min.js
12
22
  *
13
23
  * Copyright (c) Facebook, Inc. and its affiliates.
14
24
  *
15
25
  * This source code is licensed under the MIT license found in the
16
26
  * LICENSE file in the root directory of this source tree.
17
- */var ce;function Me(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&function(){var a=E,u=Symbol.for("react.element"),o=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),t=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),F=Symbol.iterator,I="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var r=F&&e[F]||e[I];return typeof r=="function"?r:null}var A=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];w("error",e,n)}}function w(e,r,n){{var i=A.ReactDebugCurrentFrame,g=i.getStackAddendum();g!==""&&(r+="%s",n=n.concat([g]));var p=n.map(function(d){return String(d)});p.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,p)}}var le=!1,fe=!1,J=!1,rr=!1,tr=!1,de;de=Symbol.for("react.module.reference");function nr(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===v||tr||e===c||e===y||e===h||rr||e===S||le||fe||J||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===O||e.$$typeof===m||e.$$typeof===t||e.$$typeof===l||e.$$typeof===de||e.getModuleId!==void 0))}function ar(e,r,n){var i=e.displayName;if(i)return i;var g=r.displayName||r.name||"";return g!==""?n+"("+g+")":n}function ve(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&C("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 s:return"Fragment";case o:return"Portal";case v:return"Profiler";case c:return"StrictMode";case y:return"Suspense";case h:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case t:var r=e;return ve(r)+".Consumer";case m:var n=e;return ve(n._context)+".Provider";case l:return ar(e,e.render,"ForwardRef");case O:var i=e.displayName||null;return i!==null?i:x(e.type)||"Memo";case j:{var g=e,p=g._payload,d=g._init;try{return x(d(p))}catch{return null}}}return null}var M=Object.assign,U=0,ge,pe,me,he,Ee,ye,Re;function be(){}be.__reactDisabledLog=!0;function or(){{if(U===0){ge=console.log,pe=console.info,me=console.warn,he=console.error,Ee=console.group,ye=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}U++}}function ir(){{if(U--,U===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:ge}),info:M({},e,{value:pe}),warn:M({},e,{value:me}),error:M({},e,{value:he}),group:M({},e,{value:Ee}),groupCollapsed:M({},e,{value:ye}),groupEnd:M({},e,{value:Re})})}U<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=A.ReactCurrentDispatcher,re;function X(e,r,n){{if(re===void 0)try{throw Error()}catch(g){var i=g.stack.trim().match(/\n( *(at )?)/);re=i&&i[1]||""}return`
18
- `+re+e}}var te=!1,H;{var ur=typeof WeakMap=="function"?WeakMap:Map;H=new ur}function _e(e,r){if(!e||te)return"";{var n=H.get(e);if(n!==void 0)return n}var i;te=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var p;p=ee.current,ee.current=null,or();try{if(r){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(D){i=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){i=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){i=D}e()}}catch(D){if(D&&i&&typeof D.stack=="string"){for(var f=D.stack.split(`
19
- `),T=i.stack.split(`
20
- `),R=f.length-1,_=T.length-1;R>=1&&_>=0&&f[R]!==T[_];)_--;for(;R>=1&&_>=0;R--,_--)if(f[R]!==T[_]){if(R!==1||_!==1)do if(R--,_--,_<0||f[R]!==T[_]){var P=`
21
- `+f[R].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,P),P}while(R>=1&&_>=0);break}}}finally{te=!1,ee.current=p,ir(),Error.prepareStackTrace=g}var W=e?e.displayName||e.name:"",Ie=W?X(W):"";return typeof e=="function"&&H.set(e,Ie),Ie}function sr(e,r,n){return _e(e,!1)}function cr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,n){if(e==null)return"";if(typeof e=="function")return _e(e,cr(e));if(typeof e=="string")return X(e);switch(e){case y:return X("Suspense");case h:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return sr(e.render);case O:return K(e.type,r,n);case j:{var i=e,g=i._payload,p=i._init;try{return K(p(g),r,n)}catch{}}}return""}var Z=Object.prototype.hasOwnProperty,Ce={},we=A.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,n=K(e.type,e._source,r?r.type:null);we.setExtraStackFrame(n)}else we.setExtraStackFrame(null)}function lr(e,r,n,i,g){{var p=Function.call.bind(Z);for(var d in e)if(p(e,d)){var f=void 0;try{if(typeof e[d]!="function"){var T=Error((i||"React class")+": "+n+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}f=e[d](r,d,i,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(R){f=R}f&&!(f instanceof Error)&&(q(g),C("%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).",i||"React class",n,d,typeof f),q(null)),f instanceof Error&&!(f.message in Ce)&&(Ce[f.message]=!0,q(g),C("Failed %s type: %s",n,f.message),q(null))}}}var fr=Array.isArray;function ne(e){return fr(e)}function dr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function vr(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function Oe(e){if(vr(e))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dr(e)),Te(e)}var B=A.ReactCurrentOwner,gr={key:!0,ref:!0,__self:!0,__source:!0},Se,je,ae;ae={};function pr(e){if(Z.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function mr(e){if(Z.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function hr(e,r){if(typeof e.ref=="string"&&B.current&&r&&B.current.stateNode!==r){var n=x(B.current.type);ae[n]||(C('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',x(B.current.type),e.ref),ae[n]=!0)}}function Er(e,r){{var n=function(){Se||(Se=!0,C("%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))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function yr(e,r){{var n=function(){je||(je=!0,C("%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))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var Rr=function(e,r,n,i,g,p,d){var f={$$typeof:u,type:e,key:r,ref:n,props:d,_owner:p};return f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(f,"_self",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:g}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function br(e,r,n,i,g){{var p,d={},f=null,T=null;n!==void 0&&(Oe(n),f=""+n),mr(r)&&(Oe(r.key),f=""+r.key),pr(r)&&(T=r.ref,hr(r,g));for(p in r)Z.call(r,p)&&!gr.hasOwnProperty(p)&&(d[p]=r[p]);if(e&&e.defaultProps){var R=e.defaultProps;for(p in R)d[p]===void 0&&(d[p]=R[p])}if(f||T){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&Er(d,_),T&&yr(d,_)}return Rr(e,f,T,g,i,B.current,d)}}var oe=A.ReactCurrentOwner,Pe=A.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,n=K(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(n)}else Pe.setExtraStackFrame(null)}var ie;ie=!1;function ue(e){return typeof e=="object"&&e!==null&&e.$$typeof===u}function ke(){{if(oe.current){var e=x(oe.current.type);if(e)return`
22
-
23
- Check the render method of \``+e+"`."}return""}}function _r(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),n=e.lineNumber;return`
24
-
25
- Check your code at `+r+":"+n+"."}return""}}var Ae={};function Cr(e){{var r=ke();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(r=`
26
-
27
- Check the top-level render call using <`+n+">.")}return r}}function xe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=Cr(r);if(Ae[n])return;Ae[n]=!0;var i="";e&&e._owner&&e._owner!==oe.current&&(i=" It was passed a child from "+x(e._owner.type)+"."),N(e),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,i),N(null)}}function De(e,r){{if(typeof e!="object")return;if(ne(e))for(var n=0;n<e.length;n++){var i=e[n];ue(i)&&xe(i,r)}else if(ue(e))e._store&&(e._store.validated=!0);else if(e){var g=L(e);if(typeof g=="function"&&g!==e.entries)for(var p=g.call(e),d;!(d=p.next()).done;)ue(d.value)&&xe(d.value,r)}}}function wr(e){{var r=e.type;if(r==null||typeof r=="string")return;var n;if(typeof r=="function")n=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===O))n=r.propTypes;else return;if(n){var i=x(r);lr(n,e.props,"prop",i,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var g=x(r);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",g||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tr(e){{for(var r=Object.keys(e.props),n=0;n<r.length;n++){var i=r[n];if(i!=="children"&&i!=="key"){N(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",i),N(null);break}}e.ref!==null&&(N(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),N(null))}}function Fe(e,r,n,i,g,p){{var d=nr(e);if(!d){var f="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(f+=" 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 T=_r(g);T?f+=T:f+=ke();var R;e===null?R="null":ne(e)?R="array":e!==void 0&&e.$$typeof===u?(R="<"+(x(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):R=typeof e,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,f)}var _=br(e,r,n,g,p);if(_==null)return _;if(d){var P=r.children;if(P!==void 0)if(i)if(ne(P)){for(var W=0;W<P.length;W++)De(P[W],e);Object.freeze&&Object.freeze(P)}else C("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 De(P,e)}return e===s?Tr(_):wr(_),_}}function Or(e,r,n){return Fe(e,r,n,!0)}function Sr(e,r,n){return Fe(e,r,n,!1)}var jr=Sr,Pr=Or;Y.Fragment=s,Y.jsx=jr,Y.jsxs=Pr}()),Y}process.env.NODE_ENV==="production"?$.exports=Le():$.exports=Me();var k=$.exports;const z=E.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ne=({axios:a,children:u,translate:o,useAuth:s,Outlet:c,Navigate:v,useLocation:m,useGoogleTagManager:t})=>{const l=E.useMemo(()=>({axios:a,Navigate:v,Outlet:c,translate:o,useAuth:s,useGoogleTagManager:t,useLocation:m}),[v,c,a,o,s,t,m]);return k.jsx(z.Provider,{value:l,children:u})},G=a=>`RequireAuth require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:a,loginPath:u="/login",localStorageKey:o="user",redirect401Path:s="/login",...c})=>{var I,L,A,C;const{axios:v=c.axios,useLocation:m=c.useLocation,useAuth:t=c.useAuth,Outlet:l=c.Outlet,Navigate:y=c.Navigate}=E.useContext(z);if(t===void 0)throw new Error(G("useAuth"));if(m===void 0)throw new Error(G("useLocation"));if(l===void 0)throw new Error(G("Outlet"));if(y===void 0)throw new Error(G("Navigate"));const[h,O]=E.useState(null),{isLogged:j}=t(),S=m(),F=E.useRef(!1);return E.useLayoutEffect(()=>{F.current||(F.current=!0,v==null||v.interceptors.response.use(w=>w,async w=>{var J;return typeof w=="object"&&w&&"response"in w&&w.response&&typeof w.response=="object"&&"status"in w.response&&w.response&&typeof w.response=="object"&&"status"in w.response&&((J=w==null?void 0:w.response)==null?void 0:J.status)===401&&(v.defaults.headers.common.Authorization=null,localStorage.removeItem(o),O(s)),Promise.reject(w)}))},[v==null?void 0:v.defaults.headers.common,v==null?void 0:v.interceptors.response,o,s]),j&&!h?k.jsx(E.Suspense,{fallback:a,children:(L=(I=S.state)==null?void 0:I.from)!=null&&L.state&&((C=(A=S.state)==null?void 0:A.from)==null?void 0:C.pathname)===u?k.jsx(y,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):k.jsx(l,{})}):k.jsx(y,{to:u,state:{from:S},replace:!0})},Q=a=>`GTMSendPageView require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ve=({...a})=>{const{useLocation:u=a.useLocation,Outlet:o=a.Outlet,useGoogleTagManager:s=a.useGoogleTagManager}=E.useContext(z);if(u===void 0)throw new Error(Q("useLocation"));if(o===void 0)throw new Error(Q("Outlet"));if(s===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:c}=u(),{sendEvent:v}=s();return E.useEffect(()=>{v({event:"pageView",pathname:c})},[c,v]),k.jsx(o,{})},Ye=({axios:a,baseURL:u,tokenTypeKey:o="tokenType",userLocalStorageKey:s="user",tokenKey:c="accessToken",postContentType:v="application/json"})=>{if(!a.defaults)return null;const m=localStorage.getItem(s),t=m?JSON.parse(m):null,l=t!=null&&t[o]?t[o]:null,y=t!=null&&t[c]?t[c]:null,h=m?`${l} ${y}`:null;return a.defaults.baseURL=u,a.defaults.headers.post["Content-Type"]=v,h&&(a.defaults.headers.common.Authorization=h),null},ze=({i18n:a,debug:u,initReactI18next:o,resources:s,LanguageDetector:c})=>(a!=null&&a.isInitialized||(a.use(c).use(o).init({debug:u,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:s,returnNull:!1}).then(()=>{document.documentElement.lang!==a.resolvedLanguage&&a.resolvedLanguage&&document.documentElement.setAttribute("lang",a.resolvedLanguage)}),a.on("languageChanged",v=>{document.documentElement.setAttribute("lang",v)})),null),Ue=({dsn:a,sentry:u,integrations:o,tracesSampleRate:s,routingInstrumentationDependencies:c,replaysSessionSampleRate:v,replaysOnErrorSampleRate:m,tracePropagationTargets:t,ignoreErrors:l,debug:y})=>(u.isInitialized()||(y||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&u.init({debug:y,dsn:a,ignoreErrors:l||[/Failed to fetch dynamically imported module/],integrations:[new u.BrowserTracing({routingInstrumentation:u.reactRouterV6Instrumentation(c.useEffect,c.useLocation,c.useNavigationType,c.createRoutesFromChildren,c.matchRoutes)}),u.replayIntegration(),...o||[]],replaysOnErrorSampleRate:m||1,replaysSessionSampleRate:v||.1,tracePropagationTargets:t,tracesSampleRate:s||1}),null),Be=({IMaskMixin:a,...u})=>{const o=E.useMemo(()=>a(({TextField:s,...c})=>k.jsx(s,{...c})),[a]);return k.jsx(o,{...u})},Ge=({mapbox:a,accessToken:u})=>(a&&u&&(a.accessToken=u),null),Je=({children:a,defaultOptions:u,QueryClient:o,QueryClientProvider:s})=>{const c=new o({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...u}}});return k.jsx(s,{client:c,children:a})},Xe=a=>{const{unknownErrorTranslationKey:u="error.unknownError"}=a||{},{translate:o=a==null?void 0:a.translate}=E.useContext(z),s=o?o(u):"Unknown error",c=E.useCallback(m=>{var l,y,h,O,j,S,F,I,L;const{response:t}=m||{};return t!=null&&t.reason?String(t.reason):(l=t==null?void 0:t.data)!=null&&l.reason?String(t.data.reason):(y=t==null?void 0:t.data)!=null&&y.message?String(t.data.message):(O=(h=t==null?void 0:t.data)==null?void 0:h.detail)!=null&&O.length&&Array.isArray((j=t==null?void 0:t.data)==null?void 0:j.detail)&&((F=(S=t==null?void 0:t.data)==null?void 0:S.detail[0])!=null&&F.msg)&&typeof((L=(I=t==null?void 0:t.data)==null?void 0:I.detail[0])==null?void 0:L.msg)=="string"?String(t.data.detail[0].msg):s},[s]),v=E.useCallback(m=>{var l,y,h;const{response:t}=m||{};return o&&(t!=null&&t.error_code)?o(t==null?void 0:t.error_code):o&&((l=t==null?void 0:t.data)!=null&&l.error_code)?o((y=t==null?void 0:t.data)==null?void 0:y.error_code):t!=null&&t.error_code?String(t==null?void 0:t.error_code):(h=t==null?void 0:t.data)!=null&&h.error_code?String(t.data.error_code):s},[s,o]);return{printError:c,printErrorCode:v}},He=({data:a,fetchNextPage:u,isFetchingNextPage:o,isInitialLoading:s,isLoading:c,enabled:v=!0})=>{const m=E.useCallback(async l=>{o||!v||await u({pageParam:(l==null?void 0:l.pageParam)||l.visibleRowsCount})},[v,u,o]),t=E.useMemo(()=>{if(a)return a.pages.reduce((l,y)=>[...l,...y],[])},[a]);return{fetchNextPageOnRowsScrollEnd:m,isLoading:o||c,loadingVariant:s?"skeleton":"linear",rows:t}},Ke=a=>{const u=E.useCallback(({tokenType:s,accessToken:c})=>{a.defaults.headers.common.Authorization=`${s} ${c}`},[a.defaults.headers.common]);return{clearAuthenticationToken:E.useCallback(()=>{a.defaults.headers.common.Authorization=null},[a.defaults.headers.common]),setAuthenticationToken:u}},Ze=a=>a.charAt(0).toUpperCase()+a.slice(1).toLowerCase(),qe=a=>{const s=a.split("/").filter(c=>c.length>0).map(c=>c.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("")).join("");return s.charAt(0).toLowerCase()+s.slice(1)},$e=(a,u,o)=>{const s=qe(u),c=Ze(o);return`${s}${c}`},Qe=a=>{if(a)return(a==null?void 0:a.reduce((u,o)=>(u[o]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},u),{}))||{}},er=a=>{const{input:u="./openapi.json",operationsToGenerateInfiniteQueryHook:o=void 0}=a||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:u,output:{client:"react-query",mode:"tags-split",override:{header:s=>["Generated by orval 🍺",...s.title?[s.title]:[],...s.description?[s.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:$e,...(o==null?void 0:o.length)&&{operations:Qe(o)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};b.AxiosConfig=Ye,b.GTMSendPageView=Ve,b.I18nConfig=ze,b.InjectDependenciesContext=z,b.InjectDependenciesProvider=Ne,b.MapBoxConfig=Ge,b.MaskTextField=Be,b.QueryClientConfigProvider=Je,b.RequireAuth=We,b.SentryConfig=Ue,b.getOrvalConfig=er,b.useAuth=Ke,b.useInfiniteDataGrid=He,b.useResponseError=Xe,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
27
+ */var le;function Ne(){if(le)return U;le=1;var a=E,i=Symbol.for("react.element"),o=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,c=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function m(t,l,y){var h,O={},j=null,S=null;y!==void 0&&(j=""+y),l.key!==void 0&&(j=""+l.key),l.ref!==void 0&&(S=l.ref);for(h in l)u.call(l,h)&&!v.hasOwnProperty(h)&&(O[h]=l[h]);if(t&&t.defaultProps)for(h in l=t.defaultProps,l)O[h]===void 0&&(O[h]=l[h]);return{$$typeof:i,type:t,key:j,ref:S,props:O,_owner:c.current}}return U.Fragment=o,U.jsx=m,U.jsxs=m,U}process.env.NODE_ENV==="production"?Q.exports=Ne():Q.exports=We();var k=Q.exports;const z=E.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ve=({axios:a,children:i,translate:o,useAuth:u,Outlet:c,Navigate:v,useLocation:m,useGoogleTagManager:t})=>{const l=E.useMemo(()=>({axios:a,Navigate:v,Outlet:c,translate:o,useAuth:u,useGoogleTagManager:t,useLocation:m}),[v,c,a,o,u,t,m]);return k.jsx(z.Provider,{value:l,children:i})},J=a=>`RequireAuth require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ye=({Fallback:a,loginPath:i="/login",localStorageKey:o="user",redirect401Path:u="/login",...c})=>{var F,L,A,C;const{axios:v=c.axios,useLocation:m=c.useLocation,useAuth:t=c.useAuth,Outlet:l=c.Outlet,Navigate:y=c.Navigate}=E.useContext(z);if(t===void 0)throw new Error(J("useAuth"));if(m===void 0)throw new Error(J("useLocation"));if(l===void 0)throw new Error(J("Outlet"));if(y===void 0)throw new Error(J("Navigate"));const[h,O]=E.useState(null),{isLogged:j}=t(),S=m(),I=E.useRef(!1);return E.useLayoutEffect(()=>{I.current||(I.current=!0,v==null||v.interceptors.response.use(w=>w,async w=>{var $;return typeof w=="object"&&w&&"response"in w&&w.response&&typeof w.response=="object"&&"status"in w.response&&w.response&&typeof w.response=="object"&&"status"in w.response&&(($=w==null?void 0:w.response)==null?void 0:$.status)===401&&(v.defaults.headers.common.Authorization=null,localStorage.removeItem(o),O(u)),Promise.reject(w)}))},[v==null?void 0:v.defaults.headers.common,v==null?void 0:v.interceptors.response,o,u]),j&&!h?k.jsx(E.Suspense,{fallback:a,children:(L=(F=S.state)==null?void 0:F.from)!=null&&L.state&&((C=(A=S.state)==null?void 0:A.from)==null?void 0:C.pathname)===i?k.jsx(y,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):k.jsx(l,{})}):k.jsx(y,{to:i,state:{from:S},replace:!0})},ee=a=>`GTMSendPageView require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ue=({...a})=>{const{useLocation:i=a.useLocation,Outlet:o=a.Outlet,useGoogleTagManager:u=a.useGoogleTagManager}=E.useContext(z);if(i===void 0)throw new Error(ee("useLocation"));if(o===void 0)throw new Error(ee("Outlet"));if(u===void 0)throw new Error(ee("useGoogleTagManager"));const{pathname:c}=i(),{sendEvent:v}=u();return E.useEffect(()=>{v({event:"pageView",pathname:c})},[c,v]),k.jsx(o,{})},ze=({axios:a,baseURL:i,tokenTypeKey:o="tokenType",userLocalStorageKey:u="user",tokenKey:c="accessToken",postContentType:v="application/json"})=>{if(!a.defaults)return null;const m=localStorage.getItem(u),t=m?JSON.parse(m):null,l=t!=null&&t[o]?t[o]:null,y=t!=null&&t[c]?t[c]:null,h=m?`${l} ${y}`:null;return a.defaults.baseURL=i,a.defaults.headers.post["Content-Type"]=v,h&&(a.defaults.headers.common.Authorization=h),null},Be=({i18n:a,debug:i,initReactI18next:o,resources:u,LanguageDetector:c})=>(a!=null&&a.isInitialized||(a.use(c).use(o).init({debug:i,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:u,returnNull:!1}).then(()=>{document.documentElement.lang!==a.resolvedLanguage&&a.resolvedLanguage&&document.documentElement.setAttribute("lang",a.resolvedLanguage)}),a.on("languageChanged",v=>{document.documentElement.setAttribute("lang",v)})),null),Ge=({dsn:a,sentry:i,integrations:o,tracesSampleRate:u,routingInstrumentationDependencies:c,replaysSessionSampleRate:v,replaysOnErrorSampleRate:m,tracePropagationTargets:t,ignoreErrors:l,debug:y})=>(i.isInitialized()||(y||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&i.init({debug:y,dsn:a,ignoreErrors:l||[/Failed to fetch dynamically imported module/],integrations:[new i.BrowserTracing({routingInstrumentation:i.reactRouterV6Instrumentation(c.useEffect,c.useLocation,c.useNavigationType,c.createRoutesFromChildren,c.matchRoutes)}),i.replayIntegration(),...o||[]],replaysOnErrorSampleRate:m||1,replaysSessionSampleRate:v||.1,tracePropagationTargets:t,tracesSampleRate:u||1}),null),Je=({IMaskMixin:a,...i})=>{const o=E.useMemo(()=>a(({TextField:u,...c})=>k.jsx(u,{...c})),[a]);return k.jsx(o,{...i})},$e=({mapbox:a,accessToken:i})=>(a&&i&&(a.accessToken=i),null),Xe=({children:a,defaultOptions:i,QueryClient:o,QueryClientProvider:u})=>{const c=new o({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...i}}});return k.jsx(u,{client:c,children:a})},He=a=>{const{unknownErrorTranslationKey:i="error.unknownError"}=a||{},{translate:o=a==null?void 0:a.translate}=E.useContext(z),u=o?o(i):"Unknown error",c=E.useCallback(m=>{var l,y,h,O,j,S,I,F,L;const{response:t}=m||{};return t!=null&&t.reason?String(t.reason):(l=t==null?void 0:t.data)!=null&&l.reason?String(t.data.reason):(y=t==null?void 0:t.data)!=null&&y.message?String(t.data.message):(O=(h=t==null?void 0:t.data)==null?void 0:h.detail)!=null&&O.length&&Array.isArray((j=t==null?void 0:t.data)==null?void 0:j.detail)&&((I=(S=t==null?void 0:t.data)==null?void 0:S.detail[0])!=null&&I.msg)&&typeof((L=(F=t==null?void 0:t.data)==null?void 0:F.detail[0])==null?void 0:L.msg)=="string"?String(t.data.detail[0].msg):u},[u]),v=E.useCallback(m=>{var l,y,h;const{response:t}=m||{};return o&&(t!=null&&t.error_code)?o(t==null?void 0:t.error_code):o&&((l=t==null?void 0:t.data)!=null&&l.error_code)?o((y=t==null?void 0:t.data)==null?void 0:y.error_code):t!=null&&t.error_code?String(t==null?void 0:t.error_code):(h=t==null?void 0:t.data)!=null&&h.error_code?String(t.data.error_code):u},[u,o]);return{printError:c,printErrorCode:v}},Ke=({data:a,fetchNextPage:i,isFetchingNextPage:o,isInitialLoading:u,isLoading:c,enabled:v=!0})=>{const m=E.useCallback(async l=>{o||!v||await i({pageParam:(l==null?void 0:l.pageParam)||l.visibleRowsCount})},[v,i,o]),t=E.useMemo(()=>{if(a)return a.pages.reduce((l,y)=>[...l,...y],[])},[a]);return{fetchNextPageOnRowsScrollEnd:m,isLoading:o||c,loadingVariant:u?"skeleton":"linear",rows:t}},Ze=a=>{const i=E.useCallback(({tokenType:u,accessToken:c})=>{a.defaults.headers.common.Authorization=`${u} ${c}`},[a.defaults.headers.common]);return{clearAuthenticationToken:E.useCallback(()=>{a.defaults.headers.common.Authorization=null},[a.defaults.headers.common]),setAuthenticationToken:i}},qe=a=>a.charAt(0).toUpperCase()+a.slice(1).toLowerCase(),Qe=a=>{const u=a.split("/").filter(c=>c.length>0).map(c=>c.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("")).join("");return u.charAt(0).toLowerCase()+u.slice(1)},er=(a,i,o)=>{const u=Qe(i),c=qe(o);return`${u}${c}`},rr=a=>{if(a)return(a==null?void 0:a.reduce((i,o)=>(i[o]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},i),{}))||{}},tr=a=>{const{input:i="./openapi.json",operationsToGenerateInfiniteQueryHook:o=void 0}=a||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:i,output:{client:"react-query",mode:"tags-split",override:{header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:er,...(o==null?void 0:o.length)&&{operations:rr(o)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}},W={react:"^18.2.0","react-dom":"^18.2.0"},fe={"@testing-library/jest-dom":"^5.17.0","@testing-library/react":"^14.0.0","@testing-library/user-event":"^14.5.1","@types/react":"^18.2.30","@types/react-dom":"^18.2.14","@vitejs/plugin-react":"^4.2.1","eslint-config-react-tracktor":"^1.7.1",husky:"^8.0.3",jsdom:"^22.1.0",typescript:"^5.3.3",vite:"^5.1.5","vite-plugin-dts":"^3.7.3","vite-plugin-static-copy":"^0.17.1",vitest:"^1.3.1"},nr=()=>"react-native"in W&&W["react-native"]&&"expo"in W&&W.expo?process.env.EXPO_PUBLIC_API_URL:"react"in W&&W.react&&"vite"in fe&&fe.vite?imprort.meta.env.VITE_API_URL:"",ar=(a,i)=>{if(!a)return"";const o=a.startsWith("/")?a:`/${a}`,u=nr();return typeof i=="number"?`${u}${o.replace("/files",`/thumbs/${i}`)}`:`${u}${o}`};b.AxiosConfig=ze,b.GTMSendPageView=Ue,b.I18nConfig=Be,b.InjectDependenciesContext=z,b.InjectDependenciesProvider=Ve,b.MapBoxConfig=$e,b.MaskTextField=Je,b.QueryClientConfigProvider=Xe,b.RequireAuth=Ye,b.SentryConfig=Ge,b.filePathAdapter=ar,b.getOrvalConfig=tr,b.useAuth=Ze,b.useInfiniteDataGrid=Ke,b.useResponseError=He,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
@@ -24,3 +24,5 @@ export { default as useAuth } from './hooks/useAuth';
24
24
  export * from './hooks/useAuth';
25
25
  export { default as getOrvalConfig } from './config/orval';
26
26
  export * from './config/orval';
27
+ export { default as filePathAdapter } from './utils/adapter/filePathAdapter';
28
+ export * from './utils/adapter/filePathAdapter';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Adapt file path from server to display file on client
3
+ * @param path
4
+ * @param size - full or number for thumbs
5
+ */
6
+ export declare const filePathAdapter: (path?: string | null, size?: number | "full") => string;
7
+ export default filePathAdapter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "0.17.2",
3
+ "version": "0.18.1",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/main.d.ts",
@@ -49,10 +49,10 @@
49
49
  "husky": "^8.0.3",
50
50
  "jsdom": "^22.1.0",
51
51
  "typescript": "^5.3.3",
52
- "vite": "^4.5.1",
53
- "vite-plugin-dts": "^3.6.4",
52
+ "vite": "^5.1.5",
53
+ "vite-plugin-dts": "^3.7.3",
54
54
  "vite-plugin-static-copy": "^0.17.1",
55
- "vitest": "^1.1.0"
55
+ "vitest": "^1.3.1"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "react": ">=18.0.0",
File without changes
File without changes
File without changes
File without changes