@sme.up/ketchup2 2.0.0-SNAPSHOT-20250624071954 → 2.0.0-SNAPSHOT-20250624105358
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/basic-components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/basic-components/cell/cell-types.d.ts +6 -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/combobox/combobox.d.ts.map +1 -1
- package/dist/basic-components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/basic-components/input-number/input-number-types.d.ts +9 -0
- package/dist/basic-components/input-number/input-number-types.d.ts.map +1 -0
- package/dist/basic-components/input-number/input-number.d.ts +4 -0
- package/dist/basic-components/input-number/input-number.d.ts.map +1 -0
- package/dist/basic-components/list/list-types.d.ts +1 -0
- package/dist/basic-components/list/list-types.d.ts.map +1 -1
- package/dist/basic-components/list/list.d.ts.map +1 -1
- package/dist/basic-components/radio/radio.d.ts.map +1 -1
- package/dist/basic-components/textfield/textfield-types.d.ts +4 -0
- package/dist/basic-components/textfield/textfield-types.d.ts.map +1 -1
- package/dist/basic-components/textfield/textfield.d.ts.map +1 -1
- package/dist/basic-components/time-picker/time-picker-clock/time-picker-clock.d.ts +3 -2
- package/dist/basic-components/time-picker/time-picker-clock/time-picker-clock.d.ts.map +1 -1
- package/dist/basic-components/time-picker/time-picker-utils.d.ts +4 -3
- package/dist/basic-components/time-picker/time-picker-utils.d.ts.map +1 -1
- package/dist/basic-components/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/input-panel/assets/data.d.ts.map +1 -1
- package/dist/components/input-panel/input-panel-types.d.ts +15 -0
- package/dist/components/input-panel/input-panel-types.d.ts.map +1 -1
- package/dist/components/input-panel/input-panel.d.ts.map +1 -1
- package/dist/ketchup2.cjs.js +13 -13
- package/dist/ketchup2.css +1 -1
- package/dist/ketchup2.es.js +2176 -1952
- package/dist/types/data-structures.d.ts +1 -1
- package/dist/types/global.d.ts +1 -1
- package/dist/types/global.d.ts.map +1 -1
- package/dist/utils/number.d.ts +51 -0
- package/dist/utils/number.d.ts.map +1 -1
- package/dist/utils/wrapper-types/number.d.ts +2 -2
- package/dist/utils/wrapper-types/time/time-utils.d.ts +10 -0
- package/dist/utils/wrapper-types/time/time-utils.d.ts.map +1 -0
- package/dist/utils/wrapper-types/{time.d.ts → time/time.d.ts} +2 -2
- package/dist/utils/wrapper-types/time/time.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/utils/wrapper-types/time.d.ts.map +0 -1
package/dist/ketchup2.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Mr=Object.defineProperty;var Fr=(r,e,t)=>e in r?Mr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var de=(r,e,t)=>Fr(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),Vr=require("react-dom");function Yr(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const Ye=Yr(T);var Ue={exports:{}},Pe={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Pt;function Ur(){if(Pt)return Pe;Pt=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var o in s)o!=="key"&&(a[o]=s[o])}else a=s;return s=a.ref,{$$typeof:r,type:n,key:i,ref:s!==void 0?s:null,props:a}}return Pe.Fragment=e,Pe.jsx=t,Pe.jsxs=t,Pe}var ke={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,37 +14,37 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var kt;function Wr(){return kt||(kt=1,process.env.NODE_ENV!=="production"&&function(){function r(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===I?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case v:return"Fragment";case S:return"Profiler";case b:return"StrictMode";case g:return"Suspense";case E:return"SuspenseList";case P:return"Activity"}if(typeof p=="object")switch(typeof p.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),p.$$typeof){case h:return"Portal";case D:return(p.displayName||"Context")+".Provider";case w:return(p._context.displayName||"Context")+".Consumer";case O:var x=p.render;return p=p.displayName,p||(p=x.displayName||x.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case $:return x=p.displayName||null,x!==null?x:r(p.type)||"Memo";case C:x=p._payload,p=p._init;try{return r(p(x))}catch{}}return null}function e(p){return""+p}function t(p){try{e(p);var x=!1}catch{x=!0}if(x){x=console;var j=x.error,A=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return j.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",A),e(p)}}function n(p){if(p===v)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===C)return"<...>";try{var x=r(p);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function s(){var p=B.A;return p===null?null:p.getOwner()}function a(){return Error("react-stack-top-frame")}function i(p){if(k.call(p,"key")){var x=Object.getOwnPropertyDescriptor(p,"key").get;if(x&&x.isReactWarning)return!1}return p.key!==void 0}function o(p,x){function j(){H||(H=!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)",x))}j.isReactWarning=!0,Object.defineProperty(p,"key",{get:j,configurable:!0})}function c(){var p=r(this.type);return G[p]||(G[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,x,j,A,_,L,Y,U){return j=L.ref,p={$$typeof:m,type:p,key:x,props:L,_owner:_},(j!==void 0?j: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:Y}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function f(p,x,j,A,_,L,Y,U){var V=x.children;if(V!==void 0)if(A)if(R(V)){for(A=0;A<V.length;A++)u(V[A]);Object.freeze&&Object.freeze(V)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(V);if(k.call(x,"key")){V=r(p);var J=Object.keys(x).filter(function(se){return se!=="key"});A=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",M[V+A]||(J=0<J.length?"{"+J.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,P,M,J,M),N[M+P]=!0)}if(M=null,O!==void 0&&(t(O),M=""+O),i(x)&&(t(x.key),M=""+x.key),"key"in x){O={};for(var H in x)H!=="key"&&(O[H]=x[H])}else O=x;return M&&o(O,typeof h=="function"?h.displayName||h.name||"Unknown":h),l(h,M,A,j,s(),O,V,Y)}function u(h){typeof h=="object"&&h!==null&&h.$$typeof===p&&h._store&&(h._store.validated=1)}var d=R,p=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),T=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),_=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,W=Array.isArray,q=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(h){return h()}};var Z,K={},z=d["react-stack-bottom-frame"].bind(d,a)(),B=q(n(a)),N={};$e.Fragment=g,$e.jsx=function(h,x,O,P,j){var A=1e4>_.recentlyCreatedOwnerStacks++;return f(h,x,O,!1,P,j,A?Error("react-stack-top-frame"):z,A?q(n(h)):B)},$e.jsxs=function(h,x,O,P,j){var A=1e4>_.recentlyCreatedOwnerStacks++;return f(h,x,O,!0,P,j,A?Error("react-stack-top-frame"):z,A?q(n(h)):B)}}()),$e}var Pt;function Wr(){return Pt||(Pt=1,process.env.NODE_ENV==="production"?Ue.exports=Yr():Ue.exports=Ur()),Ue.exports}var y=Wr();const De=({label:r,disabled:e,htmlFor:t})=>{const n={container:`smp-label ${e?"smp-label-disabled":""}`};return y.jsx("label",{className:n.container,htmlFor:t,children:r})},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"},Br=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},br=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:br(t.sections,e),content:t.content};let n=t.sections,s=t.content;return(i=t.content)!=null&&i.length&&t.columns&&+t.columns>1&&(n=Br(t.content.filter(c=>e.includes(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}}),At=(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}},kt=r=>r.some(e=>e.dim&&!e.dim.endsWith("%")),Tt=({children:r,layout:e={horizontal:!1,sections:[{id:"1",content:Array.isArray(r)?r.map(t=>({id:t.props.id})):[{id:r.props.id}]}]}})=>{const t={};R.Children.forEach(r,d=>{R.isValidElement(d)&&(t[d.props.id]=d)});const n="--smp-grid-template-cols",s="--smp-grid-template-rows",a=br(e.sections??[],Object.keys(t)),i=d=>d.reduce((p,m)=>{var T,S;let g="",b={},E={},w="";return(T=m.sections)!=null&&T.length?(g=de["smp-layout-section-grid"],b=i(m.sections),m.gridCols===void 0&&(w=de[m.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"],(m.horizontal||kt(m.sections))&&(E=At(m.sections,m.horizontal?n:s)))):(S=m.content)!=null&&S.length&&(m.gridCols!==void 0&&m.gridCols>0?(g=de["smp-layout-section-grid"],w=de["smp-grid-template-cols"],E={[n]:`repeat(${m.gridCols}, 1fr)`}):g=de["smp-layout-section-flex"]),{...p,...b,[m.id]:{classes:`${g} ${de[m.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${w} ${m.justify?`smp-justifyContent-${m.justify}`:""} ${m.align?`smp-alignItems-${m.align}`:""}`,styles:E}}},{}),o=i(a),c=`${de["smp-layout"]} ${e.horizontal?de["smp-layout-horizontal"]:de["smp-layout-vertical"]}`,l=e.horizontal||kt(e.sections||[])?At(a,e.horizontal?n:s):{},f=d=>{var m,g;const p=y.jsx("div",{"smp-id":`section-${d.id}`,className:o[d.id].classes,style:o[d.id].styles,children:(m=d.sections)!=null&&m.length?d.sections.map(b=>f(b)):(g=d.content)==null?void 0:g.map(b=>u(b,d.justify,d.align))},`section-${d.id}`);return d.title?y.jsxs("div",{className:de["smp-layout-section-with-title"],children:[y.jsx("span",{className:`${de["smp-layout-section-title"]} ${d.justify?`smp-justifyContent-${d.justify}`:""} ${d.align?`smp-alignItems-${d.align}`:""}`,children:y.jsx(De,{label:d.title})}),p]},`title-section-${d.id}`):p},u=(d,p,m)=>{const g=t[d.id];if(!g)return null;const E={gridColumnStart:(d.colSpan&&d.colSpan>0?`span ${d.colSpan}`:d.colStart&&d.colStart<1?"1":void 0)??d.colStart,gridColumnEnd:d.colEnd&&d.colEnd>0?d.colEnd:void 0},w=`${de["smp-layout-cell-container"]} ${p?`smp-justifyContent-${p}`:""} ${m?`smp-alignItems-${m}`:""}`;return y.jsx("div",{className:w,style:E,"smp-id":d.id,children:g},d.id)};return y.jsx("div",{className:c,style:l,"smp-id":"layout",children:a.map(d=>f(d))})},ne={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",ICON:"ICO",IMAGE:"IMG",MEMO:"MEM",MULTI_AUTOCOMPLETE:"AML",RADIO:"RAD",SPOTLIGHT:"SPL",SWITCH:"SWT",TEXT_FIELD:"ITX",TIME:"TIM",PASSWORD:"PWD"},Hr=r=>r.t=="D8",Gr=r=>r.t=="I1",qr=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 Qe{constructor(e,t){ye(this,"class");ye(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Qe(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 Kr(r,e){if(Ot(r)){const f=new Date(r);if(!isNaN(f.getTime()))return f}const t=new Date,n=r.replaceAll("/","").replaceAll("-","");let s="DDMMYYYY";e==="en"&&(s="MMDDYYYY");const a=s.indexOf("DD"),i=s.indexOf("MM");let o=0,c=0,l="";switch(n.length){case 1:case 2:return o=parseInt(n),t.setDate(o),We(t)?t:r;case 3:case 4:return o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),i===0?(t.setMonth(o-1),t.setDate(c)):a===0&&(t.setMonth(c-1),t.setDate(o)),We(t)?t:r;case 5:case 6:{o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),Number(n.substring(4))>50?l="19"+n.substring(4):l="20"+n.substring(4);let f=0,u=0;return i===0?(f=c,u=o-1,t.setFullYear(parseInt(l),u,f)):a===0&&(f=o,u=c-1,t.setFullYear(parseInt(l),u,f)),bt(o,u,parseInt(l))&&We(t)?t:r}case 7:case 8:{o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),l=n.substring(4);let f=0,u=0;return i===0?(f=c,u=o-1,t.setFullYear(parseInt(l),u,f)):a===0&&(f=o,u=c-1,t.setFullYear(parseInt(l),u,f)),bt(f,u,parseInt(l))&&We(t)?t:r}}return r}function Ot(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function We(r){return r instanceof Date&&!isNaN(r.getTime())}function zr(r){if(!/^\d{8}$/.test(r))return!1;const e=parseInt(r.slice(0,4),10),t=parseInt(r.slice(4,6),10),n=parseInt(r.slice(6,8),10);return bt(n,t-1,e)}function bt(r,e,t){const n=[31,Jr(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Jr(r){return r%4===0&&(r%100!==0||r%400===0)}function Xr(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 et{constructor(e,t){ye(this,"class");ye(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=Lt.get(`${e.t}${e.p}`);if(t)return new et(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=Lt.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 Lt=new Map([["D8*YYMD",{legacyToIso(r){return zr(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return Ot(r)&&r.replaceAll("-","")||r}}]]),ke=(r,e)=>{R.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 it({position:r="bottom",enabled:e=!0}){const t=R.useRef(null),n=R.useRef(null),[s,a]=R.useState(0),i=R.useCallback(()=>{const o=t.current,c=n.current;if(!o||!c)return;const{top:l,left:f,width:u,height:d}=o.getBoundingClientRect();a(u);const p=c.offsetHeight,m=c.offsetWidth;if(m===0||p===0){requestAnimationFrame(i);return}let g=l+window.scrollY,b=f+window.scrollX;switch(r){case"top":g-=p;break;case"bottom":g+=d;break;case"left":b-=m;break;case"right":b+=u;break}requestAnimationFrame(()=>{c.style.transform=`translate(${b}px, ${g}px)`,c.style.opacity="1"})},[r]);return R.useLayoutEffect(()=>{if(!e)return;const o=requestAnimationFrame(()=>{i()}),c=new MutationObserver(()=>{n.current&&i()});return n.current&&c.observe(n.current,{childList:!0,subtree:!0}),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{cancelAnimationFrame(o),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),c.disconnect()}},[i,e]),{anchorRef:t,targetRef:n,anchorWidth:s}}const Le=(r,e,t)=>{if(r=="")return"";if(t)switch(t){case"CodeOnly":return r;case"DescOnly":return e||"";case"Both":return`${r} - ${e}`}return r},xr=({helperText:r,disabled:e,state:t,id:n})=>{const s={container:`smp-helper-text ${e?"smp-helper-text-disabled":""} ${t?`smp-helper-text-${t}`:""}`};return y.jsx("label",{className:s.container,id:n,children:r})};function Zr(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 tt(){return tt=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},tt.apply(null,arguments)}function xt(r,e){return xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},xt(r,e)}function Qr(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,xt(r,e)}function ut(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 Be={};/*!
|
|
22
|
+
<%s key={someKey} {...props} />`,A,V,J,V),M[V+A]=!0)}if(V=null,j!==void 0&&(t(j),V=""+j),i(x)&&(t(x.key),V=""+x.key),"key"in x){j={};for(var K in x)K!=="key"&&(j[K]=x[K])}else j=x;return V&&o(j,typeof p=="function"?p.displayName||p.name||"Unknown":p),l(p,V,L,_,s(),j,Y,U)}function u(p){typeof p=="object"&&p!==null&&p.$$typeof===m&&p._store&&(p._store.validated=1)}var d=T,m=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),D=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),B=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=Object.prototype.hasOwnProperty,R=Array.isArray,F=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(p){return p()}};var H,G={},z=d["react-stack-bottom-frame"].bind(d,a)(),Z=F(n(a)),M={};ke.Fragment=v,ke.jsx=function(p,x,j,A,_){var L=1e4>B.recentlyCreatedOwnerStacks++;return f(p,x,j,!1,A,_,L?Error("react-stack-top-frame"):z,L?F(n(p)):Z)},ke.jsxs=function(p,x,j,A,_){var L=1e4>B.recentlyCreatedOwnerStacks++;return f(p,x,j,!0,A,_,L?Error("react-stack-top-frame"):z,L?F(n(p)):Z)}}()),ke}var At;function Br(){return At||(At=1,process.env.NODE_ENV==="production"?Ue.exports=Ur():Ue.exports=Wr()),Ue.exports}var y=Br();const $e=({label:r,disabled:e,htmlFor:t})=>{const n={container:`smp-label ${e?"smp-label-disabled":""}`};return y.jsx("label",{className:n.container,htmlFor:t,children:r})},pe={"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"},Hr=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},Sr=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:Sr(t.sections,e),content:t.content};let n=t.sections,s=t.content;return(i=t.content)!=null&&i.length&&t.columns&&+t.columns>1&&(n=Hr(t.content.filter(c=>e.includes(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}}),Lt=(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}},It=r=>r.some(e=>e.dim&&!e.dim.endsWith("%")),Ot=({children:r,layout:e={horizontal:!1,sections:[{id:"1",content:Array.isArray(r)?r.map(t=>({id:t.props.id})):[{id:r.props.id}]}]}})=>{const t={};T.Children.forEach(r,d=>{T.isValidElement(d)&&(t[d.props.id]=d)});const n="--smp-grid-template-cols",s="--smp-grid-template-rows",a=Sr(e.sections??[],Object.keys(t)),i=d=>d.reduce((m,h)=>{var D,O;let v="",b={},S={},w="";return(D=h.sections)!=null&&D.length?(v=pe["smp-layout-section-grid"],b=i(h.sections),h.gridCols===void 0&&(w=pe[h.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"],(h.horizontal||It(h.sections))&&(S=Lt(h.sections,h.horizontal?n:s)))):(O=h.content)!=null&&O.length&&(h.gridCols!==void 0&&h.gridCols>0?(v=pe["smp-layout-section-grid"],w=pe["smp-grid-template-cols"],S={[n]:`repeat(${h.gridCols}, 1fr)`}):v=pe["smp-layout-section-flex"]),{...m,...b,[h.id]:{classes:`${v} ${pe[h.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${w} ${h.justify?`smp-justifyContent-${h.justify}`:""} ${h.align?`smp-alignItems-${h.align}`:""}`,styles:S}}},{}),o=i(a),c=`${pe["smp-layout"]} ${e.horizontal?pe["smp-layout-horizontal"]:pe["smp-layout-vertical"]}`,l=e.horizontal||It(e.sections||[])?Lt(a,e.horizontal?n:s):{},f=d=>{var h,v;const m=y.jsx("div",{"smp-id":`section-${d.id}`,className:o[d.id].classes,style:o[d.id].styles,children:(h=d.sections)!=null&&h.length?d.sections.map(b=>f(b)):(v=d.content)==null?void 0:v.map(b=>u(b,d.justify,d.align))},`section-${d.id}`);return d.title?y.jsxs("div",{className:pe["smp-layout-section-with-title"],children:[y.jsx("span",{className:`${pe["smp-layout-section-title"]} ${d.justify?`smp-justifyContent-${d.justify}`:""} ${d.align?`smp-alignItems-${d.align}`:""}`,children:y.jsx($e,{label:d.title})}),m]},`title-section-${d.id}`):m},u=(d,m,h)=>{const v=t[d.id];if(!v)return null;const S={gridColumnStart:(d.colSpan&&d.colSpan>0?`span ${d.colSpan}`:d.colStart&&d.colStart<1?"1":void 0)??d.colStart,gridColumnEnd:d.colEnd&&d.colEnd>0?d.colEnd:void 0},w=`${pe["smp-layout-cell-container"]} ${m?`smp-justifyContent-${m}`:""} ${h?`smp-alignItems-${h}`:""}`;return y.jsx("div",{className:w,style:S,"smp-id":d.id,children:v},d.id)};return y.jsx("div",{className:c,style:l,"smp-id":"layout",children:a.map(d=>f(d))})},re={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",ICON:"ICO",IMAGE:"IMG",INPUT_NUMBER:"INR",MEMO:"MEM",MULTI_AUTOCOMPLETE:"AML",RADIO:"RAD",SPOTLIGHT:"SPL",SWITCH:"SWT",TEXT_FIELD:"ITX",TIME:"TIM",PASSWORD:"PWD"},Gr=r=>r.t=="D8",Kr=r=>r.t=="I1",qr=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 Qe{constructor(e,t){de(this,"class");de(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Qe(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 zr(r,e){if(Rt(r)){const f=new Date(r);if(!isNaN(f.getTime()))return f}const t=new Date,n=r.replaceAll("/","").replaceAll("-","");let s="DDMMYYYY";e==="en"&&(s="MMDDYYYY");const a=s.indexOf("DD"),i=s.indexOf("MM");let o=0,c=0,l="";switch(n.length){case 1:case 2:return o=parseInt(n),t.setDate(o),We(t)?t:r;case 3:case 4:return o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),i===0?(t.setMonth(o-1),t.setDate(c)):a===0&&(t.setMonth(c-1),t.setDate(o)),We(t)?t:r;case 5:case 6:{o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),Number(n.substring(4))>50?l="19"+n.substring(4):l="20"+n.substring(4);let f=0,u=0;return i===0?(f=c,u=o-1,t.setFullYear(parseInt(l),u,f)):a===0&&(f=o,u=c-1,t.setFullYear(parseInt(l),u,f)),xt(o,u,parseInt(l))&&We(t)?t:r}case 7:case 8:{o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),l=n.substring(4);let f=0,u=0;return i===0?(f=c,u=o-1,t.setFullYear(parseInt(l),u,f)):a===0&&(f=o,u=c-1,t.setFullYear(parseInt(l),u,f)),xt(f,u,parseInt(l))&&We(t)?t:r}}return r}function Rt(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function We(r){return r instanceof Date&&!isNaN(r.getTime())}function Jr(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 xt(n,t-1,e)}function xt(r,e,t){const n=[31,Xr(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Xr(r){return r%4===0&&(r%100!==0||r%400===0)}function Zr(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 et{constructor(e,t){de(this,"class");de(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=Nt.get(`${e.t}${e.p}`);if(t)return new et(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=Nt.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 Nt=new Map([["D8*YYMD",{legacyToIso(r){return Jr(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return Rt(r)&&r.replaceAll("-","")||r}}]]),_e=(r,e)=>{T.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 ot({position:r="bottom",enabled:e=!0}){const t=T.useRef(null),n=T.useRef(null),[s,a]=T.useState(0),i=T.useCallback(()=>{const o=t.current,c=n.current;if(!o||!c)return;const{top:l,left:f,width:u,height:d}=o.getBoundingClientRect();a(u);const m=c.offsetHeight,h=c.offsetWidth;if(h===0||m===0){requestAnimationFrame(i);return}let v=l+window.scrollY,b=f+window.scrollX;switch(r){case"top":v-=m;break;case"bottom":v+=d;break;case"left":b-=h;break;case"right":b+=u;break}requestAnimationFrame(()=>{c.style.transform=`translate(${b}px, ${v}px)`,c.style.opacity="1"})},[r]);return T.useLayoutEffect(()=>{if(!e)return;const o=requestAnimationFrame(()=>{i()}),c=new MutationObserver(()=>{n.current&&i()});return n.current&&c.observe(n.current,{childList:!0,subtree:!0}),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{cancelAnimationFrame(o),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),c.disconnect()}},[i,e]),{anchorRef:t,targetRef:n,anchorWidth:s}}const Ie=(r,e,t)=>{if(r=="")return"";if(t)switch(t){case"CodeOnly":return r;case"DescOnly":return e||"";case"Both":return`${r} - ${e}`}return r},wr=({helperText:r,disabled:e,state:t,id:n})=>{const s={container:`smp-helper-text ${e?"smp-helper-text-disabled":""} ${t?`smp-helper-text-${t}`:""}`};return y.jsx("label",{className:s.container,id:n,children:r})};function Qr(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 tt(){return tt=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},tt.apply(null,arguments)}function St(r,e){return St=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},St(r,e)}function en(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,St(r,e)}function ft(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 Be={};/*!
|
|
23
23
|
* content-type
|
|
24
24
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
25
25
|
* MIT Licensed
|
|
26
|
-
*/var
|
|
26
|
+
*/var Mt;function tn(){if(Mt)return Be;Mt=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-]+$/;Be.format=i,Be.parse=o;function i(u){if(!u||typeof u!="object")throw new TypeError("argument obj is required");var d=u.parameters,m=u.type;if(!m||!a.test(m))throw new TypeError("invalid type");var h=m;if(d&&typeof d=="object")for(var v,b=Object.keys(d).sort(),S=0;S<b.length;S++){if(v=b[S],!t.test(v))throw new TypeError("invalid parameter name");h+="; "+v+"="+l(d[v])}return h}function o(u){if(!u)throw new TypeError("argument string is required");var d=typeof u=="object"?c(u):u;if(typeof d!="string")throw new TypeError("argument string is required to be a string");var m=d.indexOf(";"),h=m!==-1?d.slice(0,m).trim():d.trim();if(!a.test(h))throw new TypeError("invalid media type");var v=new f(h.toLowerCase());if(m!==-1){var b,S,w;for(r.lastIndex=m;S=r.exec(d);){if(S.index!==m)throw new TypeError("invalid parameter format");m+=S[0].length,b=S[1].toLowerCase(),w=S[2],w.charCodeAt(0)===34&&(w=w.slice(1,-1),w.indexOf("\\")!==-1&&(w=w.replace(n,"$1"))),v.parameters[b]=w}if(m!==d.length)throw new TypeError("invalid parameter format")}return v}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 Be}var rn=tn(),Re=new Map,Er=function(e){return e.cloneNode(!0)},Ft=function(){return window.location.protocol==="file:"},Tr=function(e,t,n){var s=new XMLHttpRequest;s.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&s.readyState===2){var a=s.getResponseHeader("Content-Type");if(!a)throw new Error("Content type not found");var i=rn.parse(a).type;if(!(i==="image/svg+xml"||i==="text/plain"))throw new Error("Invalid content type: ".concat(i))}if(s.readyState===4){if(s.status===404||s.responseXML===null)throw new Error(Ft()?"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||Ft()&&s.status===0)n(null,s);else throw new Error("There was a problem injecting the SVG: "+s.status+" "+s.statusText)}}catch(o){if(s.abort(),o instanceof Error)n(o,s);else throw o}},s.open("GET",e),s.withCredentials=t,s.overrideMimeType&&s.overrideMimeType("text/xml"),s.send()},be={},Vt=function(e,t){be[e]=be[e]||[],be[e].push(t)},nn=function(e){for(var t=function(i,o){setTimeout(function(){if(Array.isArray(be[e])){var c=Re.get(e),l=be[e][i];c instanceof SVGSVGElement&&l(null,Er(c)),c instanceof Error&&l(c),i===be[e].length-1&&delete be[e]}},0)},n=0,s=be[e].length;n<s;n++)t(n)},sn=function(e,t,n){if(Re.has(e)){var s=Re.get(e);if(s===void 0){Vt(e,n);return}if(s instanceof SVGSVGElement){n(null,Er(s));return}}Re.set(e,void 0),Vt(e,n),Tr(e,t,function(a,i){var o;a?Re.set(e,a):((o=i.responseXML)===null||o===void 0?void 0:o.documentElement)instanceof SVGSVGElement&&Re.set(e,i.responseXML.documentElement),nn(e)})},an=function(e,t,n){Tr(e,t,function(s,a){var i;s?n(s):((i=a.responseXML)===null||i===void 0?void 0:i.documentElement)instanceof SVGSVGElement&&n(null,a.responseXML.documentElement)})},on=0,ln=function(){return++on},ge=[],Yt={},cn="http://www.w3.org/2000/svg",dt="http://www.w3.org/1999/xlink",Ut=function(e,t,n,s,a,i,o){var c=e.getAttribute("data-src")||e.getAttribute("src");if(!c){o(new Error("Invalid data-src or src attribute"));return}if(ge.indexOf(e)!==-1){ge.splice(ge.indexOf(e),1),e=null;return}ge.push(e),e.setAttribute("src","");var l=s?sn:an;l(c,a,function(f,u){if(!u){ge.splice(ge.indexOf(e),1),e=null,o(f);return}var d=e.getAttribute("id");d&&u.setAttribute("id",d);var m=e.getAttribute("title");m&&u.setAttribute("title",m);var h=e.getAttribute("width");h&&u.setAttribute("width",h);var v=e.getAttribute("height");v&&u.setAttribute("height",v);var b=Array.from(new Set(ft(ft(ft([],(u.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();u.setAttribute("class",b);var S=e.getAttribute("style");S&&u.setAttribute("style",S),u.setAttribute("data-src",c);var w=[].filter.call(e.attributes,function(Z){return/^data-\w[\w-]*$/.test(Z.name)});if(Array.prototype.forEach.call(w,function(Z){Z.name&&Z.value&&u.setAttribute(Z.name,Z.value)}),n){var D={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]},O,g,E,$,C;Object.keys(D).forEach(function(Z){O=Z,E=D[Z],g=u.querySelectorAll(O+"[id]");for(var M=function(A,_){$=g[A].id,C=$+"-"+ln();var L;Array.prototype.forEach.call(E,function(W){L=u.querySelectorAll("["+W+'*="'+$+'"]');for(var X=0,te=L.length;X<te;X++){var ne=L[X].getAttribute(W);ne&&!ne.match(new RegExp('url\\("?#'+$+'"?\\)'))||L[X].setAttribute(W,"url(#"+C+")")}});for(var Y=u.querySelectorAll("[*|href]"),U=[],V=0,J=Y.length;V<J;V++){var K=Y[V].getAttributeNS(dt,"href");K&&K.toString()==="#"+g[A].id&&U.push(Y[V])}for(var se=0,N=U.length;se<N;se++)U[se].setAttributeNS(dt,"href","#"+C);g[A].id=C},p=0,x=g.length;p<x;p++)M(p)})}u.removeAttribute("xmlns:a");for(var P=u.querySelectorAll("script"),I=[],B,k,R=0,F=P.length;R<F;R++)k=P[R].getAttribute("type"),(!k||k==="application/ecmascript"||k==="application/javascript"||k==="text/javascript")&&(B=P[R].innerText||P[R].textContent,B&&I.push(B),u.removeChild(P[R]));if(I.length>0&&(t==="always"||t==="once"&&!Yt[c])){for(var H=0,G=I.length;H<G;H++)new Function(I[H])(window);Yt[c]=!0}var z=u.querySelectorAll("style");if(Array.prototype.forEach.call(z,function(Z){Z.textContent+=""}),u.setAttribute("xmlns",cn),u.setAttribute("xmlns:xlink",dt),i(u),!e.parentNode){ge.splice(ge.indexOf(e),1),e=null,o(new Error("Parent node is null"));return}e.parentNode.replaceChild(u,e),ge.splice(ge.indexOf(e),1),e=null,o(null,u)})},un=function(e,t){var n=t===void 0?{}:t,s=n.afterAll,a=s===void 0?function(){}:s,i=n.afterEach,o=i===void 0?function(){}:i,c=n.beforeEach,l=c===void 0?function(){}:c,f=n.cacheRequests,u=f===void 0?!0:f,d=n.evalScripts,m=d===void 0?"never":d,h=n.httpRequestWithCredentials,v=h===void 0?!1:h,b=n.renumerateIRIElements,S=b===void 0?!0:b;if(e&&"length"in e)for(var w=0,D=0,O=e.length;D<O;D++)Ut(e[D],m,S,u,v,l,function(g,E){o(g,E),e&&"length"in e&&e.length===++w&&a(w)});else e?Ut(e,m,S,u,v,l,function(g,E){o(g,E),a(1),e=null}):a(0)},He={exports:{}},Ge={exports:{}},Q={};/** @license React v16.13.1
|
|
27
27
|
* react-is.production.min.js
|
|
28
28
|
*
|
|
29
29
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
33
|
+
*/var Wt;function fn(){if(Wt)return Q;Wt=1;var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,u=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,S=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function D(g){if(typeof g=="object"&&g!==null){var E=g.$$typeof;switch(E){case e:switch(g=g.type,g){case c:case l:case n:case a:case s:case u:return g;default:switch(g=g&&g.$$typeof,g){case o:case f:case h:case m:case i:return g;default:return E}}case t:return E}}}function O(g){return D(g)===l}return Q.AsyncMode=c,Q.ConcurrentMode=l,Q.ContextConsumer=o,Q.ContextProvider=i,Q.Element=e,Q.ForwardRef=f,Q.Fragment=n,Q.Lazy=h,Q.Memo=m,Q.Portal=t,Q.Profiler=a,Q.StrictMode=s,Q.Suspense=u,Q.isAsyncMode=function(g){return O(g)||D(g)===c},Q.isConcurrentMode=O,Q.isContextConsumer=function(g){return D(g)===o},Q.isContextProvider=function(g){return D(g)===i},Q.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===e},Q.isForwardRef=function(g){return D(g)===f},Q.isFragment=function(g){return D(g)===n},Q.isLazy=function(g){return D(g)===h},Q.isMemo=function(g){return D(g)===m},Q.isPortal=function(g){return D(g)===t},Q.isProfiler=function(g){return D(g)===a},Q.isStrictMode=function(g){return D(g)===s},Q.isSuspense=function(g){return D(g)===u},Q.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===n||g===l||g===a||g===s||g===u||g===d||typeof g=="object"&&g!==null&&(g.$$typeof===h||g.$$typeof===m||g.$$typeof===i||g.$$typeof===o||g.$$typeof===f||g.$$typeof===b||g.$$typeof===S||g.$$typeof===w||g.$$typeof===v)},Q.typeOf=D,Q}var ee={};/** @license React v16.13.1
|
|
34
34
|
* react-is.development.js
|
|
35
35
|
*
|
|
36
36
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
37
37
|
*
|
|
38
38
|
* This source code is licensed under the MIT license found in the
|
|
39
39
|
* LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/var
|
|
40
|
+
*/var Bt;function dn(){return Bt||(Bt=1,process.env.NODE_ENV!=="production"&&function(){var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,u=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,S=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function D(N){return typeof N=="string"||typeof N=="function"||N===n||N===l||N===a||N===s||N===u||N===d||typeof N=="object"&&N!==null&&(N.$$typeof===h||N.$$typeof===m||N.$$typeof===i||N.$$typeof===o||N.$$typeof===f||N.$$typeof===b||N.$$typeof===S||N.$$typeof===w||N.$$typeof===v)}function O(N){if(typeof N=="object"&&N!==null){var W=N.$$typeof;switch(W){case e:var X=N.type;switch(X){case c:case l:case n:case a:case s:case u:return X;default:var te=X&&X.$$typeof;switch(te){case o:case f:case h:case m:case i:return te;default:return W}}case t:return W}}}var g=c,E=l,$=o,C=i,P=e,I=f,B=n,k=h,R=m,F=t,H=a,G=s,z=u,Z=!1;function M(N){return Z||(Z=!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(N)||O(N)===c}function p(N){return O(N)===l}function x(N){return O(N)===o}function j(N){return O(N)===i}function A(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function _(N){return O(N)===f}function L(N){return O(N)===n}function Y(N){return O(N)===h}function U(N){return O(N)===m}function V(N){return O(N)===t}function J(N){return O(N)===a}function K(N){return O(N)===s}function se(N){return O(N)===u}ee.AsyncMode=g,ee.ConcurrentMode=E,ee.ContextConsumer=$,ee.ContextProvider=C,ee.Element=P,ee.ForwardRef=I,ee.Fragment=B,ee.Lazy=k,ee.Memo=R,ee.Portal=F,ee.Profiler=H,ee.StrictMode=G,ee.Suspense=z,ee.isAsyncMode=M,ee.isConcurrentMode=p,ee.isContextConsumer=x,ee.isContextProvider=j,ee.isElement=A,ee.isForwardRef=_,ee.isFragment=L,ee.isLazy=Y,ee.isMemo=U,ee.isPortal=V,ee.isProfiler=J,ee.isStrictMode=K,ee.isSuspense=se,ee.isValidElementType=D,ee.typeOf=O}()),ee}var Ht;function Or(){return Ht||(Ht=1,process.env.NODE_ENV==="production"?Ge.exports=fn():Ge.exports=dn()),Ge.exports}/*
|
|
41
41
|
object-assign
|
|
42
42
|
(c) Sindre Sorhus
|
|
43
43
|
@license MIT
|
|
44
|
-
*/var
|
|
45
|
-
Valid keys: `+JSON.stringify(Object.keys(h),null," "));var L=se(Y,H,j,A,V+"."+H,t);if(L)return L}return null}return b(x)}function q(h){switch(typeof h){case"number":case"string":case"undefined":return!0;case"boolean":return!h;case"object":if(Array.isArray(h))return h.every(q);if(h===null||o(h))return!0;var x=u(h);if(x){var O=x.call(h),P;if(x!==h.entries){for(;!(P=O.next()).done;)if(!q(P.value))return!1}else for(;!(P=O.next()).done;){var j=P.value;if(j&&!q(j[1]))return!1}}else return!1;return!0;default:return!1}}function Z(h,x){return h==="symbol"?!0:x?x["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&x instanceof Symbol:!1}function K(h){var x=typeof h;return Array.isArray(h)?"array":h instanceof RegExp?"object":Z(x,h)?"symbol":x}function z(h){if(typeof h>"u"||h===null)return""+h;var x=K(h);if(x==="object"){if(h instanceof Date)return"date";if(h instanceof RegExp)return"regexp"}return x}function B(h){var x=z(h);switch(x){case"array":case"object":return"an "+x;case"boolean":case"date":case"regexp":return"a "+x;default:return x}}function N(h){return!h.constructor||!h.constructor.name?d:h.constructor.name}return p.checkPropTypes=s,p.resetWarningCache=s.resetWarningCache,p.PropTypes=p,p},gt}var yt,zt;function mn(){if(zt)return yt;zt=1;var r=jt();function e(){}function t(){}return t.resetWarningCache=e,yt=function(){function n(i,o,c,l,f,u){if(u!==r){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}n.isRequired=n;function s(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:e};return a.PropTypes=a,a},yt}var Jt;function gn(){if(Jt)return He.exports;if(Jt=1,process.env.NODE_ENV!=="production"){var r=Er(),e=!0;He.exports=hn()(r.isElement,e)}else He.exports=mn()();return He.exports}var ie=gn(),yn=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},vn=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},bn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],qe="http://www.w3.org/2000/svg",Xt="http://www.w3.org/1999/xlink",Re=function(r){function e(){for(var n,s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return n=r.call.apply(r,[this].concat(a))||this,n.initialState={hasError:!1,isLoading:!0},n.state=n.initialState,n._isMounted=!1,n.reactWrapper=void 0,n.nonReactWrapper=void 0,n.refCallback=function(o){n.reactWrapper=o},n}Qr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof yn(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,c=a.httpRequestWithCredentials,l=a.renumerateIRIElements,f=a.src,u=a.title,d=a.useRequestCache,p=this.props.onError,m=this.props.beforeInjection,g=this.props.afterInjection,b=this.props.wrapper,E,w;b==="svg"?(E=document.createElementNS(qe,b),E.setAttribute("xmlns",qe),E.setAttribute("xmlns:xlink",Xt),w=document.createElementNS(qe,b)):(E=document.createElement(b),w=document.createElement(b)),E.appendChild(w),w.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(E);var T=function($){if(s.removeSVG(),!s._isMounted){p($);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){p($)})},S=function($,C){if($){T($);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{g(C)}catch(k){T(k)}})},v=function($){if($.setAttribute("role","img"),i){var C=$.querySelector(":scope > desc");C&&$.removeChild(C);var k=document.createElement("desc");k.innerHTML=i,$.prepend(k)}if(u){var I=$.querySelector(":scope > title");I&&$.removeChild(I);var _=document.createElement("title");_.innerHTML=u,$.prepend(_)}try{m($)}catch(F){T(F)}};cn(w,{afterEach:S,beforeEach:v,cacheRequests:d,evalScripts:o,httpRequestWithCredentials:c,renumerateIRIElements:l})}},t.removeSVG=function(){var s;(s=this.nonReactWrapper)!=null&&s.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},t.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},t.componentDidUpdate=function(s){var a=this;vn(tt({},s),this.props)&&this.setState(function(){return a.initialState},function(){a.removeSVG(),a.renderSVG()})},t.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},t.render=function(){var s=this.props;s.afterInjection,s.beforeInjection,s.desc,s.evalScripts;var a=s.fallback;s.httpRequestWithCredentials;var i=s.loading;s.renumerateIRIElements,s.src,s.title,s.useRequestCache;var o=s.wrapper,c=Zr(s,bn),l=o;return Ye.createElement(l,tt({},c,{ref:this.refCallback},o==="svg"?{xmlns:qe,xmlnsXlink:Xt}:{}),this.state.isLoading&&i&&Ye.createElement(i,null),this.state.hasError&&a&&Ye.createElement(a,null))},e}(Ye.Component);Re.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Re.propTypes={afterInjection:ie.func,beforeInjection:ie.func,desc:ie.string,evalScripts:ie.oneOf(["always","once","never"]),fallback:ie.oneOfType([ie.func,ie.object,ie.string]),httpRequestWithCredentials:ie.bool,loading:ie.oneOfType([ie.func,ie.object,ie.string]),onError:ie.func,renumerateIRIElements:ie.bool,src:ie.string.isRequired,title:ie.string,useRequestCache:ie.bool,wrapper:ie.oneOf(["div","span","svg"])};let St={assets:"/"};const xn=r=>{St={...St,...r}},Zt=r=>`${St.assets}/${r}`.replace(/\/+/g,"/"),oe=R.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:c,isInteractable:l=!1,spin:f=!1,title:u,tabIndex:d})=>{const[p,m]=R.useState(r),g=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),b=g&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),E=Zt(`assets/svg/${r}.svg`),w=Zt(`assets/svg/${n}.svg`),T={img:`${l?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${l?"smp-icon-interactable":""} ${f?"smp-icon-spin":""}`},S=()=>{!a&&l&&c&&c()},v=D=>{!a&&l&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),S())};return y.jsx(y.Fragment,{children:b?y.jsx(Re,{src:r,fallback:()=>y.jsx(Re,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:T.svg,onClick:S,onKeyDown:v,tabIndex:d}):g?y.jsx("img",{src:p,width:e||"16px",height:t||"auto",alt:u,onError:()=>m(w),onClick:S,className:T.img,title:u,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&S()}}):y.jsx(Re,{src:E,fallback:()=>y.jsx(Re,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:T.svg,onClick:S,onKeyDown:v,tabIndex:d})})}),he={"smp-textfield-wrapper":"_smp-textfield-wrapper_mmttf_4","smp-textfield":"_smp-textfield_mmttf_4","smp-textfield-extraSmall":"_smp-textfield-extraSmall_mmttf_30","smp-textfield-small":"_smp-textfield-small_mmttf_35","smp-textfield-medium":"_smp-textfield-medium_mmttf_40","smp-textfield-large":"_smp-textfield-large_mmttf_45","smp-textfield-extraLarge":"_smp-textfield-extraLarge_mmttf_50","smp-textfield-input":"_smp-textfield-input_mmttf_56","smp-textfield-outlined":"_smp-textfield-outlined_mmttf_79","smp-textfield-danger":"_smp-textfield-danger_mmttf_90","smp-textfield-readOnly":"_smp-textfield-readOnly_mmttf_94","smp-textfield-variant-notSelectable":"_smp-textfield-variant-notSelectable_mmttf_99","smp-textfield-disabled":"_smp-textfield-disabled_mmttf_109","smp-textfield-fullWidth":"_smp-textfield-fullWidth_mmttf_118"},xe=({disabled:r,bindValue:e,icon:t,onBlur:n,onChange:s,placeholder:a,isEditable:i=!0,shapeIcon:o,sizing:c,state:l,variant:f,rotatedShapeIcon:u=!1,onShapeIconClick:d,ref:p,inputRef:m,onKeyDown:g,inputType:b="text",ariaLabel:E="input field",label:w,helperText:T=!1,error:S,appearance:v="base",fullWidth:D=!1,_dataComponent:$="textfield",width:C})=>{const k=R.useId(),I=`${k}-helper`,_=S?"danger":l,F=S||l=="danger"?"error":o,W=T||!!S,q=z=>{s==null||s(z.target.value)},Z={wrapper:`${he["smp-textfield-wrapper"]} ${D?he["smp-textfield-fullWidth"]:""}`,container:`${he["smp-textfield"]} ${r?he["smp-textfield-disabled"]:""} ${a?he["smp-textfield-placeholder"]:""} ${c?he[`smp-textfield-${c}`]:""} ${_?he[`smp-textfield-${_}`]:""} ${v?he[`smp-textfield-${v}`]:""} ${i?"":he["smp-textfield-readOnly"]}`,input:`${he["smp-textfield-input"]}`};if(f&&(f!=="notSelectable"||i)){const z=he[`smp-textfield-variant-${f}`];z&&(Z.container+=` ${z}`)}const K=C?{"--smp-textField-width-base":C}:void 0;return y.jsxs("div",{className:Z.wrapper,"data-component":$,children:[w&&y.jsx(De,{label:w,disabled:r,htmlFor:k}),y.jsxs("div",{className:Z.container,ref:p,style:K,children:[t&&y.jsx(oe,{icon:t,disabled:r}),y.jsx("input",{id:k,type:b,value:e,placeholder:a,onChange:q,onBlur:n,className:Z.input,disabled:r,readOnly:!i,onKeyDown:g,"aria-label":E,ref:m,"aria-describedby":W?I:void 0}),F&&y.jsx(oe,{icon:F,disabled:r,state:_,onClick:d,rotated:u,isInteractable:i,tabIndex:0})]}),W&&y.jsx(xr,{helperText:S,disabled:r,state:_,id:I})]})};function Or({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=R.useState(0),i=R.useRef(null),o=r.length*e,c=Math.max(0,Math.floor(s/e)-n),l=Math.min(r.length-1,Math.floor((s+t)/e)+n),f=[];for(let p=c;p<=l;p++)f.push({item:r[p],index:p,offsetTop:p*e});const u=R.useCallback(p=>{const m=p.target.scrollTop;a(m)},[]),d=p=>{if(!i.current)return;const m=p*e,g=m+e,b=i.current,E=b.scrollTop,w=E+t;m<E?b.scrollTop=m:g>w&&(b.scrollTop=g-t)};return{virtualItems:f,containerProps:{ref:i,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:u},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:o,startIndex:c,endIndex:l},scrollToIndex:d}}const Ke={"smp-list":"_smp-list_t8eqj_1","smp-list-container":"_smp-list-container_t8eqj_10","smp-list-listItem":"_smp-list-listItem_t8eqj_15"},Sn=10,jr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:c,onKeyDown:l})=>{var I;const[f,u]=R.useState(""),d=24,[p,m]=R.useState(a!==null?a:-1),g=s!==void 0?s:e.length>Sn,b=f?e.filter(_=>_.label.toLowerCase().includes(f.toLowerCase())):e,E=_=>{u(_)},{virtualItems:w,containerProps:T,innerProps:S,scrollToIndex:v}=Or({items:b,itemHeight:d,containerHeight:200,overscan:5});R.useEffect(()=>{a!==null&&a!==p&&m(a)},[a]),R.useEffect(()=>{p>=0&&p<b.length&&v(p)},[p,b]);const D=_=>{if(_.key==="ArrowDown"||_.key==="ArrowUp"){_.preventDefault();let F=p;_.key==="ArrowDown"?F=p<b.length-1?p+1:0:_.key==="ArrowUp"&&(F=p>0?p-1:b.length-1),m(F)}else _.key==="Enter"?p>=0&&p<b.length&&(c==null||c(b[p])):_.key==="Escape"&&(_.preventDefault(),_.stopPropagation());l&&l(_)},$=_=>{D(_)},C=_=>{D(_)},k={wrapper:`${Ke["smp-list"]}`,container:`${Ke["smp-list-container"]}`,virtualScroll:`${Ke["smp-list-virtualScroll"]}`,listItem:`${Ke["smp-list-listItem"]}`};return y.jsxs("div",{id:r,ref:n,className:k.wrapper,"data-component":"list",style:{width:o},children:[g&&y.jsx(xe,{bindValue:f,placeholder:"Search...",onChange:E,onKeyDown:$}),y.jsx("div",{...T,className:k.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:C,"aria-activedescendant":p>=0&&p<b.length?(I=b[p])==null?void 0:I.id:void 0,children:y.jsx("div",{...S,className:k.virtualScroll,children:w.map(({item:_,index:F,offsetTop:W})=>{const q=i.includes(_.id);return y.jsxs("li",{role:"option",id:_.id,"aria-selected":p===F?"true":"false",tabIndex:-1,className:`${k.listItem} ${p===F?"selected-item":""}`,"aria-label":_.id+"-"+_.label,style:{height:`${d}px`,lineHeight:`calc(${d}px - 2*2px)`,transform:`translateY(${W}px)`},onClick:()=>{c==null||c(_),m(F)},children:[Le(_.id,_.label,t),q&&y.jsx(oe,{icon:"check",width:16})]},_.id)})})})]})},Rr=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=R.useState(Le(e,t,r));return R.useEffect(()=>{a(e)},[e]),R.useEffect(()=>{a(Le(e,t,r))},[t,r]),y.jsx(xe,{...n,bindValue:s})},wn=r=>{const e=R.useRef(null);return R.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}};function ot({children:r}){const[e,t]=R.useState(!1);return R.useEffect(()=>{t(!0)},[]),e?Fr.createPortal(r,document.body):null}const Rt=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,isEditable:i=!0,placeholder:o,fun:c,_changeOnEnter:l=!1,onChange:f,onOptionsRequest:u,_multiActiveIndex:d,...p})=>{const[m,g]=R.useState(r),[b,E]=R.useState(e),[w,T]=R.useState(!1),[S,v]=R.useState(t||[]),[D,$]=R.useState(0),[C,k]=R.useState([r]),{anchorRef:I,targetRef:_,anchorWidth:F}=it({position:"bottom",enabled:w});ke(_,()=>T(!1));const W=wn(400),q=B=>{B.length>=a?c&&u&&W(async()=>{const N=await u(c,B);v(N),$(N.length>0?0:-1),T(!0)}):T(!1),g(B),E(e),l||f==null||f(B,e)},Z=B=>{l?(g(""),E("")):(g(B.id),E(B.label)),f==null||f(B.id,B.label);const N=S.findIndex(h=>h.id===B.id);$(N),k([B.id]),T(!1)},K=B=>{B.key==="Escape"&&(T(!1),$(-1))},z=B=>{if((B.key==="ArrowDown"||B.key==="ArrowUp")&&(B.preventDefault(),w)){const N=B.key==="ArrowDown"?(D+1)%S.length:(D-1+S.length)%S.length;$(N)}switch(B.key){case"Enter":D>=0&&D<S.length?Z(S[D]):l&&(f==null||f(m,""),T(!1),g(""),E(""));break;case"Escape":T(!1),$(-1);break}};return y.jsxs("div",{"data-component":"autocomplete",children:[y.jsx(Rr,{...p,bindValue:m,optionalDisplayValue:b,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:o,ref:I,onChange:q,onKeyDown:z,"aria-autocomplete":"list"}),w&&y.jsx(ot,{children:y.jsx(jr,{options:S,displayMode:s,onClick:Z,ref:_,selectedIndex:D,activeIndex:d||C,width:F,showFilter:!1,onKeyDown:K})})]})},Qt=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],er=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],we=({label:r,bindValue:e,onClick:t,ariaLabel:n,icon:s,disabled:a,sizing:i="base",variant:o="primary",appearance:c="raised",showIcon:l=!0,showText:f=!0,fullWidth:u=!1,loading:d=!1,justify:p="center",title:m,optionalDisplayValue:g})=>{const b={container:`smp-button smp-button-container ${i?`smp-button-${i}`:""} ${o?`smp-buttonVariant-${o}`:""} ${c?`smp-buttonType-${c}`:""} ${u?"smp-button-fullWidth":""} smp-justifyContent-${p}`};return y.jsx("button",{"data-component":"button",className:b.container,onClick:t,"aria-label":n,disabled:a,"aria-busy":d,title:m||r||g,children:d?y.jsx(oe,{icon:"spinner",state:er(o),spin:!0}):y.jsxs(y.Fragment,{children:[s&&l&&y.jsx(oe,{icon:s,disabled:a,state:er(o),width:Qt(i),height:Qt(i)}),f&&y.jsx("span",{children:g||e})]})})},Dr=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:f,justify:u,onClick:d,onOptionsRequest:p})=>{const[m,g]=R.useState(r);R.useEffect(()=>{!m&&p&&e&&p(e,void 0).then(w=>g(w)).catch(w=>{console.error("Errore nel caricamento delle opzioni per ButtonList",w)})},[m,e,p]);const b={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},E=m==null?void 0:m.map((w,T)=>{const S={bindValue:w.id,optionalDisplayValue:w.label,fun:w.fun,icon:w.icon,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:f,sizing:s,justify:u,onClick:()=>{d==null||d(w.id,w.fun)}};return y.jsx(we,{...S},`button-${T}`)});return y.jsx("div",{role:"list","data-component":"button-list",className:b.container,children:E})},En={"smp-checkbox-wrapper":"_smp-checkbox-wrapper_z14lq_2"},_r=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i,variant:o="checkbox"})=>{const c=R.useId(),l=u=>{s&&a&&a(u.target.checked)},f={wrapper:`${En["smp-checkbox-wrapper"]}`};return y.jsxs("div",{className:f.wrapper,"data-component":e,children:[n&&y.jsx(De,{label:n,disabled:t,htmlFor:c}),y.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:l,onBlur:i,role:o==="switch"?"switch":"checkbox",id:c})]})},Tn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},Ie=({variant:r="body",bindValue:e,color:t,...n})=>{const s=Tn[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return y.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},Dt=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,c]=R.useState(null),l={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=p=>{n==null||n(r.filter((m,g)=>g!==p))},u=p=>{c(p)},d=p=>{if(o===null||o===p)return;const m=[...r],[g]=m.splice(o,1);m.splice(p,0,g),n==null||n(m),c(null)};return y.jsx("div",{className:l.container,role:"list","data-component":"chip",children:r.flatMap((p,m)=>{const g=Le(p.bindValue,p.optionalDisplayValue,t),b=y.jsxs("div",{className:l.element,role:"listitem",draggable:i,onDragStart:()=>u(m),onDragOver:w=>i&&w.preventDefault(),onDrop:()=>i&&d(m),style:{"--smp-chips-backgroundColor-base":a},children:[i&&y.jsx(oe,{icon:"drag_indicator_horizontal",isInteractable:!0}),y.jsx(Ie,{variant:"label",bindValue:g,color:s}),e&&y.jsx(oe,{icon:"close",isInteractable:!0,onClick:()=>f(m),color:s})]},`chip-${m}`),E=i&&m<r.length-1?y.jsx(oe,{icon:"chevron-right",color:s},`separator-${m}`):null;return[b,E].filter(Boolean)})})};function _t(r,e){const t=R.useRef(null);R.useEffect(()=>{if(!r)return;const n=typeof e=="object"&&e!==null&&"current"in e?e.current:null;if(!n)return;t.current=document.activeElement;const s=()=>n?Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(l=>!l.hasAttribute("disabled")&&l.offsetParent!==null):[];(()=>{const l=s();l.length>0&&requestAnimationFrame(()=>l[0].focus())})();const i=l=>{if(l.key==="Escape"||l.key!=="Tab")return;const f=s();if(f.length===0)return;const u=f[0],d=f[f.length-1];l.shiftKey&&document.activeElement===u?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),u.focus())},o=l=>{if(n&&!n.contains(l.target)){l.preventDefault();const f=s();f.length>0&&f[0].focus()}};document.addEventListener("keydown",i),document.addEventListener("mousedown",o);const c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=c,t.current&&requestAnimationFrame(()=>{var l;(l=t.current)==null||l.focus()})}},[r,e])}const $r=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:c,multiActiveIndex:l,...f})=>{const[u,d]=R.useState(!1),[p,m]=R.useState(t),[g,b]=R.useState(-1),[E,w]=R.useState([r]),T=R.useId(),{anchorRef:S,targetRef:v,anchorWidth:D}=it({position:"bottom",enabled:u});ke(v,()=>d(!1)),_t(u,v);const $=_=>{e==null||e(_.id,_.label);const F=p.findIndex(W=>W.id===_.id);b(F),w([_.id]),d(!1)},C=_=>{_.key==="Escape"&&(d(!1),b(-1))},k=_=>{(_.key==="ArrowDown"||_.key==="ArrowUp")&&(_.preventDefault(),I())},I=()=>{o&&c&&c(o,void 0).then(_=>{m(_),b(_.length>0?0:-1),d(!0)})};return y.jsxs("div",{role:"combobox","aria-expanded":u,"aria-controls":T,"aria-owns":T,"data-component":"combobox",children:[y.jsx(Rr,{...f,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:I,onKeyDown:k,shapeIcon:"arrow_drop_down",rotatedShapeIcon:u,isEditable:s,ref:S,"aria-autocomplete":"list",variant:"notSelectable"}),u&&y.jsx(ot,{children:y.jsx(jr,{id:T,options:p,displayMode:i,ref:v,selectedIndex:g,activeIndex:l||E,width:D,onClick:$,onKeyDown:C})})]})},G=r=>typeof r=="string",Ce=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},tr=r=>r==null?"":""+r,On=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},jn=/###/g,rr=r=>r&&r.indexOf("###")>-1?r.replace(jn,"."):r,nr=r=>!r||G(r),Ae=(r,e,t)=>{const n=G(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(nr(r))return{};const a=rr(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return nr(r)?{}:{obj:r,k:rr(n[s])}},sr=(r,e,t)=>{const{obj:n,k:s}=Ae(r,e,Object);if(n!==void 0||e.length===1){n[s]=t;return}let a=e[e.length-1],i=e.slice(0,e.length-1),o=Ae(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=Ae(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},Rn=(r,e,t,n)=>{const{obj:s,k:a}=Ae(r,e,Object);s[a]=s[a]||[],s[a].push(t)},rt=(r,e)=>{const{obj:t,k:n}=Ae(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},Dn=(r,e,t)=>{const n=rt(r,t);return n!==void 0?n:rt(e,t)},Cr=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?G(r[n])||r[n]instanceof String||G(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):Cr(r[n],e[n],t):r[n]=e[n]);return r},Oe=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var _n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const $n=r=>G(r)?r.replace(/[&<>"'\/]/g,e=>_n[e]):r;class Cn{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const Pn=[" ",",","?","!",";"],An=new Cn(20),kn=(r,e,t)=>{e=e||"",t=t||"";const n=Pn.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=An.getRegExp(`(${n.map(i=>i==="?"?"\\?":i).join("|")})`);let a=!s.test(r);if(!a){const i=r.indexOf(t);i>0&&!s.test(r.substring(0,i))&&(a=!0)}return a},wt=(r,e,t=".")=>{if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const n=e.split(t);let s=r;for(let a=0;a<n.length;){if(!s||typeof s!="object")return;let i,o="";for(let c=a;c<n.length;++c)if(c!==a&&(o+=t),o+=n[c],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&c<n.length-1)continue;a+=c-a+1;break}s=i}return s},Ne=r=>r==null?void 0:r.replace("_","-"),Ln={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){var t,n;(n=(t=console==null?void 0:console[r])==null?void 0:t.apply)==null||n.call(t,console,e)}};class nt{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Ln,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(G(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new nt(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new nt(this.logger,e)}}var ge=new nt;class lt{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const s=this.observers[n].get(t)||0;this.observers[n].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s.apply(s,[e,...t])})}}class ar extends lt{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,s={}){var l,f;const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,i=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):G(n)&&a?o.push(...n.split(a)):o.push(n)));const c=rt(this.data,o);return!c&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),c||!i||!G(n)?c:wt((f=(l=this.data)==null?void 0:l[e])==null?void 0:f[t],n,a)}addResource(e,t,n,s,a={silent:!1}){const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),sr(this.data,o,s),a.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const a in n)(G(n[a])||Array.isArray(n[a]))&&this.addResource(e,t,a,n[a],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,a,i={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),s=n,n=t,t=o[1]),this.addNamespaces(t);let c=rt(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Cr(c,n,a):c={...c,...n},sr(this.data,o,c),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var Pr={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,n,s){return r.forEach(a=>{var i;e=((i=this.processors[a])==null?void 0:i.process(e,t,n,s))??e}),e}};const ir={},or=r=>!G(r)&&typeof r!="boolean"&&typeof r!="number";class st extends lt{constructor(e,t={}){super(),On(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ge.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(e==null)return!1;const s=this.resolve(e,n);return(s==null?void 0:s.res)!==void 0}extractFromKey(e,t){let n=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let a=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!kn(e,n,s);if(i&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:G(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:G(a)?[a]:a}}translate(e,t,n){let s=typeof t=="object"?{...t}:t;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(s={...s}),s||(s={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const a=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:o,namespaces:c}=this.extractFromKey(e[e.length-1],s),l=c[c.length-1];let f=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const u=s.lng||this.language,d=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((u==null?void 0:u.toLowerCase())==="cimode")return d?a?{res:`${l}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:`${l}${f}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:o;const p=this.resolve(e,s);let m=p==null?void 0:p.res;const g=(p==null?void 0:p.usedKey)||o,b=(p==null?void 0:p.exactUsedKey)||o,E=["[object Number]","[object Function]","[object RegExp]"],w=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,T=!this.i18nFormat||this.i18nFormat.handleAsObject,S=s.count!==void 0&&!G(s.count),v=st.hasDefaultValue(s),D=S?this.pluralResolver.getSuffix(u,s.count,s):"",$=s.ordinal&&S?this.pluralResolver.getSuffix(u,s.count,{ordinal:!1}):"",C=S&&!s.ordinal&&s.count===0,k=C&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${D}`]||s[`defaultValue${$}`]||s.defaultValue;let I=m;T&&!m&&v&&(I=k);const _=or(I),F=Object.prototype.toString.apply(I);if(T&&I&&_&&E.indexOf(F)<0&&!(G(w)&&Array.isArray(I))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const W=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,I,{...s,ns:c}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(p.res=W,p.usedParams=this.getUsedParamsDetails(s),p):W}if(i){const W=Array.isArray(I),q=W?[]:{},Z=W?b:g;for(const K in I)if(Object.prototype.hasOwnProperty.call(I,K)){const z=`${Z}${i}${K}`;v&&!m?q[K]=this.translate(z,{...s,defaultValue:or(k)?k[K]:void 0,joinArrays:!1,ns:c}):q[K]=this.translate(z,{...s,joinArrays:!1,ns:c}),q[K]===z&&(q[K]=I[K])}m=q}}else if(T&&G(w)&&Array.isArray(m))m=m.join(w),m&&(m=this.extendTranslation(m,e,s,n));else{let W=!1,q=!1;!this.isValidLookup(m)&&v&&(W=!0,m=k),this.isValidLookup(m)||(q=!0,m=o);const K=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&q?void 0:m,z=v&&k!==m&&this.options.updateMissing;if(q||W||z){if(this.logger.log(z?"updateKey":"missingKey",u,l,o,z?k:m),i){const x=this.resolve(o,{...s,keySeparator:!1});x&&x.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 B=[];const N=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&N&&N[0])for(let x=0;x<N.length;x++)B.push(N[x]);else this.options.saveMissingTo==="all"?B=this.languageUtils.toResolveHierarchy(s.lng||this.language):B.push(s.lng||this.language);const h=(x,O,P)=>{var A;const j=v&&P!==m?P:K;this.options.missingKeyHandler?this.options.missingKeyHandler(x,l,O,j,z,s):(A=this.backendConnector)!=null&&A.saveMissing&&this.backendConnector.saveMissing(x,l,O,j,z,s),this.emit("missingKey",x,l,O,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?B.forEach(x=>{const O=this.pluralResolver.getSuffixes(x,s);C&&s[`defaultValue${this.options.pluralSeparator}zero`]&&O.indexOf(`${this.options.pluralSeparator}zero`)<0&&O.push(`${this.options.pluralSeparator}zero`),O.forEach(P=>{h([x],o+P,s[`defaultValue${P}`]||k)})}):h(B,o,k))}m=this.extendTranslation(m,e,s,p,n),q&&m===o&&this.options.appendNamespaceToMissingKey&&(m=`${l}${f}${o}`),(q||W)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${f}${o}`:o,W?m:void 0,s))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(s),p):m}extendTranslation(e,t,n,s,a){var c,l;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const f=G(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 p=e.match(this.interpolator.nestingRegexp);u=p&&p.length}let d=n.replace&&!G(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 p=e.match(this.interpolator.nestingRegexp),m=p&&p.length;u<m&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...p)=>(a==null?void 0:a[0])===p[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${t[0]}`),null):this.translate(...p,t),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,o=G(i)?[i]:i;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=Pr.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,a,i,o;return G(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&&!G(t.count),p=d&&!t.ordinal&&t.count===0,m=t.context!==void 0&&(G(t.context)||typeof t.context=="number")&&t.context!=="",g=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(b=>{var E,w;this.isValidLookup(n)||(o=b,!ir[`${g[0]}-${b}`]&&((E=this.utils)!=null&&E.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.hasLoadedNamespace(o))&&(ir[`${g[0]}-${b}`]=!0,this.logger.warn(`key "${s}" for languages "${g.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(T=>{var D;if(this.isValidLookup(n))return;i=T;const S=[f];if((D=this.i18nFormat)!=null&&D.addLookupKeys)this.i18nFormat.addLookupKeys(S,f,T,b,t);else{let $;d&&($=this.pluralResolver.getSuffix(T,t.count,t));const C=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(S.push(f+$),t.ordinal&&$.indexOf(k)===0&&S.push(f+$.replace(k,this.options.pluralSeparator)),p&&S.push(f+C)),m){const I=`${f}${this.options.contextSeparator}${t.context}`;S.push(I),d&&(S.push(I+$),t.ordinal&&$.indexOf(k)===0&&S.push(I+$.replace(k,this.options.pluralSeparator)),p&&S.push(I+C))}}let v;for(;v=S.pop();)this.isValidLookup(n)||(a=v,n=this.getResource(T,b,v,t))}))})}),{res:n,usedKey:s,exactUsedKey:a,usedLng:i,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n,s={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!G(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 lr{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ge.create("languageUtils")}getScriptPartFromCode(e){if(e=Ne(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=Ne(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(G(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(n=>{if(t)return;const s=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(n=>{if(t)return;const s=this.getScriptPartFromCode(n);if(this.isSupportedCode(s))return t=s;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return t=a;t=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&(i.indexOf("-")>0&&a.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===a||i.indexOf(a)===0&&a.length>1))return i})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),G(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),s=[],a=i=>{i&&(this.isSupportedCode(i)?s.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return G(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))):G(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const cr={zero:0,one:1,two:2,few:3,many:4,other:5},ur={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class In{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=Ne(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:s});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let i;try{i=new Intl.PluralRules(n,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),ur;if(!e.match(/-|_/))return ur;const c=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(c,t)}return this.pluralRulesCache[a]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(s=>`${t}${s}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((s,a)=>cr[s]-cr[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 fr=(r,e,t,n=".",s=!0)=>{let a=Dn(r,e,t);return!a&&s&&G(t)&&(a=wt(r,t,n),a===void 0&&(a=wt(e,t,n))),a},vt=r=>r.replace(/\$/g,"$$$$");class Nn{constructor(e={}){var t;this.logger=ge.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:a,prefixEscaped:i,suffix:o,suffixEscaped:c,formatSeparator:l,unescapeSuffix:f,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:p,nestingSuffix:m,nestingSuffixEscaped:g,nestingOptionsSeparator:b,maxReplaces:E,alwaysFormat:w}=e.interpolation;this.escape=t!==void 0?t:$n,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Oe(a):i||"{{",this.suffix=o?Oe(o):c||"}}",this.formatSeparator=l||",",this.unescapePrefix=f?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Oe(d):p||Oe("$t("),this.nestingSuffix=m?Oe(m):g||Oe(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=E||1e3,this.alwaysFormat=w!==void 0?w:!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 p;let a,i,o;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=m=>{if(m.indexOf(this.formatSeparator)<0){const w=fr(t,c,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,n,{...s,...t,interpolationkey:m}):w}const g=m.split(this.formatSeparator),b=g.shift().trim(),E=g.join(this.formatSeparator).trim();return this.format(fr(t,c,b,this.options.keySeparator,this.options.ignoreJSONStructure),E,n,{...s,...t,interpolationkey:b})};this.resetRegExp();const f=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,u=((p=s==null?void 0:s.interpolation)==null?void 0:p.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>vt(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?vt(this.escape(m)):vt(m)}].forEach(m=>{for(o=0;a=m.regex.exec(e);){const g=a[1].trim();if(i=l(g),i===void 0)if(typeof f=="function"){const E=f(e,a,s);i=G(E)?E:""}else if(s&&Object.prototype.hasOwnProperty.call(s,g))i="";else if(u){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${e}`),i="";else!G(i)&&!this.useRawValueToEscape&&(i=tr(i));const b=m.safeValue(i);if(e=e.replace(a[0],b),u?(m.regex.lastIndex+=i.length,m.regex.lastIndex-=a[0].length):m.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(c,l)=>{const f=this.nestingOptionsSeparator;if(c.indexOf(f)<0)return c;const u=c.split(new RegExp(`${f}[ ]*{`));let d=`{${u[1]}`;c=u[0],d=this.interpolate(d,i);const p=d.match(/'/g),m=d.match(/"/g);(((p==null?void 0:p.length)??0)%2===0&&!m||m.length%2!==0)&&(d=d.replace(/'/g,'"'));try{i=JSON.parse(d),l&&(i={...l,...i})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,g),`${c}${f}${d}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];i={...n},i=i.replace&&!G(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const f=s[1].split(this.formatSeparator).map(u=>u.trim());s[1]=f.shift(),c=f,l=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!G(a))return a;G(a)||(a=tr(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 Mn=r=>{let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const n=r.split("(");e=n[0].toLowerCase().trim();const s=n[1].substring(0,n[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(i=>{if(i){const[o,...c]=i.split(":"),l=c.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();t[f]||(t[f]=l),l==="false"&&(t[f]=!1),l==="true"&&(t[f]=!0),isNaN(l)||(t[f]=parseInt(l,10))}})}return{formatName:e,formatOptions:t}},dr=r=>{const e={};return(t,n,s)=>{let a=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(a={...a,[s.interpolationkey]:void 0});const i=n+JSON.stringify(a);let o=e[i];return o||(o=r(Ne(n),s),e[i]=o),o(t)}},Fn=r=>(e,t,n)=>r(Ne(t),n)(e);class Vn{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?dr:Fn;this.formats={number:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a});return o=>i.format(o)}),currency:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a,style:"currency"});return o=>i.format(o)}),datetime:n((s,a)=>{const i=new Intl.DateTimeFormat(s,{...a});return o=>i.format(o)}),relativetime:n((s,a)=>{const i=new Intl.RelativeTimeFormat(s,{...a});return o=>i.format(o,a.range||"day")}),list:n((s,a)=>{const i=new Intl.ListFormat(s,{...a});return o=>i.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=dr(t)}format(e,t,n,s={}){const a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(o=>o.indexOf(")")>-1)){const o=a.findIndex(c=>c.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,c)=>{var u;const{formatName:l,formatOptions:f}=Mn(c);if(this.formats[l]){let d=o;try{const p=((u=s==null?void 0:s.formatParams)==null?void 0:u[s.interpolationkey])||{},m=p.locale||p.lng||s.locale||s.lng||n;d=this.formats[l](o,m,{...f,...s,...p})}catch(p){this.logger.warn(p)}return d}else this.logger.warn(`there was no format function for ${l}`);return o},e)}}const Yn=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Un extends lt{constructor(e,t,n,s={}){var a,i;super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=ge.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(i=(a=this.backend)==null?void 0:a.init)==null||i.call(a,n,s.backend,s)}queueLoad(e,t,n,s){const a={},i={},o={},c={};return e.forEach(l=>{let f=!0;t.forEach(u=>{const d=`${l}|${u}`;!n.reload&&this.store.hasResourceBundle(l,u)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?i[d]===void 0&&(i[d]=!0):(this.state[d]=1,f=!1,i[d]===void 0&&(i[d]=!0),a[d]===void 0&&(a[d]=!0),c[u]===void 0&&(c[u]=!0)))}),f||(o[l]=!0)}),(Object.keys(a).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(a),pending:Object.keys(i),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(c)}}loaded(e,t,n){const s=e.split("|"),a=s[0],i=s[1];t&&this.emit("failedLoading",a,i,t),!t&&n&&this.store.addResourceBundle(a,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const o={};this.queue.forEach(c=>{Rn(c.loaded,[a],i),Yn(c,e),t&&c.errors.push(t),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(l=>{o[l]||(o[l]={});const f=c.loaded[l];f.length&&f.forEach(u=>{o[l][u]===void 0&&(o[l][u]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(c=>!c.done)}read(e,t,n,s=0,a=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:a,callback:i});return}this.readingCalls++;const o=(l,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const u=this.waitingReads.shift();this.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}if(l&&f&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,a*2,i)},a);return}i(l,f)},c=this.backend[n].bind(this.backend);if(c.length===2){try{const l=c(e,t);l&&typeof l.then=="function"?l.then(f=>o(null,f)).catch(o):o(null,l)}catch(l){o(l)}return}return c(e,t,o)}prepareLoading(e,t,n={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();G(e)&&(e=this.languageUtils.toResolveHierarchy(e)),G(t)&&(t=[t]);const a=this.queueLoad(e,t,n,s);if(!a.toLoad.length)return a.pending.length||s(),null;a.toLoad.forEach(i=>{this.loadOne(i)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),s=n[0],a=n[1];this.read(s,a,"read",void 0,void 0,(i,o)=>{i&&this.logger.warn(`${t}loading namespace ${a} for language ${s} failed`,i),!i&&o&&this.logger.log(`${t}loaded namespace ${a} for language ${s}`,o),this.loaded(e,i,o)})}saveMissing(e,t,n,s,a,i={},o=()=>{}){var c,l,f,u,d;if((l=(c=this.services)==null?void 0:c.utils)!=null&&l.hasLoadedNamespace&&!((u=(f=this.services)==null?void 0:f.utils)!=null&&u.hasLoadedNamespace(t))){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((d=this.backend)!=null&&d.create){const p={...i,isUpdate:a},m=this.backend.create.bind(this.backend);if(m.length<6)try{let g;m.length===5?g=m(e,t,n,s,p):g=m(e,t,n,s),g&&typeof g.then=="function"?g.then(b=>o(null,b)).catch(o):o(null,g)}catch(g){o(g)}else m(e,t,n,s,o,p)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const pr=()=>({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]),G(r[1])&&(e.defaultValue=r[1]),G(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}),hr=r=>{var e,t;return G(r.ns)&&(r.ns=[r.ns]),G(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),G(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},ze=()=>{},Wn=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class Me extends lt{constructor(e={},t){if(super(),this.options=hr(e),this.services={},this.logger=ge,this.modules={external:[]},Wn(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&&(G(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=pr();this.options={...n,...this.options,...hr(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=Vn;const f=new lr(this.options);this.store=new ar(this.options.resources,this.options);const u=this.services;u.logger=ge,u.resourceStore=this.store,u.languageUtils=f,u.pluralResolver=new In(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 Nn(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Un(s(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(d,...p)=>{this.emit(d,...p)}),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 st(this.services,this.options),this.translator.on("*",(d,...p)=>{this.emit(d,...p)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=ze),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(l=>{this[l]=(...f)=>this.store[l](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...f)=>(this.store[l](...f),this)});const o=Ce(),c=()=>{const l=(f,u)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(u),t(f,u)};if(this.languages&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),o}loadResources(e,t=ze){var a,i;let n=t;const s=G(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const o=[],c=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};s?c(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>c(f)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,l=>c(l)),this.services.backendConnector.load(o,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(l)})}else n(null)}reloadResources(e,t,n){const s=Ce();return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=ze),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"&&Pr.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Ce();this.emit("languageChanging",e);const s=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},a=(o,c)=>{c?this.isLanguageChangingTo===e&&(s(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,n.resolve((...l)=>this.t(...l)),t&&t(o,(...l)=>this.t(...l))},i=o=>{var f,u;!e&&!o&&this.services.languageDetector&&(o=[]);const c=G(o)?o:o&&o[0],l=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(G(o)?[o]:o);l&&(this.language||s(l),this.translator.language||this.translator.changeLanguage(l),(u=(f=this.services.languageDetector)==null?void 0:f.cacheUserLanguage)==null||u.call(f,l)),this.loadResources(l,d=>{a(d,l)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?i(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e),n}getFixedT(e,t,n){const s=(a,i,...o)=>{let c;typeof i!="object"?c=this.options.overloadTranslationOptionHandler([a,i].concat(o)):c={...i},c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||n||s.keyPrefix);const l=this.options.keySeparator||".";let f;return c.keyPrefix&&Array.isArray(a)?f=a.map(u=>`${c.keyPrefix}${l}${u}`):f=c.keyPrefix?`${c.keyPrefix}${l}${a}`:a,this.t(f,c)};return G(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}t(...e){var t;return(t=this.translator)==null?void 0:t.translate(...e)}exists(...e){var t;return(t=this.translator)==null?void 0:t.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const i=(o,c)=>{const l=this.services.backendConnector.state[`${o}|${c}`];return l===-1||l===0||l===2};if(t.precheck){const o=t.precheck(this,i);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!s||i(a,e)))}loadNamespaces(e,t){const n=Ce();return this.options.ns?(G(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Ce();G(e)&&(e=[e]);const s=this.options.preload||[],a=e.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return a.length?(this.options.preload=s.concat(a),this.loadResources(i=>{n.resolve(),t&&t(i)}),n):(t&&t(),Promise.resolve())}dir(e){var s,a;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new lr(pr());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new Me(e,t)}cloneInstance(e={},t=ze){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new Me(s);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(o=>{a[o]=this[o]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const o=Object.keys(this.store.data).reduce((c,l)=>(c[l]={...this.store.data[l]},c[l]=Object.keys(c[l]).reduce((f,u)=>(f[u]={...c[l][u]},f),c[l]),c),{});a.store=new ar(o,s),a.services.resourceStore=a.store}return a.translator=new st(a.services,s),a.translator.on("*",(o,...c)=>{a.emit(o,...c)}),a.init(s,t),a.translator.options=s,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ae=Me.createInstance();ae.createInstance=Me.createInstance;ae.createInstance;ae.dir;ae.init;ae.loadResources;ae.reloadResources;ae.use;ae.changeLanguage;ae.getFixedT;ae.t;ae.exists;ae.setDefaultNamespace;ae.hasLoadedNamespace;ae.loadNamespaces;ae.loadLanguages;const Bn={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"},Hn={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},Gn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando",CheckObjectWrongValidation:"Oggetto non valido"},qn={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:Bn,Month:Hn,Generic:Gn},Kn={Friday:"Friday",FridayShort:"Fri",Monday:"Monday",MondayShort:"Mon",Saturday:"Saturday",SaturdayShort:"Sat",Sunday:"Sunday",SundayShort:"Sun",Tuesday:"Tuesday",TuesdayShort:"Tue",Thursday:"Thursday",ThursdayShort:"Thu",Wednesday:"Wednesday",WednesdayShort:"Wed"},zn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},Jn={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command",CheckObjectWrongValidation:"Object not valid"},Xn={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:Kn,Month:zn,Generic:Jn};function mr(r,e){return new RegExp(Zn(r),e)}function Zn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qn(r,e,t,n){let s=e;const a=es(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=ts(s);return new Intl.NumberFormat(n,i).format(a)}function es(r,e,t,n,s){let a=r;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const c=o=="."?",":".";a=a.replace(mr(c,"g"),""),a=a.replace(mr(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function ts(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}ae.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 Qn(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:Xn},it:{translation:qn}}});const rs=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),ns=(r,e)=>ae.t(r,e);function Fe(){const r=R.useCallback((n,s,a,i)=>rs(n,s,a||void 0,i),[]),e=R.useCallback(()=>ae.languages[0],[]),t=R.useCallback((n,s)=>ns(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var ct=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r.CHECK_OBJECT_WRONG_VALIDATION="Generic.CheckObjectWrongValidation",r))(ct||{}),le=(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))(le||{}),ue=(r=>(r.JANUARY="Month.January",r.FEBRUARY="Month.February",r.MARCH="Month.March",r.APRIL="Month.April",r.MAY="Month.May",r.JUNE="Month.June",r.JULY="Month.July",r.AUGUST="Month.August",r.SEPTEMBER="Month.September",r.OCTOBER="Month.October",r.NOVEMBER="Month.November",r.DECEMBER="Month.December",r))(ue||{}),Et=(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))(Et||{});const ss={"smp-datepickercalendar-position":"_smp-datepickercalendar-position_19hwj_1"};function as({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=Fe(),i=()=>{if(!n)return;const N=new Date(n);return isNaN(N.getTime())?void 0:N},[o]=R.useState(new Date),[c,l]=R.useState(r||i()||new Date),[f,u]=R.useState(c?c.getMonth():new Date().getMonth()),[d,p]=R.useState(c?c.getFullYear():new Date().getFullYear()),[m,g]=R.useState(c?c.getDate():null),b=R.useRef(null),E=R.useRef([]),w=[a(ue.JANUARY),a(ue.FEBRUARY),a(ue.MARCH),a(ue.APRIL),a(ue.MAY),a(ue.JUNE),a(ue.JULY),a(ue.AUGUST),a(ue.SEPTEMBER),a(ue.OCTOBER),a(ue.NOVEMBER),a(ue.DECEMBER)],T=[{value:a(le.SUNDAY_SHORT),full:a(le.SUNDAY)},{value:a(le.MONDAY_SHORT),full:a(le.MONDAY)},{value:a(le.TUESDAY_SHORT),full:a(le.TUESDAY)},{value:a(le.WEDNESDAY_SHORT),full:a(le.WEDNESDAY)},{value:a(le.THURSDAY_SHORT),full:a(le.THURSDAY)},{value:a(le.FRIDAY_SHORT),full:a(le.FRIDAY)},{value:a(le.SATURDAY_SHORT),full:a(le.SATURDAY)}],S=N=>t.some(h=>{const x=h.start.getTime(),O=h.end.getTime(),P=N.getTime();return P>=x&&P<=O}),v=N=>{S(N)||(l(N),g(N.getDate()),e&&e(Xr(N)))},D=()=>{f===0?(u(11),p(d-1)):u(f-1),g(1)},$=()=>{f===11?(u(0),p(d+1)):u(f+1),g(1)},C=(N,h)=>new Date(N,h+1,0).getDate(),k=(N,h)=>new Date(N,h,1).getDay(),I=N=>{var x;const h=q.findIndex(O=>O!==null&&O.getDate()===N);h!==-1&&E.current[h]&&((x=E.current[h])==null||x.focus(),g(N))},_=(N,h)=>{const x=q[h];if(!x)return;const O=C(d,f),P=x.getDate();switch(N.key){case"ArrowRight":N.preventDefault();{let j=P+1,A=new Date(d,f,j);if(j>O){const V=f===11?d+1:d,Y=f===11?0:f+1;j=1,A=new Date(V,Y,j),$(),setTimeout(()=>{F(1,"forward")},0);return}S(A)?F(j,"forward"):I(j)}break;case"Tab":break;case"ArrowLeft":N.preventDefault();{let j=P-1,A=new Date(d,f,j);if(j<1){const V=f===0?d-1:d,Y=f===0?11:f-1,M=C(V,Y);j=M,A=new Date(V,Y,j),D(),setTimeout(()=>{F(M,"backward")},0);return}S(A)?F(j,"backward"):I(j)}break;case"ArrowUp":N.preventDefault();{let j=P-7,A=new Date(d,f,j);if(j<1){const V=f===0?d-1:d,Y=f===0?11:f-1;j=C(V,Y)+j,A=new Date(V,Y,j),D(),setTimeout(()=>{F(j,"backward")},0);return}S(A)?F(j,"backward"):I(j)}break;case"ArrowDown":N.preventDefault();{let j=P+7,A=new Date(d,f,j);if(j>O){const V=f===11?d+1:d,Y=f===11?0:f+1;j=j-O,A=new Date(V,Y,j),$(),setTimeout(()=>{F(j,"forward")},0);return}S(A)?F(j,"forward"):I(j)}break;case"Home":N.preventDefault(),F(1,"forward");break;case"End":N.preventDefault(),F(O,"backward");break;case"PageUp":N.preventDefault(),D(),setTimeout(()=>{const j=C(f===0?d-1:d,f===0?11:f-1),A=Math.min(P,j);F(A,"forward")},0);break;case"PageDown":N.preventDefault(),$(),setTimeout(()=>{const j=C(f===11?d+1:d,f===11?0:f+1),A=Math.min(P,j);F(A,"forward")},0);break;case" ":case"Space":if(S(x))return;g(x.getDate()),l(x);break;case"Enter":N.preventDefault(),v(x);break}},F=(N,h)=>{const x=C(d,f);if(h==="forward"){for(let O=N;O<=x;O++){const P=new Date(d,f,O);if(!S(P)){I(O);return}}$(),setTimeout(()=>{F(1,"forward")},0)}else{for(let A=N;A>=1;A--){const V=new Date(d,f,A);if(!S(V)){I(A);return}}const O=f===0?d-1:d,P=f===0?11:f-1,j=C(O,P);D(),setTimeout(()=>{F(j,"backward")},0)}},q=(()=>{const N=C(d,f),h=k(d,f),x=[];for(let O=0;O<h;O++)x.push(null);for(let O=1;O<=N;O++){const P=new Date(d,f,O);x.push(P)}return x})(),Z=[];let K=[];q.forEach((N,h)=>{if(K.push(N),K.length===7||h===q.length-1){for(;K.length<7;)K.push(null);Z.push(K),K=[]}}),R.useEffect(()=>{var N;if(m!==null){const h=q.findIndex(x=>x!==null&&x.getDate()===m);h!==-1&&E.current[h]&&((N=E.current[h])==null||N.focus())}},[f,d,m,q]);const z={label:"smp-datepickercalendar-label",wrapper:`smp-datepickercalendar ${ss["smp-datepickercalendar-position"]}`,calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(N,h,x,O)=>`smp-datepickercalendar-td
|
|
46
|
-
${
|
|
47
|
-
${
|
|
44
|
+
*/var pt,Gt;function pn(){if(Gt)return pt;Gt=1;var r=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var i={},o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var c=Object.getOwnPropertyNames(i).map(function(f){return i[f]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(f){l[f]=f}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return pt=s()?Object.assign:function(a,i){for(var o,c=n(a),l,f=1;f<arguments.length;f++){o=Object(arguments[f]);for(var u in o)e.call(o,u)&&(c[u]=o[u]);if(r){l=r(o);for(var d=0;d<l.length;d++)t.call(o,l[d])&&(c[l[d]]=o[l[d]])}}return c},pt}var ht,Kt;function jt(){if(Kt)return ht;Kt=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ht=r,ht}var mt,qt;function Rr(){return qt||(qt=1,mt=Function.call.bind(Object.prototype.hasOwnProperty)),mt}var gt,zt;function hn(){if(zt)return gt;zt=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=jt(),t={},n=Rr();r=function(a){var i="Warning: "+a;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(a,i,o,c,l){if(process.env.NODE_ENV!=="production"){for(var f in a)if(n(a,f)){var u;try{if(typeof a[f]!="function"){var d=Error((c||"React class")+": "+o+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}u=a[f](i,f,c,o,null,e)}catch(h){u=h}if(u&&!(u instanceof Error)&&r((c||"React class")+": type specification of "+o+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in t)){t[u.message]=!0;var m=l?l():"";r("Failed "+o+" type: "+u.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},gt=s,gt}var yt,Jt;function mn(){if(Jt)return yt;Jt=1;var r=Or(),e=pn(),t=jt(),n=Rr(),s=hn(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(o){var c="Warning: "+o;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return yt=function(o,c){var l=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function u(p){var x=p&&(l&&p[l]||p[f]);if(typeof x=="function")return x}var d="<<anonymous>>",m={array:S("array"),bigint:S("bigint"),bool:S("boolean"),func:S("function"),number:S("number"),object:S("object"),string:S("string"),symbol:S("symbol"),any:w(),arrayOf:D,element:O(),elementType:g(),instanceOf:E,node:I(),objectOf:C,oneOf:$,oneOfType:P,shape:k,exact:R};function h(p,x){return p===x?p!==0||1/p===1/x:p!==p&&x!==x}function v(p,x){this.message=p,this.data=x&&typeof x=="object"?x:{},this.stack=""}v.prototype=Error.prototype;function b(p){if(process.env.NODE_ENV!=="production")var x={},j=0;function A(L,Y,U,V,J,K,se){if(V=V||d,K=K||U,se!==t){if(c){var N=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 N.name="Invariant Violation",N}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var W=V+":"+U;!x[W]&&j<3&&(a("You are manually calling a React.PropTypes validation function for the `"+K+"` prop on `"+V+"`. 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."),x[W]=!0,j++)}}return Y[U]==null?L?Y[U]===null?new v("The "+J+" `"+K+"` is marked as required "+("in `"+V+"`, but its value is `null`.")):new v("The "+J+" `"+K+"` is marked as required in "+("`"+V+"`, but its value is `undefined`.")):null:p(Y,U,V,J,K)}var _=A.bind(null,!1);return _.isRequired=A.bind(null,!0),_}function S(p){function x(j,A,_,L,Y,U){var V=j[A],J=G(V);if(J!==p){var K=z(V);return new v("Invalid "+L+" `"+Y+"` of type "+("`"+K+"` supplied to `"+_+"`, expected ")+("`"+p+"`."),{expectedType:p})}return null}return b(x)}function w(){return b(i)}function D(p){function x(j,A,_,L,Y){if(typeof p!="function")return new v("Property `"+Y+"` of component `"+_+"` has invalid PropType notation inside arrayOf.");var U=j[A];if(!Array.isArray(U)){var V=G(U);return new v("Invalid "+L+" `"+Y+"` of type "+("`"+V+"` supplied to `"+_+"`, expected an array."))}for(var J=0;J<U.length;J++){var K=p(U,J,_,L,Y+"["+J+"]",t);if(K instanceof Error)return K}return null}return b(x)}function O(){function p(x,j,A,_,L){var Y=x[j];if(!o(Y)){var U=G(Y);return new v("Invalid "+_+" `"+L+"` of type "+("`"+U+"` supplied to `"+A+"`, expected a single ReactElement."))}return null}return b(p)}function g(){function p(x,j,A,_,L){var Y=x[j];if(!r.isValidElementType(Y)){var U=G(Y);return new v("Invalid "+_+" `"+L+"` of type "+("`"+U+"` supplied to `"+A+"`, expected a single ReactElement type."))}return null}return b(p)}function E(p){function x(j,A,_,L,Y){if(!(j[A]instanceof p)){var U=p.name||d,V=M(j[A]);return new v("Invalid "+L+" `"+Y+"` of type "+("`"+V+"` supplied to `"+_+"`, expected ")+("instance of `"+U+"`."))}return null}return b(x)}function $(p){if(!Array.isArray(p))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),i;function x(j,A,_,L,Y){for(var U=j[A],V=0;V<p.length;V++)if(h(U,p[V]))return null;var J=JSON.stringify(p,function(se,N){var W=z(N);return W==="symbol"?String(N):N});return new v("Invalid "+L+" `"+Y+"` of value `"+String(U)+"` "+("supplied to `"+_+"`, expected one of "+J+"."))}return b(x)}function C(p){function x(j,A,_,L,Y){if(typeof p!="function")return new v("Property `"+Y+"` of component `"+_+"` has invalid PropType notation inside objectOf.");var U=j[A],V=G(U);if(V!=="object")return new v("Invalid "+L+" `"+Y+"` of type "+("`"+V+"` supplied to `"+_+"`, expected an object."));for(var J in U)if(n(U,J)){var K=p(U,J,_,L,Y+"."+J,t);if(K instanceof Error)return K}return null}return b(x)}function P(p){if(!Array.isArray(p))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var x=0;x<p.length;x++){var j=p[x];if(typeof j!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Z(j)+" at index "+x+"."),i}function A(_,L,Y,U,V){for(var J=[],K=0;K<p.length;K++){var se=p[K],N=se(_,L,Y,U,V,t);if(N==null)return null;N.data&&n(N.data,"expectedType")&&J.push(N.data.expectedType)}var W=J.length>0?", expected one of type ["+J.join(", ")+"]":"";return new v("Invalid "+U+" `"+V+"` supplied to "+("`"+Y+"`"+W+"."))}return b(A)}function I(){function p(x,j,A,_,L){return F(x[j])?null:new v("Invalid "+_+" `"+L+"` supplied to "+("`"+A+"`, expected a ReactNode."))}return b(p)}function B(p,x,j,A,_){return new v((p||"React class")+": "+x+" type `"+j+"."+A+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+_+"`.")}function k(p){function x(j,A,_,L,Y){var U=j[A],V=G(U);if(V!=="object")return new v("Invalid "+L+" `"+Y+"` of type `"+V+"` "+("supplied to `"+_+"`, expected `object`."));for(var J in p){var K=p[J];if(typeof K!="function")return B(_,L,Y,J,z(K));var se=K(U,J,_,L,Y+"."+J,t);if(se)return se}return null}return b(x)}function R(p){function x(j,A,_,L,Y){var U=j[A],V=G(U);if(V!=="object")return new v("Invalid "+L+" `"+Y+"` of type `"+V+"` "+("supplied to `"+_+"`, expected `object`."));var J=e({},j[A],p);for(var K in J){var se=p[K];if(n(p,K)&&typeof se!="function")return B(_,L,Y,K,z(se));if(!se)return new v("Invalid "+L+" `"+Y+"` key `"+K+"` supplied to `"+_+"`.\nBad object: "+JSON.stringify(j[A],null," ")+`
|
|
45
|
+
Valid keys: `+JSON.stringify(Object.keys(p),null," "));var N=se(U,K,_,L,Y+"."+K,t);if(N)return N}return null}return b(x)}function F(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(F);if(p===null||o(p))return!0;var x=u(p);if(x){var j=x.call(p),A;if(x!==p.entries){for(;!(A=j.next()).done;)if(!F(A.value))return!1}else for(;!(A=j.next()).done;){var _=A.value;if(_&&!F(_[1]))return!1}}else return!1;return!0;default:return!1}}function H(p,x){return p==="symbol"?!0:x?x["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&x instanceof Symbol:!1}function G(p){var x=typeof p;return Array.isArray(p)?"array":p instanceof RegExp?"object":H(x,p)?"symbol":x}function z(p){if(typeof p>"u"||p===null)return""+p;var x=G(p);if(x==="object"){if(p instanceof Date)return"date";if(p instanceof RegExp)return"regexp"}return x}function Z(p){var x=z(p);switch(x){case"array":case"object":return"an "+x;case"boolean":case"date":case"regexp":return"a "+x;default:return x}}function M(p){return!p.constructor||!p.constructor.name?d:p.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},yt}var vt,Xt;function gn(){if(Xt)return vt;Xt=1;var r=jt();function e(){}function t(){}return t.resetWarningCache=e,vt=function(){function n(i,o,c,l,f,u){if(u!==r){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}n.isRequired=n;function s(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:e};return a.PropTypes=a,a},vt}var Zt;function yn(){if(Zt)return He.exports;if(Zt=1,process.env.NODE_ENV!=="production"){var r=Or(),e=!0;He.exports=mn()(r.isElement,e)}else He.exports=gn()();return He.exports}var ie=yn(),vn=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},bn=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},xn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Ke="http://www.w3.org/2000/svg",Qt="http://www.w3.org/1999/xlink",De=function(r){function e(){for(var n,s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return n=r.call.apply(r,[this].concat(a))||this,n.initialState={hasError:!1,isLoading:!0},n.state=n.initialState,n._isMounted=!1,n.reactWrapper=void 0,n.nonReactWrapper=void 0,n.refCallback=function(o){n.reactWrapper=o},n}en(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof vn(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,c=a.httpRequestWithCredentials,l=a.renumerateIRIElements,f=a.src,u=a.title,d=a.useRequestCache,m=this.props.onError,h=this.props.beforeInjection,v=this.props.afterInjection,b=this.props.wrapper,S,w;b==="svg"?(S=document.createElementNS(Ke,b),S.setAttribute("xmlns",Ke),S.setAttribute("xmlns:xlink",Qt),w=document.createElementNS(Ke,b)):(S=document.createElement(b),w=document.createElement(b)),S.appendChild(w),w.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(S);var D=function($){if(s.removeSVG(),!s._isMounted){m($);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){m($)})},O=function($,C){if($){D($);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{v(C)}catch(P){D(P)}})},g=function($){if($.setAttribute("role","img"),i){var C=$.querySelector(":scope > desc");C&&$.removeChild(C);var P=document.createElement("desc");P.innerHTML=i,$.prepend(P)}if(u){var I=$.querySelector(":scope > title");I&&$.removeChild(I);var B=document.createElement("title");B.innerHTML=u,$.prepend(B)}try{h($)}catch(k){D(k)}};un(w,{afterEach:O,beforeEach:g,cacheRequests:d,evalScripts:o,httpRequestWithCredentials:c,renumerateIRIElements:l})}},t.removeSVG=function(){var s;(s=this.nonReactWrapper)!=null&&s.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},t.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},t.componentDidUpdate=function(s){var a=this;bn(tt({},s),this.props)&&this.setState(function(){return a.initialState},function(){a.removeSVG(),a.renderSVG()})},t.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},t.render=function(){var s=this.props;s.afterInjection,s.beforeInjection,s.desc,s.evalScripts;var a=s.fallback;s.httpRequestWithCredentials;var i=s.loading;s.renumerateIRIElements,s.src,s.title,s.useRequestCache;var o=s.wrapper,c=Qr(s,xn),l=o;return Ye.createElement(l,tt({},c,{ref:this.refCallback},o==="svg"?{xmlns:Ke,xmlnsXlink:Qt}:{}),this.state.isLoading&&i&&Ye.createElement(i,null),this.state.hasError&&a&&Ye.createElement(a,null))},e}(Ye.Component);De.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};De.propTypes={afterInjection:ie.func,beforeInjection:ie.func,desc:ie.string,evalScripts:ie.oneOf(["always","once","never"]),fallback:ie.oneOfType([ie.func,ie.object,ie.string]),httpRequestWithCredentials:ie.bool,loading:ie.oneOfType([ie.func,ie.object,ie.string]),onError:ie.func,renumerateIRIElements:ie.bool,src:ie.string.isRequired,title:ie.string,useRequestCache:ie.bool,wrapper:ie.oneOf(["div","span","svg"])};let wt={assets:"/"};const Sn=r=>{wt={...wt,...r}},er=r=>`${wt.assets}/${r}`.replace(/\/+/g,"/"),oe=T.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:c,isInteractable:l=!1,spin:f=!1,title:u,tabIndex:d})=>{const[m,h]=T.useState(r),v=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),b=v&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),S=er(`assets/svg/${r}.svg`),w=er(`assets/svg/${n}.svg`),D={img:`${l?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${l?"smp-icon-interactable":""} ${f?"smp-icon-spin":""}`},O=()=>{!a&&l&&c&&c()},g=E=>{!a&&l&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),O())};return y.jsx(y.Fragment,{children:b?y.jsx(De,{src:r,fallback:()=>y.jsx(De,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:D.svg,onClick:O,onKeyDown:g,tabIndex:d}):v?y.jsx("img",{src:m,width:e||"16px",height:t||"auto",alt:u,onError:()=>h(w),onClick:O,className:D.img,title:u,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&O()}}):y.jsx(De,{src:S,fallback:()=>y.jsx(De,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:D.svg,onClick:O,onKeyDown:g,tabIndex:d})})}),me={"smp-textfield-wrapper":"_smp-textfield-wrapper_mmttf_4","smp-textfield":"_smp-textfield_mmttf_4","smp-textfield-extraSmall":"_smp-textfield-extraSmall_mmttf_30","smp-textfield-small":"_smp-textfield-small_mmttf_35","smp-textfield-medium":"_smp-textfield-medium_mmttf_40","smp-textfield-large":"_smp-textfield-large_mmttf_45","smp-textfield-extraLarge":"_smp-textfield-extraLarge_mmttf_50","smp-textfield-input":"_smp-textfield-input_mmttf_56","smp-textfield-outlined":"_smp-textfield-outlined_mmttf_79","smp-textfield-danger":"_smp-textfield-danger_mmttf_90","smp-textfield-readOnly":"_smp-textfield-readOnly_mmttf_94","smp-textfield-variant-notSelectable":"_smp-textfield-variant-notSelectable_mmttf_99","smp-textfield-disabled":"_smp-textfield-disabled_mmttf_109","smp-textfield-fullWidth":"_smp-textfield-fullWidth_mmttf_118"},xe=({disabled:r,bindValue:e,icon:t,onBlur:n,onChange:s,placeholder:a,isEditable:i=!0,shapeIcon:o,sizing:c,state:l,variant:f,rotatedShapeIcon:u=!1,onShapeIconClick:d,ref:m,inputRef:h,onKeyDown:v,inputType:b="text",ariaLabel:S="input field",label:w,helperText:D=!1,error:O,appearance:g="base",fullWidth:E=!1,_dataComponent:$="textfield",min:C,max:P,step:I,inputMode:B="text",width:k})=>{const R=T.useId(),F=`${R}-helper`,H=O?"danger":l,G=O||l=="danger"?"error":o,z=D||!!O,Z=x=>{s==null||s(x.target.value)},M={wrapper:`${me["smp-textfield-wrapper"]} ${E?me["smp-textfield-fullWidth"]:""}`,container:`${me["smp-textfield"]} ${r?me["smp-textfield-disabled"]:""} ${a?me["smp-textfield-placeholder"]:""} ${c?me[`smp-textfield-${c}`]:""} ${H?me[`smp-textfield-${H}`]:""} ${g?me[`smp-textfield-${g}`]:""} ${i?"":me["smp-textfield-readOnly"]}`,input:`${me["smp-textfield-input"]}`};if(f&&(f!=="notSelectable"||i)){const x=me[`smp-textfield-variant-${f}`];x&&(M.container+=` ${x}`)}const p=k?{"--smp-textField-width-base":k}:void 0;return y.jsxs("div",{className:M.wrapper,"data-component":$,children:[w&&y.jsx($e,{label:w,disabled:r,htmlFor:R}),y.jsxs("div",{className:M.container,ref:m,style:p,children:[t&&y.jsx(oe,{icon:t,disabled:r}),y.jsx("input",{id:R,type:b,value:e,placeholder:a,onChange:Z,onBlur:n,className:M.input,disabled:r,readOnly:!i,onKeyDown:v,"aria-label":S,ref:h,"aria-describedby":z?F:void 0,min:C,max:P,step:I,inputMode:B}),G&&y.jsx(oe,{icon:G,disabled:r,state:H,onClick:d,rotated:u,isInteractable:i,tabIndex:0})]}),z&&y.jsx(wr,{helperText:O,disabled:r,state:H,id:F})]})};function jr({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=T.useState(0),i=T.useRef(null),o=r.length*e,c=Math.max(0,Math.floor(s/e)-n),l=Math.min(r.length-1,Math.floor((s+t)/e)+n),f=[];for(let m=c;m<=l;m++)f.push({item:r[m],index:m,offsetTop:m*e});const u=T.useCallback(m=>{const h=m.target.scrollTop;a(h)},[]),d=m=>{if(!i.current)return;const h=m*e,v=h+e,b=i.current,S=b.scrollTop,w=S+t;h<S?b.scrollTop=h:v>w&&(b.scrollTop=v-t)};return{virtualItems:f,containerProps:{ref:i,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:u},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:o,startIndex:c,endIndex:l},scrollToIndex:d}}const qe={"smp-list":"_smp-list_t8eqj_1","smp-list-container":"_smp-list-container_t8eqj_10","smp-list-listItem":"_smp-list-listItem_t8eqj_15"},wn=10,Dr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:c,onKeyDown:l,isOpen:f})=>{var k;const[u,d]=T.useState(""),m=24,[h,v]=T.useState(a!==null?a:-1),b=s!==void 0?s:e.length>wn,S=u?e.filter(R=>R.label.toLowerCase().includes(u.toLowerCase())):e,w=R=>{d(R)},{virtualItems:D,containerProps:O,innerProps:g,scrollToIndex:E}=jr({items:S,itemHeight:m,containerHeight:200,overscan:5});T.useEffect(()=>{a!==null&&a!==h&&v(a)},[a]),T.useEffect(()=>{h>=0&&h<S.length&&E(h)},[h,S]);const $=R=>{if(R.key==="ArrowDown"||R.key==="ArrowUp"){R.preventDefault();let F=h;R.key==="ArrowDown"?F=h<S.length-1?h+1:0:R.key==="ArrowUp"&&(F=h>0?h-1:S.length-1),v(F)}else R.key==="Enter"?h>=0&&h<S.length&&(c==null||c(S[h])):R.key==="Escape"&&(R.preventDefault(),R.stopPropagation());l&&l(R)},C=R=>{$(R)},P=R=>{$(R)},I={wrapper:`${qe["smp-list"]}`,container:`${qe["smp-list-container"]}`,virtualScroll:`${qe["smp-list-virtualScroll"]}`,listItem:`${qe["smp-list-listItem"]}`},B=T.useRef(null);return T.useEffect(()=>{f&&(B!=null&&B.current)&&B.current.focus()},[f,B]),y.jsxs("div",{id:r,ref:n,className:I.wrapper,"data-component":"list",style:{width:o},children:[b&&y.jsx(xe,{bindValue:u,placeholder:"Search...",onChange:w,onKeyDown:C,inputRef:B}),y.jsx("div",{...O,className:I.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:P,"aria-activedescendant":h>=0&&h<S.length?(k=S[h])==null?void 0:k.id:void 0,children:y.jsx("div",{...g,className:I.virtualScroll,children:D.map(({item:R,index:F,offsetTop:H})=>{const G=i.includes(R.id);return y.jsxs("li",{role:"option",id:R.id,"aria-selected":h===F?"true":"false",tabIndex:-1,className:`${I.listItem} ${h===F?"selected-item":""}`,"aria-label":R.id+"-"+R.label,style:{height:`${m}px`,lineHeight:`calc(${m}px - 2*2px)`,transform:`translateY(${H}px)`},onClick:()=>{c==null||c(R),v(F)},children:[Ie(R.id,R.label,t),G&&y.jsx(oe,{icon:"check",width:16})]},R.id)})})})]})},Dt=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=T.useState(Ie(e,t,r));return T.useEffect(()=>{a(e)},[e]),T.useEffect(()=>{a(Ie(e,t,r))},[t,r]),y.jsx(xe,{...n,bindValue:s})},En=r=>{const e=T.useRef(null);return T.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}};function lt({children:r}){const[e,t]=T.useState(!1);return T.useEffect(()=>{t(!0)},[]),e?Vr.createPortal(r,document.body):null}const _t=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,isEditable:i=!0,placeholder:o,fun:c,_changeOnEnter:l=!1,onChange:f,onOptionsRequest:u,_multiActiveIndex:d,...m})=>{const h=T.useRef(null),[v,b]=T.useState(r),[S,w]=T.useState(e),[D,O]=T.useState(!1),[g,E]=T.useState(t||[]),[$,C]=T.useState(0),[P,I]=T.useState([r]),{anchorRef:B,targetRef:k,anchorWidth:R}=ot({position:"bottom",enabled:D}),F=T.useCallback(()=>{var p;O(!1),(p=h==null?void 0:h.current)==null||p.focus()},[]);_e(k,()=>F());const H=En(400),G=p=>{p.length>=a?c&&u&&H(async()=>{const x=await u(c,p);E(x),C(x.length>0?0:-1),O(!0)}):F(),b(p),w(e),l||f==null||f(p,e)},z=p=>{l?(b(""),w("")):(b(p.id),w(p.label)),f==null||f(p.id,p.label);const x=g.findIndex(j=>j.id===p.id);C(x),I([p.id]),F()},Z=p=>{p.key==="Escape"&&(F(),C(-1))},M=p=>{if((p.key==="ArrowDown"||p.key==="ArrowUp")&&(p.preventDefault(),D)){const x=p.key==="ArrowDown"?($+1)%g.length:($-1+g.length)%g.length;C(x)}switch(p.key){case"Enter":$>=0&&$<g.length?z(g[$]):l&&(f==null||f(v,""),F(),b(""),w(""));break;case"Escape":F(),C(-1);break}};return y.jsxs("div",{"data-component":"autocomplete",children:[y.jsx(Dt,{...m,bindValue:v,optionalDisplayValue:S,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:o,ref:B,inputRef:h,onChange:G,onKeyDown:M,"aria-autocomplete":"list"}),D&&y.jsx(lt,{children:y.jsx(Dr,{options:g,displayMode:s,onClick:z,ref:k,selectedIndex:$,activeIndex:d||P,width:R,showFilter:!1,onKeyDown:Z,isOpen:D})})]})},tr=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],rr=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],we=({label:r,bindValue:e,onClick:t,ariaLabel:n,icon:s,disabled:a,sizing:i="base",variant:o="primary",appearance:c="raised",showIcon:l=!0,showText:f=!0,fullWidth:u=!1,loading:d=!1,justify:m="center",title:h,optionalDisplayValue:v})=>{const b={container:`smp-button smp-button-container ${i?`smp-button-${i}`:""} ${o?`smp-buttonVariant-${o}`:""} ${c?`smp-buttonType-${c}`:""} ${u?"smp-button-fullWidth":""} smp-justifyContent-${m}`};return y.jsx("button",{"data-component":"button",className:b.container,onClick:t,"aria-label":n,disabled:a,"aria-busy":d,title:h||r||v,children:d?y.jsx(oe,{icon:"spinner",state:rr(o),spin:!0}):y.jsxs(y.Fragment,{children:[s&&l&&y.jsx(oe,{icon:s,disabled:a,state:rr(o),width:tr(i),height:tr(i)}),f&&y.jsx("span",{children:v||e})]})})},_r=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:f,justify:u,onClick:d,onOptionsRequest:m})=>{const[h,v]=T.useState(r);T.useEffect(()=>{!h&&m&&e&&m(e,void 0).then(w=>v(w)).catch(w=>{console.error("Errore nel caricamento delle opzioni per ButtonList",w)})},[h,e,m]);const b={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},S=h==null?void 0:h.map((w,D)=>{const O={bindValue:w.id,optionalDisplayValue:w.label,fun:w.fun,icon:w.icon,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:f,sizing:s,justify:u,onClick:()=>{d==null||d(w.id,w.fun)}};return y.jsx(we,{...O},`button-${D}`)});return y.jsx("div",{role:"list","data-component":"button-list",className:b.container,children:S})},Tn={"smp-checkbox-wrapper":"_smp-checkbox-wrapper_z14lq_2"},$r=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i,variant:o="checkbox"})=>{const c=T.useId(),l=u=>{s&&a&&a(u.target.checked)},f={wrapper:`${Tn["smp-checkbox-wrapper"]}`};return y.jsxs("div",{className:f.wrapper,"data-component":e,children:[n&&y.jsx($e,{label:n,disabled:t,htmlFor:c}),y.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:l,onBlur:i,role:o==="switch"?"switch":"checkbox",id:c})]})},On={titleLarge:"h2",title:"h3",body:"h6",label:"label"},Ne=({variant:r="body",bindValue:e,color:t,...n})=>{const s=On[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return y.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},$t=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,c]=T.useState(null),l={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=m=>{n==null||n(r.filter((h,v)=>v!==m))},u=m=>{c(m)},d=m=>{if(o===null||o===m)return;const h=[...r],[v]=h.splice(o,1);h.splice(m,0,v),n==null||n(h),c(null)};return y.jsx("div",{className:l.container,role:"list","data-component":"chip",children:r.flatMap((m,h)=>{const v=Ie(m.bindValue,m.optionalDisplayValue,t),b=y.jsxs("div",{className:l.element,role:"listitem",draggable:i,onDragStart:()=>u(h),onDragOver:w=>i&&w.preventDefault(),onDrop:()=>i&&d(h),style:{"--smp-chips-backgroundColor-base":a},children:[i&&y.jsx(oe,{icon:"drag_indicator_horizontal",isInteractable:!0}),y.jsx(Ne,{variant:"label",bindValue:v,color:s}),e&&y.jsx(oe,{icon:"close",isInteractable:!0,onClick:()=>f(h),color:s})]},`chip-${h}`),S=i&&h<r.length-1?y.jsx(oe,{icon:"chevron-right",color:s},`separator-${h}`):null;return[b,S].filter(Boolean)})})};function Ct(r,e){const t=T.useRef(null);T.useEffect(()=>{if(!r)return;const n=typeof e=="object"&&e!==null&&"current"in e?e.current:null;if(!n)return;t.current=document.activeElement;const s=()=>n?Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(l=>!l.hasAttribute("disabled")&&l.offsetParent!==null):[];(()=>{const l=s();l.length>0&&requestAnimationFrame(()=>l[0].focus())})();const i=l=>{if(l.key==="Escape"||l.key!=="Tab")return;const f=s();if(f.length===0)return;const u=f[0],d=f[f.length-1];l.shiftKey&&document.activeElement===u?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),u.focus())},o=l=>{if(n&&!n.contains(l.target)){l.preventDefault();const f=s();f.length>0&&f[0].focus()}};document.addEventListener("keydown",i),document.addEventListener("mousedown",o);const c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=c,t.current&&requestAnimationFrame(()=>{var l;(l=t.current)==null||l.focus()})}},[r,e])}const Cr=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:c,multiActiveIndex:l,...f})=>{const u=T.useRef(null),[d,m]=T.useState(!1),[h,v]=T.useState(t),[b,S]=T.useState(-1),[w,D]=T.useState([r]),O=T.useId(),{anchorRef:g,targetRef:E,anchorWidth:$}=ot({position:"bottom",enabled:d}),C=T.useCallback(()=>{var R;m(!1),(R=u==null?void 0:u.current)==null||R.focus()},[]);_e(E,()=>C()),Ct(d,E);const P=R=>{e==null||e(R.id,R.label);const F=h.findIndex(H=>H.id===R.id);S(F),D([R.id]),C()},I=R=>{R.key==="Escape"&&(C(),S(-1))},B=R=>{(R.key==="ArrowDown"||R.key==="ArrowUp")&&(R.preventDefault(),k())},k=()=>{o&&c&&c(o,void 0).then(R=>{v(R),S(R.length>0?0:-1),m(!0)})};return y.jsxs("div",{role:"combobox","aria-expanded":d,"aria-controls":O,"aria-owns":O,"data-component":"combobox",children:[y.jsx(Dt,{...f,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:k,onKeyDown:B,shapeIcon:"arrow_drop_down",rotatedShapeIcon:d,isEditable:s,ref:g,inputRef:u,"aria-autocomplete":"list",variant:"notSelectable"}),d&&y.jsx(lt,{children:y.jsx(Dr,{id:O,options:h,displayMode:i,ref:E,isOpen:d,selectedIndex:b,activeIndex:l||w,width:$,onClick:P,onKeyDown:I})})]})},q=r=>typeof r=="string",Ae=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},nr=r=>r==null?"":""+r,Rn=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},jn=/###/g,sr=r=>r&&r.indexOf("###")>-1?r.replace(jn,"."):r,ar=r=>!r||q(r),Le=(r,e,t)=>{const n=q(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(ar(r))return{};const a=sr(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return ar(r)?{}:{obj:r,k:sr(n[s])}},ir=(r,e,t)=>{const{obj:n,k:s}=Le(r,e,Object);if(n!==void 0||e.length===1){n[s]=t;return}let a=e[e.length-1],i=e.slice(0,e.length-1),o=Le(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=Le(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},Dn=(r,e,t,n)=>{const{obj:s,k:a}=Le(r,e,Object);s[a]=s[a]||[],s[a].push(t)},rt=(r,e)=>{const{obj:t,k:n}=Le(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},_n=(r,e,t)=>{const n=rt(r,t);return n!==void 0?n:rt(e,t)},Pr=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?q(r[n])||r[n]instanceof String||q(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):Pr(r[n],e[n],t):r[n]=e[n]);return r},Oe=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var $n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Cn=r=>q(r)?r.replace(/[&<>"'\/]/g,e=>$n[e]):r;class Pn{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 kn=[" ",",","?","!",";"],An=new Pn(20),Ln=(r,e,t)=>{e=e||"",t=t||"";const n=kn.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=An.getRegExp(`(${n.map(i=>i==="?"?"\\?":i).join("|")})`);let a=!s.test(r);if(!a){const i=r.indexOf(t);i>0&&!s.test(r.substring(0,i))&&(a=!0)}return a},Et=(r,e,t=".")=>{if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const n=e.split(t);let s=r;for(let a=0;a<n.length;){if(!s||typeof s!="object")return;let i,o="";for(let c=a;c<n.length;++c)if(c!==a&&(o+=t),o+=n[c],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&c<n.length-1)continue;a+=c-a+1;break}s=i}return s},Me=r=>r==null?void 0:r.replace("_","-"),In={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 nt{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||In,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(q(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new nt(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new nt(this.logger,e)}}var ye=new nt;class ct{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const s=this.observers[n].get(t)||0;this.observers[n].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s.apply(s,[e,...t])})}}class or extends ct{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,s={}){var l,f;const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,i=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):q(n)&&a?o.push(...n.split(a)):o.push(n)));const c=rt(this.data,o);return!c&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),c||!i||!q(n)?c:Et((f=(l=this.data)==null?void 0:l[e])==null?void 0:f[t],n,a)}addResource(e,t,n,s,a={silent:!1}){const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),ir(this.data,o,s),a.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const a in n)(q(n[a])||Array.isArray(n[a]))&&this.addResource(e,t,a,n[a],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,a,i={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),s=n,n=t,t=o[1]),this.addNamespaces(t);let c=rt(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Pr(c,n,a):c={...c,...n},ir(this.data,o,c),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var kr={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,n,s){return r.forEach(a=>{var i;e=((i=this.processors[a])==null?void 0:i.process(e,t,n,s))??e}),e}};const lr={},cr=r=>!q(r)&&typeof r!="boolean"&&typeof r!="number";class st extends ct{constructor(e,t={}){super(),Rn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ye.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(e==null)return!1;const s=this.resolve(e,n);return(s==null?void 0:s.res)!==void 0}extractFromKey(e,t){let n=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let a=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Ln(e,n,s);if(i&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:q(a)?[a]:a};const l=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(l[0])>-1)&&(a=l.shift()),e=l.join(s)}return{key:e,namespaces:q(a)?[a]:a}}translate(e,t,n){let s=typeof t=="object"?{...t}:t;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(s={...s}),s||(s={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const a=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:o,namespaces:c}=this.extractFromKey(e[e.length-1],s),l=c[c.length-1];let f=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const u=s.lng||this.language,d=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((u==null?void 0:u.toLowerCase())==="cimode")return d?a?{res:`${l}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:`${l}${f}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:o;const m=this.resolve(e,s);let h=m==null?void 0:m.res;const v=(m==null?void 0:m.usedKey)||o,b=(m==null?void 0:m.exactUsedKey)||o,S=["[object Number]","[object Function]","[object RegExp]"],w=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject,O=s.count!==void 0&&!q(s.count),g=st.hasDefaultValue(s),E=O?this.pluralResolver.getSuffix(u,s.count,s):"",$=s.ordinal&&O?this.pluralResolver.getSuffix(u,s.count,{ordinal:!1}):"",C=O&&!s.ordinal&&s.count===0,P=C&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${E}`]||s[`defaultValue${$}`]||s.defaultValue;let I=h;D&&!h&&g&&(I=P);const B=cr(I),k=Object.prototype.toString.apply(I);if(D&&I&&B&&S.indexOf(k)<0&&!(q(w)&&Array.isArray(I))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const R=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,I,{...s,ns:c}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(m.res=R,m.usedParams=this.getUsedParamsDetails(s),m):R}if(i){const R=Array.isArray(I),F=R?[]:{},H=R?b:v;for(const G in I)if(Object.prototype.hasOwnProperty.call(I,G)){const z=`${H}${i}${G}`;g&&!h?F[G]=this.translate(z,{...s,defaultValue:cr(P)?P[G]:void 0,joinArrays:!1,ns:c}):F[G]=this.translate(z,{...s,joinArrays:!1,ns:c}),F[G]===z&&(F[G]=I[G])}h=F}}else if(D&&q(w)&&Array.isArray(h))h=h.join(w),h&&(h=this.extendTranslation(h,e,s,n));else{let R=!1,F=!1;!this.isValidLookup(h)&&g&&(R=!0,h=P),this.isValidLookup(h)||(F=!0,h=o);const G=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&F?void 0:h,z=g&&P!==h&&this.options.updateMissing;if(F||R||z){if(this.logger.log(z?"updateKey":"missingKey",u,l,o,z?P:h),i){const x=this.resolve(o,{...s,keySeparator:!1});x&&x.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Z=[];const M=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&M&&M[0])for(let x=0;x<M.length;x++)Z.push(M[x]);else this.options.saveMissingTo==="all"?Z=this.languageUtils.toResolveHierarchy(s.lng||this.language):Z.push(s.lng||this.language);const p=(x,j,A)=>{var L;const _=g&&A!==h?A:G;this.options.missingKeyHandler?this.options.missingKeyHandler(x,l,j,_,z,s):(L=this.backendConnector)!=null&&L.saveMissing&&this.backendConnector.saveMissing(x,l,j,_,z,s),this.emit("missingKey",x,l,j,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?Z.forEach(x=>{const j=this.pluralResolver.getSuffixes(x,s);C&&s[`defaultValue${this.options.pluralSeparator}zero`]&&j.indexOf(`${this.options.pluralSeparator}zero`)<0&&j.push(`${this.options.pluralSeparator}zero`),j.forEach(A=>{p([x],o+A,s[`defaultValue${A}`]||P)})}):p(Z,o,P))}h=this.extendTranslation(h,e,s,m,n),F&&h===o&&this.options.appendNamespaceToMissingKey&&(h=`${l}${f}${o}`),(F||R)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${f}${o}`:o,R?h:void 0,s))}return a?(m.res=h,m.usedParams=this.getUsedParamsDetails(s),m):h}extendTranslation(e,t,n,s,a){var c,l;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const f=q(e)&&(((l=n==null?void 0:n.interpolation)==null?void 0:l.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(f){const m=e.match(this.interpolator.nestingRegexp);u=m&&m.length}let d=n.replace&&!q(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,n.lng||this.language||s.usedLng,n),f){const m=e.match(this.interpolator.nestingRegexp),h=m&&m.length;u<h&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...m)=>(a==null?void 0:a[0])===m[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${t[0]}`),null):this.translate(...m,t),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,o=q(i)?[i]:i;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=kr.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,a,i,o;return q(e)&&(e=[e]),e.forEach(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&&!q(t.count),m=d&&!t.ordinal&&t.count===0,h=t.context!==void 0&&(q(t.context)||typeof t.context=="number")&&t.context!=="",v=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(b=>{var S,w;this.isValidLookup(n)||(o=b,!lr[`${v[0]}-${b}`]&&((S=this.utils)!=null&&S.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.hasLoadedNamespace(o))&&(lr[`${v[0]}-${b}`]=!0,this.logger.warn(`key "${s}" for languages "${v.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(D=>{var E;if(this.isValidLookup(n))return;i=D;const O=[f];if((E=this.i18nFormat)!=null&&E.addLookupKeys)this.i18nFormat.addLookupKeys(O,f,D,b,t);else{let $;d&&($=this.pluralResolver.getSuffix(D,t.count,t));const C=`${this.options.pluralSeparator}zero`,P=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(O.push(f+$),t.ordinal&&$.indexOf(P)===0&&O.push(f+$.replace(P,this.options.pluralSeparator)),m&&O.push(f+C)),h){const I=`${f}${this.options.contextSeparator}${t.context}`;O.push(I),d&&(O.push(I+$),t.ordinal&&$.indexOf(P)===0&&O.push(I+$.replace(P,this.options.pluralSeparator)),m&&O.push(I+C))}}let g;for(;g=O.pop();)this.isValidLookup(n)||(a=g,n=this.getResource(D,b,g,t))}))})}),{res:n,usedKey:s,exactUsedKey:a,usedLng:i,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n,s={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!q(e.replace);let s=n?e.replace:e;if(n&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const a of t)delete s[a]}return s}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class ur{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ye.create("languageUtils")}getScriptPartFromCode(e){if(e=Me(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=Me(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(q(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(n=>{if(t)return;const s=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(n=>{if(t)return;const s=this.getScriptPartFromCode(n);if(this.isSupportedCode(s))return t=s;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return t=a;t=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&(i.indexOf("-")>0&&a.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===a||i.indexOf(a)===0&&a.length>1))return i})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),q(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),s=[],a=i=>{i&&(this.isSupportedCode(i)?s.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return q(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):q(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const fr={zero:0,one:1,two:2,few:3,many:4,other:5},dr={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Nn{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=ye.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Me(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:s});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let i;try{i=new Intl.PluralRules(n,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),dr;if(!e.match(/-|_/))return dr;const c=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(c,t)}return this.pluralRulesCache[a]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(s=>`${t}${s}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((s,a)=>fr[s]-fr[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 pr=(r,e,t,n=".",s=!0)=>{let a=_n(r,e,t);return!a&&s&&q(t)&&(a=Et(r,t,n),a===void 0&&(a=Et(e,t,n))),a},bt=r=>r.replace(/\$/g,"$$$$");class Mn{constructor(e={}){var t;this.logger=ye.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:a,prefixEscaped:i,suffix:o,suffixEscaped:c,formatSeparator:l,unescapeSuffix:f,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:m,nestingSuffix:h,nestingSuffixEscaped:v,nestingOptionsSeparator:b,maxReplaces:S,alwaysFormat:w}=e.interpolation;this.escape=t!==void 0?t:Cn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Oe(a):i||"{{",this.suffix=o?Oe(o):c||"}}",this.formatSeparator=l||",",this.unescapePrefix=f?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Oe(d):m||Oe("$t("),this.nestingSuffix=h?Oe(h):v||Oe(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=S||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,n)=>(t==null?void 0:t.source)===n?(t.lastIndex=0,t):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,s){var m;let a,i,o;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=h=>{if(h.indexOf(this.formatSeparator)<0){const w=pr(t,c,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,n,{...s,...t,interpolationkey:h}):w}const v=h.split(this.formatSeparator),b=v.shift().trim(),S=v.join(this.formatSeparator).trim();return this.format(pr(t,c,b,this.options.keySeparator,this.options.ignoreJSONStructure),S,n,{...s,...t,interpolationkey:b})};this.resetRegExp();const f=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,u=((m=s==null?void 0:s.interpolation)==null?void 0:m.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>bt(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?bt(this.escape(h)):bt(h)}].forEach(h=>{for(o=0;a=h.regex.exec(e);){const v=a[1].trim();if(i=l(v),i===void 0)if(typeof f=="function"){const S=f(e,a,s);i=q(S)?S:""}else if(s&&Object.prototype.hasOwnProperty.call(s,v))i="";else if(u){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${e}`),i="";else!q(i)&&!this.useRawValueToEscape&&(i=nr(i));const b=h.safeValue(i);if(e=e.replace(a[0],b),u?(h.regex.lastIndex+=i.length,h.regex.lastIndex-=a[0].length):h.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(c,l)=>{const f=this.nestingOptionsSeparator;if(c.indexOf(f)<0)return c;const u=c.split(new RegExp(`${f}[ ]*{`));let d=`{${u[1]}`;c=u[0],d=this.interpolate(d,i);const m=d.match(/'/g),h=d.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!h||h.length%2!==0)&&(d=d.replace(/'/g,'"'));try{i=JSON.parse(d),l&&(i={...l,...i})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,v),`${c}${f}${d}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];i={...n},i=i.replace&&!q(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const f=s[1].split(this.formatSeparator).map(u=>u.trim());s[1]=f.shift(),c=f,l=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!q(a))return a;q(a)||(a=nr(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 Fn=r=>{let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const n=r.split("(");e=n[0].toLowerCase().trim();const s=n[1].substring(0,n[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(i=>{if(i){const[o,...c]=i.split(":"),l=c.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();t[f]||(t[f]=l),l==="false"&&(t[f]=!1),l==="true"&&(t[f]=!0),isNaN(l)||(t[f]=parseInt(l,10))}})}return{formatName:e,formatOptions:t}},hr=r=>{const e={};return(t,n,s)=>{let a=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(a={...a,[s.interpolationkey]:void 0});const i=n+JSON.stringify(a);let o=e[i];return o||(o=r(Me(n),s),e[i]=o),o(t)}},Vn=r=>(e,t,n)=>r(Me(t),n)(e);class Yn{constructor(e={}){this.logger=ye.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?hr:Vn;this.formats={number:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a});return o=>i.format(o)}),currency:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a,style:"currency"});return o=>i.format(o)}),datetime:n((s,a)=>{const i=new Intl.DateTimeFormat(s,{...a});return o=>i.format(o)}),relativetime:n((s,a)=>{const i=new Intl.RelativeTimeFormat(s,{...a});return o=>i.format(o,a.range||"day")}),list:n((s,a)=>{const i=new Intl.ListFormat(s,{...a});return o=>i.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=hr(t)}format(e,t,n,s={}){const a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(o=>o.indexOf(")")>-1)){const o=a.findIndex(c=>c.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,c)=>{var u;const{formatName:l,formatOptions:f}=Fn(c);if(this.formats[l]){let d=o;try{const m=((u=s==null?void 0:s.formatParams)==null?void 0:u[s.interpolationkey])||{},h=m.locale||m.lng||s.locale||s.lng||n;d=this.formats[l](o,h,{...f,...s,...m})}catch(m){this.logger.warn(m)}return d}else this.logger.warn(`there was no format function for ${l}`);return o},e)}}const Un=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Wn extends ct{constructor(e,t,n,s={}){var a,i;super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=ye.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(i=(a=this.backend)==null?void 0:a.init)==null||i.call(a,n,s.backend,s)}queueLoad(e,t,n,s){const a={},i={},o={},c={};return e.forEach(l=>{let f=!0;t.forEach(u=>{const d=`${l}|${u}`;!n.reload&&this.store.hasResourceBundle(l,u)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?i[d]===void 0&&(i[d]=!0):(this.state[d]=1,f=!1,i[d]===void 0&&(i[d]=!0),a[d]===void 0&&(a[d]=!0),c[u]===void 0&&(c[u]=!0)))}),f||(o[l]=!0)}),(Object.keys(a).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(a),pending:Object.keys(i),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(c)}}loaded(e,t,n){const s=e.split("|"),a=s[0],i=s[1];t&&this.emit("failedLoading",a,i,t),!t&&n&&this.store.addResourceBundle(a,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const o={};this.queue.forEach(c=>{Dn(c.loaded,[a],i),Un(c,e),t&&c.errors.push(t),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(l=>{o[l]||(o[l]={});const f=c.loaded[l];f.length&&f.forEach(u=>{o[l][u]===void 0&&(o[l][u]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(c=>!c.done)}read(e,t,n,s=0,a=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:a,callback:i});return}this.readingCalls++;const o=(l,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const u=this.waitingReads.shift();this.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}if(l&&f&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,a*2,i)},a);return}i(l,f)},c=this.backend[n].bind(this.backend);if(c.length===2){try{const l=c(e,t);l&&typeof l.then=="function"?l.then(f=>o(null,f)).catch(o):o(null,l)}catch(l){o(l)}return}return c(e,t,o)}prepareLoading(e,t,n={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();q(e)&&(e=this.languageUtils.toResolveHierarchy(e)),q(t)&&(t=[t]);const a=this.queueLoad(e,t,n,s);if(!a.toLoad.length)return a.pending.length||s(),null;a.toLoad.forEach(i=>{this.loadOne(i)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),s=n[0],a=n[1];this.read(s,a,"read",void 0,void 0,(i,o)=>{i&&this.logger.warn(`${t}loading namespace ${a} for language ${s} failed`,i),!i&&o&&this.logger.log(`${t}loaded namespace ${a} for language ${s}`,o),this.loaded(e,i,o)})}saveMissing(e,t,n,s,a,i={},o=()=>{}){var 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 m={...i,isUpdate:a},h=this.backend.create.bind(this.backend);if(h.length<6)try{let v;h.length===5?v=h(e,t,n,s,m):v=h(e,t,n,s),v&&typeof v.then=="function"?v.then(b=>o(null,b)).catch(o):o(null,v)}catch(v){o(v)}else h(e,t,n,s,o,m)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const mr=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),q(r[1])&&(e.defaultValue=r[1]),q(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const t=r[3]||r[2];Object.keys(t).forEach(n=>{e[n]=t[n]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),gr=r=>{var e,t;return q(r.ns)&&(r.ns=[r.ns]),q(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),q(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((t=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},ze=()=>{},Bn=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class Fe extends ct{constructor(e={},t){if(super(),this.options=gr(e),this.services={},this.logger=ye,this.modules={external:[]},Bn(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(q(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=mr();this.options={...n,...this.options,...gr(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?ye.init(s(this.modules.logger),this.options):ye.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=Yn;const f=new ur(this.options);this.store=new or(this.options.resources,this.options);const u=this.services;u.logger=ye,u.resourceStore=this.store,u.languageUtils=f,u.pluralResolver=new Nn(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 Mn(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Wn(s(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(d,...m)=>{this.emit(d,...m)}),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 st(this.services,this.options),this.translator.on("*",(d,...m)=>{this.emit(d,...m)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=ze),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(l=>{this[l]=(...f)=>this.store[l](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...f)=>(this.store[l](...f),this)});const o=Ae(),c=()=>{const l=(f,u)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(u),t(f,u)};if(this.languages&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),o}loadResources(e,t=ze){var a,i;let n=t;const s=q(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const o=[],c=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};s?c(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>c(f)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,l=>c(l)),this.services.backendConnector.load(o,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(l)})}else n(null)}reloadResources(e,t,n){const s=Ae();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=ze),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"&&kr.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=Ae();this.emit("languageChanging",e);const s=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},a=(o,c)=>{c?this.isLanguageChangingTo===e&&(s(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,n.resolve((...l)=>this.t(...l)),t&&t(o,(...l)=>this.t(...l))},i=o=>{var f,u;!e&&!o&&this.services.languageDetector&&(o=[]);const c=q(o)?o:o&&o[0],l=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(q(o)?[o]:o);l&&(this.language||s(l),this.translator.language||this.translator.changeLanguage(l),(u=(f=this.services.languageDetector)==null?void 0:f.cacheUserLanguage)==null||u.call(f,l)),this.loadResources(l,d=>{a(d,l)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?i(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e),n}getFixedT(e,t,n){const s=(a,i,...o)=>{let c;typeof i!="object"?c=this.options.overloadTranslationOptionHandler([a,i].concat(o)):c={...i},c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||n||s.keyPrefix);const l=this.options.keySeparator||".";let f;return c.keyPrefix&&Array.isArray(a)?f=a.map(u=>`${c.keyPrefix}${l}${u}`):f=c.keyPrefix?`${c.keyPrefix}${l}${a}`:a,this.t(f,c)};return q(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}t(...e){var t;return(t=this.translator)==null?void 0:t.translate(...e)}exists(...e){var t;return(t=this.translator)==null?void 0:t.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const i=(o,c)=>{const l=this.services.backendConnector.state[`${o}|${c}`];return l===-1||l===0||l===2};if(t.precheck){const o=t.precheck(this,i);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!s||i(a,e)))}loadNamespaces(e,t){const n=Ae();return this.options.ns?(q(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Ae();q(e)&&(e=[e]);const s=this.options.preload||[],a=e.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return a.length?(this.options.preload=s.concat(a),this.loadResources(i=>{n.resolve(),t&&t(i)}),n):(t&&t(),Promise.resolve())}dir(e){var s,a;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new ur(mr());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new Fe(e,t)}cloneInstance(e={},t=ze){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new Fe(s);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(o=>{a[o]=this[o]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const o=Object.keys(this.store.data).reduce((c,l)=>(c[l]={...this.store.data[l]},c[l]=Object.keys(c[l]).reduce((f,u)=>(f[u]={...c[l][u]},f),c[l]),c),{});a.store=new or(o,s),a.services.resourceStore=a.store}return a.translator=new st(a.services,s),a.translator.on("*",(o,...c)=>{a.emit(o,...c)}),a.init(s,t),a.translator.options=s,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ae=Fe.createInstance();ae.createInstance=Fe.createInstance;ae.createInstance;ae.dir;ae.init;ae.loadResources;ae.reloadResources;ae.use;ae.changeLanguage;ae.getFixedT;ae.t;ae.exists;ae.setDefaultNamespace;ae.hasLoadedNamespace;ae.loadNamespaces;ae.loadLanguages;const Hn={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"},Gn={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},Kn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando",CheckObjectWrongValidation:"Oggetto non valido"},qn={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:Hn,Month:Gn,Generic:Kn},zn={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"},Jn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},Xn={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command",CheckObjectWrongValidation:"Object not valid"},Zn={Date:{NextDay:"Next Day",NextMonth:"Next Month",NextWeek:"Next Week",NextYear:"Next Year",PreviousDay:"Previous Day",PreviousMonth:"Previous Month",PreviousWeek:"Previous Week",PreviousYear:"Previous Year",Today:"Today",Tomorrow:"Tomorrow",Yesterday:"Yesterday"},Day:zn,Month:Jn,Generic:Xn};function yr(r,e){return new RegExp(Qn(r),e)}function Qn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const es=(r,e,t)=>{let n=r;return isNaN(n)||(e!=null&&(n=Math.max(n,e)),t!=null&&(n=Math.min(n,t))),n},ts=(r,e)=>{var i,o;const n=Intl.NumberFormat(r).formatToParts(1000.1),s=((i=n.find(c=>c.type==="group"))==null?void 0:i.value)??",",a=e??((o=n.find(c=>c.type==="decimal"))==null?void 0:o.value)??".";return{groupingChar:s,decimalChar:a}};function rs(r,e,t,n){let s=e;const a=as(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=is(s);return new Intl.NumberFormat(n,i).format(a)}const ns=(r,e,t)=>{const n=r.lastIndexOf(t);if(n!==-1)return r.length-n-1;const s=t==="."?",":".",a=r.lastIndexOf(s);return a!==-1&&!(s===e&&r.length-a-1===3)?r.length-a-1:0},ss=(r,e,t)=>{if(!r)return NaN;let n=r.replace(/\s/g,""),s=t;const a=(n.match(/\./g)||[]).length,i=(n.match(/,/g)||[]).length;if(a&&i)s=n.lastIndexOf(".")>n.lastIndexOf(",")?".":",";else if(!n.includes(t)){const c=n.includes(".")?".":",",l=c==="."?a:i;l>1||l===1&&c===e&&n.length-n.lastIndexOf(c)-1===3||(s=c)}const o=s==="."?",":".";return n=n.replace(new RegExp(`\\${o}`,"g"),""),s!=="."&&(n=n.replace(new RegExp(`\\${s}`,"g"),".")),parseFloat(n)};function as(r,e,t,n,s){let a=r;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const c=o=="."?",":".";a=a.replace(yr(c,"g"),""),a=a.replace(yr(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function is(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}ae.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 rs(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:Zn},it:{translation:qn}}});const os=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),ls=(r,e)=>ae.t(r,e);function Ce(){const r=T.useCallback((n,s,a,i)=>os(n,s,a||void 0,i),[]),e=T.useCallback(()=>ae.languages[0],[]),t=T.useCallback((n,s)=>ls(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var ut=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r.CHECK_OBJECT_WRONG_VALIDATION="Generic.CheckObjectWrongValidation",r))(ut||{}),le=(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))(le||{}),ue=(r=>(r.JANUARY="Month.January",r.FEBRUARY="Month.February",r.MARCH="Month.March",r.APRIL="Month.April",r.MAY="Month.May",r.JUNE="Month.June",r.JULY="Month.July",r.AUGUST="Month.August",r.SEPTEMBER="Month.September",r.OCTOBER="Month.October",r.NOVEMBER="Month.November",r.DECEMBER="Month.December",r))(ue||{}),Tt=(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))(Tt||{});const cs={"smp-datepickercalendar-position":"_smp-datepickercalendar-position_1lf9g_1"};function us({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=Ce(),i=()=>{if(!n)return;const M=new Date(n);return isNaN(M.getTime())?void 0:M},[o]=T.useState(new Date),[c,l]=T.useState(r||i()||new Date),[f,u]=T.useState(c?c.getMonth():new Date().getMonth()),[d,m]=T.useState(c?c.getFullYear():new Date().getFullYear()),[h,v]=T.useState(c?c.getDate():null),b=T.useRef(null),S=T.useRef([]),w=[a(ue.JANUARY),a(ue.FEBRUARY),a(ue.MARCH),a(ue.APRIL),a(ue.MAY),a(ue.JUNE),a(ue.JULY),a(ue.AUGUST),a(ue.SEPTEMBER),a(ue.OCTOBER),a(ue.NOVEMBER),a(ue.DECEMBER)],D=[{value:a(le.SUNDAY_SHORT),full:a(le.SUNDAY)},{value:a(le.MONDAY_SHORT),full:a(le.MONDAY)},{value:a(le.TUESDAY_SHORT),full:a(le.TUESDAY)},{value:a(le.WEDNESDAY_SHORT),full:a(le.WEDNESDAY)},{value:a(le.THURSDAY_SHORT),full:a(le.THURSDAY)},{value:a(le.FRIDAY_SHORT),full:a(le.FRIDAY)},{value:a(le.SATURDAY_SHORT),full:a(le.SATURDAY)}],O=M=>t.some(p=>{const x=p.start.getTime(),j=p.end.getTime(),A=M.getTime();return A>=x&&A<=j}),g=M=>{O(M)||(l(M),v(M.getDate()),e&&e(Zr(M)))},E=()=>{f===0?(u(11),m(d-1)):u(f-1),v(1)},$=()=>{f===11?(u(0),m(d+1)):u(f+1),v(1)},C=(M,p)=>new Date(M,p+1,0).getDate(),P=(M,p)=>new Date(M,p,1).getDay(),I=M=>{var x;const p=F.findIndex(j=>j!==null&&j.getDate()===M);p!==-1&&S.current[p]&&((x=S.current[p])==null||x.focus(),v(M))},B=(M,p)=>{const x=F[p];if(!x)return;const j=C(d,f),A=x.getDate();switch(M.key){case"ArrowRight":M.preventDefault();{let _=A+1,L=new Date(d,f,_);if(_>j){const Y=f===11?d+1:d,U=f===11?0:f+1;_=1,L=new Date(Y,U,_),$(),setTimeout(()=>{k(1,"forward")},0);return}O(L)?k(_,"forward"):I(_)}break;case"Tab":break;case"ArrowLeft":M.preventDefault();{let _=A-1,L=new Date(d,f,_);if(_<1){const Y=f===0?d-1:d,U=f===0?11:f-1,V=C(Y,U);_=V,L=new Date(Y,U,_),E(),setTimeout(()=>{k(V,"backward")},0);return}O(L)?k(_,"backward"):I(_)}break;case"ArrowUp":M.preventDefault();{let _=A-7,L=new Date(d,f,_);if(_<1){const Y=f===0?d-1:d,U=f===0?11:f-1;_=C(Y,U)+_,L=new Date(Y,U,_),E(),setTimeout(()=>{k(_,"backward")},0);return}O(L)?k(_,"backward"):I(_)}break;case"ArrowDown":M.preventDefault();{let _=A+7,L=new Date(d,f,_);if(_>j){const Y=f===11?d+1:d,U=f===11?0:f+1;_=_-j,L=new Date(Y,U,_),$(),setTimeout(()=>{k(_,"forward")},0);return}O(L)?k(_,"forward"):I(_)}break;case"Home":M.preventDefault(),k(1,"forward");break;case"End":M.preventDefault(),k(j,"backward");break;case"PageUp":M.preventDefault(),E(),setTimeout(()=>{const _=C(f===0?d-1:d,f===0?11:f-1),L=Math.min(A,_);k(L,"forward")},0);break;case"PageDown":M.preventDefault(),$(),setTimeout(()=>{const _=C(f===11?d+1:d,f===11?0:f+1),L=Math.min(A,_);k(L,"forward")},0);break;case" ":case"Space":if(O(x))return;v(x.getDate()),l(x);break;case"Enter":M.preventDefault(),g(x);break}},k=(M,p)=>{const x=C(d,f);if(p==="forward"){for(let j=M;j<=x;j++){const A=new Date(d,f,j);if(!O(A)){I(j);return}}$(),setTimeout(()=>{k(1,"forward")},0)}else{for(let L=M;L>=1;L--){const Y=new Date(d,f,L);if(!O(Y)){I(L);return}}const j=f===0?d-1:d,A=f===0?11:f-1,_=C(j,A);E(),setTimeout(()=>{k(_,"backward")},0)}},F=(()=>{const M=C(d,f),p=P(d,f),x=[];for(let j=0;j<p;j++)x.push(null);for(let j=1;j<=M;j++){const A=new Date(d,f,j);x.push(A)}return x})(),H=[];let G=[];F.forEach((M,p)=>{if(G.push(M),G.length===7||p===F.length-1){for(;G.length<7;)G.push(null);H.push(G),G=[]}}),T.useEffect(()=>{var M;if(h!==null){const p=F.findIndex(x=>x!==null&&x.getDate()===h);p!==-1&&S.current[p]&&((M=S.current[p])==null||M.focus())}},[f,d,h,F]);const z={label:"smp-datepickercalendar-label",wrapper:`smp-datepickercalendar ${cs["smp-datepickercalendar-position"]}`,calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(M,p,x,j)=>`smp-datepickercalendar-td
|
|
46
|
+
${M?"smp-datepickercalendar-td-today":""}
|
|
47
|
+
${p?"smp-datepickercalendar-td-selected":""}
|
|
48
48
|
${x?"smp-datepickercalendar-td-focused":""}
|
|
49
|
-
${O?"smp-datepickercalendar-td-disabled":""}`},B=()=>`${w[f]} ${d.toString()}`;return y.jsxs("div",{className:z.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[y.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[y.jsx(we,{onClick:D,ariaLabel:a(Et.PREVIOUS_MONTH),optionalDisplayValue:"<",appearance:"ghost",variant:"base",bindValue:"<"}),y.jsx("div",{"aria-label":B(),className:z.label,children:B()}),y.jsx(we,{onClick:$,ariaLabel:a(Et.NEXT_MONTH),bindValue:">",optionalDisplayValue:">",appearance:"ghost",variant:"base"})]}),y.jsxs("table",{ref:b,role:"grid","aria-label":`${a(ct.CALENDAR_FOR)} ${w[f]} ${d}`,className:z.table,children:[y.jsx("thead",{children:y.jsx("tr",{children:T.map(N=>y.jsx("th",{scope:"col",abbr:N.full,className:z.th,children:N.value},N.value))})}),y.jsx("tbody",{children:Z.map((N,h)=>y.jsx("tr",{children:N.map((x,O)=>{const P=h*7+O;if(x===null)return y.jsx("td",{className:z.td(!1,!1,!1,!0)},`empty-${O}`);const j=x.getDate()===o.getDate()&&x.getMonth()===o.getMonth()&&x.getFullYear()===o.getFullYear(),A=c&&x.getDate()===c.getDate()&&x.getMonth()===c.getMonth()&&x.getFullYear()===c.getFullYear(),V=m===x.getDate(),Y=S(x);return y.jsx("td",{role:"gridcell","aria-selected":A,tabIndex:V?0:-1,onClick:()=>v(x),onKeyDown:M=>_(M,P),"aria-label":`${x.getDate()} ${w[x.getMonth()]} ${x.getFullYear()}`,"data-selected":A,"aria-disabled":Y,ref:M=>{E.current[P]=M},className:z.td(j,A,V,Y),children:x.getDate()},`day-${O}`)})},`week-${h}`))})]})]})}const Ar=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const[i,o]=R.useState(!1),[c,l]=R.useState(r||""),[f,u]=R.useState(""),{anchorRef:d,targetRef:p}=it({position:"bottom",enabled:i});ke(p,()=>{o(!1)}),ke(d,()=>{if(typeof d=="object"&&d!==null&&"current"in d){const $=d.current.querySelector("input");$&&$===document.activeElement&&w()}}),_t(i,p);const{format:m,getCurrentLanguage:g}=Fe(),b=R.useCallback($=>{const C=$.length>5&&Kr($,g())||$,k=m(C,void 0,void 0,{type:"date"}),I=typeof C!="string",_=I&&C.toISOString().substring(0,10)||"";return{isValid:I,formattedDate:k,isoDate:_,normalizedDate:C}},[g,m]);R.useEffect(()=>{const{formattedDate:$,isoDate:C,isValid:k}=b(r);l(k&&C||r),u(k&&$||r)},[r,m,b]);const E=()=>o($=>!$),w=()=>{S(f)},T=$=>{S($),o(!1)},S=$=>{const{isoDate:C,isValid:k}=b($);t&&t(k&&C||$)},v=$=>{u($)},D=$=>{$.key==="Enter"&&($.preventDefault(),S(f))};return y.jsxs("div",{"data-component":"date-picker",children:[y.jsx(xe,{bindValue:f,placeholder:e,onBlur:w,onChange:v,onKeyDown:D,shapeIcon:"calendar",onShapeIconClick:E,ref:d,isEditable:s,...a}),i&&y.jsx(ot,{children:y.jsx(as,{disabledDateRanges:n,onDateChange:T,initialValue:Ot(c)&&c||"",targetRef:p})})]})},is=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:c,error:l,onOptionsRequest:f,onChange:u,onBlur:d})=>{const p=r.map(b=>b.bindValue),m=(b,E)=>{const w=[...r];if(b=="")w.pop();else{const T=w.findIndex(S=>S.bindValue===b&&S.optionalDisplayValue===E);T>=0?w.splice(T,1):w.push({bindValue:b,optionalDisplayValue:E})}u==null||u(w)},g={container:"smp-multipleAutocomplete-container"};return y.jsxs("div",{className:g.container,"data-component":"multiple-autocomplete",children:[i&&y.jsx(De,{label:i,disabled:o}),y.jsx(Dt,{elements:r,displayMode:e,isEditable:s,onChange:b=>{u==null||u(b)}}),y.jsx(Rt,{bindValue:"",fun:c,isEditable:s,onChange:m,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:f,_multiActiveIndex:p,error:l,onBlur:d})]})},Je={"smp-radio":"_smp-radio_1vo2u_1","smp-radio-horizontal":"_smp-radio-horizontal_1vo2u_10","smp-radio-element":"_smp-radio-element_1vo2u_14","smp-radio-disabled":"_smp-radio-disabled_1vo2u_20"},os=({disabled:r=!1,displayMode:e="DescOnly",horizontal:t=!1,options:n,onOptionsRequest:s,fun:a,...i})=>{const[o,c]=R.useState(n);R.useEffect(()=>{!o&&s&&a&&s(a,void 0).then(p=>c(p)).catch(p=>{console.error("Errore nel caricamento delle opzioni per ButtonList",p)})},[o,s,a]);const l={container:`${Je["smp-radio"]} ${t?Je["smp-radio-horizontal"]:""}`,option:`${Je["smp-radio-element"]} ${r?Je["smp-radio-disabled"]:""}`},f=()=>{var p;r||(p=i.onBlur)==null||p.call(i)},u=p=>{var m;r||(m=i.onChange)==null||m.call(i,p.target.value)},d=R.useId();return y.jsx("div",{"smp-id":"radio-container",className:l.container,children:o==null?void 0:o.map((p,m)=>y.jsxs("label",{className:l.option,children:[y.jsx("input",{type:"radio",name:d,value:p.id,disabled:r,checked:p.id===i.bindValue,onChange:u,onBlur:f}),Le(p.id,p.label,e)]},m))})},kr=({...r})=>{const[e,t]=R.useState(!1),n=e?"visibility-off":"visibility";return y.jsx(xe,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},ls=({...r})=>{const[e,t]=R.useState(r.bindValue),{translate:n}=Fe(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return y.jsx(xe,{...r,placeholder:r.placeholder?r.placeholder:n(ct.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},cs=({bindValue:r,optionalDisplayValue:e,label:t})=>{const n={wrapper:"smp-text-wrapper"};return t?y.jsxs("div",{className:n.wrapper,children:[y.jsx(De,{label:t}),y.jsx(Ie,{variant:"body",bindValue:e||r})]}):y.jsx(Ie,{variant:"body",bindValue:e||r})};class Ee{constructor(e,t){ye(this,"class");ye(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Ee(e,e.k==""?[]:e.k.split(";"))}static fromString(e){return new Ee({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const Pe=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),gr=r=>{const e=Ee.fromDataObj(r.obj),t=r.decode?Ee.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},us=(r,e)=>{const t=new Ee(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new Ee(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return Pe(r,t,n)},fs=({disabled:r,bindValue:e,onChange:t,placeholder:n,state:s,appearance:a,isEditable:i,label:o,ariaLabel:c,helperText:l,error:f,onBlur:u,onKeyDown:d})=>{const p=R.useId(),m=`${p}-helper`,g=f?"danger":s,b=l||!!f,E=T=>{t==null||t(T.target.value)},w={wrapper:"smp-textarea-wrapper",container:`smp-textarea ${r?"smp-textarea-disabled":""} ${n?"smp-textarea-placeholder":""} ${g?`smp-textarea-${g}`:""} ${a?`smp-textarea-${a}`:""} ${i?"":"smp-textarea-readOnly"}`};return y.jsxs("div",{className:w.wrapper,"data-component":"textarea",children:[o&&y.jsx(De,{htmlFor:p,label:o,disabled:r}),y.jsx("textarea",{id:p,value:e,placeholder:n,onChange:E,onBlur:u,className:w.container,disabled:r,readOnly:!i,onKeyDown:d,"aria-label":o?void 0:c,"aria-labelledby":o?p:void 0,"aria-describedby":b?m:void 0}),b&&y.jsx(xr,{id:m,helperText:f,disabled:r,state:g})]})},ds=({value:r,onChange:e,targetRef:t})=>{const[n,s,a]=r,i=o=>Array.from({length:o},(c,l)=>y.jsx("option",{value:l,children:l.toString().padStart(2,"0")},l));return y.jsxs("div",{className:"smp-timepicker-widget",ref:t,children:[y.jsx("select",{value:n,onChange:o=>e(+o.target.value,s,a),id:"time-picker-hours",children:i(24)}),":",y.jsx("select",{value:s,onChange:o=>e(n,+o.target.value,a),id:"time-picker-minutes",children:i(60)}),":",y.jsx("select",{value:a||0,onChange:o=>e(n,s,+o.target.value),id:"time-picker-seconds",children:i(60)})]})},yr=r=>{const e=r.match(/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/);if(!e)return!1;const[,t,n,s]=e,a=parseInt(t,10),i=parseInt(n,10),o=s?parseInt(s,10):0;return a>=0&&a<=23&&i>=0&&i<=59&&(s===void 0||o>=0&&o<=59)},ps=r=>{const e=r.split(":").map(t=>parseInt(t,10));return[e[0]||0,e[1]||0,e[2]||0]},hs=(r,e,t)=>{const n=r.toString().padStart(2,"0"),s=e.toString().padStart(2,"0"),a=t.toString().padStart(2,"0");return`${n}:${s}:${a}`},ms=({bindValue:r,placeholder:e="HH:MM:SS",onChange:t,isEditable:n=!0})=>{const[s,a]=R.useState(!1),[i,o]=R.useState(r||""),[c,l]=R.useState(""),{anchorRef:f,targetRef:u}=it({position:"bottom",enabled:s});ke(u,()=>a(!1)),_t(s,u),R.useEffect(()=>{const w=r||"",T=yr(w)?w:r||"";o(w),l(T)},[r]),R.useEffect(()=>{const w=T=>{T.key==="Escape"&&a(!1)};return s&&document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[s]);const d=()=>{n&&a(w=>!w)},p=w=>{l(w)},m=(w,T,S)=>{const v=hs(w,T,S);o(v),l(v),t==null||t(v),a(!1)},g=()=>{E(c)},b=w=>{w.key==="Enter"&&(w.preventDefault(),E(c))},E=w=>{if(w.trim()===""){o(""),l(""),t==null||t("");return}yr(w)?(o(w),l(w),t==null||t(w)):l(w)};return y.jsxs("div",{"data-component":"time-picker",children:[y.jsx(xe,{bindValue:c,placeholder:e,onChange:p,onBlur:g,onKeyDown:b,shapeIcon:"clock",onShapeIconClick:d,isEditable:n,ref:f}),s&&y.jsx(ot,{children:y.jsx(ds,{value:ps(i),onChange:m,targetRef:u})})]})};class at{constructor(e,t){ye(this,"class");ye(this,"time");this.class=e,this.time=t}static fromDataObj(e){const t=vr.get(`${e.t}${e.p}`);if(t)return new at(e,t.legacyToIso(e.k));throw new Error(`time creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=vr.get(`${this.class.t}${this.class.p}`);if(e)return e.isoToLegacy(this.time);throw new Error(`Time object not implemented ${this.class.t}${this.class.p}`)}getValue(){return this.time}}const vr=new Map([["I12",{legacyToIso(r){return`${r.substring(0,2)}:${r.substring(2,4)}:${r.substring(4,6)}`},isoToLegacy(r){return r.replaceAll(":","")||r}}]]),Ve=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,options:c,onChange:l,onClick:f,onEnter:u,onBlur:d,onOptionsRequest:p,isEditable:m})=>{const g={obj:t,shape:e,decode:r,icon:s,fun:a},b={onBlur:d,onOptionsRequest:p,fun:a,icon:s,label:o,isEditable:m,...n},E=(S,v,D)=>Hr(t)?Pe(S,new et(t,v).getLegacyValue()):Gr(t)?Pe(S,new at(t,v).getLegacyValue()):Pe(S,v,D),w=S=>Pe(g,new Qe(t,S).getLegacyValue()),T=S=>us(g,S);switch(e){case ne.AUTOCOMPLETE:{const S={...b,bindValue:t.k,optionalDisplayValue:r,onChange:(v,D)=>{l==null||l(E(g,v,D))}};return y.jsx(Rt,{...S})}case ne.BUTTON:{const S={...b,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{f==null||f(E(g,t.k))}};return y.jsx(we,{...S})}case ne.BUTTON_LIST:{const S={...b,options:c,onClick:(v,D)=>{const $={...g,fun:D};f==null||f(E($,v))}};return y.jsx(Dr,{...S})}case ne.COMBOBOX:{const S={...b,bindValue:t.k,optionalDisplayValue:r,onChange:(v,D)=>{l==null||l(E(g,v,D))}};return y.jsx($r,{...S})}case ne.RADIO:{const S={...b,bindValue:t.k,onChange:v=>{l==null||l(E(g,v))}};return y.jsx(os,{...S})}case ne.SWITCH:case ne.CHECKBOX:{const S=e===ne.SWITCH,v={...b,bindValue:Qe.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:D=>{l==null||l(w(D))},...S&&{variant:"switch"}};return y.jsx(_r,{...v})}case ne.CHIP:{const S={...b,elements:gr(g)};return y.jsx(Dt,{...S})}case ne.DATE:{const S={...b,bindValue:et.fromDataObj(t).getValue(),onChange:v=>{l==null||l(E(g,v))}};return y.jsx(Ar,{...S})}case ne.ICON:case ne.IMAGE:{const S={...b,icon:s,placeholderIcon:i,isInteractable:!!b.fun,onClick:()=>{f==null||f(E(g,t.k))}};return y.jsx(oe,{...S})}case ne.MULTI_AUTOCOMPLETE:{const S={...b,elements:gr(g),onChange:v=>{l==null||l(T(v))}};return y.jsx(is,{...S})}case ne.MEMO:{const S={...b,bindValue:t.k,optionalDisplayValue:r,onChange:v=>{l==null||l(E(g,v))}};return y.jsx(fs,{...S})}case ne.PASSWORD:{const S={...b,bindValue:t.k,onChange:v=>{l==null||l(E(g,v))}};return y.jsx(kr,{...S})}case ne.SPOTLIGHT:{const S={...b,bindValue:t.k,onEnter:v=>{u==null||u(E(g,v))}};return y.jsx(ls,{...S})}case ne.TEXT_FIELD:{const S={...b,bindValue:t.k,optionalDisplayValue:r,onChange:v=>{l==null||l(E(g,v))}};return y.jsx(xe,{...S})}case ne.TIME:{const S={...b,bindValue:at.fromDataObj(t).getValue(),onChange:v=>{l==null||l(E(g,v))}};return y.jsx(ms,{...S})}default:{const S={...b,bindValue:t.k,optionalDisplayValue:r};return y.jsx(cs,{...S})}}},gs=({data:r,onClick:e,onEnter:t})=>{var i,o;const[n,s]=R.useState(),a=R.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,p)=>{const m=l.cells[p.name],g={...m,id:p.name,onChange:b=>{s(E=>E&&{...E,[p.name]:{...E[p.name],obj:{...E[p.name].obj,k:b.obj.k}}})},onClick:()=>{m.fun&&e&&e({...m})},onEnter:b=>{t&&t(b)}};return{...d,[p.name]:g}},{})},[e,t]);return R.useEffect(()=>{r&&s(a(r))},[r,a]),!((i=r==null?void 0:r.rows)!=null&&i.length)||!((o=r.columns)!=null&&o.length)?null:n&&y.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:y.jsx(Tt,{layout:r.rows[0].layout,children:Object.values(n).map(c=>y.jsx(Ve,{...c}))})})},ys=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}}):[]},ce=r=>r==null?!1:typeof r=="string"?r.toLocaleLowerCase()=="yes":r,vs=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:c})=>{var T,S;const[l,f]=R.useState(),[u,d]=R.useState(t??!0),p=R.useRef(null),m=s.trim()?s:"100vh",g=R.useCallback(v=>{var $,C;if(!(($=v==null?void 0:v.rows)!=null&&$.length)||!((C=v==null?void 0:v.columns)!=null&&C.length))return{};const D=v.rows[0];return v.columns.filter(k=>k.visible??!0).reduce((k,I)=>{const _=D.cells[I.name];if(!_||!u&&ce(n)&&_.shape!==ne.BUTTON&&_.shape!==ne.BUTTON_LIST)return k;const F={..._,id:I.name,onChange:W=>{f(q=>{const Z={...q};return Z!=null&&Z[I.name]&&(Z[I.name].obj.k=W.obj.k),Z})},onClick:W=>{W.fun&&a&&a(W)},onEnter:W=>{i&&i(W)}};return c&&_.shape==ne.BUTTON_LIST&&(F.onOptionsRequest=(W,q)=>c(W,q).then(Z=>ys(Z))),!u&&ce(n)&&(F.data={...F.data,showText:!1,justify:"center"}),{...k,[I.name]:F}},{})},[u,n,a,i,c]),b=R.useCallback(()=>{o==null||o()},[o]),E=()=>{ce(n)?d(v=>!v):(d(!1),o==null||o())};if(R.useEffect(()=>{f(g(r))},[r]),R.useEffect(()=>{if(!p.current)return;if(!ce(n)){f(g(r));return}const v=getComputedStyle(p.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(g(r))},D/2)},[u,n]),R.useEffect(()=>{t!==void 0&&!ce(n)&&d(t)},[n,t]),!((T=r==null?void 0:r.rows)!=null&&T.length)||!((S=r.columns)!=null&&S.length))return null;const w={drawer:`smp-drawer ${ce(n)?"smp-drawer-minified":"smp-drawer-fixed"} ${u?"smp-drawer-open":""} ${!ce(n)&&!u?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${u?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${u?"smp-drawer-backdrop-open":""}`};return l&&y.jsxs(y.Fragment,{children:[!ce(n)&&y.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:w.backdrop,onClick:b}),y.jsx("aside",{ref:p,className:w.drawer,style:{height:m},"aria-label":"Drawer","smp-id":"drawer",children:y.jsxs("div",{className:w.container,children:[y.jsxs("div",{className:w.containerHeader,children:[e&&y.jsx("div",{className:w.containerLogo,children:y.jsx(oe,{icon:e,title:"drawer_logo",width:"100%",height:24})}),y.jsx("div",{className:w.containerIcon,children:y.jsx(oe,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!u,isInteractable:!0,onClick:E,width:20,height:20})})]}),y.jsx("div",{className:w.containerLayout,children:y.jsx(Tt,{layout:r.rows[0].layout,children:Object.values(l).map(v=>y.jsx(Ve,{...v}))})})]})})]})},bs=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:c,IconColName:l,IconColor:f="var(--smp-dashList-color-base)",NumberFormat:u,ForceUM:d,UmColName:p,UmColor:m="var(--smp-dashList-color-base)",ForceValue:g,ValueColName:b,ValueColor:E="var(--smp-dashList-color-base)",SelectLayout:w="1",onClick:T})=>{const S="N/A",v=(e==null?void 0:e.columns)||[],D=(e==null?void 0:e.rows)||[],$=D.length>0,C="--smp-dashList-color",k="smp-layout",I="descr",_="icon",F="um",W="value",q=i||"1em",Z="18px",K="--smp-dashList-columns",z="--smp-dashList-fontSize",B={dash:(U="1")=>{const X=h(U),te=X,re=x(X,I),fe=x(X,_),ve=x(X,F),pe=x(X,W);return{container:te,descr:re,icon:fe,um:ve,value:pe}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
|
|
50
|
-
${ce(o)?"smp-dash-list-horizontal":""}`},{format:N}=Fe(),h=U=>`${k}-${U}`,x=(U,X)=>`${U}__${X}`,O=U=>`${C}-${U}`,P=U=>{const X=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(X.test(U)){const re=U.match(X)||[];if((re==null?void 0:re.length)>3)return"rgb("+re[1]+","+re[2]+","+re[3]+")"}return U},j=U=>{if(!u)return U;const[X,te]=A(u).map(Te=>parseInt(Te||"0")),re="0,0"+(te?"."+"0".repeat(te):""),fe=N(U,re,"it");if(!X)return fe;const[ve,pe]=fe.split(",");return ve+(pe?`,${pe}`:"")},A=U=>U.includes(";")?U.split(";"):[U],V=U=>{const X=re=>{var fe;if(re)return(fe=U==null?void 0:U.cells[re])==null?void 0:fe.obj.k},te=re=>{var fe,ve;if(!(v.length<=re))return(ve=(fe=U==null?void 0:U.cells[v[re].name])==null?void 0:fe.obj)==null?void 0:ve.k};return{descr:t||X(n)||te(2)||"",icon:c||X(l)||te(3)||"",um:d||X(p)||te(1)||"",value:g||X(b)||te(0)||""}},Y=U=>{T==null||T(U)},M=(U,X)=>{(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),U.stopPropagation(),Y(X))},H=(U=>{const X=B.dash(U);return{className:X,descr:te=>y.jsx("div",{className:X.descr,children:te},`${U}-${I}`),icon:te=>y.jsx("div",{className:X.icon,children:y.jsx(oe,{color:f,height:Z,icon:te,width:Z})},`${U}-${_}`),um:te=>y.jsx("div",{className:X.um,children:te},`${U}-${F}`),value:te=>y.jsx("div",{className:X.value,children:te},`${U}-${W}`)}})(w),se=U=>{const{descr:X,icon:te,um:re,value:fe}=V(U),ve={[O(I)]:P(s),[O(F)]:P(m),[O(W)]:P(E)},pe=[],Te=j(fe);switch(w){case"2":te&&pe.push(H.icon(te)),pe.push(H.descr(X)),pe.push(H.value(re?Te+" "+re:Te));break;default:case"1":pe.push(H.descr(X)),pe.push(H.value(re?Te+" "+re:Te))}return y.jsx("div",{className:H.className.container,role:"button",style:ve,tabIndex:0,onClick:()=>Y(U),onKeyDown:Ir=>M(Ir,U),children:pe},U.rowId)},L={[K]:String(r),[z]:q};return y.jsx("div",{className:B.dashList,style:L,children:$?D.map(U=>se(U)):S})},Xe={"smp-table":"_smp-table_1qmju_1","smp-headerCell":"_smp-headerCell_1qmju_35","smp-resizer":"_smp-resizer_1qmju_44"},xs="_rowContent_20wit_2",Ss="_clickable_20wit_21",ws="_indent_20wit_26",Es="_toggle_20wit_32",Ts="_cell_20wit_38",Os="_leftSection_20wit_46",Se={rowContent:xs,clickable:Ss,indent:ws,toggle:Es,cell:Ts,leftSection:Os};function Ze(r){return!!r&&"children"in r}function js(r){return!Ze(r)}function Rs(r){const e=JSON.stringify(r,Object.keys(r).sort());let t=0,n,s;if(e.length===0)return t.toString();for(n=0;n<e.length;n++)s=e.charCodeAt(n),t=(t<<5)-t+s,t|=0;return Math.abs(t).toString()}const Lr=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var w;const[a,i]=R.useState(!1),o=Ze(r)&&!!((w=r.children)!=null&&w.length),c=r.cells&&Object.keys(r.cells).length>0,l=o,f=t*20,u=()=>{o&&i(!a)},d={content:`${Se.rowContent} ${o?Se.clickable:""}`,toggle:`${Se.toggle}`,indent:`${Se.indent}`,cell:`${Se.cell}`},p=T=>y.jsx(Ve,{...T}),m=()=>y.jsx("span",{className:d.toggle,children:l&&y.jsx(oe,{icon:a?"arrow_drop_right":"arrow_drop_down",width:16})}),g=()=>y.jsx("span",{className:d.indent,style:{width:`${f}px`},"aria-hidden":"true"}),b=()=>{const T=js(r)?"":r.decode||(c?"":"Untitled"),S=s??n*t;return y.jsxs("tr",{className:d.content,onClick:u,role:o?"button":"row","aria-expanded":o?!a:void 0,style:{height:`${n}px`,lineHeight:`calc(${n}px - 2*2px)`,transform:`translateY(${S}px)`},children:[Ze(r)&&y.jsxs("td",{className:Se.leftSection,style:{height:`${n}px`},children:[g(),m(),y.jsx("span",{className:Se.rowLabel,children:T})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([v,D])=>y.jsx("td",{className:d.cell,style:{width:e[v],minWidth:e[v],height:`${n}px`},children:p({...D,id:v})},Rs(D)||v))]})},E=()=>{var T;return a||!o?null:y.jsx(y.Fragment,{children:Ze(r)&&((T=r.children)==null?void 0:T.map((S,v)=>y.jsx(Lr,{row:S,level:t+1},`child-${v}`)))})};return y.jsxs(y.Fragment,{children:[b(),E()]})},Ds=({label:r,rowHeight:e=28,offsetTop:t=0,level:n=0,onClick:s,isExpanded:a})=>{const i={tr:"smp-groupRow-tr",td:"smp-groupRow-td"};return y.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:y.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[y.jsx(oe,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),y.jsx(Ie,{variant:"title",bindValue:r})]})})};function _s(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function $s(r,e){return r.map(t=>{const n=e.find(s=>s.column===t.bindValue);return{column:t.bindValue,visible:(n==null?void 0:n.visible)??!0}})}function Cs(r,e,t,n){const s=[];let a=0;return i(r,0,[]),{flatRows:s,offset:a};function i(u,d,p){if(d>=e.length){f(u);return}const m=e[d].column,g=o(u,m);for(const[b,E]of g){const w=[...p,b],T=c(w,d),S=n.has(T);s.push(l(b,T,d,S)),a+=t,S&&i(E,d+1,w)}}function o(u,d){var m;const p=new Map;for(const g of u){const b=((m=g.cells[d])==null?void 0:m.decode)??"N/D";p.has(b)||p.set(b,[]),p.get(b).push(g)}return p}function c(u,d){return`group-${u.join("-")}-${d}`}function l(u,d,p,m){return{isGroup:!0,value:u,cells:{},rowId:d,level:p,isExpanded:m}}function f(u){for(const d of u)s.push(d),a+=t}}const Ps=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return y.jsxs("tr",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[y.jsx("td",{children:y.jsx(oe,{icon:"groups"})}),y.jsx("td",{children:y.jsx(Dt,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})})]})},As=({columns:r,columnWidths:e})=>y.jsx("tfoot",{children:y.jsx("tr",{children:r.map(t=>t.visible&&y.jsx("td",{className:Xe["smp-headerCell"],style:{width:e[t.name],minWidth:e[t.name],maxWidth:e[t.name]}},t.name))})}),ks=({columns:r,rows:e,containerRef:t,sizingMode:n})=>{const[s,a]=R.useState({});return R.useEffect(()=>{var i,o;if(!(!r||r.length===0)){if(n==="fixed"){const l=Object.fromEntries(r.map(f=>[f.name,120]));a(l)}else if(n==="fit-grid"){const c=((i=t.current)==null?void 0:i.offsetWidth)||800,l=r.filter(d=>d.visible!==!1),f=c/l.length,u=Object.fromEntries(l.map(d=>[d.name,f]));a(u)}else if(n==="fit-content"){const c={};for(const l of r){if(!l.visible)continue;const f=((o=l.title)==null?void 0:o.length)||0,u=Math.max(...e.map(d=>{var p,m,g,b;return`${((m=(p=d.cells)==null?void 0:p[l.name])==null?void 0:m.decode)||((b=(g=d.cells)==null?void 0:g[l.name])==null?void 0:b.value)||""}`.length}),f);c[l.name]=u*8+24}a(c)}}},[r,e,t,n]),[s,a]},Ls=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var $;const[i,o]=R.useState(r??{columns:[],rows:[]}),[c,l]=R.useState(n||[]),[f,u]=R.useState(new Set),d=R.useRef(null),[p,m]=ks({columns:(i==null?void 0:i.columns)??[],rows:(i==null?void 0:i.rows)??[],containerRef:d,sizingMode:s});R.useEffect(()=>{if(c!=null&&c.length&&r.rows){const{flatRows:C}=Cs(r.rows,c,e,f);o({...r,rows:C})}else o(r)},[r,c,f,e]);const g=C=>{l($s(C,c))},b=C=>{C.preventDefault();const k=C.dataTransfer.getData("text/plain");if(!k||c.some(F=>F.column===k))return;const _=[...c,{column:k,visible:!0}];l(_)},E=C=>{C.preventDefault()},{virtualItems:w,containerProps:T,innerProps:S}=Or({items:(i==null?void 0:i.rows)??[],itemHeight:e,containerHeight:t,overscan:5}),v=(C,k)=>{const I=C.clientX,_=p[k],F=q=>{const Z=q.clientX-I,K=Math.max(50,_+Z);m(z=>({...z,[k]:K}))},W=()=>{window.removeEventListener("mousemove",F),window.removeEventListener("mouseup",W)};window.addEventListener("mousemove",F),window.addEventListener("mouseup",W)},D={smpTable:`${Xe["smp-table"]}`,headerCell:`${Xe["smp-headerCell"]}`,resizer:`${Xe["smp-resizer"]}`};return i&&y.jsx("div",{className:D.smpTable,...T,ref:d,children:y.jsxs("table",{children:[y.jsxs("thead",{children:[(n||a)&&y.jsx(Ps,{groups:c,onChange:g,onDrop:b,onDragOver:E}),y.jsx("tr",{children:i.columns&&(($=i.columns)==null?void 0:$.map(C=>C.visible&&y.jsxs("th",{className:D.headerCell,draggable:!0,onDragStart:k=>{k.dataTransfer.setData("text/plain",C.name)},style:{width:p[C.name],minWidth:p[C.name],maxWidth:p[C.name]},children:[y.jsx(Ie,{variant:"title",bindValue:C.title}),y.jsx("div",{className:D.resizer,onMouseDown:k=>v(k,C.name),role:"region"})]},C.name)))})]}),y.jsx("tbody",{...S,children:w.map(({item:C,index:k,offsetTop:I})=>{const _=C.rowId||C.value||`${C.isGroup?"group":"row"}-${k}`;return C.isGroup?y.jsx(Ds,{label:C.value||"",rowHeight:e,offsetTop:I,level:C.level,onClick:()=>{const F=C.rowId;F&&u(W=>_s(W,F))},isExpanded:C.isExpanded},`group-${_}`):y.jsx(Lr,{row:C,columnWidths:p,rowHeight:e,offsetTop:I,isGroup:!1},`row-${_}`)})}),y.jsx(As,{columns:i.columns,columnWidths:p})]})})},Is=({data:r,Type:e,ShowSubmit:t=!1,SubmitPosition:n="Right",DefaultValue:s,Label:a,LabelPosition:i="Left",onBlur:o,onClick:c,onOptionsRequest:l})=>{const[f,u]=R.useState();R.useEffect(()=>{u(()=>{if(!r)return;const g={...r};return e&&(g.shape=e),g.shape==null&&(g.shape=ne.TEXT_FIELD),s&&(g.obj=qr(s)),g})},[r,s,e]);const p={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},m=()=>{ce(t)||o==null||o(f)};if(f)return y.jsxs("div",{className:p.container,children:[y.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:y.jsx(Ve,{...f,id:"FLD",onChange:u,onOptionsRequest:l,fun:r==null?void 0:r.fun,onBlur:m,label:a,labelPosition:i})}),ce(t)&&y.jsx(we,{optionalDisplayValue:"Confirm",onClick:()=>c==null?void 0:c(f),bindValue:"Confirm"})]})},Ns=r=>(r==null?void 0:r.type)==="SmeupDataTree",Ms=r=>(r==null?void 0:r.type)==="SmeupDataTable",Fs=r=>Ns(r)?r.children?r.children.map(e=>({id:e.obj.k,label:e.value??""})):[]:Ms(r)?r.rows.map(e=>{const t=e.cells||e.cells,[n,s]=Object.keys(t);return{id:t[n].obj.k,label:t[s].value||t[s].obj.k}}):[],Vs=({data:r,readOnly:e=!1,hiddenSubmitButton:t=!1,optionsHandler:n,onSubmit:s,onCheck:a,onCheckObj:i})=>{const[o,c]=R.useState({}),{translate:l}=Fe();R.useEffect(()=>{c(p(r))},[r]);const f=(g,b)=>{c(E=>({...E,[g]:{...E[g],obj:{...E[g].obj,k:b.obj.k},decode:b.decode,data:{...E[g].data,error:void 0}}}))},u=()=>{const g=m();s({value:g})},d=async g=>{var b,E;if((b=o[g].inputSettings)!=null&&b.checkObject&&i&&((await i({obj:o[g].obj,fun:o[g].fun,cellId:g})).valid||c(T=>({...T,[g]:{...T[g],data:{...T[g].data,error:l(ct.CHECK_OBJECT_WRONG_VALIDATION)}}}))),(E=o[g].inputSettings)!=null&&E.checkValueOnExit){const w=m();a==null||a({value:w,cell:g})}},p=g=>{var E,w,T;if(!((E=g.rows)!=null&&E.length)||!((w=g.columns)!=null&&w.length))return{};const b=(T=g.rows)==null?void 0:T[0];return g.columns.filter(S=>S.visible??!0).reduce((S,v)=>{const D={...b.cells[v.name],id:v.name,label:v.title};return D.fun&&(D.onOptionsRequest=async($,C)=>Fs(await n($,C,r,v.name))),D.isEditable==null&&(D.isEditable=!0),e&&(D.isEditable=!1),D.isEditable&&D.shape==null&&(D.shape=ne.TEXT_FIELD),{...S,[v.name]:D}},{})},m=()=>({before:r,after:{type:"SmeupDataTable",columns:JSON.parse(JSON.stringify(r.columns)),rows:[{cells:JSON.parse(JSON.stringify(o))}]}});return o&&y.jsxs("div",{"data-component":"input-panel",style:{display:"flex",flexDirection:"column",gap:"2rem",padding:"2rem"},children:[y.jsx(Tt,{layout:r.rows[0].layout,children:Object.values(o).map(g=>y.jsx(Ve,{...g,onChange:b=>f(g.id,b),onBlur:()=>d(g.id)}))}),!t&&y.jsx(we,{onClick:u,bindValue:"submit",optionalDisplayValue:"Submit"})]})};exports.AppBar=gs;exports.Autocomplete=Rt;exports.Button=we;exports.ButtonList=Dr;exports.Checkbox=_r;exports.Combobox=$r;exports.DashList=bs;exports.DataTableComponent=Ls;exports.DatePicker=Ar;exports.Drawer=vs;exports.Field=Is;exports.Icon=oe;exports.InputPanel=Vs;exports.Password=kr;exports.Textfield=xe;exports.configurePaths=xn;
|
|
49
|
+
${j?"smp-datepickercalendar-td-disabled":""}`},Z=()=>`${w[f]} ${d.toString()}`;return y.jsxs("div",{className:z.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[y.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[y.jsx(we,{onClick:E,ariaLabel:a(Tt.PREVIOUS_MONTH),optionalDisplayValue:"<",appearance:"ghost",variant:"base",bindValue:"<"}),y.jsx("div",{"aria-label":Z(),className:z.label,children:Z()}),y.jsx(we,{onClick:$,ariaLabel:a(Tt.NEXT_MONTH),bindValue:">",optionalDisplayValue:">",appearance:"ghost",variant:"base"})]}),y.jsxs("table",{ref:b,role:"grid","aria-label":`${a(ut.CALENDAR_FOR)} ${w[f]} ${d}`,className:z.table,children:[y.jsx("thead",{children:y.jsx("tr",{children:D.map(M=>y.jsx("th",{scope:"col",abbr:M.full,className:z.th,children:M.value},M.value))})}),y.jsx("tbody",{children:H.map((M,p)=>y.jsx("tr",{children:M.map((x,j)=>{const A=p*7+j;if(x===null)return y.jsx("td",{className:z.td(!1,!1,!1,!0)},`empty-${j}`);const _=x.getDate()===o.getDate()&&x.getMonth()===o.getMonth()&&x.getFullYear()===o.getFullYear(),L=c&&x.getDate()===c.getDate()&&x.getMonth()===c.getMonth()&&x.getFullYear()===c.getFullYear(),Y=h===x.getDate(),U=O(x);return y.jsx("td",{role:"gridcell","aria-selected":L,tabIndex:Y?0:-1,onClick:()=>g(x),onKeyDown:V=>B(V,A),"aria-label":`${x.getDate()} ${w[x.getMonth()]} ${x.getFullYear()}`,"data-selected":L,"aria-disabled":U,ref:V=>{S.current[A]=V},className:z.td(_,L,Y,U),children:x.getDate()},`day-${j}`)})},`week-${p}`))})]})]})}const Ar=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const i=T.useRef(null),[o,c]=T.useState(!1),[l,f]=T.useState(r||""),[u,d]=T.useState(""),{anchorRef:m,targetRef:h}=ot({position:"bottom",enabled:o}),v=T.useCallback(()=>{var P;c(!1),(P=i==null?void 0:i.current)==null||P.focus()},[]);_e(h,()=>{v()}),_e(m,()=>{if(typeof m=="object"&&m!==null&&"current"in m){const P=m.current.querySelector("input");P&&P===document.activeElement&&O()}v()}),Ct(o,h);const{format:b,getCurrentLanguage:S}=Ce(),w=T.useCallback(P=>{const I=P.length>5&&zr(P,S())||P,B=b(I,void 0,void 0,{type:"date"}),k=typeof I!="string",R=k&&I.toISOString().substring(0,10)||"";return{isValid:k,formattedDate:B,isoDate:R,normalizedDate:I}},[S,b]);T.useEffect(()=>{const{formattedDate:P,isoDate:I,isValid:B}=w(r);f(B&&I||r),d(B&&P||r)},[r,b,w]);const D=()=>c(P=>!P),O=()=>{E(u)},g=P=>{E(P),v()},E=P=>{const{isoDate:I,isValid:B}=w(P);t&&t(B&&I||P)},$=P=>{d(P)},C=P=>{P.key==="Enter"&&(P.preventDefault(),E(u))};return y.jsxs("div",{"data-component":"date-picker",children:[y.jsx(xe,{...a,bindValue:u,placeholder:e,onBlur:O,onChange:$,onKeyDown:C,shapeIcon:"calendar",onShapeIconClick:D,ref:m,inputRef:i,isEditable:s}),o&&y.jsx(lt,{children:y.jsx(us,{disabledDateRanges:n,onDateChange:g,initialValue:Rt(l)&&l||"",targetRef:h})})]})},fs=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:c,error:l,onOptionsRequest:f,onChange:u,onBlur:d})=>{const m=r.map(b=>b.bindValue),h=(b,S)=>{const w=[...r];if(b=="")w.pop();else{const D=w.findIndex(O=>O.bindValue===b&&O.optionalDisplayValue===S);D>=0?w.splice(D,1):w.push({bindValue:b,optionalDisplayValue:S})}u==null||u(w)},v={container:"smp-multipleAutocomplete-container"};return y.jsxs("div",{className:v.container,"data-component":"multiple-autocomplete",children:[i&&y.jsx($e,{label:i,disabled:o}),y.jsx($t,{elements:r,displayMode:e,isEditable:s,onChange:b=>{u==null||u(b)}}),y.jsx(_t,{bindValue:"",fun:c,isEditable:s,onChange:h,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:f,_multiActiveIndex:m,error:l,onBlur:d})]})},Je={"smp-radio":"_smp-radio_1vo2u_1","smp-radio-horizontal":"_smp-radio-horizontal_1vo2u_10","smp-radio-element":"_smp-radio-element_1vo2u_14","smp-radio-disabled":"_smp-radio-disabled_1vo2u_20"},ds=({disabled:r=!1,displayMode:e="DescOnly",horizontal:t=!1,options:n,onOptionsRequest:s,fun:a,...i})=>{const[o,c]=T.useState(n);T.useEffect(()=>{!o&&s&&a&&s(a,void 0).then(m=>c(m)).catch(m=>{console.error("Error during loading options (radio)",m)})},[o,s,a]);const l={container:`${Je["smp-radio"]} ${t?Je["smp-radio-horizontal"]:""}`,option:`${Je["smp-radio-element"]} ${r?Je["smp-radio-disabled"]:""}`},f=()=>{var m;r||(m=i.onBlur)==null||m.call(i)},u=m=>{var h;r||(h=i.onChange)==null||h.call(i,m.id,m.label)},d=T.useId();return y.jsx("div",{"smp-id":"radio-container",className:l.container,children:o==null?void 0:o.map((m,h)=>y.jsxs("label",{className:l.option,children:[y.jsx("input",{type:"radio",name:d,value:m.id,disabled:r,checked:m.id===i.bindValue,onChange:()=>u(m),onBlur:f}),Ie(m.id,m.label,e)]},h))})},Lr=({...r})=>{const[e,t]=T.useState(!1),n=e?"visibility-off":"visibility";return y.jsx(xe,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},ps=({...r})=>{const[e,t]=T.useState(r.bindValue),{translate:n}=Ce(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return y.jsx(xe,{...r,placeholder:r.placeholder?r.placeholder:n(ut.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},hs=({bindValue:r,optionalDisplayValue:e,label:t})=>{const n={wrapper:"smp-text-wrapper"};return t?y.jsxs("div",{className:n.wrapper,children:[y.jsx($e,{label:t}),y.jsx(Ne,{variant:"body",bindValue:e||r})]}):y.jsx(Ne,{variant:"body",bindValue:e||r})};class Ee{constructor(e,t){de(this,"class");de(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Ee(e,e.k==""?[]:e.k.split(";"))}static fromString(e){return new Ee({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const je=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),vr=r=>{const e=Ee.fromDataObj(r.obj),t=r.decode?Ee.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},ms=(r,e)=>{const t=new Ee(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new Ee(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return je(r,t,n)},gs=({min:r,max:e,step:t=1,inputMode:n="decimal",dSep:s,bindValue:a,onChange:i,onEnter:o,...c})=>{const{getCurrentLanguage:l}=Ce(),f=T.useRef(null),u=l(),{groupingChar:d,decimalChar:m}=T.useMemo(()=>ts(u,s),[u,s]),h=T.useCallback((k,R)=>new Intl.NumberFormat(u,{minimumFractionDigits:R,maximumFractionDigits:R,useGrouping:!0}).format(k),[u]),v=T.useCallback(ss,[d,m]),b=T.useCallback(es,[r,e]),S=a!=null&&a.toString().includes(".")?a.toString().split(".")[1].length:0,[w,D]=T.useState(S),[O,g]=T.useState(a!=null?h(a,w):""),E=T.useRef(a??null);T.useEffect(()=>{if(a==null){g(""),E.current=null;return}const k=a.toString().includes(".")?a.toString().split(".")[1].length:0,R=k===0?w:k;R!==w&&D(R),g(h(a,R)),E.current=a},[a,h]);const $=T.useCallback((k,R=!1)=>{if(k.trim()===""){g(""),E.current=null,i==null||i(void 0,""),R&&(o==null||o(void 0));return}const F=v(k,d,m);if(isNaN(F))if(E.current!=null){const H=h(E.current,w);g(H)}else g("");else{const H=b(F,r,e),G=ns(k,d,m);D(G);const z=h(H,G);g(z),E.current=H,i==null||i(H,z),R&&(o==null||o(H))}},[v,d,m,b,r,e,h,i,o,w]),C=k=>g(k),P=()=>$(O),I=k=>{if(k.key==="Enter"){k.preventDefault(),$(O,!0);return}if(k.key==="ArrowUp"||k.key==="ArrowDown"){k.preventDefault();const R=k.key==="ArrowUp"?1:-1,F=E.current??0,H=b(F+R*t,r,e);$(h(H,w))}},B=k=>{if(!k.currentTarget.contains(document.activeElement))return;k.preventDefault();const R=k.deltaY<0?1:-1,F=E.current??0,H=b(F+R*t,r,e);$(h(H,w))};return _e(f,P),y.jsx("div",{ref:f,"data-component":"input-number",onWheel:B,children:y.jsx(xe,{...c,"aria-valuemin":r,"aria-valuemax":e,"aria-valuenow":E.current??void 0,bindValue:O,inputType:"text",inputMode:n,min:r,max:e,step:t,onChange:C,onBlur:P,onKeyDown:I})})};class at{constructor(e,t,n="."){de(this,"class");de(this,"value");de(this,"decimalSeparator");this.class=e,this.value=t,this.decimalSeparator=n}static fromDataObj(e,t){const n=t==="."?",":".",s=e.k.replace(new RegExp(`\\${n}`,"g"),""),a=parseFloat(s.replace(t,"."));return new at(e,a,t)}getLegacyValue(){return this.value.toString().replace(".",this.decimalSeparator)}getValue(){return this.value}}const ys=({disabled:r,bindValue:e,onChange:t,placeholder:n,state:s,appearance:a,isEditable:i,label:o,ariaLabel:c,helperText:l,error:f,onBlur:u,onKeyDown:d})=>{const m=T.useId(),h=`${m}-helper`,v=f?"danger":s,b=l||!!f,S=D=>{t==null||t(D.target.value)},w={wrapper:"smp-textarea-wrapper",container:`smp-textarea ${r?"smp-textarea-disabled":""} ${n?"smp-textarea-placeholder":""} ${v?`smp-textarea-${v}`:""} ${a?`smp-textarea-${a}`:""} ${i?"":"smp-textarea-readOnly"}`};return y.jsxs("div",{className:w.wrapper,"data-component":"textarea",children:[o&&y.jsx($e,{htmlFor:m,label:o,disabled:r}),y.jsx("textarea",{id:m,value:e,placeholder:n,onChange:S,onBlur:u,className:w.container,disabled:r,readOnly:!i,onKeyDown:d,"aria-label":o?void 0:c,"aria-labelledby":o?m:void 0,"aria-describedby":b?h:void 0}),b&&y.jsx(wr,{id:h,helperText:f,disabled:r,state:v})]})},vs=({value:r,onChange:e,targetRef:t,isOpen:n})=>{const s=T.useRef(null);T.useEffect(()=>{n&&(s!=null&&s.current)&&s.current.focus()},[n,s]);const[a,i,o]=r,c=l=>Array.from({length:l},(f,u)=>y.jsx("option",{value:u,children:u.toString().padStart(2,"0")},u));return y.jsxs("div",{className:"smp-timepicker-widget",ref:t,children:[y.jsx("select",{value:a,ref:s,onChange:l=>e(+l.target.value,i,o),id:"time-picker-hours",children:c(24)}),":",y.jsx("select",{value:i,onChange:l=>e(a,+l.target.value,o),id:"time-picker-minutes",children:c(60)}),":",y.jsx("select",{value:o||0,onChange:l=>e(a,i,+l.target.value),id:"time-picker-seconds",children:c(60)})]})},br=r=>{const e=r.match(/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/);if(!e)return!1;const[,t,n,s]=e,a=parseInt(t,10),i=parseInt(n,10),o=s?parseInt(s,10):0;return a>=0&&a<=23&&i>=0&&i<=59&&(s===void 0||o>=0&&o<=59)},bs=r=>{const e=r.split(":").map(t=>parseInt(t,10));return[e[0]||0,e[1]||0,e[2]||0]},xs=(r,e,t)=>{const n=r!=null&&!isNaN(r)?r.toString().padStart(2,"0"):"",s=e!=null&&!isNaN(e)?e.toString().padStart(2,"0"):"",a=t!=null&&!isNaN(t)?t.toString().padStart(2,"0"):"";return n&&s?`${n}:${s}:${a}`:s?`${s}:${a}`:a},Ss=({bindValue:r,placeholder:e="HH:MM:SS",onChange:t,isEditable:n=!0,...s})=>{const a=T.useRef(null),[i,o]=T.useState(!1),[c,l]=T.useState(r||""),[f,u]=T.useState(""),{anchorRef:d,targetRef:m}=ot({position:"bottom",enabled:i}),h=T.useCallback(()=>{var g;o(!1),(g=a==null?void 0:a.current)==null||g.focus()},[]);_e(m,()=>o(!1)),Ct(i,m),T.useEffect(()=>{const g=r||"",E=br(g)?g:r||"";l(g),u(E)},[r]),T.useEffect(()=>{const g=E=>{E.key==="Escape"&&o(!1)};return i&&document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[i]);const v=()=>{n&&o(g=>!g)},b=g=>{u(g)},S=(g,E,$)=>{const C=xs(g,E,$);l(C),u(C),t==null||t(C),h()},w=()=>{O(f)},D=g=>{g.key==="Enter"&&(g.preventDefault(),O(f))},O=g=>{if(g.trim()===""){l(""),u(""),t==null||t("");return}br(g)?(l(g),u(g),t==null||t(g)):u(g)};return y.jsxs("div",{"data-component":"time-picker",children:[y.jsx(Dt,{...s,bindValue:f,placeholder:e,onChange:b,onBlur:w,onKeyDown:D,shapeIcon:"clock",onShapeIconClick:v,isEditable:n,ref:d,inputRef:a}),i&&y.jsx(lt,{children:y.jsx(vs,{value:bs(c),onChange:S,targetRef:m,isOpen:i})})]})};function ws(r){return typeof r=="string"&&/^\d{6}$/.test(r)}class it{constructor(e,t){de(this,"class");de(this,"time");this.class=e,this.time=t}static fromDataObj(e){const t=xr.get(`${e.t}${e.p}`);if(t)return new it(e,t.legacyToIso(e.k));throw new Error(`time creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=xr.get(`${this.class.t}${this.class.p}`);if(e)return e.isoToLegacy(this.time);throw new Error(`Time object not implemented ${this.class.t}${this.class.p}`)}getValue(){return this.time}}const xr=new Map([["I12",{legacyToIso(r){return ws(r)&&`${r.substring(0,2)}:${r.substring(2,4)}:${r.substring(4,6)}`||r},isoToLegacy(r){return r.replaceAll(":","")||r}}]]),Ve=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,options:c,onChange:l,onClick:f,onEnter:u,onBlur:d,onOptionsRequest:m,isEditable:h})=>{const v={obj:t,shape:e,decode:r,icon:s,fun:a},b={onBlur:d,onOptionsRequest:m,fun:a,icon:s,label:o,isEditable:h,...n},S=(g,E,$)=>Gr(t)?je(g,new et(t,E).getLegacyValue()):Kr(t)?je(g,new it(t,E).getLegacyValue()):je(g,E,$),w=(g,E)=>je(g,new at(t,E,".").getLegacyValue()),D=g=>je(v,new Qe(t,g).getLegacyValue()),O=g=>ms(v,g);switch(e){case re.AUTOCOMPLETE:{const g={...b,bindValue:t.k,optionalDisplayValue:r,onChange:(E,$)=>{l==null||l(S(v,E,$))}};return y.jsx(_t,{...g})}case re.BUTTON:{const g={...b,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{f==null||f(S(v,t.k))}};return y.jsx(we,{...g})}case re.BUTTON_LIST:{const g={...b,options:c,onClick:(E,$)=>{const C={...v,fun:$};f==null||f(S(C,E))}};return y.jsx(_r,{...g})}case re.COMBOBOX:{const g={...b,bindValue:t.k,optionalDisplayValue:r,onChange:(E,$)=>{l==null||l(S(v,E,$))}};return y.jsx(Cr,{...g})}case re.RADIO:{const g={...b,bindValue:t.k,onChange:(E,$)=>{l==null||l(S(v,E,$))}};return y.jsx(ds,{...g})}case re.SWITCH:case re.CHECKBOX:{const g=e===re.SWITCH,E={...b,bindValue:Qe.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:$=>{l==null||l(D($))},...g&&{variant:"switch"}};return y.jsx($r,{...E})}case re.CHIP:{const g={...b,elements:vr(v)};return y.jsx($t,{...g})}case re.DATE:{const g={...b,bindValue:et.fromDataObj(t).getValue(),onChange:E=>{l==null||l(S(v,E))}};return y.jsx(Ar,{...g})}case re.ICON:case re.IMAGE:{const g={...b,icon:s,placeholderIcon:i,isInteractable:!!b.fun,onClick:()=>{f==null||f(S(v,t.k))}};return y.jsx(oe,{...g})}case re.INPUT_NUMBER:{const g={...b,bindValue:at.fromDataObj(t,".").getValue(),onChange:E=>{l==null||l(w(v,E))}};return y.jsx(gs,{...g})}case re.MULTI_AUTOCOMPLETE:{const g={...b,elements:vr(v),onChange:E=>{l==null||l(O(E))}};return y.jsx(fs,{...g})}case re.MEMO:{const g={...b,bindValue:t.k,optionalDisplayValue:r,onChange:E=>{l==null||l(S(v,E))}};return y.jsx(ys,{...g})}case re.PASSWORD:{const g={...b,bindValue:t.k,onChange:E=>{l==null||l(S(v,E))}};return y.jsx(Lr,{...g})}case re.SPOTLIGHT:{const g={...b,bindValue:t.k,onEnter:E=>{u==null||u(S(v,E))}};return y.jsx(ps,{...g})}case re.TEXT_FIELD:{const g={...b,bindValue:t.k,optionalDisplayValue:r,onChange:E=>{l==null||l(S(v,E))}};return y.jsx(xe,{...g})}case re.TIME:{const g={...b,bindValue:it.fromDataObj(t).getValue(),onChange:E=>{l==null||l(S(v,E))}};return y.jsx(Ss,{...g})}default:{const g={...b,bindValue:t.k,optionalDisplayValue:r};return y.jsx(hs,{...g})}}},Es=({data:r,onClick:e,onEnter:t})=>{var i,o;const[n,s]=T.useState(),a=T.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,m)=>{const h=l.cells[m.name],v={...h,id:m.name,onChange:b=>{s(S=>S&&{...S,[m.name]:{...S[m.name],obj:{...S[m.name].obj,k:b.obj.k}}})},onClick:()=>{h.fun&&e&&e({...h})},onEnter:b=>{t&&t(b)}};return{...d,[m.name]:v}},{})},[e,t]);return T.useEffect(()=>{r&&s(a(r))},[r,a]),!((i=r==null?void 0:r.rows)!=null&&i.length)||!((o=r.columns)!=null&&o.length)?null:n&&y.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:y.jsx(Ot,{layout:r.rows[0].layout,children:Object.values(n).map(c=>y.jsx(Ve,{...c}))})})},Ts=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}}):[]},ce=r=>r==null?!1:typeof r=="string"?r.toLocaleLowerCase()=="yes":r,Os=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:c})=>{var D,O;const[l,f]=T.useState(),[u,d]=T.useState(t??!0),m=T.useRef(null),h=s.trim()?s:"100vh",v=T.useCallback(g=>{var $,C;if(!(($=g==null?void 0:g.rows)!=null&&$.length)||!((C=g==null?void 0:g.columns)!=null&&C.length))return{};const E=g.rows[0];return g.columns.filter(P=>P.visible??!0).reduce((P,I)=>{const B=E.cells[I.name];if(!B||!u&&ce(n)&&B.shape!==re.BUTTON&&B.shape!==re.BUTTON_LIST)return P;const k={...B,id:I.name,onChange:R=>{f(F=>{const H={...F};return H!=null&&H[I.name]&&(H[I.name].obj.k=R.obj.k),H})},onClick:R=>{R.fun&&a&&a(R)},onEnter:R=>{i&&i(R)}};return c&&B.shape==re.BUTTON_LIST&&(k.onOptionsRequest=(R,F)=>c(R,F).then(H=>Ts(H))),!u&&ce(n)&&(k.data={...k.data,showText:!1,justify:"center"}),{...P,[I.name]:k}},{})},[u,n,a,i,c]),b=T.useCallback(()=>{o==null||o()},[o]),S=()=>{ce(n)?d(g=>!g):(d(!1),o==null||o())};if(T.useEffect(()=>{f(v(r))},[r]),T.useEffect(()=>{if(!m.current)return;if(!ce(n)){f(v(r));return}const g=getComputedStyle(m.current).getPropertyValue("--smp-drawer-slide-transition");let E=Number(g);g.endsWith("ms")?E=parseFloat(g):g.endsWith("s")&&(E=parseFloat(g)*1e3),setTimeout(()=>{f(v(r))},E/2)},[u,n]),T.useEffect(()=>{t!==void 0&&!ce(n)&&d(t)},[n,t]),!((D=r==null?void 0:r.rows)!=null&&D.length)||!((O=r.columns)!=null&&O.length))return null;const w={drawer:`smp-drawer ${ce(n)?"smp-drawer-minified":"smp-drawer-fixed"} ${u?"smp-drawer-open":""} ${!ce(n)&&!u?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${u?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${u?"smp-drawer-backdrop-open":""}`};return l&&y.jsxs(y.Fragment,{children:[!ce(n)&&y.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:w.backdrop,onClick:b}),y.jsx("aside",{ref:m,className:w.drawer,style:{height:h},"aria-label":"Drawer","smp-id":"drawer",children:y.jsxs("div",{className:w.container,children:[y.jsxs("div",{className:w.containerHeader,children:[e&&y.jsx("div",{className:w.containerLogo,children:y.jsx(oe,{icon:e,title:"drawer_logo",width:"100%",height:24})}),y.jsx("div",{className:w.containerIcon,children:y.jsx(oe,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!u,isInteractable:!0,onClick:S,width:20,height:20})})]}),y.jsx("div",{className:w.containerLayout,children:y.jsx(Ot,{layout:r.rows[0].layout,children:Object.values(l).map(g=>y.jsx(Ve,{...g}))})})]})})]})},Rs=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:c,IconColName:l,IconColor:f="var(--smp-dashList-color-base)",NumberFormat:u,ForceUM:d,UmColName:m,UmColor:h="var(--smp-dashList-color-base)",ForceValue:v,ValueColName:b,ValueColor:S="var(--smp-dashList-color-base)",SelectLayout:w="1",onClick:D})=>{const O="N/A",g=(e==null?void 0:e.columns)||[],E=(e==null?void 0:e.rows)||[],$=E.length>0,C="--smp-dashList-color",P="smp-layout",I="descr",B="icon",k="um",R="value",F=i||"1em",H="18px",G="--smp-dashList-columns",z="--smp-dashList-fontSize",Z={dash:(W="1")=>{const X=p(W),te=X,ne=x(X,I),fe=x(X,B),ve=x(X,k),he=x(X,R);return{container:te,descr:ne,icon:fe,um:ve,value:he}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
|
|
50
|
+
${ce(o)?"smp-dash-list-horizontal":""}`},{format:M}=Ce(),p=W=>`${P}-${W}`,x=(W,X)=>`${W}__${X}`,j=W=>`${C}-${W}`,A=W=>{const X=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(X.test(W)){const ne=W.match(X)||[];if((ne==null?void 0:ne.length)>3)return"rgb("+ne[1]+","+ne[2]+","+ne[3]+")"}return W},_=W=>{if(!u)return W;const[X,te]=L(u).map(Te=>parseInt(Te||"0")),ne="0,0"+(te?"."+"0".repeat(te):""),fe=M(W,ne,"it");if(!X)return fe;const[ve,he]=fe.split(",");return ve+(he?`,${he}`:"")},L=W=>W.includes(";")?W.split(";"):[W],Y=W=>{const X=ne=>{var fe;if(ne)return(fe=W==null?void 0:W.cells[ne])==null?void 0:fe.obj.k},te=ne=>{var fe,ve;if(!(g.length<=ne))return(ve=(fe=W==null?void 0:W.cells[g[ne].name])==null?void 0:fe.obj)==null?void 0:ve.k};return{descr:t||X(n)||te(2)||"",icon:c||X(l)||te(3)||"",um:d||X(m)||te(1)||"",value:v||X(b)||te(0)||""}},U=W=>{D==null||D(W)},V=(W,X)=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),W.stopPropagation(),U(X))},K=(W=>{const X=Z.dash(W);return{className:X,descr:te=>y.jsx("div",{className:X.descr,children:te},`${W}-${I}`),icon:te=>y.jsx("div",{className:X.icon,children:y.jsx(oe,{color:f,height:H,icon:te,width:H})},`${W}-${B}`),um:te=>y.jsx("div",{className:X.um,children:te},`${W}-${k}`),value:te=>y.jsx("div",{className:X.value,children:te},`${W}-${R}`)}})(w),se=W=>{const{descr:X,icon:te,um:ne,value:fe}=Y(W),ve={[j(I)]:A(s),[j(k)]:A(h),[j(R)]:A(S)},he=[],Te=_(fe);switch(w){case"2":te&&he.push(K.icon(te)),he.push(K.descr(X)),he.push(K.value(ne?Te+" "+ne:Te));break;default:case"1":he.push(K.descr(X)),he.push(K.value(ne?Te+" "+ne:Te))}return y.jsx("div",{className:K.className.container,role:"button",style:ve,tabIndex:0,onClick:()=>U(W),onKeyDown:Nr=>V(Nr,W),children:he},W.rowId)},N={[G]:String(r),[z]:F};return y.jsx("div",{className:Z.dashList,style:N,children:$?E.map(W=>se(W)):O})},Xe={"smp-table":"_smp-table_1qmju_1","smp-headerCell":"_smp-headerCell_1qmju_35","smp-resizer":"_smp-resizer_1qmju_44"},js="_rowContent_20wit_2",Ds="_clickable_20wit_21",_s="_indent_20wit_26",$s="_toggle_20wit_32",Cs="_cell_20wit_38",Ps="_leftSection_20wit_46",Se={rowContent:js,clickable:Ds,indent:_s,toggle:$s,cell:Cs,leftSection:Ps};function Ze(r){return!!r&&"children"in r}function ks(r){return!Ze(r)}function As(r){const e=JSON.stringify(r,Object.keys(r).sort());let t=0,n,s;if(e.length===0)return t.toString();for(n=0;n<e.length;n++)s=e.charCodeAt(n),t=(t<<5)-t+s,t|=0;return Math.abs(t).toString()}const Ir=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var w;const[a,i]=T.useState(!1),o=Ze(r)&&!!((w=r.children)!=null&&w.length),c=r.cells&&Object.keys(r.cells).length>0,l=o,f=t*20,u=()=>{o&&i(!a)},d={content:`${Se.rowContent} ${o?Se.clickable:""}`,toggle:`${Se.toggle}`,indent:`${Se.indent}`,cell:`${Se.cell}`},m=D=>y.jsx(Ve,{...D}),h=()=>y.jsx("span",{className:d.toggle,children:l&&y.jsx(oe,{icon:a?"arrow_drop_right":"arrow_drop_down",width:16})}),v=()=>y.jsx("span",{className:d.indent,style:{width:`${f}px`},"aria-hidden":"true"}),b=()=>{const D=ks(r)?"":r.decode||(c?"":"Untitled"),O=s??n*t;return y.jsxs("tr",{className:d.content,onClick:u,role:o?"button":"row","aria-expanded":o?!a:void 0,style:{height:`${n}px`,lineHeight:`calc(${n}px - 2*2px)`,transform:`translateY(${O}px)`},children:[Ze(r)&&y.jsxs("td",{className:Se.leftSection,style:{height:`${n}px`},children:[v(),h(),y.jsx("span",{className:Se.rowLabel,children:D})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([g,E])=>y.jsx("td",{className:d.cell,style:{width:e[g],minWidth:e[g],height:`${n}px`},children:m({...E,id:g})},As(E)||g))]})},S=()=>{var D;return a||!o?null:y.jsx(y.Fragment,{children:Ze(r)&&((D=r.children)==null?void 0:D.map((O,g)=>y.jsx(Ir,{row:O,level:t+1},`child-${g}`)))})};return y.jsxs(y.Fragment,{children:[b(),S()]})},Ls=({label:r,rowHeight:e=28,offsetTop:t=0,level:n=0,onClick:s,isExpanded:a})=>{const i={tr:"smp-groupRow-tr",td:"smp-groupRow-td"};return y.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:y.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[y.jsx(oe,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),y.jsx(Ne,{variant:"title",bindValue:r})]})})};function Is(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function Ns(r,e){return r.map(t=>{const n=e.find(s=>s.column===t.bindValue);return{column:t.bindValue,visible:(n==null?void 0:n.visible)??!0}})}function Ms(r,e,t,n){const s=[];let a=0;return i(r,0,[]),{flatRows:s,offset:a};function i(u,d,m){if(d>=e.length){f(u);return}const h=e[d].column,v=o(u,h);for(const[b,S]of v){const w=[...m,b],D=c(w,d),O=n.has(D);s.push(l(b,D,d,O)),a+=t,O&&i(S,d+1,w)}}function o(u,d){var h;const m=new Map;for(const v of u){const b=((h=v.cells[d])==null?void 0:h.decode)??"N/D";m.has(b)||m.set(b,[]),m.get(b).push(v)}return m}function c(u,d){return`group-${u.join("-")}-${d}`}function l(u,d,m,h){return{isGroup:!0,value:u,cells:{},rowId:d,level:m,isExpanded:h}}function f(u){for(const d of u)s.push(d),a+=t}}const Fs=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return y.jsxs("tr",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[y.jsx("td",{children:y.jsx(oe,{icon:"groups"})}),y.jsx("td",{children:y.jsx($t,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})})]})},Vs=({columns:r,columnWidths:e})=>y.jsx("tfoot",{children:y.jsx("tr",{children:r.map(t=>t.visible&&y.jsx("td",{className:Xe["smp-headerCell"],style:{width:e[t.name],minWidth:e[t.name],maxWidth:e[t.name]}},t.name))})}),Ys=({columns:r,rows:e,containerRef:t,sizingMode:n})=>{const[s,a]=T.useState({});return T.useEffect(()=>{var i,o;if(!(!r||r.length===0)){if(n==="fixed"){const l=Object.fromEntries(r.map(f=>[f.name,120]));a(l)}else if(n==="fit-grid"){const c=((i=t.current)==null?void 0:i.offsetWidth)||800,l=r.filter(d=>d.visible!==!1),f=c/l.length,u=Object.fromEntries(l.map(d=>[d.name,f]));a(u)}else if(n==="fit-content"){const c={};for(const l of r){if(!l.visible)continue;const f=((o=l.title)==null?void 0:o.length)||0,u=Math.max(...e.map(d=>{var m,h,v,b;return`${((h=(m=d.cells)==null?void 0:m[l.name])==null?void 0:h.decode)||((b=(v=d.cells)==null?void 0:v[l.name])==null?void 0:b.value)||""}`.length}),f);c[l.name]=u*8+24}a(c)}}},[r,e,t,n]),[s,a]},Us=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var $;const[i,o]=T.useState(r??{columns:[],rows:[]}),[c,l]=T.useState(n||[]),[f,u]=T.useState(new Set),d=T.useRef(null),[m,h]=Ys({columns:(i==null?void 0:i.columns)??[],rows:(i==null?void 0:i.rows)??[],containerRef:d,sizingMode:s});T.useEffect(()=>{if(c!=null&&c.length&&r.rows){const{flatRows:C}=Ms(r.rows,c,e,f);o({...r,rows:C})}else o(r)},[r,c,f,e]);const v=C=>{l(Ns(C,c))},b=C=>{C.preventDefault();const P=C.dataTransfer.getData("text/plain");if(!P||c.some(k=>k.column===P))return;const B=[...c,{column:P,visible:!0}];l(B)},S=C=>{C.preventDefault()},{virtualItems:w,containerProps:D,innerProps:O}=jr({items:(i==null?void 0:i.rows)??[],itemHeight:e,containerHeight:t,overscan:5}),g=(C,P)=>{const I=C.clientX,B=m[P],k=F=>{const H=F.clientX-I,G=Math.max(50,B+H);h(z=>({...z,[P]:G}))},R=()=>{window.removeEventListener("mousemove",k),window.removeEventListener("mouseup",R)};window.addEventListener("mousemove",k),window.addEventListener("mouseup",R)},E={smpTable:`${Xe["smp-table"]}`,headerCell:`${Xe["smp-headerCell"]}`,resizer:`${Xe["smp-resizer"]}`};return i&&y.jsx("div",{className:E.smpTable,...D,ref:d,children:y.jsxs("table",{children:[y.jsxs("thead",{children:[(n||a)&&y.jsx(Fs,{groups:c,onChange:v,onDrop:b,onDragOver:S}),y.jsx("tr",{children:i.columns&&(($=i.columns)==null?void 0:$.map(C=>C.visible&&y.jsxs("th",{className:E.headerCell,draggable:!0,onDragStart:P=>{P.dataTransfer.setData("text/plain",C.name)},style:{width:m[C.name],minWidth:m[C.name],maxWidth:m[C.name]},children:[y.jsx(Ne,{variant:"title",bindValue:C.title}),y.jsx("div",{className:E.resizer,onMouseDown:P=>g(P,C.name),role:"region"})]},C.name)))})]}),y.jsx("tbody",{...O,children:w.map(({item:C,index:P,offsetTop:I})=>{const B=C.rowId||C.value||`${C.isGroup?"group":"row"}-${P}`;return C.isGroup?y.jsx(Ls,{label:C.value||"",rowHeight:e,offsetTop:I,level:C.level,onClick:()=>{const k=C.rowId;k&&u(R=>Is(R,k))},isExpanded:C.isExpanded},`group-${B}`):y.jsx(Ir,{row:C,columnWidths:m,rowHeight:e,offsetTop:I,isGroup:!1},`row-${B}`)})}),y.jsx(Vs,{columns:i.columns,columnWidths:m})]})})},Ws=({data:r,Type:e,ShowSubmit:t=!1,SubmitPosition:n="Right",DefaultValue:s,Label:a,LabelPosition:i="Left",onBlur:o,onClick:c,onOptionsRequest:l})=>{const[f,u]=T.useState();T.useEffect(()=>{u(()=>{if(!r)return;const v={...r};return e&&(v.shape=e),v.shape==null&&(v.shape=re.TEXT_FIELD),s&&(v.obj=qr(s)),v})},[r,s,e]);const m={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},h=()=>{ce(t)||o==null||o(f)};if(f)return y.jsxs("div",{className:m.container,children:[y.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:y.jsx(Ve,{...f,id:"FLD",onChange:u,onOptionsRequest:l,fun:r==null?void 0:r.fun,onBlur:h,label:a,labelPosition:i})}),ce(t)&&y.jsx(we,{optionalDisplayValue:"Confirm",onClick:()=>c==null?void 0:c(f),bindValue:"Confirm"})]})},Bs=r=>(r==null?void 0:r.type)==="SmeupDataTree",Hs=r=>(r==null?void 0:r.type)==="SmeupDataTable",Gs=r=>Bs(r)?r.children?r.children.map(e=>({id:e.obj.k,label:e.value??""})):[]:Hs(r)?r.rows.map(e=>{const t=e.cells||e.cells,[n,s]=Object.keys(t);return{id:t[n].obj.k,label:t[s].value||t[s].obj.k}}):[],Ks=({data:r,readOnly:e=!1,hiddenSubmitButton:t=!1,updateOnClick:n=!1,optionsHandler:s,onSubmit:a,onCheck:i,onCheckObj:o})=>{const[c,l]=T.useState({}),{translate:f}=Ce();T.useEffect(()=>{l(h(r))},[r]);const u=(b,S)=>{l(w=>({...w,[b]:{...w[b],obj:{...w[b].obj,k:S.obj.k},decode:S.decode,data:{...w[b].data,error:void 0}}})),n&&(S.shape==re.CHECKBOX||S.shape==re.SWITCH)&&d()},d=()=>{const b=v();a({value:b})},m=async b=>{var S,w;if((S=c[b].inputSettings)!=null&&S.checkObject&&o&&((await o({obj:c[b].obj,fun:c[b].fun,cellId:b})).valid||l(O=>({...O,[b]:{...O[b],data:{...O[b].data,error:f(ut.CHECK_OBJECT_WRONG_VALIDATION)}}}))),(w=c[b].inputSettings)!=null&&w.checkValueOnExit){const D=v();i==null||i({value:D,cell:b})}},h=b=>{var w,D,O;if(!((w=b.rows)!=null&&w.length)||!((D=b.columns)!=null&&D.length))return{};const S=(O=b.rows)==null?void 0:O[0];return b.columns.filter(g=>g.visible??!0).reduce((g,E)=>{const $={...S.cells[E.name],id:E.name,label:E.title};return $.fun&&($.onOptionsRequest=async(C,P)=>Gs(await s(C,P,r,E.name))),$.isEditable==null&&($.isEditable=!0),e&&($.isEditable=!1),$.isEditable&&$.shape==null&&($.shape=re.TEXT_FIELD),{...g,[E.name]:$}},{})},v=()=>({before:r,after:{type:"SmeupDataTable",columns:JSON.parse(JSON.stringify(r.columns)),rows:[{cells:JSON.parse(JSON.stringify(c))}]}});return c&&y.jsxs("div",{"data-component":"input-panel",style:{display:"flex",flexDirection:"column",gap:"2rem",padding:"2rem"},children:[y.jsx(Ot,{layout:r.rows[0].layout,children:Object.values(c).map(b=>y.jsx(Ve,{...b,onChange:S=>u(b.id,S),onBlur:()=>m(b.id)}))}),!t&&y.jsx(we,{onClick:d,bindValue:"submit",optionalDisplayValue:"Submit"})]})};exports.AppBar=Es;exports.Autocomplete=_t;exports.Button=we;exports.ButtonList=_r;exports.Checkbox=$r;exports.Combobox=Cr;exports.DashList=Rs;exports.DataTableComponent=Us;exports.DatePicker=Ar;exports.Drawer=Os;exports.Field=Ws;exports.Icon=oe;exports.InputPanel=Ks;exports.Password=Lr;exports.Textfield=xe;exports.configurePaths=Sn;
|