thecore-auth 0.0.113 → 0.0.115
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/dist/thecore-auth.cjs.js +13 -13
- package/dist/thecore-auth.css +1 -1
- package/dist/thecore-auth.esm.js +640 -520
- package/package.json +1 -1
package/dist/thecore-auth.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),dt=require("jwt-decode"),w=require("react-router-dom"),We=require("axios"),He=require("react-dom");function ft(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(s,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return s.default=t,Object.freeze(s)}const r=ft(i);var pe={exports:{}},le={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
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 ze;function
|
|
9
|
+
*/var ze;function mt(){if(ze)return le;ze=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function n(a,l,c){var u=null;if(c!==void 0&&(u=""+c),l.key!==void 0&&(u=""+l.key),"key"in l){c={};for(var p in l)p!=="key"&&(c[p]=l[p])}else c=l;return l=c.ref,{$$typeof:t,type:a,key:u,ref:l!==void 0?l:null,props:c}}return le.Fragment=s,le.jsx=n,le.jsxs=n,le}var ce={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,21 +14,21 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Be;function
|
|
18
|
-
at`)?" (<anonymous>)":-1<
|
|
19
|
-
`+ye+e+Te}function p(e,
|
|
20
|
-
`),X=
|
|
21
|
-
`);for(
|
|
22
|
-
`+A[
|
|
17
|
+
*/var Be;function pt(){return Be||(Be=1,process.env.NODE_ENV!=="production"&&function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===_?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case z:return"Fragment";case G:return"Portal";case ee:return"Profiler";case Q:return"StrictMode";case Y:return"Suspense";case te:return"SuspenseList"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case $:return(e.displayName||"Context")+".Provider";case q:return(e._context.displayName||"Context")+".Consumer";case V:var f=e.render;return e=e.displayName,e||(e=f.displayName||f.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case J:return f=e.displayName||null,f!==null?f:t(e.type)||"Memo";case F:f=e._payload,e=e._init;try{return t(e(f))}catch{}}return null}function s(e){return""+e}function n(e){try{s(e);var f=!1}catch{f=!0}if(f){f=console;var m=f.error,O=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return m.call(f,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",O),s(e)}}function a(){}function l(){if(ae===0){Oe=console.log,ke=console.info,Le=console.warn,Pe=console.error,Re=console.group,Ne=console.groupCollapsed,Ge=console.groupEnd;var e={configurable:!0,enumerable:!0,value:a,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ae++}function c(){if(ae--,ae===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:B({},e,{value:Oe}),info:B({},e,{value:ke}),warn:B({},e,{value:Le}),error:B({},e,{value:Pe}),group:B({},e,{value:Re}),groupCollapsed:B({},e,{value:Ne}),groupEnd:B({},e,{value:Ge})})}0>ae&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function u(e){if(ye===void 0)try{throw Error()}catch(m){var f=m.stack.trim().match(/\n( *(at )?)/);ye=f&&f[1]||"",Te=-1<m.stack.indexOf(`
|
|
18
|
+
at`)?" (<anonymous>)":-1<m.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
|
+
`+ye+e+Te}function p(e,f){if(!e||Ee)return"";var m=Ce.get(e);if(m!==void 0)return m;Ee=!0,m=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var O=null;O=I.H,I.H=null,l();try{var M={DetermineComponentFrameRoot:function(){try{if(f){var Z=function(){throw Error()};if(Object.defineProperty(Z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Z,[])}catch(W){var me=W}Reflect.construct(e,[],Z)}else{try{Z.call()}catch(W){me=W}e.call(Z.prototype)}}else{try{throw Error()}catch(W){me=W}(Z=e())&&typeof Z.catch=="function"&&Z.catch(function(){})}}catch(W){if(W&&me&&typeof W.stack=="string")return[W.stack,me.stack]}return[null,null]}};M.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var R=Object.getOwnPropertyDescriptor(M.DetermineComponentFrameRoot,"name");R&&R.configurable&&Object.defineProperty(M.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=M.DetermineComponentFrameRoot(),D=v[0],re=v[1];if(D&&re){var A=D.split(`
|
|
20
|
+
`),X=re.split(`
|
|
21
|
+
`);for(v=R=0;R<A.length&&!A[R].includes("DetermineComponentFrameRoot");)R++;for(;v<X.length&&!X[v].includes("DetermineComponentFrameRoot");)v++;if(R===A.length||v===X.length)for(R=A.length-1,v=X.length-1;1<=R&&0<=v&&A[R]!==X[v];)v--;for(;1<=R&&0<=v;R--,v--)if(A[R]!==X[v]){if(R!==1||v!==1)do if(R--,v--,0>v||A[R]!==X[v]){var ie=`
|
|
22
|
+
`+A[R].replace(" at new "," at ");return e.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",e.displayName)),typeof e=="function"&&Ce.set(e,ie),ie}while(1<=R&&0<=v);break}}}finally{Ee=!1,I.H=O,c(),Error.prepareStackTrace=m}return A=(A=e?e.displayName||e.name:"")?u(A):"",typeof e=="function"&&Ce.set(e,A),A}function h(e){if(e==null)return"";if(typeof e=="function"){var f=e.prototype;return p(e,!(!f||!f.isReactComponent))}if(typeof e=="string")return u(e);switch(e){case Y:return u("Suspense");case te:return u("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case V:return e=p(e.render,!1),e;case J:return h(e.type);case F:f=e._payload,e=e._init;try{return h(e(f))}catch{}}return""}function b(){var e=I.A;return e===null?null:e.getOwner()}function g(e){if(T.call(e,"key")){var f=Object.getOwnPropertyDescriptor(e,"key").get;if(f&&f.isReactWarning)return!1}return e.key!==void 0}function P(e,f){function m(){Me||(Me=!0,console.error("%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://react.dev/link/special-props)",f))}m.isReactWarning=!0,Object.defineProperty(e,"key",{get:m,configurable:!0})}function y(){var e=t(this.type);return Ae[e]||(Ae[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function d(e,f,m,O,M,R){return m=R.ref,e={$$typeof:k,type:e,key:f,props:R,_owner:M},(m!==void 0?m:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:y}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function E(e,f,m,O,M,R){if(typeof e=="string"||typeof e=="function"||e===z||e===ee||e===Q||e===Y||e===te||e===se||typeof e=="object"&&e!==null&&(e.$$typeof===F||e.$$typeof===J||e.$$typeof===$||e.$$typeof===q||e.$$typeof===V||e.$$typeof===fe||e.getModuleId!==void 0)){var v=f.children;if(v!==void 0)if(O)if(be(v)){for(O=0;O<v.length;O++)x(v[O],e);Object.freeze&&Object.freeze(v)}else console.error("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 x(v,e)}else v="",(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(v+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),e===null?O="null":be(e)?O="array":e!==void 0&&e.$$typeof===k?(O="<"+(t(e.type)||"Unknown")+" />",v=" Did you accidentally export a JSX literal instead of a component?"):O=typeof e,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",O,v);if(T.call(f,"key")){v=t(e);var D=Object.keys(f).filter(function(A){return A!=="key"});O=0<D.length?"{key: someKey, "+D.join(": ..., ")+": ...}":"{key: someKey}",Ie[v+O]||(D=0<D.length?"{"+D.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
23
23
|
let props = %s;
|
|
24
24
|
<%s {...props} />
|
|
25
25
|
React keys must be passed directly to JSX without using spread:
|
|
26
26
|
let props = %s;
|
|
27
|
-
<%s key={someKey} {...props} />`,
|
|
27
|
+
<%s key={someKey} {...props} />`,O,v,D,v),Ie[v+O]=!0)}if(v=null,m!==void 0&&(n(m),v=""+m),g(f)&&(n(f.key),v=""+f.key),"key"in f){m={};for(var re in f)re!=="key"&&(m[re]=f[re])}else m=f;return v&&P(m,typeof e=="function"?e.displayName||e.name||"Unknown":e),d(e,v,R,M,b(),m)}function x(e,f){if(typeof e=="object"&&e&&e.$$typeof!==ut){if(be(e))for(var m=0;m<e.length;m++){var O=e[m];C(O)&&j(O,f)}else if(C(e))e._store&&(e._store.validated=1);else if(e===null||typeof e!="object"?m=null:(m=N&&e[N]||e["@@iterator"],m=typeof m=="function"?m:null),typeof m=="function"&&m!==e.entries&&(m=m.call(e),m!==e))for(;!(e=m.next()).done;)C(e.value)&&j(e.value,f)}}function C(e){return typeof e=="object"&&e!==null&&e.$$typeof===k}function j(e,f){if(e._store&&!e._store.validated&&e.key==null&&(e._store.validated=1,f=S(f),!_e[f])){_e[f]=!0;var m="";e&&e._owner!=null&&e._owner!==b()&&(m=null,typeof e._owner.tag=="number"?m=t(e._owner.type):typeof e._owner.name=="string"&&(m=e._owner.name),m=" It was passed a child from "+m+".");var O=I.getCurrentStack;I.getCurrentStack=function(){var M=h(e.type);return O&&(M+=O()||""),M},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',f,m),I.getCurrentStack=O}}function S(e){var f="",m=b();return m&&(m=t(m.type))&&(f=`
|
|
28
28
|
|
|
29
|
-
Check the render method of \``+
|
|
29
|
+
Check the render method of \``+m+"`."),f||(e=t(e))&&(f=`
|
|
30
30
|
|
|
31
|
-
Check the top-level render call using <`+e+">."),
|
|
31
|
+
Check the top-level render call using <`+e+">."),f}var L=i,k=Symbol.for("react.transitional.element"),G=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),$=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),se=Symbol.for("react.offscreen"),N=Symbol.iterator,_=Symbol.for("react.client.reference"),I=L.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,T=Object.prototype.hasOwnProperty,B=Object.assign,fe=Symbol.for("react.client.reference"),be=Array.isArray,ae=0,Oe,ke,Le,Pe,Re,Ne,Ge;a.__reactDisabledLog=!0;var ye,Te,Ee=!1,Ce=new(typeof WeakMap=="function"?WeakMap:Map),ut=Symbol.for("react.client.reference"),Me,Ae={},Ie={},_e={};ce.Fragment=z,ce.jsx=function(e,f,m,O,M){return E(e,f,m,!1,O,M)},ce.jsxs=function(e,f,m,O,M){return E(e,f,m,!0,O,M)}}()),ce}var Fe;function ht(){return Fe||(Fe=1,process.env.NODE_ENV==="production"?pe.exports=mt():pe.exports=pt()),pe.exports}var o=ht();const Ye=i.createContext(),gt=({children:t})=>{const[s,n]=i.useState(!1),[a,l]=i.useState(!1),[c,u]=i.useState({});return o.jsx(Ye.Provider,{value:{isLoading:s,setIsLoading:n,isLoadingComponent:a,setIsLoadingComponent:l,loadingProps:c,setLoadingProps:u},children:t})},ne=()=>{const t=i.useContext(Ye);if(t===void 0)throw new Error("Non puoi settare il loading");return t},Ze=({errorMessage:t,errorShow:s})=>o.jsx("section",{className:s?"":"hidden",children:o.jsxs("div",{className:"container mx-auto",children:[o.jsx("h1",{className:"text-center text-8xl my-12",children:"Errore"}),o.jsx("pre",{className:"text-xl",children:t})]})}),xt="0.0.115",Ue=i.createContext(),vt=({children:t})=>{const[s,n]=i.useState({}),[a,l]=i.useState(!1),c=`Creare un file config.json in public per il corretto funzionamento
|
|
32
32
|
Esempio di config.json:
|
|
33
33
|
|
|
34
34
|
{
|
|
@@ -55,7 +55,7 @@ Esempio di config.json:
|
|
|
55
55
|
"backendToken": "",
|
|
56
56
|
"isDebug": "",
|
|
57
57
|
"showHeaderButton": ""
|
|
58
|
-
}`,d=()=>{const m=new Date,v=String(m.getDate()).padStart(2,"0"),g=String(m.getMonth()+1).padStart(2,"0"),C=m.getFullYear(),j=String(m.getHours()).padStart(2,"0"),S=String(m.getMinutes()).padStart(2,"0"),N=String(m.getSeconds()).padStart(2,"0");return`${v}/${g}/${C} ${j}:${S}:${N}`},p=m=>new Promise((v,g)=>{const C=indexedDB.open("configDatabase",1);C.onupgradeneeded=j=>{const S=j.target.result;S.objectStoreNames.contains(m)||S.createObjectStore(m,{keyPath:"id"})},C.onsuccess=j=>v(j.target.result),C.onerror=j=>g(j.target.error)}),h=async(m,v)=>{let g=await p(m);return new Promise((C,j)=>{if(!g){j("Errore: DB non disponibile");return}const S=g==null?void 0:g.transaction(m,"readonly"),N=S==null?void 0:S.objectStore(m),L=N==null?void 0:N.get(v);L.onsuccess=()=>C(L.result),L.onerror=I=>j(I.target.error)})},y=async(m,v)=>{let g=await p(m);return new Promise((C,j)=>{if(!g){j("Errore: DB non disponibile");return}const S=g==null?void 0:g.transaction(m,"readwrite"),N=S==null?void 0:S.objectStore(m),L=N==null?void 0:N.put(v);L.onsuccess=()=>C(L.result),L.onerror=I=>j(I.target.error)})},E=async m=>{let v=Date.now(),g;do g=await h(m,v),g&&v++;while(g);return v},P=async(m,v)=>{v.id||(v.id=await E(m)),await y(m,v)},O=async()=>{try{const v=await(await fetch("/config.json")).json();let g;v.isDevelopment?g=ht:g=(await(await fetch("/package.json")).json()).version;const C={...v,version:g,openIndexedDB:p,getDataIndexedDB:h,setDataIndexedDB:y,generateUniqueId:E,setDataWithAutoId:P,setCurrentDate:d};n(C)}catch(m){console.error(m),i(!0)}};return l.useEffect(()=>{O()},[]),Object.keys(s).length===0?o.jsx(Ye,{errorShow:a,errorMessage:c}):o.jsx(Ze.Provider,{value:s,children:r})},W=()=>{const r=l.useContext(Ze);if(r===void 0)throw new Error("Non puoi leggere i config");return r},xt=r=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...r},t.createElement("defs",null,t.createElement("g",null),t.createElement("clipPath",{id:"6ca7e2bf04"},t.createElement("path",{d:"M 265.136719 0 L 375 109.863281 L 375 265.136719 L 265.136719 375 L 109.863281 375 L 0 265.136719 L 0 109.863281 L 109.863281 0 Z M 265.136719 0 ",clipRule:"nonzero"})),t.createElement("clipPath",{id:"2c77c820c6"},t.createElement("path",{d:"M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ",clipRule:"nonzero"})),t.createElement("clipPath",{id:"3d94df7d66"},t.createElement("path",{d:"M 259.804688 12.878906 L 362.121094 115.195312 L 362.121094 259.804688 L 259.804688 362.121094 L 115.195312 362.121094 L 12.878906 259.804688 L 12.878906 115.195312 L 115.195312 12.878906 Z M 259.804688 12.878906 ",clipRule:"nonzero"})),t.createElement("clipPath",{id:"8793709a64"},t.createElement("path",{d:"M 12.878906 12.878906 L 362.109375 12.878906 L 362.109375 362.109375 L 12.878906 362.109375 Z M 12.878906 12.878906 ",clipRule:"nonzero"})),t.createElement("clipPath",{id:"fdb3fe29d8"},t.createElement("path",{d:"M 259.796875 12.878906 L 362.109375 115.191406 L 362.109375 259.796875 L 259.796875 362.109375 L 115.191406 362.109375 L 12.878906 259.796875 L 12.878906 115.191406 L 115.191406 12.878906 Z M 259.796875 12.878906 ",clipRule:"nonzero"}))),t.createElement("g",{clipPath:"url(#6ca7e2bf04)"},t.createElement("rect",{x:-37.5,width:450,fill:"#b91c1c",y:-37.499999,height:449.999989,fillOpacity:1})),t.createElement("g",{clipPath:"url(#2c77c820c6)"},t.createElement("g",{clipPath:"url(#3d94df7d66)"},t.createElement("path",{fill:"#b91c1c",d:"M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ",fillOpacity:1,fillRule:"nonzero"}))),t.createElement("g",{clipPath:"url(#8793709a64)"},t.createElement("g",{clipPath:"url(#fdb3fe29d8)"},t.createElement("path",{strokeLinecap:"butt",transform:"matrix(0.75, 0, 0, 0.75, 12.879396, 12.879392)",fill:"none",strokeLinejoin:"miter",d:"M 329.223327 -0.000647072 L 465.640003 136.416029 L 465.640003 329.223333 L 329.223327 465.640009 L 136.416023 465.640009 L -0.000653072 329.223333 L -0.000653072 136.416029 L 136.416023 -0.000647072 Z M 329.223327 -0.000647072 ",stroke:"#ffffff",strokeWidth:34,strokeOpacity:1,strokeMiterlimit:4}))),t.createElement("g",{fill:"#ffffff",fillOpacity:1},t.createElement("g",{transform:"translate(111.648432, 267.442446)"},t.createElement("g",null,t.createElement("path",{d:"M 2.828125 0 L 56.25 -79.859375 L 3.046875 -159.609375 L 37.28125 -159.609375 L 75.90625 -98.046875 L 114.53125 -159.609375 L 148.765625 -159.609375 L 95.5625 -79.859375 L 148.984375 0 L 114.765625 0 L 75.671875 -60.65625 L 37.046875 0 Z M 2.828125 0 "}))))),vt=r=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...r},t.createElement("defs",null,t.createElement("g",null),t.createElement("clipPath",{id:"30562604dd"},t.createElement("path",{d:"M 187.5 0 C 83.945312 0 0 83.945312 0 187.5 C 0 291.054688 83.945312 375 187.5 375 C 291.054688 375 375 291.054688 375 187.5 C 375 83.945312 291.054688 0 187.5 0 Z M 187.5 0 ",clipRule:"nonzero"})),t.createElement("clipPath",{id:"971fcd5f72"},t.createElement("path",{d:"M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ",clipRule:"nonzero"})),t.createElement("clipPath",{id:"e891a7f57e"},t.createElement("path",{d:"M 187.5 18.570312 C 94.203125 18.570312 18.570312 94.203125 18.570312 187.5 C 18.570312 280.796875 94.203125 356.429688 187.5 356.429688 C 280.796875 356.429688 356.429688 280.796875 356.429688 187.5 C 356.429688 94.203125 280.796875 18.570312 187.5 18.570312 Z M 187.5 18.570312 ",clipRule:"nonzero"})),t.createElement("clipPath",{id:"19a9ddc130"},t.createElement("path",{d:"M 18.570312 18.570312 L 356.070312 18.570312 L 356.070312 356.070312 L 18.570312 356.070312 Z M 18.570312 18.570312 ",clipRule:"nonzero"})),t.createElement("clipPath",{id:"5e650d5bd0"},t.createElement("path",{d:"M 187.496094 18.570312 C 94.199219 18.570312 18.570312 94.199219 18.570312 187.496094 C 18.570312 280.792969 94.199219 356.421875 187.496094 356.421875 C 280.792969 356.421875 356.421875 280.792969 356.421875 187.496094 C 356.421875 94.199219 280.792969 18.570312 187.496094 18.570312 Z M 187.496094 18.570312 ",clipRule:"nonzero"}))),t.createElement("g",{clipPath:"url(#30562604dd)"},t.createElement("rect",{x:-37.5,width:450,fill:"#1d4ed8",y:-37.499999,height:449.999989,fillOpacity:1})),t.createElement("g",{clipPath:"url(#971fcd5f72)"},t.createElement("g",{clipPath:"url(#e891a7f57e)"},t.createElement("path",{fill:"#1d4ed8",d:"M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ",fillOpacity:1,fillRule:"nonzero"}))),t.createElement("g",{clipPath:"url(#19a9ddc130)"},t.createElement("g",{clipPath:"url(#5e650d5bd0)"},t.createElement("path",{strokeLinecap:"butt",transform:"matrix(0.75, 0, 0, 0.75, 18.570291, 18.570286)",fill:"none",strokeLinejoin:"miter",d:"M 225.234419 0.0000349326 C 100.838577 0.0000349326 0.0000289326 100.838583 0.0000289326 225.234425 C 0.0000289326 349.630266 100.838577 450.468815 225.234419 450.468815 C 349.63026 450.468815 450.468809 349.630266 450.468809 225.234425 C 450.468809 100.838583 349.63026 0.0000349326 225.234419 0.0000349326 Z M 225.234419 0.0000349326 ",stroke:"#ffffff",strokeWidth:34,strokeOpacity:1,strokeMiterlimit:4}))),t.createElement("g",{fill:"#ffffff",fillOpacity:1},t.createElement("g",{transform:"translate(136.121787, 300.837436)"},t.createElement("g",null,t.createElement("path",{d:"M 60 -193.78125 C 54.707031 -193.78125 50.109375 -195.734375 46.203125 -199.640625 C 42.296875 -203.554688 40.34375 -208.15625 40.34375 -213.4375 C 40.34375 -218.726562 42.296875 -223.328125 46.203125 -227.234375 C 50.109375 -231.140625 54.707031 -233.09375 60 -233.09375 C 65.28125 -233.09375 69.875 -231.140625 73.78125 -227.234375 C 77.695312 -223.328125 79.65625 -218.726562 79.65625 -213.4375 C 79.65625 -208.15625 77.695312 -203.554688 73.78125 -199.640625 C 69.875 -195.734375 65.28125 -193.78125 60 -193.78125 Z M 45.171875 4.828125 C 39.191406 4.828125 35.28125 2.414062 33.4375 -2.40625 C 31.601562 -7.238281 30.6875 -13.675781 30.6875 -21.71875 C 30.6875 -34.59375 31.773438 -47.234375 33.953125 -59.640625 C 36.140625 -72.054688 38.328125 -83.894531 40.515625 -95.15625 C 42.703125 -106.425781 43.796875 -116.890625 43.796875 -126.546875 C 43.796875 -129.078125 43.675781 -131.832031 43.4375 -134.8125 C 43.207031 -137.800781 42.632812 -140.101562 41.71875 -141.71875 C 38.039062 -139.414062 33.269531 -135.617188 27.40625 -130.328125 C 21.550781 -125.046875 16.898438 -119.1875 13.453125 -112.75 C 11.835938 -114.363281 11.03125 -116.550781 11.03125 -119.3125 C 11.03125 -123.21875 12.582031 -127.46875 15.6875 -132.0625 C 18.789062 -136.65625 22.925781 -141.078125 28.09375 -145.328125 C 33.269531 -149.585938 38.847656 -153.097656 44.828125 -155.859375 C 50.804688 -158.617188 56.664062 -160 62.40625 -160 C 67.695312 -160 71.085938 -158.734375 72.578125 -156.203125 C 74.078125 -153.671875 74.828125 -150.453125 74.828125 -146.546875 C 74.828125 -140.796875 74.078125 -133.378906 72.578125 -124.296875 C 71.085938 -115.222656 69.363281 -105.515625 67.40625 -95.171875 C 65.457031 -84.828125 63.734375 -74.484375 62.234375 -64.140625 C 60.742188 -53.796875 60 -44.367188 60 -35.859375 C 60 -31.492188 60.226562 -27.414062 60.6875 -23.625 C 61.144531 -19.832031 61.71875 -16.671875 62.40625 -14.140625 C 68.15625 -16.671875 73.613281 -20.40625 78.78125 -25.34375 C 83.957031 -30.28125 87.8125 -34.9375 90.34375 -39.3125 C 91.71875 -37.238281 92.40625 -35.050781 92.40625 -32.75 C 92.40625 -29.070312 90.796875 -25.050781 87.578125 -20.6875 C 84.359375 -16.320312 80.332031 -12.179688 75.5 -8.265625 C 70.675781 -4.359375 65.5625 -1.203125 60.15625 1.203125 C 54.757812 3.617188 49.765625 4.828125 45.171875 4.828125 Z M 45.171875 4.828125 "}))))),bt=r=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...r},t.createElement("defs",null,t.createElement("g",null),t.createElement("clipPath",{id:"59a10ac27a"},t.createElement("path",{d:"M 17.179688 32.695312 L 360 32.695312 L 360 337.5 L 17.179688 337.5 Z M 17.179688 32.695312 ",clipRule:"nonzero"})),t.createElement("clipPath",{id:"664b27481e"},t.createElement("path",{d:"M 207.042969 43.574219 L 356.394531 304.941406 C 360.242188 311.675781 360.214844 319.953125 356.324219 326.660156 C 352.429688 333.371094 345.257812 337.5 337.5 337.5 L 39.375 337.5 C 31.617188 337.5 24.445312 333.371094 20.554688 326.660156 C 16.660156 319.953125 16.632812 311.675781 20.480469 304.941406 L 169.832031 43.574219 C 173.648438 36.898438 180.746094 32.777344 188.4375 32.777344 C 196.128906 32.777344 203.226562 36.898438 207.042969 43.574219 Z M 207.042969 43.574219 ",clipRule:"nonzero"}))),t.createElement("g",{clipPath:"url(#59a10ac27a)"},t.createElement("g",{clipPath:"url(#664b27481e)"},t.createElement("path",{fill:"#d97706",d:"M 1.875 11.015625 L 375.546875 11.015625 L 375.546875 337.5 L 1.875 337.5 Z M 1.875 11.015625 ",fillOpacity:1,fillRule:"nonzero"}))),t.createElement("g",{fill:"#ffffff",fillOpacity:1},t.createElement("g",{transform:"translate(158.410439, 295.655517)"},t.createElement("g",null,t.createElement("path",{d:"M 46.890625 -63.21875 C 46.890625 -63.21875 46.890625 -64.445312 46.890625 -66.90625 L 46.890625 -176.46875 C 46.890625 -178.925781 46.1875 -180.859375 44.78125 -182.265625 C 43.375 -183.671875 41.441406 -184.375 38.984375 -184.375 L 21.078125 -184.375 C 18.617188 -184.375 16.6875 -183.671875 15.28125 -182.265625 C 13.875 -180.859375 13.171875 -178.925781 13.171875 -176.46875 L 13.171875 -66.90625 C 13.171875 -64.445312 13.875 -62.515625 15.28125 -61.109375 C 16.6875 -59.703125 18.617188 -59 21.078125 -59 L 38.984375 -59 C 41.441406 -59 43.375 -59.703125 44.78125 -61.109375 C 46.1875 -62.515625 46.890625 -63.21875 46.890625 -63.21875 Z M 46.890625 -4.21875 C 46.890625 -4.21875 46.890625 -5.445312 46.890625 -7.90625 L 46.890625 -25.546875 C 46.890625 -28.003906 46.1875 -29.9375 44.78125 -31.34375 C 43.375 -32.75 41.441406 -33.453125 38.984375 -33.453125 L 21.078125 -33.453125 C 18.617188 -33.453125 16.6875 -32.75 15.28125 -31.34375 C 13.875 -29.9375 13.171875 -28.003906 13.171875 -25.546875 L 13.171875 -7.90625 C 13.171875 -5.445312 13.875 -3.515625 15.28125 -2.109375 C 16.6875 -0.703125 18.617188 0 21.078125 0 L 38.984375 0 C 41.441406 0 43.375 -0.703125 44.78125 -2.109375 C 46.1875 -3.515625 46.890625 -4.21875 46.890625 -4.21875 Z M 46.890625 -4.21875 "})))));var Ue={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},$e=l.createContext&&l.createContext(Ue),yt=["attr","size","title"];function Et(r,s){if(r==null)return{};var n=Ct(r,s),a,i;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);for(i=0;i<c.length;i++)a=c[i],!(s.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(r,a)&&(n[a]=r[a])}return n}function Ct(r,s){if(r==null)return{};var n={};for(var a in r)if(Object.prototype.hasOwnProperty.call(r,a)){if(s.indexOf(a)>=0)continue;n[a]=r[a]}return n}function he(){return he=Object.assign?Object.assign.bind():function(r){for(var s=1;s<arguments.length;s++){var n=arguments[s];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])}return r},he.apply(this,arguments)}function De(r,s){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);s&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),n.push.apply(n,a)}return n}function ge(r){for(var s=1;s<arguments.length;s++){var n=arguments[s]!=null?arguments[s]:{};s%2?De(Object(n),!0).forEach(function(a){wt(r,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):De(Object(n)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(n,a))})}return r}function wt(r,s,n){return s=jt(s),s in r?Object.defineProperty(r,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[s]=n,r}function jt(r){var s=St(r,"string");return typeof s=="symbol"?s:s+""}function St(r,s){if(typeof r!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var a=n.call(r,s||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(r)}function qe(r){return r&&r.map((s,n)=>l.createElement(s.tag,ge({key:n},s.attr),qe(s.child)))}function ne(r){return s=>l.createElement(Ot,he({attr:ge({},r.attr)},s),qe(r.child))}function Ot(r){var s=n=>{var{attr:a,size:i,title:c}=r,d=Et(r,yt),p=i||n.size||"1em",h;return n.className&&(h=n.className),r.className&&(h=(h?h+" ":"")+r.className),l.createElement("svg",he({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,a,d,{className:h,style:ge(ge({color:r.color||n.color},n.style),r.style),height:p,width:p,xmlns:"http://www.w3.org/2000/svg"}),c&&l.createElement("title",null,c),r.children)};return $e!==void 0?l.createElement($e.Consumer,null,n=>s(n)):s(Ue)}function Lt(r){return ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M17.47 250.9C88.82 328.1 158 397.6 224.5 485.5c72.3-143.8 146.3-288.1 268.4-444.37L460 26.06C356.9 135.4 276.8 238.9 207.2 361.9c-48.4-43.6-126.62-105.3-174.38-137z"},child:[]}]})(r)}const Ve=l.createContext(),kt=({children:r})=>{const[s,n]=l.useState(!1),[a,i]=l.useState(),[c,d]=l.useState(),P={showAlert:s,setShowAlert:n,typeAlert:a,setTypeAlert:i,messageAlert:c,setMessageAlert:d,alertConfig:{danger:{bgColor:"bg-danger",textColor:"text-danger-text",buttonBg:"bg-danger",hoverBg:"hover:bg-danger-hover",focusRing:"focus:ring-danger-progress",progressColor:"bg-danger-progress"},info:{bgColor:"bg-info",textColor:"text-info-text",buttonBg:"bg-info",hoverBg:"hover:bg-info-hover",focusRing:"focus:ring-info-progress",progressColor:"bg-info-progress"},success:{bgColor:"bg-success",textColor:"text-success-text",buttonBg:"bg-success",hoverBg:"hover:bg-success-hover",focusRing:"focus:ring-success-progress",progressColor:"bg-success-progress"},warning:{bgColor:"bg-warning",textColor:"text-warning-text",buttonBg:"bg-warning",hoverBg:"hover:bg-warning-hover",focusRing:"focus:ring-warning-progress",progressColor:"bg-warning-progress"}},getIcon:O=>{switch(O){case"danger":return o.jsx(xt,{className:"w-[20px] h-[20px]"});case"info":return o.jsx(vt,{className:"w-[20px] h-[20px]"});case"success":return o.jsx(Lt,{className:"text-xl"});case"warning":return o.jsx(bt,{className:"w-[20px] h-[20px]"})}},closeAlert:()=>{n(!s)},activeAlert:(O,m)=>{n(!1),setTimeout(()=>{i(O),d(m),n(!0)},50)}};return o.jsx(Ve.Provider,{value:P,children:r})},U=()=>{const r=l.useContext(Ve);if(r===void 0)throw new Error("Non puoi modificare l'alert");return r};let re;const Je=async(r,s,n)=>{if(re)return re;try{const i=await(await fetch("/config.json")).json(),c=i.baseUri,{unauthorized:d,notFound:p,defaultMessage:h}=i.axiosErrors,y=i.axiosTimeout;return re=We.create({baseURL:c,timeout:y}),re.interceptors.request.use(E=>E),re.interceptors.response.use(E=>E,E=>{if(E.response)switch(r(!0),s("danger"),E.response.status){case 401:localStorage.removeItem("accessToken"),n(d);break;case 404:n(p);break;default:n(`${h} ${E.response.status||""} ${E.response.data.error||""}`)}return Promise.reject(E)}),re}catch(a){console.error(a)}},Xe=l.createContext(),Pt=({children:r})=>{const{heartbeatEndpoint:s,firstPrivatePath:n,infiniteSession:a,timeDeducted:i,authenticatedEndpoint:c,autoLogin:d,setCurrentDate:p,isDebug:h,backendToken:y}=W(),{setIsLoading:E}=oe(),{setShowAlert:P,setMessageAlert:O,setTypeAlert:m,activeAlert:v}=U(),g=b.useNavigate(),[C,j]=l.useState(null),[S,N]=l.useState(),[L,I]=l.useState(),[H,K]=l.useState(),[Q,q]=l.useState(!1),F=async()=>await Je(P,m,O),V=async(R=null,M)=>{R&&R.preventDefault(),q(!0);try{E(!0),P(!1);const G=await(await F()).post(c,{auth:M}),z=G.headers.token,de=G.data;z&&(localStorage.setItem("accessToken",z),localStorage.setItem("user",JSON.stringify(de)),j(!0),N(z),g(`${n}${de.id}`))}catch(_){console.error(_)}finally{q(!1),E(!1)}},Y=()=>{localStorage.removeItem("accessToken"),localStorage.removeItem("id"),localStorage.removeItem("user"),j(!1),N(null)},ee=async()=>{try{const R=localStorage.getItem("accessToken"),G=(await(await F()).get(`${s}`,{headers:{Authorization:R}})).headers.token;localStorage.setItem("accessToken",G),N(G),h&&console.log("nuovo token: ",G,"Data:",p())}catch(R){console.error(R),Y()}},J=()=>{if(!S)return;const M=lt(S).exp,_=Math.floor(Date.now()/1e3),G=(M-_)*1e3;K(G),I(G-i)},B=async R=>{try{const G=(await(await F()).get(s,{headers:{Authorization:R}})).data;G&&(localStorage.setItem("user",JSON.stringify(G)),localStorage.setItem("accessToken",R),j(!0),g(`${n}${G.id}`))}catch(M){console.error(M)}};l.useEffect(()=>{if(localStorage.getItem("accessToken"))j(!0);else{j(!1);return}},[]),l.useEffect(()=>{d&&B(y)},[d]),l.useEffect(()=>{C||d&&!Q&&B(y)},[C]),l.useEffect(()=>{if(d)return;J();let R;a&&S&&L&&(R=setInterval(()=>{ee()},L));let M;return!a&&S&&H&&(M=setTimeout(()=>{Y(),v("danger","Sessione scaduta")},H)),()=>{R&&clearInterval(R),M&&clearTimeout(M)}},[S,L]);const se={isAuthenticated:C,setIsAuthenticated:j,login:V,logout:Y,setCurrentToken:N,createAxiosInstances:F};return o.jsx(Xe.Provider,{value:se,children:r})},fe=()=>{const r=l.useContext(Xe);if(r===void 0)throw new Error("Non sei dentro al Auth Provider");return r},Ke=l.createContext(),Rt=({children:r,publicRoutes:s=[],privateRoutes:n=[]})=>o.jsx(Ke.Provider,{value:{publicRoutes:s,privateRoutes:n},children:r}),Qe=()=>{const r=l.useContext(Ke);if(r===void 0)throw new Error(`Errore: Le rotte non sono state inizializzate correttamente.
|
|
58
|
+
}`,u=()=>{const d=new Date,E=String(d.getDate()).padStart(2,"0"),x=String(d.getMonth()+1).padStart(2,"0"),C=d.getFullYear(),j=String(d.getHours()).padStart(2,"0"),S=String(d.getMinutes()).padStart(2,"0"),L=String(d.getSeconds()).padStart(2,"0");return`${E}/${x}/${C} ${j}:${S}:${L}`},p=d=>new Promise((E,x)=>{const C=indexedDB.open("configDatabase",1);C.onupgradeneeded=j=>{const S=j.target.result;S.objectStoreNames.contains(d)||S.createObjectStore(d,{keyPath:"id"})},C.onsuccess=j=>E(j.target.result),C.onerror=j=>x(j.target.error)}),h=async(d,E)=>{let x=await p(d);return new Promise((C,j)=>{if(!x){j("Errore: DB non disponibile");return}const S=x==null?void 0:x.transaction(d,"readonly"),L=S==null?void 0:S.objectStore(d),k=L==null?void 0:L.get(E);k.onsuccess=()=>C(k.result),k.onerror=G=>j(G.target.error)})},b=async(d,E)=>{let x=await p(d);return new Promise((C,j)=>{if(!x){j("Errore: DB non disponibile");return}const S=x==null?void 0:x.transaction(d,"readwrite"),L=S==null?void 0:S.objectStore(d),k=L==null?void 0:L.put(E);k.onsuccess=()=>C(k.result),k.onerror=G=>j(G.target.error)})},g=async d=>{let E=Date.now(),x;do x=await h(d,E),x&&E++;while(x);return E},P=async(d,E)=>{E.id||(E.id=await g(d)),await b(d,E)},y=async()=>{try{const E=await(await fetch("/config.json")).json();let x;E.isDevelopment?x=xt:x=(await(await fetch("/package.json")).json()).version;const C={...E,version:x,openIndexedDB:p,getDataIndexedDB:h,setDataIndexedDB:b,generateUniqueId:g,setDataWithAutoId:P,setCurrentDate:u};n(C)}catch(d){console.error(d),l(!0)}};return i.useEffect(()=>{y()},[]),Object.keys(s).length===0?o.jsx(Ze,{errorShow:a,errorMessage:c}):o.jsx(Ue.Provider,{value:s,children:t})},H=()=>{const t=i.useContext(Ue);if(t===void 0)throw new Error("Non puoi leggere i config");return t},bt=t=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...t},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"6ca7e2bf04"},r.createElement("path",{d:"M 265.136719 0 L 375 109.863281 L 375 265.136719 L 265.136719 375 L 109.863281 375 L 0 265.136719 L 0 109.863281 L 109.863281 0 Z M 265.136719 0 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"2c77c820c6"},r.createElement("path",{d:"M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"3d94df7d66"},r.createElement("path",{d:"M 259.804688 12.878906 L 362.121094 115.195312 L 362.121094 259.804688 L 259.804688 362.121094 L 115.195312 362.121094 L 12.878906 259.804688 L 12.878906 115.195312 L 115.195312 12.878906 Z M 259.804688 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"8793709a64"},r.createElement("path",{d:"M 12.878906 12.878906 L 362.109375 12.878906 L 362.109375 362.109375 L 12.878906 362.109375 Z M 12.878906 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"fdb3fe29d8"},r.createElement("path",{d:"M 259.796875 12.878906 L 362.109375 115.191406 L 362.109375 259.796875 L 259.796875 362.109375 L 115.191406 362.109375 L 12.878906 259.796875 L 12.878906 115.191406 L 115.191406 12.878906 Z M 259.796875 12.878906 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#6ca7e2bf04)"},r.createElement("rect",{x:-37.5,width:450,fill:"#b91c1c",y:-37.499999,height:449.999989,fillOpacity:1})),r.createElement("g",{clipPath:"url(#2c77c820c6)"},r.createElement("g",{clipPath:"url(#3d94df7d66)"},r.createElement("path",{fill:"#b91c1c",d:"M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#8793709a64)"},r.createElement("g",{clipPath:"url(#fdb3fe29d8)"},r.createElement("path",{strokeLinecap:"butt",transform:"matrix(0.75, 0, 0, 0.75, 12.879396, 12.879392)",fill:"none",strokeLinejoin:"miter",d:"M 329.223327 -0.000647072 L 465.640003 136.416029 L 465.640003 329.223333 L 329.223327 465.640009 L 136.416023 465.640009 L -0.000653072 329.223333 L -0.000653072 136.416029 L 136.416023 -0.000647072 Z M 329.223327 -0.000647072 ",stroke:"#ffffff",strokeWidth:34,strokeOpacity:1,strokeMiterlimit:4}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(111.648432, 267.442446)"},r.createElement("g",null,r.createElement("path",{d:"M 2.828125 0 L 56.25 -79.859375 L 3.046875 -159.609375 L 37.28125 -159.609375 L 75.90625 -98.046875 L 114.53125 -159.609375 L 148.765625 -159.609375 L 95.5625 -79.859375 L 148.984375 0 L 114.765625 0 L 75.671875 -60.65625 L 37.046875 0 Z M 2.828125 0 "}))))),yt=t=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...t},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"30562604dd"},r.createElement("path",{d:"M 187.5 0 C 83.945312 0 0 83.945312 0 187.5 C 0 291.054688 83.945312 375 187.5 375 C 291.054688 375 375 291.054688 375 187.5 C 375 83.945312 291.054688 0 187.5 0 Z M 187.5 0 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"971fcd5f72"},r.createElement("path",{d:"M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"e891a7f57e"},r.createElement("path",{d:"M 187.5 18.570312 C 94.203125 18.570312 18.570312 94.203125 18.570312 187.5 C 18.570312 280.796875 94.203125 356.429688 187.5 356.429688 C 280.796875 356.429688 356.429688 280.796875 356.429688 187.5 C 356.429688 94.203125 280.796875 18.570312 187.5 18.570312 Z M 187.5 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"19a9ddc130"},r.createElement("path",{d:"M 18.570312 18.570312 L 356.070312 18.570312 L 356.070312 356.070312 L 18.570312 356.070312 Z M 18.570312 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"5e650d5bd0"},r.createElement("path",{d:"M 187.496094 18.570312 C 94.199219 18.570312 18.570312 94.199219 18.570312 187.496094 C 18.570312 280.792969 94.199219 356.421875 187.496094 356.421875 C 280.792969 356.421875 356.421875 280.792969 356.421875 187.496094 C 356.421875 94.199219 280.792969 18.570312 187.496094 18.570312 Z M 187.496094 18.570312 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#30562604dd)"},r.createElement("rect",{x:-37.5,width:450,fill:"#1d4ed8",y:-37.499999,height:449.999989,fillOpacity:1})),r.createElement("g",{clipPath:"url(#971fcd5f72)"},r.createElement("g",{clipPath:"url(#e891a7f57e)"},r.createElement("path",{fill:"#1d4ed8",d:"M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#19a9ddc130)"},r.createElement("g",{clipPath:"url(#5e650d5bd0)"},r.createElement("path",{strokeLinecap:"butt",transform:"matrix(0.75, 0, 0, 0.75, 18.570291, 18.570286)",fill:"none",strokeLinejoin:"miter",d:"M 225.234419 0.0000349326 C 100.838577 0.0000349326 0.0000289326 100.838583 0.0000289326 225.234425 C 0.0000289326 349.630266 100.838577 450.468815 225.234419 450.468815 C 349.63026 450.468815 450.468809 349.630266 450.468809 225.234425 C 450.468809 100.838583 349.63026 0.0000349326 225.234419 0.0000349326 Z M 225.234419 0.0000349326 ",stroke:"#ffffff",strokeWidth:34,strokeOpacity:1,strokeMiterlimit:4}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(136.121787, 300.837436)"},r.createElement("g",null,r.createElement("path",{d:"M 60 -193.78125 C 54.707031 -193.78125 50.109375 -195.734375 46.203125 -199.640625 C 42.296875 -203.554688 40.34375 -208.15625 40.34375 -213.4375 C 40.34375 -218.726562 42.296875 -223.328125 46.203125 -227.234375 C 50.109375 -231.140625 54.707031 -233.09375 60 -233.09375 C 65.28125 -233.09375 69.875 -231.140625 73.78125 -227.234375 C 77.695312 -223.328125 79.65625 -218.726562 79.65625 -213.4375 C 79.65625 -208.15625 77.695312 -203.554688 73.78125 -199.640625 C 69.875 -195.734375 65.28125 -193.78125 60 -193.78125 Z M 45.171875 4.828125 C 39.191406 4.828125 35.28125 2.414062 33.4375 -2.40625 C 31.601562 -7.238281 30.6875 -13.675781 30.6875 -21.71875 C 30.6875 -34.59375 31.773438 -47.234375 33.953125 -59.640625 C 36.140625 -72.054688 38.328125 -83.894531 40.515625 -95.15625 C 42.703125 -106.425781 43.796875 -116.890625 43.796875 -126.546875 C 43.796875 -129.078125 43.675781 -131.832031 43.4375 -134.8125 C 43.207031 -137.800781 42.632812 -140.101562 41.71875 -141.71875 C 38.039062 -139.414062 33.269531 -135.617188 27.40625 -130.328125 C 21.550781 -125.046875 16.898438 -119.1875 13.453125 -112.75 C 11.835938 -114.363281 11.03125 -116.550781 11.03125 -119.3125 C 11.03125 -123.21875 12.582031 -127.46875 15.6875 -132.0625 C 18.789062 -136.65625 22.925781 -141.078125 28.09375 -145.328125 C 33.269531 -149.585938 38.847656 -153.097656 44.828125 -155.859375 C 50.804688 -158.617188 56.664062 -160 62.40625 -160 C 67.695312 -160 71.085938 -158.734375 72.578125 -156.203125 C 74.078125 -153.671875 74.828125 -150.453125 74.828125 -146.546875 C 74.828125 -140.796875 74.078125 -133.378906 72.578125 -124.296875 C 71.085938 -115.222656 69.363281 -105.515625 67.40625 -95.171875 C 65.457031 -84.828125 63.734375 -74.484375 62.234375 -64.140625 C 60.742188 -53.796875 60 -44.367188 60 -35.859375 C 60 -31.492188 60.226562 -27.414062 60.6875 -23.625 C 61.144531 -19.832031 61.71875 -16.671875 62.40625 -14.140625 C 68.15625 -16.671875 73.613281 -20.40625 78.78125 -25.34375 C 83.957031 -30.28125 87.8125 -34.9375 90.34375 -39.3125 C 91.71875 -37.238281 92.40625 -35.050781 92.40625 -32.75 C 92.40625 -29.070312 90.796875 -25.050781 87.578125 -20.6875 C 84.359375 -16.320312 80.332031 -12.179688 75.5 -8.265625 C 70.675781 -4.359375 65.5625 -1.203125 60.15625 1.203125 C 54.757812 3.617188 49.765625 4.828125 45.171875 4.828125 Z M 45.171875 4.828125 "}))))),Et=t=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...t},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"59a10ac27a"},r.createElement("path",{d:"M 17.179688 32.695312 L 360 32.695312 L 360 337.5 L 17.179688 337.5 Z M 17.179688 32.695312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"664b27481e"},r.createElement("path",{d:"M 207.042969 43.574219 L 356.394531 304.941406 C 360.242188 311.675781 360.214844 319.953125 356.324219 326.660156 C 352.429688 333.371094 345.257812 337.5 337.5 337.5 L 39.375 337.5 C 31.617188 337.5 24.445312 333.371094 20.554688 326.660156 C 16.660156 319.953125 16.632812 311.675781 20.480469 304.941406 L 169.832031 43.574219 C 173.648438 36.898438 180.746094 32.777344 188.4375 32.777344 C 196.128906 32.777344 203.226562 36.898438 207.042969 43.574219 Z M 207.042969 43.574219 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#59a10ac27a)"},r.createElement("g",{clipPath:"url(#664b27481e)"},r.createElement("path",{fill:"#d97706",d:"M 1.875 11.015625 L 375.546875 11.015625 L 375.546875 337.5 L 1.875 337.5 Z M 1.875 11.015625 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(158.410439, 295.655517)"},r.createElement("g",null,r.createElement("path",{d:"M 46.890625 -63.21875 C 46.890625 -63.21875 46.890625 -64.445312 46.890625 -66.90625 L 46.890625 -176.46875 C 46.890625 -178.925781 46.1875 -180.859375 44.78125 -182.265625 C 43.375 -183.671875 41.441406 -184.375 38.984375 -184.375 L 21.078125 -184.375 C 18.617188 -184.375 16.6875 -183.671875 15.28125 -182.265625 C 13.875 -180.859375 13.171875 -178.925781 13.171875 -176.46875 L 13.171875 -66.90625 C 13.171875 -64.445312 13.875 -62.515625 15.28125 -61.109375 C 16.6875 -59.703125 18.617188 -59 21.078125 -59 L 38.984375 -59 C 41.441406 -59 43.375 -59.703125 44.78125 -61.109375 C 46.1875 -62.515625 46.890625 -63.21875 46.890625 -63.21875 Z M 46.890625 -4.21875 C 46.890625 -4.21875 46.890625 -5.445312 46.890625 -7.90625 L 46.890625 -25.546875 C 46.890625 -28.003906 46.1875 -29.9375 44.78125 -31.34375 C 43.375 -32.75 41.441406 -33.453125 38.984375 -33.453125 L 21.078125 -33.453125 C 18.617188 -33.453125 16.6875 -32.75 15.28125 -31.34375 C 13.875 -29.9375 13.171875 -28.003906 13.171875 -25.546875 L 13.171875 -7.90625 C 13.171875 -5.445312 13.875 -3.515625 15.28125 -2.109375 C 16.6875 -0.703125 18.617188 0 21.078125 0 L 38.984375 0 C 41.441406 0 43.375 -0.703125 44.78125 -2.109375 C 46.1875 -3.515625 46.890625 -4.21875 46.890625 -4.21875 Z M 46.890625 -4.21875 "})))));var qe={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},$e=i.createContext&&i.createContext(qe),Ct=["attr","size","title"];function wt(t,s){if(t==null)return{};var n=jt(t,s),a,l;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(l=0;l<c.length;l++)a=c[l],!(s.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function jt(t,s){if(t==null)return{};var n={};for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){if(s.indexOf(a)>=0)continue;n[a]=t[a]}return n}function he(){return he=Object.assign?Object.assign.bind():function(t){for(var s=1;s<arguments.length;s++){var n=arguments[s];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},he.apply(this,arguments)}function De(t,s){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);s&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,a)}return n}function ge(t){for(var s=1;s<arguments.length;s++){var n=arguments[s]!=null?arguments[s]:{};s%2?De(Object(n),!0).forEach(function(a){St(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):De(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function St(t,s,n){return s=Ot(s),s in t?Object.defineProperty(t,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[s]=n,t}function Ot(t){var s=kt(t,"string");return typeof s=="symbol"?s:s+""}function kt(t,s){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,s||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(t)}function Ve(t){return t&&t.map((s,n)=>i.createElement(s.tag,ge({key:n},s.attr),Ve(s.child)))}function K(t){return s=>i.createElement(Lt,he({attr:ge({},t.attr)},s),Ve(t.child))}function Lt(t){var s=n=>{var{attr:a,size:l,title:c}=t,u=wt(t,Ct),p=l||n.size||"1em",h;return n.className&&(h=n.className),t.className&&(h=(h?h+" ":"")+t.className),i.createElement("svg",he({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,a,u,{className:h,style:ge(ge({color:t.color||n.color},n.style),t.style),height:p,width:p,xmlns:"http://www.w3.org/2000/svg"}),c&&i.createElement("title",null,c),t.children)};return $e!==void 0?i.createElement($e.Consumer,null,n=>s(n)):s(qe)}function Pt(t){return K({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M17.47 250.9C88.82 328.1 158 397.6 224.5 485.5c72.3-143.8 146.3-288.1 268.4-444.37L460 26.06C356.9 135.4 276.8 238.9 207.2 361.9c-48.4-43.6-126.62-105.3-174.38-137z"},child:[]}]})(t)}const Je=i.createContext(),Rt=({children:t})=>{const[s,n]=i.useState(!1),[a,l]=i.useState(),[c,u]=i.useState(),P={showAlert:s,setShowAlert:n,typeAlert:a,setTypeAlert:l,messageAlert:c,setMessageAlert:u,alertConfig:{danger:{bgColor:"bg-danger",textColor:"text-danger-text",buttonBg:"bg-danger",hoverBg:"hover:bg-danger-hover",focusRing:"focus:ring-danger-progress",progressColor:"bg-danger-progress"},info:{bgColor:"bg-info",textColor:"text-info-text",buttonBg:"bg-info",hoverBg:"hover:bg-info-hover",focusRing:"focus:ring-info-progress",progressColor:"bg-info-progress"},success:{bgColor:"bg-success",textColor:"text-success-text",buttonBg:"bg-success",hoverBg:"hover:bg-success-hover",focusRing:"focus:ring-success-progress",progressColor:"bg-success-progress"},warning:{bgColor:"bg-warning",textColor:"text-warning-text",buttonBg:"bg-warning",hoverBg:"hover:bg-warning-hover",focusRing:"focus:ring-warning-progress",progressColor:"bg-warning-progress"}},getIcon:y=>{switch(y){case"danger":return o.jsx(bt,{className:"w-[20px] h-[20px]"});case"info":return o.jsx(yt,{className:"w-[20px] h-[20px]"});case"success":return o.jsx(Pt,{className:"text-xl"});case"warning":return o.jsx(Et,{className:"w-[20px] h-[20px]"})}},closeAlert:()=>{n(!s)},activeAlert:(y,d)=>{n(!1),setTimeout(()=>{l(y),u(d),n(!0)},50)}};return o.jsx(Je.Provider,{value:P,children:t})},U=()=>{const t=i.useContext(Je);if(t===void 0)throw new Error("Non puoi modificare l'alert");return t};let oe;const Xe=async(t,s,n)=>{if(oe)return oe;try{const l=await(await fetch("/config.json")).json(),c=l.baseUri,{unauthorized:u,notFound:p,defaultMessage:h}=l.axiosErrors,b=l.axiosTimeout;return oe=We.create({baseURL:c,timeout:b}),oe.interceptors.request.use(g=>g),oe.interceptors.response.use(g=>g,g=>{if(g.response)switch(t(!0),s("danger"),g.response.status){case 401:localStorage.removeItem("accessToken"),n(u);break;case 404:n(p);break;default:n(`${h} ${g.response.status||""} ${g.response.data.error||""}`)}return Promise.reject(g)}),oe}catch(a){console.error(a)}},Ke=i.createContext(),Nt=({children:t})=>{const{heartbeatEndpoint:s,firstPrivatePath:n,infiniteSession:a,timeDeducted:l,authenticatedEndpoint:c,autoLogin:u,setCurrentDate:p,isDebug:h,backendToken:b}=H(),{setIsLoading:g}=ne(),{setShowAlert:P,setMessageAlert:y,setTypeAlert:d,activeAlert:E}=U(),x=w.useNavigate(),[C,j]=i.useState(null),[S,L]=i.useState(),[k,G]=i.useState(),[z,Q]=i.useState(),[ee,q]=i.useState(!1),$=async()=>await Xe(P,d,y),V=async(N=null,_)=>{N&&N.preventDefault(),q(!0);try{g(!0),P(!1);const T=await(await $()).post(c,{auth:_}),B=T.headers.token,fe=T.data;B&&(localStorage.setItem("accessToken",B),localStorage.setItem("user",JSON.stringify(fe)),j(!0),L(B),x(`${n}${fe.id}`))}catch(I){console.error(I)}finally{q(!1),g(!1)}},Y=()=>{localStorage.removeItem("accessToken"),localStorage.removeItem("id"),localStorage.removeItem("user"),j(!1),L(null)},te=async()=>{try{const N=localStorage.getItem("accessToken"),T=(await(await $()).get(`${s}`,{headers:{Authorization:N}})).headers.token;localStorage.setItem("accessToken",T),L(T),h&&console.log("nuovo token: ",T,"Data:",p())}catch(N){console.error(N),Y()}},J=()=>{if(!S)return;const _=dt(S).exp,I=Math.floor(Date.now()/1e3),T=(_-I)*1e3;Q(T),G(T-l)},F=async N=>{try{const T=(await(await $()).get(s,{headers:{Authorization:N}})).data;T&&(localStorage.setItem("user",JSON.stringify(T)),localStorage.setItem("accessToken",N),j(!0),x(`${n}${T.id}`))}catch(_){console.error(_)}};i.useEffect(()=>{if(localStorage.getItem("accessToken"))j(!0);else{j(!1);return}},[]),i.useEffect(()=>{u&&F(b)},[u]),i.useEffect(()=>{C||u&&!ee&&F(b)},[C]),i.useEffect(()=>{if(u)return;J();let N;a&&S&&k&&(N=setInterval(()=>{te()},k));let _;return!a&&S&&z&&(_=setTimeout(()=>{Y(),E("danger","Sessione scaduta")},z)),()=>{N&&clearInterval(N),_&&clearTimeout(_)}},[S,k]);const se={isAuthenticated:C,setIsAuthenticated:j,login:V,logout:Y,setCurrentToken:L,createAxiosInstances:$};return o.jsx(Ke.Provider,{value:se,children:t})},de=()=>{const t=i.useContext(Ke);if(t===void 0)throw new Error("Non sei dentro al Auth Provider");return t},Qe=i.createContext(),Gt=({children:t,publicRoutes:s=[],privateRoutes:n=[]})=>o.jsx(Qe.Provider,{value:{publicRoutes:s,privateRoutes:n},children:t}),et=()=>{const t=i.useContext(Qe);if(t===void 0)throw new Error(`Errore: Le rotte non sono state inizializzate correttamente.
|
|
59
59
|
|
|
60
60
|
Soluzione: Assicurati di avvolgere il tuo componente con <RouteProvider>.
|
|
61
61
|
|
|
@@ -63,4 +63,4 @@ Esempio:
|
|
|
63
63
|
|
|
64
64
|
<RouteProvider publicRoutes={[]} privateRoutes={[]}>
|
|
65
65
|
<MyPackageRoutes />
|
|
66
|
-
</RouteProvider>`);return r},et=l.createContext(),Nt=({children:r})=>{const{login:s}=fe(),{clearLoginFormOnError:n}=W(),a={email:"",password:""},[i,c]=l.useState("Accedi"),[d,p]=l.useState("Email"),[h,y]=l.useState("email"),[E,P]=l.useState("example@example.it"),[O,m]=l.useState("Accedi"),[v,g]=l.useState(a),[C,j]=l.useState(),[S,N]=l.useState(),[L,I]=l.useState(),[H,K]=l.useState(),[Q,q]=l.useState({}),[F,V]=l.useState(null),J={overrideStyle:Q,setOverrideStyle:q,title:i,setTitle:c,label:d,setLabel:p,type:h,setType:y,placeholder:E,setPlaceholder:P,buttonText:O,setButtonText:m,formData:v,setFormData:g,LogoImg:C,setLogoImg:j,styleCardForm:S,setStyleCardForm:N,styleContainerLogo:L,setStyleContainerLogo:I,styleLogo:H,setStyleLogo:K,changeData:(B,se)=>{g(R=>({...R,[B]:se}))},handleLogin:B=>{s(B,v),n&&g(a)},customVersion:F,setCustomVersion:V};return o.jsx(et.Provider,{value:J,children:r})},Se=()=>{const r=l.useContext(et);if(r===void 0)throw new Error("Non puoi modificare La login");return r};function tt(r){return ne({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.355 0-7.898 3.481-7.998 7.812 0.092-3.779 2.966-6.812 6.498-6.812 3.59 0 6.5 3.134 6.5 7 0 0.828 0.672 1.5 1.5 1.5s1.5-0.672 1.5-1.5c0-4.418-3.582-8-8-8zM8 16c4.355 0 7.898-3.481 7.998-7.812-0.092 3.779-2.966 6.812-6.498 6.812-3.59 0-6.5-3.134-6.5-7 0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5c0 4.418 3.582 8 8 8z"},child:[]}]})(r)}const rt=()=>{const{loadingProps:r}=oe(),{spinner:s=!0,spinnerStyle:n,text:a,textStyle:i,children:c,containerStyle:d,overrideStyle:p={}}=r;return o.jsxs("div",{className:p.container||`fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-loading-bg z-[999] ${d}`,children:[s&&o.jsx(tt,{className:p.spinner||`text-[20rem] relative animate-spin text-spinner ${n}`}),c||o.jsx("p",{className:p.text||`text-white text-2xl select-none absolute ${i}`,children:a||"Loading..."})]})};function Gt(r){return ne({tag:"svg",attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor"},child:[]}]})(r)}const we=()=>{const{messageAlert:r,typeAlert:s,alertConfig:n,getIcon:a,closeAlert:i}=U(),{alertTimeout:c}=W(),[d,p]=l.useState(0),{bgColor:h,textColor:y,buttonBg:E,hoverBg:P,focusRing:O,progressColor:m}=n[s];return l.useEffect(()=>{let v;const C=100/(c/100);v=setInterval(()=>{p(S=>S>=100?(clearInterval(v),100):S+C)},100);const j=setTimeout(()=>{i()},c);return()=>{clearTimeout(j),clearInterval(v)}},[]),o.jsxs("div",{className:`flex items-center p-4 pt-6 ${y} rounded-lg ${h} mx-auto max-sm:min-w-[280px] sm:max-w-1/3 fixed top-[calc(100vh-100px)] sm:right-10 right-1/2 translate-x-1/2 sm:translate-0 z-100`,role:"alert",children:[o.jsx("div",{className:"w-full bg-gray-200 rounded-t-lg overflow-hidden h-2.5 absolute top-0 left-0 right-0",children:o.jsx("div",{className:`${m} h-2.5 rounded-t-lg`,style:{width:`${d}%`}})}),a(s),o.jsx("div",{className:"px-4 text-sm font-medium",children:r}),o.jsx("button",{type:"button",className:`ms-auto ${E} rounded-lg focus:ring-2 ${O} p-1.5 ${P} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,title:"Close",onClick:i,children:o.jsx(Gt,{className:"text-xl"})})]})},ot=r=>{const{isLoading:s}=oe(),{showAlert:n}=U(),a=b.useLocation(),{isMain:i=!0,headerComponent:c=null,showHeaderOnLogin:d=!1,headerExcludedRoutes:p=[],footerComponent:h=null,showFooterOnLogin:y=!1,footerExcludedRoutes:E=[]}=r,P=p.some(g=>b.matchPath(g,a.pathname));let O;a.pathname==="/"?O=c&&d:O=c&&!P;const m=E.some(g=>b.matchPath(g,a.pathname));let v;return a.pathname==="/"?v=h&&y:v=h&&!m,o.jsxs(o.Fragment,{children:[s&&o.jsx(rt,{}),n&&o.jsx(we,{}),O&&c,i?o.jsxs("main",{className:s?"hidden":"",children:[n&&o.jsx(we,{}),o.jsx(b.Outlet,{})]}):o.jsx(b.Outlet,{}),v&&h]})},xe=r=>{const{inputType:s,inputId:n,inputPlaceholder:a,inputRequired:i,inputValue:c,inputChange:d,autoFocus:p,inputStyle:h,overrideStyle:y,disabled:E}=r,O=["text","email","password","search","tel","url"].includes(s)?s:"text";return o.jsx("input",{type:O,autoFocus:p,id:n,className:y||`bg-input-bg border border-input-border text-input-text text-input-placeholder input-rounded focus:ring focus:ring-primary focus:border-primary focus:outline-none focus:shadow-(--shadow-primary-input) block w-full p-input ${h}`,placeholder:a,required:i??!0,value:c,onChange:d,disabled:E})},ve=({label:r,labelId:s,labelStyle:n,overrideStyle:a})=>o.jsx("label",{htmlFor:s,className:a||`show-label mb-1 sm:mb-2 text-input-label font-medium text-color-label ${n}`,children:r}),nt=()=>{const{title:r,label:s,type:n,placeholder:a,buttonText:i,formData:c,changeData:d,handleLogin:p,overrideStyle:h}=Se();return o.jsxs("form",{onSubmit:p,className:h.form||"form-size",children:[o.jsx("h1",{className:h.title||"text-form-title-size show-title title-position m-form-title",children:r}),o.jsxs("div",{className:h.containerEmail||"flex justify-center flex-col gap-1 m-input-form input-size mx-auto",children:[o.jsx(ve,{labelId:"user-email",label:s}),o.jsx(xe,{inputType:n,inputId:"user-email",inputPlaceholder:a,inputValue:c.email,inputChange:y=>{d("email",y.target.value)},autoFocus:!0})]}),o.jsxs("div",{className:h.containerPassword||"flex justify-center flex-col gap-1 my-4 input-size mx-auto",children:[o.jsx(ve,{labelId:"password",label:"Password"}),o.jsx(xe,{inputType:"password",inputId:"password",inputPlaceholder:"Password",inputValue:c.password,inputChange:y=>{d("password",y.target.value)}})]}),o.jsx("div",{className:h.containerButton||"flex button-position items-center m-primary-button",children:o.jsx("button",{className:h.button||"font-bold cursor-pointer shadow-(--shadow-primary) transition-all duration-200 hover:shadow-(--shadow-primary-hover) active:shadow-(--shadow-primary-active) active:translate-y-[2px] p-primary-button rounded-primary-button bg-primary hover:bg-primary-hover text-primary-text",children:i})})]})},st=({Logo:r})=>{const{styleCardForm:s,styleContainerLogo:n,styleLogo:a,overrideStyle:i,customVersion:c}=Se(),{firstPrivatePath:d,version:p}=W(),h=b.useNavigate();return l.useEffect(()=>{const y=JSON.parse(localStorage.getItem("user"));localStorage.getItem("accessToken")&&y.id&&h(`${d}${y.id}`)},[]),o.jsxs("section",{id:"login-page",children:[(p||c)&&o.jsx("div",{className:"text-md text-primary absolute top-4 left-4",children:c||p}),o.jsx("div",{className:i.container||"container mx-auto flex items-center justify-center h-screen",children:o.jsxs("div",{className:i.cardForm||`bg-form card-style card-size flex flex-col sm:flex-row sm:items-center justify-center ${s}`,children:[o.jsx("div",{className:i.containerLogo||`basis-1/2 flex items-center justify-center ${n}`,children:r&&o.jsx(r,{className:i.logo||`login-logo h-full sm:h-auto ${a}`})}),o.jsx(nt,{})]})})]})},ue=()=>{const{isAuthenticated:r}=fe(),{activeAlert:s}=U(),{autoLogin:n}=W();return l.useEffect(()=>{const a=localStorage.getItem("accessToken");!r&&!a&&!n&&s("danger","Non sei autorizzato")},[]),r===null?null:r?o.jsx(b.Outlet,{}):o.jsx(b.Navigate,{to:"/",replace:!0})},at=()=>{const{logout:r,setCurrentToken:s,createAxiosInstances:n}=fe(),{usersEndpoint:a}=W(),{setIsLoading:i}=oe(),{activeAlert:c}=U(),[d,p]=l.useState(null),[h,y]=l.useState(!1),E=JSON.parse(localStorage.getItem("user")),P=async()=>{try{y(!0);const m=localStorage.getItem("accessToken");if(!m){r(),c("danger","Sessione Scaduta");return}const C=(await(await n()).get(`${a}`,{headers:{Authorization:`Bearer ${m}`}})).data;p(C)}catch(m){console.error(m),i(!1)}finally{y(!1)}},O=()=>{r(),c("info","Hai effettuato il logout")};return l.useEffect(()=>{const m=localStorage.getItem("accessToken");m&&s(m)},[]),o.jsx("section",{children:o.jsxs("div",{className:"container mx-auto py-8",children:[o.jsxs("div",{className:"flex items-center justify-center gap-8 h-20",children:[o.jsxs("h1",{className:"text-4xl text-center text-slate-800",children:["Email: ",E.email]}),o.jsx("button",{onClick:O,className:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-full cursor-pointer shadow-[0_4px_10px_rgba(239,68,68,0.3),0_2px_4px_rgba(239,68,68,0.2)] hover:shadow-[0_6px_14px_rgba(185,28,28,0.4),0_3px_6px_rgba(185,28,28,0.3)] active:shadow-[0_2px_5px_rgba(239,68,68,0.3)] transition-all duration-200 active:translate-y-[2px]",children:"Logout"})]}),o.jsx("div",{className:"flex justify-center items-center my-12 gap-8",children:o.jsx("button",{onClick:P,className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full disabled:bg-blue-300 disabled:text-gray-500 disabled:cursor-not-allowed cursor-pointer transition-all duration-200 active:translate-y-[2px] shadow-[0_4px_10px_rgba(59,130,246,0.3),0_2px_4px_rgba(59,130,246,0.2)] hover:shadow-[0_6px_14px_rgba(29,78,216,0.4),0_3px_6px_rgba(29,78,216,0.3)] active:shadow-[0_2px_5px_rgba(59,130,246,0.3)]",disabled:h,children:"Lista degli utenti"})}),o.jsx("div",{className:"flex justify-center items-center",children:d&&o.jsx("ul",{children:d.map(m=>o.jsxs("li",{className:"text-xl my-4",children:[m.id," - ",m.email]},`user-${m.id}`))})})]})})},Tt=r=>t.createElement("svg",{width:"108.41262mm",height:"108.41262mm",viewBox:"0 0 108.41262 108.41262",id:"svg1",xmlSpace:"preserve",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg",...r},t.createElement("defs",{id:"defs1"},t.createElement("linearGradient",{id:"linearGradient27"},t.createElement("stop",{style:{stopColor:"#ff0000",stopOpacity:1},offset:0,id:"stop27"}),t.createElement("stop",{style:{stopColor:"#ffca00",stopOpacity:.96862745},offset:1,id:"stop28"})),t.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.001785,y1:192.35495,x2:143.4144,y2:83.942337,gradientUnits:"userSpaceOnUse"}),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter90",x:-.059506074,y:-.12477839,width:1.1465613,height:1.3073246},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:1,floodColor:"rgb(0,0,0)",id:"feFlood89"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:.9,id:"feGaussianBlur89"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset89"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite89"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite90"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter147",x:-.31473854,y:-.27257434,width:1.6432813,height:1.5822092},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(255,255,255)",id:"feFlood146"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:9.5,id:"feGaussianBlur146"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:3.1,id:"feOffset146"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite146"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite147"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter385",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood384"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur384"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset384"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite384"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite385"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter387",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood385"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur385"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset385"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite386"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite387"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter389",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood387"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur387"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset387"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite388"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite389"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter391",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood389"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur389"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset389"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite390"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite391"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter393",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood391"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur391"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset391"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite392"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite393"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter395",x:0,y:0,width:1.0112203,height:1.010137},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood393"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur393"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset393"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite394"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite395"}))),t.createElement("g",{id:"layer1",transform:"translate(-35.001785,-83.942337)"},t.createElement("rect",{style:{fill:"url(#linearGradient28)",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},id:"rect26",width:108.41262,height:108.41262,x:35.001785,y:83.942337,rx:30,ry:30}),t.createElement("g",{id:"g1",transform:"matrix(0.90701349,0,0,0.90701349,9.3696997,14.003172)",style:{strokeWidth:1.10252}},t.createElement("path",{id:"path272",style:{fill:"#000000",strokeWidth:1.10252},d:"m 103.62373,105.0137 c -0.2695,0.002 -0.78905,0.20889 -1.00345,0.40037 -0.0723,0.0646 -0.21317,0.24236 -0.313,0.39478 l -0.18141,0.27703 -0.0181,18.06409 -0.0178,18.06382 h -1.52343 -1.523699 l -2.7e-4,-9.75061 c -5.1e-4,-10.41143 -0.004,-10.51883 -0.34443,-11.94691 -1.39786,-5.8616 -6.2432,-10.12876 -12.21276,-10.75566 -1.515814,-0.1589 -19.83671,-0.16023 -20.462316,-0.003 l -0.0017,-0.004 -19.984159,3.5751 18.852043,2.16035 v 6.07801 l -17.36031,3.10307 17.360304,1.98933 v 6.52314 l -17.360304,3.10307 14.274817,1.63584 -0.01572,4.90514 -0.01864,5.72665 -0.63026,0.1252 c -1.586894,0.3153 -3.197032,1.06826 -4.528475,2.1172 -2.205268,1.73733 -3.741586,4.44584 -4.052716,7.1446 -0.370335,3.21237 0.552005,6.19841 2.657413,8.60144 1.687848,1.92642 4.173186,3.25989 6.695215,3.59241 v -5.2e-4 c 0.823968,0.10864 2.933749,0.0318 3.671522,-0.13399 0.932239,-0.20951 1.790163,-0.51486 2.636639,-0.93819 2.065707,-1.03314 3.823794,-2.77572 4.827084,-4.78447 0.504382,-1.00984 0.910162,-2.2066 1.026636,-3.02875 l 0.04632,-0.32925 h 9.414169 9.413628 v 0.21364 c 0,0.11749 0.0641,0.46829 0.14251,0.77944 0.90405,3.58952 3.50881,6.4605 6.974649,7.68694 1.34306,0.47527 1.94661,0.56832 3.65554,0.56367 1.31935,-0.003 1.6122,-0.0248 2.18192,-0.1577 3.36735,-0.785 6.02631,-2.86016 7.51461,-5.86464 0.44078,-0.88981 0.88236,-2.20383 0.97202,-2.8921 l 0.0429,-0.32925 7.18349,-0.002 c 7.08058,-0.002 7.18734,-0.003 7.49462,-0.14278 0.6474,-0.29351 0.90064,-0.70316 0.90064,-1.45738 0,-0.56862 -0.16856,-0.94445 -0.54982,-1.22508 -0.50606,-0.37245 -0.22593,-0.35988 -7.89979,-0.35988 h -7.11582 l -0.11721,-0.59669 c -0.2611,-1.32878 -0.84786,-2.70966 -1.68167,-3.95762 -0.57002,-0.85316 -2.01938,-2.29531 -2.86466,-2.85108 -1.21392,-0.79816 -2.80463,-1.46394 -3.99997,-1.6734 l -0.5016,-0.0876 -0.0181,-21.17061 -0.0178,-21.17036 -0.15424,-0.31167 c -0.25804,-0.52106 -0.8796,-0.9025 -1.46482,-0.8993 z m 9.34091,0.76079 c -1.96193,0 -3.68713,1.06774 -4.53247,2.80552 -0.53635,1.10262 -0.53017,1.02648 -0.50719,6.44296 l 0.0203,4.7802 0.18834,0.55566 c 0.62086,1.83041 2.22554,3.17608 4.08307,3.42406 0.24153,0.0323 2.71506,0.0532 5.4965,0.0458 5.70515,-0.0145 5.3423,0.0172 6.54658,-0.57378 0.54778,-0.26881 0.75708,-0.42234 1.25039,-0.91741 0.48917,-0.4909 0.64889,-0.70949 0.91635,-1.25279 0.53896,-1.09564 0.53516,-1.04438 0.53516,-6.26129 0,-4.84593 -0.0122,-5.0614 -0.32764,-5.86224 -0.76424,-1.94014 -2.6134,-3.18671 -4.72693,-3.18671 h -0.55701 l -0.003,4.13929 -0.003,4.13902 -1.87799,1.48961 c -1.03267,0.8192 -1.9166,1.51251 -1.96429,1.54074 -0.0554,0.0327 -0.79171,-0.51293 -2.03382,-1.50745 l -1.94697,-1.55885 v -4.12119 -4.12117 z m 2.28928,0.5522 v 3.46322 3.46375 l 1.08417,0.86973 c 0.59637,0.47836 1.10581,0.86085 1.13185,0.85003 0.0261,-0.0108 0.53535,-0.40918 1.13212,-0.88546 l 1.08497,-0.866 -0.0171,-3.42912 -0.0168,-3.42939 -2.19977,-0.0184 z m -47.246903,6.50849 9.196533,0.0248 c 9.138394,0.0246 9.200727,0.0256 9.88912,0.17528 2.276157,0.49507 4.008841,1.42496 5.576421,2.99252 1.56294,1.56292 2.49402,3.26009 3.00157,5.47254 0.15094,0.65777 0.15069,0.6637 0.16943,10.68613 l 0.0189,10.02763 -1.19632,-2.6e-4 -1.19658,-2.6e-4 -2.909674,-2.90889 c -2.148162,-2.14765 -2.999001,-2.95439 -3.251981,-3.08256 l -0.342815,-0.17367 h -9.477299 -9.477299 v -11.60676 z m 44.869453,16.35471 c -0.8458,0 -1.3552,0.0997 -1.97601,0.38599 -1.35181,0.62342 -2.29671,1.66611 -2.77169,3.05885 l -0.18354,0.53889 -0.0203,4.74531 c -0.0228,5.40031 -0.0234,5.39175 0.50346,6.47758 0.5061,1.04314 1.24312,1.77945 2.29621,2.29407 0.34744,0.1698 0.83013,0.35177 1.07325,0.40464 h 5.1e-4 c 0.35322,0.0766 1.47942,0.0968 5.60252,0.10015 5.81748,0.004 5.68307,0.0148 6.74876,-0.50692 1.37728,-0.67421 2.29905,-1.80091 2.67474,-3.26982 0.12915,-0.50539 0.13665,-0.78389 0.13665,-5.22267 0,-4.44771 -0.007,-4.7167 -0.13746,-5.23651 -0.23263,-0.92645 -0.63571,-1.63668 -1.31912,-2.32417 -0.51589,-0.519 -0.69084,-0.64491 -1.31831,-0.94858 -0.81757,-0.39568 -1.26328,-0.49681 -2.19099,-0.49681 h -0.64544 v 4.11159 4.11159 l -1.90888,1.51757 c -1.04987,0.83448 -1.93862,1.52747 -1.97495,1.54022 -0.0363,0.0129 -0.93815,-0.6732 -2.00425,-1.52423 l -1.93845,-1.54714 -2.7e-4,-4.10467 -5.1e-4,-4.10493 z m 2.37718,0.55434 0.004,3.44644 0.004,3.4467 1.05221,0.84416 h 5.1e-4 c 0.57884,0.46404 1.07893,0.84576 1.1116,0.84843 0.0327,0.003 0.55455,-0.39065 1.1601,-0.87373 l 1.10122,-0.87826 v -3.41687 -3.41687 h -2.21709 z m -50.294829,9.49115 h 10.511122 10.511121 l 3.015165,3.00185 c 2.567942,2.55652 3.057622,3.01393 3.300462,3.08282 0.2049,0.0582 1.62307,0.0807 5.03966,0.0807 h 4.754629 v 1.5799 1.57938 l -0.53676,0.0938 c -1.12048,0.19566 -2.647899,0.80928 -3.728799,1.49786 -1.68955,1.07633 -3.11899,2.69978 -3.99411,4.53647 -0.44366,0.93112 -0.88466,2.34132 -0.88466,2.82896 v 0.21524 H 83.533023 74.11886 l -0.04632,-0.32925 c -0.173141,-1.22207 -0.843416,-2.86149 -1.706703,-4.17392 -0.532033,-0.80881 -1.995609,-2.29178 -2.799129,-2.83643 -1.322594,-0.89646 -2.959014,-1.5737 -4.282866,-1.77223 l -0.324987,-0.0488 v -4.66833 z"}),t.createElement("path",{id:"path268",style:{fill:"#ffffff",strokeWidth:1.10252},d:"m 103.6238,103.56164 c -0.26951,0.002 -0.78905,0.20888 -1.00346,0.40036 -0.0723,0.0646 -0.21316,0.24236 -0.313,0.39478 l -0.1814,0.27703 -0.0181,18.06409 -0.0178,18.06382 h -1.52344 -1.523699 l -2.6e-4,-9.7506 c -5.1e-4,-10.41144 -0.004,-10.51884 -0.34443,-11.94692 -1.39786,-5.86159 -6.2432,-10.12876 -12.212765,-10.75566 -1.515813,-0.1589 -19.836715,-0.16022 -20.46231,-0.003 l -0.0017,-0.004 -19.984159,3.5751 18.852043,2.16035 v 6.07801 l -17.36031,3.10307 17.36031,1.98934 v 6.52313 l -17.36031,3.10307 14.274823,1.63584 -0.01572,4.90514 -0.01864,5.72666 -0.630261,0.12519 c -1.586888,0.3153 -3.19702,1.06826 -4.528463,2.1172 -2.205268,1.73733 -3.741592,4.44584 -4.052721,7.1446 -0.370335,3.21237 0.55201,6.19842 2.657412,8.60144 1.687849,1.92642 4.173187,3.25989 6.695216,3.59241 v -5.2e-4 c 0.823962,0.10864 2.933749,0.0318 3.671527,-0.13398 0.932233,-0.20952 1.790157,-0.51486 2.636639,-0.9382 2.065707,-1.03313 3.823794,-2.77572 4.82709,-4.78447 0.504371,-1.00983 0.910151,-2.2066 1.026624,-3.02874 l 0.04632,-0.32925 h 9.414164 9.413621 v 0.21363 c 0,0.11749 0.0641,0.46829 0.14252,0.77944 0.90405,3.58952 3.50882,6.4605 6.974649,7.68695 1.34307,0.47527 1.94662,0.56831 3.65555,0.56366 1.31934,-0.003 1.6122,-0.0248 2.18192,-0.1577 3.36734,-0.785 6.0263,-2.86016 7.51461,-5.86464 0.44078,-0.88981 0.88236,-2.20383 0.97202,-2.89209 l 0.0429,-0.32925 7.18349,-0.002 c 7.08058,-0.002 7.18734,-0.003 7.49463,-0.14278 0.6474,-0.29351 0.90063,-0.70316 0.90063,-1.45737 0,-0.56863 -0.16856,-0.94446 -0.54981,-1.22508 -0.50607,-0.37246 -0.22593,-0.35988 -7.89979,-0.35988 h -7.11583 l -0.11721,-0.5967 c -0.2611,-1.32878 -0.84786,-2.70966 -1.68166,-3.95762 -0.57003,-0.85315 -2.01939,-2.29531 -2.86466,-2.85107 -1.21393,-0.79817 -2.80464,-1.46395 -3.99997,-1.6734 l -0.50159,-0.0876 -0.0181,-21.17061 -0.0179,-21.17036 -0.15424,-0.31166 c -0.25804,-0.52107 -0.8796,-0.90251 -1.46482,-0.8993 z m 9.34091,0.76078 c -1.96194,0 -3.68714,1.06774 -4.53248,2.80552 -0.53635,1.10263 -0.53017,1.02648 -0.50719,6.44296 l 0.0203,4.7802 0.18834,0.55567 c 0.62086,1.8304 2.22555,3.17607 4.08308,3.42406 0.24152,0.0323 2.71505,0.0532 5.4965,0.0458 5.70514,-0.0145 5.34229,0.0172 6.54658,-0.57378 0.54778,-0.2688 0.75707,-0.42233 1.25039,-0.91741 0.48917,-0.4909 0.64889,-0.70948 0.91635,-1.25279 0.53896,-1.09564 0.53516,-1.04438 0.53516,-6.26128 0,-4.84594 -0.0122,-5.06141 -0.32765,-5.86225 -0.76423,-1.94014 -2.6134,-3.18671 -4.72692,-3.18671 h -0.55701 l -0.003,4.13929 -0.003,4.13902 -1.87798,1.48961 c -1.03268,0.8192 -1.9166,1.51252 -1.96429,1.54074 -0.0554,0.0327 -0.79171,-0.51293 -2.03382,-1.50745 l -1.94698,-1.55886 v -4.12117 -4.12118 z m 2.28927,0.55221 v 3.46321 3.46375 l 1.08417,0.86974 c 0.59637,0.47835 1.10582,0.86085 1.13185,0.85002 0.0261,-0.0108 0.53535,-0.40918 1.13213,-0.88545 l 1.08496,-0.86601 -0.0171,-3.42912 -0.0168,-3.42939 -2.19978,-0.0184 z m -47.246901,6.50848 9.196533,0.0248 c 9.138394,0.0247 9.200727,0.0256 9.889125,0.17528 2.276152,0.49507 4.008834,1.42496 5.576414,2.99253 1.56294,1.56292 2.49402,3.26009 3.00158,5.47253 0.15094,0.65777 0.15069,0.6637 0.16942,10.68613 l 0.0189,10.02764 -1.19632,-2.7e-4 -1.19658,-2.6e-4 -2.909672,-2.90888 c -2.148163,-2.14765 -2.999001,-2.9544 -3.251981,-3.08256 l -0.342835,-0.17368 H 77.484375 68.00707 v -11.60675 z m 44.869461,16.35472 c -0.84581,0 -1.35521,0.0997 -1.97602,0.38599 -1.35181,0.62342 -2.29671,1.6661 -2.77169,3.05885 l -0.18354,0.53888 -0.0203,4.74531 c -0.0229,5.40032 -0.0234,5.39175 0.50346,6.47758 0.50611,1.04314 1.24312,1.77945 2.29621,2.29408 0.34744,0.1698 0.83013,0.35177 1.07325,0.40463 h 5.1e-4 c 0.35322,0.0766 1.47942,0.0968 5.60252,0.10015 5.81748,0.005 5.68308,0.0148 6.74876,-0.50692 1.37729,-0.67421 2.29905,-1.8009 2.67474,-3.26982 0.12916,-0.50539 0.13665,-0.78389 0.13665,-5.22266 0,-4.44771 -0.007,-4.7167 -0.13745,-5.23652 -0.23264,-0.92645 -0.63572,-1.63668 -1.31912,-2.32417 -0.5159,-0.519 -0.69084,-0.64491 -1.31832,-0.94858 -0.81757,-0.39568 -1.26328,-0.4968 -2.19098,-0.4968 h -0.64545 v 4.11159 4.11159 l -1.90888,1.51756 c -1.04987,0.83448 -1.93862,1.52747 -1.97495,1.54022 -0.0363,0.0129 -0.93815,-0.6732 -2.00425,-1.52423 l -1.93845,-1.54714 -2.6e-4,-4.10466 -5.2e-4,-4.10493 z m 2.37718,0.55434 0.004,3.44643 0.004,3.4467 1.0522,0.84416 h 5.2e-4 c 0.57883,0.46405 1.07893,0.84577 1.1116,0.84843 0.0327,0.003 0.55454,-0.39065 1.16009,-0.87374 l 1.10122,-0.87825 v -3.41686 -3.41687 h -2.21709 z m -50.294837,9.49114 H 75.47001 85.981126 l 3.015165,3.00185 c 2.56794,2.55652 3.05762,3.01393 3.30046,3.08283 0.20491,0.0582 1.62308,0.0807 5.03966,0.0807 h 4.754639 v 1.5799 1.57938 l -0.53676,0.0938 c -1.12049,0.19566 -2.647909,0.80928 -3.728809,1.49786 -1.68955,1.07634 -3.11898,2.69979 -3.99411,4.53647 -0.44366,0.93112 -0.88465,2.34132 -0.88465,2.82897 v 0.21523 h -9.413636 -9.414164 l -0.04632,-0.32925 c -0.173136,-1.22207 -0.843417,-2.86149 -1.706697,-4.17392 -0.53204,-0.80881 -1.995616,-2.29178 -2.799129,-2.83642 -1.322601,-0.89647 -2.959015,-1.57371 -4.282873,-1.77224 l -0.324986,-0.0487 v -4.66833 z"})),t.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},d:"",id:"path40",transform:"scale(0.26458333)"}))),At=r=>{const{publicRoutes:s,privateRoutes:n}=Qe(),{firstPrivatePath:a}=W(),{logoImg:i=Tt,pathImg:c="./src/assets/MyWarehouse.svg",firstPrivateElement:d=o.jsx(at,{}),globalLayout:p,isMain:h,headerComponent:y,showHeaderOnLogin:E,headerExcludedRoutes:P,footerComponent:O,showFooterOnLogin:m,footerExcludedRoutes:v,privateProvider:g,customProvider:C}=r,j=p||o.jsx(ot,{isMain:h,headerComponent:y,showHeaderOnLogin:E,headerExcludedRoutes:P,footerComponent:O,showFooterOnLogin:m,footerExcludedRoutes:v}),S=g?l.cloneElement(g,{},C?l.createElement(C.type,C.props,o.jsx(ue,{children:o.jsx(b.Outlet,{})})):o.jsx(ue,{children:o.jsx(b.Outlet,{})})):C?l.createElement(C.type,C.props,o.jsx(ue,{children:o.jsx(b.Outlet,{})})):o.jsx(ue,{children:o.jsx(b.Outlet,{})}),N=()=>{const L=document.querySelector("link[rel='icon']");c&&(L.href=c)};return l.useEffect(()=>{N()},[]),o.jsx(b.Routes,{children:o.jsxs(b.Route,{element:p==="none"?null:j,children:[o.jsxs(b.Route,{path:"/",children:[o.jsx(b.Route,{index:!0,element:o.jsx(st,{Logo:i})}),s.map((L,I)=>o.jsx(b.Route,{path:L.path,element:L.element},`public-${I}`))]}),o.jsxs(b.Route,{element:S,children:[o.jsx(b.Route,{path:`${a??"/dashboard/"}:id`,element:d}),n.map((L,I)=>o.jsx(b.Route,{path:L.path,element:L.element},`private-${I}`))]})]})})},_t=({children:r})=>{var i;const s=b.useLocation(),{activeAlert:n}=U(),a=JSON.parse(localStorage.getItem("user"));return l.useEffect(()=>{(!a||!a.admin)&&n("warning","Non puoi accedere a questa pagina")},[a]),!a||!a.admin?o.jsx(b.Navigate,{to:((i=s.state)==null?void 0:i.from)||"/",replace:!0}):r},It=({spinner:r=!0,spinnerStyle:s,text:n,textStyle:a,children:i,containerStyle:c,overrideStyle:d={}})=>o.jsxs("div",{className:d.container||`w-full h-full relative flex items-center justify-center ${c}`,children:[r&&o.jsx(tt,{className:d.spinner||`text-[20rem] animate-spin text-black ${s}`}),i||o.jsx("p",{className:d.text||`text-black text-2xl select-none absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 ${a}`,children:n||"Loading..."})]}),je=({isTag:r=!1,value:s,label:n,placeholder:a,id:i,onChange:c,error:d=null})=>o.jsxs("div",{className:`flex items-center justify-center relative ${r?"gap-4 mb-2":"gap-1 m-4"}`,children:[o.jsx(ve,{labelId:i,label:n,overrideStyle:`text-xl font-bold text-color-label ${r?"":"basis-1/3"}`}),o.jsx(xe,{type:"text",inputId:i,inputPlaceholder:a,inputValue:s||"",disabled:r,inputChange:c,overrideStyle:`${r?"w-full":"basis-2/3"} ${d?"border-red-600 focus:ring focus:ring-red-600 focus:border-red-600 focus:shadow-[0_0_0_4px_rgba(255,0,0,0.5)]":""} bg-input-bg border border-input-border text-input-text text-input-placeholder input-rounded focus:ring focus:ring-focus-ring focus:border-spot-rfid-input-border focus:outline-none focus:shadow-spot-rfid-input block w-full p-input`}),d&&o.jsx("p",{className:"text-red-600 text-[13px] absolute bottom-0 left-26 translate-y-[20px]",children:d})]}),Mt=({title:r,showTag:s,value:n,tag:a,showButton:i,handleClick:c})=>o.jsxs("div",{className:`border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${r==="TAG B"?"delay-200":"mb-4"} ${s?"opacity-100 translate-y-0":"opacity-0 translate-y-10"}`,children:[o.jsx("h2",{className:"text-center mb-2 text-2xl",children:r}),o.jsx(je,{label:"TID",placeholder:`Leggi ${r}`,id:a?`tid-${a}`:"tid",isTag:!0,value:(n==null?void 0:n.valueTID)||""}),o.jsx(je,{label:"EPC",placeholder:`Leggi ${r}`,id:a?`epc-${a}`:"epc",isTag:!0,value:(n==null?void 0:n.valueEPC)||""}),!i&&o.jsx("div",{className:"flex items-center justify-center",children:o.jsx("button",{onClick:c,disabled:!(n!=null&&n.valueTID)&&!(n!=null&&n.valueEPC),className:"my-1 bg-write-button disabled:bg-write-button/40 text-white px-4 py-2 rounded-lg shadow-md disabled:transition-none disabled:active:translate-y-0 transition-all duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer uppercase",children:"Scrivi tag"})})]});function zt(r){return ne({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.04 1.33L12.71 3l.29.71v.33h-.5l-.5.5v-.83l-1.67-1.67H10v4H4v-4H2v10h3l-.5 1H2l-1-1v-10l1-1h8.33l.71.29zM7 5h2V2H7v3zm6.5 0L15 6.5l-.02.69-5.5 5.5-.13.12-.37.37-.1.09-3 1.5-.67-.67 1.5-3 .09-.1.37-.37.12-.13 5.5-5.5h.71zm-6.22 7.24l-.52 1 1.04-.48-.52-.52zm.69-1.03l.79.79 5.15-5.15-.79-.79-5.15 5.15z"},child:[]}]})(r)}const Bt=({minReadingPower:r,maxReadingPower:s,stepRangePower:n,rangeValue:a,setRangeValue:i,show:c,handleClick:d})=>{const p=(a-r)/(s-r)*100;return o.jsxs("div",{className:`border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${c?"opacity-100 translate-y-0":"opacity-0 translate-y-10"}`,children:[o.jsx("h2",{className:"text-center my-4 text-2xl",children:"Configurazione Potenza"}),o.jsxs("div",{className:"relative my-12 w-[90%] mx-auto",children:[o.jsx("input",{id:"power",type:"range",min:r,max:s,step:n,value:a,onChange:h=>i(Number(h.target.value)),className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-primary-accent"}),o.jsx("div",{className:"absolute bottom-8 transform -translate-x-1/2 bg-white border border-gray-200 text-sm text-gray-800 py-1 px-2 rounded-lg shadow-md transition-opacity",style:{left:`${p}%`},children:a})]}),o.jsx("div",{className:"flex items-center justify-center my-4",children:o.jsxs("button",{onClick:()=>d(a),className:"py-2 px-4 flex items-center justify-center gap-1 bg-save-button text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",children:["Salva",o.jsx(zt,{})]})})]})},Ft=({show:r,isConfigPage:s,handleSelectFile:n})=>o.jsxs("div",{className:`${s?`${r?"opacity-100 translate-y-0 delay-200":"opacity-0 translate-y-10"}`:""} p-4 text-center transition-all duration-700 transform`,children:[o.jsxs("h2",{className:"text-xl my-4",children:["Seleziona il file ",o.jsx("strong",{children:"config.json"})," per recuperare le chiavi univoche del dispositivo"]}),o.jsx("button",{onClick:n,className:"my-4 bg-blue-500 text-white px-4 py-2 rounded-lg",children:"Seleziona file"})]});function $t(r){return ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M312 372c-7.7 0-14 6.3-14 14 0 9.9-8.1 18-18 18H94c-9.9 0-18-8.1-18-18V126c0-9.9 8.1-18 18-18h186c9.9 0 18 8.1 18 18 0 7.7 6.3 14 14 14s14-6.3 14-14c0-25.4-20.6-46-46-46H94c-25.4 0-46 20.6-46 46v260c0 25.4 20.6 46 46 46h186c25.4 0 46-20.6 46-46 0-7.7-6.3-14-14-14z"},child:[]},{tag:"path",attr:{d:"M372.9 158.1c-2.6-2.6-6.1-4.1-9.9-4.1-3.7 0-7.3 1.4-9.9 4.1-5.5 5.5-5.5 14.3 0 19.8l65.2 64.2H162c-7.7 0-14 6.3-14 14s6.3 14 14 14h256.6L355 334.2c-5.4 5.4-5.4 14.3 0 19.8l.1.1c2.7 2.5 6.2 3.9 9.8 3.9 3.8 0 7.3-1.4 9.9-4.1l82.6-82.4c4.3-4.3 6.5-9.3 6.5-14.7 0-5.3-2.3-10.3-6.5-14.5l-84.5-84.2z"},child:[]}]})(r)}function Dt(r){return ne({tag:"svg",attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 9.059v-2.559c0-.256-.098-.512-.293-.708-.195-.195-.451-.292-.707-.292s-.512.097-.707.292l-6.293 6.208 6.293 6.207c.195.195.451.293.707.293s.512-.098.707-.293.293-.452.293-.707v-2.489c2.75.068 5.755.566 8 3.989v-1c0-4.633-3.5-8.443-8-8.941z"},child:[]}]})(r)}const Wt=r=>t.createElement("svg",{width:"108.41262mm",height:"108.41262mm",viewBox:"0 0 108.41262 108.41262",id:"svg1",xmlSpace:"preserve",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg",...r},t.createElement("defs",{id:"defs1"},t.createElement("linearGradient",{id:"linearGradient27"},t.createElement("stop",{style:{stopColor:"#ff0000",stopOpacity:1},offset:0,id:"stop27"}),t.createElement("stop",{style:{stopColor:"#ffca00",stopOpacity:.96862745},offset:1,id:"stop28"})),t.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.001785,y1:192.35495,x2:143.4144,y2:83.942337,gradientUnits:"userSpaceOnUse"}),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter90",x:-.059506074,y:-.12477839,width:1.1465613,height:1.3073246},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:1,floodColor:"rgb(0,0,0)",id:"feFlood89"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:.9,id:"feGaussianBlur89"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset89"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite89"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite90"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter147",x:-.31473854,y:-.27257434,width:1.6432813,height:1.5822092},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(255,255,255)",id:"feFlood146"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:9.5,id:"feGaussianBlur146"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:3.1,id:"feOffset146"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite146"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite147"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter385",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood384"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur384"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset384"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite384"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite385"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter387",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood385"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur385"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset385"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite386"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite387"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter389",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood387"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur387"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset387"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite388"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite389"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter391",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood389"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur389"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset389"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite390"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite391"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter393",x:0,y:0,width:1.0518825,height:1.0518825},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood391"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur391"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset391"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite392"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite393"})),t.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter395",x:0,y:0,width:1.0112203,height:1.010137},t.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood393"}),t.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur393"}),t.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset393"}),t.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite394"}),t.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite395"}))),t.createElement("g",{id:"layer1",transform:"translate(-35.001785,-83.942337)"},t.createElement("rect",{style:{fill:"url(#linearGradient28)",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},id:"rect26",width:108.41262,height:108.41262,x:35.001785,y:83.942337,rx:30,ry:30}),t.createElement("g",{id:"g1",transform:"matrix(1.0833532,0,0,1.1590115,-13.020803,-26.50933)",style:{strokeWidth:.892424}},t.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,strokeWidth:0,strokeDasharray:"none"},d:"m 93.82567,176.60265 c -0.16819,-0.0337 -1.83675,-0.44258 -3.70792,-0.90862 -1.87115,-0.46603 -6.89404,-1.70738 -11.16196,-2.75855 -4.26793,-1.05118 -7.88422,-1.94532 -8.03621,-1.98697 -0.38441,-0.10533 -0.67366,-0.35309 -0.84014,-0.71961 -0.13464,-0.29646 -0.14169,-0.67022 -0.14329,-7.58613 l -0.002,-7.27432 -1.58638,-0.3886 c -0.8725,-0.21372 -2.73139,-0.66288 -4.13086,-0.99814 -1.66387,-0.39859 -2.62074,-0.66385 -2.76482,-0.76643 -0.45114,-0.32125 -0.67287,-1.17785 -0.44025,-1.70084 0.0507,-0.11391 1.34784,-1.54136 2.88261,-3.17212 1.53477,-1.63075 3.54737,-3.76898 4.47243,-4.75162 0.92507,-0.98264 1.68195,-1.81314 1.68195,-1.84557 0,-0.0324 -2.0126,-2.19745 -4.47244,-4.81117 -2.45984,-2.61372 -4.51389,-4.8454 -4.56455,-4.95928 -0.12411,-0.27898 -0.12207,-0.80663 0.005,-1.10902 0.1372,-0.32836 0.59041,-0.71699 0.94692,-0.81198 0.15823,-0.0422 1.52621,-0.37262 3.03996,-0.73436 4.23151,-1.01121 12.80468,-3.07938 16.20779,-3.90995 3.11435,-0.76008 3.63105,-0.84103 4.02851,-0.63116 0.11325,0.0598 1.10839,1.07202 2.21144,2.24939 1.10304,1.17736 3.10699,3.30654 4.45322,4.73153 l 2.44769,2.59088 0.578,-0.60313 c 0.73001,-0.76177 7.41013,-7.89063 7.89815,-8.42872 0.53305,-0.58777 1.16446,-0.82568 1.67671,-0.6318 0.0974,0.0368 1.94877,0.48807 4.11427,1.00273 2.1655,0.51466 5.55423,1.32534 7.53051,1.80149 1.97627,0.47615 5.17578,1.24703 7.11002,1.71306 1.93424,0.46603 3.61155,0.88516 3.72738,0.93144 0.43966,0.17561 0.81987,0.81095 0.82108,1.37204 2.3e-4,0.10902 -0.077,0.33848 -0.17159,0.50991 -0.14542,0.26349 -2.63982,2.95379 -7.91983,8.54181 -0.59557,0.63032 -1.07365,1.1737 -1.06238,1.20751 0.0113,0.0338 2.01538,2.1792 4.45357,4.76756 2.43818,2.58836 4.49238,4.83165 4.56486,4.9851 0.23209,0.49134 0.12362,1.1068 -0.26923,1.52754 -0.24489,0.26229 -0.46525,0.35629 -1.27692,0.54472 -0.39945,0.0927 -2.13682,0.50971 -3.86082,0.92658 -1.72399,0.41689 -3.21193,0.77599 -3.30654,0.79802 l -0.17202,0.0401 v 7.21184 c 0,5.18025 -0.0245,7.28504 -0.0869,7.4717 -0.0478,0.14293 -0.17678,0.35764 -0.2867,0.47713 -0.21143,0.22984 -0.69257,0.50905 -0.87722,0.50905 -0.0605,0 -4.19891,1.01172 -9.19638,2.24827 -12.94173,3.20224 -13.80448,3.41153 -14.01743,3.4002 -0.10512,-0.005 -0.32874,-0.0378 -0.49695,-0.0714 z m -0.11468,-14.06316 c 0,-6.93801 -0.0266,-12.61456 -0.059,-12.61456 -0.0324,0 -1.13014,1.1439 -2.43938,2.54202 -5.28868,5.6477 -5.75841,6.13463 -6.04581,6.26705 -0.47758,0.22003 0.50027,0.42347 -8.92509,-1.85672 -2.27062,-0.5493 -4.32623,-1.04513 -4.568,-1.10183 l -0.43961,-0.10308 v 6.97711 6.97712 l 0.97477,0.24011 c 6.05221,1.49085 19.20592,4.74159 20.12595,4.97382 0.65175,0.16452 1.22801,0.30235 1.28057,0.30631 0.0761,0.005 0.0956,-2.56285 0.0956,-12.60735 z m 12.57633,9.85252 c 5.92884,-1.46667 10.85676,-2.68431 10.95094,-2.70586 l 0.17122,-0.0392 0.02,-6.99318 c 0.0176,-6.18688 0.006,-6.98914 -0.0948,-6.95814 -0.0631,0.0192 -1.69723,0.41672 -3.63146,0.88324 -1.93423,0.46652 -4.7209,1.1404 -6.1926,1.49752 -3.65266,0.88632 -3.40635,0.8392 -3.78841,0.72474 -0.18605,-0.0557 -0.46352,-0.23294 -0.65085,-0.41565 -0.17959,-0.17516 -2.03807,-2.14184 -4.12994,-4.37042 -2.09186,-2.22857 -3.83203,-4.06342 -3.86703,-4.07743 -0.035,-0.014 -0.0637,5.65667 -0.0637,12.60152 v 12.627 l 0.24846,-0.0537 c 0.13666,-0.0296 5.09935,-1.25375 11.02819,-2.72042 z M 85.323,156.74825 c 0.88524,-0.91925 7.62622,-8.10235 8.03426,-8.56119 0.16287,-0.18314 0.28328,-0.34442 0.26759,-0.35841 -0.03,-0.0267 -1.29081,-0.3341 -7.0621,-1.72171 -1.93424,-0.46507 -6.15811,-1.48175 -9.38639,-2.25933 l -5.8696,-1.41376 -0.51316,0.55367 c -0.28223,0.30453 -0.80894,0.86331 -1.17046,1.24174 -0.52801,0.55274 -4.33277,4.60748 -6.87086,7.32232 -0.2664,0.28496 -0.46871,0.53377 -0.44956,0.55291 0.0191,0.0191 1.89033,0.48037 4.15819,1.02495 9.93967,2.38676 16.93345,4.07196 17.46425,4.20814 0.31536,0.0809 0.59738,0.14912 0.62671,0.15159 0.0293,0.003 0.37634,-0.33095 0.77113,-0.74092 z m 20.23487,0.40117 c 0.77963,-0.18934 3.86015,-0.93125 6.8456,-1.6487 12.24203,-2.94198 13.98307,-3.36382 14.01498,-3.39573 0.0184,-0.0184 -0.23762,-0.32105 -0.56885,-0.67267 -0.33122,-0.35161 -2.18125,-2.32256 -4.11118,-4.37989 -1.92994,-2.05733 -3.69458,-3.93741 -3.92146,-4.17796 l -0.41248,-0.43738 -6.82004,1.63769 c -3.75102,0.90074 -8.29937,1.99733 -10.10746,2.43686 -1.80808,0.43955 -3.76047,0.911 -4.33864,1.04768 -0.57817,0.13668 -1.05122,0.27733 -1.05122,0.31258 0,0.0599 1.97276,2.17716 6.91891,7.42581 1.1353,1.20474 2.07997,2.19169 2.09925,2.1932 0.0193,0.002 0.67295,-0.15217 1.45259,-0.34149 z m -9.33771,-11.00163 c 0.95365,-0.22729 3.67769,-0.88483 6.05344,-1.46119 4.87911,-1.18367 10.14405,-2.45535 11.25754,-2.7191 0.40997,-0.0971 0.7454,-0.19673 0.7454,-0.22138 0,-0.0412 -2.28027,-0.59973 -11.88826,-2.91197 -1.93424,-0.46549 -4.51448,-1.08925 -5.73389,-1.38617 -1.21941,-0.29689 -2.26871,-0.53817 -2.33178,-0.53618 -0.0631,0.002 -1.3876,0.31307 -2.9434,0.69126 -1.55579,0.37819 -4.05004,0.98158 -5.54275,1.34086 -1.49273,0.35928 -4.43422,1.06949 -6.53664,1.57826 -2.10243,0.50877 -4.07201,0.98326 -4.37687,1.05442 -0.30485,0.0712 -0.55427,0.14798 -0.55427,0.17071 0,0.0227 0.61066,0.18561 1.35702,0.36195 0.74636,0.17635 4.83175,1.16061 9.07865,2.18726 4.2469,1.02663 8.08287,1.95378 8.52439,2.06033 0.4415,0.10653 0.88256,0.19606 0.98013,0.19894 0.0976,0.003 0.95764,-0.18071 1.91129,-0.408 z m -23.17527,-5.5068 c 1.61572,-0.38489 15.1372,-3.64431 18.92683,-4.56241 0.91455,-0.22156 1.66283,-0.42236 1.66283,-0.44621 0,-0.0436 -2.17511,-2.37359 -6.49352,-6.95578 -1.28517,-1.36367 -2.37292,-2.52792 -2.41721,-2.58723 -0.0681,-0.0912 -0.25681,-0.0653 -1.22322,0.16776 -2.15241,0.51909 -10.69795,2.57488 -15.92927,3.83208 -2.87653,0.69131 -5.24697,1.27382 -5.26762,1.29447 -0.0458,0.0458 -0.20983,-0.13182 4.76121,5.15371 2.23,2.37108 4.08206,4.35788 4.11569,4.4151 0.0336,0.0572 0.0744,0.10403 0.0906,0.10403 0.0161,0 0.81435,-0.18698 1.7737,-0.41552 z m 44.72625,0.0168 c 0.66764,-0.72696 2.63332,-2.82289 4.6092,-4.91467 3.5914,-3.80204 4.07433,-4.32272 4.04059,-4.35646 -0.0185,-0.0184 -0.89212,-0.23938 -1.94146,-0.49094 -4.03823,-0.96807 -15.40558,-3.70468 -17.84516,-4.29611 l -2.55819,-0.62019 -0.2247,0.25651 c -0.12359,0.14108 -0.76319,0.82417 -1.42134,1.51797 -0.65816,0.6938 -2.25926,2.39677 -3.55803,3.78436 -1.29877,1.38761 -2.68169,2.85649 -3.07316,3.26419 -0.39148,0.40769 -0.71177,0.77302 -0.71177,0.81184 0,0.081 1.22124,0.38162 13.25883,3.26372 4.83252,1.15702 8.80323,2.1205 8.82382,2.14109 0.10179,0.1018 0.26744,0.003 0.60137,-0.36131 z",id:"path1"}),t.createElement("path",{style:{fill:"#d30000",fillOpacity:1,strokeWidth:.892424},d:"m 94.23704,147.39738 c -0.18923,-0.0768 -0.53591,-0.44038 -0.83007,-0.87064 -0.13792,-0.20172 -0.97955,-1.55209 -1.87028,-3.00083 -6.42775,-10.45449 -9.51471,-15.54702 -9.94927,-16.41318 -0.45927,-0.91546 -0.98193,-2.46434 -1.17845,-3.49236 -0.47774,-2.49897 -0.33475,-4.87936 0.43464,-7.23535 1.18651,-3.63329 3.71304,-6.57746 7.14475,-8.32579 1.32203,-0.67352 2.76073,-1.13624 4.31579,-1.38807 1.01828,-0.16489 3.18289,-0.16489 4.20118,0 2.16477,0.35056 4.09681,1.1098 5.90163,2.31918 3.0314,2.03129 5.22702,5.32107 5.95891,8.92844 0.6233,3.07215 0.29346,6.03826 -0.98629,8.86914 -0.35811,0.79216 -3.66707,6.34467 -7.57053,12.70353 -1.14824,1.87052 -2.60138,4.23855 -3.2292,5.2623 -0.78819,1.28523 -1.26572,1.99215 -1.54284,2.28396 -0.39825,0.41935 -0.51902,0.47365 -0.79997,0.35967 z m 1.26593,-20.98125 c 2.28056,-0.3989 4.20147,-2.0406 4.94879,-4.22949 0.29427,-0.86192 0.38048,-1.47914 0.33067,-2.36733 -0.0986,-1.75805 -0.74937,-3.16136 -2.02879,-4.37485 -1.21602,-1.15336 -2.65543,-1.72396 -4.3489,-1.72396 -1.69143,0 -3.13312,0.57083 -4.34528,1.72052 -0.96303,0.91339 -1.53452,1.85482 -1.86842,3.07793 -0.13092,0.47957 -0.1542,0.7208 -0.15122,1.5671 0.003,0.87328 0.0263,1.08366 0.18354,1.65699 0.55902,2.03928 1.99215,3.61954 3.96302,4.36987 1.03786,0.39512 2.18932,0.5004 3.31659,0.30322 z",id:"path2"}),t.createElement("rect",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeDasharray:"none",paintOrder:"stroke markers fill"},id:"rect2",width:3.538805,height:1.3867109,x:158.63237,y:137.74451,transform:"matrix(0.98806246,0.1540538,-0.46962192,0.88286763,0,0)"}),t.createElement("rect",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeDasharray:"none",paintOrder:"stroke markers fill"},id:"rect3",width:3.1665602,height:1.2219434,x:120.62843,y:170.94601,transform:"matrix(0.98237657,-0.18691248,-0.14496758,0.98943641,0,0)"})),t.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},d:"",id:"path40",transform:"scale(0.26458333)"}))),Ht=({Logo:r,logo:s})=>{const{logout:n}=fe(),{activeAlert:a}=U(),{autoLogin:i,configRoutes:c,firstPrivateTitle:d,showHeaderButton:p}=W(),{isLoading:h}=oe(),y=b.useLocation(),E=b.useNavigate(),P=()=>{n(),a("info","Hai effettuato il logout")},O=c.find(v=>v.path===y.pathname),m=b.useMatch("home/:id");return o.jsx("header",{className:h?"hidden":"",children:o.jsxs("nav",{className:"header-size flex items-center justify-between px-2 shadow-lg border-b gap-2 border-b-gray-300",children:[o.jsx("figure",{children:r&&typeof r=="function"?o.jsx(r,{className:"header-logo-size"}):s?o.jsx("img",{src:s,alt:"Logo",className:"header-logo-size"}):o.jsx(Wt,{className:"header-logo-size"})}),o.jsx("div",{children:o.jsx("p",{children:(O==null?void 0:O.title)||d})}),o.jsxs("div",{children:[!i&&m&&o.jsx("button",{className:"h-[48px] w-[48px] flex items-center justify-center bg-red-600 text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",type:"button",onClick:P,children:o.jsx($t,{className:"text-4xl w-full"})}),!m&&p&&o.jsx("button",{className:"h-[48px] w-[48px] flex items-center justify-center bg-sky-600 text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",type:"button",onClick:()=>E(-1),children:o.jsx(Dt,{className:"text-4xl w-full"})})]})]})})};Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:()=>b.BrowserRouter});Object.defineProperty(exports,"Link",{enumerable:!0,get:()=>b.Link});Object.defineProperty(exports,"NavLink",{enumerable:!0,get:()=>b.NavLink});Object.defineProperty(exports,"Outlet",{enumerable:!0,get:()=>b.Outlet});Object.defineProperty(exports,"Route",{enumerable:!0,get:()=>b.Route});Object.defineProperty(exports,"Routes",{enumerable:!0,get:()=>b.Routes});Object.defineProperty(exports,"useLocation",{enumerable:!0,get:()=>b.useLocation});Object.defineProperty(exports,"useMatch",{enumerable:!0,get:()=>b.useMatch});Object.defineProperty(exports,"useNavigate",{enumerable:!0,get:()=>b.useNavigate});Object.defineProperty(exports,"useParams",{enumerable:!0,get:()=>b.useParams});exports.axios=We;exports.ReactDOM=ct;exports.Alert=we;exports.AlertProvider=kt;exports.AuthAdmin=_t;exports.AuthPage=ue;exports.AuthProvider=Pt;exports.CardInputRange=Bt;exports.CardInputTag=Mt;exports.ConfigFileReader=Ft;exports.ConfigProvider=gt;exports.Dashboard=at;exports.DefaultLayout=ot;exports.ErrorPage=Ye;exports.Header=Ht;exports.Input=xe;exports.InputGroup=je;exports.InputLabel=ve;exports.Loading=rt;exports.LoadingComponent=It;exports.LoadingProvider=pt;exports.Login=st;exports.LoginForm=nt;exports.LoginFormProvider=Nt;exports.PackageRoutes=At;exports.RouteProvider=Rt;exports.fetchAxiosConfig=Je;exports.useAlert=U;exports.useAuth=fe;exports.useConfig=W;exports.useLoading=oe;exports.useLoginForm=Se;exports.useRoutesInjection=Qe;
|
|
66
|
+
</RouteProvider>`);return t},tt=i.createContext(),Tt=({children:t})=>{const{login:s}=de(),{clearLoginFormOnError:n}=H(),a={email:"",password:""},[l,c]=i.useState("Accedi"),[u,p]=i.useState("Email"),[h,b]=i.useState("email"),[g,P]=i.useState("example@example.it"),[y,d]=i.useState("Accedi"),[E,x]=i.useState(a),[C,j]=i.useState(),[S,L]=i.useState(),[k,G]=i.useState(),[z,Q]=i.useState(),[ee,q]=i.useState({}),[$,V]=i.useState(null),J={overrideStyle:ee,setOverrideStyle:q,title:l,setTitle:c,label:u,setLabel:p,type:h,setType:b,placeholder:g,setPlaceholder:P,buttonText:y,setButtonText:d,formData:E,setFormData:x,LogoImg:C,setLogoImg:j,styleCardForm:S,setStyleCardForm:L,styleContainerLogo:k,setStyleContainerLogo:G,styleLogo:z,setStyleLogo:Q,changeData:(F,se)=>{x(N=>({...N,[F]:se}))},handleLogin:F=>{s(F,E),n&&x(a)},customVersion:$,setCustomVersion:V};return o.jsx(tt.Provider,{value:J,children:t})},Se=()=>{const t=i.useContext(tt);if(t===void 0)throw new Error("Non puoi modificare La login");return t},rt=i.createContext(),Mt=({children:t})=>{const[s,n]=i.useState(!1),[a,l]=i.useState(null),[c,u]=i.useState(""),[p,h]=i.useState(null),[b,g]=i.useState(null),[P,y]=i.useState("default"),x={isOpen:s,openModal:({content:C,title:j="",onConfirm:S=null,type:L="default",item:k=null})=>{l(C),u(j),h(()=>S),y(L),g(k),n(!0)},closeModal:()=>{n(!1),l(null),u(""),h(null),g(null),y("default")},content:a,title:c,onConfirm:p,type:P,item:b};return o.jsx(rt.Provider,{value:x,children:t})},ot=()=>{const t=i.useContext(rt);if(t===void 0)throw new Error("Non sei all'interno del ModalProvider");return t};function nt(t){return K({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.355 0-7.898 3.481-7.998 7.812 0.092-3.779 2.966-6.812 6.498-6.812 3.59 0 6.5 3.134 6.5 7 0 0.828 0.672 1.5 1.5 1.5s1.5-0.672 1.5-1.5c0-4.418-3.582-8-8-8zM8 16c4.355 0 7.898-3.481 7.998-7.812-0.092 3.779-2.966 6.812-6.498 6.812-3.59 0-6.5-3.134-6.5-7 0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5c0 4.418 3.582 8 8 8z"},child:[]}]})(t)}const st=()=>{const{loadingProps:t}=ne(),{spinner:s=!0,spinnerStyle:n,text:a,textStyle:l,children:c,containerStyle:u,overrideStyle:p={}}=t;return o.jsxs("div",{className:p.container||`fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-loading-bg z-[999] ${u}`,children:[s&&o.jsx(nt,{className:p.spinner||`text-[20rem] relative animate-spin text-spinner ${n}`}),c||o.jsx("p",{className:p.text||`text-white text-2xl select-none absolute ${l}`,children:a||"Loading..."})]})};function At(t){return K({tag:"svg",attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor"},child:[]}]})(t)}const we=()=>{const{messageAlert:t,typeAlert:s,alertConfig:n,getIcon:a,closeAlert:l}=U(),{alertTimeout:c}=H(),[u,p]=i.useState(0),{bgColor:h,textColor:b,buttonBg:g,hoverBg:P,focusRing:y,progressColor:d}=n[s];return i.useEffect(()=>{let E;const C=100/(c/100);E=setInterval(()=>{p(S=>S>=100?(clearInterval(E),100):S+C)},100);const j=setTimeout(()=>{l()},c);return()=>{clearTimeout(j),clearInterval(E)}},[]),o.jsxs("div",{className:`flex items-center p-4 pt-6 ${b} rounded-lg ${h} mx-auto max-sm:min-w-[280px] sm:max-w-1/3 fixed top-[calc(100vh-100px)] sm:right-10 right-1/2 translate-x-1/2 sm:translate-0 z-100`,role:"alert",children:[o.jsx("div",{className:"w-full bg-gray-200 rounded-t-lg overflow-hidden h-2.5 absolute top-0 left-0 right-0",children:o.jsx("div",{className:`${d} h-2.5 rounded-t-lg`,style:{width:`${u}%`}})}),a(s),o.jsx("div",{className:"px-4 text-sm font-medium",children:t}),o.jsx("button",{type:"button",className:`ms-auto ${g} rounded-lg focus:ring-2 ${y} p-1.5 ${P} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,title:"Close",onClick:l,children:o.jsx(At,{className:"text-xl"})})]})};function It(t){return K({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(t)}const _t=({isOpen:t,onClose:s,title:n,formId:a,children:l,item:c,onConfirm:u,type:p="default"})=>{const h=i.useRef(null),[b,g]=i.useState(t),P=()=>{t||g(!1)};return i.useEffect(()=>{t&&g(!0)},[t]),i.useEffect(()=>{const y=d=>{d.key==="Escape"&&s()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[s]),i.useEffect(()=>{var y;if(t){const d=document.activeElement;return(y=h.current)==null||y.focus(),()=>d==null?void 0:d.focus()}},[t]),b?He.createPortal(o.jsx("div",{className:`fixed inset-0 z-50 flex items-center justify-center transition-opacity duration-200 ${t?"bg-black/50 opacity-100":"opacity-0"}`,onClick:s,onTransitionEnd:P,children:o.jsxs("div",{ref:h,className:`relative bg-white rounded-lg p-6 shadow-xl min-w-[300px] max-w-[90%] ${p==="delete"?"w-[400px]":"w-1/2"} transform transition-transform duration-200 ${t?"scale-100 opacity-100":"scale-95 opacity-0"}`,onClick:y=>y.stopPropagation(),role:"dialog","aria-modal":"true",tabIndex:-1,children:[o.jsxs("header",{className:`flex items-center justify-between mb-4 ${p==="delete"?"gap-8":""}`,children:[p==="delete"?o.jsxs("h2",{className:"text-2xl",children:["Sei sicuro di volere eliminare: ",o.jsx("strong",{children:c.name}),"?"]}):o.jsx("h2",{className:"text-2xl",children:n||"Conferma operazione"}),o.jsx("button",{onClick:s,className:"text-gray-500 hover:text-gray-700 cursor-pointer transition-transform duration-150 ease-in-out hover:scale-110 hover:opacity-80 active:scale-95 active:opacity-60","aria-label":"Chiudi modale",children:o.jsx(It,{className:"text-2xl"})})]}),p!=="delete"&&o.jsx("main",{className:"my-8",children:l}),o.jsxs("footer",{className:"flex items-center justify-between mt-4",children:[o.jsx("button",{onClick:s,className:"px-4 py-2 cursor-pointer text-sm font-medium text-gray-800 bg-gray-300 rounded-lg shadow-md hover:bg-gray-400 hover:shadow-lg active:bg-gray-500 active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70",children:"Annulla"}),o.jsxs("div",{className:"flex items-center gap-4",children:[p!=="delete"&&o.jsx("button",{type:"reset",form:a,className:"px-4 py-2 cursor-pointer text-sm font-medium text-white bg-rose-500 rounded-lg shadow-md hover:bg-rose-600 hover:shadow-lg active:bg-rose-700 active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70",children:"Reset"}),o.jsx("button",{form:a,onClick:()=>{u(),s()},className:`${p==="delete"?"bg-rose-500 rounded-lg shadow-md hover:bg-rose-600 hover:shadow-lg active:bg-rose-700":"bg-indigo-600 rounded-lg shadow-md hover:bg-indigo-700 hover:shadow-lg active:bg-indigo-800"} px-4 py-2 cursor-pointer text-sm font-medium text-white active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70`,children:p==="delete"?"Elimina":"Salva"})]})]})]})}),document.body):null},at=t=>{const{isLoading:s}=ne(),{showAlert:n}=U(),{isOpen:a,closeModal:l,content:c,title:u,onConfirm:p,item:h,type:b}=ot(),g=w.useLocation(),{isMain:P=!0,headerComponent:y=null,showHeaderOnLogin:d=!1,headerExcludedRoutes:E=[],footerComponent:x=null,showFooterOnLogin:C=!1,footerExcludedRoutes:j=[]}=t,S=E.some(z=>w.matchPath(z,g.pathname));let L;g.pathname==="/"?L=y&&d:L=y&&!S;const k=j.some(z=>w.matchPath(z,g.pathname));let G;return g.pathname==="/"?G=x&&C:G=x&&!k,o.jsxs(o.Fragment,{children:[s&&o.jsx(st,{}),n&&o.jsx(we,{}),o.jsx(_t,{isOpen:a,onClose:l,title:u,onConfirm:p,type:b,item:h,children:c}),L&&y,P?o.jsxs("main",{className:s?"hidden":"",children:[n&&o.jsx(we,{}),o.jsx(w.Outlet,{})]}):o.jsx(w.Outlet,{}),G&&x]})},xe=t=>{const{inputType:s,inputId:n,inputPlaceholder:a,inputRequired:l,inputValue:c,inputChange:u,autoFocus:p,inputStyle:h,overrideStyle:b,disabled:g}=t,y=["text","email","password","search","tel","url"].includes(s)?s:"text";return o.jsx("input",{type:y,autoFocus:p,id:n,className:b||`bg-input-bg border border-input-border text-input-text text-input-placeholder input-rounded focus:ring focus:ring-primary focus:border-primary focus:outline-none focus:shadow-(--shadow-primary-input) block w-full p-input ${h}`,placeholder:a,required:l??!0,value:c,onChange:u,disabled:g})},ve=({label:t,labelId:s,labelStyle:n,overrideStyle:a})=>o.jsx("label",{htmlFor:s,className:a||`show-label mb-1 sm:mb-2 text-input-label font-medium text-color-label ${n}`,children:t}),it=()=>{const{title:t,label:s,type:n,placeholder:a,buttonText:l,formData:c,changeData:u,handleLogin:p,overrideStyle:h}=Se();return o.jsxs("form",{onSubmit:p,className:h.form||"form-size",children:[o.jsx("h1",{className:h.title||"text-form-title-size show-title title-position m-form-title",children:t}),o.jsxs("div",{className:h.containerEmail||"flex justify-center flex-col gap-1 m-input-form input-size mx-auto",children:[o.jsx(ve,{labelId:"user-email",label:s}),o.jsx(xe,{inputType:n,inputId:"user-email",inputPlaceholder:a,inputValue:c.email,inputChange:b=>{u("email",b.target.value)},autoFocus:!0})]}),o.jsxs("div",{className:h.containerPassword||"flex justify-center flex-col gap-1 my-4 input-size mx-auto",children:[o.jsx(ve,{labelId:"password",label:"Password"}),o.jsx(xe,{inputType:"password",inputId:"password",inputPlaceholder:"Password",inputValue:c.password,inputChange:b=>{u("password",b.target.value)}})]}),o.jsx("div",{className:h.containerButton||"flex button-position items-center m-primary-button",children:o.jsx("button",{className:h.button||"font-bold cursor-pointer shadow-(--shadow-primary) transition-all duration-200 hover:shadow-(--shadow-primary-hover) active:shadow-(--shadow-primary-active) active:translate-y-[2px] p-primary-button rounded-primary-button bg-primary hover:bg-primary-hover text-primary-text",children:l})})]})},lt=({Logo:t})=>{const{styleCardForm:s,styleContainerLogo:n,styleLogo:a,overrideStyle:l,customVersion:c}=Se(),{firstPrivatePath:u,version:p}=H(),h=w.useNavigate();return i.useEffect(()=>{const b=JSON.parse(localStorage.getItem("user"));localStorage.getItem("accessToken")&&b.id&&h(`${u}${b.id}`)},[]),o.jsxs("section",{id:"login-page",children:[(p||c)&&o.jsx("div",{className:"text-md text-primary absolute top-4 left-4",children:c||p}),o.jsx("div",{className:l.container||"container mx-auto flex items-center justify-center h-screen",children:o.jsxs("div",{className:l.cardForm||`bg-form card-style card-size flex flex-col sm:flex-row sm:items-center justify-center ${s}`,children:[o.jsx("div",{className:l.containerLogo||`basis-1/2 flex items-center justify-center ${n}`,children:t&&o.jsx(t,{className:l.logo||`login-logo h-full sm:h-auto ${a}`})}),o.jsx(it,{})]})})]})},ue=()=>{const{isAuthenticated:t}=de(),{activeAlert:s}=U(),{autoLogin:n}=H();return i.useEffect(()=>{const a=localStorage.getItem("accessToken");!t&&!a&&!n&&s("danger","Non sei autorizzato")},[]),t===null?null:t?o.jsx(w.Outlet,{}):o.jsx(w.Navigate,{to:"/",replace:!0})},ct=()=>{const{logout:t,setCurrentToken:s,createAxiosInstances:n}=de(),{usersEndpoint:a}=H(),{setIsLoading:l}=ne(),{activeAlert:c}=U(),[u,p]=i.useState(null),[h,b]=i.useState(!1),g=JSON.parse(localStorage.getItem("user")),P=async()=>{try{b(!0);const d=localStorage.getItem("accessToken");if(!d){t(),c("danger","Sessione Scaduta");return}const C=(await(await n()).get(`${a}`,{headers:{Authorization:`Bearer ${d}`}})).data;p(C)}catch(d){console.error(d),l(!1)}finally{b(!1)}},y=()=>{t(),c("info","Hai effettuato il logout")};return i.useEffect(()=>{const d=localStorage.getItem("accessToken");d&&s(d)},[]),o.jsx("section",{children:o.jsxs("div",{className:"container mx-auto py-8",children:[o.jsxs("div",{className:"flex items-center justify-center gap-8 h-20",children:[o.jsxs("h1",{className:"text-4xl text-center text-slate-800",children:["Email: ",g.email]}),o.jsx("button",{onClick:y,className:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-full cursor-pointer shadow-[0_4px_10px_rgba(239,68,68,0.3),0_2px_4px_rgba(239,68,68,0.2)] hover:shadow-[0_6px_14px_rgba(185,28,28,0.4),0_3px_6px_rgba(185,28,28,0.3)] active:shadow-[0_2px_5px_rgba(239,68,68,0.3)] transition-all duration-200 active:translate-y-[2px]",children:"Logout"})]}),o.jsx("div",{className:"flex justify-center items-center my-12 gap-8",children:o.jsx("button",{onClick:P,className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full disabled:bg-blue-300 disabled:text-gray-500 disabled:cursor-not-allowed cursor-pointer transition-all duration-200 active:translate-y-[2px] shadow-[0_4px_10px_rgba(59,130,246,0.3),0_2px_4px_rgba(59,130,246,0.2)] hover:shadow-[0_6px_14px_rgba(29,78,216,0.4),0_3px_6px_rgba(29,78,216,0.3)] active:shadow-[0_2px_5px_rgba(59,130,246,0.3)]",disabled:h,children:"Lista degli utenti"})}),o.jsx("div",{className:"flex justify-center items-center",children:u&&o.jsx("ul",{children:u.map(d=>o.jsxs("li",{className:"text-xl my-4",children:[d.id," - ",d.email]},`user-${d.id}`))})})]})})},zt=t=>r.createElement("svg",{width:"108.41262mm",height:"108.41262mm",viewBox:"0 0 108.41262 108.41262",id:"svg1",xmlSpace:"preserve",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg",...t},r.createElement("defs",{id:"defs1"},r.createElement("linearGradient",{id:"linearGradient27"},r.createElement("stop",{style:{stopColor:"#ff0000",stopOpacity:1},offset:0,id:"stop27"}),r.createElement("stop",{style:{stopColor:"#ffca00",stopOpacity:.96862745},offset:1,id:"stop28"})),r.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.001785,y1:192.35495,x2:143.4144,y2:83.942337,gradientUnits:"userSpaceOnUse"}),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter90",x:-.059506074,y:-.12477839,width:1.1465613,height:1.3073246},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:1,floodColor:"rgb(0,0,0)",id:"feFlood89"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:.9,id:"feGaussianBlur89"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset89"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite89"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite90"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter147",x:-.31473854,y:-.27257434,width:1.6432813,height:1.5822092},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(255,255,255)",id:"feFlood146"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:9.5,id:"feGaussianBlur146"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:3.1,id:"feOffset146"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite146"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite147"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter385",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood384"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur384"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset384"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite384"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite385"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter387",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood385"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur385"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset385"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite386"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite387"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter389",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood387"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur387"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset387"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite388"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite389"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter391",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood389"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur389"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset389"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite390"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite391"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter393",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood391"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur391"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset391"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite392"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite393"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter395",x:0,y:0,width:1.0112203,height:1.010137},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood393"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur393"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset393"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite394"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite395"}))),r.createElement("g",{id:"layer1",transform:"translate(-35.001785,-83.942337)"},r.createElement("rect",{style:{fill:"url(#linearGradient28)",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},id:"rect26",width:108.41262,height:108.41262,x:35.001785,y:83.942337,rx:30,ry:30}),r.createElement("g",{id:"g1",transform:"matrix(0.90701349,0,0,0.90701349,9.3696997,14.003172)",style:{strokeWidth:1.10252}},r.createElement("path",{id:"path272",style:{fill:"#000000",strokeWidth:1.10252},d:"m 103.62373,105.0137 c -0.2695,0.002 -0.78905,0.20889 -1.00345,0.40037 -0.0723,0.0646 -0.21317,0.24236 -0.313,0.39478 l -0.18141,0.27703 -0.0181,18.06409 -0.0178,18.06382 h -1.52343 -1.523699 l -2.7e-4,-9.75061 c -5.1e-4,-10.41143 -0.004,-10.51883 -0.34443,-11.94691 -1.39786,-5.8616 -6.2432,-10.12876 -12.21276,-10.75566 -1.515814,-0.1589 -19.83671,-0.16023 -20.462316,-0.003 l -0.0017,-0.004 -19.984159,3.5751 18.852043,2.16035 v 6.07801 l -17.36031,3.10307 17.360304,1.98933 v 6.52314 l -17.360304,3.10307 14.274817,1.63584 -0.01572,4.90514 -0.01864,5.72665 -0.63026,0.1252 c -1.586894,0.3153 -3.197032,1.06826 -4.528475,2.1172 -2.205268,1.73733 -3.741586,4.44584 -4.052716,7.1446 -0.370335,3.21237 0.552005,6.19841 2.657413,8.60144 1.687848,1.92642 4.173186,3.25989 6.695215,3.59241 v -5.2e-4 c 0.823968,0.10864 2.933749,0.0318 3.671522,-0.13399 0.932239,-0.20951 1.790163,-0.51486 2.636639,-0.93819 2.065707,-1.03314 3.823794,-2.77572 4.827084,-4.78447 0.504382,-1.00984 0.910162,-2.2066 1.026636,-3.02875 l 0.04632,-0.32925 h 9.414169 9.413628 v 0.21364 c 0,0.11749 0.0641,0.46829 0.14251,0.77944 0.90405,3.58952 3.50881,6.4605 6.974649,7.68694 1.34306,0.47527 1.94661,0.56832 3.65554,0.56367 1.31935,-0.003 1.6122,-0.0248 2.18192,-0.1577 3.36735,-0.785 6.02631,-2.86016 7.51461,-5.86464 0.44078,-0.88981 0.88236,-2.20383 0.97202,-2.8921 l 0.0429,-0.32925 7.18349,-0.002 c 7.08058,-0.002 7.18734,-0.003 7.49462,-0.14278 0.6474,-0.29351 0.90064,-0.70316 0.90064,-1.45738 0,-0.56862 -0.16856,-0.94445 -0.54982,-1.22508 -0.50606,-0.37245 -0.22593,-0.35988 -7.89979,-0.35988 h -7.11582 l -0.11721,-0.59669 c -0.2611,-1.32878 -0.84786,-2.70966 -1.68167,-3.95762 -0.57002,-0.85316 -2.01938,-2.29531 -2.86466,-2.85108 -1.21392,-0.79816 -2.80463,-1.46394 -3.99997,-1.6734 l -0.5016,-0.0876 -0.0181,-21.17061 -0.0178,-21.17036 -0.15424,-0.31167 c -0.25804,-0.52106 -0.8796,-0.9025 -1.46482,-0.8993 z m 9.34091,0.76079 c -1.96193,0 -3.68713,1.06774 -4.53247,2.80552 -0.53635,1.10262 -0.53017,1.02648 -0.50719,6.44296 l 0.0203,4.7802 0.18834,0.55566 c 0.62086,1.83041 2.22554,3.17608 4.08307,3.42406 0.24153,0.0323 2.71506,0.0532 5.4965,0.0458 5.70515,-0.0145 5.3423,0.0172 6.54658,-0.57378 0.54778,-0.26881 0.75708,-0.42234 1.25039,-0.91741 0.48917,-0.4909 0.64889,-0.70949 0.91635,-1.25279 0.53896,-1.09564 0.53516,-1.04438 0.53516,-6.26129 0,-4.84593 -0.0122,-5.0614 -0.32764,-5.86224 -0.76424,-1.94014 -2.6134,-3.18671 -4.72693,-3.18671 h -0.55701 l -0.003,4.13929 -0.003,4.13902 -1.87799,1.48961 c -1.03267,0.8192 -1.9166,1.51251 -1.96429,1.54074 -0.0554,0.0327 -0.79171,-0.51293 -2.03382,-1.50745 l -1.94697,-1.55885 v -4.12119 -4.12117 z m 2.28928,0.5522 v 3.46322 3.46375 l 1.08417,0.86973 c 0.59637,0.47836 1.10581,0.86085 1.13185,0.85003 0.0261,-0.0108 0.53535,-0.40918 1.13212,-0.88546 l 1.08497,-0.866 -0.0171,-3.42912 -0.0168,-3.42939 -2.19977,-0.0184 z m -47.246903,6.50849 9.196533,0.0248 c 9.138394,0.0246 9.200727,0.0256 9.88912,0.17528 2.276157,0.49507 4.008841,1.42496 5.576421,2.99252 1.56294,1.56292 2.49402,3.26009 3.00157,5.47254 0.15094,0.65777 0.15069,0.6637 0.16943,10.68613 l 0.0189,10.02763 -1.19632,-2.6e-4 -1.19658,-2.6e-4 -2.909674,-2.90889 c -2.148162,-2.14765 -2.999001,-2.95439 -3.251981,-3.08256 l -0.342815,-0.17367 h -9.477299 -9.477299 v -11.60676 z m 44.869453,16.35471 c -0.8458,0 -1.3552,0.0997 -1.97601,0.38599 -1.35181,0.62342 -2.29671,1.66611 -2.77169,3.05885 l -0.18354,0.53889 -0.0203,4.74531 c -0.0228,5.40031 -0.0234,5.39175 0.50346,6.47758 0.5061,1.04314 1.24312,1.77945 2.29621,2.29407 0.34744,0.1698 0.83013,0.35177 1.07325,0.40464 h 5.1e-4 c 0.35322,0.0766 1.47942,0.0968 5.60252,0.10015 5.81748,0.004 5.68307,0.0148 6.74876,-0.50692 1.37728,-0.67421 2.29905,-1.80091 2.67474,-3.26982 0.12915,-0.50539 0.13665,-0.78389 0.13665,-5.22267 0,-4.44771 -0.007,-4.7167 -0.13746,-5.23651 -0.23263,-0.92645 -0.63571,-1.63668 -1.31912,-2.32417 -0.51589,-0.519 -0.69084,-0.64491 -1.31831,-0.94858 -0.81757,-0.39568 -1.26328,-0.49681 -2.19099,-0.49681 h -0.64544 v 4.11159 4.11159 l -1.90888,1.51757 c -1.04987,0.83448 -1.93862,1.52747 -1.97495,1.54022 -0.0363,0.0129 -0.93815,-0.6732 -2.00425,-1.52423 l -1.93845,-1.54714 -2.7e-4,-4.10467 -5.1e-4,-4.10493 z m 2.37718,0.55434 0.004,3.44644 0.004,3.4467 1.05221,0.84416 h 5.1e-4 c 0.57884,0.46404 1.07893,0.84576 1.1116,0.84843 0.0327,0.003 0.55455,-0.39065 1.1601,-0.87373 l 1.10122,-0.87826 v -3.41687 -3.41687 h -2.21709 z m -50.294829,9.49115 h 10.511122 10.511121 l 3.015165,3.00185 c 2.567942,2.55652 3.057622,3.01393 3.300462,3.08282 0.2049,0.0582 1.62307,0.0807 5.03966,0.0807 h 4.754629 v 1.5799 1.57938 l -0.53676,0.0938 c -1.12048,0.19566 -2.647899,0.80928 -3.728799,1.49786 -1.68955,1.07633 -3.11899,2.69978 -3.99411,4.53647 -0.44366,0.93112 -0.88466,2.34132 -0.88466,2.82896 v 0.21524 H 83.533023 74.11886 l -0.04632,-0.32925 c -0.173141,-1.22207 -0.843416,-2.86149 -1.706703,-4.17392 -0.532033,-0.80881 -1.995609,-2.29178 -2.799129,-2.83643 -1.322594,-0.89646 -2.959014,-1.5737 -4.282866,-1.77223 l -0.324987,-0.0488 v -4.66833 z"}),r.createElement("path",{id:"path268",style:{fill:"#ffffff",strokeWidth:1.10252},d:"m 103.6238,103.56164 c -0.26951,0.002 -0.78905,0.20888 -1.00346,0.40036 -0.0723,0.0646 -0.21316,0.24236 -0.313,0.39478 l -0.1814,0.27703 -0.0181,18.06409 -0.0178,18.06382 h -1.52344 -1.523699 l -2.6e-4,-9.7506 c -5.1e-4,-10.41144 -0.004,-10.51884 -0.34443,-11.94692 -1.39786,-5.86159 -6.2432,-10.12876 -12.212765,-10.75566 -1.515813,-0.1589 -19.836715,-0.16022 -20.46231,-0.003 l -0.0017,-0.004 -19.984159,3.5751 18.852043,2.16035 v 6.07801 l -17.36031,3.10307 17.36031,1.98934 v 6.52313 l -17.36031,3.10307 14.274823,1.63584 -0.01572,4.90514 -0.01864,5.72666 -0.630261,0.12519 c -1.586888,0.3153 -3.19702,1.06826 -4.528463,2.1172 -2.205268,1.73733 -3.741592,4.44584 -4.052721,7.1446 -0.370335,3.21237 0.55201,6.19842 2.657412,8.60144 1.687849,1.92642 4.173187,3.25989 6.695216,3.59241 v -5.2e-4 c 0.823962,0.10864 2.933749,0.0318 3.671527,-0.13398 0.932233,-0.20952 1.790157,-0.51486 2.636639,-0.9382 2.065707,-1.03313 3.823794,-2.77572 4.82709,-4.78447 0.504371,-1.00983 0.910151,-2.2066 1.026624,-3.02874 l 0.04632,-0.32925 h 9.414164 9.413621 v 0.21363 c 0,0.11749 0.0641,0.46829 0.14252,0.77944 0.90405,3.58952 3.50882,6.4605 6.974649,7.68695 1.34307,0.47527 1.94662,0.56831 3.65555,0.56366 1.31934,-0.003 1.6122,-0.0248 2.18192,-0.1577 3.36734,-0.785 6.0263,-2.86016 7.51461,-5.86464 0.44078,-0.88981 0.88236,-2.20383 0.97202,-2.89209 l 0.0429,-0.32925 7.18349,-0.002 c 7.08058,-0.002 7.18734,-0.003 7.49463,-0.14278 0.6474,-0.29351 0.90063,-0.70316 0.90063,-1.45737 0,-0.56863 -0.16856,-0.94446 -0.54981,-1.22508 -0.50607,-0.37246 -0.22593,-0.35988 -7.89979,-0.35988 h -7.11583 l -0.11721,-0.5967 c -0.2611,-1.32878 -0.84786,-2.70966 -1.68166,-3.95762 -0.57003,-0.85315 -2.01939,-2.29531 -2.86466,-2.85107 -1.21393,-0.79817 -2.80464,-1.46395 -3.99997,-1.6734 l -0.50159,-0.0876 -0.0181,-21.17061 -0.0179,-21.17036 -0.15424,-0.31166 c -0.25804,-0.52107 -0.8796,-0.90251 -1.46482,-0.8993 z m 9.34091,0.76078 c -1.96194,0 -3.68714,1.06774 -4.53248,2.80552 -0.53635,1.10263 -0.53017,1.02648 -0.50719,6.44296 l 0.0203,4.7802 0.18834,0.55567 c 0.62086,1.8304 2.22555,3.17607 4.08308,3.42406 0.24152,0.0323 2.71505,0.0532 5.4965,0.0458 5.70514,-0.0145 5.34229,0.0172 6.54658,-0.57378 0.54778,-0.2688 0.75707,-0.42233 1.25039,-0.91741 0.48917,-0.4909 0.64889,-0.70948 0.91635,-1.25279 0.53896,-1.09564 0.53516,-1.04438 0.53516,-6.26128 0,-4.84594 -0.0122,-5.06141 -0.32765,-5.86225 -0.76423,-1.94014 -2.6134,-3.18671 -4.72692,-3.18671 h -0.55701 l -0.003,4.13929 -0.003,4.13902 -1.87798,1.48961 c -1.03268,0.8192 -1.9166,1.51252 -1.96429,1.54074 -0.0554,0.0327 -0.79171,-0.51293 -2.03382,-1.50745 l -1.94698,-1.55886 v -4.12117 -4.12118 z m 2.28927,0.55221 v 3.46321 3.46375 l 1.08417,0.86974 c 0.59637,0.47835 1.10582,0.86085 1.13185,0.85002 0.0261,-0.0108 0.53535,-0.40918 1.13213,-0.88545 l 1.08496,-0.86601 -0.0171,-3.42912 -0.0168,-3.42939 -2.19978,-0.0184 z m -47.246901,6.50848 9.196533,0.0248 c 9.138394,0.0247 9.200727,0.0256 9.889125,0.17528 2.276152,0.49507 4.008834,1.42496 5.576414,2.99253 1.56294,1.56292 2.49402,3.26009 3.00158,5.47253 0.15094,0.65777 0.15069,0.6637 0.16942,10.68613 l 0.0189,10.02764 -1.19632,-2.7e-4 -1.19658,-2.6e-4 -2.909672,-2.90888 c -2.148163,-2.14765 -2.999001,-2.9544 -3.251981,-3.08256 l -0.342835,-0.17368 H 77.484375 68.00707 v -11.60675 z m 44.869461,16.35472 c -0.84581,0 -1.35521,0.0997 -1.97602,0.38599 -1.35181,0.62342 -2.29671,1.6661 -2.77169,3.05885 l -0.18354,0.53888 -0.0203,4.74531 c -0.0229,5.40032 -0.0234,5.39175 0.50346,6.47758 0.50611,1.04314 1.24312,1.77945 2.29621,2.29408 0.34744,0.1698 0.83013,0.35177 1.07325,0.40463 h 5.1e-4 c 0.35322,0.0766 1.47942,0.0968 5.60252,0.10015 5.81748,0.005 5.68308,0.0148 6.74876,-0.50692 1.37729,-0.67421 2.29905,-1.8009 2.67474,-3.26982 0.12916,-0.50539 0.13665,-0.78389 0.13665,-5.22266 0,-4.44771 -0.007,-4.7167 -0.13745,-5.23652 -0.23264,-0.92645 -0.63572,-1.63668 -1.31912,-2.32417 -0.5159,-0.519 -0.69084,-0.64491 -1.31832,-0.94858 -0.81757,-0.39568 -1.26328,-0.4968 -2.19098,-0.4968 h -0.64545 v 4.11159 4.11159 l -1.90888,1.51756 c -1.04987,0.83448 -1.93862,1.52747 -1.97495,1.54022 -0.0363,0.0129 -0.93815,-0.6732 -2.00425,-1.52423 l -1.93845,-1.54714 -2.6e-4,-4.10466 -5.2e-4,-4.10493 z m 2.37718,0.55434 0.004,3.44643 0.004,3.4467 1.0522,0.84416 h 5.2e-4 c 0.57883,0.46405 1.07893,0.84577 1.1116,0.84843 0.0327,0.003 0.55454,-0.39065 1.16009,-0.87374 l 1.10122,-0.87825 v -3.41686 -3.41687 h -2.21709 z m -50.294837,9.49114 H 75.47001 85.981126 l 3.015165,3.00185 c 2.56794,2.55652 3.05762,3.01393 3.30046,3.08283 0.20491,0.0582 1.62308,0.0807 5.03966,0.0807 h 4.754639 v 1.5799 1.57938 l -0.53676,0.0938 c -1.12049,0.19566 -2.647909,0.80928 -3.728809,1.49786 -1.68955,1.07634 -3.11898,2.69979 -3.99411,4.53647 -0.44366,0.93112 -0.88465,2.34132 -0.88465,2.82897 v 0.21523 h -9.413636 -9.414164 l -0.04632,-0.32925 c -0.173136,-1.22207 -0.843417,-2.86149 -1.706697,-4.17392 -0.53204,-0.80881 -1.995616,-2.29178 -2.799129,-2.83642 -1.322601,-0.89647 -2.959015,-1.57371 -4.282873,-1.77224 l -0.324986,-0.0487 v -4.66833 z"})),r.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},d:"",id:"path40",transform:"scale(0.26458333)"}))),Bt=t=>{const{publicRoutes:s,privateRoutes:n}=et(),{firstPrivatePath:a}=H(),{logoImg:l=zt,pathImg:c="./src/assets/MyWarehouse.svg",firstPrivateElement:u=o.jsx(ct,{}),globalLayout:p,isMain:h,headerComponent:b,showHeaderOnLogin:g,headerExcludedRoutes:P,footerComponent:y,showFooterOnLogin:d,footerExcludedRoutes:E,privateProvider:x,customProvider:C}=t,j=p||o.jsx(at,{isMain:h,headerComponent:b,showHeaderOnLogin:g,headerExcludedRoutes:P,footerComponent:y,showFooterOnLogin:d,footerExcludedRoutes:E}),S=x?i.cloneElement(x,{},C?i.createElement(C.type,C.props,o.jsx(ue,{children:o.jsx(w.Outlet,{})})):o.jsx(ue,{children:o.jsx(w.Outlet,{})})):C?i.createElement(C.type,C.props,o.jsx(ue,{children:o.jsx(w.Outlet,{})})):o.jsx(ue,{children:o.jsx(w.Outlet,{})}),L=()=>{const k=document.querySelector("link[rel='icon']");c&&(k.href=c)};return i.useEffect(()=>{L()},[]),o.jsx(w.Routes,{children:o.jsxs(w.Route,{element:p==="none"?null:j,children:[o.jsxs(w.Route,{path:"/",children:[o.jsx(w.Route,{index:!0,element:o.jsx(lt,{Logo:l})}),s.map((k,G)=>o.jsx(w.Route,{path:k.path,element:k.element},`public-${G}`))]}),o.jsxs(w.Route,{element:S,children:[o.jsx(w.Route,{path:`${a??"/dashboard/"}:id`,element:u}),n.map((k,G)=>o.jsx(w.Route,{path:k.path,element:k.element},`private-${G}`))]})]})})},Ft=({children:t})=>{var l;const s=w.useLocation(),{activeAlert:n}=U(),a=JSON.parse(localStorage.getItem("user"));return i.useEffect(()=>{(!a||!a.admin)&&n("warning","Non puoi accedere a questa pagina")},[a]),!a||!a.admin?o.jsx(w.Navigate,{to:((l=s.state)==null?void 0:l.from)||"/",replace:!0}):t},$t=({spinner:t=!0,spinnerStyle:s,text:n,textStyle:a,children:l,containerStyle:c,overrideStyle:u={}})=>o.jsxs("div",{className:u.container||`w-full h-full relative flex items-center justify-center ${c}`,children:[t&&o.jsx(nt,{className:u.spinner||`text-[20rem] animate-spin text-black ${s}`}),l||o.jsx("p",{className:u.text||`text-black text-2xl select-none absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 ${a}`,children:n||"Loading..."})]}),je=({isTag:t=!1,value:s,label:n,placeholder:a,id:l,onChange:c,error:u=null})=>o.jsxs("div",{className:`flex items-center justify-center relative ${t?"gap-4 mb-2":"gap-1 m-4"}`,children:[o.jsx(ve,{labelId:l,label:n,overrideStyle:`text-xl font-bold text-color-label ${t?"":"basis-1/3"}`}),o.jsx(xe,{type:"text",inputId:l,inputPlaceholder:a,inputValue:s||"",disabled:t,inputChange:c,overrideStyle:`${t?"w-full":"basis-2/3"} ${u?"border-red-600 focus:ring focus:ring-red-600 focus:border-red-600 focus:shadow-[0_0_0_4px_rgba(255,0,0,0.5)]":""} bg-input-bg border border-input-border text-input-text text-input-placeholder input-rounded focus:ring focus:ring-focus-ring focus:border-spot-rfid-input-border focus:outline-none focus:shadow-spot-rfid-input block w-full p-input`}),u&&o.jsx("p",{className:"text-red-600 text-[13px] absolute bottom-0 left-26 translate-y-[20px]",children:u})]}),Dt=({title:t,showTag:s,value:n,tag:a,showButton:l,handleClick:c})=>o.jsxs("div",{className:`border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${t==="TAG B"?"delay-200":"mb-4"} ${s?"opacity-100 translate-y-0":"opacity-0 translate-y-10"}`,children:[o.jsx("h2",{className:"text-center mb-2 text-2xl",children:t}),o.jsx(je,{label:"TID",placeholder:`Leggi ${t}`,id:a?`tid-${a}`:"tid",isTag:!0,value:(n==null?void 0:n.valueTID)||""}),o.jsx(je,{label:"EPC",placeholder:`Leggi ${t}`,id:a?`epc-${a}`:"epc",isTag:!0,value:(n==null?void 0:n.valueEPC)||""}),!l&&o.jsx("div",{className:"flex items-center justify-center",children:o.jsx("button",{onClick:c,disabled:!(n!=null&&n.valueTID)&&!(n!=null&&n.valueEPC),className:"my-1 bg-write-button disabled:bg-write-button/40 text-white px-4 py-2 rounded-lg shadow-md disabled:transition-none disabled:active:translate-y-0 transition-all duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer uppercase",children:"Scrivi tag"})})]});function Wt(t){return K({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.04 1.33L12.71 3l.29.71v.33h-.5l-.5.5v-.83l-1.67-1.67H10v4H4v-4H2v10h3l-.5 1H2l-1-1v-10l1-1h8.33l.71.29zM7 5h2V2H7v3zm6.5 0L15 6.5l-.02.69-5.5 5.5-.13.12-.37.37-.1.09-3 1.5-.67-.67 1.5-3 .09-.1.37-.37.12-.13 5.5-5.5h.71zm-6.22 7.24l-.52 1 1.04-.48-.52-.52zm.69-1.03l.79.79 5.15-5.15-.79-.79-5.15 5.15z"},child:[]}]})(t)}const Ht=({minReadingPower:t,maxReadingPower:s,stepRangePower:n,rangeValue:a,setRangeValue:l,show:c,handleClick:u})=>{const p=(a-t)/(s-t)*100;return o.jsxs("div",{className:`border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${c?"opacity-100 translate-y-0":"opacity-0 translate-y-10"}`,children:[o.jsx("h2",{className:"text-center my-4 text-2xl",children:"Configurazione Potenza"}),o.jsxs("div",{className:"relative my-12 w-[90%] mx-auto",children:[o.jsx("input",{id:"power",type:"range",min:t,max:s,step:n,value:a,onChange:h=>l(Number(h.target.value)),className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-primary-accent"}),o.jsx("div",{className:"absolute bottom-8 transform -translate-x-1/2 bg-white border border-gray-200 text-sm text-gray-800 py-1 px-2 rounded-lg shadow-md transition-opacity",style:{left:`${p}%`},children:a})]}),o.jsx("div",{className:"flex items-center justify-center my-4",children:o.jsxs("button",{onClick:()=>u(a),className:"py-2 px-4 flex items-center justify-center gap-1 bg-save-button text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",children:["Salva",o.jsx(Wt,{})]})})]})},Yt=({show:t,isConfigPage:s,handleSelectFile:n})=>o.jsxs("div",{className:`${s?`${t?"opacity-100 translate-y-0 delay-200":"opacity-0 translate-y-10"}`:""} p-4 text-center transition-all duration-700 transform`,children:[o.jsxs("h2",{className:"text-xl my-4",children:["Seleziona il file ",o.jsx("strong",{children:"config.json"})," per recuperare le chiavi univoche del dispositivo"]}),o.jsx("button",{onClick:n,className:"my-4 bg-blue-500 text-white px-4 py-2 rounded-lg",children:"Seleziona file"})]});function Zt(t){return K({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M312 372c-7.7 0-14 6.3-14 14 0 9.9-8.1 18-18 18H94c-9.9 0-18-8.1-18-18V126c0-9.9 8.1-18 18-18h186c9.9 0 18 8.1 18 18 0 7.7 6.3 14 14 14s14-6.3 14-14c0-25.4-20.6-46-46-46H94c-25.4 0-46 20.6-46 46v260c0 25.4 20.6 46 46 46h186c25.4 0 46-20.6 46-46 0-7.7-6.3-14-14-14z"},child:[]},{tag:"path",attr:{d:"M372.9 158.1c-2.6-2.6-6.1-4.1-9.9-4.1-3.7 0-7.3 1.4-9.9 4.1-5.5 5.5-5.5 14.3 0 19.8l65.2 64.2H162c-7.7 0-14 6.3-14 14s6.3 14 14 14h256.6L355 334.2c-5.4 5.4-5.4 14.3 0 19.8l.1.1c2.7 2.5 6.2 3.9 9.8 3.9 3.8 0 7.3-1.4 9.9-4.1l82.6-82.4c4.3-4.3 6.5-9.3 6.5-14.7 0-5.3-2.3-10.3-6.5-14.5l-84.5-84.2z"},child:[]}]})(t)}function Ut(t){return K({tag:"svg",attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 9.059v-2.559c0-.256-.098-.512-.293-.708-.195-.195-.451-.292-.707-.292s-.512.097-.707.292l-6.293 6.208 6.293 6.207c.195.195.451.293.707.293s.512-.098.707-.293.293-.452.293-.707v-2.489c2.75.068 5.755.566 8 3.989v-1c0-4.633-3.5-8.443-8-8.941z"},child:[]}]})(t)}const qt=t=>r.createElement("svg",{width:"108.41262mm",height:"108.41262mm",viewBox:"0 0 108.41262 108.41262",id:"svg1",xmlSpace:"preserve",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg",...t},r.createElement("defs",{id:"defs1"},r.createElement("linearGradient",{id:"linearGradient27"},r.createElement("stop",{style:{stopColor:"#ff0000",stopOpacity:1},offset:0,id:"stop27"}),r.createElement("stop",{style:{stopColor:"#ffca00",stopOpacity:.96862745},offset:1,id:"stop28"})),r.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.001785,y1:192.35495,x2:143.4144,y2:83.942337,gradientUnits:"userSpaceOnUse"}),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter90",x:-.059506074,y:-.12477839,width:1.1465613,height:1.3073246},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:1,floodColor:"rgb(0,0,0)",id:"feFlood89"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:.9,id:"feGaussianBlur89"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset89"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite89"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite90"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter147",x:-.31473854,y:-.27257434,width:1.6432813,height:1.5822092},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(255,255,255)",id:"feFlood146"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:9.5,id:"feGaussianBlur146"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:3.1,id:"feOffset146"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite146"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite147"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter385",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood384"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur384"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset384"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite384"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite385"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter387",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood385"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur385"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset385"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite386"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite387"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter389",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood387"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur387"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset387"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite388"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite389"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter391",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood389"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur389"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset389"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite390"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite391"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter393",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood391"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur391"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset391"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite392"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite393"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter395",x:0,y:0,width:1.0112203,height:1.010137},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood393"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur393"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset393"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite394"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite395"}))),r.createElement("g",{id:"layer1",transform:"translate(-35.001785,-83.942337)"},r.createElement("rect",{style:{fill:"url(#linearGradient28)",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},id:"rect26",width:108.41262,height:108.41262,x:35.001785,y:83.942337,rx:30,ry:30}),r.createElement("g",{id:"g1",transform:"matrix(1.0833532,0,0,1.1590115,-13.020803,-26.50933)",style:{strokeWidth:.892424}},r.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,strokeWidth:0,strokeDasharray:"none"},d:"m 93.82567,176.60265 c -0.16819,-0.0337 -1.83675,-0.44258 -3.70792,-0.90862 -1.87115,-0.46603 -6.89404,-1.70738 -11.16196,-2.75855 -4.26793,-1.05118 -7.88422,-1.94532 -8.03621,-1.98697 -0.38441,-0.10533 -0.67366,-0.35309 -0.84014,-0.71961 -0.13464,-0.29646 -0.14169,-0.67022 -0.14329,-7.58613 l -0.002,-7.27432 -1.58638,-0.3886 c -0.8725,-0.21372 -2.73139,-0.66288 -4.13086,-0.99814 -1.66387,-0.39859 -2.62074,-0.66385 -2.76482,-0.76643 -0.45114,-0.32125 -0.67287,-1.17785 -0.44025,-1.70084 0.0507,-0.11391 1.34784,-1.54136 2.88261,-3.17212 1.53477,-1.63075 3.54737,-3.76898 4.47243,-4.75162 0.92507,-0.98264 1.68195,-1.81314 1.68195,-1.84557 0,-0.0324 -2.0126,-2.19745 -4.47244,-4.81117 -2.45984,-2.61372 -4.51389,-4.8454 -4.56455,-4.95928 -0.12411,-0.27898 -0.12207,-0.80663 0.005,-1.10902 0.1372,-0.32836 0.59041,-0.71699 0.94692,-0.81198 0.15823,-0.0422 1.52621,-0.37262 3.03996,-0.73436 4.23151,-1.01121 12.80468,-3.07938 16.20779,-3.90995 3.11435,-0.76008 3.63105,-0.84103 4.02851,-0.63116 0.11325,0.0598 1.10839,1.07202 2.21144,2.24939 1.10304,1.17736 3.10699,3.30654 4.45322,4.73153 l 2.44769,2.59088 0.578,-0.60313 c 0.73001,-0.76177 7.41013,-7.89063 7.89815,-8.42872 0.53305,-0.58777 1.16446,-0.82568 1.67671,-0.6318 0.0974,0.0368 1.94877,0.48807 4.11427,1.00273 2.1655,0.51466 5.55423,1.32534 7.53051,1.80149 1.97627,0.47615 5.17578,1.24703 7.11002,1.71306 1.93424,0.46603 3.61155,0.88516 3.72738,0.93144 0.43966,0.17561 0.81987,0.81095 0.82108,1.37204 2.3e-4,0.10902 -0.077,0.33848 -0.17159,0.50991 -0.14542,0.26349 -2.63982,2.95379 -7.91983,8.54181 -0.59557,0.63032 -1.07365,1.1737 -1.06238,1.20751 0.0113,0.0338 2.01538,2.1792 4.45357,4.76756 2.43818,2.58836 4.49238,4.83165 4.56486,4.9851 0.23209,0.49134 0.12362,1.1068 -0.26923,1.52754 -0.24489,0.26229 -0.46525,0.35629 -1.27692,0.54472 -0.39945,0.0927 -2.13682,0.50971 -3.86082,0.92658 -1.72399,0.41689 -3.21193,0.77599 -3.30654,0.79802 l -0.17202,0.0401 v 7.21184 c 0,5.18025 -0.0245,7.28504 -0.0869,7.4717 -0.0478,0.14293 -0.17678,0.35764 -0.2867,0.47713 -0.21143,0.22984 -0.69257,0.50905 -0.87722,0.50905 -0.0605,0 -4.19891,1.01172 -9.19638,2.24827 -12.94173,3.20224 -13.80448,3.41153 -14.01743,3.4002 -0.10512,-0.005 -0.32874,-0.0378 -0.49695,-0.0714 z m -0.11468,-14.06316 c 0,-6.93801 -0.0266,-12.61456 -0.059,-12.61456 -0.0324,0 -1.13014,1.1439 -2.43938,2.54202 -5.28868,5.6477 -5.75841,6.13463 -6.04581,6.26705 -0.47758,0.22003 0.50027,0.42347 -8.92509,-1.85672 -2.27062,-0.5493 -4.32623,-1.04513 -4.568,-1.10183 l -0.43961,-0.10308 v 6.97711 6.97712 l 0.97477,0.24011 c 6.05221,1.49085 19.20592,4.74159 20.12595,4.97382 0.65175,0.16452 1.22801,0.30235 1.28057,0.30631 0.0761,0.005 0.0956,-2.56285 0.0956,-12.60735 z m 12.57633,9.85252 c 5.92884,-1.46667 10.85676,-2.68431 10.95094,-2.70586 l 0.17122,-0.0392 0.02,-6.99318 c 0.0176,-6.18688 0.006,-6.98914 -0.0948,-6.95814 -0.0631,0.0192 -1.69723,0.41672 -3.63146,0.88324 -1.93423,0.46652 -4.7209,1.1404 -6.1926,1.49752 -3.65266,0.88632 -3.40635,0.8392 -3.78841,0.72474 -0.18605,-0.0557 -0.46352,-0.23294 -0.65085,-0.41565 -0.17959,-0.17516 -2.03807,-2.14184 -4.12994,-4.37042 -2.09186,-2.22857 -3.83203,-4.06342 -3.86703,-4.07743 -0.035,-0.014 -0.0637,5.65667 -0.0637,12.60152 v 12.627 l 0.24846,-0.0537 c 0.13666,-0.0296 5.09935,-1.25375 11.02819,-2.72042 z M 85.323,156.74825 c 0.88524,-0.91925 7.62622,-8.10235 8.03426,-8.56119 0.16287,-0.18314 0.28328,-0.34442 0.26759,-0.35841 -0.03,-0.0267 -1.29081,-0.3341 -7.0621,-1.72171 -1.93424,-0.46507 -6.15811,-1.48175 -9.38639,-2.25933 l -5.8696,-1.41376 -0.51316,0.55367 c -0.28223,0.30453 -0.80894,0.86331 -1.17046,1.24174 -0.52801,0.55274 -4.33277,4.60748 -6.87086,7.32232 -0.2664,0.28496 -0.46871,0.53377 -0.44956,0.55291 0.0191,0.0191 1.89033,0.48037 4.15819,1.02495 9.93967,2.38676 16.93345,4.07196 17.46425,4.20814 0.31536,0.0809 0.59738,0.14912 0.62671,0.15159 0.0293,0.003 0.37634,-0.33095 0.77113,-0.74092 z m 20.23487,0.40117 c 0.77963,-0.18934 3.86015,-0.93125 6.8456,-1.6487 12.24203,-2.94198 13.98307,-3.36382 14.01498,-3.39573 0.0184,-0.0184 -0.23762,-0.32105 -0.56885,-0.67267 -0.33122,-0.35161 -2.18125,-2.32256 -4.11118,-4.37989 -1.92994,-2.05733 -3.69458,-3.93741 -3.92146,-4.17796 l -0.41248,-0.43738 -6.82004,1.63769 c -3.75102,0.90074 -8.29937,1.99733 -10.10746,2.43686 -1.80808,0.43955 -3.76047,0.911 -4.33864,1.04768 -0.57817,0.13668 -1.05122,0.27733 -1.05122,0.31258 0,0.0599 1.97276,2.17716 6.91891,7.42581 1.1353,1.20474 2.07997,2.19169 2.09925,2.1932 0.0193,0.002 0.67295,-0.15217 1.45259,-0.34149 z m -9.33771,-11.00163 c 0.95365,-0.22729 3.67769,-0.88483 6.05344,-1.46119 4.87911,-1.18367 10.14405,-2.45535 11.25754,-2.7191 0.40997,-0.0971 0.7454,-0.19673 0.7454,-0.22138 0,-0.0412 -2.28027,-0.59973 -11.88826,-2.91197 -1.93424,-0.46549 -4.51448,-1.08925 -5.73389,-1.38617 -1.21941,-0.29689 -2.26871,-0.53817 -2.33178,-0.53618 -0.0631,0.002 -1.3876,0.31307 -2.9434,0.69126 -1.55579,0.37819 -4.05004,0.98158 -5.54275,1.34086 -1.49273,0.35928 -4.43422,1.06949 -6.53664,1.57826 -2.10243,0.50877 -4.07201,0.98326 -4.37687,1.05442 -0.30485,0.0712 -0.55427,0.14798 -0.55427,0.17071 0,0.0227 0.61066,0.18561 1.35702,0.36195 0.74636,0.17635 4.83175,1.16061 9.07865,2.18726 4.2469,1.02663 8.08287,1.95378 8.52439,2.06033 0.4415,0.10653 0.88256,0.19606 0.98013,0.19894 0.0976,0.003 0.95764,-0.18071 1.91129,-0.408 z m -23.17527,-5.5068 c 1.61572,-0.38489 15.1372,-3.64431 18.92683,-4.56241 0.91455,-0.22156 1.66283,-0.42236 1.66283,-0.44621 0,-0.0436 -2.17511,-2.37359 -6.49352,-6.95578 -1.28517,-1.36367 -2.37292,-2.52792 -2.41721,-2.58723 -0.0681,-0.0912 -0.25681,-0.0653 -1.22322,0.16776 -2.15241,0.51909 -10.69795,2.57488 -15.92927,3.83208 -2.87653,0.69131 -5.24697,1.27382 -5.26762,1.29447 -0.0458,0.0458 -0.20983,-0.13182 4.76121,5.15371 2.23,2.37108 4.08206,4.35788 4.11569,4.4151 0.0336,0.0572 0.0744,0.10403 0.0906,0.10403 0.0161,0 0.81435,-0.18698 1.7737,-0.41552 z m 44.72625,0.0168 c 0.66764,-0.72696 2.63332,-2.82289 4.6092,-4.91467 3.5914,-3.80204 4.07433,-4.32272 4.04059,-4.35646 -0.0185,-0.0184 -0.89212,-0.23938 -1.94146,-0.49094 -4.03823,-0.96807 -15.40558,-3.70468 -17.84516,-4.29611 l -2.55819,-0.62019 -0.2247,0.25651 c -0.12359,0.14108 -0.76319,0.82417 -1.42134,1.51797 -0.65816,0.6938 -2.25926,2.39677 -3.55803,3.78436 -1.29877,1.38761 -2.68169,2.85649 -3.07316,3.26419 -0.39148,0.40769 -0.71177,0.77302 -0.71177,0.81184 0,0.081 1.22124,0.38162 13.25883,3.26372 4.83252,1.15702 8.80323,2.1205 8.82382,2.14109 0.10179,0.1018 0.26744,0.003 0.60137,-0.36131 z",id:"path1"}),r.createElement("path",{style:{fill:"#d30000",fillOpacity:1,strokeWidth:.892424},d:"m 94.23704,147.39738 c -0.18923,-0.0768 -0.53591,-0.44038 -0.83007,-0.87064 -0.13792,-0.20172 -0.97955,-1.55209 -1.87028,-3.00083 -6.42775,-10.45449 -9.51471,-15.54702 -9.94927,-16.41318 -0.45927,-0.91546 -0.98193,-2.46434 -1.17845,-3.49236 -0.47774,-2.49897 -0.33475,-4.87936 0.43464,-7.23535 1.18651,-3.63329 3.71304,-6.57746 7.14475,-8.32579 1.32203,-0.67352 2.76073,-1.13624 4.31579,-1.38807 1.01828,-0.16489 3.18289,-0.16489 4.20118,0 2.16477,0.35056 4.09681,1.1098 5.90163,2.31918 3.0314,2.03129 5.22702,5.32107 5.95891,8.92844 0.6233,3.07215 0.29346,6.03826 -0.98629,8.86914 -0.35811,0.79216 -3.66707,6.34467 -7.57053,12.70353 -1.14824,1.87052 -2.60138,4.23855 -3.2292,5.2623 -0.78819,1.28523 -1.26572,1.99215 -1.54284,2.28396 -0.39825,0.41935 -0.51902,0.47365 -0.79997,0.35967 z m 1.26593,-20.98125 c 2.28056,-0.3989 4.20147,-2.0406 4.94879,-4.22949 0.29427,-0.86192 0.38048,-1.47914 0.33067,-2.36733 -0.0986,-1.75805 -0.74937,-3.16136 -2.02879,-4.37485 -1.21602,-1.15336 -2.65543,-1.72396 -4.3489,-1.72396 -1.69143,0 -3.13312,0.57083 -4.34528,1.72052 -0.96303,0.91339 -1.53452,1.85482 -1.86842,3.07793 -0.13092,0.47957 -0.1542,0.7208 -0.15122,1.5671 0.003,0.87328 0.0263,1.08366 0.18354,1.65699 0.55902,2.03928 1.99215,3.61954 3.96302,4.36987 1.03786,0.39512 2.18932,0.5004 3.31659,0.30322 z",id:"path2"}),r.createElement("rect",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeDasharray:"none",paintOrder:"stroke markers fill"},id:"rect2",width:3.538805,height:1.3867109,x:158.63237,y:137.74451,transform:"matrix(0.98806246,0.1540538,-0.46962192,0.88286763,0,0)"}),r.createElement("rect",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeDasharray:"none",paintOrder:"stroke markers fill"},id:"rect3",width:3.1665602,height:1.2219434,x:120.62843,y:170.94601,transform:"matrix(0.98237657,-0.18691248,-0.14496758,0.98943641,0,0)"})),r.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},d:"",id:"path40",transform:"scale(0.26458333)"}))),Vt=({Logo:t,logo:s})=>{const{logout:n}=de(),{activeAlert:a}=U(),{autoLogin:l,configRoutes:c,firstPrivateTitle:u,showHeaderButton:p}=H(),{isLoading:h}=ne(),b=w.useLocation(),g=w.useNavigate(),P=()=>{n(),a("info","Hai effettuato il logout")},y=c.find(E=>E.path===b.pathname),d=w.useMatch("home/:id");return o.jsx("header",{className:h?"hidden":"",children:o.jsxs("nav",{className:"header-size flex items-center justify-between px-2 shadow-lg border-b gap-2 border-b-gray-300",children:[o.jsx("figure",{children:t&&typeof t=="function"?o.jsx(t,{className:"header-logo-size"}):s?o.jsx("img",{src:s,alt:"Logo",className:"header-logo-size"}):o.jsx(qt,{className:"header-logo-size"})}),o.jsx("div",{children:o.jsx("p",{children:(y==null?void 0:y.title)||u})}),o.jsxs("div",{children:[!l&&d&&o.jsx("button",{className:"h-[48px] w-[48px] flex items-center justify-center bg-red-600 text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",type:"button",onClick:P,children:o.jsx(Zt,{className:"text-4xl w-full"})}),!d&&p&&o.jsx("button",{className:"h-[48px] w-[48px] flex items-center justify-center bg-sky-600 text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",type:"button",onClick:()=>g(-1),children:o.jsx(Ut,{className:"text-4xl w-full"})})]})]})})};Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:()=>w.BrowserRouter});Object.defineProperty(exports,"Link",{enumerable:!0,get:()=>w.Link});Object.defineProperty(exports,"NavLink",{enumerable:!0,get:()=>w.NavLink});Object.defineProperty(exports,"Outlet",{enumerable:!0,get:()=>w.Outlet});Object.defineProperty(exports,"Route",{enumerable:!0,get:()=>w.Route});Object.defineProperty(exports,"Routes",{enumerable:!0,get:()=>w.Routes});Object.defineProperty(exports,"useLocation",{enumerable:!0,get:()=>w.useLocation});Object.defineProperty(exports,"useMatch",{enumerable:!0,get:()=>w.useMatch});Object.defineProperty(exports,"useNavigate",{enumerable:!0,get:()=>w.useNavigate});Object.defineProperty(exports,"useParams",{enumerable:!0,get:()=>w.useParams});exports.axios=We;exports.ReactDOM=He;exports.Alert=we;exports.AlertProvider=Rt;exports.AuthAdmin=Ft;exports.AuthPage=ue;exports.AuthProvider=Nt;exports.CardInputRange=Ht;exports.CardInputTag=Dt;exports.ConfigFileReader=Yt;exports.ConfigProvider=vt;exports.Dashboard=ct;exports.DefaultLayout=at;exports.ErrorPage=Ze;exports.Header=Vt;exports.Input=xe;exports.InputGroup=je;exports.InputLabel=ve;exports.Loading=st;exports.LoadingComponent=$t;exports.LoadingProvider=gt;exports.Login=lt;exports.LoginForm=it;exports.LoginFormProvider=Tt;exports.ModalProvider=Mt;exports.PackageRoutes=Bt;exports.RouteProvider=Gt;exports.fetchAxiosConfig=Xe;exports.useAlert=U;exports.useAuth=de;exports.useConfig=H;exports.useLoading=ne;exports.useLoginForm=Se;exports.useModal=ot;exports.useRoutesInjection=et;
|