@sme.up/ketchup2 2.0.0-SNAPSHOT-20250612144549 → 2.0.0-SNAPSHOT-20250613074100
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/assets/layoutAssets.d.ts.map +1 -1
- package/dist/assets/svg/arrow_drop_right.svg +1 -0
- package/dist/assets/testAsset.d.ts +10 -10
- package/dist/assets/testAsset.d.ts.map +1 -1
- package/dist/basic-components/cell/cell.d.ts.map +1 -1
- package/dist/components/app-bar/app-bar.data.d.ts +8 -0
- package/dist/components/app-bar/app-bar.data.d.ts.map +1 -1
- package/dist/components/data-table/assets/data-table-shapes.d.ts +11 -11
- package/dist/components/data-table/data-table-types.d.ts +4 -0
- package/dist/components/data-table/data-table-types.d.ts.map +1 -1
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/drawer/drawer.data.d.ts.map +1 -1
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/spotlight/spotlight.d.ts.map +1 -1
- package/dist/functional-components/group-row/group-row.d.ts.map +1 -1
- package/dist/functional-components/row/row-assets.d.ts.map +1 -1
- package/dist/functional-components/row/row.d.ts.map +1 -1
- package/dist/ketchup2.cjs.js +13 -13
- package/dist/ketchup2.css +1 -1
- package/dist/ketchup2.es.js +1732 -1661
- package/package.json +1 -1
package/dist/ketchup2.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
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 A=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(A);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 wt;function Ar(){if(wt)return De;wt=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 Et;function Lr(){return Et||(Et=1,process.env.NODE_ENV!=="production"&&function(){function r(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===j?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 C: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 m: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 k: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,$=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.",$),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=_.A;return p===null?null:p.getOwner()}function a(){return Error("react-stack-top-frame")}function i(p){if(N.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(){J||(J=!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,$,O,P,V,Y){return T=P.ref,p={$$typeof:h,type:p,key:g,props:P,_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 f(p,g,T,$,O,P,V,Y){var M=g.children;if(M!==void 0)if($)if(F(M)){for($=0;$<M.length;$++)u(M[$]);Object.freeze&&Object.freeze(M)}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 u(M);if(N.call(g,"key")){M=r(p);var X=Object.keys(g).filter(function(ne){return ne!=="key"});$=0<X.length?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}",I[M+$]||(X=0<X.length?"{"+X.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} />`,$,M,X,M),I[M+$]=!0)}if(M=null,T!==void 0&&(t(T),M=""+T),i(g)&&(t(g.key),M=""+g.key),"key"in g){T={};for(var G in g)G!=="key"&&(T[G]=g[G])}else T=g;return M&&o(T,typeof p=="function"?p.displayName||p.name||"Unknown":p),l(p,M,P,O,s(),T,V,Y)}function u(p){typeof p=="object"&&p!==null&&p.$$typeof===h&&p._store&&(p._store.validated=1)}var d=A,h=Symbol.for("react.transitional.element"),m=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"),C=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),j=Symbol.for("react.client.reference"),_=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,F=Array.isArray,B=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(p){return p()}};var J,K={},H=d["react-stack-bottom-frame"].bind(d,a)(),q=B(n(a)),I={};je.Fragment=y,je.jsx=function(p,g,T,$,O){var P=1e4>_.recentlyCreatedOwnerStacks++;return f(p,g,T,!1,$,O,P?Error("react-stack-top-frame"):H,P?B(n(p)):q)},je.jsxs=function(p,g,T,$,O){var P=1e4>_.recentlyCreatedOwnerStacks++;return f(p,g,T,!0,$,O,P?Error("react-stack-top-frame"):H,P?B(n(p)):q)}}()),je}var Tt;function _r(){return Tt||(Tt=1,process.env.NODE_ENV==="production"?_e.exports=Ar():_e.exports=Lr()),_e.exports}var b=_r();const Qe={"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(ht(r)){const f=new Date(r);if(!isNaN(f.getTime()))return f}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 f=0,u=0;return i===0?(f=c,u=o-1,t.setFullYear(parseInt(l),u,f)):a===0&&(f=o,u=c-1,t.setFullYear(parseInt(l),u,f)),ct(o,u,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 f=0,u=0;return i===0?(f=c,u=o-1,t.setFullYear(parseInt(l),u,f)):a===0&&(f=o,u=c-1,t.setFullYear(parseInt(l),u,f)),ct(f,u,parseInt(l))&&ke(t)?t:r}}return r}function ht(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 ct(n,t-1,e)}function ct(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=Ot.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=Ot.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 Ot=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 ht(r)&&r.replaceAll("-","")||r}}]]),Be=(r,e)=>{A.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 mt({position:r="bottom",enabled:e=!0}){const t=A.useRef(null),n=A.useRef(null),[s,a]=A.useState(0),i=A.useCallback(()=>{const o=t.current,c=n.current;if(!o||!c)return;const{top:l,left:f,width:u,height:d}=o.getBoundingClientRect();a(u);const h=c.offsetHeight,m=c.offsetWidth;if(m===0||h===0){requestAnimationFrame(i);return}let y=l+window.scrollY,x=f+window.scrollX;switch(r){case"top":y-=h;break;case"bottom":y+=d;break;case"left":x-=m;break;case"right":x+=u;break}requestAnimationFrame(()=>{c.style.transform=`translate(${x}px, ${y}px)`})},[r]);return A.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})},cr=({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 ut(r,e){return ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},ut(r,e)}function Zr(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,ut(r,e)}function et(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 Rt;function Qr(){if(Rt)return Ie;Rt=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(u){if(!u||typeof u!="object")throw new TypeError("argument obj is required");var d=u.parameters,h=u.type;if(!h||!a.test(h))throw new TypeError("invalid type");var m=h;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");m+="; "+y+"="+l(d[y])}return m}function o(u){if(!u)throw new TypeError("argument string is required");var d=typeof u=="object"?c(u):u;if(typeof d!="string")throw new TypeError("argument string is required to be a string");var h=d.indexOf(";"),m=h!==-1?d.slice(0,h).trim():d.trim();if(!a.test(m))throw new TypeError("invalid media type");var y=new f(m.toLowerCase());if(h!==-1){var x,w,E;for(r.lastIndex=h;w=r.exec(d);){if(w.index!==h)throw new TypeError("invalid parameter format");h+=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(h!==d.length)throw new TypeError("invalid parameter format")}return y}function c(u){var d;if(typeof u.getHeader=="function"?d=u.getHeader("content-type"):typeof u.headers=="object"&&(d=u.headers&&u.headers["content-type"]),typeof d!="string")throw new TypeError("content-type header is missing from object");return d}function l(u){var d=String(u);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 f(u){this.parameters=Object.create(null),this.type=u}return Ie}var en=Qr(),Te=new Map,ur=function(e){return e.cloneNode(!0)},Dt=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(Dt()?"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||Dt()&&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={},jt=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){jt(e,n);return}if(s instanceof SVGSVGElement){n(null,ur(s));return}}Te.set(e,void 0),jt(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=[],Ct={},on="http://www.w3.org/2000/svg",tt="http://www.w3.org/1999/xlink",$t=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(f,u){if(!u){he.splice(he.indexOf(e),1),e=null,o(f);return}var d=e.getAttribute("id");d&&u.setAttribute("id",d);var h=e.getAttribute("title");h&&u.setAttribute("title",h);var m=e.getAttribute("width");m&&u.setAttribute("width",m);var y=e.getAttribute("height");y&&u.setAttribute("height",y);var x=Array.from(new Set(et(et(et([],(u.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();u.setAttribute("class",x);var w=e.getAttribute("style");w&&u.setAttribute("style",w),u.setAttribute("data-src",c);var E=[].filter.call(e.attributes,function(q){return/^data-\w[\w-]*$/.test(q.name)});if(Array.prototype.forEach.call(E,function(q){q.name&&q.value&&u.setAttribute(q.name,q.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,C,k,W;Object.keys(D).forEach(function(q){S=q,C=D[q],v=u.querySelectorAll(S+"[id]");for(var I=function($,O){k=v[$].id,W=k+"-"+an();var P;Array.prototype.forEach.call(C,function(U){P=u.querySelectorAll("["+U+'*="'+k+'"]');for(var Z=0,te=P.length;Z<te;Z++){var re=P[Z].getAttribute(U);re&&!re.match(new RegExp('url\\("?#'+k+'"?\\)'))||P[Z].setAttribute(U,"url(#"+W+")")}});for(var V=u.querySelectorAll("[*|href]"),Y=[],M=0,X=V.length;M<X;M++){var G=V[M].getAttributeNS(tt,"href");G&&G.toString()==="#"+v[$].id&&Y.push(V[M])}for(var ne=0,L=Y.length;ne<L;ne++)Y[ne].setAttributeNS(tt,"href","#"+W);v[$].id=W},p=0,g=v.length;p<g;p++)I(p)})}u.removeAttribute("xmlns:a");for(var R=u.querySelectorAll("script"),j=[],_,N,F=0,B=R.length;F<B;F++)N=R[F].getAttribute("type"),(!N||N==="application/ecmascript"||N==="application/javascript"||N==="text/javascript")&&(_=R[F].innerText||R[F].textContent,_&&j.push(_),u.removeChild(R[F]));if(j.length>0&&(t==="always"||t==="once"&&!Ct[c])){for(var J=0,K=j.length;J<K;J++)new Function(j[J])(window);Ct[c]=!0}var H=u.querySelectorAll("style");if(Array.prototype.forEach.call(H,function(q){q.textContent+=""}),u.setAttribute("xmlns",on),u.setAttribute("xmlns:xlink",tt),i(u),!e.parentNode){he.splice(he.indexOf(e),1),e=null,o(new Error("Parent node is null"));return}e.parentNode.replaceChild(u,e),he.splice(he.indexOf(e),1),e=null,o(null,u)})},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,f=n.cacheRequests,u=f===void 0?!0:f,d=n.evalScripts,h=d===void 0?"never":d,m=n.httpRequestWithCredentials,y=m===void 0?!1:m,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++)$t(e[D],h,w,u,y,l,function(v,C){o(v,C),e&&"length"in e&&e.length===++E&&a(E)});else e?$t(e,h,w,u,y,l,function(v,C){o(v,C),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 Pt;function cn(){if(Pt)return Q;Pt=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,f=r?Symbol.for("react.forward_ref"):60112,u=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,h=r?Symbol.for("react.memo"):60115,m=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 C=v.$$typeof;switch(C){case e:switch(v=v.type,v){case c:case l:case n:case a:case s:case u:return v;default:switch(v=v&&v.$$typeof,v){case o:case f:case m:case h:case i:return v;default:return C}}case t:return C}}}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=f,Q.Fragment=n,Q.Lazy=m,Q.Memo=h,Q.Portal=t,Q.Profiler=a,Q.StrictMode=s,Q.Suspense=u,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)===f},Q.isFragment=function(v){return D(v)===n},Q.isLazy=function(v){return D(v)===m},Q.isMemo=function(v){return D(v)===h},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)===u},Q.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===n||v===l||v===a||v===s||v===u||v===d||typeof v=="object"&&v!==null&&(v.$$typeof===m||v.$$typeof===h||v.$$typeof===i||v.$$typeof===o||v.$$typeof===f||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 At;function un(){return At||(At=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,f=r?Symbol.for("react.forward_ref"):60112,u=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,h=r?Symbol.for("react.memo"):60115,m=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(L){return typeof L=="string"||typeof L=="function"||L===n||L===l||L===a||L===s||L===u||L===d||typeof L=="object"&&L!==null&&(L.$$typeof===m||L.$$typeof===h||L.$$typeof===i||L.$$typeof===o||L.$$typeof===f||L.$$typeof===x||L.$$typeof===w||L.$$typeof===E||L.$$typeof===y)}function S(L){if(typeof L=="object"&&L!==null){var U=L.$$typeof;switch(U){case e:var Z=L.type;switch(Z){case c:case l:case n:case a:case s:case u:return Z;default:var te=Z&&Z.$$typeof;switch(te){case o:case f:case m:case h:case i:return te;default:return U}}case t:return U}}}var v=c,C=l,k=o,W=i,R=e,j=f,_=n,N=m,F=h,B=t,J=a,K=s,H=u,q=!1;function I(L){return q||(q=!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(L)||S(L)===c}function p(L){return S(L)===l}function g(L){return S(L)===o}function T(L){return S(L)===i}function $(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function O(L){return S(L)===f}function P(L){return S(L)===n}function V(L){return S(L)===m}function Y(L){return S(L)===h}function M(L){return S(L)===t}function X(L){return S(L)===a}function G(L){return S(L)===s}function ne(L){return S(L)===u}ee.AsyncMode=v,ee.ConcurrentMode=C,ee.ContextConsumer=k,ee.ContextProvider=W,ee.Element=R,ee.ForwardRef=j,ee.Fragment=_,ee.Lazy=N,ee.Memo=F,ee.Portal=B,ee.Profiler=J,ee.StrictMode=K,ee.Suspense=H,ee.isAsyncMode=I,ee.isConcurrentMode=p,ee.isContextConsumer=g,ee.isContextProvider=T,ee.isElement=$,ee.isForwardRef=O,ee.isFragment=P,ee.isLazy=V,ee.isMemo=Y,ee.isPortal=M,ee.isProfiler=X,ee.isStrictMode=G,ee.isSuspense=ne,ee.isValidElementType=D,ee.typeOf=S}()),ee}var Lt;function dr(){return Lt||(Lt=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 rt,
|
|
45
|
-
Valid keys: `+JSON.stringify(Object.keys(p),null," "));var L=ne(F,G,R,$,M+"."+G,t);if(L)return L}return null}return x(y)}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 y=c(p);if(y){var O=y.call(p),j;if(y!==p.entries){for(;!(j=O.next()).done;)if(!B(j.value))return!1}else for(;!(j=O.next()).done;){var R=j.value;if(R&&!B(R[1]))return!1}}else return!1;return!0;default:return!1}}function Z(p,y){return p==="symbol"?!0:y?y["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&y instanceof Symbol:!1}function X(p){var y=typeof p;return Array.isArray(p)?"array":p instanceof RegExp?"object":Z(y,p)?"symbol":y}function W(p){if(typeof p>"u"||p===null)return""+p;var y=X(p);if(y==="object"){if(p instanceof Date)return"date";if(p instanceof RegExp)return"regexp"}return y}function z(p){var y=W(p);switch(y){case"array":case"object":return"an "+y;case"boolean":case"date":case"regexp":return"a "+y;default:return y}}function N(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,Mt;function pn(){if(Mt)return ot;Mt=1;var r=mt();function e(){}function t(){}return t.resetWarningCache=e,ot=function(){function n(i,o,u,l,f,c){if(c!==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 Ft;function hn(){if(Ft)return Ne.exports;if(Ft=1,process.env.NODE_ENV!=="production"){var r=fr(),e=!0;Ne.exports=dn()(r.isElement,e)}else Ne.exports=pn()();return Ne.exports}var ae=hn(),gn=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},mn=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},yn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Fe="http://www.w3.org/2000/svg",Vt="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}Xr(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,u=a.httpRequestWithCredentials,l=a.renumerateIRIElements,f=a.src,c=a.title,d=a.useRequestCache,h=this.props.onError,g=this.props.beforeInjection,m=this.props.afterInjection,x=this.props.wrapper,E,T;x==="svg"?(E=document.createElementNS(Fe,x),E.setAttribute("xmlns",Fe),E.setAttribute("xmlns:xlink",Vt),T=document.createElementNS(Fe,x)):(E=document.createElement(x),T=document.createElement(x)),E.appendChild(T),T.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(E);var D=function(C){if(s.removeSVG(),!s._isMounted){h(C);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){h(C)})},S=function(C,Y){if(C){D(C);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{m(Y)}catch(_){D(_)}})},v=function(C){if(C.setAttribute("role","img"),i){var Y=C.querySelector(":scope > desc");Y&&C.removeChild(Y);var _=document.createElement("desc");_.innerHTML=i,C.prepend(_)}if(c){var P=C.querySelector(":scope > title");P&&C.removeChild(P);var k=document.createElement("title");k.innerHTML=c,C.prepend(k)}try{g(C)}catch(U){D(U)}};on(T,{afterEach:S,beforeEach:v,cacheRequests:d,evalScripts:o,httpRequestWithCredentials:u,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;mn(qe({},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,u=Jr(s,yn),l=o;return Le.createElement(l,qe({},u,{ref:this.refCallback},o==="svg"?{xmlns:Fe,xmlnsXlink:Vt}:{}),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 vn=r=>{ft={...ft,...r}},Yt=r=>`${ft.assets}/${r}`.replace(/\/+/g,"/"),ce=A.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:u,isInteractable:l=!1,spin:f=!1,title:c})=>{const[d,h]=A.useState(r),g=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),m=g&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),x=Yt(`assets/svg/${r}.svg`),E=Yt(`assets/svg/${n}.svg`),T={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&&u&&u()};return b.jsx(b.Fragment,{children:m?b.jsx(Oe,{src:r,fallback:()=>b.jsx(Oe,{src:E,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:c,role:"application",fill:s,"aria-disabled":a,className:T.svg,onClick:D}):g?b.jsx("img",{src:d,width:e||"16px",height:t||"auto",alt:c,onError:()=>h(E),onClick:D,className:T.img,title:c,onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&D()}}):b.jsx(Oe,{src:x,fallback:()=>b.jsx(Oe,{src:E,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:c,role:"application",fill:s,"aria-disabled":a,className:T.svg,onClick:D})})}),Se=({disabled:r,readOnly:e,bindValue:t,icon:n,onBlur:s,onChange:a,placeholder:i,shapeIcon:o,sizing:u,state:l,variant:f,rotatedShapeIcon:c=!1,onShapeIconClick:d,ref:h,inputRef:g,onKeyDown:m,inputType:x="text",ariaLabel:E="input field",label:T,helperText:D=!1,error:S,appearance:v="base",fullWidth:w=!1,_dataComponent:C="textfield",width:Y})=>{const _=S?"danger":l,P=S||l=="danger"?"error":o,k=D||!!S,U=Z=>{a==null||a(Z.target.value)},H={wrapper:`smp-textfield-wrapper ${w?"smp-textfield-fullWidth":""}`,container:`smp-textfield ${r?"smp-textfield-disabled":""} ${e?"smp-textfield-readOnly":""} ${i?"smp-textfield-placeholder":""} ${u?`smp-textfield-${u}`:""} ${_?`smp-textfield-${_}`:""} ${f?`smp-textfield-variant-${f}`:""} ${v?`smp-textfield-${v}`:""}`,input:"smp-textfield-input "},B=Y?{"--smp-textField-width-base":Y}:void 0;return b.jsxs("div",{className:H.wrapper,"data-component":C,children:[T&&b.jsx(lr,{label:T,disabled:r}),b.jsxs("div",{className:H.container,ref:h,style:B,children:[n&&b.jsx(ce,{icon:n,disabled:r}),b.jsx("input",{type:x,value:t,placeholder:i,onChange:U,onBlur:s,className:H.input,disabled:r,readOnly:e,onKeyDown:m,"aria-label":E,ref:g}),P&&b.jsx(ce,{icon:P,disabled:r,state:_,onClick:d,rotated:c})]}),k&&b.jsx(zr,{helperText:S,disabled:r,state:_})]})};function pr({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=A.useState(0),i=A.useRef(null),o=r.length*e,u=Math.max(0,Math.floor(s/e)-n),l=Math.min(r.length-1,Math.floor((s+t)/e)+n),f=[];for(let h=u;h<=l;h++)f.push({item:r[h],index:h,offsetTop:h*e});const c=A.useCallback(h=>{const g=h.target.scrollTop;a(g)},[]),d=h=>{if(!i.current)return;const g=h*e,m=g+e,x=i.current,E=x.scrollTop,T=E+t;g<E?x.scrollTop=g:m>T&&(x.scrollTop=m-t)};return{virtualItems:f,containerProps:{ref:i,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:c},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:o,startIndex:u,endIndex:l},scrollToIndex:d}}const bn=10,hr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:u,onKeyDown:l})=>{var P;const[f,c]=A.useState(""),d=24,[h,g]=A.useState(a!==null?a:-1),m=s!==void 0?s:e.length>bn,x=f?e.filter(k=>k.label.toLowerCase().includes(f.toLowerCase())):e,E=k=>{c(k)},{virtualItems:T,containerProps:D,innerProps:S,scrollToIndex:v}=pr({items:x,itemHeight:d,containerHeight:200,overscan:5});A.useEffect(()=>{a!==null&&a!==h&&g(a)},[a]),A.useEffect(()=>{h>=0&&h<x.length&&v(h)},[h,x]);const w=k=>{if(k.key==="ArrowDown"||k.key==="ArrowUp"){k.preventDefault();let U=h;k.key==="ArrowDown"?U=h<x.length-1?h+1:0:k.key==="ArrowUp"&&(U=h>0?h-1:x.length-1),g(U)}else k.key==="Enter"?h>=0&&h<x.length&&(u==null||u(x[h])):k.key==="Escape"&&(k.preventDefault(),k.stopPropagation());l&&l(k)},C=k=>{w(k)},Y=k=>{w(k)},_={wrapper:"smp-list",container:"smp-list-container",virtualScroll:"smp-list-virtualScroll",listItem:"smp-list-listItem"};return b.jsxs("div",{id:r,ref:n,className:_.wrapper,"data-component":"list",style:{width:o},children:[m&&b.jsx(Se,{bindValue:f,placeholder:"Search...",onChange:E,onKeyDown:C}),b.jsx("div",{...D,className:_.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:Y,"aria-activedescendant":h>=0&&h<x.length?(P=x[h])==null?void 0:P.id:void 0,children:b.jsx("div",{...S,className:_.virtualScroll,children:T.map(({item:k,index:U,offsetTop:H})=>{const B=i.includes(k.id);return b.jsxs("li",{role:"option",id:k.id,"aria-selected":h===U?"true":"false",tabIndex:-1,className:`${_.listItem} ${h===U?"selected-item":""}`,"aria-label":k.id+"-"+k.label,style:{height:`${d}px`,lineHeight:`calc(${d}px - 2*2px)`,transform:`translateY(${H}px)`},onClick:()=>{u==null||u(k),g(U)},children:[Ge(k.id,k.label,t),B&&b.jsx(ce,{icon:"check",width:16})]},k.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})},xn=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:u=!1,onChange:l,onOptionsRequest:f,_multiActiveIndex:c,...d})=>{const[h,g]=A.useState(r),[m,x]=A.useState(e),[E,T]=A.useState(!1),[D,S]=A.useState(t||[]),[v,w]=A.useState(0),[C,Y]=A.useState([r]),{anchorRef:_,targetRef:P,anchorWidth:k}=gt({position:"bottom",enabled:E});Be(P,()=>T(!1));const U=xn(400),H=W=>{W.length>=a?o&&f&&U(async()=>{const z=await f(o,W);S(z),w(z.length>0?0:-1),T(!0)}):T(!1),g(W),x(e),u||l==null||l(W,e)},B=W=>{u?(g(""),x("")):(g(W.id),x(W.label)),l==null||l(W.id,W.label);const z=D.findIndex(N=>N.id===W.id);w(z),Y([W.id]),T(!1)},Z=W=>{W.key==="Escape"&&(T(!1),w(-1))},X=W=>{if((W.key==="ArrowDown"||W.key==="ArrowUp")&&(W.preventDefault(),E)){const z=W.key==="ArrowDown"?(v+1)%D.length:(v-1+D.length)%D.length;w(z)}switch(W.key){case"Enter":v>=0&&v<D.length?B(D[v]):u&&(l==null||l(h,""),T(!1),g(""),x(""));break;case"Escape":T(!1),w(-1);break}};return b.jsxs("div",{"data-component":"autocomplete",children:[b.jsx(gr,{...d,bindValue:h,optionalDisplayValue:m,displayMode:n,shapeIcon:"magnify",placeholder:i,ref:_,onChange:H,onKeyDown:X,"aria-autocomplete":"list"}),E&&b.jsx(hr,{options:D,displayMode:s,onClick:B,ref:P,selectedIndex:v,activeIndex:c||C,width:k,showFilter:!1,onKeyDown:Z})]})},Ut=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],Wt=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:u=!0,showText:l=!0,fullWidth:f=!1,loading:c=!1,justify:d="center",title:h,optionalDisplayValue:g})=>{const m={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:m.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":c,title:h||r||g,children:c?b.jsx(ce,{icon:"spinner",state:Wt(i),spin:!0}):b.jsxs(b.Fragment,{children:[n&&u&&b.jsx(ce,{icon:n,disabled:s,state:Wt(i),width:Ut(a),height:Ut(a)}),l&&g&&b.jsx("span",{children:g})]})})},mr=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:u,fullWidth:l,disabled:f,justify:c,onClick:d,onOptionsRequest:h})=>{const[g,m]=A.useState(r);A.useEffect(()=>{!g&&h&&e&&h(e,void 0).then(T=>m(T)).catch(T=>{console.error("Errore nel caricamento delle opzioni per ButtonList",T)})},[g,e,h]);const x={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},E=g==null?void 0:g.map((T,D)=>{const S={bindValue:T.id,optionalDisplayValue:T.label,fun:T.fun,icon:T.icon,variant:a,appearance:i,showText:o,showIcon:u,fullWidth:l,disabled:f,sizing:s,justify:c,onClick:()=>{d==null||d(T.id,T.fun)}};return b.jsx(Re,{...S},`button-${D}`)});return b.jsx("div",{role:"list","data-component":"button-list",className:x.container,children:E})},yr=({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})},Sn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},wn=({variant:r="body",bindValue:e,color:t,...n})=>{const s=Sn[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})},vt=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,u]=A.useState(null),l={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=h=>{n==null||n(r.filter((g,m)=>m!==h))},c=h=>{u(h)},d=h=>{if(o===null||o===h)return;const g=[...r],[m]=g.splice(o,1);g.splice(h,0,m),n==null||n(g),u(null)};return b.jsx("div",{className:l.container,role:"list","data-component":"chip",children:r.flatMap((h,g)=>{const m=Ge(h.bindValue,h.optionalDisplayValue,t),x=b.jsxs("div",{className:l.element,role:"listitem",draggable:i,onDragStart:()=>c(g),onDragOver:T=>i&&T.preventDefault(),onDrop:()=>i&&d(g),style:{"--smp-chips-backgroundColor-base":a},children:[i&&b.jsx(ce,{icon:"drag_indicator_horizontal",isInteractable:!0}),b.jsx(wn,{variant:"label",bindValue:m,color:s}),e&&b.jsx(ce,{icon:"close",isInteractable:!0,onClick:()=>f(g),color:s})]},`chip-${g}`),E=i&&g<r.length-1?b.jsx(ce,{icon:"chevron-right",color:s},`separator-${g}`):null;return[x,E].filter(Boolean)})})};function vr(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 c=f[0],d=f[f.length-1];l.shiftKey&&document.activeElement===c?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),c.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 u=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=u,t.current&&requestAnimationFrame(()=>{var l;(l=t.current)==null||l.focus()})}},[r,e])}const br=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,displayMode:s,listDisplayMode:a="Both",fun:i,onOptionsRequest:o,multiActiveIndex:u,...l})=>{const[f,c]=A.useState(!1),[d,h]=A.useState(t),[g,m]=A.useState(-1),[x,E]=A.useState([r]),T=A.useId(),{anchorRef:D,targetRef:S,anchorWidth:v}=gt({position:"bottom",enabled:f});Be(S,()=>c(!1)),vr(f,S);const w=P=>{e==null||e(P.id,P.label);const k=d.findIndex(U=>U.id===P.id);m(k),E([P.id]),c(!1)},C=P=>{P.key==="Escape"&&(c(!1),m(-1))},Y=P=>{(P.key==="ArrowDown"||P.key==="ArrowUp")&&(P.preventDefault(),_())},_=()=>{i&&o&&o(i,void 0).then(P=>{h(P),m(P.length>0?0:-1),c(!0)})};return b.jsxs("div",{role:"combobox","aria-expanded":f,"aria-controls":T,"aria-owns":T,"data-component":"combobox",children:[b.jsx(gr,{...l,bindValue:r,optionalDisplayValue:n,displayMode:s,onShapeIconClick:_,onKeyDown:Y,shapeIcon:"arrow_drop_down",rotatedShapeIcon:f,readOnly:!0,ref:D,"aria-autocomplete":"list",variant:"notSelectable"}),f&&b.jsx(hr,{id:T,options:d,displayMode:a,ref:S,selectedIndex:g,activeIndex:u||x,width:v,onClick:w,onKeyDown:C})]})},q=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},Ht=r=>r==null?"":""+r,En=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},Tn=/###/g,Bt=r=>r&&r.indexOf("###")>-1?r.replace(Tn,"."):r,Gt=r=>!r||q(r),$e=(r,e,t)=>{const n=q(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(Gt(r))return{};const a=Bt(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return Gt(r)?{}:{obj:r,k:Bt(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)},xr=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?q(r[n])||r[n]instanceof String||q(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):xr(r[n],e[n],t):r[n]=e[n]);return r},Ee=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Dn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const jn=r=>q(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 u=a;u<n.length;++u)if(u!==a&&(o+=t),o+=n[u],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&u<n.length-1)continue;a+=u-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 ze{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:(q(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new ze(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new ze(this.logger,e)}}var ge=new ze;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 Kt 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):q(n)&&a?o.push(...n.split(a)):o.push(n)));const u=Ke(this.data,o);return!u&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),u||!i||!q(n)?u: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),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)(q(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 u=Ke(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?xr(u,n,a):u={...u,...n},qt(this.data,o,u),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 Sr={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 zt={},Jt=r=>!q(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=ge.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 u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:q(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:q(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:u}=this.extractFromKey(e[e.length-1],s),l=u[u.length-1];let f=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const c=s.lng||this.language,d=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((c==null?void 0:c.toLowerCase())==="cimode")return d?a?{res:`${l}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:`${l}${f}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:o;const h=this.resolve(e,s);let g=h==null?void 0:h.res;const m=(h==null?void 0:h.usedKey)||o,x=(h==null?void 0:h.exactUsedKey)||o,E=["[object Number]","[object Function]","[object RegExp]"],T=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject,S=s.count!==void 0&&!q(s.count),v=Je.hasDefaultValue(s),w=S?this.pluralResolver.getSuffix(c,s.count,s):"",C=s.ordinal&&S?this.pluralResolver.getSuffix(c,s.count,{ordinal:!1}):"",Y=S&&!s.ordinal&&s.count===0,_=Y&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${w}`]||s[`defaultValue${C}`]||s.defaultValue;let P=g;D&&!g&&v&&(P=_);const k=Jt(P),U=Object.prototype.toString.apply(P);if(D&&P&&k&&E.indexOf(U)<0&&!(q(T)&&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 H=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,P,{...s,ns:u}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(h.res=H,h.usedParams=this.getUsedParamsDetails(s),h):H}if(i){const H=Array.isArray(P),B=H?[]:{},Z=H?x:m;for(const X in P)if(Object.prototype.hasOwnProperty.call(P,X)){const W=`${Z}${i}${X}`;v&&!g?B[X]=this.translate(W,{...s,defaultValue:Jt(_)?_[X]:void 0,joinArrays:!1,ns:u}):B[X]=this.translate(W,{...s,joinArrays:!1,ns:u}),B[X]===W&&(B[X]=P[X])}g=B}}else if(D&&q(T)&&Array.isArray(g))g=g.join(T),g&&(g=this.extendTranslation(g,e,s,n));else{let H=!1,B=!1;!this.isValidLookup(g)&&v&&(H=!0,g=_),this.isValidLookup(g)||(B=!0,g=o);const X=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&B?void 0:g,W=v&&_!==g&&this.options.updateMissing;if(B||H||W){if(this.logger.log(W?"updateKey":"missingKey",c,l,o,W?_:g),i){const y=this.resolve(o,{...s,keySeparator:!1});y&&y.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 z=[];const N=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&N&&N[0])for(let y=0;y<N.length;y++)z.push(N[y]);else this.options.saveMissingTo==="all"?z=this.languageUtils.toResolveHierarchy(s.lng||this.language):z.push(s.lng||this.language);const p=(y,O,j)=>{var $;const R=v&&j!==g?j:X;this.options.missingKeyHandler?this.options.missingKeyHandler(y,l,O,R,W,s):($=this.backendConnector)!=null&&$.saveMissing&&this.backendConnector.saveMissing(y,l,O,R,W,s),this.emit("missingKey",y,l,O,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?z.forEach(y=>{const O=this.pluralResolver.getSuffixes(y,s);Y&&s[`defaultValue${this.options.pluralSeparator}zero`]&&O.indexOf(`${this.options.pluralSeparator}zero`)<0&&O.push(`${this.options.pluralSeparator}zero`),O.forEach(j=>{p([y],o+j,s[`defaultValue${j}`]||_)})}):p(z,o,_))}g=this.extendTranslation(g,e,s,h,n),B&&g===o&&this.options.appendNamespaceToMissingKey&&(g=`${l}${f}${o}`),(B||H)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${f}${o}`:o,H?g:void 0,s))}return a?(h.res=g,h.usedParams=this.getUsedParamsDetails(s),h):g}extendTranslation(e,t,n,s,a){var u,l;if((u=this.i18nFormat)!=null&&u.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=q(e)&&(((l=n==null?void 0:n.interpolation)==null?void 0:l.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(f){const h=e.match(this.interpolator.nestingRegexp);c=h&&h.length}let d=n.replace&&!q(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),g=h&&h.length;c<g&&(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=q(i)?[i]:i;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=Sr.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 q(e)&&(e=[e]),e.forEach(u=>{if(this.isValidLookup(n))return;const l=this.extractFromKey(u,t),f=l.key;s=f;let c=l.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=t.count!==void 0&&!q(t.count),h=d&&!t.ordinal&&t.count===0,g=t.context!==void 0&&(q(t.context)||typeof t.context=="number")&&t.context!=="",m=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(x=>{var E,T;this.isValidLookup(n)||(o=x,!zt[`${m[0]}-${x}`]&&((E=this.utils)!=null&&E.hasLoadedNamespace)&&!((T=this.utils)!=null&&T.hasLoadedNamespace(o))&&(zt[`${m[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${m.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!!!")),m.forEach(D=>{var w;if(this.isValidLookup(n))return;i=D;const S=[f];if((w=this.i18nFormat)!=null&&w.addLookupKeys)this.i18nFormat.addLookupKeys(S,f,D,x,t);else{let C;d&&(C=this.pluralResolver.getSuffix(D,t.count,t));const Y=`${this.options.pluralSeparator}zero`,_=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(S.push(f+C),t.ordinal&&C.indexOf(_)===0&&S.push(f+C.replace(_,this.options.pluralSeparator)),h&&S.push(f+Y)),g){const P=`${f}${this.options.contextSeparator}${t.context}`;S.push(P),d&&(S.push(P+C),t.ordinal&&C.indexOf(_)===0&&S.push(P+C.replace(_,this.options.pluralSeparator)),h&&S.push(P+Y))}}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&&!q(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 Xt{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ge.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(q(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)),q(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 q(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))):q(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const Zt={zero:0,one:1,two:2,few:3,many:4,other:5},Qt={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class _n{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=ge.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!"),Qt;if(!e.match(/-|_/))return Qt;const u=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(u,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)=>Zt[s]-Zt[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 er=(r,e,t,n=".",s=!0)=>{let a=Rn(r,e,t);return!a&&s&&q(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=ge.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:u,formatSeparator:l,unescapeSuffix:f,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:g,nestingSuffixEscaped:m,nestingOptionsSeparator:x,maxReplaces:E,alwaysFormat:T}=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):u||"}}",this.formatSeparator=l||",",this.unescapePrefix=f?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Ee(d):h||Ee("$t("),this.nestingSuffix=g?Ee(g):m||Ee(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=E||1e3,this.alwaysFormat=T!==void 0?T:!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 u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=g=>{if(g.indexOf(this.formatSeparator)<0){const T=er(t,u,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(T,void 0,n,{...s,...t,interpolationkey:g}):T}const m=g.split(this.formatSeparator),x=m.shift().trim(),E=m.join(this.formatSeparator).trim();return this.format(er(t,u,x,this.options.keySeparator,this.options.ignoreJSONStructure),E,n,{...s,...t,interpolationkey:x})};this.resetRegExp();const f=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,c=((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:g=>lt(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?lt(this.escape(g)):lt(g)}].forEach(g=>{for(o=0;a=g.regex.exec(e);){const m=a[1].trim();if(i=l(m),i===void 0)if(typeof f=="function"){const E=f(e,a,s);i=q(E)?E:""}else if(s&&Object.prototype.hasOwnProperty.call(s,m))i="";else if(c){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),i="";else!q(i)&&!this.useRawValueToEscape&&(i=Ht(i));const x=g.safeValue(i);if(e=e.replace(a[0],x),c?(g.regex.lastIndex+=i.length,g.regex.lastIndex-=a[0].length):g.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(u,l)=>{const f=this.nestingOptionsSeparator;if(u.indexOf(f)<0)return u;const c=u.split(new RegExp(`${f}[ ]*{`));let d=`{${c[1]}`;u=c[0],d=this.interpolate(d,i);const h=d.match(/'/g),g=d.match(/"/g);(((h==null?void 0:h.length)??0)%2===0&&!g||g.length%2!==0)&&(d=d.replace(/'/g,'"'));try{i=JSON.parse(d),l&&(i={...l,...i})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,m),`${u}${f}${d}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,u};for(;s=this.nestingRegexp.exec(e);){let u=[];i={...n},i=i.replace&&!q(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(c=>c.trim());s[1]=f.shift(),u=f,l=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!q(a))return a;q(a)||(a=Ht(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),l&&(a=u.reduce((f,c)=>this.format(f,c,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,...u]=i.split(":"),l=u.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}},tr=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=ge.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?tr: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()]=tr(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(u=>u.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,u)=>{var c;const{formatName:l,formatOptions:f}=In(u);if(this.formats[l]){let d=o;try{const h=((c=s==null?void 0:s.formatParams)==null?void 0:c[s.interpolationkey])||{},g=h.locale||h.lng||s.locale||s.lng||n;d=this.formats[l](o,g,{...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=ge.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={},u={};return e.forEach(l=>{let f=!0;t.forEach(c=>{const d=`${l}|${c}`;!n.reload&&this.store.hasResourceBundle(l,c)?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),u[c]===void 0&&(u[c]=!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(u)}}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(u=>{On(u.loaded,[a],i),Fn(u,e),t&&u.errors.push(t),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(l=>{o[l]||(o[l]={});const f=u.loaded[l];f.length&&f.forEach(c=>{o[l][c]===void 0&&(o[l][c]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(u=>!u.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 c=this.waitingReads.shift();this.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.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)},u=this.backend[n].bind(this.backend);if(u.length===2){try{const l=u(e,t);l&&typeof l.then=="function"?l.then(f=>o(null,f)).catch(o):o(null,l)}catch(l){o(l)}return}return u(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();q(e)&&(e=this.languageUtils.toResolveHierarchy(e)),q(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 u,l,f,c,d;if((l=(u=this.services)==null?void 0:u.utils)!=null&&l.hasLoadedNamespace&&!((c=(f=this.services)==null?void 0:f.utils)!=null&&c.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},g=this.backend.create.bind(this.backend);if(g.length<6)try{let m;g.length===5?m=g(e,t,n,s,h):m=g(e,t,n,s),m&&typeof m.then=="function"?m.then(x=>o(null,x)).catch(o):o(null,m)}catch(m){o(m)}else g(e,t,n,s,o,h)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const rr=()=>({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]),q(r[1])&&(e.defaultValue=r[1]),q(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}),nr=r=>{var e,t;return q(r.ns)&&(r.ns=[r.ns]),q(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),q(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=nr(e),this.services={},this.logger=ge,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&&(q(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=rr();this.options={...n,...this.options,...nr(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?ge.init(s(this.modules.logger),this.options):ge.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=Mn;const f=new Xt(this.options);this.store=new Kt(this.options.resources,this.options);const c=this.services;c.logger=ge,c.resourceStore=this.store,c.languageUtils=f,c.pluralResolver=new _n(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),l&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(c.formatter=s(l),c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new kn(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new Vn(s(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",(d,...h)=>{this.emit(d,...h)}),this.modules.languageDetector&&(c.languageDetector=s(this.modules.languageDetector),c.languageDetector.init&&c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=s(this.modules.i18nFormat),c.i18nFormat.init&&c.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(),u=()=>{const l=(f,c)=>{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(c),t(f,c)};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?u():setTimeout(u,0),o}loadResources(e,t=Ve){var a,i;let n=t;const s=q(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=[],u=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(c=>{c!=="cimode"&&o.indexOf(c)<0&&o.push(c)})};s?u(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>u(f)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,l=>u(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"&&Sr.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,u)=>{u?this.isLanguageChangingTo===e&&(s(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,n.resolve((...l)=>this.t(...l)),t&&t(o,(...l)=>this.t(...l))},i=o=>{var f,c;!e&&!o&&this.services.languageDetector&&(o=[]);const u=q(o)?o:o&&o[0],l=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(q(o)?[o]:o);l&&(this.language||s(l),this.translator.language||this.translator.changeLanguage(l),(c=(f=this.services.languageDetector)==null?void 0:f.cacheUserLanguage)==null||c.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 u;typeof i!="object"?u=this.options.overloadTranslationOptionHandler([a,i].concat(o)):u={...i},u.lng=u.lng||s.lng,u.lngs=u.lngs||s.lngs,u.ns=u.ns||s.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||n||s.keyPrefix);const l=this.options.keySeparator||".";let f;return u.keyPrefix&&Array.isArray(a)?f=a.map(c=>`${u.keyPrefix}${l}${c}`):f=u.keyPrefix?`${u.keyPrefix}${l}${a}`:a,this.t(f,u)};return q(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,u)=>{const l=this.services.backendConnector.state[`${o}|${u}`];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?(q(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();q(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 Xt(rr());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((u,l)=>(u[l]={...this.store.data[l]},u[l]=Object.keys(u[l]).reduce((f,c)=>(f[c]={...u[l][c]},f),u[l]),u),{});a.store=new Kt(o,s),a.services.resourceStore=a.store}return a.translator=new Je(a.services,s),a.translator.on("*",(o,...u)=>{a.emit(o,...u)}),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"},qn={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"},zn={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:qn,Generic:Kn};function sr(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 u=o=="."?",":".";a=a.replace(sr(u,"g"),""),a=a.replace(sr(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:zn},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 bt=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r))(bt||{}),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 N=new Date(n);return isNaN(N.getTime())?void 0:N},[o]=A.useState(new Date),[u,l]=A.useState(r||i()||new Date),[f,c]=A.useState(u?u.getMonth():new Date().getMonth()),[d,h]=A.useState(u?u.getFullYear():new Date().getFullYear()),[g,m]=A.useState(u?u.getDate():null),x=A.useRef(null),E=A.useRef([]),T=[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=N=>t.some(p=>{const y=p.start.getTime(),O=p.end.getTime(),j=N.getTime();return j>=y&&j<=O}),v=N=>{S(N)||(l(N),m(N.getDate()),e&&e(Kr(N)))},w=()=>{f===0?(c(11),h(d-1)):c(f-1),m(1)},C=()=>{f===11?(c(0),h(d+1)):c(f+1),m(1)},Y=(N,p)=>new Date(N,p+1,0).getDate(),_=(N,p)=>new Date(N,p,1).getDay(),P=N=>{var y;const p=B.findIndex(O=>O!==null&&O.getDate()===N);p!==-1&&E.current[p]&&((y=E.current[p])==null||y.focus(),m(N))},k=(N,p)=>{const y=B[p];if(!y)return;const O=Y(d,f),j=y.getDate();switch(N.key){case"ArrowRight":N.preventDefault();{let R=j+1,$=new Date(d,f,R);if(R>O){const M=f===11?d+1:d,F=f===11?0:f+1;R=1,$=new Date(M,F,R),C(),setTimeout(()=>{U(1,"forward")},0);return}S($)?U(R,"forward"):P(R)}break;case"Tab":break;case"ArrowLeft":N.preventDefault();{let R=j-1,$=new Date(d,f,R);if(R<1){const M=f===0?d-1:d,F=f===0?11:f-1,I=Y(M,F);R=I,$=new Date(M,F,R),w(),setTimeout(()=>{U(I,"backward")},0);return}S($)?U(R,"backward"):P(R)}break;case"ArrowUp":N.preventDefault();{let R=j-7,$=new Date(d,f,R);if(R<1){const M=f===0?d-1:d,F=f===0?11:f-1;R=Y(M,F)+R,$=new Date(M,F,R),w(),setTimeout(()=>{U(R,"backward")},0);return}S($)?U(R,"backward"):P(R)}break;case"ArrowDown":N.preventDefault();{let R=j+7,$=new Date(d,f,R);if(R>O){const M=f===11?d+1:d,F=f===11?0:f+1;R=R-O,$=new Date(M,F,R),C(),setTimeout(()=>{U(R,"forward")},0);return}S($)?U(R,"forward"):P(R)}break;case"Home":N.preventDefault(),U(1,"forward");break;case"End":N.preventDefault(),U(O,"backward");break;case"PageUp":N.preventDefault(),w(),setTimeout(()=>{const R=Y(f===0?d-1:d,f===0?11:f-1),$=Math.min(j,R);U($,"forward")},0);break;case"PageDown":N.preventDefault(),C(),setTimeout(()=>{const R=Y(f===11?d+1:d,f===11?0:f+1),$=Math.min(j,R);U($,"forward")},0);break;case" ":case"Space":if(S(y))return;m(y.getDate()),l(y);break;case"Enter":N.preventDefault(),v(y);break}},U=(N,p)=>{const y=Y(d,f);if(p==="forward"){for(let O=N;O<=y;O++){const j=new Date(d,f,O);if(!S(j)){P(O);return}}C(),setTimeout(()=>{U(1,"forward")},0)}else{for(let $=N;$>=1;$--){const M=new Date(d,f,$);if(!S(M)){P($);return}}const O=f===0?d-1:d,j=f===0?11:f-1,R=Y(O,j);w(),setTimeout(()=>{U(R,"backward")},0)}},B=(()=>{const N=Y(d,f),p=_(d,f),y=[];for(let O=0;O<p;O++)y.push(null);for(let O=1;O<=N;O++){const j=new Date(d,f,O);y.push(j)}return y})(),Z=[];let X=[];B.forEach((N,p)=>{if(X.push(N),X.length===7||p===B.length-1){for(;X.length<7;)X.push(null);Z.push(X),X=[]}}),A.useEffect(()=>{var N;if(g!==null){const p=B.findIndex(y=>y!==null&&y.getDate()===g);p!==-1&&E.current[p]&&((N=E.current[p])==null||N.focus())}},[f,d,g,B]);const W={label:"smp-datepickercalendar-label",wrapper:"smp-datepickercalendar",calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(N,p,y,O)=>`smp-datepickercalendar-td
|
|
46
|
-
${
|
|
44
|
+
*/var rt,_t;function fn(){if(_t)return rt;_t=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(f){return i[f]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(f){l[f]=f}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return rt=s()?Object.assign:function(a,i){for(var o,c=n(a),l,f=1;f<arguments.length;f++){o=Object(arguments[f]);for(var u in o)e.call(o,u)&&(c[u]=o[u]);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},rt}var nt,kt;function gt(){if(kt)return nt;kt=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return nt=r,nt}var st,It;function pr(){return It||(It=1,st=Function.call.bind(Object.prototype.hasOwnProperty)),st}var at,Nt;function dn(){if(Nt)return at;Nt=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=gt(),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 f in a)if(n(a,f)){var u;try{if(typeof a[f]!="function"){var d=Error((c||"React class")+": "+o+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}u=a[f](i,f,c,o,null,e)}catch(m){u=m}if(u&&!(u instanceof Error)&&r((c||"React class")+": type specification of "+o+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in t)){t[u.message]=!0;var h=l?l():"";r("Failed "+o+" type: "+u.message+(h??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},at=s,at}var it,Mt;function pn(){if(Mt)return it;Mt=1;var r=dr(),e=fn(),t=gt(),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 it=function(o,c){var l=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function u(p){var g=p&&(l&&p[l]||p[f]);if(typeof g=="function")return g}var d="<<anonymous>>",h={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:C,node:j(),objectOf:W,oneOf:k,oneOfType:R,shape:N,exact:F};function m(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 $(P,V,Y,M,X,G,ne){if(M=M||d,G=G||Y,ne!==t){if(c){var L=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 L.name="Invariant Violation",L}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var U=M+":"+Y;!g[U]&&T<3&&(a("You are manually calling a React.PropTypes validation function for the `"+G+"` prop on `"+M+"`. 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?P?V[Y]===null?new y("The "+X+" `"+G+"` is marked as required "+("in `"+M+"`, but its value is `null`.")):new y("The "+X+" `"+G+"` is marked as required in "+("`"+M+"`, but its value is `undefined`.")):null:p(V,Y,M,X,G)}var O=$.bind(null,!1);return O.isRequired=$.bind(null,!0),O}function w(p){function g(T,$,O,P,V,Y){var M=T[$],X=K(M);if(X!==p){var G=H(M);return new y("Invalid "+P+" `"+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,$,O,P,V){if(typeof p!="function")return new y("Property `"+V+"` of component `"+O+"` has invalid PropType notation inside arrayOf.");var Y=T[$];if(!Array.isArray(Y)){var M=K(Y);return new y("Invalid "+P+" `"+V+"` of type "+("`"+M+"` supplied to `"+O+"`, expected an array."))}for(var X=0;X<Y.length;X++){var G=p(Y,X,O,P,V+"["+X+"]",t);if(G instanceof Error)return G}return null}return x(g)}function S(){function p(g,T,$,O,P){var V=g[T];if(!o(V)){var Y=K(V);return new y("Invalid "+O+" `"+P+"` of type "+("`"+Y+"` supplied to `"+$+"`, expected a single ReactElement."))}return null}return x(p)}function v(){function p(g,T,$,O,P){var V=g[T];if(!r.isValidElementType(V)){var Y=K(V);return new y("Invalid "+O+" `"+P+"` of type "+("`"+Y+"` supplied to `"+$+"`, expected a single ReactElement type."))}return null}return x(p)}function C(p){function g(T,$,O,P,V){if(!(T[$]instanceof p)){var Y=p.name||d,M=I(T[$]);return new y("Invalid "+P+" `"+V+"` of type "+("`"+M+"` supplied to `"+O+"`, expected ")+("instance of `"+Y+"`."))}return null}return x(g)}function k(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,$,O,P,V){for(var Y=T[$],M=0;M<p.length;M++)if(m(Y,p[M]))return null;var X=JSON.stringify(p,function(ne,L){var U=H(L);return U==="symbol"?String(L):L});return new y("Invalid "+P+" `"+V+"` of value `"+String(Y)+"` "+("supplied to `"+O+"`, expected one of "+X+"."))}return x(g)}function W(p){function g(T,$,O,P,V){if(typeof p!="function")return new y("Property `"+V+"` of component `"+O+"` has invalid PropType notation inside objectOf.");var Y=T[$],M=K(Y);if(M!=="object")return new y("Invalid "+P+" `"+V+"` of type "+("`"+M+"` supplied to `"+O+"`, expected an object."));for(var X in Y)if(n(Y,X)){var G=p(Y,X,O,P,V+"."+X,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 "+q(T)+" at index "+g+"."),i}function $(O,P,V,Y,M){for(var X=[],G=0;G<p.length;G++){var ne=p[G],L=ne(O,P,V,Y,M,t);if(L==null)return null;L.data&&n(L.data,"expectedType")&&X.push(L.data.expectedType)}var U=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new y("Invalid "+Y+" `"+M+"` supplied to "+("`"+V+"`"+U+"."))}return x($)}function j(){function p(g,T,$,O,P){return B(g[T])?null:new y("Invalid "+O+" `"+P+"` supplied to "+("`"+$+"`, expected a ReactNode."))}return x(p)}function _(p,g,T,$,O){return new y((p||"React class")+": "+g+" type `"+T+"."+$+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+O+"`.")}function N(p){function g(T,$,O,P,V){var Y=T[$],M=K(Y);if(M!=="object")return new y("Invalid "+P+" `"+V+"` of type `"+M+"` "+("supplied to `"+O+"`, expected `object`."));for(var X in p){var G=p[X];if(typeof G!="function")return _(O,P,V,X,H(G));var ne=G(Y,X,O,P,V+"."+X,t);if(ne)return ne}return null}return x(g)}function F(p){function g(T,$,O,P,V){var Y=T[$],M=K(Y);if(M!=="object")return new y("Invalid "+P+" `"+V+"` of type `"+M+"` "+("supplied to `"+O+"`, expected `object`."));var X=e({},T[$],p);for(var G in X){var ne=p[G];if(n(p,G)&&typeof ne!="function")return _(O,P,V,G,H(ne));if(!ne)return new y("Invalid "+P+" `"+V+"` key `"+G+"` supplied to `"+O+"`.\nBad object: "+JSON.stringify(T[$],null," ")+`
|
|
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
|
+
${I?"smp-datepickercalendar-td-today":""}
|
|
47
47
|
${p?"smp-datepickercalendar-td-selected":""}
|
|
48
|
-
${
|
|
49
|
-
${O?"smp-datepickercalendar-td-disabled":""}`},z=()=>`${T[f]} ${d.toString()}`;return b.jsxs("div",{className:W.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:w,ariaLabel:a(pt.PREVIOUS_MONTH),bindValue:"<",appearance:"ghost",variant:"base"}),b.jsx("div",{"aria-label":z(),className:W.label,children:z()}),b.jsx(Re,{onClick:C,ariaLabel:a(pt.NEXT_MONTH),bindValue:">",appearance:"ghost",variant:"base"})]}),b.jsxs("table",{ref:x,role:"grid","aria-label":`${a(bt.CALENDAR_FOR)} ${T[f]} ${d}`,className:W.table,children:[b.jsx("thead",{children:b.jsx("tr",{children:D.map(N=>b.jsx("th",{scope:"col",abbr:N.full,className:W.th,children:N.value},N.value))})}),b.jsx("tbody",{children:Z.map((N,p)=>b.jsx("tr",{children:N.map((y,O)=>{const j=p*7+O;if(y===null)return b.jsx("td",{className:W.td(!1,!1,!1,!0)},`empty-${O}`);const R=y.getDate()===o.getDate()&&y.getMonth()===o.getMonth()&&y.getFullYear()===o.getFullYear(),$=u&&y.getDate()===u.getDate()&&y.getMonth()===u.getMonth()&&y.getFullYear()===u.getFullYear(),M=g===y.getDate(),F=S(y);return b.jsx("td",{role:"gridcell","aria-selected":$,tabIndex:M?0:-1,onClick:()=>v(y),onKeyDown:I=>k(I,j),"aria-label":`${y.getDate()} ${T[y.getMonth()]} ${y.getFullYear()}`,"data-selected":$,"aria-disabled":F,ref:I=>{E.current[j]=I},className:W.td(R,$,M,F),children:y.getDate()},`day-${O}`)})},`week-${p}`))})]})]})}const wr=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,...s})=>{const[a,i]=A.useState(!1),[o,u]=A.useState(r||""),[l,f]=A.useState(""),{anchorRef:c,targetRef:d}=gt({position:"bottom",enabled:a});Be(d,()=>{i(!1)}),Be(c,()=>{if(typeof c=="object"&&c!==null&&"current"in c){const w=c.current.querySelector("input");w&&w===document.activeElement&&E()}}),vr(a,d);const{format:h,getCurrentLanguage:g}=Ze(),m=A.useCallback(w=>{const C=w.length>5&&Br(w,g())||w,Y=h(C,void 0,void 0,{type:"date"}),_=typeof C!="string",P=_&&C.toISOString().substring(0,10)||"";return{isValid:_,formattedDate:Y,isoDate:P,normalizedDate:C}},[g,h]);A.useEffect(()=>{const{formattedDate:w,isoDate:C,isValid:Y}=m(r);u(Y&&C||r),f(Y&&w||r)},[r,h,m]);const x=()=>i(w=>!w),E=()=>{D(l)},T=w=>{D(w),i(!1)},D=w=>{const{isoDate:C,isValid:Y}=m(w);t&&t(Y&&C||w)},S=w=>{f(w)},v=w=>{w.key==="Enter"&&(w.preventDefault(),D(l))};return b.jsxs("div",{"data-component":"date-picker",children:[b.jsx(Se,{bindValue:l,placeholder:e,onBlur:E,onChange:S,onKeyDown:v,shapeIcon:"calendar",onShapeIconClick:x,ref:c,...s}),a&&b.jsx(rs,{disabledDateRanges:n,onDateChange:T,initialValue:ht(o)&&o||"",targetRef:d})]})},ns=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,placeholder:s,fun:a,onOptionsRequest:i,onChange:o})=>{const u=r.map(c=>c.bindValue),l=(c,d)=>{const h=[...r];if(c=="")h.pop();else{const g=h.findIndex(m=>m.bindValue===c&&m.optionalDisplayValue===d);g>=0?h.splice(g,1):h.push({bindValue:c,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(vt,{elements:r,displayMode:e,isEditable:!0,onChange:c=>{o==null||o(c)}}),b.jsx(yt,{bindValue:"",fun:a,onChange:l,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:s,onOptionsRequest:i,_multiActiveIndex:u})]})},Er=({...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(bt.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}),ar=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)},xt=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,options:u,onChange:l,onClick:f,onEnter:c,onBlur:d,onOptionsRequest:h,isEditable:g})=>{const m={obj:t,shape:e,decode:r,icon:s,fun:a},x={onBlur:d,onOptionsRequest:h,fun:a,icon:s,label:o,isEditable:g,...n},E=(S,v,w)=>Wr(t)?Ue(S,new He(t,v).getLegacyValue()):Ue(S,v,w),T=S=>Ue(m,new We(t,S).getLegacyValue()),D=S=>as(m,S);switch(e){case ie.AUTOCOMPLETE:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(v,w)=>{l==null||l(E(m,v,w))}};return b.jsx(yt,{...S})}case ie.BUTTON:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{f==null||f(E(m,t.k))}};return b.jsx(Re,{...S})}case ie.BUTTON_LIST:{const S={...x,options:u,onClick:(v,w)=>{const C={...m,fun:w};f==null||f(E(C,v))}};return b.jsx(mr,{...S})}case ie.COMBOBOX:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(v,w)=>{l==null||l(E(m,v,w))}};return b.jsx(br,{...S})}case ie.CHECKBOX:{const S={...x,bindValue:We.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:v=>{l==null||l(T(v))}};return b.jsx(yr,{...S})}case ie.CHIP:{const S={...x,elements:ar(m)};return b.jsx(vt,{...S})}case ie.DATE:{const S={...x,bindValue:He.fromDataObj(t).getValue(),onChange:v=>{l==null||l(E(m,v))}};return b.jsx(wr,{...S})}case ie.ICON:case ie.IMAGE:{const S={...x,icon:s,placeholderIcon:i,isInteractable:!!x.fun,onClick:()=>{f==null||f(E(m,t.k))}};return b.jsx(ce,{...S})}case ie.MULTI_AUTOCOMPLETE:{const S={...x,elements:ar(m),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(E(m,v))}};return b.jsx(Er,{...S})}case ie.SPOTLIGHT:{const S={...x,bindValue:t.k,onEnter:v=>{c==null||c(E(m,v))}};return b.jsx(ss,{...S})}case ie.TEXT_FIELD:case void 0:{const S={...x,bindValue:t.k,onChange:v=>{l==null||l(E(m,v))}};return b.jsx(Se,{...S})}}},Tr=({row:r,columnWidths:e={},level:t=0,rowHeight:n=30,offsetTop:s})=>{var T;const[a,i]=A.useState(!1),o=Ye(r)&&!!((T=r.children)!=null&&T.length),u=r.cells&&Object.keys(r.cells).length>0,l=o,f=t*20,c=()=>{o&&i(!a)},d={content:`${be.rowContent} ${o?be.clickable:""}`,toggle:`${be.toggle}`,indent:`${be.indent}`,cell:`${be.cell}`},h=D=>b.jsx(xt,{...D}),g=()=>b.jsx("span",{className:d.toggle,children:l?a?"▶":"▼":" "}),m=()=>b.jsx("span",{className:d.indent,style:{width:`${f}px`},"aria-hidden":"true"}),x=()=>{const D=Yr(r)?"":r.decode||(u?"":"Untitled"),S=s??n*t;return b.jsxs("tr",{className:d.content,onClick:c,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,children:[m(),g(),b.jsx("span",{className:be.rowLabel,children:D})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([v,w])=>b.jsx("td",{className:d.cell,style:{width:e[v],minWidth:e[v]},children:h(w)},Ur(w)||v))]})},E=()=>{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(Tr,{row:S,level:t+1},`child-${v}`)))})};return b.jsxs(b.Fragment,{children:[x(),E()]})},is=({label:r,rowHeight:e,offsetTop:t=0,level:n=0,onClick:s,isExpanded:a})=>b.jsx("tr",{style:{height:e,top:t,position:"absolute",backgroundColor:"#e0e0e0",fontWeight:"bold",cursor:s?"pointer":"default"},onClick:s,children:b.jsxs("td",{style:{paddingLeft:10+n*20,userSelect:"none",display:"flex",alignItems:"center",gap:"6px"},children:[typeof a=="boolean"&&b.jsx("span",{style:{display:"inline-block",width:12},children:a?"▼":"▶"}),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(c,d,h){if(d>=e.length){f(c);return}const g=e[d].column,m=o(c,g);for(const[x,E]of m){const T=[...h,x],D=u(T,d),S=n.has(D);s.push(l(x,D,d,S)),a+=t,S&&i(E,d+1,T)}}function o(c,d){var g;const h=new Map;for(const m of c){const x=((g=m.cells[d])==null?void 0:g.decode)??"N/D";h.has(x)||h.set(x,[]),h.get(x).push(m)}return h}function u(c,d){return`group-${c.join("-")}-${d}`}function l(c,d,h,g){return{isGroup:!0,value:c,cells:{},rowId:d,level:h,isExpanded:g}}function f(c){for(const d of c)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(ce,{icon:"groups"}),b.jsx(vt,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})]})},fs=({data:r,lineHeight:e=30,TableHeight:t=400,groups:n})=>{var v;const[s,a]=A.useState(r),[i,o]=A.useState(n||[]),[u,l]=A.useState(new Set),f=Object.fromEntries(s&&s.columns.map(w=>[w.name,120])),[c,d]=A.useState(f);A.useEffect(()=>{if(i!=null&&i.length&&r.rows){const{flatRows:w}=cs(r.rows,i,e,u);a({...r,rows:w})}else a(r)},[r,i,u,e]);const h=w=>{o(ls(w,i))},g=w=>{w.preventDefault();const C=w.dataTransfer.getData("text/plain");if(!C||i.some(P=>P.column===C))return;const _=[...i,{column:C,visible:!0}];o(_)},m=w=>{w.preventDefault()},{virtualItems:x,containerProps:E,innerProps:T}=pr({items:s.rows||[],itemHeight:e||30,containerHeight:t,overscan:5}),D=(w,C)=>{const Y=w.clientX,_=c[C],P=U=>{const H=U.clientX-Y,B=Math.max(50,_+H);d(Z=>({...Z,[C]:B}))},k=()=>{window.removeEventListener("mousemove",P),window.removeEventListener("mouseup",k)};window.addEventListener("mousemove",P),window.addEventListener("mouseup",k)},S={smpTable:`${Qe["smp-table"]}`,headerCell:`${Qe["smp-headerCell"]}`,resizer:`${Qe["smp-resizer"]}`};return b.jsxs("div",{className:S.smpTable,...E,children:[n&&b.jsx(us,{groups:i,onChange:h,onDrop:g,onDragOver:m}),b.jsxs("table",{children:[b.jsx("thead",{children:b.jsx("tr",{children:s.columns&&((v=s.columns)==null?void 0:v.map(w=>w.visible&&b.jsxs("th",{className:S.headerCell,draggable:!0,onDragStart:C=>{C.dataTransfer.setData("text/plain",w.name)},style:{width:c[w.name],minWidth:c[w.name]},children:[w.title,b.jsx("div",{className:S.resizer,onMouseDown:C=>D(C,w.name),role:"region"})]},w.name)))})}),b.jsx("tbody",{...T,children:x.map(({item:w,index:C,offsetTop:Y})=>w.isGroup?b.jsx(is,{label:w.value||"",rowHeight:e,offsetTop:Y,level:w.level,onClick:()=>{const _=w.rowId;_&&l(P=>os(P,_))},isExpanded:w.isExpanded},w.rowId||`group-${C}`):b.jsx(Tr,{row:w,columnWidths:c,rowHeight:e,offsetTop:Y,isGroup:!1},w.rowId||`row-${C}`))}),b.jsx("tfoot",{children:b.jsx("span",{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},Or=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:Or(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(u=>!!e[u.id]),+t.columns).map((u,l)=>({...t,id:`${t.id}-${l}`,content:u,gridCols:t.columns,horizontal:!0})),s=[]),{...t,sections:n,content:s}}),ir=(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}},or=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"},Rr=({layout:r,cells:e})=>{var c;if(!((c=r.sections)!=null&&c.length))return b.jsx(b.Fragment,{});const t="--smp-grid-template-cols",n="--smp-grid-template-rows",s=Or(r.sections,e),a=d=>d==null?void 0:d.reduce((h,g)=>{var D,S;let m="",x={},E={},T="";return(D=g.sections)!=null&&D.length?(m=de["smp-layout-section-grid"],x=a(g.sections),g.gridCols==null&&(T=`${de[g.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"]}`,(g.horizontal||or(g.sections))&&(E=ir(g.sections,g.horizontal?t:n)))):(S=g.content)!=null&&S.length&&(g.gridCols!==void 0&&g.gridCols>0?(m=de["smp-layout-section-grid"],T=`${de["smp-grid-template-cols"]}`,E={[t]:`repeat(${g.gridCols}, 1fr)`}):m=de["smp-layout-section-flex"]),{...h,...x,[g.id]:{classes:`${m} ${de[g.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${T} ${g.justify?`smp-justifyContent-${g.justify}`:""} ${g.align?`smp-alignItems-${g.align}`:""}`,styles:E}}},{}),i=a(s),o={container:`${de["smp-layout"]} ${r.horizontal?de["smp-layout-horizontal"]:de["smp-layout-vertical"]}`,sections:i},u=r.horizontal||or(r.sections)?ir(s,r.horizontal?t:n):{},l=d=>{var g;const h=b.jsx("div",{"smp-id":"section-"+d.id,className:o.sections[d.id].classes,style:o.sections[d.id].styles,children:(g=d.sections)!=null&&g.length?d.sections.map(m=>l(m)):d.content.map(m=>f(m,e[m.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(lr,{label:d.title})}),h]}):h},f=(d,h,g,m)=>{const x=d.colSpan!==void 0?d.colSpan>0?d.colSpan:d.colStart!==void 0&&d.colStart<1?1:null:null,E=x!==null?`span ${x}`:d.colStart,T=d.colEnd!==void 0&&d.colEnd>0?d.colEnd:"",D={gridColumnStart:E,gridColumnEnd:T},S=`${de["smp-layout-cell-container"]} ${g?`smp-justifyContent-${g}`:""} ${m?`smp-alignItems-${m}`:""}`;return h?b.jsx("div",{className:S,style:{...D},"smp-id":d.id,children:b.jsx(xt,{...h})},d.id):b.jsx(b.Fragment,{})};return b.jsx("div",{className:o.container,style:u,"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(u=>{var f,c;if(!((f=u.rows)!=null&&f.length)||!((c=u.columns)!=null&&c.length))return{};const l=u.rows[0];return u.columns.filter(d=>d.visible).reduce((d,h)=>{const g=l.cells[h.name],m={...g,onChange:x=>{s(E=>E&&{...E,[h.name]:{...E[h.name],obj:{...E[h.name].obj,k:x.obj.k}}})},onClick:()=>{g.fun&&e&&e({...g})},onEnter:x=>{t&&t(x)}};return{...d,[h.name]:m}},{})},[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(Rr,{layout:r.rows[0].layout,cells:n})})},le=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:u,IconColName:l,IconColor:f="var(--smp-dashList-color-base)",NumberFormat:c,ForceUM:d,UmColName:h,UmColor:g="var(--smp-dashList-color-base)",ForceValue:m,ValueColName:x,ValueColor:E="var(--smp-dashList-color-base)",SelectLayout:T="1",onClick:D})=>{const S="N/A",v=(e==null?void 0:e.columns)||[],w=(e==null?void 0:e.rows)||[],C=w.length>0,Y="--smp-dashList-color",_="smp-layout",P="descr",k="icon",U="um",H="value",B=i||"1em",Z="18px",X="--smp-dashList-columns",W="--smp-dashList-fontSize",z={dash:(V="1")=>{const J=p(V),te=J,re=y(J,P),fe=y(J,k),me=y(J,U),pe=y(J,H);return{container:te,descr:re,icon:fe,um:me,value:pe}},dashList:`smp-dash-list ${le(a)?"smp-dash-list-fill-space":""}
|
|
50
|
-
${
|
|
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:I}=Ze(),p=U=>`${R}-${U}`,g=(U,Z)=>`${U}__${Z}`,T=U=>`${W}-${U}`,$=U=>{const Z=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(Z.test(U)){const re=U.match(Z)||[];if((re==null?void 0:re.length)>3)return"rgb("+re[1]+","+re[2]+","+re[3]+")"}return U},O=U=>{if(!u)return U;const[Z,te]=P(u).map(we=>parseInt(we||"0")),re="0,0"+(te?"."+"0".repeat(te):""),fe=I(U,re,"it");if(!Z)return fe;const[ge,pe]=fe.split(",");return ge+(pe?`,${pe}`:"")},P=U=>U.includes(";")?U.split(";"):[U],V=U=>{const Z=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||Z(n)||te(2)||"",icon:c||Z(l)||te(3)||"",um:d||Z(h)||te(1)||"",value:y||Z(x)||te(0)||""}},Y=U=>{D==null||D(U)},M=(U,Z)=>{(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),U.stopPropagation(),Y(Z))},G=(U=>{const Z=q.dash(U);return{className:Z,descr:te=>b.jsx("div",{className:Z.descr,children:te},`${U}-${j}`),icon:te=>b.jsx("div",{className:Z.icon,children:b.jsx(le,{color:f,height:J,icon:te,width:J})},`${U}-${_}`),um:te=>b.jsx("div",{className:Z.um,children:te},`${U}-${N}`),value:te=>b.jsx("div",{className:Z.value,children:te},`${U}-${F}`)}})(E),ne=U=>{const{descr:Z,icon:te,um:re,value:fe}=V(U),ge={[T(j)]:$(s),[T(N)]:$(m),[T(F)]:$(w)},pe=[],we=O(fe);switch(E){case"2":te&&pe.push(G.icon(te)),pe.push(G.descr(Z)),pe.push(G.value(re?we+" "+re:we));break;default:case"1":pe.push(G.descr(Z)),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=>M(jr,U),children:pe},U.rowId)},L={[K]:String(r),[H]:B};return b.jsx("div",{className:q.dashList,style:L,children:k?C.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,f]=A.useState(),[u,d]=A.useState(t??!0),h=A.useRef(null),m=s.trim()?s:"100vh",y=A.useCallback(v=>{var k,W;if(!((k=v.rows)!=null&&k.length)||!((W=v.columns)!=null&&W.length))return{};const C=v.rows[0];return v.columns.filter(R=>R.visible??!0).reduce((R,j)=>{const _=C.cells[j.name];if(!_||!u&&ce(n)&&_.shape!==ie.BUTTON&&_.shape!==ie.BUTTON_LIST)return R;const N={..._,onChange:F=>{f(B=>{const J={...B};return J!=null&&J[j.name]&&(J[j.name].obj.k=F.obj.k),J})},onClick:F=>{F.fun&&a&&a(F)},onEnter:F=>{i&&i(F)}};return c&&_.shape==ie.BUTTON_LIST&&(N.onOptionsRequest=(F,B)=>c(F,B).then(J=>ms(J))),!u&&ce(n)&&(N.data={...N.data,showText:!1,justify:"center"}),{...R,[j.name]:N}},{})},[u,n,a,i,c]),x=A.useCallback(()=>{o==null||o()},[o]),w=()=>{ce(n)?d(v=>!v):(d(!1),o==null||o())};if(A.useEffect(()=>{f(y(r))},[r]),A.useEffect(()=>{if(!h.current)return;if(!ce(n)){f(y(r));return}const v=getComputedStyle(h.current).getPropertyValue("--smp-drawer-slide-transition");let C=Number(v);v.endsWith("ms")?C=parseFloat(v):v.endsWith("s")&&(C=parseFloat(v)*1e3),setTimeout(()=>{f(y(r))},C/2)},[u,n]),A.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"} ${u?"smp-drawer-open":""} ${!ce(n)&&!u?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${u?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${u?"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:h,className:E.drawer,style:{height:m},"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:!u,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[f,u]=A.useState();A.useEffect(()=>{u(()=>{const y={...r};return e&&(y.shape=e),s&&(y.obj=Br(s)),y})},[r,s,e]);const h={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},m=()=>{ce(t)||o==null||o(f)};if(f)return b.jsxs("div",{className:h.container,children:[b.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:b.jsx(St,{...f,onChange:u,onOptionsRequest:l,fun:r.fun,onBlur:m,label:a,labelPosition:i})}),ce(t)&&b.jsx(Re,{optionalDisplayValue:"Confirm",onClick:()=>c==null?void 0:c(f),bindValue:"Confirm"})]})};exports.AppBar=ps;exports.Autocomplete=yt;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;
|