@sme.up/ketchup2 2.0.0-SNAPSHOT-20250610104613 → 2.0.0-SNAPSHOT-20250611105124
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/buttonListAssets.d.ts +3 -0
- package/dist/assets/buttonListAssets.d.ts.map +1 -0
- package/dist/assets/layoutAssets.d.ts.map +1 -1
- package/dist/assets/svg/dashboard.svg +1 -0
- package/dist/assets/svg/star.svg +1 -0
- package/dist/basic-components/button/button-types.d.ts +0 -11
- package/dist/basic-components/button/button-types.d.ts.map +1 -1
- package/dist/basic-components/button/button.d.ts.map +1 -1
- package/dist/basic-components/button-list/button-list-types.d.ts +2 -2
- package/dist/basic-components/button-list/button-list-types.d.ts.map +1 -1
- package/dist/basic-components/button-list/button-list.d.ts.map +1 -1
- package/dist/basic-components/cell/cell-types.d.ts +36 -0
- package/dist/basic-components/cell/cell-types.d.ts.map +1 -1
- package/dist/basic-components/cell/cell.d.ts.map +1 -1
- package/dist/basic-components/cell/tests/utils.d.ts +7 -1
- package/dist/basic-components/cell/tests/utils.d.ts.map +1 -1
- package/dist/components/app-bar/app-bar.data.d.ts +7 -6
- package/dist/components/app-bar/app-bar.data.d.ts.map +1 -1
- package/dist/components/drawer/drawer-types.d.ts +6 -1
- package/dist/components/drawer/drawer-types.d.ts.map +1 -1
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/drawer.data.d.ts +4 -0
- package/dist/components/drawer/drawer.data.d.ts.map +1 -1
- package/dist/functional-components/layout/layout.d.ts.map +1 -1
- package/dist/ketchup2.cjs.js +9 -9
- package/dist/ketchup2.css +1 -1
- package/dist/ketchup2.es.js +1704 -1675
- package/dist/types/data-structures.d.ts +8 -7
- package/dist/types/data-structures.d.ts.map +1 -1
- package/dist/types/generic.d.ts +1 -1
- package/dist/types/generic.d.ts.map +1 -1
- package/dist/utils/adapters.d.ts +3 -0
- package/dist/utils/adapters.d.ts.map +1 -0
- package/package.json +39 -39
package/dist/ketchup2.cjs.js
CHANGED
|
@@ -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 yt;function Dr(){return yt||(yt=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
|
|
17
|
+
*/var yt;function Dr(){return yt||(yt=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 x:return"Profiler";case b:return"StrictMode";case v:return"Suspense";case D:return"SuspenseList";case M: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 g:return"Portal";case P:return(p.displayName||"Context")+".Provider";case O:return(p._context.displayName||"Context")+".Consumer";case w:var m=p.render;return p=p.displayName,p||(p=m.displayName||m.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case L:return m=p.displayName||null,m!==null?m:r(p.type)||"Memo";case U:m=p._payload,p=p._init;try{return r(p(m))}catch{}}return null}function e(p){return""+p}function t(p){try{e(p);var m=!1}catch{m=!0}if(m){m=console;var E=m.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return E.call(m,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),e(p)}}function n(p){if(p===y)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===U)return"<...>";try{var m=r(p);return m?"<"+m+">":"<...>"}catch{return"<...>"}}function s(){var p=N.A;return p===null?null:p.getOwner()}function a(){return Error("react-stack-top-frame")}function o(p){if(Y.call(p,"key")){var m=Object.getOwnPropertyDescriptor(p,"key").get;if(m&&m.isReactWarning)return!1}return p.key!==void 0}function i(p,m){function E(){Z||(Z=!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)",m))}E.isReactWarning=!0,Object.defineProperty(p,"key",{get:E,configurable:!0})}function c(){var p=r(this.type);return X[p]||(X[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,m,E,R,T,$,_,F){return E=$.ref,p={$$typeof:h,type:p,key:m,props:$,_owner:T},(E!==void 0?E: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:_}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:F}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function f(p,m,E,R,T,$,_,F){var k=m.children;if(k!==void 0)if(R)if(q(k)){for(R=0;R<k.length;R++)u(k[R]);Object.freeze&&Object.freeze(k)}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(k);if(Y.call(m,"key")){k=r(p);var z=Object.keys(m).filter(function(ne){return ne!=="key"});R=0<z.length?"{key: someKey, "+z.join(": ..., ")+": ...}":"{key: someKey}",I[k+R]||(z=0<z.length?"{"+z.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} />`,R,k,z,k),I[k+R]=!0)}if(k=null,E!==void 0&&(t(E),k=""+E),o(m)&&(t(m.key),k=""+m.key),"key"in m){E={};for(var H in m)H!=="key"&&(E[H]=m[H])}else E=m;return k&&i(E,typeof p=="function"?p.displayName||p.name||"Unknown":p),l(p,k,$,T,s(),E,_,F)}function u(p){typeof p=="object"&&p!==null&&p.$$typeof===h&&p._store&&(p._store.validated=1)}var d=C,h=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),P=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),j=Symbol.for("react.client.reference"),N=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,q=Array.isArray,K=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(p){return p()}};var Z,X={},W=d["react-stack-bottom-frame"].bind(d,a)(),G=K(n(a)),I={};De.Fragment=y,De.jsx=function(p,m,E,R,T){var $=1e4>N.recentlyCreatedOwnerStacks++;return f(p,m,E,!1,R,T,$?Error("react-stack-top-frame"):W,$?K(n(p)):G)},De.jsxs=function(p,m,E,R,T){var $=1e4>N.recentlyCreatedOwnerStacks++;return f(p,m,E,!0,R,T,$?Error("react-stack-top-frame"):W,$?K(n(p)):G)}}()),De}var vt;function Pr(){return vt||(vt=1,process.env.NODE_ENV==="production"?Le.exports=Rr():Le.exports=Dr()),Le.exports}var S=Pr();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"},$r=r=>r.t=="D8",Ar=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 Ye{constructor(e,t){ve(this,"class");ve(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Ye(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 jr(r,e){if(ft(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"),o=s.indexOf("MM");let i=0,c=0,l="";switch(n.length){case 1:case 2:return i=parseInt(n),t.setDate(i),ke(t)?t:r;case 3:case 4:return i=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),o===0?(t.setMonth(i-1),t.setDate(c)):a===0&&(t.setMonth(c-1),t.setDate(i)),ke(t)?t:r;case 5:case 6:{i=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 o===0?(f=c,u=i-1,t.setFullYear(parseInt(l),u,f)):a===0&&(f=i,u=c-1,t.setFullYear(parseInt(l),u,f)),it(i,u,parseInt(l))&&ke(t)?t:r}case 7:case 8:{i=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),l=n.substring(4);let f=0,u=0;return o===0?(f=c,u=i-1,t.setFullYear(parseInt(l),u,f)):a===0&&(f=i,u=c-1,t.setFullYear(parseInt(l),u,f)),it(f,u,parseInt(l))&&ke(t)?t:r}}return r}function ft(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function ke(r){return r instanceof Date&&!isNaN(r.getTime())}function Cr(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 it(n,t-1,e)}function it(r,e,t){const n=[31,Lr(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Lr(r){return r%4===0&&(r%100!==0||r%400===0)}function kr(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 Ue{constructor(e,t){ve(this,"class");ve(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=bt.get(`${e.t}${e.p}`);if(t)return new Ue(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=bt.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 bt=new Map([["D8*YYMD",{legacyToIso(r){return Cr(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return ft(r)&&r.replaceAll("-","")||r}}]]),We=(r,e)=>{C.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 dt({position:r="bottom",enabled:e=!0}){const t=C.useRef(null),n=C.useRef(null),[s,a]=C.useState(0),o=C.useCallback(()=>{const i=t.current,c=n.current;if(!i||!c)return;const{top:l,left:f,width:u,height:d}=i.getBoundingClientRect();a(u);const h=c.offsetHeight,g=c.offsetWidth;if(g===0||h===0){requestAnimationFrame(o);return}let y=l+window.scrollY,b=f+window.scrollX;switch(r){case"top":y-=h;break;case"bottom":y+=d;break;case"left":b-=g;break;case"right":b+=u;break}requestAnimationFrame(()=>{c.style.transform=`translate(${b}px, ${y}px)`})},[r]);return C.useLayoutEffect(()=>{e&&t.current&&n.current&&o();const i=new MutationObserver(()=>{n.current&&o()});return n.current&&i.observe(n.current,{childList:!0,subtree:!0}),window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),()=>{window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0),i.disconnect()}},[o,e]),{anchorRef:t,targetRef:n,anchorWidth:s}}const He=(r,e,t)=>{if(t)switch(t){case"CodeOnly":return r;case"DescOnly":return e||"";case"Both":return`${r} - ${e}`}return r},Ir=({helperText:r,disabled:e,state:t})=>{const n={container:`smp-helper-text ${e?"smp-helper-text-disabled":""} ${t?`smp-helper-text-${t}`:""}`};return S.jsx("span",{className:n.container,children:r})},nr=({label:r,disabled:e})=>{const t={container:`smp-label ${e?"smp-label-disabled":""}`};return S.jsx("span",{className:t.container,children:r})};function Nr(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 Be(){return Be=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},Be.apply(null,arguments)}function ot(r,e){return ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},ot(r,e)}function _r(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,ot(r,e)}function Xe(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 xt;function Mr(){if(xt)return Ie;xt=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=o,Ie.parse=i;function o(
|
|
26
|
+
*/var xt;function Mr(){if(xt)return Ie;xt=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=o,Ie.parse=i;function o(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 g=h;if(d&&typeof d=="object")for(var y,b=Object.keys(d).sort(),x=0;x<b.length;x++){if(y=b[x],!t.test(y))throw new TypeError("invalid parameter name");g+="; "+y+"="+l(d[y])}return g}function i(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(";"),g=h!==-1?d.slice(0,h).trim():d.trim();if(!a.test(g))throw new TypeError("invalid media type");var y=new f(g.toLowerCase());if(h!==-1){var b,x,O;for(r.lastIndex=h;x=r.exec(d);){if(x.index!==h)throw new TypeError("invalid parameter format");h+=x[0].length,b=x[1].toLowerCase(),O=x[2],O.charCodeAt(0)===34&&(O=O.slice(1,-1),O.indexOf("\\")!==-1&&(O=O.replace(n,"$1"))),y.parameters[b]=O}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 Fr=Mr(),Ee=new Map,sr=function(e){return e.cloneNode(!0)},St=function(){return window.location.protocol==="file:"},ar=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 o=Fr.parse(a).type;if(!(o==="image/svg+xml"||o==="text/plain"))throw new Error("Invalid content type: ".concat(o))}if(s.readyState===4){if(s.status===404||s.responseXML===null)throw new Error(St()?"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||St()&&s.status===0)n(null,s);else throw new Error("There was a problem injecting the SVG: "+s.status+" "+s.statusText)}}catch(i){if(s.abort(),i instanceof Error)n(i,s);else throw i}},s.open("GET",e),s.withCredentials=t,s.overrideMimeType&&s.overrideMimeType("text/xml"),s.send()},ye={},wt=function(e,t){ye[e]=ye[e]||[],ye[e].push(t)},Vr=function(e){for(var t=function(o,i){setTimeout(function(){if(Array.isArray(ye[e])){var c=Ee.get(e),l=ye[e][o];c instanceof SVGSVGElement&&l(null,sr(c)),c instanceof Error&&l(c),o===ye[e].length-1&&delete ye[e]}},0)},n=0,s=ye[e].length;n<s;n++)t(n)},Yr=function(e,t,n){if(Ee.has(e)){var s=Ee.get(e);if(s===void 0){wt(e,n);return}if(s instanceof SVGSVGElement){n(null,sr(s));return}}Ee.set(e,void 0),wt(e,n),ar(e,t,function(a,o){var i;a?Ee.set(e,a):((i=o.responseXML)===null||i===void 0?void 0:i.documentElement)instanceof SVGSVGElement&&Ee.set(e,o.responseXML.documentElement),Vr(e)})},Ur=function(e,t,n){ar(e,t,function(s,a){var o;s?n(s):((o=a.responseXML)===null||o===void 0?void 0:o.documentElement)instanceof SVGSVGElement&&n(null,a.responseXML.documentElement)})},Wr=0,Hr=function(){return++Wr},he=[],Et={},Br="http://www.w3.org/2000/svg",Ze="http://www.w3.org/1999/xlink",Tt=function(e,t,n,s,a,o,i){var c=e.getAttribute("data-src")||e.getAttribute("src");if(!c){i(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?Yr:Ur;l(c,a,function(f,u){if(!u){he.splice(he.indexOf(e),1),e=null,i(f);return}var d=e.getAttribute("id");d&&u.setAttribute("id",d);var h=e.getAttribute("title");h&&u.setAttribute("title",h);var g=e.getAttribute("width");g&&u.setAttribute("width",g);var y=e.getAttribute("height");y&&u.setAttribute("height",y);var b=Array.from(new Set(Xe(Xe(Xe([],(u.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();u.setAttribute("class",b);var x=e.getAttribute("style");x&&u.setAttribute("style",x),u.setAttribute("data-src",c);var O=[].filter.call(e.attributes,function(G){return/^data-\w[\w-]*$/.test(G.name)});if(Array.prototype.forEach.call(O,function(G){G.name&&G.value&&u.setAttribute(G.name,G.value)}),n){var P={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"]},w,v,D,L,U;Object.keys(P).forEach(function(G){w=G,D=P[G],v=u.querySelectorAll(w+"[id]");for(var I=function(R,T){L=v[R].id,U=L+"-"+Hr();var $;Array.prototype.forEach.call(D,function(V){$=u.querySelectorAll("["+V+'*="'+L+'"]');for(var J=0,te=$.length;J<te;J++){var re=$[J].getAttribute(V);re&&!re.match(new RegExp('url\\("?#'+L+'"?\\)'))||$[J].setAttribute(V,"url(#"+U+")")}});for(var _=u.querySelectorAll("[*|href]"),F=[],k=0,z=_.length;k<z;k++){var H=_[k].getAttributeNS(Ze,"href");H&&H.toString()==="#"+v[R].id&&F.push(_[k])}for(var ne=0,A=F.length;ne<A;ne++)F[ne].setAttributeNS(Ze,"href","#"+U);v[R].id=U},p=0,m=v.length;p<m;p++)I(p)})}u.removeAttribute("xmlns:a");for(var M=u.querySelectorAll("script"),j=[],N,Y,q=0,K=M.length;q<K;q++)Y=M[q].getAttribute("type"),(!Y||Y==="application/ecmascript"||Y==="application/javascript"||Y==="text/javascript")&&(N=M[q].innerText||M[q].textContent,N&&j.push(N),u.removeChild(M[q]));if(j.length>0&&(t==="always"||t==="once"&&!Et[c])){for(var Z=0,X=j.length;Z<X;Z++)new Function(j[Z])(window);Et[c]=!0}var W=u.querySelectorAll("style");if(Array.prototype.forEach.call(W,function(G){G.textContent+=""}),u.setAttribute("xmlns",Br),u.setAttribute("xmlns:xlink",Ze),o(u),!e.parentNode){he.splice(he.indexOf(e),1),e=null,i(new Error("Parent node is null"));return}e.parentNode.replaceChild(u,e),he.splice(he.indexOf(e),1),e=null,i(null,u)})},qr=function(e,t){var n=t===void 0?{}:t,s=n.afterAll,a=s===void 0?function(){}:s,o=n.afterEach,i=o===void 0?function(){}:o,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,g=n.httpRequestWithCredentials,y=g===void 0?!1:g,b=n.renumerateIRIElements,x=b===void 0?!0:b;if(e&&"length"in e)for(var O=0,P=0,w=e.length;P<w;P++)Tt(e[P],h,x,u,y,l,function(v,D){i(v,D),e&&"length"in e&&e.length===++O&&a(O)});else e?Tt(e,h,x,u,y,l,function(v,D){i(v,D),a(1),e=null}):a(0)},Ne={exports:{}},_e={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 Ot;function Kr(){if(Ot)return
|
|
33
|
+
*/var Ot;function Kr(){if(Ot)return Q;Ot=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,o=r?Symbol.for("react.provider"):60109,i=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,g=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,x=r?Symbol.for("react.responder"):60118,O=r?Symbol.for("react.scope"):60119;function P(v){if(typeof v=="object"&&v!==null){var D=v.$$typeof;switch(D){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 i:case f:case g:case h:case o:return v;default:return D}}case t:return D}}}function w(v){return P(v)===l}return Q.AsyncMode=c,Q.ConcurrentMode=l,Q.ContextConsumer=i,Q.ContextProvider=o,Q.Element=e,Q.ForwardRef=f,Q.Fragment=n,Q.Lazy=g,Q.Memo=h,Q.Portal=t,Q.Profiler=a,Q.StrictMode=s,Q.Suspense=u,Q.isAsyncMode=function(v){return w(v)||P(v)===c},Q.isConcurrentMode=w,Q.isContextConsumer=function(v){return P(v)===i},Q.isContextProvider=function(v){return P(v)===o},Q.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},Q.isForwardRef=function(v){return P(v)===f},Q.isFragment=function(v){return P(v)===n},Q.isLazy=function(v){return P(v)===g},Q.isMemo=function(v){return P(v)===h},Q.isPortal=function(v){return P(v)===t},Q.isProfiler=function(v){return P(v)===a},Q.isStrictMode=function(v){return P(v)===s},Q.isSuspense=function(v){return P(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===g||v.$$typeof===h||v.$$typeof===o||v.$$typeof===i||v.$$typeof===f||v.$$typeof===b||v.$$typeof===x||v.$$typeof===O||v.$$typeof===y)},Q.typeOf=P,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 Rt;function zr(){return Rt||(Rt=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,o=r?Symbol.for("react.provider"):60109,i=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.concurrent_mode"):60111,
|
|
40
|
+
*/var Rt;function zr(){return Rt||(Rt=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,o=r?Symbol.for("react.provider"):60109,i=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,g=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,x=r?Symbol.for("react.responder"):60118,O=r?Symbol.for("react.scope"):60119;function P(A){return typeof A=="string"||typeof A=="function"||A===n||A===l||A===a||A===s||A===u||A===d||typeof A=="object"&&A!==null&&(A.$$typeof===g||A.$$typeof===h||A.$$typeof===o||A.$$typeof===i||A.$$typeof===f||A.$$typeof===b||A.$$typeof===x||A.$$typeof===O||A.$$typeof===y)}function w(A){if(typeof A=="object"&&A!==null){var V=A.$$typeof;switch(V){case e:var J=A.type;switch(J){case c:case l:case n:case a:case s:case u:return J;default:var te=J&&J.$$typeof;switch(te){case i:case f:case g:case h:case o:return te;default:return V}}case t:return V}}}var v=c,D=l,L=i,U=o,M=e,j=f,N=n,Y=g,q=h,K=t,Z=a,X=s,W=u,G=!1;function I(A){return G||(G=!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(A)||w(A)===c}function p(A){return w(A)===l}function m(A){return w(A)===i}function E(A){return w(A)===o}function R(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function T(A){return w(A)===f}function $(A){return w(A)===n}function _(A){return w(A)===g}function F(A){return w(A)===h}function k(A){return w(A)===t}function z(A){return w(A)===a}function H(A){return w(A)===s}function ne(A){return w(A)===u}ee.AsyncMode=v,ee.ConcurrentMode=D,ee.ContextConsumer=L,ee.ContextProvider=U,ee.Element=M,ee.ForwardRef=j,ee.Fragment=N,ee.Lazy=Y,ee.Memo=q,ee.Portal=K,ee.Profiler=Z,ee.StrictMode=X,ee.Suspense=W,ee.isAsyncMode=I,ee.isConcurrentMode=p,ee.isContextConsumer=m,ee.isContextProvider=E,ee.isElement=R,ee.isForwardRef=T,ee.isFragment=$,ee.isLazy=_,ee.isMemo=F,ee.isPortal=k,ee.isProfiler=z,ee.isStrictMode=H,ee.isSuspense=ne,ee.isValidElementType=P,ee.typeOf=w}()),ee}var Dt;function ir(){return Dt||(Dt=1,process.env.NODE_ENV==="production"?_e.exports=Kr():_e.exports=zr()),_e.exports}/*
|
|
41
41
|
object-assign
|
|
42
42
|
(c) Sindre Sorhus
|
|
43
43
|
@license MIT
|
|
44
|
-
*/var Qe,Pt;function Gr(){if(Pt)return Qe;Pt=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 o={},i=0;i<10;i++)o["_"+String.fromCharCode(i)]=i;var c=Object.getOwnPropertyNames(o).map(function(
|
|
45
|
-
Valid keys: `+JSON.stringify(Object.keys(p),null," "));var A=ne(M,q,T,$,N+"."+q,t);if(A)return A}return null}return x(m)}function H(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(H);if(p===null||i(p))return!0;var m=f(p);if(m){var E=m.call(p),O;if(m!==p.entries){for(;!(O=E.next()).done;)if(!H(O.value))return!1}else for(;!(O=E.next()).done;){var T=O.value;if(T&&!H(T[1]))return!1}}else return!1;return!0;default:return!1}}function re(p,m){return p==="symbol"?!0:m?m["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&m instanceof Symbol:!1}function X(p){var m=typeof p;return Array.isArray(p)?"array":p instanceof RegExp?"object":re(m,p)?"symbol":m}function W(p){if(typeof p>"u"||p===null)return""+p;var m=X(p);if(m==="object"){if(p instanceof Date)return"date";if(p instanceof RegExp)return"regexp"}return m}function G(p){var m=W(p);switch(m){case"array":case"object":return"an "+m;case"boolean":case"date":case"regexp":return"a "+m;default:return m}}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},nt}var st,Lt;function Zr(){if(Lt)return st;Lt=1;var r=pt();function e(){}function t(){}return t.resetWarningCache=e,st=function(){function n(o,i,c,l,u,f){if(f!==r){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}n.isRequired=n;function s(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:e};return a.PropTypes=a,a},st}var kt;function Qr(){if(kt)return Ne.exports;if(kt=1,process.env.NODE_ENV!=="production"){var r=ir(),e=!0;Ne.exports=Xr()(r.isElement,e)}else Ne.exports=Zr()();return Ne.exports}var ae=Qr(),en=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},tn=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},rn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Me="http://www.w3.org/2000/svg",It="http://www.w3.org/1999/xlink",Te=function(r){function e(){for(var n,s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];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(i){n.reactWrapper=i},n}_r(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof en(this.reactWrapper).Node){var a=this.props,o=a.desc,i=a.evalScripts,c=a.httpRequestWithCredentials,l=a.renumerateIRIElements,u=a.src,f=a.title,d=a.useRequestCache,h=this.props.onError,g=this.props.beforeInjection,y=this.props.afterInjection,x=this.props.wrapper,w,R;x==="svg"?(w=document.createElementNS(Me,x),w.setAttribute("xmlns",Me),w.setAttribute("xmlns:xlink",It),R=document.createElementNS(Me,x)):(w=document.createElement(x),R=document.createElement(x)),w.appendChild(R),R.dataset.src=u,this.nonReactWrapper=this.reactWrapper.appendChild(w);var D=function(L){if(s.removeSVG(),!s._isMounted){h(L);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){h(L)})},b=function(L,Y){if(L){D(L);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{y(Y)}catch(V){D(V)}})},v=function(L){if(L.setAttribute("role","img"),o){var Y=L.querySelector(":scope > desc");Y&&L.removeChild(Y);var V=document.createElement("desc");V.innerHTML=o,L.prepend(V)}if(f){var j=L.querySelector(":scope > title");j&&L.removeChild(j);var _=document.createElement("title");_.innerHTML=f,L.prepend(_)}try{g(L)}catch(U){D(U)}};Br(R,{afterEach:b,beforeEach:v,cacheRequests:d,evalScripts:i,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;tn(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 o=s.loading;s.renumerateIRIElements,s.src,s.title,s.useRequestCache;var i=s.wrapper,c=Nr(s,rn),l=i;return Ce.createElement(l,qe({},c,{ref:this.refCallback},i==="svg"?{xmlns:Me,xmlnsXlink:It}:{}),this.state.isLoading&&o&&Ce.createElement(o,null),this.state.hasError&&a&&Ce.createElement(a,null))},e}(Ce.Component);Te.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Te.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 lt={assets:"/"};const nn=r=>{lt={...lt,...r}},Nt=r=>`${lt.assets}/${r}`.replace(/\/+/g,"/"),ue=C.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:o="base",rotated:i=!1,onClick:c,isInteractable:l=!1,spin:u=!1,title:f})=>{const[d,h]=C.useState(r),g=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),y=g&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),x=Nt(`assets/svg/${r}.svg`),w=Nt(`assets/svg/${n}.svg`),R={img:`${l?"smp-image-interactable":""}`,svg:`smp-icon ${o?`smp-icon-${o}`:""} ${i?"smp-icon-rotated":""} ${l?"smp-icon-interactable":""} ${u?"smp-icon-spin":""}`},D=()=>{!a&&c&&c()};return S.jsx(S.Fragment,{children:y?S.jsx(Te,{src:r,fallback:()=>S.jsx(Te,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:f,role:"application",fill:s,"aria-disabled":a,className:R.svg,onClick:D}):g?S.jsx("img",{src:d,width:e||"16px",height:t||"auto",alt:f,onError:()=>h(w),onClick:D,className:R.img,title:f,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&D()}}):S.jsx(Te,{src:x,fallback:()=>S.jsx(Te,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:f,role:"application",fill:s,"aria-disabled":a,className:R.svg,onClick:D})})}),xe=({disabled:r,readOnly:e,bindValue:t,icon:n,onBlur:s,onChange:a,placeholder:o,shapeIcon:i,sizing:c,state:l,variant:u,rotatedShapeIcon:f=!1,onShapeIconClick:d,ref:h,inputRef:g,onKeyDown:y,inputType:x="text",ariaLabel:w="input field",label:R,helperText:D=!1,error:b,appearance:v="base",fullWidth:P=!1,_dataComponent:L="textfield",width:Y})=>{const V=b?"danger":l,j=b||l=="danger"?"error":i,_=D||!!b,U=re=>{a==null||a(re.target.value)},z={wrapper:`smp-textfield-wrapper ${P?"smp-textfield-fullWidth":""}`,container:`smp-textfield ${r?"smp-textfield-disabled":""} ${e?"smp-textfield-readOnly":""} ${o?"smp-textfield-placeholder":""} ${c?`smp-textfield-${c}`:""} ${V?`smp-textfield-${V}`:""} ${u?`smp-textfield-variant-${u}`:""} ${v?`smp-textfield-${v}`:""}`,input:"smp-textfield-input "},H=Y?{"--smp-textField-width-base":Y}:void 0;return S.jsxs("div",{className:z.wrapper,"data-component":L,children:[R&&S.jsx(nr,{label:R,disabled:r}),S.jsxs("div",{className:z.container,ref:h,style:H,children:[n&&S.jsx(ue,{icon:n,disabled:r}),S.jsx("input",{type:x,value:t,placeholder:o,onChange:U,onBlur:s,className:z.input,disabled:r,readOnly:e,onKeyDown:y,"aria-label":w,ref:g}),j&&S.jsx(ue,{icon:j,disabled:r,state:V,onClick:d,rotated:f})]}),_&&S.jsx(Ir,{helperText:b,disabled:r,state:V})]})};function sn({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=C.useState(0),o=C.useRef(null),i=r.length*e,c=Math.max(0,Math.floor(s/e)-n),l=Math.min(r.length-1,Math.floor((s+t)/e)+n),u=[];for(let h=c;h<=l;h++)u.push({item:r[h],index:h,offsetTop:h*e});const f=C.useCallback(h=>{const g=h.target.scrollTop;a(g)},[]),d=h=>{if(!o.current)return;const g=h*e,y=g+e,x=o.current,w=x.scrollTop,R=w+t;g<w?x.scrollTop=g:y>R&&(x.scrollTop=y-t)};return{virtualItems:u,containerProps:{ref:o,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:f},innerProps:{style:{height:`${i}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:i,startIndex:c,endIndex:l},scrollToIndex:d}}const an=10,lr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:o=[],width:i,onClick:c,onKeyDown:l})=>{var j;const[u,f]=C.useState(""),d=24,[h,g]=C.useState(a!==null?a:-1),y=s!==void 0?s:e.length>an,x=u?e.filter(_=>_.label.toLowerCase().includes(u.toLowerCase())):e,w=_=>{f(_)},{virtualItems:R,containerProps:D,innerProps:b,scrollToIndex:v}=sn({items:x,itemHeight:d,containerHeight:200,overscan:5});C.useEffect(()=>{a!==null&&a!==h&&g(a)},[a]),C.useEffect(()=>{h>=0&&h<x.length&&v(h)},[h,x]);const P=_=>{if(_.key==="ArrowDown"||_.key==="ArrowUp"){_.preventDefault();let U=h;_.key==="ArrowDown"?U=h<x.length-1?h+1:0:_.key==="ArrowUp"&&(U=h>0?h-1:x.length-1),g(U)}else _.key==="Enter"?h>=0&&h<x.length&&(c==null||c(x[h])):_.key==="Escape"&&(_.preventDefault(),_.stopPropagation());l&&l(_)},L=_=>{P(_)},Y=_=>{P(_)},V={wrapper:"smp-list",container:"smp-list-container",virtualScroll:"smp-list-virtualScroll",listItem:"smp-list-listItem"};return S.jsxs("div",{id:r,ref:n,className:V.wrapper,"data-component":"list",style:{width:i},children:[y&&S.jsx(xe,{bindValue:u,placeholder:"Search...",onChange:w,onKeyDown:L}),S.jsx("div",{...D,className:V.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:Y,"aria-activedescendant":h>=0&&h<x.length?(j=x[h])==null?void 0:j.id:void 0,children:S.jsx("div",{...b,className:V.virtualScroll,children:R.map(({item:_,index:U,offsetTop:z})=>{const H=o.includes(_.id);return S.jsxs("li",{role:"option",id:_.id,"aria-selected":h===U?"true":"false",tabIndex:-1,className:`${V.listItem} ${h===U?"selected-item":""}`,"aria-label":_.id+"-"+_.label,style:{height:`${d}px`,lineHeight:`calc(${d}px - 2*2px)`,transform:`translateY(${z}px)`},onClick:()=>{c==null||c(_),g(U)},children:[He(_.id,_.label,t),H&&S.jsx(ue,{icon:"check",width:16})]},_.id)})})})]})},cr=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=C.useState(He(e,t,r));return C.useEffect(()=>{a(e)},[e]),C.useEffect(()=>{a(He(e,t,r))},[t,r]),S.jsx(xe,{...n,bindValue:s})},on=r=>{const e=C.useRef(null);return C.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}},ht=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,placeholder:o,fun:i,_changeOnEnter:c=!1,onChange:l,onOptionsRequest:u,_multiActiveIndex:f,...d})=>{const[h,g]=C.useState(r),[y,x]=C.useState(e),[w,R]=C.useState(!1),[D,b]=C.useState(t||[]),[v,P]=C.useState(0),[L,Y]=C.useState([r]),{anchorRef:V,targetRef:j,anchorWidth:_}=dt({position:"bottom",enabled:w});We(j,()=>R(!1));const U=on(400),z=W=>{W.length>=a?i&&u&&U(async()=>{const G=await u(i,W);b(G),P(G.length>0?0:-1),R(!0)}):R(!1),g(W),x(e),c||l==null||l(W,e)},H=W=>{c?(g(""),x("")):(g(W.id),x(W.label)),l==null||l(W.id,W.label);const G=D.findIndex(I=>I.id===W.id);P(G),Y([W.id]),R(!1)},re=W=>{W.key==="Escape"&&(R(!1),P(-1))},X=W=>{if((W.key==="ArrowDown"||W.key==="ArrowUp")&&(W.preventDefault(),w)){const G=W.key==="ArrowDown"?(v+1)%D.length:(v-1+D.length)%D.length;P(G)}switch(W.key){case"Enter":v>=0&&v<D.length?H(D[v]):c&&(l==null||l(h,""),R(!1),g(""),x(""));break;case"Escape":R(!1),P(-1);break}};return S.jsxs("div",{"data-component":"autocomplete",children:[S.jsx(cr,{...d,bindValue:h,optionalDisplayValue:y,displayMode:n,shapeIcon:"magnify",placeholder:o,ref:V,onChange:z,onKeyDown:X,"aria-autocomplete":"list"}),w&&S.jsx(lr,{options:D,displayMode:s,onClick:H,ref:j,selectedIndex:v,activeIndex:f||L,width:_,showFilter:!1,onKeyDown:re})]})},_t=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],Mt=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],Oe=({bindValue:r,onClick:e,ariaLabel:t,icon:n,disabled:s,sizing:a="base",variant:o="primary",appearance:i="raised",showIcon:c=!0,showText:l=!0,fullWidth:u=!1,loading:f=!1,title:d,optionalDisplayValue:h})=>{const g={container:`smp-button smp-button-container ${a?`smp-button-${a}`:""} ${o?`smp-buttonVariant-${o}`:""} ${i?`smp-buttonType-${i}`:""} ${u?"smp-button-fullWidth":""}`};return S.jsx("button",{"data-component":"button",className:g.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":f,title:d||h,children:f?S.jsx(ue,{icon:"spinner",state:Mt(o),spin:!0}):S.jsxs(S.Fragment,{children:[n&&c&&S.jsx(ue,{icon:n,disabled:s,state:Mt(o),width:_t(a),height:_t(a)}),l&&r&&S.jsx("span",{children:r})]})})},ur=({options:r,direction:e="row",disposition:t="start",sizing:n,variant:s,appearance:a,showText:o,showIcon:i,fullWidth:c,disabled:l,onClick:u})=>{const f={container:`smp-button-list smp-button-list-${e} smp-justifyContent-${t}`},d=r==null?void 0:r.map((h,g)=>{const y={bindValue:h.id,label:h.label,fun:h.fun,icon:h.icon,variant:s,appearance:a,showText:o,showIcon:i,fullWidth:c,disabled:l,sizing:n,onClick:()=>{u==null||u(h.id,h.fun)}};return S.jsx(Oe,{...y},`button-${g}`)});return S.jsx("div",{role:"list","data-component":"button-list",className:f.container,children:d})},fr=({bindValue:r,onChange:e,onBlur:t})=>{const n=s=>{e&&e(s.target.checked)};return S.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:n,onBlur:t})},ln={titleLarge:"h2",title:"h3",body:"h6",label:"label"},cn=({variant:r="body",bindValue:e,color:t,...n})=>{const s=ln[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return S.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},dr=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:o=!1})=>{const[i,c]=C.useState(null),l={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},u=h=>{n==null||n(r.filter((g,y)=>y!==h))},f=h=>{c(h)},d=h=>{if(i===null||i===h)return;const g=[...r],[y]=g.splice(i,1);g.splice(h,0,y),n==null||n(g),c(null)};return S.jsx("div",{className:l.container,role:"list","data-component":"chip",children:r.flatMap((h,g)=>{const y=He(h.bindValue,h.optionalDisplayValue,t),x=S.jsxs("div",{className:l.element,role:"listitem",draggable:o,onDragStart:()=>f(g),onDragOver:R=>o&&R.preventDefault(),onDrop:()=>o&&d(g),style:{"--smp-chips-backgroundColor-base":a},children:[o&&S.jsx(ue,{icon:"drag_indicator_horizontal",isInteractable:!0}),S.jsx(cn,{variant:"label",bindValue:y,color:s}),e&&S.jsx(ue,{icon:"close",isInteractable:!0,onClick:()=>u(g),color:s})]},`chip-${g}`),w=o&&g<r.length-1?S.jsx(ue,{icon:"chevron-right",color:s},`separator-${g}`):null;return[x,w].filter(Boolean)})})};function pr(r,e){const t=C.useRef(null);C.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 o=l=>{if(l.key==="Escape"||l.key!=="Tab")return;const u=s();if(u.length===0)return;const f=u[0],d=u[u.length-1];l.shiftKey&&document.activeElement===f?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),f.focus())},i=l=>{if(n&&!n.contains(l.target)){l.preventDefault();const u=s();u.length>0&&u[0].focus()}};document.addEventListener("keydown",o),document.addEventListener("mousedown",i);const c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.removeEventListener("mousedown",i),document.body.style.overflow=c,t.current&&requestAnimationFrame(()=>{var l;(l=t.current)==null||l.focus()})}},[r,e])}const hr=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,displayMode:s,listDisplayMode:a="Both",fun:o,onOptionsRequest:i,multiActiveIndex:c,...l})=>{const[u,f]=C.useState(!1),[d,h]=C.useState(t),[g,y]=C.useState(-1),[x,w]=C.useState([r]),R=C.useId(),{anchorRef:D,targetRef:b,anchorWidth:v}=dt({position:"bottom",enabled:u});We(b,()=>f(!1)),pr(u,b);const P=j=>{e==null||e(j.id,j.label);const _=d.findIndex(U=>U.id===j.id);y(_),w([j.id]),f(!1)},L=j=>{j.key==="Escape"&&(f(!1),y(-1))},Y=j=>{(j.key==="ArrowDown"||j.key==="ArrowUp")&&(j.preventDefault(),V())},V=()=>{o&&i&&i(o,void 0).then(j=>{h(j),y(j.length>0?0:-1),f(!0)})};return S.jsxs("div",{role:"combobox","aria-expanded":u,"aria-controls":R,"aria-owns":R,"data-component":"combobox",children:[S.jsx(cr,{...l,bindValue:r,optionalDisplayValue:n,displayMode:s,onShapeIconClick:V,onKeyDown:Y,shapeIcon:"arrow_drop_down",rotatedShapeIcon:u,readOnly:!0,ref:D,"aria-autocomplete":"list",variant:"notSelectable"}),u&&S.jsx(lr,{id:R,options:d,displayMode:a,ref:b,selectedIndex:g,activeIndex:c||x,width:v,onClick:P,onKeyDown:L})]})},B=r=>typeof r=="string",Pe=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},Ft=r=>r==null?"":""+r,un=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},fn=/###/g,Vt=r=>r&&r.indexOf("###")>-1?r.replace(fn,"."):r,Yt=r=>!r||B(r),$e=(r,e,t)=>{const n=B(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(Yt(r))return{};const a=Vt(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return Yt(r)?{}:{obj:r,k:Vt(n[s])}},Ut=(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],o=e.slice(0,e.length-1),i=$e(r,o,Object);for(;i.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),i=$e(r,o,Object),i!=null&&i.obj&&typeof i.obj[`${i.k}.${a}`]<"u"&&(i.obj=void 0);i.obj[`${i.k}.${a}`]=t},dn=(r,e,t,n)=>{const{obj:s,k:a}=$e(r,e,Object);s[a]=s[a]||[],s[a].push(t)},Be=(r,e)=>{const{obj:t,k:n}=$e(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},pn=(r,e,t)=>{const n=Be(r,t);return n!==void 0?n:Be(e,t)},gr=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?B(r[n])||r[n]instanceof String||B(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):gr(r[n],e[n],t):r[n]=e[n]);return r},we=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var hn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const gn=r=>B(r)?r.replace(/[&<>"'\/]/g,e=>hn[e]):r;class mn{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 yn=[" ",",","?","!",";"],vn=new mn(20),bn=(r,e,t)=>{e=e||"",t=t||"";const n=yn.filter(o=>e.indexOf(o)<0&&t.indexOf(o)<0);if(n.length===0)return!0;const s=vn.getRegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!s.test(r);if(!a){const o=r.indexOf(t);o>0&&!s.test(r.substring(0,o))&&(a=!0)}return a},ct=(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 o,i="";for(let c=a;c<n.length;++c)if(c!==a&&(i+=t),i+=n[c],o=s[i],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&c<n.length-1)continue;a+=c-a+1;break}s=o}return s},Ae=r=>r==null?void 0:r.replace("_","-"),xn={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 Ke{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||xn,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:(B(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Ke(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Ke(this.logger,e)}}var ge=new Ke;class Ge{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 o=0;o<a;o++)s(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,a])=>{for(let o=0;o<a;o++)s.apply(s,[e,...t])})}}class Wt extends Ge{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,s={}){var l,u;const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,o=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let i;e.indexOf(".")>-1?i=e.split("."):(i=[e,t],n&&(Array.isArray(n)?i.push(...n):B(n)&&a?i.push(...n.split(a)):i.push(n)));const c=Be(this.data,i);return!c&&!t&&!n&&e.indexOf(".")>-1&&(e=i[0],t=i[1],n=i.slice(2).join(".")),c||!o||!B(n)?c:ct((u=(l=this.data)==null?void 0:l[e])==null?void 0:u[t],n,a)}addResource(e,t,n,s,a={silent:!1}){const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let i=[e,t];n&&(i=i.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(i=e.split("."),s=t,t=i[1]),this.addNamespaces(t),Ut(this.data,i,s),a.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const a in n)(B(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,o={silent:!1,skipCopy:!1}){let i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),s=n,n=t,t=i[1]),this.addNamespaces(t);let c=Be(this.data,i)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?gr(c,n,a):c={...c,...n},Ut(this.data,i,c),o.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 mr={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,n,s){return r.forEach(a=>{var o;e=((o=this.processors[a])==null?void 0:o.process(e,t,n,s))??e}),e}};const Ht={},qt=r=>!B(r)&&typeof r!="boolean"&&typeof r!="number";class ze extends Ge{constructor(e,t={}){super(),un(["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 o=n&&e.indexOf(n)>-1,i=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!bn(e,n,s);if(o&&!i){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:B(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:B(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,o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:i,namespaces:c}=this.extractFromKey(e[e.length-1],s),l=c[c.length-1];let u=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");const f=s.lng||this.language,d=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return d?a?{res:`${l}${u}${i}`,usedKey:i,exactUsedKey:i,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:`${l}${u}${i}`:a?{res:i,usedKey:i,exactUsedKey:i,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:i;const h=this.resolve(e,s);let g=h==null?void 0:h.res;const y=(h==null?void 0:h.usedKey)||i,x=(h==null?void 0:h.exactUsedKey)||i,w=["[object Number]","[object Function]","[object RegExp]"],R=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject,b=s.count!==void 0&&!B(s.count),v=ze.hasDefaultValue(s),P=b?this.pluralResolver.getSuffix(f,s.count,s):"",L=s.ordinal&&b?this.pluralResolver.getSuffix(f,s.count,{ordinal:!1}):"",Y=b&&!s.ordinal&&s.count===0,V=Y&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${P}`]||s[`defaultValue${L}`]||s.defaultValue;let j=g;D&&!g&&v&&(j=V);const _=qt(j),U=Object.prototype.toString.apply(j);if(D&&j&&_&&w.indexOf(U)<0&&!(B(R)&&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 z=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,j,{...s,ns:c}):`key '${i} (${this.language})' returned an object instead of string.`;return a?(h.res=z,h.usedParams=this.getUsedParamsDetails(s),h):z}if(o){const z=Array.isArray(j),H=z?[]:{},re=z?x:y;for(const X in j)if(Object.prototype.hasOwnProperty.call(j,X)){const W=`${re}${o}${X}`;v&&!g?H[X]=this.translate(W,{...s,defaultValue:qt(V)?V[X]:void 0,joinArrays:!1,ns:c}):H[X]=this.translate(W,{...s,joinArrays:!1,ns:c}),H[X]===W&&(H[X]=j[X])}g=H}}else if(D&&B(R)&&Array.isArray(g))g=g.join(R),g&&(g=this.extendTranslation(g,e,s,n));else{let z=!1,H=!1;!this.isValidLookup(g)&&v&&(z=!0,g=V),this.isValidLookup(g)||(H=!0,g=i);const X=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&H?void 0:g,W=v&&V!==g&&this.options.updateMissing;if(H||z||W){if(this.logger.log(W?"updateKey":"missingKey",f,l,i,W?V:g),o){const m=this.resolve(i,{...s,keySeparator:!1});m&&m.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 G=[];const I=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&I&&I[0])for(let m=0;m<I.length;m++)G.push(I[m]);else this.options.saveMissingTo==="all"?G=this.languageUtils.toResolveHierarchy(s.lng||this.language):G.push(s.lng||this.language);const p=(m,E,O)=>{var $;const T=v&&O!==g?O:X;this.options.missingKeyHandler?this.options.missingKeyHandler(m,l,E,T,W,s):($=this.backendConnector)!=null&&$.saveMissing&&this.backendConnector.saveMissing(m,l,E,T,W,s),this.emit("missingKey",m,l,E,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?G.forEach(m=>{const E=this.pluralResolver.getSuffixes(m,s);Y&&s[`defaultValue${this.options.pluralSeparator}zero`]&&E.indexOf(`${this.options.pluralSeparator}zero`)<0&&E.push(`${this.options.pluralSeparator}zero`),E.forEach(O=>{p([m],i+O,s[`defaultValue${O}`]||V)})}):p(G,i,V))}g=this.extendTranslation(g,e,s,h,n),H&&g===i&&this.options.appendNamespaceToMissingKey&&(g=`${l}${u}${i}`),(H||z)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${i}`:i,z?g:void 0,s))}return a?(h.res=g,h.usedParams=this.getUsedParamsDetails(s),h):g}extendTranslation(e,t,n,s,a){var c,l;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const u=B(e)&&(((l=n==null?void 0:n.interpolation)==null?void 0:l.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(u){const h=e.match(this.interpolator.nestingRegexp);f=h&&h.length}let d=n.replace&&!B(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,n.lng||this.language||s.usedLng,n),u){const h=e.match(this.interpolator.nestingRegexp),g=h&&h.length;f<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 o=n.postProcess||this.options.postProcess,i=B(o)?[o]:o;return e!=null&&(i!=null&&i.length)&&n.applyPostProcessor!==!1&&(e=mr.handle(i,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,a,o,i;return B(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(n))return;const l=this.extractFromKey(c,t),u=l.key;s=u;let f=l.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const d=t.count!==void 0&&!B(t.count),h=d&&!t.ordinal&&t.count===0,g=t.context!==void 0&&(B(t.context)||typeof t.context=="number")&&t.context!=="",y=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);f.forEach(x=>{var w,R;this.isValidLookup(n)||(i=x,!Ht[`${y[0]}-${x}`]&&((w=this.utils)!=null&&w.hasLoadedNamespace)&&!((R=this.utils)!=null&&R.hasLoadedNamespace(i))&&(Ht[`${y[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${y.join(", ")}" won't get resolved as namespace "${i}" 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 P;if(this.isValidLookup(n))return;o=D;const b=[u];if((P=this.i18nFormat)!=null&&P.addLookupKeys)this.i18nFormat.addLookupKeys(b,u,D,x,t);else{let L;d&&(L=this.pluralResolver.getSuffix(D,t.count,t));const Y=`${this.options.pluralSeparator}zero`,V=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(b.push(u+L),t.ordinal&&L.indexOf(V)===0&&b.push(u+L.replace(V,this.options.pluralSeparator)),h&&b.push(u+Y)),g){const j=`${u}${this.options.contextSeparator}${t.context}`;b.push(j),d&&(b.push(j+L),t.ordinal&&L.indexOf(V)===0&&b.push(j+L.replace(V,this.options.pluralSeparator)),h&&b.push(j+Y))}}let v;for(;v=b.pop();)this.isValidLookup(n)||(a=v,n=this.getResource(D,x,v,t))}))})}),{res:n,usedKey:s,exactUsedKey:a,usedLng:o,usedNS:i}}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&&!B(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 Bt{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ge.create("languageUtils")}getScriptPartFromCode(e){if(e=Ae(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=Ae(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(B(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(o=>{if(o===a)return o;if(!(o.indexOf("-")<0&&a.indexOf("-")<0)&&(o.indexOf("-")>0&&a.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===a||o.indexOf(a)===0&&a.length>1))return o})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),B(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=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return B(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))):B(e)&&a(this.formatLanguageCode(e)),n.forEach(o=>{s.indexOf(o)<0&&a(this.formatLanguageCode(o))}),s}}const Kt={zero:0,one:1,two:2,few:3,many:4,other:5},zt={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Sn{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=Ae(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 o;try{o=new Intl.PluralRules(n,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),zt;if(!e.match(/-|_/))return zt;const c=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(c,t)}return this.pluralRulesCache[a]=o,o}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)=>Kt[s]-Kt[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 Gt=(r,e,t,n=".",s=!0)=>{let a=pn(r,e,t);return!a&&s&&B(t)&&(a=ct(r,t,n),a===void 0&&(a=ct(e,t,n))),a},at=r=>r.replace(/\$/g,"$$$$");class wn{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:o,suffix:i,suffixEscaped:c,formatSeparator:l,unescapeSuffix:u,unescapePrefix:f,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:g,nestingSuffixEscaped:y,nestingOptionsSeparator:x,maxReplaces:w,alwaysFormat:R}=e.interpolation;this.escape=t!==void 0?t:gn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?we(a):o||"{{",this.suffix=i?we(i):c||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?we(d):h||we("$t("),this.nestingSuffix=g?we(g):y||we(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=w||1e3,this.alwaysFormat=R!==void 0?R:!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,o,i;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=g=>{if(g.indexOf(this.formatSeparator)<0){const R=Gt(t,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(R,void 0,n,{...s,...t,interpolationkey:g}):R}const y=g.split(this.formatSeparator),x=y.shift().trim(),w=y.join(this.formatSeparator).trim();return this.format(Gt(t,c,x,this.options.keySeparator,this.options.ignoreJSONStructure),w,n,{...s,...t,interpolationkey:x})};this.resetRegExp();const u=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((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=>at(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?at(this.escape(g)):at(g)}].forEach(g=>{for(i=0;a=g.regex.exec(e);){const y=a[1].trim();if(o=l(y),o===void 0)if(typeof u=="function"){const w=u(e,a,s);o=B(w)?w:""}else if(s&&Object.prototype.hasOwnProperty.call(s,y))o="";else if(f){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),o="";else!B(o)&&!this.useRawValueToEscape&&(o=Ft(o));const x=g.safeValue(o);if(e=e.replace(a[0],x),f?(g.regex.lastIndex+=o.length,g.regex.lastIndex-=a[0].length):g.regex.lastIndex=0,i++,i>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,o;const i=(c,l)=>{const u=this.nestingOptionsSeparator;if(c.indexOf(u)<0)return c;const f=c.split(new RegExp(`${u}[ ]*{`));let d=`{${f[1]}`;c=f[0],d=this.interpolate(d,o);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{o=JSON.parse(d),l&&(o={...l,...o})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,y),`${c}${u}${d}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];o={...n},o=o.replace&&!B(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let l=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const u=s[1].split(this.formatSeparator).map(f=>f.trim());s[1]=u.shift(),c=u,l=!0}if(a=t(i.call(this,s[1].trim(),o),o),a&&s[0]===e&&!B(a))return a;B(a)||(a=Ft(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),l&&(a=c.reduce((u,f)=>this.format(u,f,n.lng,{...n,interpolationkey:s[1].trim()}),a.trim())),e=e.replace(s[0],a),this.regexp.lastIndex=0}return e}}const En=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(o=>{if(o){const[i,...c]=o.split(":"),l=c.join(":").trim().replace(/^'+|'+$/g,""),u=i.trim();t[u]||(t[u]=l),l==="false"&&(t[u]=!1),l==="true"&&(t[u]=!0),isNaN(l)||(t[u]=parseInt(l,10))}})}return{formatName:e,formatOptions:t}},Jt=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 o=n+JSON.stringify(a);let i=e[o];return i||(i=r(Ae(n),s),e[o]=i),i(t)}},Tn=r=>(e,t,n)=>r(Ae(t),n)(e);class On{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?Jt:Tn;this.formats={number:n((s,a)=>{const o=new Intl.NumberFormat(s,{...a});return i=>o.format(i)}),currency:n((s,a)=>{const o=new Intl.NumberFormat(s,{...a,style:"currency"});return i=>o.format(i)}),datetime:n((s,a)=>{const o=new Intl.DateTimeFormat(s,{...a});return i=>o.format(i)}),relativetime:n((s,a)=>{const o=new Intl.RelativeTimeFormat(s,{...a});return i=>o.format(i,a.range||"day")}),list:n((s,a)=>{const o=new Intl.ListFormat(s,{...a});return i=>o.format(i)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Jt(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(i=>i.indexOf(")")>-1)){const i=a.findIndex(c=>c.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,i)].join(this.formatSeparator)}return a.reduce((i,c)=>{var f;const{formatName:l,formatOptions:u}=En(c);if(this.formats[l]){let d=i;try{const h=((f=s==null?void 0:s.formatParams)==null?void 0:f[s.interpolationkey])||{},g=h.locale||h.lng||s.locale||s.lng||n;d=this.formats[l](i,g,{...u,...s,...h})}catch(h){this.logger.warn(h)}return d}else this.logger.warn(`there was no format function for ${l}`);return i},e)}}const Rn=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Dn extends Ge{constructor(e,t,n,s={}){var a,o;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=[],(o=(a=this.backend)==null?void 0:a.init)==null||o.call(a,n,s.backend,s)}queueLoad(e,t,n,s){const a={},o={},i={},c={};return e.forEach(l=>{let u=!0;t.forEach(f=>{const d=`${l}|${f}`;!n.reload&&this.store.hasResourceBundle(l,f)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?o[d]===void 0&&(o[d]=!0):(this.state[d]=1,u=!1,o[d]===void 0&&(o[d]=!0),a[d]===void 0&&(a[d]=!0),c[f]===void 0&&(c[f]=!0)))}),u||(i[l]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(c)}}loaded(e,t,n){const s=e.split("|"),a=s[0],o=s[1];t&&this.emit("failedLoading",a,o,t),!t&&n&&this.store.addResourceBundle(a,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const i={};this.queue.forEach(c=>{dn(c.loaded,[a],o),Rn(c,e),t&&c.errors.push(t),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(l=>{i[l]||(i[l]={});const u=c.loaded[l];u.length&&u.forEach(f=>{i[l][f]===void 0&&(i[l][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(c=>!c.done)}read(e,t,n,s=0,a=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:a,callback:o});return}this.readingCalls++;const i=(l,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(l&&u&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,a*2,o)},a);return}o(l,u)},c=this.backend[n].bind(this.backend);if(c.length===2){try{const l=c(e,t);l&&typeof l.then=="function"?l.then(u=>i(null,u)).catch(i):i(null,l)}catch(l){i(l)}return}return c(e,t,i)}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();B(e)&&(e=this.languageUtils.toResolveHierarchy(e)),B(t)&&(t=[t]);const a=this.queueLoad(e,t,n,s);if(!a.toLoad.length)return a.pending.length||s(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}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,(o,i)=>{o&&this.logger.warn(`${t}loading namespace ${a} for language ${s} failed`,o),!o&&i&&this.logger.log(`${t}loaded namespace ${a} for language ${s}`,i),this.loaded(e,o,i)})}saveMissing(e,t,n,s,a,o={},i=()=>{}){var c,l,u,f,d;if((l=(c=this.services)==null?void 0:c.utils)!=null&&l.hasLoadedNamespace&&!((f=(u=this.services)==null?void 0:u.utils)!=null&&f.hasLoadedNamespace(t))){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((d=this.backend)!=null&&d.create){const h={...o,isUpdate:a},g=this.backend.create.bind(this.backend);if(g.length<6)try{let y;g.length===5?y=g(e,t,n,s,h):y=g(e,t,n,s),y&&typeof y.then=="function"?y.then(x=>i(null,x)).catch(i):i(null,y)}catch(y){i(y)}else g(e,t,n,s,i,h)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const Xt=()=>({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]),B(r[1])&&(e.defaultValue=r[1]),B(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}),Zt=r=>{var e,t;return B(r.ns)&&(r.ns=[r.ns]),B(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),B(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},Fe=()=>{},Pn=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class je extends Ge{constructor(e={},t){if(super(),this.options=Zt(e),this.services={},this.logger=ge,this.modules={external:[]},Pn(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&&(B(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=Xt();this.options={...n,...this.options,...Zt(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=On;const u=new Bt(this.options);this.store=new Wt(this.options.resources,this.options);const f=this.services;f.logger=ge,f.resourceStore=this.store,f.languageUtils=u,f.pluralResolver=new Sn(u,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),l&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(f.formatter=s(l),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new wn(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Dn(s(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(d,...h)=>{this.emit(d,...h)}),this.modules.languageDetector&&(f.languageDetector=s(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=s(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new ze(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=Fe),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(l=>{this[l]=(...u)=>this.store[l](...u)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...u)=>(this.store[l](...u),this)});const i=Pe(),c=()=>{const l=(u,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(f),t(u,f)};if(this.languages&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),i}loadResources(e,t=Fe){var a,o;let n=t;const s=B(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 i=[],c=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(f=>{f!=="cimode"&&i.indexOf(f)<0&&i.push(f)})};s?c(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>c(u)),(o=(a=this.options.preload)==null?void 0:a.forEach)==null||o.call(a,l=>c(l)),this.services.backendConnector.load(i,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(l)})}else n(null)}reloadResources(e,t,n){const s=Pe();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=Fe),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"&&mr.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=Pe();this.emit("languageChanging",e);const s=i=>{this.language=i,this.languages=this.services.languageUtils.toResolveHierarchy(i),this.resolvedLanguage=void 0,this.setResolvedLanguage(i)},a=(i,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(i,(...l)=>this.t(...l))},o=i=>{var u,f;!e&&!i&&this.services.languageDetector&&(i=[]);const c=B(i)?i:i&&i[0],l=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(B(i)?[i]:i);l&&(this.language||s(l),this.translator.language||this.translator.changeLanguage(l),(f=(u=this.services.languageDetector)==null?void 0:u.cacheUserLanguage)==null||f.call(u,l)),this.loadResources(l,d=>{a(d,l)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),n}getFixedT(e,t,n){const s=(a,o,...i)=>{let c;typeof o!="object"?c=this.options.overloadTranslationOptionHandler([a,o].concat(i)):c={...o},c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||n||s.keyPrefix);const l=this.options.keySeparator||".";let u;return c.keyPrefix&&Array.isArray(a)?u=a.map(f=>`${c.keyPrefix}${l}${f}`):u=c.keyPrefix?`${c.keyPrefix}${l}${a}`:a,this.t(u,c)};return B(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 o=(i,c)=>{const l=this.services.backendConnector.state[`${i}|${c}`];return l===-1||l===0||l===2};if(t.precheck){const i=t.precheck(this,o);if(i!==void 0)return i}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,e)&&(!s||o(a,e)))}loadNamespaces(e,t){const n=Pe();return this.options.ns?(B(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=Pe();B(e)&&(e=[e]);const s=this.options.preload||[],a=e.filter(o=>s.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=s.concat(a),this.loadResources(o=>{n.resolve(),t&&t(o)}),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 Bt(Xt());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new je(e,t)}cloneInstance(e={},t=Fe){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new je(s);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(i=>{a[i]=this[i]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const i=Object.keys(this.store.data).reduce((c,l)=>(c[l]={...this.store.data[l]},c[l]=Object.keys(c[l]).reduce((u,f)=>(u[f]={...c[l][f]},u),c[l]),c),{});a.store=new Wt(i,s),a.services.resourceStore=a.store}return a.translator=new ze(a.services,s),a.translator.on("*",(i,...c)=>{a.emit(i,...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=je.createInstance();se.createInstance=je.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 $n={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"},An={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},jn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando"},Cn={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:$n,Month:An,Generic:jn},Ln={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"},kn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},In={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command"},Nn={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:Ln,Month:kn,Generic:In};function Qt(r,e){return new RegExp(_n(r),e)}function _n(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Mn(r,e,t,n){let s=e;const a=Fn(r,t);if(!s){const i=Math.abs(a);i-Math.floor(i)?s="0,0.00":s="0,0"}const o=Vn(s);return new Intl.NumberFormat(n,o).format(a)}function Fn(r,e,t,n,s){let a=r;if(typeof a!="number"){let i;e&&n===void 0?i=",":i=".";const c=i=="."?",":".";a=a.replace(Qt(c,"g"),""),a=a.replace(Qt(i,"g"),"."),a=Number(a)}const o=Number(a);return isNaN(o)?NaN:o}function Vn(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 Mn(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:Nn},it:{translation:Cn}}});const Yn=(r,e,t,n)=>se.format(r,e,t||se.language,n),Un=(r,e)=>se.t(r,e);function Je(){const r=C.useCallback((n,s,a,o)=>Yn(n,s,a||void 0,o),[]),e=C.useCallback(()=>se.languages[0],[]),t=C.useCallback((n,s)=>Un(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var gt=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r))(gt||{}),ie=(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))(ie||{}),le=(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))(le||{}),ut=(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))(ut||{});function Wn({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=Je(),o=()=>{if(!n)return;const I=new Date(n);return isNaN(I.getTime())?void 0:I},[i]=C.useState(new Date),[c,l]=C.useState(r||o()||new Date),[u,f]=C.useState(c?c.getMonth():new Date().getMonth()),[d,h]=C.useState(c?c.getFullYear():new Date().getFullYear()),[g,y]=C.useState(c?c.getDate():null),x=C.useRef(null),w=C.useRef([]),R=[a(le.JANUARY),a(le.FEBRUARY),a(le.MARCH),a(le.APRIL),a(le.MAY),a(le.JUNE),a(le.JULY),a(le.AUGUST),a(le.SEPTEMBER),a(le.OCTOBER),a(le.NOVEMBER),a(le.DECEMBER)],D=[{value:a(ie.SUNDAY_SHORT),full:a(ie.SUNDAY)},{value:a(ie.MONDAY_SHORT),full:a(ie.MONDAY)},{value:a(ie.TUESDAY_SHORT),full:a(ie.TUESDAY)},{value:a(ie.WEDNESDAY_SHORT),full:a(ie.WEDNESDAY)},{value:a(ie.THURSDAY_SHORT),full:a(ie.THURSDAY)},{value:a(ie.FRIDAY_SHORT),full:a(ie.FRIDAY)},{value:a(ie.SATURDAY_SHORT),full:a(ie.SATURDAY)}],b=I=>t.some(p=>{const m=p.start.getTime(),E=p.end.getTime(),O=I.getTime();return O>=m&&O<=E}),v=I=>{b(I)||(l(I),y(I.getDate()),e&&e(kr(I)))},P=()=>{u===0?(f(11),h(d-1)):f(u-1),y(1)},L=()=>{u===11?(f(0),h(d+1)):f(u+1),y(1)},Y=(I,p)=>new Date(I,p+1,0).getDate(),V=(I,p)=>new Date(I,p,1).getDay(),j=I=>{var m;const p=H.findIndex(E=>E!==null&&E.getDate()===I);p!==-1&&w.current[p]&&((m=w.current[p])==null||m.focus(),y(I))},_=(I,p)=>{const m=H[p];if(!m)return;const E=Y(d,u),O=m.getDate();switch(I.key){case"ArrowRight":I.preventDefault();{let T=O+1,$=new Date(d,u,T);if(T>E){const N=u===11?d+1:d,M=u===11?0:u+1;T=1,$=new Date(N,M,T),L(),setTimeout(()=>{U(1,"forward")},0);return}b($)?U(T,"forward"):j(T)}break;case"Tab":break;case"ArrowLeft":I.preventDefault();{let T=O-1,$=new Date(d,u,T);if(T<1){const N=u===0?d-1:d,M=u===0?11:u-1,k=Y(N,M);T=k,$=new Date(N,M,T),P(),setTimeout(()=>{U(k,"backward")},0);return}b($)?U(T,"backward"):j(T)}break;case"ArrowUp":I.preventDefault();{let T=O-7,$=new Date(d,u,T);if(T<1){const N=u===0?d-1:d,M=u===0?11:u-1;T=Y(N,M)+T,$=new Date(N,M,T),P(),setTimeout(()=>{U(T,"backward")},0);return}b($)?U(T,"backward"):j(T)}break;case"ArrowDown":I.preventDefault();{let T=O+7,$=new Date(d,u,T);if(T>E){const N=u===11?d+1:d,M=u===11?0:u+1;T=T-E,$=new Date(N,M,T),L(),setTimeout(()=>{U(T,"forward")},0);return}b($)?U(T,"forward"):j(T)}break;case"Home":I.preventDefault(),U(1,"forward");break;case"End":I.preventDefault(),U(E,"backward");break;case"PageUp":I.preventDefault(),P(),setTimeout(()=>{const T=Y(u===0?d-1:d,u===0?11:u-1),$=Math.min(O,T);U($,"forward")},0);break;case"PageDown":I.preventDefault(),L(),setTimeout(()=>{const T=Y(u===11?d+1:d,u===11?0:u+1),$=Math.min(O,T);U($,"forward")},0);break;case" ":case"Space":if(b(m))return;y(m.getDate()),l(m);break;case"Enter":I.preventDefault(),v(m);break}},U=(I,p)=>{const m=Y(d,u);if(p==="forward"){for(let E=I;E<=m;E++){const O=new Date(d,u,E);if(!b(O)){j(E);return}}L(),setTimeout(()=>{U(1,"forward")},0)}else{for(let $=I;$>=1;$--){const N=new Date(d,u,$);if(!b(N)){j($);return}}const E=u===0?d-1:d,O=u===0?11:u-1,T=Y(E,O);P(),setTimeout(()=>{U(T,"backward")},0)}},H=(()=>{const I=Y(d,u),p=V(d,u),m=[];for(let E=0;E<p;E++)m.push(null);for(let E=1;E<=I;E++){const O=new Date(d,u,E);m.push(O)}return m})(),re=[];let X=[];H.forEach((I,p)=>{if(X.push(I),X.length===7||p===H.length-1){for(;X.length<7;)X.push(null);re.push(X),X=[]}}),C.useEffect(()=>{var I;if(g!==null){const p=H.findIndex(m=>m!==null&&m.getDate()===g);p!==-1&&w.current[p]&&((I=w.current[p])==null||I.focus())}},[u,d,g,H]);const W={label:"smp-datepickercalendar-label",wrapper:"smp-datepickercalendar",calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(I,p,m,E)=>`smp-datepickercalendar-td
|
|
44
|
+
*/var Qe,Pt;function Gr(){if(Pt)return Qe;Pt=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 o={},i=0;i<10;i++)o["_"+String.fromCharCode(i)]=i;var c=Object.getOwnPropertyNames(o).map(function(f){return o[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 Qe=s()?Object.assign:function(a,o){for(var i,c=n(a),l,f=1;f<arguments.length;f++){i=Object(arguments[f]);for(var u in i)e.call(i,u)&&(c[u]=i[u]);if(r){l=r(i);for(var d=0;d<l.length;d++)t.call(i,l[d])&&(c[l[d]]=i[l[d]])}}return c},Qe}var et,$t;function pt(){if($t)return et;$t=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return et=r,et}var tt,At;function or(){return At||(At=1,tt=Function.call.bind(Object.prototype.hasOwnProperty)),tt}var rt,jt;function Jr(){if(jt)return rt;jt=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=pt(),t={},n=or();r=function(a){var o="Warning: "+a;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(a,o,i,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")+": "+i+" 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](o,f,c,i,null,e)}catch(g){u=g}if(u&&!(u instanceof Error)&&r((c||"React class")+": type specification of "+i+" `"+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 "+i+" type: "+u.message+(h??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},rt=s,rt}var nt,Ct;function Xr(){if(Ct)return nt;Ct=1;var r=ir(),e=Gr(),t=pt(),n=or(),s=Jr(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(i){var c="Warning: "+i;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function o(){return null}return nt=function(i,c){var l=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function u(p){var m=p&&(l&&p[l]||p[f]);if(typeof m=="function")return m}var d="<<anonymous>>",h={array:x("array"),bigint:x("bigint"),bool:x("boolean"),func:x("function"),number:x("number"),object:x("object"),string:x("string"),symbol:x("symbol"),any:O(),arrayOf:P,element:w(),elementType:v(),instanceOf:D,node:j(),objectOf:U,oneOf:L,oneOfType:M,shape:Y,exact:q};function g(p,m){return p===m?p!==0||1/p===1/m:p!==p&&m!==m}function y(p,m){this.message=p,this.data=m&&typeof m=="object"?m:{},this.stack=""}y.prototype=Error.prototype;function b(p){if(process.env.NODE_ENV!=="production")var m={},E=0;function R($,_,F,k,z,H,ne){if(k=k||d,H=H||F,ne!==t){if(c){var A=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 A.name="Invariant Violation",A}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var V=k+":"+F;!m[V]&&E<3&&(a("You are manually calling a React.PropTypes validation function for the `"+H+"` prop on `"+k+"`. 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."),m[V]=!0,E++)}}return _[F]==null?$?_[F]===null?new y("The "+z+" `"+H+"` is marked as required "+("in `"+k+"`, but its value is `null`.")):new y("The "+z+" `"+H+"` is marked as required in "+("`"+k+"`, but its value is `undefined`.")):null:p(_,F,k,z,H)}var T=R.bind(null,!1);return T.isRequired=R.bind(null,!0),T}function x(p){function m(E,R,T,$,_,F){var k=E[R],z=X(k);if(z!==p){var H=W(k);return new y("Invalid "+$+" `"+_+"` of type "+("`"+H+"` supplied to `"+T+"`, expected ")+("`"+p+"`."),{expectedType:p})}return null}return b(m)}function O(){return b(o)}function P(p){function m(E,R,T,$,_){if(typeof p!="function")return new y("Property `"+_+"` of component `"+T+"` has invalid PropType notation inside arrayOf.");var F=E[R];if(!Array.isArray(F)){var k=X(F);return new y("Invalid "+$+" `"+_+"` of type "+("`"+k+"` supplied to `"+T+"`, expected an array."))}for(var z=0;z<F.length;z++){var H=p(F,z,T,$,_+"["+z+"]",t);if(H instanceof Error)return H}return null}return b(m)}function w(){function p(m,E,R,T,$){var _=m[E];if(!i(_)){var F=X(_);return new y("Invalid "+T+" `"+$+"` of type "+("`"+F+"` supplied to `"+R+"`, expected a single ReactElement."))}return null}return b(p)}function v(){function p(m,E,R,T,$){var _=m[E];if(!r.isValidElementType(_)){var F=X(_);return new y("Invalid "+T+" `"+$+"` of type "+("`"+F+"` supplied to `"+R+"`, expected a single ReactElement type."))}return null}return b(p)}function D(p){function m(E,R,T,$,_){if(!(E[R]instanceof p)){var F=p.name||d,k=I(E[R]);return new y("Invalid "+$+" `"+_+"` of type "+("`"+k+"` supplied to `"+T+"`, expected ")+("instance of `"+F+"`."))}return null}return b(m)}function L(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.")),o;function m(E,R,T,$,_){for(var F=E[R],k=0;k<p.length;k++)if(g(F,p[k]))return null;var z=JSON.stringify(p,function(ne,A){var V=W(A);return V==="symbol"?String(A):A});return new y("Invalid "+$+" `"+_+"` of value `"+String(F)+"` "+("supplied to `"+T+"`, expected one of "+z+"."))}return b(m)}function U(p){function m(E,R,T,$,_){if(typeof p!="function")return new y("Property `"+_+"` of component `"+T+"` has invalid PropType notation inside objectOf.");var F=E[R],k=X(F);if(k!=="object")return new y("Invalid "+$+" `"+_+"` of type "+("`"+k+"` supplied to `"+T+"`, expected an object."));for(var z in F)if(n(F,z)){var H=p(F,z,T,$,_+"."+z,t);if(H instanceof Error)return H}return null}return b(m)}function M(p){if(!Array.isArray(p))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var m=0;m<p.length;m++){var E=p[m];if(typeof E!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+G(E)+" at index "+m+"."),o}function R(T,$,_,F,k){for(var z=[],H=0;H<p.length;H++){var ne=p[H],A=ne(T,$,_,F,k,t);if(A==null)return null;A.data&&n(A.data,"expectedType")&&z.push(A.data.expectedType)}var V=z.length>0?", expected one of type ["+z.join(", ")+"]":"";return new y("Invalid "+F+" `"+k+"` supplied to "+("`"+_+"`"+V+"."))}return b(R)}function j(){function p(m,E,R,T,$){return K(m[E])?null:new y("Invalid "+T+" `"+$+"` supplied to "+("`"+R+"`, expected a ReactNode."))}return b(p)}function N(p,m,E,R,T){return new y((p||"React class")+": "+m+" type `"+E+"."+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+T+"`.")}function Y(p){function m(E,R,T,$,_){var F=E[R],k=X(F);if(k!=="object")return new y("Invalid "+$+" `"+_+"` of type `"+k+"` "+("supplied to `"+T+"`, expected `object`."));for(var z in p){var H=p[z];if(typeof H!="function")return N(T,$,_,z,W(H));var ne=H(F,z,T,$,_+"."+z,t);if(ne)return ne}return null}return b(m)}function q(p){function m(E,R,T,$,_){var F=E[R],k=X(F);if(k!=="object")return new y("Invalid "+$+" `"+_+"` of type `"+k+"` "+("supplied to `"+T+"`, expected `object`."));var z=e({},E[R],p);for(var H in z){var ne=p[H];if(n(p,H)&&typeof ne!="function")return N(T,$,_,H,W(ne));if(!ne)return new y("Invalid "+$+" `"+_+"` key `"+H+"` supplied to `"+T+"`.\nBad object: "+JSON.stringify(E[R],null," ")+`
|
|
45
|
+
Valid keys: `+JSON.stringify(Object.keys(p),null," "));var A=ne(F,H,T,$,_+"."+H,t);if(A)return A}return null}return b(m)}function K(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(K);if(p===null||i(p))return!0;var m=u(p);if(m){var E=m.call(p),R;if(m!==p.entries){for(;!(R=E.next()).done;)if(!K(R.value))return!1}else for(;!(R=E.next()).done;){var T=R.value;if(T&&!K(T[1]))return!1}}else return!1;return!0;default:return!1}}function Z(p,m){return p==="symbol"?!0:m?m["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&m instanceof Symbol:!1}function X(p){var m=typeof p;return Array.isArray(p)?"array":p instanceof RegExp?"object":Z(m,p)?"symbol":m}function W(p){if(typeof p>"u"||p===null)return""+p;var m=X(p);if(m==="object"){if(p instanceof Date)return"date";if(p instanceof RegExp)return"regexp"}return m}function G(p){var m=W(p);switch(m){case"array":case"object":return"an "+m;case"boolean":case"date":case"regexp":return"a "+m;default:return m}}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},nt}var st,Lt;function Zr(){if(Lt)return st;Lt=1;var r=pt();function e(){}function t(){}return t.resetWarningCache=e,st=function(){function n(o,i,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},st}var kt;function Qr(){if(kt)return Ne.exports;if(kt=1,process.env.NODE_ENV!=="production"){var r=ir(),e=!0;Ne.exports=Xr()(r.isElement,e)}else Ne.exports=Zr()();return Ne.exports}var ae=Qr(),en=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},tn=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},rn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Me="http://www.w3.org/2000/svg",It="http://www.w3.org/1999/xlink",Te=function(r){function e(){for(var n,s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];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(i){n.reactWrapper=i},n}_r(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof en(this.reactWrapper).Node){var a=this.props,o=a.desc,i=a.evalScripts,c=a.httpRequestWithCredentials,l=a.renumerateIRIElements,f=a.src,u=a.title,d=a.useRequestCache,h=this.props.onError,g=this.props.beforeInjection,y=this.props.afterInjection,b=this.props.wrapper,x,O;b==="svg"?(x=document.createElementNS(Me,b),x.setAttribute("xmlns",Me),x.setAttribute("xmlns:xlink",It),O=document.createElementNS(Me,b)):(x=document.createElement(b),O=document.createElement(b)),x.appendChild(O),O.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(x);var P=function(L){if(s.removeSVG(),!s._isMounted){h(L);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){h(L)})},w=function(L,U){if(L){P(L);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{y(U)}catch(M){P(M)}})},v=function(L){if(L.setAttribute("role","img"),o){var U=L.querySelector(":scope > desc");U&&L.removeChild(U);var M=document.createElement("desc");M.innerHTML=o,L.prepend(M)}if(u){var j=L.querySelector(":scope > title");j&&L.removeChild(j);var N=document.createElement("title");N.innerHTML=u,L.prepend(N)}try{g(L)}catch(Y){P(Y)}};qr(O,{afterEach:w,beforeEach:v,cacheRequests:d,evalScripts:i,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;tn(Be({},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 o=s.loading;s.renumerateIRIElements,s.src,s.title,s.useRequestCache;var i=s.wrapper,c=Nr(s,rn),l=i;return Ce.createElement(l,Be({},c,{ref:this.refCallback},i==="svg"?{xmlns:Me,xmlnsXlink:It}:{}),this.state.isLoading&&o&&Ce.createElement(o,null),this.state.hasError&&a&&Ce.createElement(a,null))},e}(Ce.Component);Te.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Te.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 lt={assets:"/"};const nn=r=>{lt={...lt,...r}},Nt=r=>`${lt.assets}/${r}`.replace(/\/+/g,"/"),ue=C.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:o="base",rotated:i=!1,onClick:c,isInteractable:l=!1,spin:f=!1,title:u})=>{const[d,h]=C.useState(r),g=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),y=g&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),b=Nt(`assets/svg/${r}.svg`),x=Nt(`assets/svg/${n}.svg`),O={img:`${l?"smp-image-interactable":""}`,svg:`smp-icon ${o?`smp-icon-${o}`:""} ${i?"smp-icon-rotated":""} ${l?"smp-icon-interactable":""} ${f?"smp-icon-spin":""}`},P=()=>{!a&&c&&c()};return S.jsx(S.Fragment,{children:y?S.jsx(Te,{src:r,fallback:()=>S.jsx(Te,{src:x,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:O.svg,onClick:P}):g?S.jsx("img",{src:d,width:e||"16px",height:t||"auto",alt:u,onError:()=>h(x),onClick:P,className:O.img,title:u,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&P()}}):S.jsx(Te,{src:b,fallback:()=>S.jsx(Te,{src:x,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:O.svg,onClick:P})})}),xe=({disabled:r,readOnly:e,bindValue:t,icon:n,onBlur:s,onChange:a,placeholder:o,shapeIcon:i,sizing:c,state:l,variant:f,rotatedShapeIcon:u=!1,onShapeIconClick:d,ref:h,inputRef:g,onKeyDown:y,inputType:b="text",ariaLabel:x="input field",label:O,helperText:P=!1,error:w,appearance:v="base",fullWidth:D=!1,_dataComponent:L="textfield",width:U})=>{const M=w?"danger":l,j=w||l=="danger"?"error":i,N=P||!!w,Y=Z=>{a==null||a(Z.target.value)},q={wrapper:`smp-textfield-wrapper ${D?"smp-textfield-fullWidth":""}`,container:`smp-textfield ${r?"smp-textfield-disabled":""} ${e?"smp-textfield-readOnly":""} ${o?"smp-textfield-placeholder":""} ${c?`smp-textfield-${c}`:""} ${M?`smp-textfield-${M}`:""} ${f?`smp-textfield-variant-${f}`:""} ${v?`smp-textfield-${v}`:""}`,input:"smp-textfield-input "},K=U?{"--smp-textField-width-base":U}:void 0;return S.jsxs("div",{className:q.wrapper,"data-component":L,children:[O&&S.jsx(nr,{label:O,disabled:r}),S.jsxs("div",{className:q.container,ref:h,style:K,children:[n&&S.jsx(ue,{icon:n,disabled:r}),S.jsx("input",{type:b,value:t,placeholder:o,onChange:Y,onBlur:s,className:q.input,disabled:r,readOnly:e,onKeyDown:y,"aria-label":x,ref:g}),j&&S.jsx(ue,{icon:j,disabled:r,state:M,onClick:d,rotated:u})]}),N&&S.jsx(Ir,{helperText:w,disabled:r,state:M})]})};function sn({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=C.useState(0),o=C.useRef(null),i=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=C.useCallback(h=>{const g=h.target.scrollTop;a(g)},[]),d=h=>{if(!o.current)return;const g=h*e,y=g+e,b=o.current,x=b.scrollTop,O=x+t;g<x?b.scrollTop=g:y>O&&(b.scrollTop=y-t)};return{virtualItems:f,containerProps:{ref:o,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:u},innerProps:{style:{height:`${i}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:i,startIndex:c,endIndex:l},scrollToIndex:d}}const an=10,lr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:o=[],width:i,onClick:c,onKeyDown:l})=>{var j;const[f,u]=C.useState(""),d=24,[h,g]=C.useState(a!==null?a:-1),y=s!==void 0?s:e.length>an,b=f?e.filter(N=>N.label.toLowerCase().includes(f.toLowerCase())):e,x=N=>{u(N)},{virtualItems:O,containerProps:P,innerProps:w,scrollToIndex:v}=sn({items:b,itemHeight:d,containerHeight:200,overscan:5});C.useEffect(()=>{a!==null&&a!==h&&g(a)},[a]),C.useEffect(()=>{h>=0&&h<b.length&&v(h)},[h,b]);const D=N=>{if(N.key==="ArrowDown"||N.key==="ArrowUp"){N.preventDefault();let Y=h;N.key==="ArrowDown"?Y=h<b.length-1?h+1:0:N.key==="ArrowUp"&&(Y=h>0?h-1:b.length-1),g(Y)}else N.key==="Enter"?h>=0&&h<b.length&&(c==null||c(b[h])):N.key==="Escape"&&(N.preventDefault(),N.stopPropagation());l&&l(N)},L=N=>{D(N)},U=N=>{D(N)},M={wrapper:"smp-list",container:"smp-list-container",virtualScroll:"smp-list-virtualScroll",listItem:"smp-list-listItem"};return S.jsxs("div",{id:r,ref:n,className:M.wrapper,"data-component":"list",style:{width:i},children:[y&&S.jsx(xe,{bindValue:f,placeholder:"Search...",onChange:x,onKeyDown:L}),S.jsx("div",{...P,className:M.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:U,"aria-activedescendant":h>=0&&h<b.length?(j=b[h])==null?void 0:j.id:void 0,children:S.jsx("div",{...w,className:M.virtualScroll,children:O.map(({item:N,index:Y,offsetTop:q})=>{const K=o.includes(N.id);return S.jsxs("li",{role:"option",id:N.id,"aria-selected":h===Y?"true":"false",tabIndex:-1,className:`${M.listItem} ${h===Y?"selected-item":""}`,"aria-label":N.id+"-"+N.label,style:{height:`${d}px`,lineHeight:`calc(${d}px - 2*2px)`,transform:`translateY(${q}px)`},onClick:()=>{c==null||c(N),g(Y)},children:[He(N.id,N.label,t),K&&S.jsx(ue,{icon:"check",width:16})]},N.id)})})})]})},cr=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=C.useState(He(e,t,r));return C.useEffect(()=>{a(e)},[e]),C.useEffect(()=>{a(He(e,t,r))},[t,r]),S.jsx(xe,{...n,bindValue:s})},on=r=>{const e=C.useRef(null);return C.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}},ht=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,placeholder:o,fun:i,_changeOnEnter:c=!1,onChange:l,onOptionsRequest:f,_multiActiveIndex:u,...d})=>{const[h,g]=C.useState(r),[y,b]=C.useState(e),[x,O]=C.useState(!1),[P,w]=C.useState(t||[]),[v,D]=C.useState(0),[L,U]=C.useState([r]),{anchorRef:M,targetRef:j,anchorWidth:N}=dt({position:"bottom",enabled:x});We(j,()=>O(!1));const Y=on(400),q=W=>{W.length>=a?i&&f&&Y(async()=>{const G=await f(i,W);w(G),D(G.length>0?0:-1),O(!0)}):O(!1),g(W),b(e),c||l==null||l(W,e)},K=W=>{c?(g(""),b("")):(g(W.id),b(W.label)),l==null||l(W.id,W.label);const G=P.findIndex(I=>I.id===W.id);D(G),U([W.id]),O(!1)},Z=W=>{W.key==="Escape"&&(O(!1),D(-1))},X=W=>{if((W.key==="ArrowDown"||W.key==="ArrowUp")&&(W.preventDefault(),x)){const G=W.key==="ArrowDown"?(v+1)%P.length:(v-1+P.length)%P.length;D(G)}switch(W.key){case"Enter":v>=0&&v<P.length?K(P[v]):c&&(l==null||l(h,""),O(!1),g(""),b(""));break;case"Escape":O(!1),D(-1);break}};return S.jsxs("div",{"data-component":"autocomplete",children:[S.jsx(cr,{...d,bindValue:h,optionalDisplayValue:y,displayMode:n,shapeIcon:"magnify",placeholder:o,ref:M,onChange:q,onKeyDown:X,"aria-autocomplete":"list"}),x&&S.jsx(lr,{options:P,displayMode:s,onClick:K,ref:j,selectedIndex:v,activeIndex:u||L,width:N,showFilter:!1,onKeyDown:Z})]})},_t=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],Mt=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],Oe=({label:r,onClick:e,ariaLabel:t,icon:n,disabled:s,sizing:a="base",variant:o="primary",appearance:i="raised",showIcon:c=!0,showText:l=!0,fullWidth:f=!1,loading:u=!1,title:d,optionalDisplayValue:h})=>{const g={container:`smp-button smp-button-container ${a?`smp-button-${a}`:""} ${o?`smp-buttonVariant-${o}`:""} ${i?`smp-buttonType-${i}`:""} ${f?"smp-button-fullWidth":""}`};return S.jsx("button",{"data-component":"button",className:g.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":u,title:d||r||h,children:u?S.jsx(ue,{icon:"spinner",state:Mt(o),spin:!0}):S.jsxs(S.Fragment,{children:[n&&c&&S.jsx(ue,{icon:n,disabled:s,state:Mt(o),width:_t(a),height:_t(a)}),l&&h&&S.jsx("span",{children:h})]})})},ur=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:o,showText:i,showIcon:c,fullWidth:l,disabled:f,onClick:u,onOptionsRequest:d})=>{const[h,g]=C.useState(r);C.useEffect(()=>{!(h!=null&&h.length)&&d&&e&&d(e,void 0).then(x=>g(x)).catch(x=>{console.error("Errore nel caricamento delle opzioni per ButtonList",x)})},[h,e,d]);const y={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},b=h==null?void 0:h.map((x,O)=>{const P={bindValue:x.id,optionalDisplayValue:x.label,fun:x.fun,icon:x.icon,variant:a,appearance:o,showText:i,showIcon:c,fullWidth:l,disabled:f,sizing:s,onClick:()=>{u==null||u(x.id,x.fun)}};return S.jsx(Oe,{...P},`button-${O}`)});return S.jsx("div",{role:"list","data-component":"button-list",className:y.container,children:b})},fr=({bindValue:r,onChange:e,onBlur:t})=>{const n=s=>{e&&e(s.target.checked)};return S.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:n,onBlur:t})},ln={titleLarge:"h2",title:"h3",body:"h6",label:"label"},cn=({variant:r="body",bindValue:e,color:t,...n})=>{const s=ln[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return S.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},dr=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:o=!1})=>{const[i,c]=C.useState(null),l={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=h=>{n==null||n(r.filter((g,y)=>y!==h))},u=h=>{c(h)},d=h=>{if(i===null||i===h)return;const g=[...r],[y]=g.splice(i,1);g.splice(h,0,y),n==null||n(g),c(null)};return S.jsx("div",{className:l.container,role:"list","data-component":"chip",children:r.flatMap((h,g)=>{const y=He(h.bindValue,h.optionalDisplayValue,t),b=S.jsxs("div",{className:l.element,role:"listitem",draggable:o,onDragStart:()=>u(g),onDragOver:O=>o&&O.preventDefault(),onDrop:()=>o&&d(g),style:{"--smp-chips-backgroundColor-base":a},children:[o&&S.jsx(ue,{icon:"drag_indicator_horizontal",isInteractable:!0}),S.jsx(cn,{variant:"label",bindValue:y,color:s}),e&&S.jsx(ue,{icon:"close",isInteractable:!0,onClick:()=>f(g),color:s})]},`chip-${g}`),x=o&&g<r.length-1?S.jsx(ue,{icon:"chevron-right",color:s},`separator-${g}`):null;return[b,x].filter(Boolean)})})};function pr(r,e){const t=C.useRef(null);C.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 o=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())},i=l=>{if(n&&!n.contains(l.target)){l.preventDefault();const f=s();f.length>0&&f[0].focus()}};document.addEventListener("keydown",o),document.addEventListener("mousedown",i);const c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.removeEventListener("mousedown",i),document.body.style.overflow=c,t.current&&requestAnimationFrame(()=>{var l;(l=t.current)==null||l.focus()})}},[r,e])}const hr=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,displayMode:s,listDisplayMode:a="Both",fun:o,onOptionsRequest:i,multiActiveIndex:c,...l})=>{const[f,u]=C.useState(!1),[d,h]=C.useState(t),[g,y]=C.useState(-1),[b,x]=C.useState([r]),O=C.useId(),{anchorRef:P,targetRef:w,anchorWidth:v}=dt({position:"bottom",enabled:f});We(w,()=>u(!1)),pr(f,w);const D=j=>{e==null||e(j.id,j.label);const N=d.findIndex(Y=>Y.id===j.id);y(N),x([j.id]),u(!1)},L=j=>{j.key==="Escape"&&(u(!1),y(-1))},U=j=>{(j.key==="ArrowDown"||j.key==="ArrowUp")&&(j.preventDefault(),M())},M=()=>{o&&i&&i(o,void 0).then(j=>{h(j),y(j.length>0?0:-1),u(!0)})};return S.jsxs("div",{role:"combobox","aria-expanded":f,"aria-controls":O,"aria-owns":O,"data-component":"combobox",children:[S.jsx(cr,{...l,bindValue:r,optionalDisplayValue:n,displayMode:s,onShapeIconClick:M,onKeyDown:U,shapeIcon:"arrow_drop_down",rotatedShapeIcon:f,readOnly:!0,ref:P,"aria-autocomplete":"list",variant:"notSelectable"}),f&&S.jsx(lr,{id:O,options:d,displayMode:a,ref:w,selectedIndex:g,activeIndex:c||b,width:v,onClick:D,onKeyDown:L})]})},B=r=>typeof r=="string",Pe=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},Ft=r=>r==null?"":""+r,un=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},fn=/###/g,Vt=r=>r&&r.indexOf("###")>-1?r.replace(fn,"."):r,Yt=r=>!r||B(r),$e=(r,e,t)=>{const n=B(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(Yt(r))return{};const a=Vt(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return Yt(r)?{}:{obj:r,k:Vt(n[s])}},Ut=(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],o=e.slice(0,e.length-1),i=$e(r,o,Object);for(;i.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),i=$e(r,o,Object),i!=null&&i.obj&&typeof i.obj[`${i.k}.${a}`]<"u"&&(i.obj=void 0);i.obj[`${i.k}.${a}`]=t},dn=(r,e,t,n)=>{const{obj:s,k:a}=$e(r,e,Object);s[a]=s[a]||[],s[a].push(t)},qe=(r,e)=>{const{obj:t,k:n}=$e(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},pn=(r,e,t)=>{const n=qe(r,t);return n!==void 0?n:qe(e,t)},gr=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?B(r[n])||r[n]instanceof String||B(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):gr(r[n],e[n],t):r[n]=e[n]);return r},we=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var hn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const gn=r=>B(r)?r.replace(/[&<>"'\/]/g,e=>hn[e]):r;class mn{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 yn=[" ",",","?","!",";"],vn=new mn(20),bn=(r,e,t)=>{e=e||"",t=t||"";const n=yn.filter(o=>e.indexOf(o)<0&&t.indexOf(o)<0);if(n.length===0)return!0;const s=vn.getRegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!s.test(r);if(!a){const o=r.indexOf(t);o>0&&!s.test(r.substring(0,o))&&(a=!0)}return a},ct=(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 o,i="";for(let c=a;c<n.length;++c)if(c!==a&&(i+=t),i+=n[c],o=s[i],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&c<n.length-1)continue;a+=c-a+1;break}s=o}return s},Ae=r=>r==null?void 0:r.replace("_","-"),xn={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 Ke{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||xn,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:(B(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Ke(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Ke(this.logger,e)}}var ge=new Ke;class Ge{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 o=0;o<a;o++)s(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,a])=>{for(let o=0;o<a;o++)s.apply(s,[e,...t])})}}class Wt extends Ge{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,o=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let i;e.indexOf(".")>-1?i=e.split("."):(i=[e,t],n&&(Array.isArray(n)?i.push(...n):B(n)&&a?i.push(...n.split(a)):i.push(n)));const c=qe(this.data,i);return!c&&!t&&!n&&e.indexOf(".")>-1&&(e=i[0],t=i[1],n=i.slice(2).join(".")),c||!o||!B(n)?c:ct((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 o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let i=[e,t];n&&(i=i.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(i=e.split("."),s=t,t=i[1]),this.addNamespaces(t),Ut(this.data,i,s),a.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const a in n)(B(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,o={silent:!1,skipCopy:!1}){let i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),s=n,n=t,t=i[1]),this.addNamespaces(t);let c=qe(this.data,i)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?gr(c,n,a):c={...c,...n},Ut(this.data,i,c),o.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 mr={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,n,s){return r.forEach(a=>{var o;e=((o=this.processors[a])==null?void 0:o.process(e,t,n,s))??e}),e}};const Ht={},Bt=r=>!B(r)&&typeof r!="boolean"&&typeof r!="number";class ze extends Ge{constructor(e,t={}){super(),un(["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 o=n&&e.indexOf(n)>-1,i=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!bn(e,n,s);if(o&&!i){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:B(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:B(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,o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:i,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}${i}`,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:`${l}${f}${i}`:a?{res:i,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:i;const h=this.resolve(e,s);let g=h==null?void 0:h.res;const y=(h==null?void 0:h.usedKey)||i,b=(h==null?void 0:h.exactUsedKey)||i,x=["[object Number]","[object Function]","[object RegExp]"],O=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,P=!this.i18nFormat||this.i18nFormat.handleAsObject,w=s.count!==void 0&&!B(s.count),v=ze.hasDefaultValue(s),D=w?this.pluralResolver.getSuffix(u,s.count,s):"",L=s.ordinal&&w?this.pluralResolver.getSuffix(u,s.count,{ordinal:!1}):"",U=w&&!s.ordinal&&s.count===0,M=U&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${D}`]||s[`defaultValue${L}`]||s.defaultValue;let j=g;P&&!g&&v&&(j=M);const N=Bt(j),Y=Object.prototype.toString.apply(j);if(P&&j&&N&&x.indexOf(Y)<0&&!(B(O)&&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 q=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,j,{...s,ns:c}):`key '${i} (${this.language})' returned an object instead of string.`;return a?(h.res=q,h.usedParams=this.getUsedParamsDetails(s),h):q}if(o){const q=Array.isArray(j),K=q?[]:{},Z=q?b:y;for(const X in j)if(Object.prototype.hasOwnProperty.call(j,X)){const W=`${Z}${o}${X}`;v&&!g?K[X]=this.translate(W,{...s,defaultValue:Bt(M)?M[X]:void 0,joinArrays:!1,ns:c}):K[X]=this.translate(W,{...s,joinArrays:!1,ns:c}),K[X]===W&&(K[X]=j[X])}g=K}}else if(P&&B(O)&&Array.isArray(g))g=g.join(O),g&&(g=this.extendTranslation(g,e,s,n));else{let q=!1,K=!1;!this.isValidLookup(g)&&v&&(q=!0,g=M),this.isValidLookup(g)||(K=!0,g=i);const X=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&K?void 0:g,W=v&&M!==g&&this.options.updateMissing;if(K||q||W){if(this.logger.log(W?"updateKey":"missingKey",u,l,i,W?M:g),o){const m=this.resolve(i,{...s,keySeparator:!1});m&&m.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 G=[];const I=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&I&&I[0])for(let m=0;m<I.length;m++)G.push(I[m]);else this.options.saveMissingTo==="all"?G=this.languageUtils.toResolveHierarchy(s.lng||this.language):G.push(s.lng||this.language);const p=(m,E,R)=>{var $;const T=v&&R!==g?R:X;this.options.missingKeyHandler?this.options.missingKeyHandler(m,l,E,T,W,s):($=this.backendConnector)!=null&&$.saveMissing&&this.backendConnector.saveMissing(m,l,E,T,W,s),this.emit("missingKey",m,l,E,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?G.forEach(m=>{const E=this.pluralResolver.getSuffixes(m,s);U&&s[`defaultValue${this.options.pluralSeparator}zero`]&&E.indexOf(`${this.options.pluralSeparator}zero`)<0&&E.push(`${this.options.pluralSeparator}zero`),E.forEach(R=>{p([m],i+R,s[`defaultValue${R}`]||M)})}):p(G,i,M))}g=this.extendTranslation(g,e,s,h,n),K&&g===i&&this.options.appendNamespaceToMissingKey&&(g=`${l}${f}${i}`),(K||q)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${f}${i}`:i,q?g:void 0,s))}return a?(h.res=g,h.usedParams=this.getUsedParamsDetails(s),h):g}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=B(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&&!B(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;u<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 o=n.postProcess||this.options.postProcess,i=B(o)?[o]:o;return e!=null&&(i!=null&&i.length)&&n.applyPostProcessor!==!1&&(e=mr.handle(i,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,a,o,i;return B(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&&!B(t.count),h=d&&!t.ordinal&&t.count===0,g=t.context!==void 0&&(B(t.context)||typeof t.context=="number")&&t.context!=="",y=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(b=>{var x,O;this.isValidLookup(n)||(i=b,!Ht[`${y[0]}-${b}`]&&((x=this.utils)!=null&&x.hasLoadedNamespace)&&!((O=this.utils)!=null&&O.hasLoadedNamespace(i))&&(Ht[`${y[0]}-${b}`]=!0,this.logger.warn(`key "${s}" for languages "${y.join(", ")}" won't get resolved as namespace "${i}" 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(P=>{var D;if(this.isValidLookup(n))return;o=P;const w=[f];if((D=this.i18nFormat)!=null&&D.addLookupKeys)this.i18nFormat.addLookupKeys(w,f,P,b,t);else{let L;d&&(L=this.pluralResolver.getSuffix(P,t.count,t));const U=`${this.options.pluralSeparator}zero`,M=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(w.push(f+L),t.ordinal&&L.indexOf(M)===0&&w.push(f+L.replace(M,this.options.pluralSeparator)),h&&w.push(f+U)),g){const j=`${f}${this.options.contextSeparator}${t.context}`;w.push(j),d&&(w.push(j+L),t.ordinal&&L.indexOf(M)===0&&w.push(j+L.replace(M,this.options.pluralSeparator)),h&&w.push(j+U))}}let v;for(;v=w.pop();)this.isValidLookup(n)||(a=v,n=this.getResource(P,b,v,t))}))})}),{res:n,usedKey:s,exactUsedKey:a,usedLng:o,usedNS:i}}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&&!B(e.replace);let s=n?e.replace:e;if(n&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const a of t)delete s[a]}return s}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class qt{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ge.create("languageUtils")}getScriptPartFromCode(e){if(e=Ae(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=Ae(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(B(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(o=>{if(o===a)return o;if(!(o.indexOf("-")<0&&a.indexOf("-")<0)&&(o.indexOf("-")>0&&a.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===a||o.indexOf(a)===0&&a.length>1))return o})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),B(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=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return B(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))):B(e)&&a(this.formatLanguageCode(e)),n.forEach(o=>{s.indexOf(o)<0&&a(this.formatLanguageCode(o))}),s}}const Kt={zero:0,one:1,two:2,few:3,many:4,other:5},zt={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Sn{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=Ae(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 o;try{o=new Intl.PluralRules(n,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),zt;if(!e.match(/-|_/))return zt;const c=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(c,t)}return this.pluralRulesCache[a]=o,o}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)=>Kt[s]-Kt[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 Gt=(r,e,t,n=".",s=!0)=>{let a=pn(r,e,t);return!a&&s&&B(t)&&(a=ct(r,t,n),a===void 0&&(a=ct(e,t,n))),a},at=r=>r.replace(/\$/g,"$$$$");class wn{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:o,suffix:i,suffixEscaped:c,formatSeparator:l,unescapeSuffix:f,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:g,nestingSuffixEscaped:y,nestingOptionsSeparator:b,maxReplaces:x,alwaysFormat:O}=e.interpolation;this.escape=t!==void 0?t:gn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?we(a):o||"{{",this.suffix=i?we(i):c||"}}",this.formatSeparator=l||",",this.unescapePrefix=f?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?we(d):h||we("$t("),this.nestingSuffix=g?we(g):y||we(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=x||1e3,this.alwaysFormat=O!==void 0?O:!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,o,i;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=g=>{if(g.indexOf(this.formatSeparator)<0){const O=Gt(t,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(O,void 0,n,{...s,...t,interpolationkey:g}):O}const y=g.split(this.formatSeparator),b=y.shift().trim(),x=y.join(this.formatSeparator).trim();return this.format(Gt(t,c,b,this.options.keySeparator,this.options.ignoreJSONStructure),x,n,{...s,...t,interpolationkey:b})};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:g=>at(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?at(this.escape(g)):at(g)}].forEach(g=>{for(i=0;a=g.regex.exec(e);){const y=a[1].trim();if(o=l(y),o===void 0)if(typeof f=="function"){const x=f(e,a,s);o=B(x)?x:""}else if(s&&Object.prototype.hasOwnProperty.call(s,y))o="";else if(u){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),o="";else!B(o)&&!this.useRawValueToEscape&&(o=Ft(o));const b=g.safeValue(o);if(e=e.replace(a[0],b),u?(g.regex.lastIndex+=o.length,g.regex.lastIndex-=a[0].length):g.regex.lastIndex=0,i++,i>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,o;const i=(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,o);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{o=JSON.parse(d),l&&(o={...l,...o})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,y),`${c}${f}${d}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];o={...n},o=o.replace&&!B(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.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(i.call(this,s[1].trim(),o),o),a&&s[0]===e&&!B(a))return a;B(a)||(a=Ft(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 En=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(o=>{if(o){const[i,...c]=o.split(":"),l=c.join(":").trim().replace(/^'+|'+$/g,""),f=i.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}},Jt=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 o=n+JSON.stringify(a);let i=e[o];return i||(i=r(Ae(n),s),e[o]=i),i(t)}},Tn=r=>(e,t,n)=>r(Ae(t),n)(e);class On{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?Jt:Tn;this.formats={number:n((s,a)=>{const o=new Intl.NumberFormat(s,{...a});return i=>o.format(i)}),currency:n((s,a)=>{const o=new Intl.NumberFormat(s,{...a,style:"currency"});return i=>o.format(i)}),datetime:n((s,a)=>{const o=new Intl.DateTimeFormat(s,{...a});return i=>o.format(i)}),relativetime:n((s,a)=>{const o=new Intl.RelativeTimeFormat(s,{...a});return i=>o.format(i,a.range||"day")}),list:n((s,a)=>{const o=new Intl.ListFormat(s,{...a});return i=>o.format(i)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Jt(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(i=>i.indexOf(")")>-1)){const i=a.findIndex(c=>c.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,i)].join(this.formatSeparator)}return a.reduce((i,c)=>{var u;const{formatName:l,formatOptions:f}=En(c);if(this.formats[l]){let d=i;try{const h=((u=s==null?void 0:s.formatParams)==null?void 0:u[s.interpolationkey])||{},g=h.locale||h.lng||s.locale||s.lng||n;d=this.formats[l](i,g,{...f,...s,...h})}catch(h){this.logger.warn(h)}return d}else this.logger.warn(`there was no format function for ${l}`);return i},e)}}const Rn=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Dn extends Ge{constructor(e,t,n,s={}){var a,o;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=[],(o=(a=this.backend)==null?void 0:a.init)==null||o.call(a,n,s.backend,s)}queueLoad(e,t,n,s){const a={},o={},i={},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?o[d]===void 0&&(o[d]=!0):(this.state[d]=1,f=!1,o[d]===void 0&&(o[d]=!0),a[d]===void 0&&(a[d]=!0),c[u]===void 0&&(c[u]=!0)))}),f||(i[l]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(c)}}loaded(e,t,n){const s=e.split("|"),a=s[0],o=s[1];t&&this.emit("failedLoading",a,o,t),!t&&n&&this.store.addResourceBundle(a,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const i={};this.queue.forEach(c=>{dn(c.loaded,[a],o),Rn(c,e),t&&c.errors.push(t),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(l=>{i[l]||(i[l]={});const f=c.loaded[l];f.length&&f.forEach(u=>{i[l][u]===void 0&&(i[l][u]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(c=>!c.done)}read(e,t,n,s=0,a=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:a,callback:o});return}this.readingCalls++;const i=(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,o)},a);return}o(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=>i(null,f)).catch(i):i(null,l)}catch(l){i(l)}return}return c(e,t,i)}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();B(e)&&(e=this.languageUtils.toResolveHierarchy(e)),B(t)&&(t=[t]);const a=this.queueLoad(e,t,n,s);if(!a.toLoad.length)return a.pending.length||s(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}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,(o,i)=>{o&&this.logger.warn(`${t}loading namespace ${a} for language ${s} failed`,o),!o&&i&&this.logger.log(`${t}loaded namespace ${a} for language ${s}`,i),this.loaded(e,o,i)})}saveMissing(e,t,n,s,a,o={},i=()=>{}){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={...o,isUpdate:a},g=this.backend.create.bind(this.backend);if(g.length<6)try{let y;g.length===5?y=g(e,t,n,s,h):y=g(e,t,n,s),y&&typeof y.then=="function"?y.then(b=>i(null,b)).catch(i):i(null,y)}catch(y){i(y)}else g(e,t,n,s,i,h)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const Xt=()=>({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]),B(r[1])&&(e.defaultValue=r[1]),B(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}),Zt=r=>{var e,t;return B(r.ns)&&(r.ns=[r.ns]),B(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),B(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},Fe=()=>{},Pn=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class je extends Ge{constructor(e={},t){if(super(),this.options=Zt(e),this.services={},this.logger=ge,this.modules={external:[]},Pn(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&&(B(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=Xt();this.options={...n,...this.options,...Zt(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=On;const f=new qt(this.options);this.store=new Wt(this.options.resources,this.options);const u=this.services;u.logger=ge,u.resourceStore=this.store,u.languageUtils=f,u.pluralResolver=new Sn(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 wn(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Dn(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 ze(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=Fe),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 i=Pe(),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),i.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),i}loadResources(e,t=Fe){var a,o;let n=t;const s=B(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 i=[],c=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(u=>{u!=="cimode"&&i.indexOf(u)<0&&i.push(u)})};s?c(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>c(f)),(o=(a=this.options.preload)==null?void 0:a.forEach)==null||o.call(a,l=>c(l)),this.services.backendConnector.load(i,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(l)})}else n(null)}reloadResources(e,t,n){const s=Pe();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=Fe),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"&&mr.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=Pe();this.emit("languageChanging",e);const s=i=>{this.language=i,this.languages=this.services.languageUtils.toResolveHierarchy(i),this.resolvedLanguage=void 0,this.setResolvedLanguage(i)},a=(i,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(i,(...l)=>this.t(...l))},o=i=>{var f,u;!e&&!i&&this.services.languageDetector&&(i=[]);const c=B(i)?i:i&&i[0],l=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(B(i)?[i]:i);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?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),n}getFixedT(e,t,n){const s=(a,o,...i)=>{let c;typeof o!="object"?c=this.options.overloadTranslationOptionHandler([a,o].concat(i)):c={...o},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 B(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 o=(i,c)=>{const l=this.services.backendConnector.state[`${i}|${c}`];return l===-1||l===0||l===2};if(t.precheck){const i=t.precheck(this,o);if(i!==void 0)return i}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,e)&&(!s||o(a,e)))}loadNamespaces(e,t){const n=Pe();return this.options.ns?(B(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=Pe();B(e)&&(e=[e]);const s=this.options.preload||[],a=e.filter(o=>s.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=s.concat(a),this.loadResources(o=>{n.resolve(),t&&t(o)}),n):(t&&t(),Promise.resolve())}dir(e){var s,a;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new qt(Xt());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new je(e,t)}cloneInstance(e={},t=Fe){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new je(s);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(i=>{a[i]=this[i]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const i=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 Wt(i,s),a.services.resourceStore=a.store}return a.translator=new ze(a.services,s),a.translator.on("*",(i,...c)=>{a.emit(i,...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=je.createInstance();se.createInstance=je.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 $n={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"},An={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},jn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando"},Cn={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:$n,Month:An,Generic:jn},Ln={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"},kn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},In={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command"},Nn={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:Ln,Month:kn,Generic:In};function Qt(r,e){return new RegExp(_n(r),e)}function _n(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Mn(r,e,t,n){let s=e;const a=Fn(r,t);if(!s){const i=Math.abs(a);i-Math.floor(i)?s="0,0.00":s="0,0"}const o=Vn(s);return new Intl.NumberFormat(n,o).format(a)}function Fn(r,e,t,n,s){let a=r;if(typeof a!="number"){let i;e&&n===void 0?i=",":i=".";const c=i=="."?",":".";a=a.replace(Qt(c,"g"),""),a=a.replace(Qt(i,"g"),"."),a=Number(a)}const o=Number(a);return isNaN(o)?NaN:o}function Vn(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 Mn(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:Nn},it:{translation:Cn}}});const Yn=(r,e,t,n)=>se.format(r,e,t||se.language,n),Un=(r,e)=>se.t(r,e);function Je(){const r=C.useCallback((n,s,a,o)=>Yn(n,s,a||void 0,o),[]),e=C.useCallback(()=>se.languages[0],[]),t=C.useCallback((n,s)=>Un(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var gt=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r))(gt||{}),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||{}),le=(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))(le||{}),ut=(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))(ut||{});function Wn({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=Je(),o=()=>{if(!n)return;const I=new Date(n);return isNaN(I.getTime())?void 0:I},[i]=C.useState(new Date),[c,l]=C.useState(r||o()||new Date),[f,u]=C.useState(c?c.getMonth():new Date().getMonth()),[d,h]=C.useState(c?c.getFullYear():new Date().getFullYear()),[g,y]=C.useState(c?c.getDate():null),b=C.useRef(null),x=C.useRef([]),O=[a(le.JANUARY),a(le.FEBRUARY),a(le.MARCH),a(le.APRIL),a(le.MAY),a(le.JUNE),a(le.JULY),a(le.AUGUST),a(le.SEPTEMBER),a(le.OCTOBER),a(le.NOVEMBER),a(le.DECEMBER)],P=[{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)}],w=I=>t.some(p=>{const m=p.start.getTime(),E=p.end.getTime(),R=I.getTime();return R>=m&&R<=E}),v=I=>{w(I)||(l(I),y(I.getDate()),e&&e(kr(I)))},D=()=>{f===0?(u(11),h(d-1)):u(f-1),y(1)},L=()=>{f===11?(u(0),h(d+1)):u(f+1),y(1)},U=(I,p)=>new Date(I,p+1,0).getDate(),M=(I,p)=>new Date(I,p,1).getDay(),j=I=>{var m;const p=K.findIndex(E=>E!==null&&E.getDate()===I);p!==-1&&x.current[p]&&((m=x.current[p])==null||m.focus(),y(I))},N=(I,p)=>{const m=K[p];if(!m)return;const E=U(d,f),R=m.getDate();switch(I.key){case"ArrowRight":I.preventDefault();{let T=R+1,$=new Date(d,f,T);if(T>E){const _=f===11?d+1:d,F=f===11?0:f+1;T=1,$=new Date(_,F,T),L(),setTimeout(()=>{Y(1,"forward")},0);return}w($)?Y(T,"forward"):j(T)}break;case"Tab":break;case"ArrowLeft":I.preventDefault();{let T=R-1,$=new Date(d,f,T);if(T<1){const _=f===0?d-1:d,F=f===0?11:f-1,k=U(_,F);T=k,$=new Date(_,F,T),D(),setTimeout(()=>{Y(k,"backward")},0);return}w($)?Y(T,"backward"):j(T)}break;case"ArrowUp":I.preventDefault();{let T=R-7,$=new Date(d,f,T);if(T<1){const _=f===0?d-1:d,F=f===0?11:f-1;T=U(_,F)+T,$=new Date(_,F,T),D(),setTimeout(()=>{Y(T,"backward")},0);return}w($)?Y(T,"backward"):j(T)}break;case"ArrowDown":I.preventDefault();{let T=R+7,$=new Date(d,f,T);if(T>E){const _=f===11?d+1:d,F=f===11?0:f+1;T=T-E,$=new Date(_,F,T),L(),setTimeout(()=>{Y(T,"forward")},0);return}w($)?Y(T,"forward"):j(T)}break;case"Home":I.preventDefault(),Y(1,"forward");break;case"End":I.preventDefault(),Y(E,"backward");break;case"PageUp":I.preventDefault(),D(),setTimeout(()=>{const T=U(f===0?d-1:d,f===0?11:f-1),$=Math.min(R,T);Y($,"forward")},0);break;case"PageDown":I.preventDefault(),L(),setTimeout(()=>{const T=U(f===11?d+1:d,f===11?0:f+1),$=Math.min(R,T);Y($,"forward")},0);break;case" ":case"Space":if(w(m))return;y(m.getDate()),l(m);break;case"Enter":I.preventDefault(),v(m);break}},Y=(I,p)=>{const m=U(d,f);if(p==="forward"){for(let E=I;E<=m;E++){const R=new Date(d,f,E);if(!w(R)){j(E);return}}L(),setTimeout(()=>{Y(1,"forward")},0)}else{for(let $=I;$>=1;$--){const _=new Date(d,f,$);if(!w(_)){j($);return}}const E=f===0?d-1:d,R=f===0?11:f-1,T=U(E,R);D(),setTimeout(()=>{Y(T,"backward")},0)}},K=(()=>{const I=U(d,f),p=M(d,f),m=[];for(let E=0;E<p;E++)m.push(null);for(let E=1;E<=I;E++){const R=new Date(d,f,E);m.push(R)}return m})(),Z=[];let X=[];K.forEach((I,p)=>{if(X.push(I),X.length===7||p===K.length-1){for(;X.length<7;)X.push(null);Z.push(X),X=[]}}),C.useEffect(()=>{var I;if(g!==null){const p=K.findIndex(m=>m!==null&&m.getDate()===g);p!==-1&&x.current[p]&&((I=x.current[p])==null||I.focus())}},[f,d,g,K]);const W={label:"smp-datepickercalendar-label",wrapper:"smp-datepickercalendar",calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(I,p,m,E)=>`smp-datepickercalendar-td
|
|
46
46
|
${I?"smp-datepickercalendar-td-today":""}
|
|
47
47
|
${p?"smp-datepickercalendar-td-selected":""}
|
|
48
48
|
${m?"smp-datepickercalendar-td-focused":""}
|
|
49
|
-
${E?"smp-datepickercalendar-td-disabled":""}`},G=()=>`${R[u]} ${d.toString()}`;return S.jsxs("div",{className:W.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[S.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[S.jsx(Oe,{onClick:P,ariaLabel:a(ut.PREVIOUS_MONTH),bindValue:"<",appearance:"ghost",variant:"base"}),S.jsx("div",{"aria-label":G(),className:W.label,children:G()}),S.jsx(Oe,{onClick:L,ariaLabel:a(ut.NEXT_MONTH),bindValue:">",appearance:"ghost",variant:"base"})]}),S.jsxs("table",{ref:x,role:"grid","aria-label":`${a(gt.CALENDAR_FOR)} ${R[u]} ${d}`,className:W.table,children:[S.jsx("thead",{children:S.jsx("tr",{children:D.map(I=>S.jsx("th",{scope:"col",abbr:I.full,className:W.th,children:I.value},I.value))})}),S.jsx("tbody",{children:re.map((I,p)=>S.jsx("tr",{children:I.map((m,E)=>{const O=p*7+E;if(m===null)return S.jsx("td",{className:W.td(!1,!1,!1,!0)},`empty-${E}`);const T=m.getDate()===i.getDate()&&m.getMonth()===i.getMonth()&&m.getFullYear()===i.getFullYear(),$=c&&m.getDate()===c.getDate()&&m.getMonth()===c.getMonth()&&m.getFullYear()===c.getFullYear(),N=g===m.getDate(),M=b(m);return S.jsx("td",{role:"gridcell","aria-selected":$,tabIndex:N?0:-1,onClick:()=>v(m),onKeyDown:k=>_(k,O),"aria-label":`${m.getDate()} ${R[m.getMonth()]} ${m.getFullYear()}`,"data-selected":$,"aria-disabled":M,ref:k=>{w.current[O]=k},className:W.td(T,$,N,M),children:m.getDate()},`day-${E}`)})},`week-${p}`))})]})]})}const yr=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,...s})=>{const[a,o]=C.useState(!1),[i,c]=C.useState(r||""),[l,u]=C.useState(""),{anchorRef:f,targetRef:d}=dt({position:"bottom",enabled:a});We(d,()=>{o(!1)}),We(f,()=>{if(typeof f=="object"&&f!==null&&"current"in f){const P=f.current.querySelector("input");P&&P===document.activeElement&&w()}}),pr(a,d);const{format:h,getCurrentLanguage:g}=Je(),y=C.useCallback(P=>{const L=P.length>5&&jr(P,g())||P,Y=h(L,void 0,void 0,{type:"date"}),V=typeof L!="string",j=V&&L.toISOString().substring(0,10)||"";return{isValid:V,formattedDate:Y,isoDate:j,normalizedDate:L}},[g,h]);C.useEffect(()=>{const{formattedDate:P,isoDate:L,isValid:Y}=y(r);c(Y&&L||r),u(Y&&P||r)},[r,h,y]);const x=()=>o(P=>!P),w=()=>{D(l)},R=P=>{D(P),o(!1)},D=P=>{const{isoDate:L,isValid:Y}=y(P);t&&t(Y&&L||P)},b=P=>{u(P)},v=P=>{P.key==="Enter"&&(P.preventDefault(),D(l))};return S.jsxs("div",{"data-component":"date-picker",children:[S.jsx(xe,{bindValue:l,placeholder:e,onBlur:w,onChange:b,onKeyDown:v,shapeIcon:"calendar",onShapeIconClick:x,ref:f,...s}),a&&S.jsx(Wn,{disabledDateRanges:n,onDateChange:R,initialValue:ft(i)&&i||"",targetRef:d})]})},Hn=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,placeholder:s,fun:a,onOptionsRequest:o,onChange:i})=>{const c=r.map(f=>f.bindValue),l=(f,d)=>{const h=[...r];if(f=="")h.pop();else{const g=h.findIndex(y=>y.bindValue===f&&y.optionalDisplayValue===d);g>=0?h.splice(g,1):h.push({bindValue:f,optionalDisplayValue:d})}i==null||i(h)},u={container:"smp-multipleAutocomplete-container"};return S.jsxs("div",{className:u.container,"data-component":"multiple-autocomplete",children:[S.jsx(dr,{elements:r,displayMode:e,isEditable:!0,onChange:f=>{i==null||i(f)}}),S.jsx(ht,{bindValue:"",fun:a,onChange:l,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:s,onOptionsRequest:o,_multiActiveIndex:c})]})},vr=({...r})=>{const[e,t]=C.useState(!1),n=e?"visibility-off":"visibility";return S.jsx(xe,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},qn=({...r})=>{const[e,t]=C.useState(r.bindValue),{translate:n}=Je(),s=a=>{var o;a.key==="Enter"&&(a.preventDefault(),(o=r.onEnter)==null||o.call(r,e))};return S.jsx(xe,{...r,placeholder:r.placeholder?r.placeholder:n(gt.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})};class be{constructor(e,t){ve(this,"class");ve(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new be(e,e.k.split(";"))}static fromString(e){return new be({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const Ve=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t||r.decode,shape:r.shape,fun:r.fun}),er=r=>{const e=be.fromDataObj(r.obj),t=r.decode?be.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},Bn=(r,e)=>{const t=new be(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new be(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return Ve(r,t,n)},br=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:o,label:i,options:c,onChange:l,onClick:u,onEnter:f,onBlur:d,onOptionsRequest:h,isEditable:g})=>{const y={obj:t,shape:e,decode:r,icon:s},x={onBlur:d,onOptionsRequest:h,fun:a,icon:s,label:i,isEditable:g,...n},w=(b,v,P)=>$r(t)?Ve(b,new Ue(t,v).getLegacyValue()):Ve(b,v,P),R=b=>Ve(y,new Ye(t,b).getLegacyValue()),D=b=>Bn(y,b);switch(e){case oe.AUTOCOMPLETE:{const b={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(v,P)=>{l==null||l(w(y,v,P))}};return S.jsx(ht,{...b})}case oe.BUTTON:{const b={...x,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{u==null||u(w(y,t.k))}};return S.jsx(Oe,{...b})}case oe.BUTTON_LIST:{const b={...x,options:c,onClick:(v,P)=>{const L={...y,fun:P};u==null||u(w(L,v))}};return S.jsx(ur,{...b})}case oe.COMBOBOX:{const b={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(v,P)=>{l==null||l(w(y,v,P))}};return S.jsx(hr,{...b})}case oe.CHECKBOX:{const b={...x,bindValue:Ye.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:v=>{l==null||l(R(v))}};return S.jsx(fr,{...b})}case oe.CHIP:{const b={...x,elements:er(y)};return S.jsx(dr,{...b})}case oe.DATE:{const b={...x,bindValue:Ue.fromDataObj(t).getValue(),onChange:v=>{l==null||l(w(y,v))}};return S.jsx(yr,{...b})}case oe.ICON:case oe.IMAGE:{const b={...x,icon:s,placeholderIcon:o,isInteractable:!!x.fun,onClick:()=>{u==null||u(w(y,t.k))}};return S.jsx(ue,{...b})}case oe.MULTI_AUTOCOMPLETE:{const b={...x,elements:er(y),onChange:v=>{l==null||l(D(v))}};return S.jsx(Hn,{...b})}case oe.PASSWORD:{const b={...x,bindValue:t.k,onChange:v=>{l==null||l(w(y,v))}};return S.jsx(vr,{...b})}case oe.SPOTLIGHT:{const b={...x,bindValue:t.k,onEnter:v=>{f==null||f(w(y,v))}};return S.jsx(qn,{...b})}case oe.TEXT_FIELD:case void 0:{const b={...x,bindValue:t.k,onChange:v=>{l==null||l(w(y,v))}};return S.jsx(xe,{...b})}}},Kn=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},xr=(r,e)=>r.map(t=>{var a,o;if((a=t.sections)!=null&&a.length)return{...t,sections:xr(t.sections,e),content:t.content};let n=t.sections,s=t.content;return(o=t.content)!=null&&o.length&&t.columns&&+t.columns>1&&(n=Kn(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}}),tr=(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}},rr=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"},Sr=({layout:r,cells:e})=>{var f;if(!((f=r.sections)!=null&&f.length))return S.jsx(S.Fragment,{});const t="--smp-grid-template-cols",n="--smp-grid-template-rows",s=xr(r.sections,e),a=d=>d==null?void 0:d.reduce((h,g)=>{var D,b;let y="",x={},w={},R="";return(D=g.sections)!=null&&D.length?(y=de["smp-layout-section-grid"],x=a(g.sections),g.gridCols==null&&(R=`${de[g.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"]}`,(g.horizontal||rr(g.sections))&&(w=tr(g.sections,g.horizontal?t:n)))):(b=g.content)!=null&&b.length&&(g.gridCols!==void 0&&g.gridCols>0?(y=de["smp-layout-section-grid"],R=`${de["smp-grid-template-cols"]}`,w={[t]:`repeat(${g.gridCols}, 1fr)`}):y=de["smp-layout-section-flex"]),{...h,...x,[g.id]:{classes:`${y} ${de[g.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${R} ${g.hdsp?`smp-justifyContent-${g.hdsp}`:""} ${g.vdsp?`smp-alignItems-${g.vdsp}`:""}`,styles:w}}},{}),o=a(s),i={container:`${de["smp-layout"]} ${r.horizontal?de["smp-layout-horizontal"]:de["smp-layout-vertical"]}`,sections:o},c=r.horizontal||rr(r.sections)?tr(s,r.horizontal?t:n):{},l=d=>{var g;const h=S.jsx("div",{"smp-id":"section-"+d.id,className:i.sections[d.id].classes,style:i.sections[d.id].styles,children:(g=d.sections)!=null&&g.length?d.sections.map(y=>l(y)):d.content.map(y=>u(y,e[y.id],d.hdsp,d.vdsp))},"section-"+d.id);return d.title?S.jsxs("div",{className:`${de["smp-layout-section-with-title"]}`,children:[S.jsx("span",{className:`${de["smp-layout-section-title"]} ${d.hdsp?`smp-justifyContent-${d.hdsp}`:""} ${d.vdsp?`smp-alignItems-${d.vdsp}`:""}`,children:S.jsx(nr,{label:d.title})}),h]}):h},u=(d,h,g,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,R=d.colEnd!==void 0&&d.colEnd>0?d.colEnd:"",D={gridColumnStart:w,gridColumnEnd:R},b=`${de["smp-layout-cell-container"]} ${g?`smp-justifyContent-${g}`:""} ${y?`smp-alignItems-${y}`:""}`;return h?S.jsx("div",{className:b,style:{...D},"smp-id":d.id,children:S.jsx(br,{...h})},d.id):S.jsx(S.Fragment,{})};return S.jsx("div",{className:i.container,style:c,"smp-id":"layout",children:s==null?void 0:s.map(d=>l(d))})},zn=({data:r,onClick:e,onEnter:t})=>{var o,i;const[n,s]=C.useState(),a=C.useCallback(c=>{var u,f;if(!((u=c.rows)!=null&&u.length)||!((f=c.columns)!=null&&f.length))return{};const l=c.rows[0];return c.columns.filter(d=>d.visible).reduce((d,h)=>{const g=l.cells[h.name],y={...g,onChange:x=>{s(w=>w&&{...w,[h.name]:{...w[h.name],obj:{...w[h.name].obj,k:x.obj.k}}})},onClick:()=>{g.fun&&e&&e({...g})},onEnter:x=>{t&&t(x)}};return{...d,[h.name]:y}},{})},[e,t]);return C.useEffect(()=>{s(a(r))},[r,a]),!((o=r==null?void 0:r.rows)!=null&&o.length)||!((i=r.columns)!=null&&i.length)?null:n&&S.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:S.jsx(Sr,{layout:r.rows[0].layout,cells:n})})},ce=r=>r==null?!1:typeof r=="string"?r.toLocaleLowerCase()=="yes":r,Gn=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:o,Horizontal:i,ForceIcon:c,IconColName:l,IconColor:u="var(--smp-dashList-color-base)",NumberFormat:f,ForceUM:d,UmColName:h,UmColor:g="var(--smp-dashList-color-base)",ForceValue:y,ValueColName:x,ValueColor:w="var(--smp-dashList-color-base)",SelectLayout:R="1",onClick:D})=>{const b="N/A",v=(e==null?void 0:e.columns)||[],P=(e==null?void 0:e.rows)||[],L=P.length>0,Y="--smp-dashList-color",V="smp-layout",j="descr",_="icon",U="um",z="value",H=o||"1em",re="18px",X="--smp-dashList-columns",W="--smp-dashList-fontSize",G={dash:(F="1")=>{const J=p(F),ee=J,te=m(J,j),fe=m(J,_),me=m(J,U),pe=m(J,z);return{container:ee,descr:te,icon:fe,um:me,value:pe}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
|
|
50
|
-
${ce(i)?"smp-dash-list-horizontal":""}`},{format:I}=Je(),p=
|
|
49
|
+
${E?"smp-datepickercalendar-td-disabled":""}`},G=()=>`${O[f]} ${d.toString()}`;return S.jsxs("div",{className:W.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[S.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[S.jsx(Oe,{onClick:D,ariaLabel:a(ut.PREVIOUS_MONTH),bindValue:"<",appearance:"ghost",variant:"base"}),S.jsx("div",{"aria-label":G(),className:W.label,children:G()}),S.jsx(Oe,{onClick:L,ariaLabel:a(ut.NEXT_MONTH),bindValue:">",appearance:"ghost",variant:"base"})]}),S.jsxs("table",{ref:b,role:"grid","aria-label":`${a(gt.CALENDAR_FOR)} ${O[f]} ${d}`,className:W.table,children:[S.jsx("thead",{children:S.jsx("tr",{children:P.map(I=>S.jsx("th",{scope:"col",abbr:I.full,className:W.th,children:I.value},I.value))})}),S.jsx("tbody",{children:Z.map((I,p)=>S.jsx("tr",{children:I.map((m,E)=>{const R=p*7+E;if(m===null)return S.jsx("td",{className:W.td(!1,!1,!1,!0)},`empty-${E}`);const T=m.getDate()===i.getDate()&&m.getMonth()===i.getMonth()&&m.getFullYear()===i.getFullYear(),$=c&&m.getDate()===c.getDate()&&m.getMonth()===c.getMonth()&&m.getFullYear()===c.getFullYear(),_=g===m.getDate(),F=w(m);return S.jsx("td",{role:"gridcell","aria-selected":$,tabIndex:_?0:-1,onClick:()=>v(m),onKeyDown:k=>N(k,R),"aria-label":`${m.getDate()} ${O[m.getMonth()]} ${m.getFullYear()}`,"data-selected":$,"aria-disabled":F,ref:k=>{x.current[R]=k},className:W.td(T,$,_,F),children:m.getDate()},`day-${E}`)})},`week-${p}`))})]})]})}const yr=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,...s})=>{const[a,o]=C.useState(!1),[i,c]=C.useState(r||""),[l,f]=C.useState(""),{anchorRef:u,targetRef:d}=dt({position:"bottom",enabled:a});We(d,()=>{o(!1)}),We(u,()=>{if(typeof u=="object"&&u!==null&&"current"in u){const D=u.current.querySelector("input");D&&D===document.activeElement&&x()}}),pr(a,d);const{format:h,getCurrentLanguage:g}=Je(),y=C.useCallback(D=>{const L=D.length>5&&jr(D,g())||D,U=h(L,void 0,void 0,{type:"date"}),M=typeof L!="string",j=M&&L.toISOString().substring(0,10)||"";return{isValid:M,formattedDate:U,isoDate:j,normalizedDate:L}},[g,h]);C.useEffect(()=>{const{formattedDate:D,isoDate:L,isValid:U}=y(r);c(U&&L||r),f(U&&D||r)},[r,h,y]);const b=()=>o(D=>!D),x=()=>{P(l)},O=D=>{P(D),o(!1)},P=D=>{const{isoDate:L,isValid:U}=y(D);t&&t(U&&L||D)},w=D=>{f(D)},v=D=>{D.key==="Enter"&&(D.preventDefault(),P(l))};return S.jsxs("div",{"data-component":"date-picker",children:[S.jsx(xe,{bindValue:l,placeholder:e,onBlur:x,onChange:w,onKeyDown:v,shapeIcon:"calendar",onShapeIconClick:b,ref:u,...s}),a&&S.jsx(Wn,{disabledDateRanges:n,onDateChange:O,initialValue:ft(i)&&i||"",targetRef:d})]})},Hn=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,placeholder:s,fun:a,onOptionsRequest:o,onChange:i})=>{const c=r.map(u=>u.bindValue),l=(u,d)=>{const h=[...r];if(u=="")h.pop();else{const g=h.findIndex(y=>y.bindValue===u&&y.optionalDisplayValue===d);g>=0?h.splice(g,1):h.push({bindValue:u,optionalDisplayValue:d})}i==null||i(h)},f={container:"smp-multipleAutocomplete-container"};return S.jsxs("div",{className:f.container,"data-component":"multiple-autocomplete",children:[S.jsx(dr,{elements:r,displayMode:e,isEditable:!0,onChange:u=>{i==null||i(u)}}),S.jsx(ht,{bindValue:"",fun:a,onChange:l,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:s,onOptionsRequest:o,_multiActiveIndex:c})]})},vr=({...r})=>{const[e,t]=C.useState(!1),n=e?"visibility-off":"visibility";return S.jsx(xe,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},Bn=({...r})=>{const[e,t]=C.useState(r.bindValue),{translate:n}=Je(),s=a=>{var o;a.key==="Enter"&&(a.preventDefault(),(o=r.onEnter)==null||o.call(r,e))};return S.jsx(xe,{...r,placeholder:r.placeholder?r.placeholder:n(gt.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})};class be{constructor(e,t){ve(this,"class");ve(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new be(e,e.k.split(";"))}static fromString(e){return new be({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const Ve=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),er=r=>{const e=be.fromDataObj(r.obj),t=r.decode?be.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},qn=(r,e)=>{const t=new be(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new be(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return Ve(r,t,n)},br=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:o,label:i,options:c,onChange:l,onClick:f,onEnter:u,onBlur:d,onOptionsRequest:h,isEditable:g})=>{const y={obj:t,shape:e,decode:r,icon:s,fun:a},b={onBlur:d,onOptionsRequest:h,fun:a,icon:s,label:i,isEditable:g,...n},x=(w,v,D)=>$r(t)?Ve(w,new Ue(t,v).getLegacyValue()):Ve(w,v,D),O=w=>Ve(y,new Ye(t,w).getLegacyValue()),P=w=>qn(y,w);switch(e){case ie.AUTOCOMPLETE:{const w={...b,bindValue:t.k,optionalDisplayValue:r,onChange:(v,D)=>{l==null||l(x(y,v,D))}};return S.jsx(ht,{...w})}case ie.BUTTON:{const w={...b,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{f==null||f(x(y,t.k))}};return S.jsx(Oe,{...w})}case ie.BUTTON_LIST:{const w={...b,options:c,onClick:(v,D)=>{const L={...y,fun:D};f==null||f(x(L,v))}};return S.jsx(ur,{...w})}case ie.COMBOBOX:{const w={...b,bindValue:t.k,optionalDisplayValue:r,onChange:(v,D)=>{l==null||l(x(y,v,D))}};return S.jsx(hr,{...w})}case ie.CHECKBOX:{const w={...b,bindValue:Ye.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:v=>{l==null||l(O(v))}};return S.jsx(fr,{...w})}case ie.CHIP:{const w={...b,elements:er(y)};return S.jsx(dr,{...w})}case ie.DATE:{const w={...b,bindValue:Ue.fromDataObj(t).getValue(),onChange:v=>{l==null||l(x(y,v))}};return S.jsx(yr,{...w})}case ie.ICON:case ie.IMAGE:{const w={...b,icon:s,placeholderIcon:o,isInteractable:!!b.fun,onClick:()=>{f==null||f(x(y,t.k))}};return S.jsx(ue,{...w})}case ie.MULTI_AUTOCOMPLETE:{const w={...b,elements:er(y),onChange:v=>{l==null||l(P(v))}};return S.jsx(Hn,{...w})}case ie.PASSWORD:{const w={...b,bindValue:t.k,onChange:v=>{l==null||l(x(y,v))}};return S.jsx(vr,{...w})}case ie.SPOTLIGHT:{const w={...b,bindValue:t.k,onEnter:v=>{u==null||u(x(y,v))}};return S.jsx(Bn,{...w})}case ie.TEXT_FIELD:case void 0:{const w={...b,bindValue:t.k,onChange:v=>{l==null||l(x(y,v))}};return S.jsx(xe,{...w})}}},Kn=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},xr=(r,e)=>r.map(t=>{var a,o;if((a=t.sections)!=null&&a.length)return{...t,sections:xr(t.sections,e),content:t.content};let n=t.sections,s=t.content;return(o=t.content)!=null&&o.length&&t.columns&&+t.columns>1&&(n=Kn(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}}),tr=(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}},rr=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"},Sr=({layout:r,cells:e})=>{var u;if(!((u=r.sections)!=null&&u.length))return S.jsx(S.Fragment,{});const t="--smp-grid-template-cols",n="--smp-grid-template-rows",s=xr(r.sections,e),a=d=>d==null?void 0:d.reduce((h,g)=>{var P,w;let y="",b={},x={},O="";return(P=g.sections)!=null&&P.length?(y=de["smp-layout-section-grid"],b=a(g.sections),g.gridCols==null&&(O=`${de[g.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"]}`,(g.horizontal||rr(g.sections))&&(x=tr(g.sections,g.horizontal?t:n)))):(w=g.content)!=null&&w.length&&(g.gridCols!==void 0&&g.gridCols>0?(y=de["smp-layout-section-grid"],O=`${de["smp-grid-template-cols"]}`,x={[t]:`repeat(${g.gridCols}, 1fr)`}):y=de["smp-layout-section-flex"]),{...h,...b,[g.id]:{classes:`${y} ${de[g.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${O} ${g.justify?`smp-justifyContent-${g.justify}`:""} ${g.align?`smp-alignItems-${g.align}`:""}`,styles:x}}},{}),o=a(s),i={container:`${de["smp-layout"]} ${r.horizontal?de["smp-layout-horizontal"]:de["smp-layout-vertical"]}`,sections:o},c=r.horizontal||rr(r.sections)?tr(s,r.horizontal?t:n):{},l=d=>{var g;const h=S.jsx("div",{"smp-id":"section-"+d.id,className:i.sections[d.id].classes,style:i.sections[d.id].styles,children:(g=d.sections)!=null&&g.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?S.jsxs("div",{className:`${de["smp-layout-section-with-title"]}`,children:[S.jsx("span",{className:`${de["smp-layout-section-title"]} ${d.justify?`smp-justifyContent-${d.justify}`:""} ${d.align?`smp-alignItems-${d.align}`:""}`,children:S.jsx(nr,{label:d.title})}),h]}):h},f=(d,h,g,y)=>{const b=d.colSpan!==void 0?d.colSpan>0?d.colSpan:d.colStart!==void 0&&d.colStart<1?1:null:null,x=b!==null?`span ${b}`:d.colStart,O=d.colEnd!==void 0&&d.colEnd>0?d.colEnd:"",P={gridColumnStart:x,gridColumnEnd:O},w=`${de["smp-layout-cell-container"]} ${g?`smp-justifyContent-${g}`:""} ${y?`smp-alignItems-${y}`:""}`;return h?S.jsx("div",{className:w,style:{...P},"smp-id":d.id,children:S.jsx(br,{...h})},d.id):S.jsx(S.Fragment,{})};return S.jsx("div",{className:i.container,style:c,"smp-id":"layout",children:s==null?void 0:s.map(d=>l(d))})},zn=({data:r,onClick:e,onEnter:t})=>{var o,i;const[n,s]=C.useState(),a=C.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 g=l.cells[h.name],y={...g,onChange:b=>{s(x=>x&&{...x,[h.name]:{...x[h.name],obj:{...x[h.name].obj,k:b.obj.k}}})},onClick:()=>{g.fun&&e&&e({...g})},onEnter:b=>{t&&t(b)}};return{...d,[h.name]:y}},{})},[e,t]);return C.useEffect(()=>{s(a(r))},[r,a]),!((o=r==null?void 0:r.rows)!=null&&o.length)||!((i=r.columns)!=null&&i.length)?null:n&&S.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:S.jsx(Sr,{layout:r.rows[0].layout,cells:n})})},ce=r=>r==null?!1:typeof r=="string"?r.toLocaleLowerCase()=="yes":r,Gn=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:o,Horizontal:i,ForceIcon:c,IconColName:l,IconColor:f="var(--smp-dashList-color-base)",NumberFormat:u,ForceUM:d,UmColName:h,UmColor:g="var(--smp-dashList-color-base)",ForceValue:y,ValueColName:b,ValueColor:x="var(--smp-dashList-color-base)",SelectLayout:O="1",onClick:P})=>{const w="N/A",v=(e==null?void 0:e.columns)||[],D=(e==null?void 0:e.rows)||[],L=D.length>0,U="--smp-dashList-color",M="smp-layout",j="descr",N="icon",Y="um",q="value",K=o||"1em",Z="18px",X="--smp-dashList-columns",W="--smp-dashList-fontSize",G={dash:(V="1")=>{const J=p(V),te=J,re=m(J,j),fe=m(J,N),me=m(J,Y),pe=m(J,q);return{container:te,descr:re,icon:fe,um:me,value:pe}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
|
|
50
|
+
${ce(i)?"smp-dash-list-horizontal":""}`},{format:I}=Je(),p=V=>`${M}-${V}`,m=(V,J)=>`${V}__${J}`,E=V=>`${U}-${V}`,R=V=>{const J=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(J.test(V)){const re=V.match(J)||[];if((re==null?void 0:re.length)>3)return"rgb("+re[1]+","+re[2]+","+re[3]+")"}return V},T=V=>{if(!u)return V;const[J,te]=$(u).map(Se=>parseInt(Se||"0")),re="0,0"+(te?"."+"0".repeat(te):""),fe=I(V,re,"it");if(!J)return fe;const[me,pe]=fe.split(",");return me+(pe?`,${pe}`:"")},$=V=>V.includes(";")?V.split(";"):[V],_=V=>{const J=re=>{var fe;if(re)return(fe=V==null?void 0:V.cells[re])==null?void 0:fe.obj.k},te=re=>{var fe,me;if(!(v.length<=re))return(me=(fe=V==null?void 0:V.cells[v[re].name])==null?void 0:fe.obj)==null?void 0:me.k};return{descr:t||J(n)||te(2)||"",icon:c||J(l)||te(3)||"",um:d||J(h)||te(1)||"",value:y||J(b)||te(0)||""}},F=V=>{P==null||P(V)},k=(V,J)=>{(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),V.stopPropagation(),F(J))},H=(V=>{const J=G.dash(V);return{className:J,descr:te=>S.jsx("div",{className:J.descr,children:te},`${V}-${j}`),icon:te=>S.jsx("div",{className:J.icon,children:S.jsx(ue,{color:f,height:Z,icon:te,width:Z})},`${V}-${N}`),um:te=>S.jsx("div",{className:J.um,children:te},`${V}-${Y}`),value:te=>S.jsx("div",{className:J.value,children:te},`${V}-${q}`)}})(O),ne=V=>{const{descr:J,icon:te,um:re,value:fe}=_(V),me={[E(j)]:R(s),[E(Y)]:R(g),[E(q)]:R(x)},pe=[],Se=T(fe);switch(O){case"2":te&&pe.push(H.icon(te)),pe.push(H.descr(J)),pe.push(H.value(re?Se+" "+re:Se));break;default:case"1":pe.push(H.descr(J)),pe.push(H.value(re?Se+" "+re:Se))}return S.jsx("div",{className:H.className.container,role:"button",style:me,tabIndex:0,onClick:()=>F(V),onKeyDown:wr=>k(wr,V),children:pe},V.rowId)},A={[X]:String(r),[W]:K};return S.jsx("div",{className:G.dashList,style:A,children:L?D.map(V=>ne(V)):w})},Jn=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}}):[]},Xn=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:o,onClose:i,loadOptions:c})=>{var P,w;const[l,f]=C.useState(),[u,d]=C.useState(t??!0),h=C.useRef(null),g=s.trim()?s:"100vh",y=C.useCallback(v=>{var L,U;if(!((L=v.rows)!=null&&L.length)||!((U=v.columns)!=null&&U.length))return{};const D=v.rows[0];return v.columns.filter(M=>M.visible??!0).reduce((M,j)=>{const N=D.cells[j.name];if(!N||!u&&ce(n)&&N.shape!==ie.BUTTON&&N.shape!==ie.BUTTON_LIST)return M;const Y={...N,onChange:q=>{f(K=>{const Z={...K};return Z!=null&&Z[j.name]&&(Z[j.name].obj.k=q.obj.k),Z})},onClick:q=>{q.fun&&a&&a(q)},onEnter:q=>{o&&o(q)}};return c&&N.shape==ie.BUTTON_LIST&&(Y.onOptionsRequest=(q,K)=>c(q,K).then(Z=>Jn(Z))),!u&&ce(n)&&(Y.data={...Y.data,showText:!1}),{...M,[j.name]:Y}},{})},[u,n,a,o,c]),b=C.useCallback(()=>{i==null||i()},[i]),x=()=>{ce(n)?d(v=>!v):(d(!1),i==null||i())};if(C.useEffect(()=>{f(y(r))},[r]),C.useEffect(()=>{if(!h.current)return;if(!ce(n)){f(y(r));return}const v=getComputedStyle(h.current).getPropertyValue("--smp-drawer-slide-transition");let D=Number(v);v.endsWith("ms")?D=parseFloat(v):v.endsWith("s")&&(D=parseFloat(v)*1e3),setTimeout(()=>{f(y(r))},D/2)},[u,n]),C.useEffect(()=>{t!==void 0&&!ce(n)&&d(t)},[n,t]),!((P=r==null?void 0:r.rows)!=null&&P.length)||!((w=r.columns)!=null&&w.length))return null;const O={drawer:`smp-drawer ${ce(n)?"smp-drawer-minified":"smp-drawer-fixed"} ${u?"smp-drawer-open":""}`,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&&S.jsxs(S.Fragment,{children:[!ce(n)&&S.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:O.backdrop,onClick:b}),S.jsx("aside",{ref:h,className:O.drawer,style:{height:g},"aria-label":"Drawer","smp-id":"drawer",children:S.jsxs("div",{className:O.container,children:[S.jsxs("div",{className:O.containerHeader,children:[e&&S.jsx("div",{className:O.containerLogo,children:S.jsx(ue,{icon:e,title:"drawer_logo",width:"100%",height:24})}),S.jsx("div",{className:O.containerIcon,children:S.jsx(ue,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!u,isInteractable:!0,onClick:x,width:20,height:20})})]}),S.jsx("div",{className:O.containerLayout,children:S.jsx(Sr,{layout:r.rows[0].layout,cells:l})})]})})]})},Zn=({data:r,Type:e,ShowSubmit:t=!1,SubmitPosition:n="Right",DefaultValue:s,Label:a,LabelPosition:o="Left",onBlur:i,onClick:c,onOptionsRequest:l})=>{const[f,u]=C.useState();C.useEffect(()=>{u(()=>{const y={...r};return e&&(y.shape=e),s&&(y.obj=Ar(s)),y})},[r,s,e]);const h={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},g=()=>{ce(t)||i==null||i(f)};if(f)return S.jsxs("div",{className:h.container,children:[S.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:S.jsx(br,{...f,onChange:u,onOptionsRequest:l,fun:r.fun,onBlur:g,label:a,labelPosition:o})}),ce(t)&&S.jsx(Oe,{bindValue:"Confirm",onClick:()=>c==null?void 0:c(f)})]})};exports.AppBar=zn;exports.Autocomplete=ht;exports.Button=Oe;exports.ButtonList=ur;exports.Checkbox=fr;exports.Combobox=hr;exports.DashList=Gn;exports.DatePicker=yr;exports.Drawer=Xn;exports.Field=Zn;exports.Icon=ue;exports.Password=vr;exports.Textfield=xe;exports.configurePaths=nn;
|