@sme.up/ketchup2 2.0.0-SNAPSHOT-20250613074100 → 2.0.0-SNAPSHOT-20250613081018
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/basic-components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/basic-components/cell/cell-types.d.ts +0 -5
- package/dist/basic-components/cell/cell-types.d.ts.map +1 -1
- package/dist/basic-components/checkbox/checkbox-types.d.ts +5 -1
- package/dist/basic-components/checkbox/checkbox-types.d.ts.map +1 -1
- package/dist/basic-components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/basic-components/combobox/combobox.d.ts.map +1 -1
- package/dist/basic-components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/basic-components/mulitple-autocomplete/multiple-autocomplete.d.ts.map +1 -1
- package/dist/basic-components/textfield/textfield-types.d.ts +6 -6
- package/dist/basic-components/textfield/textfield-types.d.ts.map +1 -1
- package/dist/basic-components/textfield/textfield.d.ts.map +1 -1
- package/dist/components/input-panel/assets/data.d.ts +3 -0
- package/dist/components/input-panel/assets/data.d.ts.map +1 -0
- package/dist/components/input-panel/input-panel-types.d.ts +4 -0
- package/dist/components/input-panel/input-panel-types.d.ts.map +1 -1
- package/dist/components/input-panel/input-panel.d.ts.map +1 -1
- package/dist/ketchup2.cjs.js +12 -12
- package/dist/ketchup2.css +1 -1
- package/dist/ketchup2.es.js +1315 -1293
- package/package.json +1 -1
package/dist/ketchup2.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Cr=Object.defineProperty;var $r=(r,e,t)=>e in r?Cr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var ve=(r,e,t)=>$r(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";var Cr=Object.defineProperty;var $r=(r,e,t)=>e in r?Cr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var ve=(r,e,t)=>$r(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react");function Pr(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const Le=Pr(L);var _e={exports:{}},De={};/**
|
|
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
|
|
9
|
+
*/var Et;function Ar(){if(Et)return De;Et=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var o in s)o!=="key"&&(a[o]=s[o])}else a=s;return s=a.ref,{$$typeof:r,type:n,key:i,ref:s!==void 0?s:null,props:a}}return De.Fragment=e,De.jsx=t,De.jsxs=t,De}var je={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,37 +14,37 @@
|
|
|
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
|
|
17
|
+
*/var Tt;function Lr(){return Tt||(Tt=1,process.env.NODE_ENV!=="production"&&function(){function r(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===P?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case y:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case v:return"Suspense";case I:return"SuspenseList";case R:return"Activity"}if(typeof p=="object")switch(typeof p.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),p.$$typeof){case h:return"Portal";case D:return(p.displayName||"Context")+".Provider";case E:return(p._context.displayName||"Context")+".Consumer";case S:var g=p.render;return p=p.displayName,p||(p=g.displayName||g.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case $:return g=p.displayName||null,g!==null?g:r(p.type)||"Memo";case W:g=p._payload,p=p._init;try{return r(p(g))}catch{}}return null}function e(p){return""+p}function t(p){try{e(p);var g=!1}catch{g=!0}if(g){g=console;var T=g.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return T.call(g,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),e(p)}}function n(p){if(p===y)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===W)return"<...>";try{var g=r(p);return g?"<"+g+">":"<...>"}catch{return"<...>"}}function s(){var p=j.A;return p===null?null:p.getOwner()}function a(){return Error("react-stack-top-frame")}function i(p){if(M.call(p,"key")){var g=Object.getOwnPropertyDescriptor(p,"key").get;if(g&&g.isReactWarning)return!1}return p.key!==void 0}function o(p,g){function T(){q||(q=!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)",g))}T.isReactWarning=!0,Object.defineProperty(p,"key",{get:T,configurable:!0})}function c(){var p=r(this.type);return K[p]||(K[p]=!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.")),p=this.props.ref,p!==void 0?p:null}function l(p,g,T,C,O,A,V,Y){return T=A.ref,p={$$typeof:m,type:p,key:g,props:A,_owner:O},(T!==void 0?T:null)!==null?Object.defineProperty(p,"ref",{enumerable:!1,get:c}):Object.defineProperty(p,"ref",{enumerable:!1,value:null}),p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(p,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(p,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:V}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function u(p,g,T,C,O,A,V,Y){var F=g.children;if(F!==void 0)if(C)if(N(F)){for(C=0;C<F.length;C++)f(F[C]);Object.freeze&&Object.freeze(F)}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 f(F);if(M.call(g,"key")){F=r(p);var J=Object.keys(g).filter(function(ne){return ne!=="key"});C=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",_[F+C]||(J=0<J.length?"{"+J.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props}
|
|
22
|
+
<%s key={someKey} {...props} />`,C,F,J,F),_[F+C]=!0)}if(F=null,T!==void 0&&(t(T),F=""+T),i(g)&&(t(g.key),F=""+g.key),"key"in g){T={};for(var G in g)G!=="key"&&(T[G]=g[G])}else T=g;return F&&o(T,typeof p=="function"?p.displayName||p.name||"Unknown":p),l(p,F,A,O,s(),T,V,Y)}function f(p){typeof p=="object"&&p!==null&&p.$$typeof===m&&p._store&&(p._store.validated=1)}var d=L,m=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),D=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),P=Symbol.for("react.client.reference"),j=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,N=Array.isArray,B=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(p){return p()}};var q,K={},Z=d["react-stack-bottom-frame"].bind(d,a)(),H=B(n(a)),_={};je.Fragment=y,je.jsx=function(p,g,T,C,O){var A=1e4>j.recentlyCreatedOwnerStacks++;return u(p,g,T,!1,C,O,A?Error("react-stack-top-frame"):Z,A?B(n(p)):H)},je.jsxs=function(p,g,T,C,O){var A=1e4>j.recentlyCreatedOwnerStacks++;return u(p,g,T,!0,C,O,A?Error("react-stack-top-frame"):Z,A?B(n(p)):H)}}()),je}var Ot;function _r(){return Ot||(Ot=1,process.env.NODE_ENV==="production"?_e.exports=Ar():_e.exports=Lr()),_e.exports}var b=_r();const et={"smp-table":"_smp-table_8dmh0_1","smp-headerCell":"_smp-headerCell_8dmh0_35","smp-resizer":"_smp-resizer_8dmh0_44"},kr="_rowContent_gazwe_13",Ir="_clickable_gazwe_42",Nr="_indent_gazwe_47",Mr="_toggle_gazwe_53",Fr="_rowLabel_gazwe_69",Vr="_cell_gazwe_78",Yr="_leftSection_gazwe_86",be={rowContent:kr,clickable:Ir,indent:Nr,toggle:Mr,rowLabel:Fr,cell:Vr,leftSection:Yr};function Ye(r){return!!r&&"children"in r}function Ur(r){return!Ye(r)}function Wr(r){return JSON.stringify(r).split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0).toString()}const ie={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",ICON:"ICO",IMAGE:"IMG",MULTI_AUTOCOMPLETE:"AML",SPOTLIGHT:"SPL",TEXT_FIELD:"ITX",PASSWORD:"PWD"},Hr=r=>r.t=="D8",Br=r=>{if(r){const e=r.split(";");if(e.length==3)return{t:e[0],p:e[1],k:e[2]}}return{t:"",p:"",k:""}};class We{constructor(e,t){ve(this,"class");ve(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new We(e,e.k=="1"||e.k=="true")}getValue(){return this.value}getLegacyValue(){if(this.class.t=="V2"){if(this.class.p=="SI/NO")return this.value?"1":" ";if(this.class.p=="ON/OFF")return this.value?"1":"0"}return this.value?"true":"false"}}function Gr(r,e){if(mt(r)){const u=new Date(r);if(!isNaN(u.getTime()))return u}const t=new Date,n=r.replaceAll("/","").replaceAll("-","");let s="DDMMYYYY";e==="en"&&(s="MMDDYYYY");const a=s.indexOf("DD"),i=s.indexOf("MM");let o=0,c=0,l="";switch(n.length){case 1:case 2:return o=parseInt(n),t.setDate(o),ke(t)?t:r;case 3:case 4:return o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),i===0?(t.setMonth(o-1),t.setDate(c)):a===0&&(t.setMonth(c-1),t.setDate(o)),ke(t)?t:r;case 5:case 6:{o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),Number(n.substring(4))>50?l="19"+n.substring(4):l="20"+n.substring(4);let u=0,f=0;return i===0?(u=c,f=o-1,t.setFullYear(parseInt(l),f,u)):a===0&&(u=o,f=c-1,t.setFullYear(parseInt(l),f,u)),ut(o,f,parseInt(l))&&ke(t)?t:r}case 7:case 8:{o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),l=n.substring(4);let u=0,f=0;return i===0?(u=c,f=o-1,t.setFullYear(parseInt(l),f,u)):a===0&&(u=o,f=c-1,t.setFullYear(parseInt(l),f,u)),ut(u,f,parseInt(l))&&ke(t)?t:r}}return r}function mt(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function ke(r){return r instanceof Date&&!isNaN(r.getTime())}function zr(r){if(!/^\d{8}$/.test(r))return!1;const e=parseInt(r.slice(0,4),10),t=parseInt(r.slice(4,6),10),n=parseInt(r.slice(6,8),10);return ut(n,t-1,e)}function ut(r,e,t){const n=[31,Kr(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Kr(r){return r%4===0&&(r%100!==0||r%400===0)}function qr(r){const e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return isNaN(e)||isNaN(Number(t))||isNaN(Number(n))?r.toString():`${e}-${t}-${n}`}class He{constructor(e,t){ve(this,"class");ve(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=Rt.get(`${e.t}${e.p}`);if(t)return new He(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=Rt.get(`${this.class.t}${this.class.p}`);if(e)return e.isoToLegacy(this.date);throw new Error(`Date object not implemented ${this.class.t}${this.class.p}`)}getValue(){return this.date}}const Rt=new Map([["D8*YYMD",{legacyToIso(r){return zr(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return mt(r)&&r.replaceAll("-","")||r}}]]),Be=(r,e)=>{L.useEffect(()=>{const t=n=>{typeof r=="object"&&r!==null&&"current"in r&&r.current&&!r.current.contains(n.target)&&e()};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[r,e])};function gt({position:r="bottom",enabled:e=!0}){const t=L.useRef(null),n=L.useRef(null),[s,a]=L.useState(0),i=L.useCallback(()=>{const o=t.current,c=n.current;if(!o||!c)return;const{top:l,left:u,width:f,height:d}=o.getBoundingClientRect();a(f);const m=c.offsetHeight,h=c.offsetWidth;if(h===0||m===0){requestAnimationFrame(i);return}let y=l+window.scrollY,x=u+window.scrollX;switch(r){case"top":y-=m;break;case"bottom":y+=d;break;case"left":x-=h;break;case"right":x+=f;break}requestAnimationFrame(()=>{c.style.transform=`translate(${x}px, ${y}px)`})},[r]);return L.useLayoutEffect(()=>{e&&t.current&&n.current&&i();const o=new MutationObserver(()=>{n.current&&i()});return n.current&&o.observe(n.current,{childList:!0,subtree:!0}),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),o.disconnect()}},[i,e]),{anchorRef:t,targetRef:n,anchorWidth:s}}const Ge=(r,e,t)=>{if(t)switch(t){case"CodeOnly":return r;case"DescOnly":return e||"";case"Both":return`${r} - ${e}`}return r},Jr=({helperText:r,disabled:e,state:t})=>{const n={container:`smp-helper-text ${e?"smp-helper-text-disabled":""} ${t?`smp-helper-text-${t}`:""}`};return b.jsx("span",{className:n.container,children:r})},Xe=({label:r,disabled:e})=>{const t={container:`smp-label ${e?"smp-label-disabled":""}`};return b.jsx("span",{className:t.container,children:r})};function Xr(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)!==-1)continue;t[n]=r[n]}return t}function ze(){return ze=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},ze.apply(null,arguments)}function ft(r,e){return ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},ft(r,e)}function Zr(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,ft(r,e)}function tt(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,a;n<s;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}var Ie={};/*!
|
|
23
23
|
* content-type
|
|
24
24
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
25
25
|
* MIT Licensed
|
|
26
|
-
*/var
|
|
26
|
+
*/var Dt;function Qr(){if(Dt)return Ie;Dt=1;var r=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,e=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,t=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,n=/\\([\u000b\u0020-\u00ff])/g,s=/([\\"])/g,a=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;Ie.format=i,Ie.parse=o;function i(f){if(!f||typeof f!="object")throw new TypeError("argument obj is required");var d=f.parameters,m=f.type;if(!m||!a.test(m))throw new TypeError("invalid type");var h=m;if(d&&typeof d=="object")for(var y,x=Object.keys(d).sort(),w=0;w<x.length;w++){if(y=x[w],!t.test(y))throw new TypeError("invalid parameter name");h+="; "+y+"="+l(d[y])}return h}function o(f){if(!f)throw new TypeError("argument string is required");var d=typeof f=="object"?c(f):f;if(typeof d!="string")throw new TypeError("argument string is required to be a string");var m=d.indexOf(";"),h=m!==-1?d.slice(0,m).trim():d.trim();if(!a.test(h))throw new TypeError("invalid media type");var y=new u(h.toLowerCase());if(m!==-1){var x,w,E;for(r.lastIndex=m;w=r.exec(d);){if(w.index!==m)throw new TypeError("invalid parameter format");m+=w[0].length,x=w[1].toLowerCase(),E=w[2],E.charCodeAt(0)===34&&(E=E.slice(1,-1),E.indexOf("\\")!==-1&&(E=E.replace(n,"$1"))),y.parameters[x]=E}if(m!==d.length)throw new TypeError("invalid parameter format")}return y}function c(f){var d;if(typeof f.getHeader=="function"?d=f.getHeader("content-type"):typeof f.headers=="object"&&(d=f.headers&&f.headers["content-type"]),typeof d!="string")throw new TypeError("content-type header is missing from object");return d}function l(f){var d=String(f);if(t.test(d))return d;if(d.length>0&&!e.test(d))throw new TypeError("invalid parameter value");return'"'+d.replace(s,"\\$1")+'"'}function u(f){this.parameters=Object.create(null),this.type=f}return Ie}var en=Qr(),Te=new Map,ur=function(e){return e.cloneNode(!0)},jt=function(){return window.location.protocol==="file:"},fr=function(e,t,n){var s=new XMLHttpRequest;s.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&s.readyState===2){var a=s.getResponseHeader("Content-Type");if(!a)throw new Error("Content type not found");var i=en.parse(a).type;if(!(i==="image/svg+xml"||i==="text/plain"))throw new Error("Invalid content type: ".concat(i))}if(s.readyState===4){if(s.status===404||s.responseXML===null)throw new Error(jt()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(s.status===200||jt()&&s.status===0)n(null,s);else throw new Error("There was a problem injecting the SVG: "+s.status+" "+s.statusText)}}catch(o){if(s.abort(),o instanceof Error)n(o,s);else throw o}},s.open("GET",e),s.withCredentials=t,s.overrideMimeType&&s.overrideMimeType("text/xml"),s.send()},ye={},Ct=function(e,t){ye[e]=ye[e]||[],ye[e].push(t)},tn=function(e){for(var t=function(i,o){setTimeout(function(){if(Array.isArray(ye[e])){var c=Te.get(e),l=ye[e][i];c instanceof SVGSVGElement&&l(null,ur(c)),c instanceof Error&&l(c),i===ye[e].length-1&&delete ye[e]}},0)},n=0,s=ye[e].length;n<s;n++)t(n)},rn=function(e,t,n){if(Te.has(e)){var s=Te.get(e);if(s===void 0){Ct(e,n);return}if(s instanceof SVGSVGElement){n(null,ur(s));return}}Te.set(e,void 0),Ct(e,n),fr(e,t,function(a,i){var o;a?Te.set(e,a):((o=i.responseXML)===null||o===void 0?void 0:o.documentElement)instanceof SVGSVGElement&&Te.set(e,i.responseXML.documentElement),tn(e)})},nn=function(e,t,n){fr(e,t,function(s,a){var i;s?n(s):((i=a.responseXML)===null||i===void 0?void 0:i.documentElement)instanceof SVGSVGElement&&n(null,a.responseXML.documentElement)})},sn=0,an=function(){return++sn},he=[],$t={},on="http://www.w3.org/2000/svg",rt="http://www.w3.org/1999/xlink",Pt=function(e,t,n,s,a,i,o){var c=e.getAttribute("data-src")||e.getAttribute("src");if(!c){o(new Error("Invalid data-src or src attribute"));return}if(he.indexOf(e)!==-1){he.splice(he.indexOf(e),1),e=null;return}he.push(e),e.setAttribute("src","");var l=s?rn:nn;l(c,a,function(u,f){if(!f){he.splice(he.indexOf(e),1),e=null,o(u);return}var d=e.getAttribute("id");d&&f.setAttribute("id",d);var m=e.getAttribute("title");m&&f.setAttribute("title",m);var h=e.getAttribute("width");h&&f.setAttribute("width",h);var y=e.getAttribute("height");y&&f.setAttribute("height",y);var x=Array.from(new Set(tt(tt(tt([],(f.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();f.setAttribute("class",x);var w=e.getAttribute("style");w&&f.setAttribute("style",w),f.setAttribute("data-src",c);var E=[].filter.call(e.attributes,function(H){return/^data-\w[\w-]*$/.test(H.name)});if(Array.prototype.forEach.call(E,function(H){H.name&&H.value&&f.setAttribute(H.name,H.value)}),n){var D={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]},S,v,I,$,W;Object.keys(D).forEach(function(H){S=H,I=D[H],v=f.querySelectorAll(S+"[id]");for(var _=function(C,O){$=v[C].id,W=$+"-"+an();var A;Array.prototype.forEach.call(I,function(U){A=f.querySelectorAll("["+U+'*="'+$+'"]');for(var X=0,te=A.length;X<te;X++){var re=A[X].getAttribute(U);re&&!re.match(new RegExp('url\\("?#'+$+'"?\\)'))||A[X].setAttribute(U,"url(#"+W+")")}});for(var V=f.querySelectorAll("[*|href]"),Y=[],F=0,J=V.length;F<J;F++){var G=V[F].getAttributeNS(rt,"href");G&&G.toString()==="#"+v[C].id&&Y.push(V[F])}for(var ne=0,k=Y.length;ne<k;ne++)Y[ne].setAttributeNS(rt,"href","#"+W);v[C].id=W},p=0,g=v.length;p<g;p++)_(p)})}f.removeAttribute("xmlns:a");for(var R=f.querySelectorAll("script"),P=[],j,M,N=0,B=R.length;N<B;N++)M=R[N].getAttribute("type"),(!M||M==="application/ecmascript"||M==="application/javascript"||M==="text/javascript")&&(j=R[N].innerText||R[N].textContent,j&&P.push(j),f.removeChild(R[N]));if(P.length>0&&(t==="always"||t==="once"&&!$t[c])){for(var q=0,K=P.length;q<K;q++)new Function(P[q])(window);$t[c]=!0}var Z=f.querySelectorAll("style");if(Array.prototype.forEach.call(Z,function(H){H.textContent+=""}),f.setAttribute("xmlns",on),f.setAttribute("xmlns:xlink",rt),i(f),!e.parentNode){he.splice(he.indexOf(e),1),e=null,o(new Error("Parent node is null"));return}e.parentNode.replaceChild(f,e),he.splice(he.indexOf(e),1),e=null,o(null,f)})},ln=function(e,t){var n=t===void 0?{}:t,s=n.afterAll,a=s===void 0?function(){}:s,i=n.afterEach,o=i===void 0?function(){}:i,c=n.beforeEach,l=c===void 0?function(){}:c,u=n.cacheRequests,f=u===void 0?!0:u,d=n.evalScripts,m=d===void 0?"never":d,h=n.httpRequestWithCredentials,y=h===void 0?!1:h,x=n.renumerateIRIElements,w=x===void 0?!0:x;if(e&&"length"in e)for(var E=0,D=0,S=e.length;D<S;D++)Pt(e[D],m,w,f,y,l,function(v,I){o(v,I),e&&"length"in e&&e.length===++E&&a(E)});else e?Pt(e,m,w,f,y,l,function(v,I){o(v,I),a(1),e=null}):a(0)},Ne={exports:{}},Me={exports:{}},Q={};/** @license React v16.13.1
|
|
27
27
|
* react-is.production.min.js
|
|
28
28
|
*
|
|
29
29
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
33
|
+
*/var At;function cn(){if(At)return Q;At=1;var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.concurrent_mode"):60111,u=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,x=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function D(v){if(typeof v=="object"&&v!==null){var I=v.$$typeof;switch(I){case e:switch(v=v.type,v){case c:case l:case n:case a:case s:case f:return v;default:switch(v=v&&v.$$typeof,v){case o:case u:case h:case m:case i:return v;default:return I}}case t:return I}}}function S(v){return D(v)===l}return Q.AsyncMode=c,Q.ConcurrentMode=l,Q.ContextConsumer=o,Q.ContextProvider=i,Q.Element=e,Q.ForwardRef=u,Q.Fragment=n,Q.Lazy=h,Q.Memo=m,Q.Portal=t,Q.Profiler=a,Q.StrictMode=s,Q.Suspense=f,Q.isAsyncMode=function(v){return S(v)||D(v)===c},Q.isConcurrentMode=S,Q.isContextConsumer=function(v){return D(v)===o},Q.isContextProvider=function(v){return D(v)===i},Q.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},Q.isForwardRef=function(v){return D(v)===u},Q.isFragment=function(v){return D(v)===n},Q.isLazy=function(v){return D(v)===h},Q.isMemo=function(v){return D(v)===m},Q.isPortal=function(v){return D(v)===t},Q.isProfiler=function(v){return D(v)===a},Q.isStrictMode=function(v){return D(v)===s},Q.isSuspense=function(v){return D(v)===f},Q.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===n||v===l||v===a||v===s||v===f||v===d||typeof v=="object"&&v!==null&&(v.$$typeof===h||v.$$typeof===m||v.$$typeof===i||v.$$typeof===o||v.$$typeof===u||v.$$typeof===x||v.$$typeof===w||v.$$typeof===E||v.$$typeof===y)},Q.typeOf=D,Q}var ee={};/** @license React v16.13.1
|
|
34
34
|
* react-is.development.js
|
|
35
35
|
*
|
|
36
36
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
37
37
|
*
|
|
38
38
|
* This source code is licensed under the MIT license found in the
|
|
39
39
|
* LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/var
|
|
40
|
+
*/var Lt;function un(){return Lt||(Lt=1,process.env.NODE_ENV!=="production"&&function(){var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.concurrent_mode"):60111,u=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,x=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function D(k){return typeof k=="string"||typeof k=="function"||k===n||k===l||k===a||k===s||k===f||k===d||typeof k=="object"&&k!==null&&(k.$$typeof===h||k.$$typeof===m||k.$$typeof===i||k.$$typeof===o||k.$$typeof===u||k.$$typeof===x||k.$$typeof===w||k.$$typeof===E||k.$$typeof===y)}function S(k){if(typeof k=="object"&&k!==null){var U=k.$$typeof;switch(U){case e:var X=k.type;switch(X){case c:case l:case n:case a:case s:case f:return X;default:var te=X&&X.$$typeof;switch(te){case o:case u:case h:case m:case i:return te;default:return U}}case t:return U}}}var v=c,I=l,$=o,W=i,R=e,P=u,j=n,M=h,N=m,B=t,q=a,K=s,Z=f,H=!1;function _(k){return H||(H=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),p(k)||S(k)===c}function p(k){return S(k)===l}function g(k){return S(k)===o}function T(k){return S(k)===i}function C(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function O(k){return S(k)===u}function A(k){return S(k)===n}function V(k){return S(k)===h}function Y(k){return S(k)===m}function F(k){return S(k)===t}function J(k){return S(k)===a}function G(k){return S(k)===s}function ne(k){return S(k)===f}ee.AsyncMode=v,ee.ConcurrentMode=I,ee.ContextConsumer=$,ee.ContextProvider=W,ee.Element=R,ee.ForwardRef=P,ee.Fragment=j,ee.Lazy=M,ee.Memo=N,ee.Portal=B,ee.Profiler=q,ee.StrictMode=K,ee.Suspense=Z,ee.isAsyncMode=_,ee.isConcurrentMode=p,ee.isContextConsumer=g,ee.isContextProvider=T,ee.isElement=C,ee.isForwardRef=O,ee.isFragment=A,ee.isLazy=V,ee.isMemo=Y,ee.isPortal=F,ee.isProfiler=J,ee.isStrictMode=G,ee.isSuspense=ne,ee.isValidElementType=D,ee.typeOf=S}()),ee}var _t;function dr(){return _t||(_t=1,process.env.NODE_ENV==="production"?Me.exports=cn():Me.exports=un()),Me.exports}/*
|
|
41
41
|
object-assign
|
|
42
42
|
(c) Sindre Sorhus
|
|
43
43
|
@license MIT
|
|
44
|
-
*/var
|
|
45
|
-
Valid keys: `+JSON.stringify(Object.keys(p),null," "));var L=ne(Y,G,O,P,V+"."+G,t);if(L)return L}return null}return x(g)}function B(p){switch(typeof p){case"number":case"string":case"undefined":return!0;case"boolean":return!p;case"object":if(Array.isArray(p))return p.every(B);if(p===null||o(p))return!0;var g=u(p);if(g){var T=g.call(p),$;if(g!==p.entries){for(;!($=T.next()).done;)if(!B($.value))return!1}else for(;!($=T.next()).done;){var O=$.value;if(O&&!B(O[1]))return!1}}else return!1;return!0;default:return!1}}function J(p,g){return p==="symbol"?!0:g?g["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&g instanceof Symbol:!1}function K(p){var g=typeof p;return Array.isArray(p)?"array":p instanceof RegExp?"object":J(g,p)?"symbol":g}function H(p){if(typeof p>"u"||p===null)return""+p;var g=K(p);if(g==="object"){if(p instanceof Date)return"date";if(p instanceof RegExp)return"regexp"}return g}function q(p){var g=H(p);switch(g){case"array":case"object":return"an "+g;case"boolean":case"date":case"regexp":return"a "+g;default:return g}}function I(p){return!p.constructor||!p.constructor.name?d:p.constructor.name}return h.checkPropTypes=s,h.resetWarningCache=s.resetWarningCache,h.PropTypes=h,h},it}var ot,Ft;function hn(){if(Ft)return ot;Ft=1;var r=gt();function e(){}function t(){}return t.resetWarningCache=e,ot=function(){function n(i,o,c,l,f,u){if(u!==r){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}n.isRequired=n;function s(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:e};return a.PropTypes=a,a},ot}var Vt;function mn(){if(Vt)return Ne.exports;if(Vt=1,process.env.NODE_ENV!=="production"){var r=dr(),e=!0;Ne.exports=pn()(r.isElement,e)}else Ne.exports=hn()();return Ne.exports}var ae=mn(),gn=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},yn=function(e,t){for(var n in e)if(!(n in t))return!0;for(var s in t)if(e[s]!==t[s])return!0;return!1},vn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Fe="http://www.w3.org/2000/svg",Yt="http://www.w3.org/1999/xlink",Oe=function(r){function e(){for(var n,s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return n=r.call.apply(r,[this].concat(a))||this,n.initialState={hasError:!1,isLoading:!0},n.state=n.initialState,n._isMounted=!1,n.reactWrapper=void 0,n.nonReactWrapper=void 0,n.refCallback=function(o){n.reactWrapper=o},n}Zr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof gn(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,c=a.httpRequestWithCredentials,l=a.renumerateIRIElements,f=a.src,u=a.title,d=a.useRequestCache,h=this.props.onError,m=this.props.beforeInjection,y=this.props.afterInjection,x=this.props.wrapper,w,E;x==="svg"?(w=document.createElementNS(Fe,x),w.setAttribute("xmlns",Fe),w.setAttribute("xmlns:xlink",Yt),E=document.createElementNS(Fe,x)):(w=document.createElement(x),E=document.createElement(x)),w.appendChild(E),E.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(w);var D=function(k){if(s.removeSVG(),!s._isMounted){h(k);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){h(k)})},S=function(k,W){if(k){D(k);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{y(W)}catch(R){D(R)}})},v=function(k){if(k.setAttribute("role","img"),i){var W=k.querySelector(":scope > desc");W&&k.removeChild(W);var R=document.createElement("desc");R.innerHTML=i,k.prepend(R)}if(u){var j=k.querySelector(":scope > title");j&&k.removeChild(j);var _=document.createElement("title");_.innerHTML=u,k.prepend(_)}try{m(k)}catch(N){D(N)}};ln(E,{afterEach:S,beforeEach:v,cacheRequests:d,evalScripts:o,httpRequestWithCredentials:c,renumerateIRIElements:l})}},t.removeSVG=function(){var s;(s=this.nonReactWrapper)!=null&&s.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},t.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},t.componentDidUpdate=function(s){var a=this;yn(ze({},s),this.props)&&this.setState(function(){return a.initialState},function(){a.removeSVG(),a.renderSVG()})},t.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},t.render=function(){var s=this.props;s.afterInjection,s.beforeInjection,s.desc,s.evalScripts;var a=s.fallback;s.httpRequestWithCredentials;var i=s.loading;s.renumerateIRIElements,s.src,s.title,s.useRequestCache;var o=s.wrapper,c=Xr(s,vn),l=o;return Le.createElement(l,ze({},c,{ref:this.refCallback},o==="svg"?{xmlns:Fe,xmlnsXlink:Yt}:{}),this.state.isLoading&&i&&Le.createElement(i,null),this.state.hasError&&a&&Le.createElement(a,null))},e}(Le.Component);Oe.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Oe.propTypes={afterInjection:ae.func,beforeInjection:ae.func,desc:ae.string,evalScripts:ae.oneOf(["always","once","never"]),fallback:ae.oneOfType([ae.func,ae.object,ae.string]),httpRequestWithCredentials:ae.bool,loading:ae.oneOfType([ae.func,ae.object,ae.string]),onError:ae.func,renumerateIRIElements:ae.bool,src:ae.string.isRequired,title:ae.string,useRequestCache:ae.bool,wrapper:ae.oneOf(["div","span","svg"])};let ft={assets:"/"};const bn=r=>{ft={...ft,...r}},Ut=r=>`${ft.assets}/${r}`.replace(/\/+/g,"/"),le=A.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:c,isInteractable:l=!1,spin:f=!1,title:u})=>{const[d,h]=A.useState(r),m=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),y=m&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),x=Ut(`assets/svg/${r}.svg`),w=Ut(`assets/svg/${n}.svg`),E={img:`${l?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${l?"smp-icon-interactable":""} ${f?"smp-icon-spin":""}`},D=()=>{!a&&c&&c()};return b.jsx(b.Fragment,{children:y?b.jsx(Oe,{src:r,fallback:()=>b.jsx(Oe,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:E.svg,onClick:D}):m?b.jsx("img",{src:d,width:e||"16px",height:t||"auto",alt:u,onError:()=>h(w),onClick:D,className:E.img,title:u,onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&D()}}):b.jsx(Oe,{src:x,fallback:()=>b.jsx(Oe,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:E.svg,onClick:D})})}),Se=({disabled:r,readOnly:e,bindValue:t,icon:n,onBlur:s,onChange:a,placeholder:i,shapeIcon:o,sizing:c,state:l,variant:f,rotatedShapeIcon:u=!1,onShapeIconClick:d,ref:h,inputRef:m,onKeyDown:y,inputType:x="text",ariaLabel:w="input field",label:E,helperText:D=!1,error:S,appearance:v="base",fullWidth:C=!1,_dataComponent:k="textfield",width:W})=>{const R=S?"danger":l,j=S||l=="danger"?"error":o,_=D||!!S,N=J=>{a==null||a(J.target.value)},F={wrapper:`smp-textfield-wrapper ${C?"smp-textfield-fullWidth":""}`,container:`smp-textfield ${r?"smp-textfield-disabled":""} ${e?"smp-textfield-readOnly":""} ${i?"smp-textfield-placeholder":""} ${c?`smp-textfield-${c}`:""} ${R?`smp-textfield-${R}`:""} ${f?`smp-textfield-variant-${f}`:""} ${v?`smp-textfield-${v}`:""}`,input:"smp-textfield-input "},B=W?{"--smp-textField-width-base":W}:void 0;return b.jsxs("div",{className:F.wrapper,"data-component":k,children:[E&&b.jsx(cr,{label:E,disabled:r}),b.jsxs("div",{className:F.container,ref:h,style:B,children:[n&&b.jsx(le,{icon:n,disabled:r}),b.jsx("input",{type:x,value:t,placeholder:i,onChange:N,onBlur:s,className:F.input,disabled:r,readOnly:e,onKeyDown:y,"aria-label":w,ref:m}),j&&b.jsx(le,{icon:j,disabled:r,state:R,onClick:d,rotated:u})]}),_&&b.jsx(Jr,{helperText:S,disabled:r,state:R})]})};function hr({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=A.useState(0),i=A.useRef(null),o=r.length*e,c=Math.max(0,Math.floor(s/e)-n),l=Math.min(r.length-1,Math.floor((s+t)/e)+n),f=[];for(let h=c;h<=l;h++)f.push({item:r[h],index:h,offsetTop:h*e});const u=A.useCallback(h=>{const m=h.target.scrollTop;a(m)},[]),d=h=>{if(!i.current)return;const m=h*e,y=m+e,x=i.current,w=x.scrollTop,E=w+t;m<w?x.scrollTop=m:y>E&&(x.scrollTop=y-t)};return{virtualItems:f,containerProps:{ref:i,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:u},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:o,startIndex:c,endIndex:l},scrollToIndex:d}}const xn=10,mr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:c,onKeyDown:l})=>{var j;const[f,u]=A.useState(""),d=24,[h,m]=A.useState(a!==null?a:-1),y=s!==void 0?s:e.length>xn,x=f?e.filter(_=>_.label.toLowerCase().includes(f.toLowerCase())):e,w=_=>{u(_)},{virtualItems:E,containerProps:D,innerProps:S,scrollToIndex:v}=hr({items:x,itemHeight:d,containerHeight:200,overscan:5});A.useEffect(()=>{a!==null&&a!==h&&m(a)},[a]),A.useEffect(()=>{h>=0&&h<x.length&&v(h)},[h,x]);const C=_=>{if(_.key==="ArrowDown"||_.key==="ArrowUp"){_.preventDefault();let N=h;_.key==="ArrowDown"?N=h<x.length-1?h+1:0:_.key==="ArrowUp"&&(N=h>0?h-1:x.length-1),m(N)}else _.key==="Enter"?h>=0&&h<x.length&&(c==null||c(x[h])):_.key==="Escape"&&(_.preventDefault(),_.stopPropagation());l&&l(_)},k=_=>{C(_)},W=_=>{C(_)},R={wrapper:"smp-list",container:"smp-list-container",virtualScroll:"smp-list-virtualScroll",listItem:"smp-list-listItem"};return b.jsxs("div",{id:r,ref:n,className:R.wrapper,"data-component":"list",style:{width:o},children:[y&&b.jsx(Se,{bindValue:f,placeholder:"Search...",onChange:w,onKeyDown:k}),b.jsx("div",{...D,className:R.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:W,"aria-activedescendant":h>=0&&h<x.length?(j=x[h])==null?void 0:j.id:void 0,children:b.jsx("div",{...S,className:R.virtualScroll,children:E.map(({item:_,index:N,offsetTop:F})=>{const B=i.includes(_.id);return b.jsxs("li",{role:"option",id:_.id,"aria-selected":h===N?"true":"false",tabIndex:-1,className:`${R.listItem} ${h===N?"selected-item":""}`,"aria-label":_.id+"-"+_.label,style:{height:`${d}px`,lineHeight:`calc(${d}px - 2*2px)`,transform:`translateY(${F}px)`},onClick:()=>{c==null||c(_),m(N)},children:[Ge(_.id,_.label,t),B&&b.jsx(le,{icon:"check",width:16})]},_.id)})})})]})},gr=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=A.useState(Ge(e,t,r));return A.useEffect(()=>{a(e)},[e]),A.useEffect(()=>{a(Ge(e,t,r))},[t,r]),b.jsx(Se,{...n,bindValue:s})},Sn=r=>{const e=A.useRef(null);return A.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}},yt=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,placeholder:i,fun:o,_changeOnEnter:c=!1,onChange:l,onOptionsRequest:f,_multiActiveIndex:u,...d})=>{const[h,m]=A.useState(r),[y,x]=A.useState(e),[w,E]=A.useState(!1),[D,S]=A.useState(t||[]),[v,C]=A.useState(0),[k,W]=A.useState([r]),{anchorRef:R,targetRef:j,anchorWidth:_}=mt({position:"bottom",enabled:w});Be(j,()=>E(!1));const N=Sn(400),F=H=>{H.length>=a?o&&f&&N(async()=>{const q=await f(o,H);S(q),C(q.length>0?0:-1),E(!0)}):E(!1),m(H),x(e),c||l==null||l(H,e)},B=H=>{c?(m(""),x("")):(m(H.id),x(H.label)),l==null||l(H.id,H.label);const q=D.findIndex(I=>I.id===H.id);C(q),W([H.id]),E(!1)},J=H=>{H.key==="Escape"&&(E(!1),C(-1))},K=H=>{if((H.key==="ArrowDown"||H.key==="ArrowUp")&&(H.preventDefault(),w)){const q=H.key==="ArrowDown"?(v+1)%D.length:(v-1+D.length)%D.length;C(q)}switch(H.key){case"Enter":v>=0&&v<D.length?B(D[v]):c&&(l==null||l(h,""),E(!1),m(""),x(""));break;case"Escape":E(!1),C(-1);break}};return b.jsxs("div",{"data-component":"autocomplete",children:[b.jsx(gr,{...d,bindValue:h,optionalDisplayValue:y,displayMode:n,shapeIcon:"magnify",placeholder:i,ref:R,onChange:F,onKeyDown:K,"aria-autocomplete":"list"}),w&&b.jsx(mr,{options:D,displayMode:s,onClick:B,ref:j,selectedIndex:v,activeIndex:u||k,width:_,showFilter:!1,onKeyDown:J})]})},Wt=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],Ht=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],Re=({label:r,onClick:e,ariaLabel:t,icon:n,disabled:s,sizing:a="base",variant:i="primary",appearance:o="raised",showIcon:c=!0,showText:l=!0,fullWidth:f=!1,loading:u=!1,justify:d="center",title:h,optionalDisplayValue:m})=>{const y={container:`smp-button smp-button-container ${a?`smp-button-${a}`:""} ${i?`smp-buttonVariant-${i}`:""} ${o?`smp-buttonType-${o}`:""} ${f?"smp-button-fullWidth":""} smp-justifyContent-${d}`};return b.jsx("button",{"data-component":"button",className:y.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":u,title:h||r||m,children:u?b.jsx(le,{icon:"spinner",state:Ht(i),spin:!0}):b.jsxs(b.Fragment,{children:[n&&c&&b.jsx(le,{icon:n,disabled:s,state:Ht(i),width:Wt(a),height:Wt(a)}),l&&m&&b.jsx("span",{children:m})]})})},yr=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:f,justify:u,onClick:d,onOptionsRequest:h})=>{const[m,y]=A.useState(r);A.useEffect(()=>{!m&&h&&e&&h(e,void 0).then(E=>y(E)).catch(E=>{console.error("Errore nel caricamento delle opzioni per ButtonList",E)})},[m,e,h]);const x={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},w=m==null?void 0:m.map((E,D)=>{const S={bindValue:E.id,optionalDisplayValue:E.label,fun:E.fun,icon:E.icon,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:f,sizing:s,justify:u,onClick:()=>{d==null||d(E.id,E.fun)}};return b.jsx(Re,{...S},`button-${D}`)});return b.jsx("div",{role:"list","data-component":"button-list",className:x.container,children:w})},vr=({bindValue:r,onChange:e,onBlur:t})=>{const n=s=>{e&&e(s.target.checked)};return b.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:n,onBlur:t})},wn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},vt=({variant:r="body",bindValue:e,color:t,...n})=>{const s=wn[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return b.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},bt=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,c]=A.useState(null),l={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=h=>{n==null||n(r.filter((m,y)=>y!==h))},u=h=>{c(h)},d=h=>{if(o===null||o===h)return;const m=[...r],[y]=m.splice(o,1);m.splice(h,0,y),n==null||n(m),c(null)};return b.jsx("div",{className:l.container,role:"list","data-component":"chip",children:r.flatMap((h,m)=>{const y=Ge(h.bindValue,h.optionalDisplayValue,t),x=b.jsxs("div",{className:l.element,role:"listitem",draggable:i,onDragStart:()=>u(m),onDragOver:E=>i&&E.preventDefault(),onDrop:()=>i&&d(m),style:{"--smp-chips-backgroundColor-base":a},children:[i&&b.jsx(le,{icon:"drag_indicator_horizontal",isInteractable:!0}),b.jsx(vt,{variant:"label",bindValue:y,color:s}),e&&b.jsx(le,{icon:"close",isInteractable:!0,onClick:()=>f(m),color:s})]},`chip-${m}`),w=i&&m<r.length-1?b.jsx(le,{icon:"chevron-right",color:s},`separator-${m}`):null;return[x,w].filter(Boolean)})})};function br(r,e){const t=A.useRef(null);A.useEffect(()=>{if(!r)return;const n=typeof e=="object"&&e!==null&&"current"in e?e.current:null;if(!n)return;t.current=document.activeElement;const s=()=>n?Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(l=>!l.hasAttribute("disabled")&&l.offsetParent!==null):[];(()=>{const l=s();l.length>0&&requestAnimationFrame(()=>l[0].focus())})();const i=l=>{if(l.key==="Escape"||l.key!=="Tab")return;const f=s();if(f.length===0)return;const u=f[0],d=f[f.length-1];l.shiftKey&&document.activeElement===u?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),u.focus())},o=l=>{if(n&&!n.contains(l.target)){l.preventDefault();const f=s();f.length>0&&f[0].focus()}};document.addEventListener("keydown",i),document.addEventListener("mousedown",o);const c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=c,t.current&&requestAnimationFrame(()=>{var l;(l=t.current)==null||l.focus()})}},[r,e])}const xr=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,displayMode:s,listDisplayMode:a="Both",fun:i,onOptionsRequest:o,multiActiveIndex:c,...l})=>{const[f,u]=A.useState(!1),[d,h]=A.useState(t),[m,y]=A.useState(-1),[x,w]=A.useState([r]),E=A.useId(),{anchorRef:D,targetRef:S,anchorWidth:v}=mt({position:"bottom",enabled:f});Be(S,()=>u(!1)),br(f,S);const C=j=>{e==null||e(j.id,j.label);const _=d.findIndex(N=>N.id===j.id);y(_),w([j.id]),u(!1)},k=j=>{j.key==="Escape"&&(u(!1),y(-1))},W=j=>{(j.key==="ArrowDown"||j.key==="ArrowUp")&&(j.preventDefault(),R())},R=()=>{i&&o&&o(i,void 0).then(j=>{h(j),y(j.length>0?0:-1),u(!0)})};return b.jsxs("div",{role:"combobox","aria-expanded":f,"aria-controls":E,"aria-owns":E,"data-component":"combobox",children:[b.jsx(gr,{...l,bindValue:r,optionalDisplayValue:n,displayMode:s,onShapeIconClick:R,onKeyDown:W,shapeIcon:"arrow_drop_down",rotatedShapeIcon:f,readOnly:!0,ref:D,"aria-autocomplete":"list",variant:"notSelectable"}),f&&b.jsx(mr,{id:E,options:d,displayMode:a,ref:S,selectedIndex:m,activeIndex:c||x,width:v,onClick:C,onKeyDown:k})]})},z=r=>typeof r=="string",Ce=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},Bt=r=>r==null?"":""+r,En=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},Tn=/###/g,Gt=r=>r&&r.indexOf("###")>-1?r.replace(Tn,"."):r,zt=r=>!r||z(r),$e=(r,e,t)=>{const n=z(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(zt(r))return{};const a=Gt(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return zt(r)?{}:{obj:r,k:Gt(n[s])}},Kt=(r,e,t)=>{const{obj:n,k:s}=$e(r,e,Object);if(n!==void 0||e.length===1){n[s]=t;return}let a=e[e.length-1],i=e.slice(0,e.length-1),o=$e(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=$e(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},On=(r,e,t,n)=>{const{obj:s,k:a}=$e(r,e,Object);s[a]=s[a]||[],s[a].push(t)},Ke=(r,e)=>{const{obj:t,k:n}=$e(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},Rn=(r,e,t)=>{const n=Ke(r,t);return n!==void 0?n:Ke(e,t)},Sr=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?z(r[n])||r[n]instanceof String||z(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):Sr(r[n],e[n],t):r[n]=e[n]);return r},Ee=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Dn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const jn=r=>z(r)?r.replace(/[&<>"'\/]/g,e=>Dn[e]):r;class Cn{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const $n=[" ",",","?","!",";"],Pn=new Cn(20),An=(r,e,t)=>{e=e||"",t=t||"";const n=$n.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=Pn.getRegExp(`(${n.map(i=>i==="?"?"\\?":i).join("|")})`);let a=!s.test(r);if(!a){const i=r.indexOf(t);i>0&&!s.test(r.substring(0,i))&&(a=!0)}return a},dt=(r,e,t=".")=>{if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const n=e.split(t);let s=r;for(let a=0;a<n.length;){if(!s||typeof s!="object")return;let i,o="";for(let c=a;c<n.length;++c)if(c!==a&&(o+=t),o+=n[c],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&c<n.length-1)continue;a+=c-a+1;break}s=i}return s},Pe=r=>r==null?void 0:r.replace("_","-"),Ln={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){var t,n;(n=(t=console==null?void 0:console[r])==null?void 0:t.apply)==null||n.call(t,console,e)}};class qe{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Ln,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(z(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new qe(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new qe(this.logger,e)}}var me=new qe;class Xe{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const s=this.observers[n].get(t)||0;this.observers[n].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s.apply(s,[e,...t])})}}class qt extends Xe{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,s={}){var l,f;const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,i=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):z(n)&&a?o.push(...n.split(a)):o.push(n)));const c=Ke(this.data,o);return!c&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),c||!i||!z(n)?c:dt((f=(l=this.data)==null?void 0:l[e])==null?void 0:f[t],n,a)}addResource(e,t,n,s,a={silent:!1}){const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),Kt(this.data,o,s),a.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const a in n)(z(n[a])||Array.isArray(n[a]))&&this.addResource(e,t,a,n[a],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,a,i={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),s=n,n=t,t=o[1]),this.addNamespaces(t);let c=Ke(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Sr(c,n,a):c={...c,...n},Kt(this.data,o,c),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var wr={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,n,s){return r.forEach(a=>{var i;e=((i=this.processors[a])==null?void 0:i.process(e,t,n,s))??e}),e}};const Jt={},Xt=r=>!z(r)&&typeof r!="boolean"&&typeof r!="number";class Je extends Xe{constructor(e,t={}){super(),En(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=me.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(e==null)return!1;const s=this.resolve(e,n);return(s==null?void 0:s.res)!==void 0}extractFromKey(e,t){let n=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let a=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!An(e,n,s);if(i&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:z(a)?[a]:a};const l=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(l[0])>-1)&&(a=l.shift()),e=l.join(s)}return{key:e,namespaces:z(a)?[a]:a}}translate(e,t,n){let s=typeof t=="object"?{...t}:t;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(s={...s}),s||(s={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const a=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:o,namespaces:c}=this.extractFromKey(e[e.length-1],s),l=c[c.length-1];let f=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const u=s.lng||this.language,d=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((u==null?void 0:u.toLowerCase())==="cimode")return d?a?{res:`${l}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:`${l}${f}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:o;const h=this.resolve(e,s);let m=h==null?void 0:h.res;const y=(h==null?void 0:h.usedKey)||o,x=(h==null?void 0:h.exactUsedKey)||o,w=["[object Number]","[object Function]","[object RegExp]"],E=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject,S=s.count!==void 0&&!z(s.count),v=Je.hasDefaultValue(s),C=S?this.pluralResolver.getSuffix(u,s.count,s):"",k=s.ordinal&&S?this.pluralResolver.getSuffix(u,s.count,{ordinal:!1}):"",W=S&&!s.ordinal&&s.count===0,R=W&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${C}`]||s[`defaultValue${k}`]||s.defaultValue;let j=m;D&&!m&&v&&(j=R);const _=Xt(j),N=Object.prototype.toString.apply(j);if(D&&j&&_&&w.indexOf(N)<0&&!(z(E)&&Array.isArray(j))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const F=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,j,{...s,ns:c}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(h.res=F,h.usedParams=this.getUsedParamsDetails(s),h):F}if(i){const F=Array.isArray(j),B=F?[]:{},J=F?x:y;for(const K in j)if(Object.prototype.hasOwnProperty.call(j,K)){const H=`${J}${i}${K}`;v&&!m?B[K]=this.translate(H,{...s,defaultValue:Xt(R)?R[K]:void 0,joinArrays:!1,ns:c}):B[K]=this.translate(H,{...s,joinArrays:!1,ns:c}),B[K]===H&&(B[K]=j[K])}m=B}}else if(D&&z(E)&&Array.isArray(m))m=m.join(E),m&&(m=this.extendTranslation(m,e,s,n));else{let F=!1,B=!1;!this.isValidLookup(m)&&v&&(F=!0,m=R),this.isValidLookup(m)||(B=!0,m=o);const K=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&B?void 0:m,H=v&&R!==m&&this.options.updateMissing;if(B||F||H){if(this.logger.log(H?"updateKey":"missingKey",u,l,o,H?R:m),i){const g=this.resolve(o,{...s,keySeparator:!1});g&&g.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let q=[];const I=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&I&&I[0])for(let g=0;g<I.length;g++)q.push(I[g]);else this.options.saveMissingTo==="all"?q=this.languageUtils.toResolveHierarchy(s.lng||this.language):q.push(s.lng||this.language);const p=(g,T,$)=>{var P;const O=v&&$!==m?$:K;this.options.missingKeyHandler?this.options.missingKeyHandler(g,l,T,O,H,s):(P=this.backendConnector)!=null&&P.saveMissing&&this.backendConnector.saveMissing(g,l,T,O,H,s),this.emit("missingKey",g,l,T,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?q.forEach(g=>{const T=this.pluralResolver.getSuffixes(g,s);W&&s[`defaultValue${this.options.pluralSeparator}zero`]&&T.indexOf(`${this.options.pluralSeparator}zero`)<0&&T.push(`${this.options.pluralSeparator}zero`),T.forEach($=>{p([g],o+$,s[`defaultValue${$}`]||R)})}):p(q,o,R))}m=this.extendTranslation(m,e,s,h,n),B&&m===o&&this.options.appendNamespaceToMissingKey&&(m=`${l}${f}${o}`),(B||F)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${f}${o}`:o,F?m:void 0,s))}return a?(h.res=m,h.usedParams=this.getUsedParamsDetails(s),h):m}extendTranslation(e,t,n,s,a){var c,l;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const f=z(e)&&(((l=n==null?void 0:n.interpolation)==null?void 0:l.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(f){const h=e.match(this.interpolator.nestingRegexp);u=h&&h.length}let d=n.replace&&!z(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,n.lng||this.language||s.usedLng,n),f){const h=e.match(this.interpolator.nestingRegexp),m=h&&h.length;u<m&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...h)=>(a==null?void 0:a[0])===h[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${t[0]}`),null):this.translate(...h,t),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,o=z(i)?[i]:i;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=wr.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,a,i,o;return z(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(n))return;const l=this.extractFromKey(c,t),f=l.key;s=f;let u=l.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const d=t.count!==void 0&&!z(t.count),h=d&&!t.ordinal&&t.count===0,m=t.context!==void 0&&(z(t.context)||typeof t.context=="number")&&t.context!=="",y=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(x=>{var w,E;this.isValidLookup(n)||(o=x,!Jt[`${y[0]}-${x}`]&&((w=this.utils)!=null&&w.hasLoadedNamespace)&&!((E=this.utils)!=null&&E.hasLoadedNamespace(o))&&(Jt[`${y[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${y.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(D=>{var C;if(this.isValidLookup(n))return;i=D;const S=[f];if((C=this.i18nFormat)!=null&&C.addLookupKeys)this.i18nFormat.addLookupKeys(S,f,D,x,t);else{let k;d&&(k=this.pluralResolver.getSuffix(D,t.count,t));const W=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(S.push(f+k),t.ordinal&&k.indexOf(R)===0&&S.push(f+k.replace(R,this.options.pluralSeparator)),h&&S.push(f+W)),m){const j=`${f}${this.options.contextSeparator}${t.context}`;S.push(j),d&&(S.push(j+k),t.ordinal&&k.indexOf(R)===0&&S.push(j+k.replace(R,this.options.pluralSeparator)),h&&S.push(j+W))}}let v;for(;v=S.pop();)this.isValidLookup(n)||(a=v,n=this.getResource(D,x,v,t))}))})}),{res:n,usedKey:s,exactUsedKey:a,usedLng:i,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n,s={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!z(e.replace);let s=n?e.replace:e;if(n&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const a of t)delete s[a]}return s}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class Zt{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=me.create("languageUtils")}getScriptPartFromCode(e){if(e=Pe(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Pe(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(z(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(n=>{if(t)return;const s=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(n=>{if(t)return;const s=this.getScriptPartFromCode(n);if(this.isSupportedCode(s))return t=s;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return t=a;t=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&(i.indexOf("-")>0&&a.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===a||i.indexOf(a)===0&&a.length>1))return i})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),z(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),s=[],a=i=>{i&&(this.isSupportedCode(i)?s.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return z(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):z(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const Qt={zero:0,one:1,two:2,few:3,many:4,other:5},er={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class _n{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=me.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Pe(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:s});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let i;try{i=new Intl.PluralRules(n,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),er;if(!e.match(/-|_/))return er;const c=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(c,t)}return this.pluralRulesCache[a]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(s=>`${t}${s}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((s,a)=>Qt[s]-Qt[a]).map(s=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,t,n={}){const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const tr=(r,e,t,n=".",s=!0)=>{let a=Rn(r,e,t);return!a&&s&&z(t)&&(a=dt(r,t,n),a===void 0&&(a=dt(e,t,n))),a},lt=r=>r.replace(/\$/g,"$$$$");class kn{constructor(e={}){var t;this.logger=me.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:a,prefixEscaped:i,suffix:o,suffixEscaped:c,formatSeparator:l,unescapeSuffix:f,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:m,nestingSuffixEscaped:y,nestingOptionsSeparator:x,maxReplaces:w,alwaysFormat:E}=e.interpolation;this.escape=t!==void 0?t:jn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Ee(a):i||"{{",this.suffix=o?Ee(o):c||"}}",this.formatSeparator=l||",",this.unescapePrefix=f?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Ee(d):h||Ee("$t("),this.nestingSuffix=m?Ee(m):y||Ee(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=w||1e3,this.alwaysFormat=E!==void 0?E:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,n)=>(t==null?void 0:t.source)===n?(t.lastIndex=0,t):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,s){var h;let a,i,o;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=m=>{if(m.indexOf(this.formatSeparator)<0){const E=tr(t,c,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,n,{...s,...t,interpolationkey:m}):E}const y=m.split(this.formatSeparator),x=y.shift().trim(),w=y.join(this.formatSeparator).trim();return this.format(tr(t,c,x,this.options.keySeparator,this.options.ignoreJSONStructure),w,n,{...s,...t,interpolationkey:x})};this.resetRegExp();const f=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,u=((h=s==null?void 0:s.interpolation)==null?void 0:h.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>lt(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?lt(this.escape(m)):lt(m)}].forEach(m=>{for(o=0;a=m.regex.exec(e);){const y=a[1].trim();if(i=l(y),i===void 0)if(typeof f=="function"){const w=f(e,a,s);i=z(w)?w:""}else if(s&&Object.prototype.hasOwnProperty.call(s,y))i="";else if(u){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),i="";else!z(i)&&!this.useRawValueToEscape&&(i=Bt(i));const x=m.safeValue(i);if(e=e.replace(a[0],x),u?(m.regex.lastIndex+=i.length,m.regex.lastIndex-=a[0].length):m.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(c,l)=>{const f=this.nestingOptionsSeparator;if(c.indexOf(f)<0)return c;const u=c.split(new RegExp(`${f}[ ]*{`));let d=`{${u[1]}`;c=u[0],d=this.interpolate(d,i);const h=d.match(/'/g),m=d.match(/"/g);(((h==null?void 0:h.length)??0)%2===0&&!m||m.length%2!==0)&&(d=d.replace(/'/g,'"'));try{i=JSON.parse(d),l&&(i={...l,...i})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,y),`${c}${f}${d}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];i={...n},i=i.replace&&!z(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const f=s[1].split(this.formatSeparator).map(u=>u.trim());s[1]=f.shift(),c=f,l=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!z(a))return a;z(a)||(a=Bt(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),l&&(a=c.reduce((f,u)=>this.format(f,u,n.lng,{...n,interpolationkey:s[1].trim()}),a.trim())),e=e.replace(s[0],a),this.regexp.lastIndex=0}return e}}const In=r=>{let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const n=r.split("(");e=n[0].toLowerCase().trim();const s=n[1].substring(0,n[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(i=>{if(i){const[o,...c]=i.split(":"),l=c.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();t[f]||(t[f]=l),l==="false"&&(t[f]=!1),l==="true"&&(t[f]=!0),isNaN(l)||(t[f]=parseInt(l,10))}})}return{formatName:e,formatOptions:t}},rr=r=>{const e={};return(t,n,s)=>{let a=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(a={...a,[s.interpolationkey]:void 0});const i=n+JSON.stringify(a);let o=e[i];return o||(o=r(Pe(n),s),e[i]=o),o(t)}},Nn=r=>(e,t,n)=>r(Pe(t),n)(e);class Mn{constructor(e={}){this.logger=me.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?rr:Nn;this.formats={number:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a});return o=>i.format(o)}),currency:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a,style:"currency"});return o=>i.format(o)}),datetime:n((s,a)=>{const i=new Intl.DateTimeFormat(s,{...a});return o=>i.format(o)}),relativetime:n((s,a)=>{const i=new Intl.RelativeTimeFormat(s,{...a});return o=>i.format(o,a.range||"day")}),list:n((s,a)=>{const i=new Intl.ListFormat(s,{...a});return o=>i.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=rr(t)}format(e,t,n,s={}){const a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(o=>o.indexOf(")")>-1)){const o=a.findIndex(c=>c.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,c)=>{var u;const{formatName:l,formatOptions:f}=In(c);if(this.formats[l]){let d=o;try{const h=((u=s==null?void 0:s.formatParams)==null?void 0:u[s.interpolationkey])||{},m=h.locale||h.lng||s.locale||s.lng||n;d=this.formats[l](o,m,{...f,...s,...h})}catch(h){this.logger.warn(h)}return d}else this.logger.warn(`there was no format function for ${l}`);return o},e)}}const Fn=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Vn extends Xe{constructor(e,t,n,s={}){var a,i;super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=me.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(i=(a=this.backend)==null?void 0:a.init)==null||i.call(a,n,s.backend,s)}queueLoad(e,t,n,s){const a={},i={},o={},c={};return e.forEach(l=>{let f=!0;t.forEach(u=>{const d=`${l}|${u}`;!n.reload&&this.store.hasResourceBundle(l,u)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?i[d]===void 0&&(i[d]=!0):(this.state[d]=1,f=!1,i[d]===void 0&&(i[d]=!0),a[d]===void 0&&(a[d]=!0),c[u]===void 0&&(c[u]=!0)))}),f||(o[l]=!0)}),(Object.keys(a).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(a),pending:Object.keys(i),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(c)}}loaded(e,t,n){const s=e.split("|"),a=s[0],i=s[1];t&&this.emit("failedLoading",a,i,t),!t&&n&&this.store.addResourceBundle(a,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const o={};this.queue.forEach(c=>{On(c.loaded,[a],i),Fn(c,e),t&&c.errors.push(t),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(l=>{o[l]||(o[l]={});const f=c.loaded[l];f.length&&f.forEach(u=>{o[l][u]===void 0&&(o[l][u]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(c=>!c.done)}read(e,t,n,s=0,a=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:a,callback:i});return}this.readingCalls++;const o=(l,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const u=this.waitingReads.shift();this.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}if(l&&f&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,a*2,i)},a);return}i(l,f)},c=this.backend[n].bind(this.backend);if(c.length===2){try{const l=c(e,t);l&&typeof l.then=="function"?l.then(f=>o(null,f)).catch(o):o(null,l)}catch(l){o(l)}return}return c(e,t,o)}prepareLoading(e,t,n={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();z(e)&&(e=this.languageUtils.toResolveHierarchy(e)),z(t)&&(t=[t]);const a=this.queueLoad(e,t,n,s);if(!a.toLoad.length)return a.pending.length||s(),null;a.toLoad.forEach(i=>{this.loadOne(i)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),s=n[0],a=n[1];this.read(s,a,"read",void 0,void 0,(i,o)=>{i&&this.logger.warn(`${t}loading namespace ${a} for language ${s} failed`,i),!i&&o&&this.logger.log(`${t}loaded namespace ${a} for language ${s}`,o),this.loaded(e,i,o)})}saveMissing(e,t,n,s,a,i={},o=()=>{}){var c,l,f,u,d;if((l=(c=this.services)==null?void 0:c.utils)!=null&&l.hasLoadedNamespace&&!((u=(f=this.services)==null?void 0:f.utils)!=null&&u.hasLoadedNamespace(t))){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((d=this.backend)!=null&&d.create){const h={...i,isUpdate:a},m=this.backend.create.bind(this.backend);if(m.length<6)try{let y;m.length===5?y=m(e,t,n,s,h):y=m(e,t,n,s),y&&typeof y.then=="function"?y.then(x=>o(null,x)).catch(o):o(null,y)}catch(y){o(y)}else m(e,t,n,s,o,h)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const nr=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),z(r[1])&&(e.defaultValue=r[1]),z(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const t=r[3]||r[2];Object.keys(t).forEach(n=>{e[n]=t[n]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),sr=r=>{var e,t;return z(r.ns)&&(r.ns=[r.ns]),z(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),z(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((t=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},Ve=()=>{},Yn=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class Ae extends Xe{constructor(e={},t){if(super(),this.options=sr(e),this.services={},this.logger=me,this.modules={external:[]},Yn(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(z(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=nr();this.options={...n,...this.options,...sr(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const s=l=>l?typeof l=="function"?new l:l:null;if(!this.options.isClone){this.modules.logger?me.init(s(this.modules.logger),this.options):me.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=Mn;const f=new Zt(this.options);this.store=new qt(this.options.resources,this.options);const u=this.services;u.logger=me,u.resourceStore=this.store,u.languageUtils=f,u.pluralResolver=new _n(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),l&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(u.formatter=s(l),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new kn(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Vn(s(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(d,...h)=>{this.emit(d,...h)}),this.modules.languageDetector&&(u.languageDetector=s(this.modules.languageDetector),u.languageDetector.init&&u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=s(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new Je(this.services,this.options),this.translator.on("*",(d,...h)=>{this.emit(d,...h)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Ve),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(l=>{this[l]=(...f)=>this.store[l](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...f)=>(this.store[l](...f),this)});const o=Ce(),c=()=>{const l=(f,u)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(u),t(f,u)};if(this.languages&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),o}loadResources(e,t=Ve){var a,i;let n=t;const s=z(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const o=[],c=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};s?c(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>c(f)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,l=>c(l)),this.services.backendConnector.load(o,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(l)})}else n(null)}reloadResources(e,t,n){const s=Ce();return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Ve),this.services.backendConnector.reload(e,t,a=>{s.resolve(),n(a)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&wr.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Ce();this.emit("languageChanging",e);const s=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},a=(o,c)=>{c?this.isLanguageChangingTo===e&&(s(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,n.resolve((...l)=>this.t(...l)),t&&t(o,(...l)=>this.t(...l))},i=o=>{var f,u;!e&&!o&&this.services.languageDetector&&(o=[]);const c=z(o)?o:o&&o[0],l=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(z(o)?[o]:o);l&&(this.language||s(l),this.translator.language||this.translator.changeLanguage(l),(u=(f=this.services.languageDetector)==null?void 0:f.cacheUserLanguage)==null||u.call(f,l)),this.loadResources(l,d=>{a(d,l)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?i(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e),n}getFixedT(e,t,n){const s=(a,i,...o)=>{let c;typeof i!="object"?c=this.options.overloadTranslationOptionHandler([a,i].concat(o)):c={...i},c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||n||s.keyPrefix);const l=this.options.keySeparator||".";let f;return c.keyPrefix&&Array.isArray(a)?f=a.map(u=>`${c.keyPrefix}${l}${u}`):f=c.keyPrefix?`${c.keyPrefix}${l}${a}`:a,this.t(f,c)};return z(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}t(...e){var t;return(t=this.translator)==null?void 0:t.translate(...e)}exists(...e){var t;return(t=this.translator)==null?void 0:t.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const i=(o,c)=>{const l=this.services.backendConnector.state[`${o}|${c}`];return l===-1||l===0||l===2};if(t.precheck){const o=t.precheck(this,i);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!s||i(a,e)))}loadNamespaces(e,t){const n=Ce();return this.options.ns?(z(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Ce();z(e)&&(e=[e]);const s=this.options.preload||[],a=e.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return a.length?(this.options.preload=s.concat(a),this.loadResources(i=>{n.resolve(),t&&t(i)}),n):(t&&t(),Promise.resolve())}dir(e){var s,a;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new Zt(nr());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new Ae(e,t)}cloneInstance(e={},t=Ve){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new Ae(s);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(o=>{a[o]=this[o]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const o=Object.keys(this.store.data).reduce((c,l)=>(c[l]={...this.store.data[l]},c[l]=Object.keys(c[l]).reduce((f,u)=>(f[u]={...c[l][u]},f),c[l]),c),{});a.store=new qt(o,s),a.services.resourceStore=a.store}return a.translator=new Je(a.services,s),a.translator.on("*",(o,...c)=>{a.emit(o,...c)}),a.init(s,t),a.translator.options=s,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const se=Ae.createInstance();se.createInstance=Ae.createInstance;se.createInstance;se.dir;se.init;se.loadResources;se.reloadResources;se.use;se.changeLanguage;se.getFixedT;se.t;se.exists;se.setDefaultNamespace;se.hasLoadedNamespace;se.loadNamespaces;se.loadLanguages;const Un={Friday:"Venerdì",FridayShort:"Ven",Monday:"Lunedì",MondayShort:"Lun",Saturday:"Sabato",SaturdayShort:"Sab",Sunday:"Domenica",SundayShort:"Dom",Tuesday:"Martedì",TuesdayShort:"Mar",Thursday:"Giovedì",ThursdayShort:"Gio",Wednesday:"Mercoledì",WednesdayShort:"Mer"},Wn={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},Hn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando"},Bn={Date:{NextDay:"Giorno Successivo",NextMonth:"Mese Successivo",NextWeek:"Settimana Successiva",NextYear:"Anno Successivo",PreviousDay:"Giorno Precedente",PreviousMonth:"Mese Precedente",PreviousWeek:"Settimana Precedente",PreviousYear:"Anno Precedente",Today:"Oggi",Tomorrow:"Domani",Yesterday:"Ieri"},Day:Un,Month:Wn,Generic:Hn},Gn={Friday:"Friday",FridayShort:"Fri",Monday:"Monday",MondayShort:"Mon",Saturday:"Saturday",SaturdayShort:"Sat",Sunday:"Sunday",SundayShort:"Sun",Tuesday:"Tuesday",TuesdayShort:"Tue",Thursday:"Thursday",ThursdayShort:"Thu",Wednesday:"Wednesday",WednesdayShort:"Wed"},zn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},Kn={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command"},qn={Date:{NextDay:"Next Day",NextMonth:"Next Month",NextWeek:"Next Week",NextYear:"Next Year",PreviousDay:"Previous Day",PreviousMonth:"Previous Month",PreviousWeek:"Previous Week",PreviousYear:"Previous Year",Today:"Today",Tomorrow:"Tomorrow",Yesterday:"Yesterday"},Day:Gn,Month:zn,Generic:Kn};function ar(r,e){return new RegExp(Jn(r),e)}function Jn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xn(r,e,t,n){let s=e;const a=Zn(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=Qn(s);return new Intl.NumberFormat(n,i).format(a)}function Zn(r,e,t,n,s){let a=r;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const c=o=="."?",":".";a=a.replace(ar(c,"g"),""),a=a.replace(ar(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function Qn(r){const e={};r.includes(",")?e.useGrouping=!0:e.useGrouping=!1;const t=r.indexOf(".");if(t>-1){const s=(r.substring(t+1).match(/0/g)||[]).length;e.minimumFractionDigits=s,e.maximumFractionDigits=s}else e.minimumFractionDigits=0,e.maximumFractionDigits=0;return e}se.init({lng:typeof navigator<"u"&&navigator.language.split("-")[0]||"en",fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1,format:(r,e,t,n)=>{const s=(n==null?void 0:n.type)??"number";try{switch(s){case"date":{const a=r instanceof Date?r:new Date(r);return new Intl.DateTimeFormat(t,{dateStyle:e||"short"}).format(a)}default:case"number":{const a=(n==null?void 0:n.inputIsLocalized)??!1;return Xn(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:qn},it:{translation:Bn}}});const es=(r,e,t,n)=>se.format(r,e,t||se.language,n),ts=(r,e)=>se.t(r,e);function Ze(){const r=A.useCallback((n,s,a,i)=>es(n,s,a||void 0,i),[]),e=A.useCallback(()=>se.languages[0],[]),t=A.useCallback((n,s)=>ts(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var xt=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r))(xt||{}),oe=(r=>(r.MONDAY="Day.Monday",r.MONDAY_SHORT="Day.MondayShort",r.TUESDAY="Day.Tuesday",r.TUESDAY_SHORT="Day.TuesdayShort",r.WEDNESDAY="Day.Wednesday",r.WEDNESDAY_SHORT="Day.WednesdayShort",r.THURSDAY="Day.Thursday",r.THURSDAY_SHORT="Day.ThursdayShort",r.FRIDAY="Day.Friday",r.FRIDAY_SHORT="Day.FridayShort",r.SATURDAY="Day.Saturday",r.SATURDAY_SHORT="Day.SaturdayShort",r.SUNDAY="Day.Sunday",r.SUNDAY_SHORT="Day.SundayShort",r))(oe||{}),ue=(r=>(r.JANUARY="Month.January",r.FEBRUARY="Month.February",r.MARCH="Month.March",r.APRIL="Month.April",r.MAY="Month.May",r.JUNE="Month.June",r.JULY="Month.July",r.AUGUST="Month.August",r.SEPTEMBER="Month.September",r.OCTOBER="Month.October",r.NOVEMBER="Month.November",r.DECEMBER="Month.December",r))(ue||{}),pt=(r=>(r.PREVIOUS_DAY="Date.PreviousDay",r.PREVIOUS_WEEK="Date.PreviousWeek",r.PREVIOUS_MONTH="Date.PreviousMonth",r.PREVIOUS_YEAR="Date.PreviousYear",r.NEXT_DAY="Date.NextDay",r.NEXT_WEEK="Date.NextWeek",r.NEXT_MONTH="Date.NextMonth",r.NEXT_YEAR="Date.NextYear",r.YESTERDAY="Date.Yesterday",r.TODAY="Date.Today",r.TOMORROW="Date.Tomorrow",r))(pt||{});function rs({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=Ze(),i=()=>{if(!n)return;const I=new Date(n);return isNaN(I.getTime())?void 0:I},[o]=A.useState(new Date),[c,l]=A.useState(r||i()||new Date),[f,u]=A.useState(c?c.getMonth():new Date().getMonth()),[d,h]=A.useState(c?c.getFullYear():new Date().getFullYear()),[m,y]=A.useState(c?c.getDate():null),x=A.useRef(null),w=A.useRef([]),E=[a(ue.JANUARY),a(ue.FEBRUARY),a(ue.MARCH),a(ue.APRIL),a(ue.MAY),a(ue.JUNE),a(ue.JULY),a(ue.AUGUST),a(ue.SEPTEMBER),a(ue.OCTOBER),a(ue.NOVEMBER),a(ue.DECEMBER)],D=[{value:a(oe.SUNDAY_SHORT),full:a(oe.SUNDAY)},{value:a(oe.MONDAY_SHORT),full:a(oe.MONDAY)},{value:a(oe.TUESDAY_SHORT),full:a(oe.TUESDAY)},{value:a(oe.WEDNESDAY_SHORT),full:a(oe.WEDNESDAY)},{value:a(oe.THURSDAY_SHORT),full:a(oe.THURSDAY)},{value:a(oe.FRIDAY_SHORT),full:a(oe.FRIDAY)},{value:a(oe.SATURDAY_SHORT),full:a(oe.SATURDAY)}],S=I=>t.some(p=>{const g=p.start.getTime(),T=p.end.getTime(),$=I.getTime();return $>=g&&$<=T}),v=I=>{S(I)||(l(I),y(I.getDate()),e&&e(qr(I)))},C=()=>{f===0?(u(11),h(d-1)):u(f-1),y(1)},k=()=>{f===11?(u(0),h(d+1)):u(f+1),y(1)},W=(I,p)=>new Date(I,p+1,0).getDate(),R=(I,p)=>new Date(I,p,1).getDay(),j=I=>{var g;const p=B.findIndex(T=>T!==null&&T.getDate()===I);p!==-1&&w.current[p]&&((g=w.current[p])==null||g.focus(),y(I))},_=(I,p)=>{const g=B[p];if(!g)return;const T=W(d,f),$=g.getDate();switch(I.key){case"ArrowRight":I.preventDefault();{let O=$+1,P=new Date(d,f,O);if(O>T){const V=f===11?d+1:d,Y=f===11?0:f+1;O=1,P=new Date(V,Y,O),k(),setTimeout(()=>{N(1,"forward")},0);return}S(P)?N(O,"forward"):j(O)}break;case"Tab":break;case"ArrowLeft":I.preventDefault();{let O=$-1,P=new Date(d,f,O);if(O<1){const V=f===0?d-1:d,Y=f===0?11:f-1,M=W(V,Y);O=M,P=new Date(V,Y,O),C(),setTimeout(()=>{N(M,"backward")},0);return}S(P)?N(O,"backward"):j(O)}break;case"ArrowUp":I.preventDefault();{let O=$-7,P=new Date(d,f,O);if(O<1){const V=f===0?d-1:d,Y=f===0?11:f-1;O=W(V,Y)+O,P=new Date(V,Y,O),C(),setTimeout(()=>{N(O,"backward")},0);return}S(P)?N(O,"backward"):j(O)}break;case"ArrowDown":I.preventDefault();{let O=$+7,P=new Date(d,f,O);if(O>T){const V=f===11?d+1:d,Y=f===11?0:f+1;O=O-T,P=new Date(V,Y,O),k(),setTimeout(()=>{N(O,"forward")},0);return}S(P)?N(O,"forward"):j(O)}break;case"Home":I.preventDefault(),N(1,"forward");break;case"End":I.preventDefault(),N(T,"backward");break;case"PageUp":I.preventDefault(),C(),setTimeout(()=>{const O=W(f===0?d-1:d,f===0?11:f-1),P=Math.min($,O);N(P,"forward")},0);break;case"PageDown":I.preventDefault(),k(),setTimeout(()=>{const O=W(f===11?d+1:d,f===11?0:f+1),P=Math.min($,O);N(P,"forward")},0);break;case" ":case"Space":if(S(g))return;y(g.getDate()),l(g);break;case"Enter":I.preventDefault(),v(g);break}},N=(I,p)=>{const g=W(d,f);if(p==="forward"){for(let T=I;T<=g;T++){const $=new Date(d,f,T);if(!S($)){j(T);return}}k(),setTimeout(()=>{N(1,"forward")},0)}else{for(let P=I;P>=1;P--){const V=new Date(d,f,P);if(!S(V)){j(P);return}}const T=f===0?d-1:d,$=f===0?11:f-1,O=W(T,$);C(),setTimeout(()=>{N(O,"backward")},0)}},B=(()=>{const I=W(d,f),p=R(d,f),g=[];for(let T=0;T<p;T++)g.push(null);for(let T=1;T<=I;T++){const $=new Date(d,f,T);g.push($)}return g})(),J=[];let K=[];B.forEach((I,p)=>{if(K.push(I),K.length===7||p===B.length-1){for(;K.length<7;)K.push(null);J.push(K),K=[]}}),A.useEffect(()=>{var I;if(m!==null){const p=B.findIndex(g=>g!==null&&g.getDate()===m);p!==-1&&w.current[p]&&((I=w.current[p])==null||I.focus())}},[f,d,m,B]);const H={label:"smp-datepickercalendar-label",wrapper:"smp-datepickercalendar",calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(I,p,g,T)=>`smp-datepickercalendar-td
|
|
46
|
-
${
|
|
44
|
+
*/var nt,kt;function fn(){if(kt)return nt;kt=1;var r=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var i={},o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var c=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(u){l[u]=u}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return nt=s()?Object.assign:function(a,i){for(var o,c=n(a),l,u=1;u<arguments.length;u++){o=Object(arguments[u]);for(var f in o)e.call(o,f)&&(c[f]=o[f]);if(r){l=r(o);for(var d=0;d<l.length;d++)t.call(o,l[d])&&(c[l[d]]=o[l[d]])}}return c},nt}var st,It;function yt(){if(It)return st;It=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return st=r,st}var at,Nt;function pr(){return Nt||(Nt=1,at=Function.call.bind(Object.prototype.hasOwnProperty)),at}var it,Mt;function dn(){if(Mt)return it;Mt=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=yt(),t={},n=pr();r=function(a){var i="Warning: "+a;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(a,i,o,c,l){if(process.env.NODE_ENV!=="production"){for(var u in a)if(n(a,u)){var f;try{if(typeof a[u]!="function"){var d=Error((c||"React class")+": "+o+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}f=a[u](i,u,c,o,null,e)}catch(h){f=h}if(f&&!(f instanceof Error)&&r((c||"React class")+": type specification of "+o+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in t)){t[f.message]=!0;var m=l?l():"";r("Failed "+o+" type: "+f.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},it=s,it}var ot,Ft;function pn(){if(Ft)return ot;Ft=1;var r=dr(),e=fn(),t=yt(),n=pr(),s=dn(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(o){var c="Warning: "+o;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return ot=function(o,c){var l=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(p){var g=p&&(l&&p[l]||p[u]);if(typeof g=="function")return g}var d="<<anonymous>>",m={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:E(),arrayOf:D,element:S(),elementType:v(),instanceOf:I,node:P(),objectOf:W,oneOf:$,oneOfType:R,shape:M,exact:N};function h(p,g){return p===g?p!==0||1/p===1/g:p!==p&&g!==g}function y(p,g){this.message=p,this.data=g&&typeof g=="object"?g:{},this.stack=""}y.prototype=Error.prototype;function x(p){if(process.env.NODE_ENV!=="production")var g={},T=0;function C(A,V,Y,F,J,G,ne){if(F=F||d,G=G||Y,ne!==t){if(c){var k=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw k.name="Invariant Violation",k}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var U=F+":"+Y;!g[U]&&T<3&&(a("You are manually calling a React.PropTypes validation function for the `"+G+"` prop on `"+F+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),g[U]=!0,T++)}}return V[Y]==null?A?V[Y]===null?new y("The "+J+" `"+G+"` is marked as required "+("in `"+F+"`, but its value is `null`.")):new y("The "+J+" `"+G+"` is marked as required in "+("`"+F+"`, but its value is `undefined`.")):null:p(V,Y,F,J,G)}var O=C.bind(null,!1);return O.isRequired=C.bind(null,!0),O}function w(p){function g(T,C,O,A,V,Y){var F=T[C],J=K(F);if(J!==p){var G=Z(F);return new y("Invalid "+A+" `"+V+"` of type "+("`"+G+"` supplied to `"+O+"`, expected ")+("`"+p+"`."),{expectedType:p})}return null}return x(g)}function E(){return x(i)}function D(p){function g(T,C,O,A,V){if(typeof p!="function")return new y("Property `"+V+"` of component `"+O+"` has invalid PropType notation inside arrayOf.");var Y=T[C];if(!Array.isArray(Y)){var F=K(Y);return new y("Invalid "+A+" `"+V+"` of type "+("`"+F+"` supplied to `"+O+"`, expected an array."))}for(var J=0;J<Y.length;J++){var G=p(Y,J,O,A,V+"["+J+"]",t);if(G instanceof Error)return G}return null}return x(g)}function S(){function p(g,T,C,O,A){var V=g[T];if(!o(V)){var Y=K(V);return new y("Invalid "+O+" `"+A+"` of type "+("`"+Y+"` supplied to `"+C+"`, expected a single ReactElement."))}return null}return x(p)}function v(){function p(g,T,C,O,A){var V=g[T];if(!r.isValidElementType(V)){var Y=K(V);return new y("Invalid "+O+" `"+A+"` of type "+("`"+Y+"` supplied to `"+C+"`, expected a single ReactElement type."))}return null}return x(p)}function I(p){function g(T,C,O,A,V){if(!(T[C]instanceof p)){var Y=p.name||d,F=_(T[C]);return new y("Invalid "+A+" `"+V+"` of type "+("`"+F+"` supplied to `"+O+"`, expected ")+("instance of `"+Y+"`."))}return null}return x(g)}function $(p){if(!Array.isArray(p))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),i;function g(T,C,O,A,V){for(var Y=T[C],F=0;F<p.length;F++)if(h(Y,p[F]))return null;var J=JSON.stringify(p,function(ne,k){var U=Z(k);return U==="symbol"?String(k):k});return new y("Invalid "+A+" `"+V+"` of value `"+String(Y)+"` "+("supplied to `"+O+"`, expected one of "+J+"."))}return x(g)}function W(p){function g(T,C,O,A,V){if(typeof p!="function")return new y("Property `"+V+"` of component `"+O+"` has invalid PropType notation inside objectOf.");var Y=T[C],F=K(Y);if(F!=="object")return new y("Invalid "+A+" `"+V+"` of type "+("`"+F+"` supplied to `"+O+"`, expected an object."));for(var J in Y)if(n(Y,J)){var G=p(Y,J,O,A,V+"."+J,t);if(G instanceof Error)return G}return null}return x(g)}function R(p){if(!Array.isArray(p))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var g=0;g<p.length;g++){var T=p[g];if(typeof T!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+H(T)+" at index "+g+"."),i}function C(O,A,V,Y,F){for(var J=[],G=0;G<p.length;G++){var ne=p[G],k=ne(O,A,V,Y,F,t);if(k==null)return null;k.data&&n(k.data,"expectedType")&&J.push(k.data.expectedType)}var U=J.length>0?", expected one of type ["+J.join(", ")+"]":"";return new y("Invalid "+Y+" `"+F+"` supplied to "+("`"+V+"`"+U+"."))}return x(C)}function P(){function p(g,T,C,O,A){return B(g[T])?null:new y("Invalid "+O+" `"+A+"` supplied to "+("`"+C+"`, expected a ReactNode."))}return x(p)}function j(p,g,T,C,O){return new y((p||"React class")+": "+g+" type `"+T+"."+C+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+O+"`.")}function M(p){function g(T,C,O,A,V){var Y=T[C],F=K(Y);if(F!=="object")return new y("Invalid "+A+" `"+V+"` of type `"+F+"` "+("supplied to `"+O+"`, expected `object`."));for(var J in p){var G=p[J];if(typeof G!="function")return j(O,A,V,J,Z(G));var ne=G(Y,J,O,A,V+"."+J,t);if(ne)return ne}return null}return x(g)}function N(p){function g(T,C,O,A,V){var Y=T[C],F=K(Y);if(F!=="object")return new y("Invalid "+A+" `"+V+"` of type `"+F+"` "+("supplied to `"+O+"`, expected `object`."));var J=e({},T[C],p);for(var G in J){var ne=p[G];if(n(p,G)&&typeof ne!="function")return j(O,A,V,G,Z(ne));if(!ne)return new y("Invalid "+A+" `"+V+"` key `"+G+"` supplied to `"+O+"`.\nBad object: "+JSON.stringify(T[C],null," ")+`
|
|
45
|
+
Valid keys: `+JSON.stringify(Object.keys(p),null," "));var k=ne(Y,G,O,A,V+"."+G,t);if(k)return k}return null}return x(g)}function B(p){switch(typeof p){case"number":case"string":case"undefined":return!0;case"boolean":return!p;case"object":if(Array.isArray(p))return p.every(B);if(p===null||o(p))return!0;var g=f(p);if(g){var T=g.call(p),C;if(g!==p.entries){for(;!(C=T.next()).done;)if(!B(C.value))return!1}else for(;!(C=T.next()).done;){var O=C.value;if(O&&!B(O[1]))return!1}}else return!1;return!0;default:return!1}}function q(p,g){return p==="symbol"?!0:g?g["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&g instanceof Symbol:!1}function K(p){var g=typeof p;return Array.isArray(p)?"array":p instanceof RegExp?"object":q(g,p)?"symbol":g}function Z(p){if(typeof p>"u"||p===null)return""+p;var g=K(p);if(g==="object"){if(p instanceof Date)return"date";if(p instanceof RegExp)return"regexp"}return g}function H(p){var g=Z(p);switch(g){case"array":case"object":return"an "+g;case"boolean":case"date":case"regexp":return"a "+g;default:return g}}function _(p){return!p.constructor||!p.constructor.name?d:p.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},ot}var lt,Vt;function hn(){if(Vt)return lt;Vt=1;var r=yt();function e(){}function t(){}return t.resetWarningCache=e,lt=function(){function n(i,o,c,l,u,f){if(f!==r){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}n.isRequired=n;function s(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:e};return a.PropTypes=a,a},lt}var Yt;function mn(){if(Yt)return Ne.exports;if(Yt=1,process.env.NODE_ENV!=="production"){var r=dr(),e=!0;Ne.exports=pn()(r.isElement,e)}else Ne.exports=hn()();return Ne.exports}var ae=mn(),gn=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},yn=function(e,t){for(var n in e)if(!(n in t))return!0;for(var s in t)if(e[s]!==t[s])return!0;return!1},vn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Fe="http://www.w3.org/2000/svg",Ut="http://www.w3.org/1999/xlink",Oe=function(r){function e(){for(var n,s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return n=r.call.apply(r,[this].concat(a))||this,n.initialState={hasError:!1,isLoading:!0},n.state=n.initialState,n._isMounted=!1,n.reactWrapper=void 0,n.nonReactWrapper=void 0,n.refCallback=function(o){n.reactWrapper=o},n}Zr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof gn(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,c=a.httpRequestWithCredentials,l=a.renumerateIRIElements,u=a.src,f=a.title,d=a.useRequestCache,m=this.props.onError,h=this.props.beforeInjection,y=this.props.afterInjection,x=this.props.wrapper,w,E;x==="svg"?(w=document.createElementNS(Fe,x),w.setAttribute("xmlns",Fe),w.setAttribute("xmlns:xlink",Ut),E=document.createElementNS(Fe,x)):(w=document.createElement(x),E=document.createElement(x)),w.appendChild(E),E.dataset.src=u,this.nonReactWrapper=this.reactWrapper.appendChild(w);var D=function($){if(s.removeSVG(),!s._isMounted){m($);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){m($)})},S=function($,W){if($){D($);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{y(W)}catch(R){D(R)}})},v=function($){if($.setAttribute("role","img"),i){var W=$.querySelector(":scope > desc");W&&$.removeChild(W);var R=document.createElement("desc");R.innerHTML=i,$.prepend(R)}if(f){var P=$.querySelector(":scope > title");P&&$.removeChild(P);var j=document.createElement("title");j.innerHTML=f,$.prepend(j)}try{h($)}catch(M){D(M)}};ln(E,{afterEach:S,beforeEach:v,cacheRequests:d,evalScripts:o,httpRequestWithCredentials:c,renumerateIRIElements:l})}},t.removeSVG=function(){var s;(s=this.nonReactWrapper)!=null&&s.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},t.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},t.componentDidUpdate=function(s){var a=this;yn(ze({},s),this.props)&&this.setState(function(){return a.initialState},function(){a.removeSVG(),a.renderSVG()})},t.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},t.render=function(){var s=this.props;s.afterInjection,s.beforeInjection,s.desc,s.evalScripts;var a=s.fallback;s.httpRequestWithCredentials;var i=s.loading;s.renumerateIRIElements,s.src,s.title,s.useRequestCache;var o=s.wrapper,c=Xr(s,vn),l=o;return Le.createElement(l,ze({},c,{ref:this.refCallback},o==="svg"?{xmlns:Fe,xmlnsXlink:Ut}:{}),this.state.isLoading&&i&&Le.createElement(i,null),this.state.hasError&&a&&Le.createElement(a,null))},e}(Le.Component);Oe.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Oe.propTypes={afterInjection:ae.func,beforeInjection:ae.func,desc:ae.string,evalScripts:ae.oneOf(["always","once","never"]),fallback:ae.oneOfType([ae.func,ae.object,ae.string]),httpRequestWithCredentials:ae.bool,loading:ae.oneOfType([ae.func,ae.object,ae.string]),onError:ae.func,renumerateIRIElements:ae.bool,src:ae.string.isRequired,title:ae.string,useRequestCache:ae.bool,wrapper:ae.oneOf(["div","span","svg"])};let dt={assets:"/"};const bn=r=>{dt={...dt,...r}},Wt=r=>`${dt.assets}/${r}`.replace(/\/+/g,"/"),le=L.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:c,isInteractable:l=!1,spin:u=!1,title:f})=>{const[d,m]=L.useState(r),h=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),y=h&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),x=Wt(`assets/svg/${r}.svg`),w=Wt(`assets/svg/${n}.svg`),E={img:`${l?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${l?"smp-icon-interactable":""} ${u?"smp-icon-spin":""}`},D=()=>{!a&&l&&c&&c()};return b.jsx(b.Fragment,{children:y?b.jsx(Oe,{src:r,fallback:()=>b.jsx(Oe,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:f,role:"application",fill:s,"aria-disabled":a,className:E.svg,onClick:D}):h?b.jsx("img",{src:d,width:e||"16px",height:t||"auto",alt:f,onError:()=>m(w),onClick:D,className:E.img,title:f,onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&D()}}):b.jsx(Oe,{src:x,fallback:()=>b.jsx(Oe,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:f,role:"application",fill:s,"aria-disabled":a,className:E.svg,onClick:D})})}),Se=({disabled:r,bindValue:e,icon:t,onBlur:n,onChange:s,placeholder:a,isEditable:i=!0,shapeIcon:o,sizing:c,state:l,variant:u,rotatedShapeIcon:f=!1,onShapeIconClick:d,ref:m,inputRef:h,onKeyDown:y,inputType:x="text",ariaLabel:w="input field",label:E,helperText:D=!1,error:S,appearance:v="base",fullWidth:I=!1,_dataComponent:$="textfield",width:W})=>{const R=S?"danger":l,P=S||l=="danger"?"error":o,j=D||!!S,M=q=>{s==null||s(q.target.value)},N={wrapper:`smp-textfield-wrapper ${I?"smp-textfield-fullWidth":""}`,container:`smp-textfield ${r?"smp-textfield-disabled":""} ${a?"smp-textfield-placeholder":""} ${c?`smp-textfield-${c}`:""} ${R?`smp-textfield-${R}`:""} ${v?`smp-textfield-${v}`:""} ${i?"":"smp-textfield-readOnly"}`,input:"smp-textfield-input "};u&&(u!="notSelectable"||i)&&(N.container+=`smp-textfield-variant-${u}`);const B=W?{"--smp-textField-width-base":W}:void 0;return b.jsxs("div",{className:N.wrapper,"data-component":$,children:[E&&b.jsx(Xe,{label:E,disabled:r}),b.jsxs("div",{className:N.container,ref:m,style:B,children:[t&&b.jsx(le,{icon:t,disabled:r}),b.jsx("input",{type:x,value:e,placeholder:a,onChange:M,onBlur:n,className:N.input,disabled:r,readOnly:!i,onKeyDown:y,"aria-label":w,ref:h}),P&&b.jsx(le,{icon:P,disabled:r,state:R,onClick:d,rotated:f,isInteractable:i})]}),j&&b.jsx(Jr,{helperText:S,disabled:r,state:R})]})};function hr({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=L.useState(0),i=L.useRef(null),o=r.length*e,c=Math.max(0,Math.floor(s/e)-n),l=Math.min(r.length-1,Math.floor((s+t)/e)+n),u=[];for(let m=c;m<=l;m++)u.push({item:r[m],index:m,offsetTop:m*e});const f=L.useCallback(m=>{const h=m.target.scrollTop;a(h)},[]),d=m=>{if(!i.current)return;const h=m*e,y=h+e,x=i.current,w=x.scrollTop,E=w+t;h<w?x.scrollTop=h:y>E&&(x.scrollTop=y-t)};return{virtualItems:u,containerProps:{ref:i,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:f},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:o,startIndex:c,endIndex:l},scrollToIndex:d}}const xn=10,mr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:c,onKeyDown:l})=>{var P;const[u,f]=L.useState(""),d=24,[m,h]=L.useState(a!==null?a:-1),y=s!==void 0?s:e.length>xn,x=u?e.filter(j=>j.label.toLowerCase().includes(u.toLowerCase())):e,w=j=>{f(j)},{virtualItems:E,containerProps:D,innerProps:S,scrollToIndex:v}=hr({items:x,itemHeight:d,containerHeight:200,overscan:5});L.useEffect(()=>{a!==null&&a!==m&&h(a)},[a]),L.useEffect(()=>{m>=0&&m<x.length&&v(m)},[m,x]);const I=j=>{if(j.key==="ArrowDown"||j.key==="ArrowUp"){j.preventDefault();let M=m;j.key==="ArrowDown"?M=m<x.length-1?m+1:0:j.key==="ArrowUp"&&(M=m>0?m-1:x.length-1),h(M)}else j.key==="Enter"?m>=0&&m<x.length&&(c==null||c(x[m])):j.key==="Escape"&&(j.preventDefault(),j.stopPropagation());l&&l(j)},$=j=>{I(j)},W=j=>{I(j)},R={wrapper:"smp-list",container:"smp-list-container",virtualScroll:"smp-list-virtualScroll",listItem:"smp-list-listItem"};return b.jsxs("div",{id:r,ref:n,className:R.wrapper,"data-component":"list",style:{width:o},children:[y&&b.jsx(Se,{bindValue:u,placeholder:"Search...",onChange:w,onKeyDown:$}),b.jsx("div",{...D,className:R.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:W,"aria-activedescendant":m>=0&&m<x.length?(P=x[m])==null?void 0:P.id:void 0,children:b.jsx("div",{...S,className:R.virtualScroll,children:E.map(({item:j,index:M,offsetTop:N})=>{const B=i.includes(j.id);return b.jsxs("li",{role:"option",id:j.id,"aria-selected":m===M?"true":"false",tabIndex:-1,className:`${R.listItem} ${m===M?"selected-item":""}`,"aria-label":j.id+"-"+j.label,style:{height:`${d}px`,lineHeight:`calc(${d}px - 2*2px)`,transform:`translateY(${N}px)`},onClick:()=>{c==null||c(j),h(M)},children:[Ge(j.id,j.label,t),B&&b.jsx(le,{icon:"check",width:16})]},j.id)})})})]})},gr=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=L.useState(Ge(e,t,r));return L.useEffect(()=>{a(e)},[e]),L.useEffect(()=>{a(Ge(e,t,r))},[t,r]),b.jsx(Se,{...n,bindValue:s})},Sn=r=>{const e=L.useRef(null);return L.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}},vt=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,isEditable:i=!0,placeholder:o,fun:c,_changeOnEnter:l=!1,onChange:u,onOptionsRequest:f,_multiActiveIndex:d,...m})=>{const[h,y]=L.useState(r),[x,w]=L.useState(e),[E,D]=L.useState(!1),[S,v]=L.useState(t||[]),[I,$]=L.useState(0),[W,R]=L.useState([r]),{anchorRef:P,targetRef:j,anchorWidth:M}=gt({position:"bottom",enabled:E});Be(j,()=>D(!1));const N=Sn(400),B=H=>{H.length>=a?c&&f&&N(async()=>{const _=await f(c,H);v(_),$(_.length>0?0:-1),D(!0)}):D(!1),y(H),w(e),l||u==null||u(H,e)},q=H=>{l?(y(""),w("")):(y(H.id),w(H.label)),u==null||u(H.id,H.label);const _=S.findIndex(p=>p.id===H.id);$(_),R([H.id]),D(!1)},K=H=>{H.key==="Escape"&&(D(!1),$(-1))},Z=H=>{if((H.key==="ArrowDown"||H.key==="ArrowUp")&&(H.preventDefault(),E)){const _=H.key==="ArrowDown"?(I+1)%S.length:(I-1+S.length)%S.length;$(_)}switch(H.key){case"Enter":I>=0&&I<S.length?q(S[I]):l&&(u==null||u(h,""),D(!1),y(""),w(""));break;case"Escape":D(!1),$(-1);break}};return b.jsxs("div",{"data-component":"autocomplete",children:[b.jsx(gr,{...m,bindValue:h,optionalDisplayValue:x,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:o,ref:P,onChange:B,onKeyDown:Z,"aria-autocomplete":"list"}),E&&b.jsx(mr,{options:S,displayMode:s,onClick:q,ref:j,selectedIndex:I,activeIndex:d||W,width:M,showFilter:!1,onKeyDown:K})]})},Ht=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],Bt=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],Re=({label:r,onClick:e,ariaLabel:t,icon:n,disabled:s,sizing:a="base",variant:i="primary",appearance:o="raised",showIcon:c=!0,showText:l=!0,fullWidth:u=!1,loading:f=!1,justify:d="center",title:m,optionalDisplayValue:h})=>{const y={container:`smp-button smp-button-container ${a?`smp-button-${a}`:""} ${i?`smp-buttonVariant-${i}`:""} ${o?`smp-buttonType-${o}`:""} ${u?"smp-button-fullWidth":""} smp-justifyContent-${d}`};return b.jsx("button",{"data-component":"button",className:y.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":f,title:m||r||h,children:f?b.jsx(le,{icon:"spinner",state:Bt(i),spin:!0}):b.jsxs(b.Fragment,{children:[n&&c&&b.jsx(le,{icon:n,disabled:s,state:Bt(i),width:Ht(a),height:Ht(a)}),l&&h&&b.jsx("span",{children:h})]})})},yr=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:u,justify:f,onClick:d,onOptionsRequest:m})=>{const[h,y]=L.useState(r);L.useEffect(()=>{!h&&m&&e&&m(e,void 0).then(E=>y(E)).catch(E=>{console.error("Errore nel caricamento delle opzioni per ButtonList",E)})},[h,e,m]);const x={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},w=h==null?void 0:h.map((E,D)=>{const S={bindValue:E.id,optionalDisplayValue:E.label,fun:E.fun,icon:E.icon,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:u,sizing:s,justify:f,onClick:()=>{d==null||d(E.id,E.fun)}};return b.jsx(Re,{...S},`button-${D}`)});return b.jsx("div",{role:"list","data-component":"button-list",className:x.container,children:w})},vr=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i})=>{const o=l=>{s&&a&&a(l.target.checked)},c={wrapper:"smp-checkbox-wrapper"};return b.jsxs("div",{className:c.wrapper,"data-component":e,children:[n&&b.jsx(Xe,{label:n,disabled:t}),b.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:o,onBlur:i})]})},wn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},bt=({variant:r="body",bindValue:e,color:t,...n})=>{const s=wn[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return b.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},xt=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,c]=L.useState(null),l={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},u=m=>{n==null||n(r.filter((h,y)=>y!==m))},f=m=>{c(m)},d=m=>{if(o===null||o===m)return;const h=[...r],[y]=h.splice(o,1);h.splice(m,0,y),n==null||n(h),c(null)};return b.jsx("div",{className:l.container,role:"list","data-component":"chip",children:r.flatMap((m,h)=>{const y=Ge(m.bindValue,m.optionalDisplayValue,t),x=b.jsxs("div",{className:l.element,role:"listitem",draggable:i,onDragStart:()=>f(h),onDragOver:E=>i&&E.preventDefault(),onDrop:()=>i&&d(h),style:{"--smp-chips-backgroundColor-base":a},children:[i&&b.jsx(le,{icon:"drag_indicator_horizontal",isInteractable:!0}),b.jsx(bt,{variant:"label",bindValue:y,color:s}),e&&b.jsx(le,{icon:"close",isInteractable:!0,onClick:()=>u(h),color:s})]},`chip-${h}`),w=i&&h<r.length-1?b.jsx(le,{icon:"chevron-right",color:s},`separator-${h}`):null;return[x,w].filter(Boolean)})})};function br(r,e){const t=L.useRef(null);L.useEffect(()=>{if(!r)return;const n=typeof e=="object"&&e!==null&&"current"in e?e.current:null;if(!n)return;t.current=document.activeElement;const s=()=>n?Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(l=>!l.hasAttribute("disabled")&&l.offsetParent!==null):[];(()=>{const l=s();l.length>0&&requestAnimationFrame(()=>l[0].focus())})();const i=l=>{if(l.key==="Escape"||l.key!=="Tab")return;const u=s();if(u.length===0)return;const f=u[0],d=u[u.length-1];l.shiftKey&&document.activeElement===f?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),f.focus())},o=l=>{if(n&&!n.contains(l.target)){l.preventDefault();const u=s();u.length>0&&u[0].focus()}};document.addEventListener("keydown",i),document.addEventListener("mousedown",o);const c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=c,t.current&&requestAnimationFrame(()=>{var l;(l=t.current)==null||l.focus()})}},[r,e])}const xr=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:c,multiActiveIndex:l,...u})=>{const[f,d]=L.useState(!1),[m,h]=L.useState(t),[y,x]=L.useState(-1),[w,E]=L.useState([r]),D=L.useId(),{anchorRef:S,targetRef:v,anchorWidth:I}=gt({position:"bottom",enabled:f});Be(v,()=>d(!1)),br(f,v);const $=j=>{e==null||e(j.id,j.label);const M=m.findIndex(N=>N.id===j.id);x(M),E([j.id]),d(!1)},W=j=>{j.key==="Escape"&&(d(!1),x(-1))},R=j=>{(j.key==="ArrowDown"||j.key==="ArrowUp")&&(j.preventDefault(),P())},P=()=>{o&&c&&c(o,void 0).then(j=>{h(j),x(j.length>0?0:-1),d(!0)})};return b.jsxs("div",{role:"combobox","aria-expanded":f,"aria-controls":D,"aria-owns":D,"data-component":"combobox",children:[b.jsx(gr,{...u,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:P,onKeyDown:R,shapeIcon:"arrow_drop_down",rotatedShapeIcon:f,isEditable:s,ref:S,"aria-autocomplete":"list",variant:"notSelectable"}),f&&b.jsx(mr,{id:D,options:m,displayMode:i,ref:v,selectedIndex:y,activeIndex:l||w,width:I,onClick:$,onKeyDown:W})]})},z=r=>typeof r=="string",Ce=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},Gt=r=>r==null?"":""+r,En=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},Tn=/###/g,zt=r=>r&&r.indexOf("###")>-1?r.replace(Tn,"."):r,Kt=r=>!r||z(r),$e=(r,e,t)=>{const n=z(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(Kt(r))return{};const a=zt(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return Kt(r)?{}:{obj:r,k:zt(n[s])}},qt=(r,e,t)=>{const{obj:n,k:s}=$e(r,e,Object);if(n!==void 0||e.length===1){n[s]=t;return}let a=e[e.length-1],i=e.slice(0,e.length-1),o=$e(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=$e(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},On=(r,e,t,n)=>{const{obj:s,k:a}=$e(r,e,Object);s[a]=s[a]||[],s[a].push(t)},Ke=(r,e)=>{const{obj:t,k:n}=$e(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},Rn=(r,e,t)=>{const n=Ke(r,t);return n!==void 0?n:Ke(e,t)},Sr=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?z(r[n])||r[n]instanceof String||z(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):Sr(r[n],e[n],t):r[n]=e[n]);return r},Ee=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Dn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const jn=r=>z(r)?r.replace(/[&<>"'\/]/g,e=>Dn[e]):r;class Cn{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const $n=[" ",",","?","!",";"],Pn=new Cn(20),An=(r,e,t)=>{e=e||"",t=t||"";const n=$n.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=Pn.getRegExp(`(${n.map(i=>i==="?"?"\\?":i).join("|")})`);let a=!s.test(r);if(!a){const i=r.indexOf(t);i>0&&!s.test(r.substring(0,i))&&(a=!0)}return a},pt=(r,e,t=".")=>{if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const n=e.split(t);let s=r;for(let a=0;a<n.length;){if(!s||typeof s!="object")return;let i,o="";for(let c=a;c<n.length;++c)if(c!==a&&(o+=t),o+=n[c],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&c<n.length-1)continue;a+=c-a+1;break}s=i}return s},Pe=r=>r==null?void 0:r.replace("_","-"),Ln={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){var t,n;(n=(t=console==null?void 0:console[r])==null?void 0:t.apply)==null||n.call(t,console,e)}};class qe{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Ln,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(z(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new qe(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new qe(this.logger,e)}}var me=new qe;class Ze{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const s=this.observers[n].get(t)||0;this.observers[n].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s.apply(s,[e,...t])})}}class Jt extends Ze{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,s={}){var l,u;const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,i=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):z(n)&&a?o.push(...n.split(a)):o.push(n)));const c=Ke(this.data,o);return!c&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),c||!i||!z(n)?c:pt((u=(l=this.data)==null?void 0:l[e])==null?void 0:u[t],n,a)}addResource(e,t,n,s,a={silent:!1}){const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),qt(this.data,o,s),a.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const a in n)(z(n[a])||Array.isArray(n[a]))&&this.addResource(e,t,a,n[a],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,a,i={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),s=n,n=t,t=o[1]),this.addNamespaces(t);let c=Ke(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Sr(c,n,a):c={...c,...n},qt(this.data,o,c),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var wr={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,n,s){return r.forEach(a=>{var i;e=((i=this.processors[a])==null?void 0:i.process(e,t,n,s))??e}),e}};const Xt={},Zt=r=>!z(r)&&typeof r!="boolean"&&typeof r!="number";class Je extends Ze{constructor(e,t={}){super(),En(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=me.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(e==null)return!1;const s=this.resolve(e,n);return(s==null?void 0:s.res)!==void 0}extractFromKey(e,t){let n=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let a=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!An(e,n,s);if(i&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:z(a)?[a]:a};const l=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(l[0])>-1)&&(a=l.shift()),e=l.join(s)}return{key:e,namespaces:z(a)?[a]:a}}translate(e,t,n){let s=typeof t=="object"?{...t}:t;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(s={...s}),s||(s={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const a=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:o,namespaces:c}=this.extractFromKey(e[e.length-1],s),l=c[c.length-1];let u=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");const f=s.lng||this.language,d=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return d?a?{res:`${l}${u}${o}`,usedKey:o,exactUsedKey:o,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:`${l}${u}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:o;const m=this.resolve(e,s);let h=m==null?void 0:m.res;const y=(m==null?void 0:m.usedKey)||o,x=(m==null?void 0:m.exactUsedKey)||o,w=["[object Number]","[object Function]","[object RegExp]"],E=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject,S=s.count!==void 0&&!z(s.count),v=Je.hasDefaultValue(s),I=S?this.pluralResolver.getSuffix(f,s.count,s):"",$=s.ordinal&&S?this.pluralResolver.getSuffix(f,s.count,{ordinal:!1}):"",W=S&&!s.ordinal&&s.count===0,R=W&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${I}`]||s[`defaultValue${$}`]||s.defaultValue;let P=h;D&&!h&&v&&(P=R);const j=Zt(P),M=Object.prototype.toString.apply(P);if(D&&P&&j&&w.indexOf(M)<0&&!(z(E)&&Array.isArray(P))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const N=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,P,{...s,ns:c}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(m.res=N,m.usedParams=this.getUsedParamsDetails(s),m):N}if(i){const N=Array.isArray(P),B=N?[]:{},q=N?x:y;for(const K in P)if(Object.prototype.hasOwnProperty.call(P,K)){const Z=`${q}${i}${K}`;v&&!h?B[K]=this.translate(Z,{...s,defaultValue:Zt(R)?R[K]:void 0,joinArrays:!1,ns:c}):B[K]=this.translate(Z,{...s,joinArrays:!1,ns:c}),B[K]===Z&&(B[K]=P[K])}h=B}}else if(D&&z(E)&&Array.isArray(h))h=h.join(E),h&&(h=this.extendTranslation(h,e,s,n));else{let N=!1,B=!1;!this.isValidLookup(h)&&v&&(N=!0,h=R),this.isValidLookup(h)||(B=!0,h=o);const K=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&B?void 0:h,Z=v&&R!==h&&this.options.updateMissing;if(B||N||Z){if(this.logger.log(Z?"updateKey":"missingKey",f,l,o,Z?R:h),i){const g=this.resolve(o,{...s,keySeparator:!1});g&&g.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let H=[];const _=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&_&&_[0])for(let g=0;g<_.length;g++)H.push(_[g]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(s.lng||this.language):H.push(s.lng||this.language);const p=(g,T,C)=>{var A;const O=v&&C!==h?C:K;this.options.missingKeyHandler?this.options.missingKeyHandler(g,l,T,O,Z,s):(A=this.backendConnector)!=null&&A.saveMissing&&this.backendConnector.saveMissing(g,l,T,O,Z,s),this.emit("missingKey",g,l,T,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?H.forEach(g=>{const T=this.pluralResolver.getSuffixes(g,s);W&&s[`defaultValue${this.options.pluralSeparator}zero`]&&T.indexOf(`${this.options.pluralSeparator}zero`)<0&&T.push(`${this.options.pluralSeparator}zero`),T.forEach(C=>{p([g],o+C,s[`defaultValue${C}`]||R)})}):p(H,o,R))}h=this.extendTranslation(h,e,s,m,n),B&&h===o&&this.options.appendNamespaceToMissingKey&&(h=`${l}${u}${o}`),(B||N)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${o}`:o,N?h:void 0,s))}return a?(m.res=h,m.usedParams=this.getUsedParamsDetails(s),m):h}extendTranslation(e,t,n,s,a){var c,l;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const u=z(e)&&(((l=n==null?void 0:n.interpolation)==null?void 0:l.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(u){const m=e.match(this.interpolator.nestingRegexp);f=m&&m.length}let d=n.replace&&!z(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,n.lng||this.language||s.usedLng,n),u){const m=e.match(this.interpolator.nestingRegexp),h=m&&m.length;f<h&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...m)=>(a==null?void 0:a[0])===m[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${t[0]}`),null):this.translate(...m,t),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,o=z(i)?[i]:i;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=wr.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,a,i,o;return z(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(n))return;const l=this.extractFromKey(c,t),u=l.key;s=u;let f=l.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const d=t.count!==void 0&&!z(t.count),m=d&&!t.ordinal&&t.count===0,h=t.context!==void 0&&(z(t.context)||typeof t.context=="number")&&t.context!=="",y=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);f.forEach(x=>{var w,E;this.isValidLookup(n)||(o=x,!Xt[`${y[0]}-${x}`]&&((w=this.utils)!=null&&w.hasLoadedNamespace)&&!((E=this.utils)!=null&&E.hasLoadedNamespace(o))&&(Xt[`${y[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${y.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(D=>{var I;if(this.isValidLookup(n))return;i=D;const S=[u];if((I=this.i18nFormat)!=null&&I.addLookupKeys)this.i18nFormat.addLookupKeys(S,u,D,x,t);else{let $;d&&($=this.pluralResolver.getSuffix(D,t.count,t));const W=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(S.push(u+$),t.ordinal&&$.indexOf(R)===0&&S.push(u+$.replace(R,this.options.pluralSeparator)),m&&S.push(u+W)),h){const P=`${u}${this.options.contextSeparator}${t.context}`;S.push(P),d&&(S.push(P+$),t.ordinal&&$.indexOf(R)===0&&S.push(P+$.replace(R,this.options.pluralSeparator)),m&&S.push(P+W))}}let v;for(;v=S.pop();)this.isValidLookup(n)||(a=v,n=this.getResource(D,x,v,t))}))})}),{res:n,usedKey:s,exactUsedKey:a,usedLng:i,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n,s={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!z(e.replace);let s=n?e.replace:e;if(n&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const a of t)delete s[a]}return s}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class Qt{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=me.create("languageUtils")}getScriptPartFromCode(e){if(e=Pe(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Pe(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(z(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(n=>{if(t)return;const s=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(n=>{if(t)return;const s=this.getScriptPartFromCode(n);if(this.isSupportedCode(s))return t=s;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return t=a;t=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&(i.indexOf("-")>0&&a.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===a||i.indexOf(a)===0&&a.length>1))return i})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),z(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),s=[],a=i=>{i&&(this.isSupportedCode(i)?s.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return z(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):z(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const er={zero:0,one:1,two:2,few:3,many:4,other:5},tr={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class _n{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=me.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Pe(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:s});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let i;try{i=new Intl.PluralRules(n,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),tr;if(!e.match(/-|_/))return tr;const c=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(c,t)}return this.pluralRulesCache[a]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(s=>`${t}${s}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((s,a)=>er[s]-er[a]).map(s=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,t,n={}){const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const rr=(r,e,t,n=".",s=!0)=>{let a=Rn(r,e,t);return!a&&s&&z(t)&&(a=pt(r,t,n),a===void 0&&(a=pt(e,t,n))),a},ct=r=>r.replace(/\$/g,"$$$$");class kn{constructor(e={}){var t;this.logger=me.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:a,prefixEscaped:i,suffix:o,suffixEscaped:c,formatSeparator:l,unescapeSuffix:u,unescapePrefix:f,nestingPrefix:d,nestingPrefixEscaped:m,nestingSuffix:h,nestingSuffixEscaped:y,nestingOptionsSeparator:x,maxReplaces:w,alwaysFormat:E}=e.interpolation;this.escape=t!==void 0?t:jn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Ee(a):i||"{{",this.suffix=o?Ee(o):c||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?Ee(d):m||Ee("$t("),this.nestingSuffix=h?Ee(h):y||Ee(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=w||1e3,this.alwaysFormat=E!==void 0?E:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,n)=>(t==null?void 0:t.source)===n?(t.lastIndex=0,t):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,s){var m;let a,i,o;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=h=>{if(h.indexOf(this.formatSeparator)<0){const E=rr(t,c,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,n,{...s,...t,interpolationkey:h}):E}const y=h.split(this.formatSeparator),x=y.shift().trim(),w=y.join(this.formatSeparator).trim();return this.format(rr(t,c,x,this.options.keySeparator,this.options.ignoreJSONStructure),w,n,{...s,...t,interpolationkey:x})};this.resetRegExp();const u=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((m=s==null?void 0:s.interpolation)==null?void 0:m.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>ct(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?ct(this.escape(h)):ct(h)}].forEach(h=>{for(o=0;a=h.regex.exec(e);){const y=a[1].trim();if(i=l(y),i===void 0)if(typeof u=="function"){const w=u(e,a,s);i=z(w)?w:""}else if(s&&Object.prototype.hasOwnProperty.call(s,y))i="";else if(f){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),i="";else!z(i)&&!this.useRawValueToEscape&&(i=Gt(i));const x=h.safeValue(i);if(e=e.replace(a[0],x),f?(h.regex.lastIndex+=i.length,h.regex.lastIndex-=a[0].length):h.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(c,l)=>{const u=this.nestingOptionsSeparator;if(c.indexOf(u)<0)return c;const f=c.split(new RegExp(`${u}[ ]*{`));let d=`{${f[1]}`;c=f[0],d=this.interpolate(d,i);const m=d.match(/'/g),h=d.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!h||h.length%2!==0)&&(d=d.replace(/'/g,'"'));try{i=JSON.parse(d),l&&(i={...l,...i})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,y),`${c}${u}${d}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];i={...n},i=i.replace&&!z(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const u=s[1].split(this.formatSeparator).map(f=>f.trim());s[1]=u.shift(),c=u,l=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!z(a))return a;z(a)||(a=Gt(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),l&&(a=c.reduce((u,f)=>this.format(u,f,n.lng,{...n,interpolationkey:s[1].trim()}),a.trim())),e=e.replace(s[0],a),this.regexp.lastIndex=0}return e}}const In=r=>{let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const n=r.split("(");e=n[0].toLowerCase().trim();const s=n[1].substring(0,n[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(i=>{if(i){const[o,...c]=i.split(":"),l=c.join(":").trim().replace(/^'+|'+$/g,""),u=o.trim();t[u]||(t[u]=l),l==="false"&&(t[u]=!1),l==="true"&&(t[u]=!0),isNaN(l)||(t[u]=parseInt(l,10))}})}return{formatName:e,formatOptions:t}},nr=r=>{const e={};return(t,n,s)=>{let a=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(a={...a,[s.interpolationkey]:void 0});const i=n+JSON.stringify(a);let o=e[i];return o||(o=r(Pe(n),s),e[i]=o),o(t)}},Nn=r=>(e,t,n)=>r(Pe(t),n)(e);class Mn{constructor(e={}){this.logger=me.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?nr:Nn;this.formats={number:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a});return o=>i.format(o)}),currency:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a,style:"currency"});return o=>i.format(o)}),datetime:n((s,a)=>{const i=new Intl.DateTimeFormat(s,{...a});return o=>i.format(o)}),relativetime:n((s,a)=>{const i=new Intl.RelativeTimeFormat(s,{...a});return o=>i.format(o,a.range||"day")}),list:n((s,a)=>{const i=new Intl.ListFormat(s,{...a});return o=>i.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=nr(t)}format(e,t,n,s={}){const a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(o=>o.indexOf(")")>-1)){const o=a.findIndex(c=>c.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,c)=>{var f;const{formatName:l,formatOptions:u}=In(c);if(this.formats[l]){let d=o;try{const m=((f=s==null?void 0:s.formatParams)==null?void 0:f[s.interpolationkey])||{},h=m.locale||m.lng||s.locale||s.lng||n;d=this.formats[l](o,h,{...u,...s,...m})}catch(m){this.logger.warn(m)}return d}else this.logger.warn(`there was no format function for ${l}`);return o},e)}}const Fn=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Vn extends Ze{constructor(e,t,n,s={}){var a,i;super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=me.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(i=(a=this.backend)==null?void 0:a.init)==null||i.call(a,n,s.backend,s)}queueLoad(e,t,n,s){const a={},i={},o={},c={};return e.forEach(l=>{let u=!0;t.forEach(f=>{const d=`${l}|${f}`;!n.reload&&this.store.hasResourceBundle(l,f)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?i[d]===void 0&&(i[d]=!0):(this.state[d]=1,u=!1,i[d]===void 0&&(i[d]=!0),a[d]===void 0&&(a[d]=!0),c[f]===void 0&&(c[f]=!0)))}),u||(o[l]=!0)}),(Object.keys(a).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(a),pending:Object.keys(i),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(c)}}loaded(e,t,n){const s=e.split("|"),a=s[0],i=s[1];t&&this.emit("failedLoading",a,i,t),!t&&n&&this.store.addResourceBundle(a,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const o={};this.queue.forEach(c=>{On(c.loaded,[a],i),Fn(c,e),t&&c.errors.push(t),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(l=>{o[l]||(o[l]={});const u=c.loaded[l];u.length&&u.forEach(f=>{o[l][f]===void 0&&(o[l][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(c=>!c.done)}read(e,t,n,s=0,a=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:a,callback:i});return}this.readingCalls++;const o=(l,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(l&&u&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,a*2,i)},a);return}i(l,u)},c=this.backend[n].bind(this.backend);if(c.length===2){try{const l=c(e,t);l&&typeof l.then=="function"?l.then(u=>o(null,u)).catch(o):o(null,l)}catch(l){o(l)}return}return c(e,t,o)}prepareLoading(e,t,n={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();z(e)&&(e=this.languageUtils.toResolveHierarchy(e)),z(t)&&(t=[t]);const a=this.queueLoad(e,t,n,s);if(!a.toLoad.length)return a.pending.length||s(),null;a.toLoad.forEach(i=>{this.loadOne(i)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),s=n[0],a=n[1];this.read(s,a,"read",void 0,void 0,(i,o)=>{i&&this.logger.warn(`${t}loading namespace ${a} for language ${s} failed`,i),!i&&o&&this.logger.log(`${t}loaded namespace ${a} for language ${s}`,o),this.loaded(e,i,o)})}saveMissing(e,t,n,s,a,i={},o=()=>{}){var c,l,u,f,d;if((l=(c=this.services)==null?void 0:c.utils)!=null&&l.hasLoadedNamespace&&!((f=(u=this.services)==null?void 0:u.utils)!=null&&f.hasLoadedNamespace(t))){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((d=this.backend)!=null&&d.create){const m={...i,isUpdate:a},h=this.backend.create.bind(this.backend);if(h.length<6)try{let y;h.length===5?y=h(e,t,n,s,m):y=h(e,t,n,s),y&&typeof y.then=="function"?y.then(x=>o(null,x)).catch(o):o(null,y)}catch(y){o(y)}else h(e,t,n,s,o,m)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const sr=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),z(r[1])&&(e.defaultValue=r[1]),z(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const t=r[3]||r[2];Object.keys(t).forEach(n=>{e[n]=t[n]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ar=r=>{var e,t;return z(r.ns)&&(r.ns=[r.ns]),z(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),z(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((t=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},Ve=()=>{},Yn=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class Ae extends Ze{constructor(e={},t){if(super(),this.options=ar(e),this.services={},this.logger=me,this.modules={external:[]},Yn(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(z(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=sr();this.options={...n,...this.options,...ar(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const s=l=>l?typeof l=="function"?new l:l:null;if(!this.options.isClone){this.modules.logger?me.init(s(this.modules.logger),this.options):me.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=Mn;const u=new Qt(this.options);this.store=new Jt(this.options.resources,this.options);const f=this.services;f.logger=me,f.resourceStore=this.store,f.languageUtils=u,f.pluralResolver=new _n(u,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),l&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(f.formatter=s(l),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new kn(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Vn(s(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(d,...m)=>{this.emit(d,...m)}),this.modules.languageDetector&&(f.languageDetector=s(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=s(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new Je(this.services,this.options),this.translator.on("*",(d,...m)=>{this.emit(d,...m)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Ve),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(l=>{this[l]=(...u)=>this.store[l](...u)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...u)=>(this.store[l](...u),this)});const o=Ce(),c=()=>{const l=(u,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(f),t(u,f)};if(this.languages&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),o}loadResources(e,t=Ve){var a,i;let n=t;const s=z(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const o=[],c=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(f=>{f!=="cimode"&&o.indexOf(f)<0&&o.push(f)})};s?c(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>c(u)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,l=>c(l)),this.services.backendConnector.load(o,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(l)})}else n(null)}reloadResources(e,t,n){const s=Ce();return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Ve),this.services.backendConnector.reload(e,t,a=>{s.resolve(),n(a)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&wr.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Ce();this.emit("languageChanging",e);const s=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},a=(o,c)=>{c?this.isLanguageChangingTo===e&&(s(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,n.resolve((...l)=>this.t(...l)),t&&t(o,(...l)=>this.t(...l))},i=o=>{var u,f;!e&&!o&&this.services.languageDetector&&(o=[]);const c=z(o)?o:o&&o[0],l=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(z(o)?[o]:o);l&&(this.language||s(l),this.translator.language||this.translator.changeLanguage(l),(f=(u=this.services.languageDetector)==null?void 0:u.cacheUserLanguage)==null||f.call(u,l)),this.loadResources(l,d=>{a(d,l)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?i(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e),n}getFixedT(e,t,n){const s=(a,i,...o)=>{let c;typeof i!="object"?c=this.options.overloadTranslationOptionHandler([a,i].concat(o)):c={...i},c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||n||s.keyPrefix);const l=this.options.keySeparator||".";let u;return c.keyPrefix&&Array.isArray(a)?u=a.map(f=>`${c.keyPrefix}${l}${f}`):u=c.keyPrefix?`${c.keyPrefix}${l}${a}`:a,this.t(u,c)};return z(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}t(...e){var t;return(t=this.translator)==null?void 0:t.translate(...e)}exists(...e){var t;return(t=this.translator)==null?void 0:t.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const i=(o,c)=>{const l=this.services.backendConnector.state[`${o}|${c}`];return l===-1||l===0||l===2};if(t.precheck){const o=t.precheck(this,i);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!s||i(a,e)))}loadNamespaces(e,t){const n=Ce();return this.options.ns?(z(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Ce();z(e)&&(e=[e]);const s=this.options.preload||[],a=e.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return a.length?(this.options.preload=s.concat(a),this.loadResources(i=>{n.resolve(),t&&t(i)}),n):(t&&t(),Promise.resolve())}dir(e){var s,a;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new Qt(sr());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new Ae(e,t)}cloneInstance(e={},t=Ve){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new Ae(s);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(o=>{a[o]=this[o]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const o=Object.keys(this.store.data).reduce((c,l)=>(c[l]={...this.store.data[l]},c[l]=Object.keys(c[l]).reduce((u,f)=>(u[f]={...c[l][f]},u),c[l]),c),{});a.store=new Jt(o,s),a.services.resourceStore=a.store}return a.translator=new Je(a.services,s),a.translator.on("*",(o,...c)=>{a.emit(o,...c)}),a.init(s,t),a.translator.options=s,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const se=Ae.createInstance();se.createInstance=Ae.createInstance;se.createInstance;se.dir;se.init;se.loadResources;se.reloadResources;se.use;se.changeLanguage;se.getFixedT;se.t;se.exists;se.setDefaultNamespace;se.hasLoadedNamespace;se.loadNamespaces;se.loadLanguages;const Un={Friday:"Venerdì",FridayShort:"Ven",Monday:"Lunedì",MondayShort:"Lun",Saturday:"Sabato",SaturdayShort:"Sab",Sunday:"Domenica",SundayShort:"Dom",Tuesday:"Martedì",TuesdayShort:"Mar",Thursday:"Giovedì",ThursdayShort:"Gio",Wednesday:"Mercoledì",WednesdayShort:"Mer"},Wn={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},Hn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando"},Bn={Date:{NextDay:"Giorno Successivo",NextMonth:"Mese Successivo",NextWeek:"Settimana Successiva",NextYear:"Anno Successivo",PreviousDay:"Giorno Precedente",PreviousMonth:"Mese Precedente",PreviousWeek:"Settimana Precedente",PreviousYear:"Anno Precedente",Today:"Oggi",Tomorrow:"Domani",Yesterday:"Ieri"},Day:Un,Month:Wn,Generic:Hn},Gn={Friday:"Friday",FridayShort:"Fri",Monday:"Monday",MondayShort:"Mon",Saturday:"Saturday",SaturdayShort:"Sat",Sunday:"Sunday",SundayShort:"Sun",Tuesday:"Tuesday",TuesdayShort:"Tue",Thursday:"Thursday",ThursdayShort:"Thu",Wednesday:"Wednesday",WednesdayShort:"Wed"},zn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},Kn={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command"},qn={Date:{NextDay:"Next Day",NextMonth:"Next Month",NextWeek:"Next Week",NextYear:"Next Year",PreviousDay:"Previous Day",PreviousMonth:"Previous Month",PreviousWeek:"Previous Week",PreviousYear:"Previous Year",Today:"Today",Tomorrow:"Tomorrow",Yesterday:"Yesterday"},Day:Gn,Month:zn,Generic:Kn};function ir(r,e){return new RegExp(Jn(r),e)}function Jn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xn(r,e,t,n){let s=e;const a=Zn(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=Qn(s);return new Intl.NumberFormat(n,i).format(a)}function Zn(r,e,t,n,s){let a=r;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const c=o=="."?",":".";a=a.replace(ir(c,"g"),""),a=a.replace(ir(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function Qn(r){const e={};r.includes(",")?e.useGrouping=!0:e.useGrouping=!1;const t=r.indexOf(".");if(t>-1){const s=(r.substring(t+1).match(/0/g)||[]).length;e.minimumFractionDigits=s,e.maximumFractionDigits=s}else e.minimumFractionDigits=0,e.maximumFractionDigits=0;return e}se.init({lng:typeof navigator<"u"&&navigator.language.split("-")[0]||"en",fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1,format:(r,e,t,n)=>{const s=(n==null?void 0:n.type)??"number";try{switch(s){case"date":{const a=r instanceof Date?r:new Date(r);return new Intl.DateTimeFormat(t,{dateStyle:e||"short"}).format(a)}default:case"number":{const a=(n==null?void 0:n.inputIsLocalized)??!1;return Xn(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:qn},it:{translation:Bn}}});const es=(r,e,t,n)=>se.format(r,e,t||se.language,n),ts=(r,e)=>se.t(r,e);function Qe(){const r=L.useCallback((n,s,a,i)=>es(n,s,a||void 0,i),[]),e=L.useCallback(()=>se.languages[0],[]),t=L.useCallback((n,s)=>ts(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var St=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r))(St||{}),oe=(r=>(r.MONDAY="Day.Monday",r.MONDAY_SHORT="Day.MondayShort",r.TUESDAY="Day.Tuesday",r.TUESDAY_SHORT="Day.TuesdayShort",r.WEDNESDAY="Day.Wednesday",r.WEDNESDAY_SHORT="Day.WednesdayShort",r.THURSDAY="Day.Thursday",r.THURSDAY_SHORT="Day.ThursdayShort",r.FRIDAY="Day.Friday",r.FRIDAY_SHORT="Day.FridayShort",r.SATURDAY="Day.Saturday",r.SATURDAY_SHORT="Day.SaturdayShort",r.SUNDAY="Day.Sunday",r.SUNDAY_SHORT="Day.SundayShort",r))(oe||{}),ue=(r=>(r.JANUARY="Month.January",r.FEBRUARY="Month.February",r.MARCH="Month.March",r.APRIL="Month.April",r.MAY="Month.May",r.JUNE="Month.June",r.JULY="Month.July",r.AUGUST="Month.August",r.SEPTEMBER="Month.September",r.OCTOBER="Month.October",r.NOVEMBER="Month.November",r.DECEMBER="Month.December",r))(ue||{}),ht=(r=>(r.PREVIOUS_DAY="Date.PreviousDay",r.PREVIOUS_WEEK="Date.PreviousWeek",r.PREVIOUS_MONTH="Date.PreviousMonth",r.PREVIOUS_YEAR="Date.PreviousYear",r.NEXT_DAY="Date.NextDay",r.NEXT_WEEK="Date.NextWeek",r.NEXT_MONTH="Date.NextMonth",r.NEXT_YEAR="Date.NextYear",r.YESTERDAY="Date.Yesterday",r.TODAY="Date.Today",r.TOMORROW="Date.Tomorrow",r))(ht||{});function rs({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=Qe(),i=()=>{if(!n)return;const _=new Date(n);return isNaN(_.getTime())?void 0:_},[o]=L.useState(new Date),[c,l]=L.useState(r||i()||new Date),[u,f]=L.useState(c?c.getMonth():new Date().getMonth()),[d,m]=L.useState(c?c.getFullYear():new Date().getFullYear()),[h,y]=L.useState(c?c.getDate():null),x=L.useRef(null),w=L.useRef([]),E=[a(ue.JANUARY),a(ue.FEBRUARY),a(ue.MARCH),a(ue.APRIL),a(ue.MAY),a(ue.JUNE),a(ue.JULY),a(ue.AUGUST),a(ue.SEPTEMBER),a(ue.OCTOBER),a(ue.NOVEMBER),a(ue.DECEMBER)],D=[{value:a(oe.SUNDAY_SHORT),full:a(oe.SUNDAY)},{value:a(oe.MONDAY_SHORT),full:a(oe.MONDAY)},{value:a(oe.TUESDAY_SHORT),full:a(oe.TUESDAY)},{value:a(oe.WEDNESDAY_SHORT),full:a(oe.WEDNESDAY)},{value:a(oe.THURSDAY_SHORT),full:a(oe.THURSDAY)},{value:a(oe.FRIDAY_SHORT),full:a(oe.FRIDAY)},{value:a(oe.SATURDAY_SHORT),full:a(oe.SATURDAY)}],S=_=>t.some(p=>{const g=p.start.getTime(),T=p.end.getTime(),C=_.getTime();return C>=g&&C<=T}),v=_=>{S(_)||(l(_),y(_.getDate()),e&&e(qr(_)))},I=()=>{u===0?(f(11),m(d-1)):f(u-1),y(1)},$=()=>{u===11?(f(0),m(d+1)):f(u+1),y(1)},W=(_,p)=>new Date(_,p+1,0).getDate(),R=(_,p)=>new Date(_,p,1).getDay(),P=_=>{var g;const p=B.findIndex(T=>T!==null&&T.getDate()===_);p!==-1&&w.current[p]&&((g=w.current[p])==null||g.focus(),y(_))},j=(_,p)=>{const g=B[p];if(!g)return;const T=W(d,u),C=g.getDate();switch(_.key){case"ArrowRight":_.preventDefault();{let O=C+1,A=new Date(d,u,O);if(O>T){const V=u===11?d+1:d,Y=u===11?0:u+1;O=1,A=new Date(V,Y,O),$(),setTimeout(()=>{M(1,"forward")},0);return}S(A)?M(O,"forward"):P(O)}break;case"Tab":break;case"ArrowLeft":_.preventDefault();{let O=C-1,A=new Date(d,u,O);if(O<1){const V=u===0?d-1:d,Y=u===0?11:u-1,F=W(V,Y);O=F,A=new Date(V,Y,O),I(),setTimeout(()=>{M(F,"backward")},0);return}S(A)?M(O,"backward"):P(O)}break;case"ArrowUp":_.preventDefault();{let O=C-7,A=new Date(d,u,O);if(O<1){const V=u===0?d-1:d,Y=u===0?11:u-1;O=W(V,Y)+O,A=new Date(V,Y,O),I(),setTimeout(()=>{M(O,"backward")},0);return}S(A)?M(O,"backward"):P(O)}break;case"ArrowDown":_.preventDefault();{let O=C+7,A=new Date(d,u,O);if(O>T){const V=u===11?d+1:d,Y=u===11?0:u+1;O=O-T,A=new Date(V,Y,O),$(),setTimeout(()=>{M(O,"forward")},0);return}S(A)?M(O,"forward"):P(O)}break;case"Home":_.preventDefault(),M(1,"forward");break;case"End":_.preventDefault(),M(T,"backward");break;case"PageUp":_.preventDefault(),I(),setTimeout(()=>{const O=W(u===0?d-1:d,u===0?11:u-1),A=Math.min(C,O);M(A,"forward")},0);break;case"PageDown":_.preventDefault(),$(),setTimeout(()=>{const O=W(u===11?d+1:d,u===11?0:u+1),A=Math.min(C,O);M(A,"forward")},0);break;case" ":case"Space":if(S(g))return;y(g.getDate()),l(g);break;case"Enter":_.preventDefault(),v(g);break}},M=(_,p)=>{const g=W(d,u);if(p==="forward"){for(let T=_;T<=g;T++){const C=new Date(d,u,T);if(!S(C)){P(T);return}}$(),setTimeout(()=>{M(1,"forward")},0)}else{for(let A=_;A>=1;A--){const V=new Date(d,u,A);if(!S(V)){P(A);return}}const T=u===0?d-1:d,C=u===0?11:u-1,O=W(T,C);I(),setTimeout(()=>{M(O,"backward")},0)}},B=(()=>{const _=W(d,u),p=R(d,u),g=[];for(let T=0;T<p;T++)g.push(null);for(let T=1;T<=_;T++){const C=new Date(d,u,T);g.push(C)}return g})(),q=[];let K=[];B.forEach((_,p)=>{if(K.push(_),K.length===7||p===B.length-1){for(;K.length<7;)K.push(null);q.push(K),K=[]}}),L.useEffect(()=>{var _;if(h!==null){const p=B.findIndex(g=>g!==null&&g.getDate()===h);p!==-1&&w.current[p]&&((_=w.current[p])==null||_.focus())}},[u,d,h,B]);const Z={label:"smp-datepickercalendar-label",wrapper:"smp-datepickercalendar",calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(_,p,g,T)=>`smp-datepickercalendar-td
|
|
46
|
+
${_?"smp-datepickercalendar-td-today":""}
|
|
47
47
|
${p?"smp-datepickercalendar-td-selected":""}
|
|
48
48
|
${g?"smp-datepickercalendar-td-focused":""}
|
|
49
|
-
${T?"smp-datepickercalendar-td-disabled":""}`},q=()=>`${E[f]} ${d.toString()}`;return b.jsxs("div",{className:H.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[b.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[b.jsx(Re,{onClick:C,ariaLabel:a(pt.PREVIOUS_MONTH),bindValue:"<",appearance:"ghost",variant:"base"}),b.jsx("div",{"aria-label":q(),className:H.label,children:q()}),b.jsx(Re,{onClick:k,ariaLabel:a(pt.NEXT_MONTH),bindValue:">",appearance:"ghost",variant:"base"})]}),b.jsxs("table",{ref:x,role:"grid","aria-label":`${a(xt.CALENDAR_FOR)} ${E[f]} ${d}`,className:H.table,children:[b.jsx("thead",{children:b.jsx("tr",{children:D.map(I=>b.jsx("th",{scope:"col",abbr:I.full,className:H.th,children:I.value},I.value))})}),b.jsx("tbody",{children:J.map((I,p)=>b.jsx("tr",{children:I.map((g,T)=>{const $=p*7+T;if(g===null)return b.jsx("td",{className:H.td(!1,!1,!1,!0)},`empty-${T}`);const O=g.getDate()===o.getDate()&&g.getMonth()===o.getMonth()&&g.getFullYear()===o.getFullYear(),P=c&&g.getDate()===c.getDate()&&g.getMonth()===c.getMonth()&&g.getFullYear()===c.getFullYear(),V=m===g.getDate(),Y=S(g);return b.jsx("td",{role:"gridcell","aria-selected":P,tabIndex:V?0:-1,onClick:()=>v(g),onKeyDown:M=>_(M,$),"aria-label":`${g.getDate()} ${E[g.getMonth()]} ${g.getFullYear()}`,"data-selected":P,"aria-disabled":Y,ref:M=>{w.current[$]=M},className:H.td(O,P,V,Y),children:g.getDate()},`day-${T}`)})},`week-${p}`))})]})]})}const Er=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,...s})=>{const[a,i]=A.useState(!1),[o,c]=A.useState(r||""),[l,f]=A.useState(""),{anchorRef:u,targetRef:d}=mt({position:"bottom",enabled:a});Be(d,()=>{i(!1)}),Be(u,()=>{if(typeof u=="object"&&u!==null&&"current"in u){const C=u.current.querySelector("input");C&&C===document.activeElement&&w()}}),br(a,d);const{format:h,getCurrentLanguage:m}=Ze(),y=A.useCallback(C=>{const k=C.length>5&&Gr(C,m())||C,W=h(k,void 0,void 0,{type:"date"}),R=typeof k!="string",j=R&&k.toISOString().substring(0,10)||"";return{isValid:R,formattedDate:W,isoDate:j,normalizedDate:k}},[m,h]);A.useEffect(()=>{const{formattedDate:C,isoDate:k,isValid:W}=y(r);c(W&&k||r),f(W&&C||r)},[r,h,y]);const x=()=>i(C=>!C),w=()=>{D(l)},E=C=>{D(C),i(!1)},D=C=>{const{isoDate:k,isValid:W}=y(C);t&&t(W&&k||C)},S=C=>{f(C)},v=C=>{C.key==="Enter"&&(C.preventDefault(),D(l))};return b.jsxs("div",{"data-component":"date-picker",children:[b.jsx(Se,{bindValue:l,placeholder:e,onBlur:w,onChange:S,onKeyDown:v,shapeIcon:"calendar",onShapeIconClick:x,ref:u,...s}),a&&b.jsx(rs,{disabledDateRanges:n,onDateChange:E,initialValue:ht(o)&&o||"",targetRef:d})]})},ns=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,placeholder:s,fun:a,onOptionsRequest:i,onChange:o})=>{const c=r.map(u=>u.bindValue),l=(u,d)=>{const h=[...r];if(u=="")h.pop();else{const m=h.findIndex(y=>y.bindValue===u&&y.optionalDisplayValue===d);m>=0?h.splice(m,1):h.push({bindValue:u,optionalDisplayValue:d})}o==null||o(h)},f={container:"smp-multipleAutocomplete-container"};return b.jsxs("div",{className:f.container,"data-component":"multiple-autocomplete",children:[b.jsx(bt,{elements:r,displayMode:e,isEditable:!0,onChange:u=>{o==null||o(u)}}),b.jsx(yt,{bindValue:"",fun:a,onChange:l,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:s,onOptionsRequest:i,_multiActiveIndex:c})]})},Tr=({...r})=>{const[e,t]=A.useState(!1),n=e?"visibility-off":"visibility";return b.jsx(Se,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},ss=({...r})=>{const[e,t]=A.useState(r.bindValue),{translate:n}=Ze(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return b.jsx(Se,{...r,placeholder:r.placeholder?r.placeholder:n(xt.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})};class xe{constructor(e,t){ve(this,"class");ve(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new xe(e,e.k.split(";"))}static fromString(e){return new xe({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const Ue=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),ir=r=>{const e=xe.fromDataObj(r.obj),t=r.decode?xe.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},as=(r,e)=>{const t=new xe(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new xe(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return Ue(r,t,n)},St=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,options:c,onChange:l,onClick:f,onEnter:u,onBlur:d,onOptionsRequest:h,isEditable:m})=>{const y={obj:t,shape:e,decode:r,icon:s,fun:a},x={onBlur:d,onOptionsRequest:h,fun:a,icon:s,label:o,isEditable:m,...n},w=(S,v,C)=>Hr(t)?Ue(S,new He(t,v).getLegacyValue()):Ue(S,v,C),E=S=>Ue(y,new We(t,S).getLegacyValue()),D=S=>as(y,S);switch(e){case ie.AUTOCOMPLETE:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(v,C)=>{l==null||l(w(y,v,C))}};return b.jsx(yt,{...S})}case ie.BUTTON:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{f==null||f(w(y,t.k))}};return b.jsx(Re,{...S})}case ie.BUTTON_LIST:{const S={...x,options:c,onClick:(v,C)=>{const k={...y,fun:C};f==null||f(w(k,v))}};return b.jsx(yr,{...S})}case ie.COMBOBOX:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(v,C)=>{l==null||l(w(y,v,C))}};return b.jsx(xr,{...S})}case ie.CHECKBOX:{const S={...x,bindValue:We.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:v=>{l==null||l(E(v))}};return b.jsx(vr,{...S})}case ie.CHIP:{const S={...x,elements:ir(y)};return b.jsx(bt,{...S})}case ie.DATE:{const S={...x,bindValue:He.fromDataObj(t).getValue(),onChange:v=>{l==null||l(w(y,v))}};return b.jsx(Er,{...S})}case ie.ICON:case ie.IMAGE:{const S={...x,icon:s,placeholderIcon:i,isInteractable:!!x.fun,onClick:()=>{f==null||f(w(y,t.k))}};return b.jsx(le,{...S})}case ie.MULTI_AUTOCOMPLETE:{const S={...x,elements:ir(y),onChange:v=>{l==null||l(D(v))}};return b.jsx(ns,{...S})}case ie.PASSWORD:{const S={...x,bindValue:t.k,onChange:v=>{l==null||l(w(y,v))}};return b.jsx(Tr,{...S})}case ie.SPOTLIGHT:{const S={...x,bindValue:t.k,onEnter:v=>{u==null||u(w(y,v))}};return b.jsx(ss,{...S})}case ie.TEXT_FIELD:case void 0:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:v=>{l==null||l(w(y,v))}};return b.jsx(Se,{...S})}}},Or=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var E;const[a,i]=A.useState(!1),o=Ye(r)&&!!((E=r.children)!=null&&E.length),c=r.cells&&Object.keys(r.cells).length>0,l=o,f=t*20,u=()=>{o&&i(!a)},d={content:`${be.rowContent} ${o?be.clickable:""}`,toggle:`${be.toggle}`,indent:`${be.indent}`,cell:`${be.cell}`},h=D=>b.jsx(St,{...D}),m=()=>b.jsx("span",{className:d.toggle,children:l?a?"▶":"▼":" "}),y=()=>b.jsx("span",{className:d.indent,style:{width:`${f}px`},"aria-hidden":"true"}),x=()=>{const D=Ur(r)?"":r.decode||(c?"":"Untitled"),S=s??n*t;return b.jsxs("tr",{className:d.content,onClick:u,role:o?"button":"row","aria-expanded":o?!a:void 0,style:{height:`${n}px`,lineHeight:`calc(${n}px - 2*2px)`,transform:`translateY(${S}px)`},children:[Ye(r)&&b.jsxs("td",{className:be.leftSection,style:{height:`${n}px`},children:[y(),m(),b.jsx("span",{className:be.rowLabel,children:D})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([v,C])=>b.jsx("td",{className:d.cell,style:{width:e[v],minWidth:e[v],height:`${n}px`},children:h(C)},Wr(C)||v))]})},w=()=>{var D;return a||!o?null:b.jsx(b.Fragment,{children:Ye(r)&&((D=r.children)==null?void 0:D.map((S,v)=>b.jsx(Or,{row:S,level:t+1},`child-${v}`)))})};return b.jsxs(b.Fragment,{children:[x(),w()]})},is=({label:r,rowHeight:e=28,offsetTop:t=0,level:n=0,onClick:s,isExpanded:a})=>{const i={tr:"smp-groupRow-tr",td:"smp-groupRow-td"};return b.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:b.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[b.jsx(le,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),b.jsx(vt,{variant:"title",bindValue:r})]})})};function os(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function ls(r,e){return r.map(t=>{const n=e.find(s=>s.column===t.bindValue);return{column:t.bindValue,visible:(n==null?void 0:n.visible)??!0}})}function cs(r,e,t,n){const s=[];let a=0;return i(r,0,[]),{flatRows:s,offset:a};function i(u,d,h){if(d>=e.length){f(u);return}const m=e[d].column,y=o(u,m);for(const[x,w]of y){const E=[...h,x],D=c(E,d),S=n.has(D);s.push(l(x,D,d,S)),a+=t,S&&i(w,d+1,E)}}function o(u,d){var m;const h=new Map;for(const y of u){const x=((m=y.cells[d])==null?void 0:m.decode)??"N/D";h.has(x)||h.set(x,[]),h.get(x).push(y)}return h}function c(u,d){return`group-${u.join("-")}-${d}`}function l(u,d,h,m){return{isGroup:!0,value:u,cells:{},rowId:d,level:h,isExpanded:m}}function f(u){for(const d of u)s.push(d),a+=t}}const us=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return b.jsxs("div",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[b.jsx(le,{icon:"groups"}),b.jsx(bt,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})]})},fs=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var W;const[i,o]=A.useState(r),[c,l]=A.useState(n||[]),[f,u]=A.useState(new Set),d=Object.fromEntries(i&&i.columns.map(R=>[R.name,120])),[h,m]=A.useState(d),y=A.useRef(null);A.useEffect(()=>{var _,N;const R=((_=y.current)==null?void 0:_.clientWidth)??1e3;if(!((N=i==null?void 0:i.columns)!=null&&N.length))return;let j={};switch(s){case"fixed":j=Object.fromEntries(i.columns.map(F=>[F.name,120]));break;case"fit-grid":{const F=i.columns.filter(J=>J.visible),B=Math.floor(R/F.length);j=Object.fromEntries(F.map(J=>[J.name,B]));break}case"fit-content":j=Object.fromEntries(i.columns.map(F=>{const B=Math.max(...r.rows.map(I=>{var T;const p=(T=I==null?void 0:I.cells)==null?void 0:T[F.name],g=(p==null?void 0:p.decode)||(p==null?void 0:p.value);return g?String(g).length:0}),0),J=F.title?F.title.length:0,K=Math.max(B,J);return[F.name,Math.max(50,K*8+16)]}));break}m(j)},[s,r,i.columns]),A.useEffect(()=>{if(c!=null&&c.length&&r.rows){const{flatRows:R}=cs(r.rows,c,e,f);o({...r,rows:R})}else o(r)},[r,c,f,e]);const x=R=>{l(ls(R,c))},w=R=>{R.preventDefault();const j=R.dataTransfer.getData("text/plain");if(!j||c.some(F=>F.column===j))return;const N=[...c,{column:j,visible:!0}];l(N)},E=R=>{R.preventDefault()},{virtualItems:D,containerProps:S,innerProps:v}=hr({items:i.rows||[],itemHeight:e,containerHeight:t,overscan:5}),C=(R,j)=>{const _=R.clientX,N=h[j],F=J=>{const K=J.clientX-_,H=Math.max(50,N+K);m(q=>({...q,[j]:H}))},B=()=>{window.removeEventListener("mousemove",F),window.removeEventListener("mouseup",B)};window.addEventListener("mousemove",F),window.addEventListener("mouseup",B)},k={smpTable:`${Qe["smp-table"]}`,headerCell:`${Qe["smp-headerCell"]}`,resizer:`${Qe["smp-resizer"]}`};return b.jsx("div",{className:k.smpTable,...S,ref:y,children:b.jsxs("table",{children:[b.jsxs("thead",{children:[(n||a)&&b.jsx(us,{groups:c,onChange:x,onDrop:w,onDragOver:E}),b.jsx("tr",{children:i.columns&&((W=i.columns)==null?void 0:W.map(R=>R.visible&&b.jsxs("th",{className:k.headerCell,draggable:!0,onDragStart:j=>{j.dataTransfer.setData("text/plain",R.name)},style:{width:h[R.name],minWidth:h[R.name],maxWidth:h[R.name]},children:[b.jsx(vt,{variant:"title",bindValue:R.title}),b.jsx("div",{className:k.resizer,onMouseDown:j=>C(j,R.name),role:"region"})]},R.name)))})]}),b.jsx("tbody",{...v,children:D.map(({item:R,index:j,offsetTop:_})=>R.isGroup?b.jsx(is,{label:R.value||"",rowHeight:e,offsetTop:_,level:R.level,onClick:()=>{const N=R.rowId;N&&u(F=>os(F,N))},isExpanded:R.isExpanded},R.rowId||`group-${j}`):b.jsx(Or,{row:R,columnWidths:h,rowHeight:e,offsetTop:_,isGroup:!1},R.rowId||`row-${j}`))}),b.jsx("tfoot",{children:b.jsx("td",{children:"Tfooter here"})})]})})},ds=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},Rr=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:Rr(t.sections,e),content:t.content};let n=t.sections,s=t.content;return(i=t.content)!=null&&i.length&&t.columns&&+t.columns>1&&(n=ds(t.content.filter(c=>!!e[c.id]),+t.columns).map((c,l)=>({...t,id:`${t.id}-${l}`,content:c,gridCols:t.columns,horizontal:!0})),s=[]),{...t,sections:n,content:s}}),or=(r,e)=>{if(!e)return{};const t=r.some(n=>n.dim)?r.map(n=>n.dim||"auto").join(" "):`repeat(${r.length}, 1fr)`;return{[e]:t}},lr=r=>r.some(e=>e.dim&&!e.dim.endsWith("%")),de={"smp-layout":"_smp-layout_xrjwg_1","smp-layout-horizontal":"_smp-layout-horizontal_xrjwg_9","smp-layout-vertical":"_smp-layout-vertical_xrjwg_13","smp-layout-section-grid":"_smp-layout-section-grid_xrjwg_18","smp-layout-section-vertical":"_smp-layout-section-vertical_xrjwg_20","smp-layout-section-horizontal":"_smp-layout-section-horizontal_xrjwg_24","smp-layout-section-flex":"_smp-layout-section-flex_xrjwg_29","smp-layout-cell-container":"_smp-layout-cell-container_xrjwg_34","smp-grid-template-cols":"_smp-grid-template-cols_xrjwg_44","smp-grid-template-rows":"_smp-grid-template-rows_xrjwg_48","smp-layout-section-with-title":"_smp-layout-section-with-title_xrjwg_52","smp-layout-section-title":"_smp-layout-section-title_xrjwg_58"},Dr=({layout:r,cells:e})=>{var u;if(!((u=r.sections)!=null&&u.length))return b.jsx(b.Fragment,{});const t="--smp-grid-template-cols",n="--smp-grid-template-rows",s=Rr(r.sections,e),a=d=>d==null?void 0:d.reduce((h,m)=>{var D,S;let y="",x={},w={},E="";return(D=m.sections)!=null&&D.length?(y=de["smp-layout-section-grid"],x=a(m.sections),m.gridCols==null&&(E=`${de[m.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"]}`,(m.horizontal||lr(m.sections))&&(w=or(m.sections,m.horizontal?t:n)))):(S=m.content)!=null&&S.length&&(m.gridCols!==void 0&&m.gridCols>0?(y=de["smp-layout-section-grid"],E=`${de["smp-grid-template-cols"]}`,w={[t]:`repeat(${m.gridCols}, 1fr)`}):y=de["smp-layout-section-flex"]),{...h,...x,[m.id]:{classes:`${y} ${de[m.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${E} ${m.justify?`smp-justifyContent-${m.justify}`:""} ${m.align?`smp-alignItems-${m.align}`:""}`,styles:w}}},{}),i=a(s),o={container:`${de["smp-layout"]} ${r.horizontal?de["smp-layout-horizontal"]:de["smp-layout-vertical"]}`,sections:i},c=r.horizontal||lr(r.sections)?or(s,r.horizontal?t:n):{},l=d=>{var m;const h=b.jsx("div",{"smp-id":"section-"+d.id,className:o.sections[d.id].classes,style:o.sections[d.id].styles,children:(m=d.sections)!=null&&m.length?d.sections.map(y=>l(y)):d.content.map(y=>f(y,e[y.id],d.justify,d.align))},"section-"+d.id);return d.title?b.jsxs("div",{className:`${de["smp-layout-section-with-title"]}`,children:[b.jsx("span",{className:`${de["smp-layout-section-title"]} ${d.justify?`smp-justifyContent-${d.justify}`:""} ${d.align?`smp-alignItems-${d.align}`:""}`,children:b.jsx(cr,{label:d.title})}),h]}):h},f=(d,h,m,y)=>{const x=d.colSpan!==void 0?d.colSpan>0?d.colSpan:d.colStart!==void 0&&d.colStart<1?1:null:null,w=x!==null?`span ${x}`:d.colStart,E=d.colEnd!==void 0&&d.colEnd>0?d.colEnd:"",D={gridColumnStart:w,gridColumnEnd:E},S=`${de["smp-layout-cell-container"]} ${m?`smp-justifyContent-${m}`:""} ${y?`smp-alignItems-${y}`:""}`;return h?b.jsx("div",{className:S,style:{...D},"smp-id":d.id,children:b.jsx(St,{...h})},d.id):b.jsx(b.Fragment,{})};return b.jsx("div",{className:o.container,style:c,"smp-id":"layout",children:s==null?void 0:s.map(d=>l(d))})},ps=({data:r,onClick:e,onEnter:t})=>{var i,o;const[n,s]=A.useState(),a=A.useCallback(c=>{var f,u;if(!((f=c.rows)!=null&&f.length)||!((u=c.columns)!=null&&u.length))return{};const l=c.rows[0];return c.columns.filter(d=>d.visible).reduce((d,h)=>{const m=l.cells[h.name],y={...m,onChange:x=>{s(w=>w&&{...w,[h.name]:{...w[h.name],obj:{...w[h.name].obj,k:x.obj.k}}})},onClick:()=>{m.fun&&e&&e({...m})},onEnter:x=>{t&&t(x)}};return{...d,[h.name]:y}},{})},[e,t]);return A.useEffect(()=>{s(a(r))},[r,a]),!((i=r==null?void 0:r.rows)!=null&&i.length)||!((o=r.columns)!=null&&o.length)?null:n&&b.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:b.jsx(Dr,{layout:r.rows[0].layout,cells:n})})},ce=r=>r==null?!1:typeof r=="string"?r.toLocaleLowerCase()=="yes":r,hs=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:c,IconColName:l,IconColor:f="var(--smp-dashList-color-base)",NumberFormat:u,ForceUM:d,UmColName:h,UmColor:m="var(--smp-dashList-color-base)",ForceValue:y,ValueColName:x,ValueColor:w="var(--smp-dashList-color-base)",SelectLayout:E="1",onClick:D})=>{const S="N/A",v=(e==null?void 0:e.columns)||[],C=(e==null?void 0:e.rows)||[],k=C.length>0,W="--smp-dashList-color",R="smp-layout",j="descr",_="icon",N="um",F="value",B=i||"1em",J="18px",K="--smp-dashList-columns",H="--smp-dashList-fontSize",q={dash:(U="1")=>{const Z=p(U),te=Z,re=g(Z,j),fe=g(Z,_),ge=g(Z,N),pe=g(Z,F);return{container:te,descr:re,icon:fe,um:ge,value:pe}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
|
|
50
|
-
${ce(o)?"smp-dash-list-horizontal":""}`},{format:
|
|
49
|
+
${T?"smp-datepickercalendar-td-disabled":""}`},H=()=>`${E[u]} ${d.toString()}`;return b.jsxs("div",{className:Z.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[b.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[b.jsx(Re,{onClick:I,ariaLabel:a(ht.PREVIOUS_MONTH),bindValue:"<",appearance:"ghost",variant:"base"}),b.jsx("div",{"aria-label":H(),className:Z.label,children:H()}),b.jsx(Re,{onClick:$,ariaLabel:a(ht.NEXT_MONTH),bindValue:">",appearance:"ghost",variant:"base"})]}),b.jsxs("table",{ref:x,role:"grid","aria-label":`${a(St.CALENDAR_FOR)} ${E[u]} ${d}`,className:Z.table,children:[b.jsx("thead",{children:b.jsx("tr",{children:D.map(_=>b.jsx("th",{scope:"col",abbr:_.full,className:Z.th,children:_.value},_.value))})}),b.jsx("tbody",{children:q.map((_,p)=>b.jsx("tr",{children:_.map((g,T)=>{const C=p*7+T;if(g===null)return b.jsx("td",{className:Z.td(!1,!1,!1,!0)},`empty-${T}`);const O=g.getDate()===o.getDate()&&g.getMonth()===o.getMonth()&&g.getFullYear()===o.getFullYear(),A=c&&g.getDate()===c.getDate()&&g.getMonth()===c.getMonth()&&g.getFullYear()===c.getFullYear(),V=h===g.getDate(),Y=S(g);return b.jsx("td",{role:"gridcell","aria-selected":A,tabIndex:V?0:-1,onClick:()=>v(g),onKeyDown:F=>j(F,C),"aria-label":`${g.getDate()} ${E[g.getMonth()]} ${g.getFullYear()}`,"data-selected":A,"aria-disabled":Y,ref:F=>{w.current[C]=F},className:Z.td(O,A,V,Y),children:g.getDate()},`day-${T}`)})},`week-${p}`))})]})]})}const Er=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const[i,o]=L.useState(!1),[c,l]=L.useState(r||""),[u,f]=L.useState(""),{anchorRef:d,targetRef:m}=gt({position:"bottom",enabled:i});Be(m,()=>{o(!1)}),Be(d,()=>{if(typeof d=="object"&&d!==null&&"current"in d){const $=d.current.querySelector("input");$&&$===document.activeElement&&E()}}),br(i,m);const{format:h,getCurrentLanguage:y}=Qe(),x=L.useCallback($=>{const W=$.length>5&&Gr($,y())||$,R=h(W,void 0,void 0,{type:"date"}),P=typeof W!="string",j=P&&W.toISOString().substring(0,10)||"";return{isValid:P,formattedDate:R,isoDate:j,normalizedDate:W}},[y,h]);L.useEffect(()=>{const{formattedDate:$,isoDate:W,isValid:R}=x(r);l(R&&W||r),f(R&&$||r)},[r,h,x]);const w=()=>o($=>!$),E=()=>{S(u)},D=$=>{S($),o(!1)},S=$=>{const{isoDate:W,isValid:R}=x($);t&&t(R&&W||$)},v=$=>{f($)},I=$=>{$.key==="Enter"&&($.preventDefault(),S(u))};return b.jsxs("div",{"data-component":"date-picker",children:[b.jsx(Se,{bindValue:u,placeholder:e,onBlur:E,onChange:v,onKeyDown:I,shapeIcon:"calendar",onShapeIconClick:w,ref:d,isEditable:s,...a}),i&&b.jsx(rs,{disabledDateRanges:n,onDateChange:D,initialValue:mt(c)&&c||"",targetRef:m})]})},ns=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:c,onOptionsRequest:l,onChange:u})=>{const f=r.map(h=>h.bindValue),d=(h,y)=>{const x=[...r];if(h=="")x.pop();else{const w=x.findIndex(E=>E.bindValue===h&&E.optionalDisplayValue===y);w>=0?x.splice(w,1):x.push({bindValue:h,optionalDisplayValue:y})}u==null||u(x)},m={container:"smp-multipleAutocomplete-container"};return b.jsxs("div",{className:m.container,"data-component":"multiple-autocomplete",children:[i&&b.jsx(Xe,{label:i,disabled:o}),b.jsx(xt,{elements:r,displayMode:e,isEditable:s,onChange:h=>{u==null||u(h)}}),b.jsx(vt,{bindValue:"",fun:c,isEditable:s,onChange:d,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:l,_multiActiveIndex:f})]})},Tr=({...r})=>{const[e,t]=L.useState(!1),n=e?"visibility-off":"visibility";return b.jsx(Se,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},ss=({...r})=>{const[e,t]=L.useState(r.bindValue),{translate:n}=Qe(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return b.jsx(Se,{...r,placeholder:r.placeholder?r.placeholder:n(St.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})};class xe{constructor(e,t){ve(this,"class");ve(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new xe(e,e.k.split(";"))}static fromString(e){return new xe({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const Ue=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),or=r=>{const e=xe.fromDataObj(r.obj),t=r.decode?xe.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},as=(r,e)=>{const t=new xe(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new xe(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return Ue(r,t,n)},wt=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,options:c,onChange:l,onClick:u,onEnter:f,onBlur:d,onOptionsRequest:m,isEditable:h})=>{const y={obj:t,shape:e,decode:r,icon:s,fun:a},x={onBlur:d,onOptionsRequest:m,fun:a,icon:s,label:o,isEditable:h,...n},w=(S,v,I)=>Hr(t)?Ue(S,new He(t,v).getLegacyValue()):Ue(S,v,I),E=S=>Ue(y,new We(t,S).getLegacyValue()),D=S=>as(y,S);switch(e){case ie.AUTOCOMPLETE:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(v,I)=>{l==null||l(w(y,v,I))}};return b.jsx(vt,{...S})}case ie.BUTTON:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{u==null||u(w(y,t.k))}};return b.jsx(Re,{...S})}case ie.BUTTON_LIST:{const S={...x,options:c,onClick:(v,I)=>{const $={...y,fun:I};u==null||u(w($,v))}};return b.jsx(yr,{...S})}case ie.COMBOBOX:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(v,I)=>{l==null||l(w(y,v,I))}};return b.jsx(xr,{...S})}case ie.CHECKBOX:{const S={...x,bindValue:We.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:v=>{l==null||l(E(v))}};return b.jsx(vr,{...S})}case ie.CHIP:{const S={...x,elements:or(y)};return b.jsx(xt,{...S})}case ie.DATE:{const S={...x,bindValue:He.fromDataObj(t).getValue(),onChange:v=>{l==null||l(w(y,v))}};return b.jsx(Er,{...S})}case ie.ICON:case ie.IMAGE:{const S={...x,icon:s,placeholderIcon:i,isInteractable:!!x.fun,onClick:()=>{u==null||u(w(y,t.k))}};return b.jsx(le,{...S})}case ie.MULTI_AUTOCOMPLETE:{const S={...x,elements:or(y),onChange:v=>{l==null||l(D(v))}};return b.jsx(ns,{...S})}case ie.PASSWORD:{const S={...x,bindValue:t.k,onChange:v=>{l==null||l(w(y,v))}};return b.jsx(Tr,{...S})}case ie.SPOTLIGHT:{const S={...x,bindValue:t.k,onEnter:v=>{f==null||f(w(y,v))}};return b.jsx(ss,{...S})}case ie.TEXT_FIELD:case void 0:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:v=>{l==null||l(w(y,v))}};return b.jsx(Se,{...S})}}},Or=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var E;const[a,i]=L.useState(!1),o=Ye(r)&&!!((E=r.children)!=null&&E.length),c=r.cells&&Object.keys(r.cells).length>0,l=o,u=t*20,f=()=>{o&&i(!a)},d={content:`${be.rowContent} ${o?be.clickable:""}`,toggle:`${be.toggle}`,indent:`${be.indent}`,cell:`${be.cell}`},m=D=>b.jsx(wt,{...D}),h=()=>b.jsx("span",{className:d.toggle,children:l?a?"▶":"▼":" "}),y=()=>b.jsx("span",{className:d.indent,style:{width:`${u}px`},"aria-hidden":"true"}),x=()=>{const D=Ur(r)?"":r.decode||(c?"":"Untitled"),S=s??n*t;return b.jsxs("tr",{className:d.content,onClick:f,role:o?"button":"row","aria-expanded":o?!a:void 0,style:{height:`${n}px`,lineHeight:`calc(${n}px - 2*2px)`,transform:`translateY(${S}px)`},children:[Ye(r)&&b.jsxs("td",{className:be.leftSection,style:{height:`${n}px`},children:[y(),h(),b.jsx("span",{className:be.rowLabel,children:D})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([v,I])=>b.jsx("td",{className:d.cell,style:{width:e[v],minWidth:e[v],height:`${n}px`},children:m(I)},Wr(I)||v))]})},w=()=>{var D;return a||!o?null:b.jsx(b.Fragment,{children:Ye(r)&&((D=r.children)==null?void 0:D.map((S,v)=>b.jsx(Or,{row:S,level:t+1},`child-${v}`)))})};return b.jsxs(b.Fragment,{children:[x(),w()]})},is=({label:r,rowHeight:e=28,offsetTop:t=0,level:n=0,onClick:s,isExpanded:a})=>{const i={tr:"smp-groupRow-tr",td:"smp-groupRow-td"};return b.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:b.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[b.jsx(le,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),b.jsx(bt,{variant:"title",bindValue:r})]})})};function os(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function ls(r,e){return r.map(t=>{const n=e.find(s=>s.column===t.bindValue);return{column:t.bindValue,visible:(n==null?void 0:n.visible)??!0}})}function cs(r,e,t,n){const s=[];let a=0;return i(r,0,[]),{flatRows:s,offset:a};function i(f,d,m){if(d>=e.length){u(f);return}const h=e[d].column,y=o(f,h);for(const[x,w]of y){const E=[...m,x],D=c(E,d),S=n.has(D);s.push(l(x,D,d,S)),a+=t,S&&i(w,d+1,E)}}function o(f,d){var h;const m=new Map;for(const y of f){const x=((h=y.cells[d])==null?void 0:h.decode)??"N/D";m.has(x)||m.set(x,[]),m.get(x).push(y)}return m}function c(f,d){return`group-${f.join("-")}-${d}`}function l(f,d,m,h){return{isGroup:!0,value:f,cells:{},rowId:d,level:m,isExpanded:h}}function u(f){for(const d of f)s.push(d),a+=t}}const us=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return b.jsxs("div",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[b.jsx(le,{icon:"groups"}),b.jsx(xt,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})]})},fs=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var W;const[i,o]=L.useState(r),[c,l]=L.useState(n||[]),[u,f]=L.useState(new Set),d=Object.fromEntries(i&&i.columns.map(R=>[R.name,120])),[m,h]=L.useState(d),y=L.useRef(null);L.useEffect(()=>{var j,M;const R=((j=y.current)==null?void 0:j.clientWidth)??1e3;if(!((M=i==null?void 0:i.columns)!=null&&M.length))return;let P={};switch(s){case"fixed":P=Object.fromEntries(i.columns.map(N=>[N.name,120]));break;case"fit-grid":{const N=i.columns.filter(q=>q.visible),B=Math.floor(R/N.length);P=Object.fromEntries(N.map(q=>[q.name,B]));break}case"fit-content":P=Object.fromEntries(i.columns.map(N=>{const B=Math.max(...r.rows.map(_=>{var T;const p=(T=_==null?void 0:_.cells)==null?void 0:T[N.name],g=(p==null?void 0:p.decode)||(p==null?void 0:p.value);return g?String(g).length:0}),0),q=N.title?N.title.length:0,K=Math.max(B,q);return[N.name,Math.max(50,K*8+16)]}));break}h(P)},[s,r,i.columns]),L.useEffect(()=>{if(c!=null&&c.length&&r.rows){const{flatRows:R}=cs(r.rows,c,e,u);o({...r,rows:R})}else o(r)},[r,c,u,e]);const x=R=>{l(ls(R,c))},w=R=>{R.preventDefault();const P=R.dataTransfer.getData("text/plain");if(!P||c.some(N=>N.column===P))return;const M=[...c,{column:P,visible:!0}];l(M)},E=R=>{R.preventDefault()},{virtualItems:D,containerProps:S,innerProps:v}=hr({items:i.rows||[],itemHeight:e,containerHeight:t,overscan:5}),I=(R,P)=>{const j=R.clientX,M=m[P],N=q=>{const K=q.clientX-j,Z=Math.max(50,M+K);h(H=>({...H,[P]:Z}))},B=()=>{window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",B)};window.addEventListener("mousemove",N),window.addEventListener("mouseup",B)},$={smpTable:`${et["smp-table"]}`,headerCell:`${et["smp-headerCell"]}`,resizer:`${et["smp-resizer"]}`};return b.jsx("div",{className:$.smpTable,...S,ref:y,children:b.jsxs("table",{children:[b.jsxs("thead",{children:[(n||a)&&b.jsx(us,{groups:c,onChange:x,onDrop:w,onDragOver:E}),b.jsx("tr",{children:i.columns&&((W=i.columns)==null?void 0:W.map(R=>R.visible&&b.jsxs("th",{className:$.headerCell,draggable:!0,onDragStart:P=>{P.dataTransfer.setData("text/plain",R.name)},style:{width:m[R.name],minWidth:m[R.name],maxWidth:m[R.name]},children:[b.jsx(bt,{variant:"title",bindValue:R.title}),b.jsx("div",{className:$.resizer,onMouseDown:P=>I(P,R.name),role:"region"})]},R.name)))})]}),b.jsx("tbody",{...v,children:D.map(({item:R,index:P,offsetTop:j})=>R.isGroup?b.jsx(is,{label:R.value||"",rowHeight:e,offsetTop:j,level:R.level,onClick:()=>{const M=R.rowId;M&&f(N=>os(N,M))},isExpanded:R.isExpanded},R.rowId||`group-${P}`):b.jsx(Or,{row:R,columnWidths:m,rowHeight:e,offsetTop:j,isGroup:!1},R.rowId||`row-${P}`))}),b.jsx("tfoot",{children:b.jsx("td",{children:"Tfooter here"})})]})})},ds=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},Rr=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:Rr(t.sections,e),content:t.content};let n=t.sections,s=t.content;return(i=t.content)!=null&&i.length&&t.columns&&+t.columns>1&&(n=ds(t.content.filter(c=>!!e[c.id]),+t.columns).map((c,l)=>({...t,id:`${t.id}-${l}`,content:c,gridCols:t.columns,horizontal:!0})),s=[]),{...t,sections:n,content:s}}),lr=(r,e)=>{if(!e)return{};const t=r.some(n=>n.dim)?r.map(n=>n.dim||"auto").join(" "):`repeat(${r.length}, 1fr)`;return{[e]:t}},cr=r=>r.some(e=>e.dim&&!e.dim.endsWith("%")),de={"smp-layout":"_smp-layout_xrjwg_1","smp-layout-horizontal":"_smp-layout-horizontal_xrjwg_9","smp-layout-vertical":"_smp-layout-vertical_xrjwg_13","smp-layout-section-grid":"_smp-layout-section-grid_xrjwg_18","smp-layout-section-vertical":"_smp-layout-section-vertical_xrjwg_20","smp-layout-section-horizontal":"_smp-layout-section-horizontal_xrjwg_24","smp-layout-section-flex":"_smp-layout-section-flex_xrjwg_29","smp-layout-cell-container":"_smp-layout-cell-container_xrjwg_34","smp-grid-template-cols":"_smp-grid-template-cols_xrjwg_44","smp-grid-template-rows":"_smp-grid-template-rows_xrjwg_48","smp-layout-section-with-title":"_smp-layout-section-with-title_xrjwg_52","smp-layout-section-title":"_smp-layout-section-title_xrjwg_58"},Dr=({layout:r,cells:e})=>{var f;if(!((f=r.sections)!=null&&f.length))return b.jsx(b.Fragment,{});const t="--smp-grid-template-cols",n="--smp-grid-template-rows",s=Rr(r.sections,e),a=d=>d==null?void 0:d.reduce((m,h)=>{var D,S;let y="",x={},w={},E="";return(D=h.sections)!=null&&D.length?(y=de["smp-layout-section-grid"],x=a(h.sections),h.gridCols==null&&(E=`${de[h.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"]}`,(h.horizontal||cr(h.sections))&&(w=lr(h.sections,h.horizontal?t:n)))):(S=h.content)!=null&&S.length&&(h.gridCols!==void 0&&h.gridCols>0?(y=de["smp-layout-section-grid"],E=`${de["smp-grid-template-cols"]}`,w={[t]:`repeat(${h.gridCols}, 1fr)`}):y=de["smp-layout-section-flex"]),{...m,...x,[h.id]:{classes:`${y} ${de[h.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${E} ${h.justify?`smp-justifyContent-${h.justify}`:""} ${h.align?`smp-alignItems-${h.align}`:""}`,styles:w}}},{}),i=a(s),o={container:`${de["smp-layout"]} ${r.horizontal?de["smp-layout-horizontal"]:de["smp-layout-vertical"]}`,sections:i},c=r.horizontal||cr(r.sections)?lr(s,r.horizontal?t:n):{},l=d=>{var h;const m=b.jsx("div",{"smp-id":"section-"+d.id,className:o.sections[d.id].classes,style:o.sections[d.id].styles,children:(h=d.sections)!=null&&h.length?d.sections.map(y=>l(y)):d.content.map(y=>u(y,e[y.id],d.justify,d.align))},"section-"+d.id);return d.title?b.jsxs("div",{className:`${de["smp-layout-section-with-title"]}`,children:[b.jsx("span",{className:`${de["smp-layout-section-title"]} ${d.justify?`smp-justifyContent-${d.justify}`:""} ${d.align?`smp-alignItems-${d.align}`:""}`,children:b.jsx(Xe,{label:d.title})}),m]}):m},u=(d,m,h,y)=>{const x=d.colSpan!==void 0?d.colSpan>0?d.colSpan:d.colStart!==void 0&&d.colStart<1?1:null:null,w=x!==null?`span ${x}`:d.colStart,E=d.colEnd!==void 0&&d.colEnd>0?d.colEnd:"",D={gridColumnStart:w,gridColumnEnd:E},S=`${de["smp-layout-cell-container"]} ${h?`smp-justifyContent-${h}`:""} ${y?`smp-alignItems-${y}`:""}`;return m?b.jsx("div",{className:S,style:{...D},"smp-id":d.id,children:b.jsx(wt,{...m})},d.id):b.jsx(b.Fragment,{})};return b.jsx("div",{className:o.container,style:c,"smp-id":"layout",children:s==null?void 0:s.map(d=>l(d))})},ps=({data:r,onClick:e,onEnter:t})=>{var i,o;const[n,s]=L.useState(),a=L.useCallback(c=>{var u,f;if(!((u=c.rows)!=null&&u.length)||!((f=c.columns)!=null&&f.length))return{};const l=c.rows[0];return c.columns.filter(d=>d.visible).reduce((d,m)=>{const h=l.cells[m.name],y={...h,onChange:x=>{s(w=>w&&{...w,[m.name]:{...w[m.name],obj:{...w[m.name].obj,k:x.obj.k}}})},onClick:()=>{h.fun&&e&&e({...h})},onEnter:x=>{t&&t(x)}};return{...d,[m.name]:y}},{})},[e,t]);return L.useEffect(()=>{s(a(r))},[r,a]),!((i=r==null?void 0:r.rows)!=null&&i.length)||!((o=r.columns)!=null&&o.length)?null:n&&b.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:b.jsx(Dr,{layout:r.rows[0].layout,cells:n})})},ce=r=>r==null?!1:typeof r=="string"?r.toLocaleLowerCase()=="yes":r,hs=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:c,IconColName:l,IconColor:u="var(--smp-dashList-color-base)",NumberFormat:f,ForceUM:d,UmColName:m,UmColor:h="var(--smp-dashList-color-base)",ForceValue:y,ValueColName:x,ValueColor:w="var(--smp-dashList-color-base)",SelectLayout:E="1",onClick:D})=>{const S="N/A",v=(e==null?void 0:e.columns)||[],I=(e==null?void 0:e.rows)||[],$=I.length>0,W="--smp-dashList-color",R="smp-layout",P="descr",j="icon",M="um",N="value",B=i||"1em",q="18px",K="--smp-dashList-columns",Z="--smp-dashList-fontSize",H={dash:(U="1")=>{const X=p(U),te=X,re=g(X,P),fe=g(X,j),ge=g(X,M),pe=g(X,N);return{container:te,descr:re,icon:fe,um:ge,value:pe}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
|
|
50
|
+
${ce(o)?"smp-dash-list-horizontal":""}`},{format:_}=Qe(),p=U=>`${R}-${U}`,g=(U,X)=>`${U}__${X}`,T=U=>`${W}-${U}`,C=U=>{const X=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(X.test(U)){const re=U.match(X)||[];if((re==null?void 0:re.length)>3)return"rgb("+re[1]+","+re[2]+","+re[3]+")"}return U},O=U=>{if(!f)return U;const[X,te]=A(f).map(we=>parseInt(we||"0")),re="0,0"+(te?"."+"0".repeat(te):""),fe=_(U,re,"it");if(!X)return fe;const[ge,pe]=fe.split(",");return ge+(pe?`,${pe}`:"")},A=U=>U.includes(";")?U.split(";"):[U],V=U=>{const X=re=>{var fe;if(re)return(fe=U==null?void 0:U.cells[re])==null?void 0:fe.obj.k},te=re=>{var fe,ge;if(!(v.length<=re))return(ge=(fe=U==null?void 0:U.cells[v[re].name])==null?void 0:fe.obj)==null?void 0:ge.k};return{descr:t||X(n)||te(2)||"",icon:c||X(l)||te(3)||"",um:d||X(m)||te(1)||"",value:y||X(x)||te(0)||""}},Y=U=>{D==null||D(U)},F=(U,X)=>{(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),U.stopPropagation(),Y(X))},G=(U=>{const X=H.dash(U);return{className:X,descr:te=>b.jsx("div",{className:X.descr,children:te},`${U}-${P}`),icon:te=>b.jsx("div",{className:X.icon,children:b.jsx(le,{color:u,height:q,icon:te,width:q})},`${U}-${j}`),um:te=>b.jsx("div",{className:X.um,children:te},`${U}-${M}`),value:te=>b.jsx("div",{className:X.value,children:te},`${U}-${N}`)}})(E),ne=U=>{const{descr:X,icon:te,um:re,value:fe}=V(U),ge={[T(P)]:C(s),[T(M)]:C(h),[T(N)]:C(w)},pe=[],we=O(fe);switch(E){case"2":te&&pe.push(G.icon(te)),pe.push(G.descr(X)),pe.push(G.value(re?we+" "+re:we));break;default:case"1":pe.push(G.descr(X)),pe.push(G.value(re?we+" "+re:we))}return b.jsx("div",{className:G.className.container,role:"button",style:ge,tabIndex:0,onClick:()=>Y(U),onKeyDown:jr=>F(jr,U),children:pe},U.rowId)},k={[K]:String(r),[Z]:B};return b.jsx("div",{className:H.dashList,style:k,children:$?I.map(U=>ne(U)):S})},ms=r=>{var e;return(e=r.children)!=null&&e.length?r.children.map(t=>{var n,s;return{id:((n=t.obj)==null?void 0:n.k)??"",label:t.decode??t.value??((s=t.obj)==null?void 0:s.k)??"",fun:t.fun,icon:t.icon}}):[]},gs=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:c})=>{var D,S;const[l,u]=L.useState(),[f,d]=L.useState(t??!0),m=L.useRef(null),h=s.trim()?s:"100vh",y=L.useCallback(v=>{var $,W;if(!(($=v.rows)!=null&&$.length)||!((W=v.columns)!=null&&W.length))return{};const I=v.rows[0];return v.columns.filter(R=>R.visible??!0).reduce((R,P)=>{const j=I.cells[P.name];if(!j||!f&&ce(n)&&j.shape!==ie.BUTTON&&j.shape!==ie.BUTTON_LIST)return R;const M={...j,onChange:N=>{u(B=>{const q={...B};return q!=null&&q[P.name]&&(q[P.name].obj.k=N.obj.k),q})},onClick:N=>{N.fun&&a&&a(N)},onEnter:N=>{i&&i(N)}};return c&&j.shape==ie.BUTTON_LIST&&(M.onOptionsRequest=(N,B)=>c(N,B).then(q=>ms(q))),!f&&ce(n)&&(M.data={...M.data,showText:!1,justify:"center"}),{...R,[P.name]:M}},{})},[f,n,a,i,c]),x=L.useCallback(()=>{o==null||o()},[o]),w=()=>{ce(n)?d(v=>!v):(d(!1),o==null||o())};if(L.useEffect(()=>{u(y(r))},[r]),L.useEffect(()=>{if(!m.current)return;if(!ce(n)){u(y(r));return}const v=getComputedStyle(m.current).getPropertyValue("--smp-drawer-slide-transition");let I=Number(v);v.endsWith("ms")?I=parseFloat(v):v.endsWith("s")&&(I=parseFloat(v)*1e3),setTimeout(()=>{u(y(r))},I/2)},[f,n]),L.useEffect(()=>{t!==void 0&&!ce(n)&&d(t)},[n,t]),!((D=r==null?void 0:r.rows)!=null&&D.length)||!((S=r.columns)!=null&&S.length))return null;const E={drawer:`smp-drawer ${ce(n)?"smp-drawer-minified":"smp-drawer-fixed"} ${f?"smp-drawer-open":""} ${!ce(n)&&!f?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${f?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${f?"smp-drawer-backdrop-open":""}`};return l&&b.jsxs(b.Fragment,{children:[!ce(n)&&b.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:E.backdrop,onClick:x}),b.jsx("aside",{ref:m,className:E.drawer,style:{height:h},"aria-label":"Drawer","smp-id":"drawer",children:b.jsxs("div",{className:E.container,children:[b.jsxs("div",{className:E.containerHeader,children:[e&&b.jsx("div",{className:E.containerLogo,children:b.jsx(le,{icon:e,title:"drawer_logo",width:"100%",height:24})}),b.jsx("div",{className:E.containerIcon,children:b.jsx(le,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!f,isInteractable:!0,onClick:w,width:20,height:20})})]}),b.jsx("div",{className:E.containerLayout,children:b.jsx(Dr,{layout:r.rows[0].layout,cells:l})})]})})]})},ys=({data:r,Type:e,ShowSubmit:t=!1,SubmitPosition:n="Right",DefaultValue:s,Label:a,LabelPosition:i="Left",onBlur:o,onClick:c,onOptionsRequest:l})=>{const[u,f]=L.useState();L.useEffect(()=>{f(()=>{const y={...r};return e&&(y.shape=e),s&&(y.obj=Br(s)),y})},[r,s,e]);const m={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},h=()=>{ce(t)||o==null||o(u)};if(u)return b.jsxs("div",{className:m.container,children:[b.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:b.jsx(wt,{...u,onChange:f,onOptionsRequest:l,fun:r.fun,onBlur:h,label:a,labelPosition:i})}),ce(t)&&b.jsx(Re,{optionalDisplayValue:"Confirm",onClick:()=>c==null?void 0:c(u),bindValue:"Confirm"})]})};exports.AppBar=ps;exports.Autocomplete=vt;exports.Button=Re;exports.ButtonList=yr;exports.Checkbox=vr;exports.Combobox=xr;exports.DashList=hs;exports.DataTableComponent=fs;exports.DatePicker=Er;exports.Drawer=gs;exports.Field=ys;exports.Icon=le;exports.Password=Tr;exports.Textfield=Se;exports.configurePaths=bn;
|