@sme.up/ketchup2 2.0.0-SNAPSHOT-20250701103402 → 2.0.0-SNAPSHOT-20250701135033

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.
@@ -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 kt;function Hr(){if(kt)return Ae;kt=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 Ae.Fragment=e,Ae.jsx=t,Ae.jsxs=t,Ae}var Ne={};/**
9
+ */var It;function Hr(){if(It)return Ae;It=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 Ae.Fragment=e,Ae.jsx=t,Ae.jsxs=t,Ae}var Ne={};/**
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 Pt;function Gr(){return Pt||(Pt=1,process.env.NODE_ENV!=="production"&&function(){function r(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===T?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case y:return"Fragment";case _:return"Profiler";case x:return"StrictMode";case b:return"Suspense";case j:return"SuspenseList";case O:return"Activity"}if(typeof h=="object")switch(typeof h.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),h.$$typeof){case d:return"Portal";case S:return(h.displayName||"Context")+".Provider";case w:return(h._context.displayName||"Context")+".Consumer";case E:var v=h.render;return h=h.displayName,h||(h=v.displayName||v.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case M:return v=h.displayName||null,v!==null?v:r(h.type)||"Memo";case k:v=h._payload,h=h._init;try{return r(h(v))}catch{}}return null}function e(h){return""+h}function t(h){try{e(h);var v=!1}catch{v=!0}if(v){v=console;var R=v.error,L=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return R.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",L),e(h)}}function n(h){if(h===y)return"<>";if(typeof h=="object"&&h!==null&&h.$$typeof===k)return"<...>";try{var v=r(h);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function s(){var h=I.A;return h===null?null:h.getOwner()}function a(){return Error("react-stack-top-frame")}function i(h){if($.call(h,"key")){var v=Object.getOwnPropertyDescriptor(h,"key").get;if(v&&v.isReactWarning)return!1}return h.key!==void 0}function o(h,v){function R(){A||(A=!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)",v))}R.isReactWarning=!0,Object.defineProperty(h,"key",{get:R,configurable:!0})}function l(){var h=r(this.type);return V[h]||(V[h]=!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.")),h=this.props.ref,h!==void 0?h:null}function c(h,v,R,L,C,N,W,H){return R=N.ref,h={$$typeof:m,type:h,key:v,props:N,_owner:C},(R!==void 0?R:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:l}):Object.defineProperty(h,"ref",{enumerable:!1,value:null}),h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(h,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(h,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:W}),Object.defineProperty(h,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:H}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function f(h,v,R,L,C,N,W,H){var B=v.children;if(B!==void 0)if(L)if(P(B)){for(L=0;L<B.length;L++)u(B[L]);Object.freeze&&Object.freeze(B)}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(B);if($.call(v,"key")){B=r(h);var X=Object.keys(v).filter(function(se){return se!=="key"});L=0<X.length?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}",U[B+L]||(X=0<X.length?"{"+X.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var Pt;function Gr(){return Pt||(Pt=1,process.env.NODE_ENV!=="production"&&function(){function r(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===T?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case y:return"Fragment";case _:return"Profiler";case x:return"StrictMode";case b:return"Suspense";case j:return"SuspenseList";case O:return"Activity"}if(typeof h=="object")switch(typeof h.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),h.$$typeof){case p:return"Portal";case S:return(h.displayName||"Context")+".Provider";case w:return(h._context.displayName||"Context")+".Consumer";case E:var v=h.render;return h=h.displayName,h||(h=v.displayName||v.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case M:return v=h.displayName||null,v!==null?v:r(h.type)||"Memo";case I:v=h._payload,h=h._init;try{return r(h(v))}catch{}}return null}function e(h){return""+h}function t(h){try{e(h);var v=!1}catch{v=!0}if(v){v=console;var R=v.error,L=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return R.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",L),e(h)}}function n(h){if(h===y)return"<>";if(typeof h=="object"&&h!==null&&h.$$typeof===I)return"<...>";try{var v=r(h);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function s(){var h=k.A;return h===null?null:h.getOwner()}function a(){return Error("react-stack-top-frame")}function i(h){if($.call(h,"key")){var v=Object.getOwnPropertyDescriptor(h,"key").get;if(v&&v.isReactWarning)return!1}return h.key!==void 0}function o(h,v){function R(){A||(A=!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)",v))}R.isReactWarning=!0,Object.defineProperty(h,"key",{get:R,configurable:!0})}function l(){var h=r(this.type);return Y[h]||(Y[h]=!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.")),h=this.props.ref,h!==void 0?h:null}function c(h,v,R,L,C,N,W,H){return R=N.ref,h={$$typeof:m,type:h,key:v,props:N,_owner:C},(R!==void 0?R:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:l}):Object.defineProperty(h,"ref",{enumerable:!1,value:null}),h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(h,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(h,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:W}),Object.defineProperty(h,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:H}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function f(h,v,R,L,C,N,W,H){var B=v.children;if(B!==void 0)if(L)if(P(B)){for(L=0;L<B.length;L++)u(B[L]);Object.freeze&&Object.freeze(B)}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(B);if($.call(v,"key")){B=r(h);var X=Object.keys(v).filter(function(se){return se!=="key"});L=0<X.length?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}",U[B+L]||(X=0<X.length?"{"+X.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,L,B,X,B),U[B+L]=!0)}if(B=null,R!==void 0&&(t(R),B=""+R),i(v)&&(t(v.key),B=""+v.key),"key"in v){R={};for(var K in v)K!=="key"&&(R[K]=v[K])}else R=v;return B&&o(R,typeof h=="function"?h.displayName||h.name||"Unknown":h),c(h,B,N,C,s(),R,W,H)}function u(h){typeof h=="object"&&h!==null&&h.$$typeof===m&&h._store&&(h._store.validated=1)}var p=D,m=Symbol.for("react.transitional.element"),d=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),S=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),T=Symbol.for("react.client.reference"),I=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=Object.prototype.hasOwnProperty,P=Array.isArray,Y=console.createTask?console.createTask:function(){return null};p={"react-stack-bottom-frame":function(h){return h()}};var A,V={},z=p["react-stack-bottom-frame"].bind(p,a)(),J=Y(n(a)),U={};Ne.Fragment=y,Ne.jsx=function(h,v,R,L,C){var N=1e4>I.recentlyCreatedOwnerStacks++;return f(h,v,R,!1,L,C,N?Error("react-stack-top-frame"):z,N?Y(n(h)):J)},Ne.jsxs=function(h,v,R,L,C){var N=1e4>I.recentlyCreatedOwnerStacks++;return f(h,v,R,!0,L,C,N?Error("react-stack-top-frame"):z,N?Y(n(h)):J)}}()),Ne}var At;function Kr(){return At||(At=1,process.env.NODE_ENV==="production"?He.exports=Hr():He.exports=Gr()),He.exports}var g=Kr();const De=({label:r,disabled:e,htmlFor:t})=>{const n={container:`smp-label ${e?"smp-label-disabled":""}`};return g.jsx("label",{className:n.container,htmlFor:t,children:r})},pe={"smp-layout":"_smp-layout_pdvd2_1","smp-layout-horizontal":"_smp-layout-horizontal_pdvd2_9","smp-layout-vertical":"_smp-layout-vertical_pdvd2_14","smp-layout-section-grid":"_smp-layout-section-grid_pdvd2_19","smp-layout-section-vertical":"_smp-layout-section-vertical_pdvd2_22","smp-layout-section-horizontal":"_smp-layout-section-horizontal_pdvd2_26","smp-layout-cell-container":"_smp-layout-cell-container_pdvd2_31","smp-layout-section-flex":"_smp-layout-section-flex_pdvd2_35","smp-grid-template-cols":"_smp-grid-template-cols_pdvd2_52","smp-grid-template-rows":"_smp-grid-template-rows_pdvd2_56","smp-layout-section-with-title":"_smp-layout-section-with-title_pdvd2_60","smp-layout-section-title":"_smp-layout-section-title_pdvd2_66"},qr=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},Er=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:Er(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=qr(t.content.filter(l=>e.includes(l.id)),+t.columns).map((l,c)=>({...t,id:`${t.id}-${c}`,content:l,gridCols:t.columns,horizontal:!0})),s=[]),{...t,sections:n,content:s}}),Nt=(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}},Mt=r=>r.some(e=>e.dim&&!e.dim.endsWith("%"));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 wt(r,e){return wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},wt(r,e)}function Jr(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,wt(r,e)}function pt(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 Ge={};/*!
22
+ <%s key={someKey} {...props} />`,L,B,X,B),U[B+L]=!0)}if(B=null,R!==void 0&&(t(R),B=""+R),i(v)&&(t(v.key),B=""+v.key),"key"in v){R={};for(var K in v)K!=="key"&&(R[K]=v[K])}else R=v;return B&&o(R,typeof h=="function"?h.displayName||h.name||"Unknown":h),c(h,B,N,C,s(),R,W,H)}function u(h){typeof h=="object"&&h!==null&&h.$$typeof===m&&h._store&&(h._store.validated=1)}var d=D,m=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),S=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),T=Symbol.for("react.client.reference"),k=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=Object.prototype.hasOwnProperty,P=Array.isArray,V=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(h){return h()}};var A,Y={},z=d["react-stack-bottom-frame"].bind(d,a)(),J=V(n(a)),U={};Ne.Fragment=y,Ne.jsx=function(h,v,R,L,C){var N=1e4>k.recentlyCreatedOwnerStacks++;return f(h,v,R,!1,L,C,N?Error("react-stack-top-frame"):z,N?V(n(h)):J)},Ne.jsxs=function(h,v,R,L,C){var N=1e4>k.recentlyCreatedOwnerStacks++;return f(h,v,R,!0,L,C,N?Error("react-stack-top-frame"):z,N?V(n(h)):J)}}()),Ne}var At;function Kr(){return At||(At=1,process.env.NODE_ENV==="production"?He.exports=Hr():He.exports=Gr()),He.exports}var g=Kr();const De=({label:r,disabled:e,htmlFor:t})=>{const n={container:`smp-label ${e?"smp-label-disabled":""}`};return g.jsx("label",{className:n.container,htmlFor:t,children:r})},pe={"smp-layout":"_smp-layout_pdvd2_1","smp-layout-horizontal":"_smp-layout-horizontal_pdvd2_9","smp-layout-vertical":"_smp-layout-vertical_pdvd2_14","smp-layout-section-grid":"_smp-layout-section-grid_pdvd2_19","smp-layout-section-vertical":"_smp-layout-section-vertical_pdvd2_22","smp-layout-section-horizontal":"_smp-layout-section-horizontal_pdvd2_26","smp-layout-cell-container":"_smp-layout-cell-container_pdvd2_31","smp-layout-section-flex":"_smp-layout-section-flex_pdvd2_35","smp-grid-template-cols":"_smp-grid-template-cols_pdvd2_52","smp-grid-template-rows":"_smp-grid-template-rows_pdvd2_56","smp-layout-section-with-title":"_smp-layout-section-with-title_pdvd2_60","smp-layout-section-title":"_smp-layout-section-title_pdvd2_66"},qr=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},Er=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:Er(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=qr(t.content.filter(l=>e.includes(l.id)),+t.columns).map((l,c)=>({...t,id:`${t.id}-${c}`,content:l,gridCols:t.columns,horizontal:!0})),s=[]),{...t,sections:n,content:s}}),Nt=(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}},Mt=r=>r.some(e=>e.dim&&!e.dim.endsWith("%"));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 wt(r,e){return wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},wt(r,e)}function Jr(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,wt(r,e)}function pt(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 Ge={};/*!
23
23
  * content-type
24
24
  * Copyright(c) 2015 Douglas Christopher Wilson
25
25
  * MIT Licensed
26
- */var Ft;function Xr(){if(Ft)return Ge;Ft=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-]+$/;Ge.format=i,Ge.parse=o;function i(u){if(!u||typeof u!="object")throw new TypeError("argument obj is required");var p=u.parameters,m=u.type;if(!m||!a.test(m))throw new TypeError("invalid type");var d=m;if(p&&typeof p=="object")for(var y,x=Object.keys(p).sort(),_=0;_<x.length;_++){if(y=x[_],!t.test(y))throw new TypeError("invalid parameter name");d+="; "+y+"="+c(p[y])}return d}function o(u){if(!u)throw new TypeError("argument string is required");var p=typeof u=="object"?l(u):u;if(typeof p!="string")throw new TypeError("argument string is required to be a string");var m=p.indexOf(";"),d=m!==-1?p.slice(0,m).trim():p.trim();if(!a.test(d))throw new TypeError("invalid media type");var y=new f(d.toLowerCase());if(m!==-1){var x,_,w;for(r.lastIndex=m;_=r.exec(p);){if(_.index!==m)throw new TypeError("invalid parameter format");m+=_[0].length,x=_[1].toLowerCase(),w=_[2],w.charCodeAt(0)===34&&(w=w.slice(1,-1),w.indexOf("\\")!==-1&&(w=w.replace(n,"$1"))),y.parameters[x]=w}if(m!==p.length)throw new TypeError("invalid parameter format")}return y}function l(u){var p;if(typeof u.getHeader=="function"?p=u.getHeader("content-type"):typeof u.headers=="object"&&(p=u.headers&&u.headers["content-type"]),typeof p!="string")throw new TypeError("content-type header is missing from object");return p}function c(u){var p=String(u);if(t.test(p))return p;if(p.length>0&&!e.test(p))throw new TypeError("invalid parameter value");return'"'+p.replace(s,"\\$1")+'"'}function f(u){this.parameters=Object.create(null),this.type=u}return Ge}var Zr=Xr(),Ie=new Map,Tr=function(e){return e.cloneNode(!0)},Vt=function(){return window.location.protocol==="file:"},Or=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=Zr.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(Vt()?"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||Vt()&&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()},xe={},Yt=function(e,t){xe[e]=xe[e]||[],xe[e].push(t)},Qr=function(e){for(var t=function(i,o){setTimeout(function(){if(Array.isArray(xe[e])){var l=Ie.get(e),c=xe[e][i];l instanceof SVGSVGElement&&c(null,Tr(l)),l instanceof Error&&c(l),i===xe[e].length-1&&delete xe[e]}},0)},n=0,s=xe[e].length;n<s;n++)t(n)},en=function(e,t,n){if(Ie.has(e)){var s=Ie.get(e);if(s===void 0){Yt(e,n);return}if(s instanceof SVGSVGElement){n(null,Tr(s));return}}Ie.set(e,void 0),Yt(e,n),Or(e,t,function(a,i){var o;a?Ie.set(e,a):((o=i.responseXML)===null||o===void 0?void 0:o.documentElement)instanceof SVGSVGElement&&Ie.set(e,i.responseXML.documentElement),Qr(e)})},tn=function(e,t,n){Or(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)})},rn=0,nn=function(){return++rn},ge=[],Ut={},sn="http://www.w3.org/2000/svg",ht="http://www.w3.org/1999/xlink",Wt=function(e,t,n,s,a,i,o){var l=e.getAttribute("data-src")||e.getAttribute("src");if(!l){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 c=s?en:tn;c(l,a,function(f,u){if(!u){ge.splice(ge.indexOf(e),1),e=null,o(f);return}var p=e.getAttribute("id");p&&u.setAttribute("id",p);var m=e.getAttribute("title");m&&u.setAttribute("title",m);var d=e.getAttribute("width");d&&u.setAttribute("width",d);var y=e.getAttribute("height");y&&u.setAttribute("height",y);var x=Array.from(new Set(pt(pt(pt([],(u.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();u.setAttribute("class",x);var _=e.getAttribute("style");_&&u.setAttribute("style",_),u.setAttribute("data-src",l);var w=[].filter.call(e.attributes,function(J){return/^data-\w[\w-]*$/.test(J.name)});if(Array.prototype.forEach.call(w,function(J){J.name&&J.value&&u.setAttribute(J.name,J.value)}),n){var S={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"]},E,b,j,M,k;Object.keys(S).forEach(function(J){E=J,j=S[J],b=u.querySelectorAll(E+"[id]");for(var U=function(L,C){M=b[L].id,k=M+"-"+nn();var N;Array.prototype.forEach.call(j,function(G){N=u.querySelectorAll("["+G+'*="'+M+'"]');for(var Z=0,re=N.length;Z<re;Z++){var ne=N[Z].getAttribute(G);ne&&!ne.match(new RegExp('url\\("?#'+M+'"?\\)'))||N[Z].setAttribute(G,"url(#"+k+")")}});for(var W=u.querySelectorAll("[*|href]"),H=[],B=0,X=W.length;B<X;B++){var K=W[B].getAttributeNS(ht,"href");K&&K.toString()==="#"+b[L].id&&H.push(W[B])}for(var se=0,F=H.length;se<F;se++)H[se].setAttributeNS(ht,"href","#"+k);b[L].id=k},h=0,v=b.length;h<v;h++)U(h)})}u.removeAttribute("xmlns:a");for(var O=u.querySelectorAll("script"),T=[],I,$,P=0,Y=O.length;P<Y;P++)$=O[P].getAttribute("type"),(!$||$==="application/ecmascript"||$==="application/javascript"||$==="text/javascript")&&(I=O[P].innerText||O[P].textContent,I&&T.push(I),u.removeChild(O[P]));if(T.length>0&&(t==="always"||t==="once"&&!Ut[l])){for(var A=0,V=T.length;A<V;A++)new Function(T[A])(window);Ut[l]=!0}var z=u.querySelectorAll("style");if(Array.prototype.forEach.call(z,function(J){J.textContent+=""}),u.setAttribute("xmlns",sn),u.setAttribute("xmlns:xlink",ht),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)})},an=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,l=n.beforeEach,c=l===void 0?function(){}:l,f=n.cacheRequests,u=f===void 0?!0:f,p=n.evalScripts,m=p===void 0?"never":p,d=n.httpRequestWithCredentials,y=d===void 0?!1:d,x=n.renumerateIRIElements,_=x===void 0?!0:x;if(e&&"length"in e)for(var w=0,S=0,E=e.length;S<E;S++)Wt(e[S],m,_,u,y,c,function(b,j){o(b,j),e&&"length"in e&&e.length===++w&&a(w)});else e?Wt(e,m,_,u,y,c,function(b,j){o(b,j),a(1),e=null}):a(0)},Ke={exports:{}},qe={exports:{}},Q={};/** @license React v16.13.1
26
+ */var Ft;function Xr(){if(Ft)return Ge;Ft=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-]+$/;Ge.format=i,Ge.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 p=m;if(d&&typeof d=="object")for(var y,x=Object.keys(d).sort(),_=0;_<x.length;_++){if(y=x[_],!t.test(y))throw new TypeError("invalid parameter name");p+="; "+y+"="+c(d[y])}return p}function o(u){if(!u)throw new TypeError("argument string is required");var d=typeof u=="object"?l(u):u;if(typeof d!="string")throw new TypeError("argument string is required to be a string");var m=d.indexOf(";"),p=m!==-1?d.slice(0,m).trim():d.trim();if(!a.test(p))throw new TypeError("invalid media type");var y=new f(p.toLowerCase());if(m!==-1){var x,_,w;for(r.lastIndex=m;_=r.exec(d);){if(_.index!==m)throw new TypeError("invalid parameter format");m+=_[0].length,x=_[1].toLowerCase(),w=_[2],w.charCodeAt(0)===34&&(w=w.slice(1,-1),w.indexOf("\\")!==-1&&(w=w.replace(n,"$1"))),y.parameters[x]=w}if(m!==d.length)throw new TypeError("invalid parameter format")}return y}function l(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 c(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 Ge}var Zr=Xr(),ke=new Map,Tr=function(e){return e.cloneNode(!0)},Vt=function(){return window.location.protocol==="file:"},Or=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=Zr.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(Vt()?"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||Vt()&&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()},xe={},Yt=function(e,t){xe[e]=xe[e]||[],xe[e].push(t)},Qr=function(e){for(var t=function(i,o){setTimeout(function(){if(Array.isArray(xe[e])){var l=ke.get(e),c=xe[e][i];l instanceof SVGSVGElement&&c(null,Tr(l)),l instanceof Error&&c(l),i===xe[e].length-1&&delete xe[e]}},0)},n=0,s=xe[e].length;n<s;n++)t(n)},en=function(e,t,n){if(ke.has(e)){var s=ke.get(e);if(s===void 0){Yt(e,n);return}if(s instanceof SVGSVGElement){n(null,Tr(s));return}}ke.set(e,void 0),Yt(e,n),Or(e,t,function(a,i){var o;a?ke.set(e,a):((o=i.responseXML)===null||o===void 0?void 0:o.documentElement)instanceof SVGSVGElement&&ke.set(e,i.responseXML.documentElement),Qr(e)})},tn=function(e,t,n){Or(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)})},rn=0,nn=function(){return++rn},ge=[],Ut={},sn="http://www.w3.org/2000/svg",ht="http://www.w3.org/1999/xlink",Wt=function(e,t,n,s,a,i,o){var l=e.getAttribute("data-src")||e.getAttribute("src");if(!l){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 c=s?en:tn;c(l,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 p=e.getAttribute("width");p&&u.setAttribute("width",p);var y=e.getAttribute("height");y&&u.setAttribute("height",y);var x=Array.from(new Set(pt(pt(pt([],(u.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();u.setAttribute("class",x);var _=e.getAttribute("style");_&&u.setAttribute("style",_),u.setAttribute("data-src",l);var w=[].filter.call(e.attributes,function(J){return/^data-\w[\w-]*$/.test(J.name)});if(Array.prototype.forEach.call(w,function(J){J.name&&J.value&&u.setAttribute(J.name,J.value)}),n){var S={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"]},E,b,j,M,I;Object.keys(S).forEach(function(J){E=J,j=S[J],b=u.querySelectorAll(E+"[id]");for(var U=function(L,C){M=b[L].id,I=M+"-"+nn();var N;Array.prototype.forEach.call(j,function(G){N=u.querySelectorAll("["+G+'*="'+M+'"]');for(var Z=0,re=N.length;Z<re;Z++){var ne=N[Z].getAttribute(G);ne&&!ne.match(new RegExp('url\\("?#'+M+'"?\\)'))||N[Z].setAttribute(G,"url(#"+I+")")}});for(var W=u.querySelectorAll("[*|href]"),H=[],B=0,X=W.length;B<X;B++){var K=W[B].getAttributeNS(ht,"href");K&&K.toString()==="#"+b[L].id&&H.push(W[B])}for(var se=0,F=H.length;se<F;se++)H[se].setAttributeNS(ht,"href","#"+I);b[L].id=I},h=0,v=b.length;h<v;h++)U(h)})}u.removeAttribute("xmlns:a");for(var O=u.querySelectorAll("script"),T=[],k,$,P=0,V=O.length;P<V;P++)$=O[P].getAttribute("type"),(!$||$==="application/ecmascript"||$==="application/javascript"||$==="text/javascript")&&(k=O[P].innerText||O[P].textContent,k&&T.push(k),u.removeChild(O[P]));if(T.length>0&&(t==="always"||t==="once"&&!Ut[l])){for(var A=0,Y=T.length;A<Y;A++)new Function(T[A])(window);Ut[l]=!0}var z=u.querySelectorAll("style");if(Array.prototype.forEach.call(z,function(J){J.textContent+=""}),u.setAttribute("xmlns",sn),u.setAttribute("xmlns:xlink",ht),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)})},an=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,l=n.beforeEach,c=l===void 0?function(){}:l,f=n.cacheRequests,u=f===void 0?!0:f,d=n.evalScripts,m=d===void 0?"never":d,p=n.httpRequestWithCredentials,y=p===void 0?!1:p,x=n.renumerateIRIElements,_=x===void 0?!0:x;if(e&&"length"in e)for(var w=0,S=0,E=e.length;S<E;S++)Wt(e[S],m,_,u,y,c,function(b,j){o(b,j),e&&"length"in e&&e.length===++w&&a(w)});else e?Wt(e,m,_,u,y,c,function(b,j){o(b,j),a(1),e=null}):a(0)},Ke={exports:{}},qe={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 Bt;function on(){if(Bt)return Q;Bt=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,l=r?Symbol.for("react.async_mode"):60111,c=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,u=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,d=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,x=r?Symbol.for("react.fundamental"):60117,_=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function S(b){if(typeof b=="object"&&b!==null){var j=b.$$typeof;switch(j){case e:switch(b=b.type,b){case l:case c:case n:case a:case s:case u:return b;default:switch(b=b&&b.$$typeof,b){case o:case f:case d:case m:case i:return b;default:return j}}case t:return j}}}function E(b){return S(b)===c}return Q.AsyncMode=l,Q.ConcurrentMode=c,Q.ContextConsumer=o,Q.ContextProvider=i,Q.Element=e,Q.ForwardRef=f,Q.Fragment=n,Q.Lazy=d,Q.Memo=m,Q.Portal=t,Q.Profiler=a,Q.StrictMode=s,Q.Suspense=u,Q.isAsyncMode=function(b){return E(b)||S(b)===l},Q.isConcurrentMode=E,Q.isContextConsumer=function(b){return S(b)===o},Q.isContextProvider=function(b){return S(b)===i},Q.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Q.isForwardRef=function(b){return S(b)===f},Q.isFragment=function(b){return S(b)===n},Q.isLazy=function(b){return S(b)===d},Q.isMemo=function(b){return S(b)===m},Q.isPortal=function(b){return S(b)===t},Q.isProfiler=function(b){return S(b)===a},Q.isStrictMode=function(b){return S(b)===s},Q.isSuspense=function(b){return S(b)===u},Q.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===c||b===a||b===s||b===u||b===p||typeof b=="object"&&b!==null&&(b.$$typeof===d||b.$$typeof===m||b.$$typeof===i||b.$$typeof===o||b.$$typeof===f||b.$$typeof===x||b.$$typeof===_||b.$$typeof===w||b.$$typeof===y)},Q.typeOf=S,Q}var ee={};/** @license React v16.13.1
33
+ */var Bt;function on(){if(Bt)return Q;Bt=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,l=r?Symbol.for("react.async_mode"):60111,c=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,p=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,x=r?Symbol.for("react.fundamental"):60117,_=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function S(b){if(typeof b=="object"&&b!==null){var j=b.$$typeof;switch(j){case e:switch(b=b.type,b){case l:case c:case n:case a:case s:case u:return b;default:switch(b=b&&b.$$typeof,b){case o:case f:case p:case m:case i:return b;default:return j}}case t:return j}}}function E(b){return S(b)===c}return Q.AsyncMode=l,Q.ConcurrentMode=c,Q.ContextConsumer=o,Q.ContextProvider=i,Q.Element=e,Q.ForwardRef=f,Q.Fragment=n,Q.Lazy=p,Q.Memo=m,Q.Portal=t,Q.Profiler=a,Q.StrictMode=s,Q.Suspense=u,Q.isAsyncMode=function(b){return E(b)||S(b)===l},Q.isConcurrentMode=E,Q.isContextConsumer=function(b){return S(b)===o},Q.isContextProvider=function(b){return S(b)===i},Q.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Q.isForwardRef=function(b){return S(b)===f},Q.isFragment=function(b){return S(b)===n},Q.isLazy=function(b){return S(b)===p},Q.isMemo=function(b){return S(b)===m},Q.isPortal=function(b){return S(b)===t},Q.isProfiler=function(b){return S(b)===a},Q.isStrictMode=function(b){return S(b)===s},Q.isSuspense=function(b){return S(b)===u},Q.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===c||b===a||b===s||b===u||b===d||typeof b=="object"&&b!==null&&(b.$$typeof===p||b.$$typeof===m||b.$$typeof===i||b.$$typeof===o||b.$$typeof===f||b.$$typeof===x||b.$$typeof===_||b.$$typeof===w||b.$$typeof===y)},Q.typeOf=S,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 Ht;function ln(){return Ht||(Ht=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,l=r?Symbol.for("react.async_mode"):60111,c=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,u=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,d=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,x=r?Symbol.for("react.fundamental"):60117,_=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function S(F){return typeof F=="string"||typeof F=="function"||F===n||F===c||F===a||F===s||F===u||F===p||typeof F=="object"&&F!==null&&(F.$$typeof===d||F.$$typeof===m||F.$$typeof===i||F.$$typeof===o||F.$$typeof===f||F.$$typeof===x||F.$$typeof===_||F.$$typeof===w||F.$$typeof===y)}function E(F){if(typeof F=="object"&&F!==null){var G=F.$$typeof;switch(G){case e:var Z=F.type;switch(Z){case l:case c:case n:case a:case s:case u:return Z;default:var re=Z&&Z.$$typeof;switch(re){case o:case f:case d:case m:case i:return re;default:return G}}case t:return G}}}var b=l,j=c,M=o,k=i,O=e,T=f,I=n,$=d,P=m,Y=t,A=a,V=s,z=u,J=!1;function U(F){return J||(J=!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.")),h(F)||E(F)===l}function h(F){return E(F)===c}function v(F){return E(F)===o}function R(F){return E(F)===i}function L(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function C(F){return E(F)===f}function N(F){return E(F)===n}function W(F){return E(F)===d}function H(F){return E(F)===m}function B(F){return E(F)===t}function X(F){return E(F)===a}function K(F){return E(F)===s}function se(F){return E(F)===u}ee.AsyncMode=b,ee.ConcurrentMode=j,ee.ContextConsumer=M,ee.ContextProvider=k,ee.Element=O,ee.ForwardRef=T,ee.Fragment=I,ee.Lazy=$,ee.Memo=P,ee.Portal=Y,ee.Profiler=A,ee.StrictMode=V,ee.Suspense=z,ee.isAsyncMode=U,ee.isConcurrentMode=h,ee.isContextConsumer=v,ee.isContextProvider=R,ee.isElement=L,ee.isForwardRef=C,ee.isFragment=N,ee.isLazy=W,ee.isMemo=H,ee.isPortal=B,ee.isProfiler=X,ee.isStrictMode=K,ee.isSuspense=se,ee.isValidElementType=S,ee.typeOf=E}()),ee}var Gt;function _r(){return Gt||(Gt=1,process.env.NODE_ENV==="production"?qe.exports=on():qe.exports=ln()),qe.exports}/*
40
+ */var Ht;function ln(){return Ht||(Ht=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,l=r?Symbol.for("react.async_mode"):60111,c=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,p=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,x=r?Symbol.for("react.fundamental"):60117,_=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function S(F){return typeof F=="string"||typeof F=="function"||F===n||F===c||F===a||F===s||F===u||F===d||typeof F=="object"&&F!==null&&(F.$$typeof===p||F.$$typeof===m||F.$$typeof===i||F.$$typeof===o||F.$$typeof===f||F.$$typeof===x||F.$$typeof===_||F.$$typeof===w||F.$$typeof===y)}function E(F){if(typeof F=="object"&&F!==null){var G=F.$$typeof;switch(G){case e:var Z=F.type;switch(Z){case l:case c:case n:case a:case s:case u:return Z;default:var re=Z&&Z.$$typeof;switch(re){case o:case f:case p:case m:case i:return re;default:return G}}case t:return G}}}var b=l,j=c,M=o,I=i,O=e,T=f,k=n,$=p,P=m,V=t,A=a,Y=s,z=u,J=!1;function U(F){return J||(J=!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.")),h(F)||E(F)===l}function h(F){return E(F)===c}function v(F){return E(F)===o}function R(F){return E(F)===i}function L(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function C(F){return E(F)===f}function N(F){return E(F)===n}function W(F){return E(F)===p}function H(F){return E(F)===m}function B(F){return E(F)===t}function X(F){return E(F)===a}function K(F){return E(F)===s}function se(F){return E(F)===u}ee.AsyncMode=b,ee.ConcurrentMode=j,ee.ContextConsumer=M,ee.ContextProvider=I,ee.Element=O,ee.ForwardRef=T,ee.Fragment=k,ee.Lazy=$,ee.Memo=P,ee.Portal=V,ee.Profiler=A,ee.StrictMode=Y,ee.Suspense=z,ee.isAsyncMode=U,ee.isConcurrentMode=h,ee.isContextConsumer=v,ee.isContextProvider=R,ee.isElement=L,ee.isForwardRef=C,ee.isFragment=N,ee.isLazy=W,ee.isMemo=H,ee.isPortal=B,ee.isProfiler=X,ee.isStrictMode=K,ee.isSuspense=se,ee.isValidElementType=S,ee.typeOf=E}()),ee}var Gt;function _r(){return Gt||(Gt=1,process.env.NODE_ENV==="production"?qe.exports=on():qe.exports=ln()),qe.exports}/*
41
41
  object-assign
42
42
  (c) Sindre Sorhus
43
43
  @license MIT
44
- */var mt,Kt;function cn(){if(Kt)return mt;Kt=1;var r=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var i={},o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var l=Object.getOwnPropertyNames(i).map(function(f){return i[f]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(f){c[f]=f}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return mt=s()?Object.assign:function(a,i){for(var o,l=n(a),c,f=1;f<arguments.length;f++){o=Object(arguments[f]);for(var u in o)e.call(o,u)&&(l[u]=o[u]);if(r){c=r(o);for(var p=0;p<c.length;p++)t.call(o,c[p])&&(l[c[p]]=o[c[p]])}}return l},mt}var gt,qt;function Dt(){if(qt)return gt;qt=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return gt=r,gt}var yt,zt;function Rr(){return zt||(zt=1,yt=Function.call.bind(Object.prototype.hasOwnProperty)),yt}var bt,Jt;function un(){if(Jt)return bt;Jt=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=Dt(),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,l,c){if(process.env.NODE_ENV!=="production"){for(var f in a)if(n(a,f)){var u;try{if(typeof a[f]!="function"){var p=Error((l||"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 p.name="Invariant Violation",p}u=a[f](i,f,l,o,null,e)}catch(d){u=d}if(u&&!(u instanceof Error)&&r((l||"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=c?c():"";r("Failed "+o+" type: "+u.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},bt=s,bt}var vt,Xt;function fn(){if(Xt)return vt;Xt=1;var r=_r(),e=cn(),t=Dt(),n=Rr(),s=un(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(o){var l="Warning: "+o;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function i(){return null}return vt=function(o,l){var c=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function u(h){var v=h&&(c&&h[c]||h[f]);if(typeof v=="function")return v}var p="<<anonymous>>",m={array:_("array"),bigint:_("bigint"),bool:_("boolean"),func:_("function"),number:_("number"),object:_("object"),string:_("string"),symbol:_("symbol"),any:w(),arrayOf:S,element:E(),elementType:b(),instanceOf:j,node:T(),objectOf:k,oneOf:M,oneOfType:O,shape:$,exact:P};function d(h,v){return h===v?h!==0||1/h===1/v:h!==h&&v!==v}function y(h,v){this.message=h,this.data=v&&typeof v=="object"?v:{},this.stack=""}y.prototype=Error.prototype;function x(h){if(process.env.NODE_ENV!=="production")var v={},R=0;function L(N,W,H,B,X,K,se){if(B=B||p,K=K||H,se!==t){if(l){var F=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 F.name="Invariant Violation",F}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var G=B+":"+H;!v[G]&&R<3&&(a("You are manually calling a React.PropTypes validation function for the `"+K+"` prop on `"+B+"`. 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."),v[G]=!0,R++)}}return W[H]==null?N?W[H]===null?new y("The "+X+" `"+K+"` is marked as required "+("in `"+B+"`, but its value is `null`.")):new y("The "+X+" `"+K+"` is marked as required in "+("`"+B+"`, but its value is `undefined`.")):null:h(W,H,B,X,K)}var C=L.bind(null,!1);return C.isRequired=L.bind(null,!0),C}function _(h){function v(R,L,C,N,W,H){var B=R[L],X=V(B);if(X!==h){var K=z(B);return new y("Invalid "+N+" `"+W+"` of type "+("`"+K+"` supplied to `"+C+"`, expected ")+("`"+h+"`."),{expectedType:h})}return null}return x(v)}function w(){return x(i)}function S(h){function v(R,L,C,N,W){if(typeof h!="function")return new y("Property `"+W+"` of component `"+C+"` has invalid PropType notation inside arrayOf.");var H=R[L];if(!Array.isArray(H)){var B=V(H);return new y("Invalid "+N+" `"+W+"` of type "+("`"+B+"` supplied to `"+C+"`, expected an array."))}for(var X=0;X<H.length;X++){var K=h(H,X,C,N,W+"["+X+"]",t);if(K instanceof Error)return K}return null}return x(v)}function E(){function h(v,R,L,C,N){var W=v[R];if(!o(W)){var H=V(W);return new y("Invalid "+C+" `"+N+"` of type "+("`"+H+"` supplied to `"+L+"`, expected a single ReactElement."))}return null}return x(h)}function b(){function h(v,R,L,C,N){var W=v[R];if(!r.isValidElementType(W)){var H=V(W);return new y("Invalid "+C+" `"+N+"` of type "+("`"+H+"` supplied to `"+L+"`, expected a single ReactElement type."))}return null}return x(h)}function j(h){function v(R,L,C,N,W){if(!(R[L]instanceof h)){var H=h.name||p,B=U(R[L]);return new y("Invalid "+N+" `"+W+"` of type "+("`"+B+"` supplied to `"+C+"`, expected ")+("instance of `"+H+"`."))}return null}return x(v)}function M(h){if(!Array.isArray(h))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 v(R,L,C,N,W){for(var H=R[L],B=0;B<h.length;B++)if(d(H,h[B]))return null;var X=JSON.stringify(h,function(se,F){var G=z(F);return G==="symbol"?String(F):F});return new y("Invalid "+N+" `"+W+"` of value `"+String(H)+"` "+("supplied to `"+C+"`, expected one of "+X+"."))}return x(v)}function k(h){function v(R,L,C,N,W){if(typeof h!="function")return new y("Property `"+W+"` of component `"+C+"` has invalid PropType notation inside objectOf.");var H=R[L],B=V(H);if(B!=="object")return new y("Invalid "+N+" `"+W+"` of type "+("`"+B+"` supplied to `"+C+"`, expected an object."));for(var X in H)if(n(H,X)){var K=h(H,X,C,N,W+"."+X,t);if(K instanceof Error)return K}return null}return x(v)}function O(h){if(!Array.isArray(h))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var v=0;v<h.length;v++){var R=h[v];if(typeof R!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+J(R)+" at index "+v+"."),i}function L(C,N,W,H,B){for(var X=[],K=0;K<h.length;K++){var se=h[K],F=se(C,N,W,H,B,t);if(F==null)return null;F.data&&n(F.data,"expectedType")&&X.push(F.data.expectedType)}var G=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new y("Invalid "+H+" `"+B+"` supplied to "+("`"+W+"`"+G+"."))}return x(L)}function T(){function h(v,R,L,C,N){return Y(v[R])?null:new y("Invalid "+C+" `"+N+"` supplied to "+("`"+L+"`, expected a ReactNode."))}return x(h)}function I(h,v,R,L,C){return new y((h||"React class")+": "+v+" type `"+R+"."+L+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+C+"`.")}function $(h){function v(R,L,C,N,W){var H=R[L],B=V(H);if(B!=="object")return new y("Invalid "+N+" `"+W+"` of type `"+B+"` "+("supplied to `"+C+"`, expected `object`."));for(var X in h){var K=h[X];if(typeof K!="function")return I(C,N,W,X,z(K));var se=K(H,X,C,N,W+"."+X,t);if(se)return se}return null}return x(v)}function P(h){function v(R,L,C,N,W){var H=R[L],B=V(H);if(B!=="object")return new y("Invalid "+N+" `"+W+"` of type `"+B+"` "+("supplied to `"+C+"`, expected `object`."));var X=e({},R[L],h);for(var K in X){var se=h[K];if(n(h,K)&&typeof se!="function")return I(C,N,W,K,z(se));if(!se)return new y("Invalid "+N+" `"+W+"` key `"+K+"` supplied to `"+C+"`.\nBad object: "+JSON.stringify(R[L],null," ")+`
45
- Valid keys: `+JSON.stringify(Object.keys(h),null," "));var F=se(H,K,C,N,W+"."+K,t);if(F)return F}return null}return x(v)}function Y(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(Y);if(h===null||o(h))return!0;var v=u(h);if(v){var R=v.call(h),L;if(v!==h.entries){for(;!(L=R.next()).done;)if(!Y(L.value))return!1}else for(;!(L=R.next()).done;){var C=L.value;if(C&&!Y(C[1]))return!1}}else return!1;return!0;default:return!1}}function A(h,v){return h==="symbol"?!0:v?v["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&v instanceof Symbol:!1}function V(h){var v=typeof h;return Array.isArray(h)?"array":h instanceof RegExp?"object":A(v,h)?"symbol":v}function z(h){if(typeof h>"u"||h===null)return""+h;var v=V(h);if(v==="object"){if(h instanceof Date)return"date";if(h instanceof RegExp)return"regexp"}return v}function J(h){var v=z(h);switch(v){case"array":case"object":return"an "+v;case"boolean":case"date":case"regexp":return"a "+v;default:return v}}function U(h){return!h.constructor||!h.constructor.name?p:h.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},vt}var xt,Zt;function dn(){if(Zt)return xt;Zt=1;var r=Dt();function e(){}function t(){}return t.resetWarningCache=e,xt=function(){function n(i,o,l,c,f,u){if(u!==r){var p=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 p.name="Invariant Violation",p}}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},xt}var Qt;function pn(){if(Qt)return Ke.exports;if(Qt=1,process.env.NODE_ENV!=="production"){var r=_r(),e=!0;Ke.exports=fn()(r.isElement,e)}else Ke.exports=dn()();return Ke.exports}var ie=pn(),hn=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},mn=function(e,t){for(var n in e)if(!(n in t))return!0;for(var s in t)if(e[s]!==t[s])return!0;return!1},gn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],ze="http://www.w3.org/2000/svg",er="http://www.w3.org/1999/xlink",ke=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}Jr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof hn(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,l=a.httpRequestWithCredentials,c=a.renumerateIRIElements,f=a.src,u=a.title,p=a.useRequestCache,m=this.props.onError,d=this.props.beforeInjection,y=this.props.afterInjection,x=this.props.wrapper,_,w;x==="svg"?(_=document.createElementNS(ze,x),_.setAttribute("xmlns",ze),_.setAttribute("xmlns:xlink",er),w=document.createElementNS(ze,x)):(_=document.createElement(x),w=document.createElement(x)),_.appendChild(w),w.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(_);var S=function(M){if(s.removeSVG(),!s._isMounted){m(M);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){m(M)})},E=function(M,k){if(M){S(M);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{y(k)}catch(O){S(O)}})},b=function(M){if(M.setAttribute("role","img"),i){var k=M.querySelector(":scope > desc");k&&M.removeChild(k);var O=document.createElement("desc");O.innerHTML=i,M.prepend(O)}if(u){var T=M.querySelector(":scope > title");T&&M.removeChild(T);var I=document.createElement("title");I.innerHTML=u,M.prepend(I)}try{d(M)}catch($){S($)}};an(w,{afterEach:E,beforeEach:b,cacheRequests:p,evalScripts:o,httpRequestWithCredentials:l,renumerateIRIElements:c})}},t.removeSVG=function(){var s;(s=this.nonReactWrapper)!=null&&s.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},t.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},t.componentDidUpdate=function(s){var a=this;mn(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,l=zr(s,gn),c=o;return Be.createElement(c,tt({},l,{ref:this.refCallback},o==="svg"?{xmlns:ze,xmlnsXlink:er}:{}),this.state.isLoading&&i&&Be.createElement(i,null),this.state.hasError&&a&&Be.createElement(a,null))},e}(Be.Component);ke.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};ke.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 Et={assets:"/"};const yn=r=>{Et={...Et,...r}},tr=r=>`${Et.assets}/${r}`.replace(/\/+/g,"/"),oe=D.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:l,isInteractable:c=!1,spin:f=!1,title:u,tabIndex:p})=>{const[m,d]=D.useState(r),y=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),x=y&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),_=tr(`assets/svg/${r}.svg`),w=tr(`assets/svg/${n}.svg`),S={img:`${c?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${c?"smp-icon-interactable":""} ${f?"smp-icon-spin":""}`},E=()=>{!a&&c&&l&&l()},b=j=>{!a&&c&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),E())};return g.jsx(g.Fragment,{children:x?g.jsx(ke,{src:r,fallback:()=>g.jsx(ke,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:S.svg,onClick:E,onKeyDown:b,tabIndex:p}):y?g.jsx("img",{src:m,width:e||"16px",height:t||"auto",alt:u,onError:()=>d(w),onClick:E,className:S.img,title:u,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&E()}}):g.jsx(ke,{src:_,fallback:()=>g.jsx(ke,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:S.svg,onClick:E,onKeyDown:b,tabIndex:p})})}),rr=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],nr=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],Se=({bindValue:r,onClick:e,ariaLabel:t,icon:n,disabled:s,sizing:a="base",variant:i="primary",appearance:o="raised",showIcon:l=!0,showText:c=!0,fullWidth:f=!1,loading:u=!1,justify:p="center",title:m,optionalDisplayValue:d,squared:y=!1,submit:x=!1})=>{const _={container:`smp-button smp-button-container ${a?`smp-button-${a}`:""} ${i?`smp-buttonVariant-${i}`:""} ${o?`smp-buttonType-${o}`:""} ${f?"smp-button-fullWidth":""} smp-justifyContent-${p} ${y&&!c?"smp-button-squared":""}`};return g.jsx("button",{"data-component":"button",type:x?"submit":"button",className:_.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":u,title:m||d,children:u?g.jsx(oe,{icon:"spinner",state:nr(i),spin:!0}):g.jsxs(g.Fragment,{children:[n&&l&&g.jsx(oe,{icon:n,disabled:s,state:nr(i),width:rr(a),height:rr(a)}),c&&g.jsx("span",{children:d||r})]})})},bn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},_e=({variant:r="body",bindValue:e,color:t,...n})=>{const s=bn[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return g.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},ye={"smp-tabbar-container":"_smp-tabbar-container_1scvh_1","smp-tabbar-scroll-button":"_smp-tabbar-scroll-button_1scvh_8","smp-tabbar-scroll-buttonRight":"_smp-tabbar-scroll-buttonRight_1scvh_13","smp-tabbar-scroll-buttonLeft":"_smp-tabbar-scroll-buttonLeft_1scvh_17","smp-tabbar-list-wrapper":"_smp-tabbar-list-wrapper_1scvh_21","smp-tabbar-list":"_smp-tabbar-list_1scvh_21","smp-tabbar-tab":"_smp-tabbar-tab_1scvh_38","smp-active":"_smp-active_1scvh_62","smp-tabbar-tab-extraSmall":"_smp-tabbar-tab-extraSmall_1scvh_75","smp-tabbar-tab-small":"_smp-tabbar-tab-small_1scvh_80","smp-tabbar-tab-base":"_smp-tabbar-tab-base_1scvh_85","smp-tabbar-tab-large":"_smp-tabbar-tab-large_1scvh_90","smp-tabbar-tab-extraLarge":"_smp-tabbar-tab-extraLarge_1scvh_95"},Dr=({data:r,sizing:e="large",toolbar:t=!0,selectedIndex:n,onTabChange:s})=>{const[a,i]=D.useState(0),o=n??a,[l,c]=D.useState(!1),[f,u]=D.useState(!1),p=D.useRef(null);if(D.useEffect(()=>{const S=p.current;if(!S)return;x();const E=()=>x();return S.addEventListener("scroll",E),window.addEventListener("resize",x),()=>{S.removeEventListener("scroll",E),window.removeEventListener("resize",x)}},[]),!r.children||r.children.length===0)return g.jsx("div",{className:"tab-bar-empty",children:"No tabs available"});const m={container:ye["smp-tabbar-container"],listWrapper:ye["smp-tabbar-list-wrapper"],list:ye["smp-tabbar-list"],tab:`${ye["smp-tabbar-tab"]} ${e?ye[`smp-tabbar-tab-${e}`]:""}`,scrollButtonRight:`${ye["smp-tabbar-scroll-button"]} ${ye["smp-tabbar-scroll-buttonRight"]}`,scrollButtonLeft:`${ye["smp-tabbar-scroll-button"]} ${ye["smp-tabbar-scroll-buttonLeft"]}`,active:ye["smp-active"]},d=100,y=2,x=()=>{const S=p.current;S&&(c(S.scrollLeft>0),u(S.scrollLeft+S.clientWidth<S.scrollWidth-y))},_=()=>{var S;(S=p.current)==null||S.scrollBy({left:-d,behavior:"smooth"})},w=()=>{var S;(S=p.current)==null||S.scrollBy({left:d,behavior:"smooth"})};return g.jsxs("div",{className:m.container,role:"tabpanel","data-component":"tab-bar",children:[l&&g.jsx("div",{className:m.scrollButtonLeft,children:g.jsx(Se,{bindValue:"",optionalDisplayValue:"<",onClick:_,variant:"base",sizing:e})}),g.jsx("div",{className:m.listWrapper,children:g.jsx("div",{className:m.list,ref:p,role:"tablist",children:r.children.map((S,E)=>g.jsxs("button",{type:"button",className:`${E===a?m.active:""} ${m.tab} `,role:"tab","aria-selected":E===o,tabIndex:E===o?0:-1,onClick:()=>{s&&s(E),i(E)},children:[S.icon&&g.jsx(oe,{icon:S.icon,placeholderIcon:S.placeholderIcon}),g.jsx(_e,{variant:"body",bindValue:S.decode||"Tab[object Object]"}),t&&(o===E?g.jsx(oe,{icon:"more_vert",placeholderIcon:S.placeholderIcon,isInteractable:!0,onClick:()=>{console.log("clicked icon")}}):g.jsx(oe,{icon:"empty"}))]},E))})}),f&&g.jsx("div",{className:m.scrollButtonRight,children:g.jsx(Se,{bindValue:"",optionalDisplayValue:">",onClick:w,variant:"base",sizing:e})})]})},rt=({children:r,layout:e={horizontal:!1,sectionsType:"tab",sections:[{id:"1",content:Array.isArray(r)?r.map(t=>({id:t.props.id})):[{id:r.props.id}]}]}})=>{const[t,n]=D.useState(0),s={};D.Children.forEach(r,d=>{D.isValidElement(d)&&(s[d.props.id]=d)});const a="--smp-grid-template-cols",i="--smp-grid-template-rows",o=Er(e.sections??[],Object.keys(s)),l=d=>d.reduce((y,x)=>{var b,j;let _="",w={},S={},E="";return(b=x.sections)!=null&&b.length?(_=pe["smp-layout-section-grid"],w=l(x.sections),x.gridCols===void 0&&(E=pe[x.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"],(x.horizontal||Mt(x.sections))&&(S=Nt(x.sections,x.horizontal?a:i)))):(j=x.content)!=null&&j.length&&(x.gridCols!==void 0&&x.gridCols>0?(_=pe["smp-layout-section-grid"],E=pe["smp-grid-template-cols"],S={[a]:`repeat(${x.gridCols}, 1fr)`}):_=pe["smp-layout-section-flex"]),{...y,...w,[x.id]:{classes:`${_} ${pe[x.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${E} ${x.justify?`smp-justifyContent-${x.justify}`:""} ${x.align?`smp-alignItems-${x.align}`:""}`,styles:S}}},{}),c=l(o),f=`${pe["smp-layout"]} ${e.horizontal?pe["smp-layout-horizontal"]:pe["smp-layout-vertical"]}`,u=e.horizontal||Mt(e.sections||[])?Nt(o,e.horizontal?a:i):{},p=(d,y)=>{var _,w;const x=g.jsx("div",{"smp-id":`section-${d.id}`,className:c[d.id].classes,style:c[d.id].styles,children:(_=d.sections)!=null&&_.length?d.sections.map(S=>p(S)):(w=d.content)==null?void 0:w.map(S=>m(S,d.justify,d.align))},`section-${d.id}`);return d.title&&!y?g.jsxs("div",{className:pe["smp-layout-section-with-title"],children:[g.jsx("span",{className:`${pe["smp-layout-section-title"]} ${d.justify?`smp-justifyContent-${d.justify}`:""} ${d.align?`smp-alignItems-${d.align}`:""}`,children:g.jsx(De,{label:d.title})}),x]},`title-section-${d.id}`):x},m=(d,y,x)=>{const _=s[d.id];if(!_)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},E=`${pe["smp-layout-cell-container"]} ${y?`smp-justifyContent-${y}`:""} ${x?`smp-alignItems-${x}`:""}`;return g.jsx("div",{className:E,style:S,"smp-id":d.id,children:_},d.id)};return g.jsxs("div",{className:f,style:u,"smp-id":"layout",children:[e.sectionsType==="tab"&&e.sections&&(e==null?void 0:e.sections.length)>1&&g.jsx(Dr,{data:{type:"SmeupDataTree",children:o.map(d=>({decode:d.title||d.id||"Tab",obj:{t:"",p:"",k:""},placeholderIcon:"tab",cells:{},children:[],shape:void 0}))},selectedIndex:t,onTabChange:n,toolbar:!1}),e.sectionsType?p(o[t],!0):o.map(d=>p(d))]})},te={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"},vn=r=>r.t=="D8",xn=r=>r.t=="I1",Sn=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 nt{constructor(e,t){de(this,"class");de(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new nt(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 wn(r,e){if(jt(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,l=0,c="";switch(n.length){case 1:case 2:return o=parseInt(n),t.setDate(o),Je(t)?t:r;case 3:case 4:return o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),i===0?(t.setMonth(o-1),t.setDate(l)):a===0&&(t.setMonth(l-1),t.setDate(o)),Je(t)?t:r;case 5:case 6:{o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),Number(n.substring(4))>50?c="19"+n.substring(4):c="20"+n.substring(4);let f=0,u=0;return i===0?(f=l,u=o-1,t.setFullYear(parseInt(c),u,f)):a===0&&(f=o,u=l-1,t.setFullYear(parseInt(c),u,f)),Tt(o,u,parseInt(c))&&Je(t)?t:r}case 7:case 8:{o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),c=n.substring(4);let f=0,u=0;return i===0?(f=l,u=o-1,t.setFullYear(parseInt(c),u,f)):a===0&&(f=o,u=l-1,t.setFullYear(parseInt(c),u,f)),Tt(f,u,parseInt(c))&&Je(t)?t:r}}return r}function jt(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function Je(r){return r instanceof Date&&!isNaN(r.getTime())}function En(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 Tt(n,t-1,e)}function Tt(r,e,t){const n=[31,Tn(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Tn(r){return r%4===0&&(r%100!==0||r%400===0)}function On(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 st{constructor(e,t){de(this,"class");de(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=sr.get(`${e.t}${e.p}`);if(t)return new st(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=sr.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 sr=new Map([["D8*YYMD",{legacyToIso(r){return En(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return jt(r)&&r.replaceAll("-","")||r}}]]);function ct({position:r="bottom",enabled:e=!0}){const t=D.useRef(null),n=D.useRef(null),[s,a]=D.useState(0),i=D.useCallback(()=>{const o=t.current,l=n.current;if(!o||!l)return;const{top:c,left:f,width:u,height:p}=o.getBoundingClientRect();a(u);const m=l.offsetHeight,d=l.offsetWidth;if(d===0||m===0){requestAnimationFrame(i);return}let y=c+window.scrollY,x=f+window.scrollX;switch(r){case"top":y-=m;break;case"bottom":y+=p;break;case"left":x-=d;break;case"right":x+=u;break}requestAnimationFrame(()=>{l.style.transform=`translate(${x}px, ${y}px)`,l.style.opacity="1"})},[r]);return D.useLayoutEffect(()=>{if(!e)return;let o;const l=()=>{const f=t.current,u=n.current;f&&u?i():o=requestAnimationFrame(l)};o=requestAnimationFrame(l);const c=new MutationObserver(()=>{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 Pe=(r,e,t)=>{if(r==""&&(e==""||e==null))return"";if(t)switch(t){case"CodeOnly":return r;case"DescOnly":return e||"";case"Both":return`${r} - ${e}`}return r},jr=({helperText:r,disabled:e,state:t,id:n})=>{const s={container:`smp-helper-text ${e?"smp-helper-text-disabled":""} ${t?`smp-helper-text-${t}`:""}`};return g.jsx("label",{className:s.container,id:n,children:r})},he={"smp-textfield-wrapper":"_smp-textfield-wrapper_ep1c3_4","smp-textfield":"_smp-textfield_ep1c3_4","smp-textfield-variant-notSelectable":"_smp-textfield-variant-notSelectable_ep1c3_29","smp-textfield-extraSmall":"_smp-textfield-extraSmall_ep1c3_35","smp-textfield-small":"_smp-textfield-small_ep1c3_40","smp-textfield-medium":"_smp-textfield-medium_ep1c3_45","smp-textfield-large":"_smp-textfield-large_ep1c3_50","smp-textfield-extraLarge":"_smp-textfield-extraLarge_ep1c3_55","smp-textfield-input":"_smp-textfield-input_ep1c3_61","smp-textfield-outlined":"_smp-textfield-outlined_ep1c3_84","smp-textfield-danger":"_smp-textfield-danger_ep1c3_95","smp-textfield-readOnly":"_smp-textfield-readOnly_ep1c3_99","smp-textfield-disabled":"_smp-textfield-disabled_ep1c3_114","smp-textfield-fullWidth":"_smp-textfield-fullWidth_ep1c3_123","smp-textfield-top-right-indicator":"_smp-textfield-top-right-indicator_ep1c3_127"},we=({disabled:r,bindValue:e,icon:t,placeholder:n,isEditable:s=!0,shapeIcon:a,sizing:i,state:o,variant:l,tooltip:c=!1,rotatedShapeIcon:f=!1,ref:u,inputRef:p,inputType:m="text",ariaLabel:d="input field",label:y,helperText:x=!1,error:_,appearance:w="base",fullWidth:S=!1,_dataComponent:E="textfield",min:b,max:j,step:M,inputMode:k="text",width:O,autocomplete:T,size:I,maxLength:$,onBlur:P,onChange:Y,onKeyDown:A,onShapeIconClick:V,onClick:z})=>{const J=D.useId(),U=`${J}-helper`,h=_?"danger":o,v=_||o=="danger"?"error":a,R=x||!!_,L=W=>{Y==null||Y(W.target.value)},C={wrapper:`${he["smp-textfield-wrapper"]} ${S?he["smp-textfield-fullWidth"]:""}`,container:`${he["smp-textfield"]} ${r?he["smp-textfield-disabled"]:""} ${n?he["smp-textfield-placeholder"]:""} ${i?he[`smp-textfield-${i}`]:""} ${h?he[`smp-textfield-${h}`]:""} ${w?he[`smp-textfield-${w}`]:""} ${s?"":he["smp-textfield-readOnly"]} ${c?he["smp-textfield-top-right-indicator"]:""}`,input:`${he["smp-textfield-input"]}`};if(l&&(l!=="notSelectable"||s)){const W=he[`smp-textfield-variant-${l}`];W&&(C.container+=` ${W}`)}const N=O?{"--smp-textField-width-base":O}:void 0;return g.jsxs("div",{className:C.wrapper,"data-component":E,children:[y&&g.jsx(De,{label:y,disabled:r,htmlFor:J}),g.jsxs("div",{className:C.container,ref:u,style:N,children:[t&&g.jsx(oe,{icon:t,disabled:r}),g.jsx("input",{id:J,type:m,value:e,placeholder:n,onChange:L,onBlur:P,className:C.input,disabled:r,readOnly:!s,onKeyDown:A,"aria-label":d,ref:p,"aria-describedby":R?U:void 0,min:b,max:j,step:M,inputMode:k,autoComplete:T,size:I,maxLength:$,onClick:z}),v&&g.jsx(oe,{icon:v,disabled:r,state:h,onClick:V,rotated:f,isInteractable:s,tabIndex:0})]}),R&&g.jsx(jr,{helperText:_,disabled:r,state:h,id:U})]})};function $r({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=D.useState(0),i=D.useRef(null),o=r.length*e,l=Math.max(0,Math.floor(s/e)-n),c=Math.min(r.length-1,Math.floor((s+t)/e)+n),f=[];for(let m=l;m<=c;m++)f.push({item:r[m],index:m,offsetTop:m*e});const u=D.useCallback(m=>{const d=m.target.scrollTop;a(d)},[]),p=m=>{if(!i.current)return;const d=m*e,y=d+e,x=i.current,_=x.scrollTop,w=_+t;d<_?x.scrollTop=d:y>w&&(x.scrollTop=y-t)};return{virtualItems:f,containerProps:{ref:i,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:u},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:o,startIndex:l,endIndex:c},scrollToIndex:p}}const Xe={"smp-list":"_smp-list_6ni6l_1","smp-list-container":"_smp-list-container_6ni6l_12","smp-list-listItem":"_smp-list-listItem_6ni6l_17"};function _n(r,e,t="14px IBM Plex Sans, sans-serif",n=32){const a=document.createElement("canvas").getContext("2d");if(!a)return 200;a.font=t;let i=0;for(const o of r){const l=Pe(o.id,o.label,e),c=a.measureText(l);i=Math.max(i,c.width)}return Math.ceil(i+n)}const Rn=10,Cr=({id:r,options:e,displayMode:t="Both",ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:l,onKeyDown:c,isOpen:f})=>{var Y;const[u,p]=D.useState(""),m=40,[d,y]=D.useState(a!==null?a:-1),[x,_]=D.useState(o||200),w=D.useRef(null),S=s!==void 0?s:e.length>Rn,E=u?e.filter(A=>A.label.toLowerCase().includes(u.toLowerCase())):e,b=A=>{p(A)},{virtualItems:j,containerProps:M,innerProps:k,scrollToIndex:O}=$r({items:E,itemHeight:m,containerHeight:200,overscan:5});D.useEffect(()=>{a!==null&&a!==d&&y(a)},[a]),D.useEffect(()=>{d>=0&&d<E.length&&O(d)},[d,E]),D.useEffect(()=>{f&&(w!=null&&w.current)&&w.current.focus()},[f,w]),D.useEffect(()=>{const A=_n(e,t);_(A)},[e,t]);const T=A=>{if(A.key==="ArrowDown"||A.key==="ArrowUp"){A.preventDefault();let V=d;A.key==="ArrowDown"?V=d<E.length-1?d+1:0:A.key==="ArrowUp"&&(V=d>0?d-1:E.length-1),y(V)}else A.key==="Enter"?d>=0&&d<E.length&&(l==null||l(E[d])):A.key==="Escape"&&(A.preventDefault(),A.stopPropagation());c&&c(A)},I=A=>{T(A)},$=A=>{T(A)},P={wrapper:`${Xe["smp-list"]}`,container:`${Xe["smp-list-container"]}`,virtualScroll:`${Xe["smp-list-virtualScroll"]}`,listItem:`${Xe["smp-list-listItem"]}`};return g.jsxs("div",{id:r,ref:n,className:P.wrapper,"data-component":"list",style:{width:x,minWidth:o},children:[S&&g.jsx(we,{bindValue:u,placeholder:"Search...",fullWidth:!0,onChange:b,onKeyDown:I,inputRef:w}),g.jsx("div",{...M,className:P.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:$,"aria-activedescendant":d>=0&&d<E.length?(Y=E[d])==null?void 0:Y.id:void 0,children:g.jsx("div",{...k,className:P.virtualScroll,children:j.map(({item:A,index:V,offsetTop:z})=>{const J=i.includes(A.id);return g.jsxs("li",{role:"option",id:A.id,"aria-selected":d===V?"true":"false",tabIndex:-1,className:`${P.listItem} ${d===V?"selected-item":""}`,"aria-label":A.id+"-"+A.label,style:{height:`${m}px`,lineHeight:`calc(${m}px - 2*2px)`,transform:`translateY(${z}px)`},onClick:()=>{l==null||l(A),y(V)},children:[Pe(A.id,A.label,t),J&&g.jsx(oe,{icon:"check",width:16})]},A.id)})})})]})},$t=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=D.useState(Pe(e,t,r));return D.useEffect(()=>{a(e)},[e]),D.useEffect(()=>{a(Pe(e,t,r))},[t,r]),g.jsx(we,{...n,bindValue:s})},Dn=r=>{const e=D.useRef(null);return D.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}};function ut({children:r}){const[e,t]=D.useState(!1);return D.useEffect(()=>{t(!0)},[]),e?Wr.createPortal(r,document.body):null}const ft=(r,e,t)=>{D.useEffect(()=>{if(!e)return;const n=s=>{(r==null?void 0:r.some(i=>{if(typeof i=="object"&&i!==null&&"current"in i){const o=i==null?void 0:i.current;return o&&o.contains(s.target)}}))||t()};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[r,t,e])},q=r=>typeof r=="string",Me=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},ar=r=>r==null?"":""+r,jn=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},$n=/###/g,ir=r=>r&&r.indexOf("###")>-1?r.replace($n,"."):r,or=r=>!r||q(r),Ve=(r,e,t)=>{const n=q(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(or(r))return{};const a=ir(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return or(r)?{}:{obj:r,k:ir(n[s])}},lr=(r,e,t)=>{const{obj:n,k:s}=Ve(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=Ve(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=Ve(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},Cn=(r,e,t,n)=>{const{obj:s,k:a}=Ve(r,e,Object);s[a]=s[a]||[],s[a].push(t)},at=(r,e)=>{const{obj:t,k:n}=Ve(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},In=(r,e,t)=>{const n=at(r,t);return n!==void 0?n:at(e,t)},Ir=(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]):Ir(r[n],e[n],t):r[n]=e[n]);return r},Ce=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Ln={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const kn=r=>q(r)?r.replace(/[&<>"'\/]/g,e=>Ln[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 An=[" ",",","?","!",";"],Nn=new Pn(20),Mn=(r,e,t)=>{e=e||"",t=t||"";const n=An.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=Nn.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},Ot=(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 l=a;l<n.length;++l)if(l!==a&&(o+=t),o+=n[l],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&l<n.length-1)continue;a+=l-a+1;break}s=i}return s},Ye=r=>r==null?void 0:r.replace("_","-"),Fn={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 it{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Fn,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 it(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new it(this.logger,e)}}var be=new it;class dt{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 cr extends dt{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 c,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 l=at(this.data,o);return!l&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),l||!i||!q(n)?l:Ot((f=(c=this.data)==null?void 0:c[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),lr(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 l=at(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Ir(l,n,a):l={...l,...n},lr(this.data,o,l),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 Lr={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 ur={},fr=r=>!q(r)&&typeof r!="boolean"&&typeof r!="number";class ot extends dt{constructor(e,t={}){super(),jn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=be.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&&!Mn(e,n,s);if(i&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:q(a)?[a]:a};const c=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(c[0])>-1)&&(a=c.shift()),e=c.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:l}=this.extractFromKey(e[e.length-1],s),c=l[l.length-1];let f=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const u=s.lng||this.language,p=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((u==null?void 0:u.toLowerCase())==="cimode")return p?a?{res:`${c}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:`${c}${f}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:o;const m=this.resolve(e,s);let d=m==null?void 0:m.res;const y=(m==null?void 0:m.usedKey)||o,x=(m==null?void 0:m.exactUsedKey)||o,_=["[object Number]","[object Function]","[object RegExp]"],w=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,E=s.count!==void 0&&!q(s.count),b=ot.hasDefaultValue(s),j=E?this.pluralResolver.getSuffix(u,s.count,s):"",M=s.ordinal&&E?this.pluralResolver.getSuffix(u,s.count,{ordinal:!1}):"",k=E&&!s.ordinal&&s.count===0,O=k&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${j}`]||s[`defaultValue${M}`]||s.defaultValue;let T=d;S&&!d&&b&&(T=O);const I=fr(T),$=Object.prototype.toString.apply(T);if(S&&T&&I&&_.indexOf($)<0&&!(q(w)&&Array.isArray(T))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const P=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,T,{...s,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(m.res=P,m.usedParams=this.getUsedParamsDetails(s),m):P}if(i){const P=Array.isArray(T),Y=P?[]:{},A=P?x:y;for(const V in T)if(Object.prototype.hasOwnProperty.call(T,V)){const z=`${A}${i}${V}`;b&&!d?Y[V]=this.translate(z,{...s,defaultValue:fr(O)?O[V]:void 0,joinArrays:!1,ns:l}):Y[V]=this.translate(z,{...s,joinArrays:!1,ns:l}),Y[V]===z&&(Y[V]=T[V])}d=Y}}else if(S&&q(w)&&Array.isArray(d))d=d.join(w),d&&(d=this.extendTranslation(d,e,s,n));else{let P=!1,Y=!1;!this.isValidLookup(d)&&b&&(P=!0,d=O),this.isValidLookup(d)||(Y=!0,d=o);const V=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Y?void 0:d,z=b&&O!==d&&this.options.updateMissing;if(Y||P||z){if(this.logger.log(z?"updateKey":"missingKey",u,c,o,z?O:d),i){const v=this.resolve(o,{...s,keySeparator:!1});v&&v.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 J=[];const U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&U&&U[0])for(let v=0;v<U.length;v++)J.push(U[v]);else this.options.saveMissingTo==="all"?J=this.languageUtils.toResolveHierarchy(s.lng||this.language):J.push(s.lng||this.language);const h=(v,R,L)=>{var N;const C=b&&L!==d?L:V;this.options.missingKeyHandler?this.options.missingKeyHandler(v,c,R,C,z,s):(N=this.backendConnector)!=null&&N.saveMissing&&this.backendConnector.saveMissing(v,c,R,C,z,s),this.emit("missingKey",v,c,R,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&E?J.forEach(v=>{const R=this.pluralResolver.getSuffixes(v,s);k&&s[`defaultValue${this.options.pluralSeparator}zero`]&&R.indexOf(`${this.options.pluralSeparator}zero`)<0&&R.push(`${this.options.pluralSeparator}zero`),R.forEach(L=>{h([v],o+L,s[`defaultValue${L}`]||O)})}):h(J,o,O))}d=this.extendTranslation(d,e,s,m,n),Y&&d===o&&this.options.appendNamespaceToMissingKey&&(d=`${c}${f}${o}`),(Y||P)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${f}${o}`:o,P?d:void 0,s))}return a?(m.res=d,m.usedParams=this.getUsedParamsDetails(s),m):d}extendTranslation(e,t,n,s,a){var l,c;if((l=this.i18nFormat)!=null&&l.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)&&(((c=n==null?void 0:n.interpolation)==null?void 0:c.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 p=n.replace&&!q(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),e=this.interpolator.interpolate(e,p,n.lng||this.language||s.usedLng,n),f){const m=e.match(this.interpolator.nestingRegexp),d=m&&m.length;u<d&&(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=Lr.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(l=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(l,t),f=c.key;s=f;let u=c.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const p=t.count!==void 0&&!q(t.count),m=p&&!t.ordinal&&t.count===0,d=t.context!==void 0&&(q(t.context)||typeof t.context=="number")&&t.context!=="",y=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(x=>{var _,w;this.isValidLookup(n)||(o=x,!ur[`${y[0]}-${x}`]&&((_=this.utils)!=null&&_.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.hasLoadedNamespace(o))&&(ur[`${y[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${y.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(S=>{var j;if(this.isValidLookup(n))return;i=S;const E=[f];if((j=this.i18nFormat)!=null&&j.addLookupKeys)this.i18nFormat.addLookupKeys(E,f,S,x,t);else{let M;p&&(M=this.pluralResolver.getSuffix(S,t.count,t));const k=`${this.options.pluralSeparator}zero`,O=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(E.push(f+M),t.ordinal&&M.indexOf(O)===0&&E.push(f+M.replace(O,this.options.pluralSeparator)),m&&E.push(f+k)),d){const T=`${f}${this.options.contextSeparator}${t.context}`;E.push(T),p&&(E.push(T+M),t.ordinal&&M.indexOf(O)===0&&E.push(T+M.replace(O,this.options.pluralSeparator)),m&&E.push(T+k))}}let b;for(;b=E.pop();)this.isValidLookup(n)||(a=b,n=this.getResource(S,x,b,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 dr{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=be.create("languageUtils")}getScriptPartFromCode(e){if(e=Ye(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=Ye(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 pr={zero:0,one:1,two:2,few:3,many:4,other:5},hr={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Vn{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=be.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Ye(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!"),hr;if(!e.match(/-|_/))return hr;const l=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(l,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)=>pr[s]-pr[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 mr=(r,e,t,n=".",s=!0)=>{let a=In(r,e,t);return!a&&s&&q(t)&&(a=Ot(r,t,n),a===void 0&&(a=Ot(e,t,n))),a},St=r=>r.replace(/\$/g,"$$$$");class Yn{constructor(e={}){var t;this.logger=be.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:l,formatSeparator:c,unescapeSuffix:f,unescapePrefix:u,nestingPrefix:p,nestingPrefixEscaped:m,nestingSuffix:d,nestingSuffixEscaped:y,nestingOptionsSeparator:x,maxReplaces:_,alwaysFormat:w}=e.interpolation;this.escape=t!==void 0?t:kn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Ce(a):i||"{{",this.suffix=o?Ce(o):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=f?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=p?Ce(p):m||Ce("$t("),this.nestingSuffix=d?Ce(d):y||Ce(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=_||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 l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=d=>{if(d.indexOf(this.formatSeparator)<0){const w=mr(t,l,d,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,n,{...s,...t,interpolationkey:d}):w}const y=d.split(this.formatSeparator),x=y.shift().trim(),_=y.join(this.formatSeparator).trim();return this.format(mr(t,l,x,this.options.keySeparator,this.options.ignoreJSONStructure),_,n,{...s,...t,interpolationkey:x})};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:d=>St(d)},{regex:this.regexp,safeValue:d=>this.escapeValue?St(this.escape(d)):St(d)}].forEach(d=>{for(o=0;a=d.regex.exec(e);){const y=a[1].trim();if(i=c(y),i===void 0)if(typeof f=="function"){const _=f(e,a,s);i=q(_)?_:""}else if(s&&Object.prototype.hasOwnProperty.call(s,y))i="";else if(u){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),i="";else!q(i)&&!this.useRawValueToEscape&&(i=ar(i));const x=d.safeValue(i);if(e=e.replace(a[0],x),u?(d.regex.lastIndex+=i.length,d.regex.lastIndex-=a[0].length):d.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(l,c)=>{const f=this.nestingOptionsSeparator;if(l.indexOf(f)<0)return l;const u=l.split(new RegExp(`${f}[ ]*{`));let p=`{${u[1]}`;l=u[0],p=this.interpolate(p,i);const m=p.match(/'/g),d=p.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!d||d.length%2!==0)&&(p=p.replace(/'/g,'"'));try{i=JSON.parse(p),c&&(i={...c,...i})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${f}${p}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,l};for(;s=this.nestingRegexp.exec(e);){let l=[];i={...n},i=i.replace&&!q(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let c=!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(),l=f,c=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!q(a))return a;q(a)||(a=ar(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),c&&(a=l.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 Un=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,...l]=i.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();t[f]||(t[f]=c),c==="false"&&(t[f]=!1),c==="true"&&(t[f]=!0),isNaN(c)||(t[f]=parseInt(c,10))}})}return{formatName:e,formatOptions:t}},gr=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(Ye(n),s),e[i]=o),o(t)}},Wn=r=>(e,t,n)=>r(Ye(t),n)(e);class Bn{constructor(e={}){this.logger=be.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?gr:Wn;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()]=gr(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(l=>l.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,l)=>{var u;const{formatName:c,formatOptions:f}=Un(l);if(this.formats[c]){let p=o;try{const m=((u=s==null?void 0:s.formatParams)==null?void 0:u[s.interpolationkey])||{},d=m.locale||m.lng||s.locale||s.lng||n;p=this.formats[c](o,d,{...f,...s,...m})}catch(m){this.logger.warn(m)}return p}else this.logger.warn(`there was no format function for ${c}`);return o},e)}}const Hn=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Gn extends dt{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=be.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={},l={};return e.forEach(c=>{let f=!0;t.forEach(u=>{const p=`${c}|${u}`;!n.reload&&this.store.hasResourceBundle(c,u)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?i[p]===void 0&&(i[p]=!0):(this.state[p]=1,f=!1,i[p]===void 0&&(i[p]=!0),a[p]===void 0&&(a[p]=!0),l[u]===void 0&&(l[u]=!0)))}),f||(o[c]=!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(l)}}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(l=>{Cn(l.loaded,[a],i),Hn(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{o[c]||(o[c]={});const f=l.loaded[c];f.length&&f.forEach(u=>{o[c][u]===void 0&&(o[c][u]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.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=(c,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(c&&f&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,a*2,i)},a);return}i(c,f)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const c=l(e,t);c&&typeof c.then=="function"?c.then(f=>o(null,f)).catch(o):o(null,c)}catch(c){o(c)}return}return l(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 l,c,f,u,p;if((c=(l=this.services)==null?void 0:l.utils)!=null&&c.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((p=this.backend)!=null&&p.create){const m={...i,isUpdate:a},d=this.backend.create.bind(this.backend);if(d.length<6)try{let y;d.length===5?y=d(e,t,n,s,m):y=d(e,t,n,s),y&&typeof y.then=="function"?y.then(x=>o(null,x)).catch(o):o(null,y)}catch(y){o(y)}else d(e,t,n,s,o,m)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const yr=()=>({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}),br=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=()=>{},Kn=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class Ue extends dt{constructor(e={},t){if(super(),this.options=br(e),this.services={},this.logger=be,this.modules={external:[]},Kn(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=yr();this.options={...n,...this.options,...br(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=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?be.init(s(this.modules.logger),this.options):be.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=Bn;const f=new dr(this.options);this.store=new cr(this.options.resources,this.options);const u=this.services;u.logger=be,u.resourceStore=this.store,u.languageUtils=f,u.pluralResolver=new Vn(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(u.formatter=s(c),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new Yn(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Gn(s(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(p,...m)=>{this.emit(p,...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 ot(this.services,this.options),this.translator.on("*",(p,...m)=>{this.emit(p,...m)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Ze),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[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(c=>{this[c]=(...f)=>this.store[c](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...f)=>(this.store[c](...f),this)});const o=Me(),l=()=>{const c=(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 c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,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=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};s?l(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>l(f)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,c=>l(c)),this.services.backendConnector.load(o,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(c)})}else n(null)}reloadResources(e,t,n){const s=Me();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"&&Lr.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=Me();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,l)=>{l?this.isLanguageChangingTo===e&&(s(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,n.resolve((...c)=>this.t(...c)),t&&t(o,(...c)=>this.t(...c))},i=o=>{var f,u;!e&&!o&&this.services.languageDetector&&(o=[]);const l=q(o)?o:o&&o[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(q(o)?[o]:o);c&&(this.language||s(c),this.translator.language||this.translator.changeLanguage(c),(u=(f=this.services.languageDetector)==null?void 0:f.cacheUserLanguage)==null||u.call(f,c)),this.loadResources(c,p=>{a(p,c)})};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 l;typeof i!="object"?l=this.options.overloadTranslationOptionHandler([a,i].concat(o)):l={...i},l.lng=l.lng||s.lng,l.lngs=l.lngs||s.lngs,l.ns=l.ns||s.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||n||s.keyPrefix);const c=this.options.keySeparator||".";let f;return l.keyPrefix&&Array.isArray(a)?f=a.map(u=>`${l.keyPrefix}${c}${u}`):f=l.keyPrefix?`${l.keyPrefix}${c}${a}`:a,this.t(f,l)};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,l)=>{const c=this.services.backendConnector.state[`${o}|${l}`];return c===-1||c===0||c===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=Me();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=Me();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 dr(yr());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new Ue(e,t)}cloneInstance(e={},t=Ze){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new Ue(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((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((f,u)=>(f[u]={...l[c][u]},f),l[c]),l),{});a.store=new cr(o,s),a.services.resourceStore=a.store}return a.translator=new ot(a.services,s),a.translator.on("*",(o,...l)=>{a.emit(o,...l)}),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=Ue.createInstance();ae.createInstance=Ue.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 qn={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"},zn={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},Jn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando",CheckObjectWrongValidation:"Oggetto non valido",ConfirmButton:"Conferma",AutocompleteDefaultPlaceholder:"Inserisci codice o descrizione"},Xn={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:qn,Month:zn,Generic:Jn},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"},Qn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},es={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command",CheckObjectWrongValidation:"Object not valid",ConfirmButton:"Confirm",AutocompleteDefaultPlaceholder:"Type code or description"},ts={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:Qn,Generic:es};function vr(r,e){return new RegExp(rs(r),e)}function rs(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const ns=(r,e,t)=>{let n=r;return isNaN(n)||(e!=null&&(n=Math.max(n,e)),t!=null&&(n=Math.min(n,t))),n},ss=(r,e)=>{var i,o;const n=Intl.NumberFormat(r).formatToParts(1000.1),s=((i=n.find(l=>l.type==="group"))==null?void 0:i.value)??",",a=e??((o=n.find(l=>l.type==="decimal"))==null?void 0:o.value)??".";return{groupingChar:s,decimalChar:a}};function as(r,e,t,n){let s=e;const a=ls(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=cs(s);return new Intl.NumberFormat(n,i).format(a)}const is=(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},os=(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 l=n.includes(".")?".":",",c=l==="."?a:i;c>1||c===1&&l===e&&n.length-n.lastIndexOf(l)-1===3||(s=l)}const o=s==="."?",":".";return n=n.replace(new RegExp(`\\${o}`,"g"),""),s!=="."&&(n=n.replace(new RegExp(`\\${s}`,"g"),".")),parseFloat(n)};function ls(r,e,t,n,s){let a=r;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const l=o=="."?",":".";a=a.replace(vr(l,"g"),""),a=a.replace(vr(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function cs(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 as(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:ts},it:{translation:Xn}}});const us=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),fs=(r,e)=>ae.t(r,e);function je(){const r=D.useCallback((n,s,a,i)=>us(n,s,a||void 0,i),[]),e=D.useCallback(()=>ae.languages[0],[]),t=D.useCallback((n,s)=>fs(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var Te=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r.CHECK_OBJECT_WRONG_VALIDATION="Generic.CheckObjectWrongValidation",r.CONFIRM_BUTTON="Generic.ConfirmButton",r.AUTOCOMPLETE_DEFAULT_PLACEHOLDER="Generic.AutocompleteDefaultPlaceholder",r))(Te||{}),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||{}),_t=(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))(_t||{});const Ct=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,isEditable:i=!0,fun:o,_changeOnEnter:l=!1,onChange:c,onOptionsRequest:f,onBlur:u,_multiActiveIndex:p,...m})=>{const d=D.useRef(null),[y,x]=D.useState(r),[_,w]=D.useState(e),{translate:S}=je(),[E,b]=D.useState(!1),[j,M]=D.useState(t||[]),[k,O]=D.useState(0),[T,I]=D.useState([r]),{anchorRef:$,targetRef:P,anchorWidth:Y}=ct({position:"bottom",enabled:E}),A=D.useCallback(()=>{var R;b(!1),(R=d==null?void 0:d.current)==null||R.focus()},[]);ft([P],E,()=>A());const V=Dn(400),z=R=>{R.length>=a?o&&f&&V(async()=>{const L=await f(o,R);M(L),O(L.length>0?0:-1),b(!0)}):A(),x(R),w(e),l||c==null||c(R,e)},J=()=>{E||u==null||u()},U=R=>{l?(x(""),w("")):(x(R.id),w(R.label)),c==null||c(R.id,R.label);const L=j.findIndex(C=>C.id===R.id);O(L),I([R.id]),A()},h=R=>{R.key==="Escape"&&(A(),O(-1))},v=R=>{if((R.key==="ArrowDown"||R.key==="ArrowUp")&&(R.preventDefault(),E)){const L=R.key==="ArrowDown"?(k+1)%j.length:(k-1+j.length)%j.length;O(L)}switch(R.key){case"Enter":k>=0&&k<j.length?U(j[k]):l&&(c==null||c(y,""),A(),x(""),w(""));break;case"Escape":A(),O(-1);break}};return g.jsxs("div",{"data-component":"autocomplete",children:[g.jsx($t,{...m,bindValue:y,optionalDisplayValue:_,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:S(Te.AUTOCOMPLETE_DEFAULT_PLACEHOLDER),ref:$,inputRef:d,onChange:z,onKeyDown:v,onBlur:J,"aria-autocomplete":"list"}),E&&g.jsx(ut,{children:g.jsx(Cr,{options:j,displayMode:s,onClick:U,ref:P,selectedIndex:k,activeIndex:p||T,width:Y,showFilter:!1,onKeyDown:h,isOpen:E})})]})},kr=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:l,fullWidth:c,disabled:f,justify:u,squared:p,onClick:m,onOptionsRequest:d})=>{const[y,x]=D.useState(r);D.useEffect(()=>{!y&&d&&e&&d(e,void 0).then(S=>x(S)).catch(S=>{console.error("Errore nel caricamento delle opzioni per ButtonList",S)})},[y,e,d]);const _={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},w=y==null?void 0:y.map((S,E)=>{const b={bindValue:S.id,optionalDisplayValue:S.label,fun:S.fun,icon:S.icon,variant:a,appearance:i,showText:o,showIcon:l,fullWidth:c,disabled:f,sizing:s,justify:u,squared:p,onClick:()=>{m==null||m(S.id,S.fun)}};return g.jsx(Se,{...b},`button-${E}`)});return g.jsx("div",{role:"list","data-component":"button-list",className:_.container,children:w})},ds={"smp-checkbox-wrapper":"_smp-checkbox-wrapper_z14lq_2"},Pr=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i,variant:o="checkbox"})=>{const l=D.useId(),c=u=>{s&&a&&a(u.target.checked)},f={wrapper:`${ds["smp-checkbox-wrapper"]}`};return g.jsxs("div",{className:f.wrapper,"data-component":e,children:[n&&g.jsx(De,{label:n,disabled:t,htmlFor:l}),g.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:c,onBlur:i,role:o==="switch"?"switch":"checkbox",id:l})]})},It=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,l]=D.useState(null),c={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=m=>{n==null||n(r.filter((d,y)=>y!==m))},u=m=>{l(m)},p=m=>{if(o===null||o===m)return;const d=[...r],[y]=d.splice(o,1);d.splice(m,0,y),n==null||n(d),l(null)};return g.jsx("div",{className:c.container,role:"list","data-component":"chip",children:r.flatMap((m,d)=>{const y=Pe(m.bindValue,m.optionalDisplayValue,t),x=g.jsxs("div",{className:c.element,role:"listitem",draggable:i,onDragStart:()=>u(d),onDragOver:w=>i&&w.preventDefault(),onDrop:()=>i&&p(d),style:{"--smp-chips-backgroundColor-base":a},children:[i&&g.jsx(oe,{icon:"drag_indicator_horizontal",isInteractable:!0}),g.jsx(_e,{variant:"label",bindValue:y,color:s}),e&&g.jsx(oe,{icon:"close",isInteractable:!0,onClick:()=>f(d),color:s})]},`chip-${d}`),_=i&&d<r.length-1?g.jsx(oe,{icon:"chevron-right",color:s},`separator-${d}`):null;return[x,_].filter(Boolean)})})};function Lt(r,e){const t=D.useRef(null);D.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(c=>!c.hasAttribute("disabled")&&c.offsetParent!==null):[];(()=>{const c=s();c.length>0&&requestAnimationFrame(()=>c[0].focus())})();const i=c=>{if(c.key==="Escape"||c.key!=="Tab")return;const f=s();if(f.length===0)return;const u=f[0],p=f[f.length-1];c.shiftKey&&document.activeElement===u?(c.preventDefault(),p.focus()):!c.shiftKey&&document.activeElement===p&&(c.preventDefault(),u.focus())},o=c=>{if(n&&!n.contains(c.target)){c.preventDefault();const f=s();f.length>0&&f[0].focus()}};document.addEventListener("keydown",i),document.addEventListener("mousedown",o);const l=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=l,t.current&&requestAnimationFrame(()=>{var c;(c=t.current)==null||c.focus()})}},[r,e])}const Ar=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:l,multiActiveIndex:c,...f})=>{const u=D.useRef(null),[p,m]=D.useState(!1),[d,y]=D.useState(t),[x,_]=D.useState(-1),[w,S]=D.useState([r]),E=D.useId(),{anchorRef:b,targetRef:j,anchorWidth:M}=ct({position:"bottom",enabled:p}),k=D.useCallback(()=>{var P;m(!1),(P=u==null?void 0:u.current)==null||P.focus()},[]);ft([j,b],p,()=>k()),Lt(p,j);const O=P=>{e==null||e(P.id,P.label);const Y=d.findIndex(A=>A.id===P.id);_(Y),S([P.id]),k()},T=P=>{P.key==="Escape"&&(k(),_(-1))},I=P=>{(P.key==="ArrowDown"||P.key==="ArrowUp")&&(P.preventDefault(),$())},$=()=>{s&&(o&&l?p?m(!1):l(o,void 0).then(P=>{y(P),_(P.length>0?0:-1),m(!0)}):m(P=>!P))};return g.jsxs("div",{role:"combobox","aria-expanded":p,"aria-controls":E,"aria-owns":E,"data-component":"combobox",children:[g.jsx($t,{...f,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:$,onKeyDown:I,onClick:$,shapeIcon:"arrow_drop_down",rotatedShapeIcon:p,isEditable:s,ref:b,inputRef:u,"aria-autocomplete":"list",variant:"notSelectable"}),p&&g.jsx(ut,{children:g.jsx(Cr,{id:E,options:d,displayMode:i,ref:j,isOpen:p,selectedIndex:x,activeIndex:c||w,width:M,onClick:O,onKeyDown:T})})]})},ps={"smp-datepickercalendar-position":"_smp-datepickercalendar-position_1lf9g_1"};function hs({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=je(),i=()=>{if(!n)return;const U=new Date(n);return isNaN(U.getTime())?void 0:U},[o]=D.useState(new Date),[l,c]=D.useState(r||i()||new Date),[f,u]=D.useState(l?l.getMonth():new Date().getMonth()),[p,m]=D.useState(l?l.getFullYear():new Date().getFullYear()),[d,y]=D.useState(l?l.getDate():null),x=D.useRef(null),_=D.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)],S=[{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)}],E=U=>t.some(h=>{const v=h.start.getTime(),R=h.end.getTime(),L=U.getTime();return L>=v&&L<=R}),b=U=>{E(U)||(c(U),y(U.getDate()),e&&e(On(U)))},j=()=>{f===0?(u(11),m(p-1)):u(f-1),y(1)},M=()=>{f===11?(u(0),m(p+1)):u(f+1),y(1)},k=(U,h)=>new Date(U,h+1,0).getDate(),O=(U,h)=>new Date(U,h,1).getDay(),T=U=>{var v;const h=Y.findIndex(R=>R!==null&&R.getDate()===U);h!==-1&&_.current[h]&&((v=_.current[h])==null||v.focus(),y(U))},I=(U,h)=>{const v=Y[h];if(!v)return;const R=k(p,f),L=v.getDate();switch(U.key){case"ArrowRight":U.preventDefault();{let C=L+1,N=new Date(p,f,C);if(C>R){const W=f===11?p+1:p,H=f===11?0:f+1;C=1,N=new Date(W,H,C),M(),setTimeout(()=>{$(1,"forward")},0);return}E(N)?$(C,"forward"):T(C)}break;case"Tab":break;case"ArrowLeft":U.preventDefault();{let C=L-1,N=new Date(p,f,C);if(C<1){const W=f===0?p-1:p,H=f===0?11:f-1,B=k(W,H);C=B,N=new Date(W,H,C),j(),setTimeout(()=>{$(B,"backward")},0);return}E(N)?$(C,"backward"):T(C)}break;case"ArrowUp":U.preventDefault();{let C=L-7,N=new Date(p,f,C);if(C<1){const W=f===0?p-1:p,H=f===0?11:f-1;C=k(W,H)+C,N=new Date(W,H,C),j(),setTimeout(()=>{$(C,"backward")},0);return}E(N)?$(C,"backward"):T(C)}break;case"ArrowDown":U.preventDefault();{let C=L+7,N=new Date(p,f,C);if(C>R){const W=f===11?p+1:p,H=f===11?0:f+1;C=C-R,N=new Date(W,H,C),M(),setTimeout(()=>{$(C,"forward")},0);return}E(N)?$(C,"forward"):T(C)}break;case"Home":U.preventDefault(),$(1,"forward");break;case"End":U.preventDefault(),$(R,"backward");break;case"PageUp":U.preventDefault(),j(),setTimeout(()=>{const C=k(f===0?p-1:p,f===0?11:f-1),N=Math.min(L,C);$(N,"forward")},0);break;case"PageDown":U.preventDefault(),M(),setTimeout(()=>{const C=k(f===11?p+1:p,f===11?0:f+1),N=Math.min(L,C);$(N,"forward")},0);break;case" ":case"Space":if(E(v))return;y(v.getDate()),c(v);break;case"Enter":U.preventDefault(),b(v);break}},$=(U,h)=>{const v=k(p,f);if(h==="forward"){for(let R=U;R<=v;R++){const L=new Date(p,f,R);if(!E(L)){T(R);return}}M(),setTimeout(()=>{$(1,"forward")},0)}else{for(let N=U;N>=1;N--){const W=new Date(p,f,N);if(!E(W)){T(N);return}}const R=f===0?p-1:p,L=f===0?11:f-1,C=k(R,L);j(),setTimeout(()=>{$(C,"backward")},0)}},Y=(()=>{const U=k(p,f),h=O(p,f),v=[];for(let R=0;R<h;R++)v.push(null);for(let R=1;R<=U;R++){const L=new Date(p,f,R);v.push(L)}return v})(),A=[];let V=[];Y.forEach((U,h)=>{if(V.push(U),V.length===7||h===Y.length-1){for(;V.length<7;)V.push(null);A.push(V),V=[]}}),D.useEffect(()=>{var U;if(d!==null){const h=Y.findIndex(v=>v!==null&&v.getDate()===d);h!==-1&&_.current[h]&&((U=_.current[h])==null||U.focus())}},[f,p,d,Y]);const z={label:"smp-datepickercalendar-label",wrapper:`smp-datepickercalendar ${ps["smp-datepickercalendar-position"]}`,calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(U,h,v,R)=>`smp-datepickercalendar-td
44
+ */var mt,Kt;function cn(){if(Kt)return mt;Kt=1;var r=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var i={},o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var l=Object.getOwnPropertyNames(i).map(function(f){return i[f]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(f){c[f]=f}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return mt=s()?Object.assign:function(a,i){for(var o,l=n(a),c,f=1;f<arguments.length;f++){o=Object(arguments[f]);for(var u in o)e.call(o,u)&&(l[u]=o[u]);if(r){c=r(o);for(var d=0;d<c.length;d++)t.call(o,c[d])&&(l[c[d]]=o[c[d]])}}return l},mt}var gt,qt;function Dt(){if(qt)return gt;qt=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return gt=r,gt}var yt,zt;function Rr(){return zt||(zt=1,yt=Function.call.bind(Object.prototype.hasOwnProperty)),yt}var bt,Jt;function un(){if(Jt)return bt;Jt=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=Dt(),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,l,c){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((l||"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,l,o,null,e)}catch(p){u=p}if(u&&!(u instanceof Error)&&r((l||"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=c?c():"";r("Failed "+o+" type: "+u.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},bt=s,bt}var vt,Xt;function fn(){if(Xt)return vt;Xt=1;var r=_r(),e=cn(),t=Dt(),n=Rr(),s=un(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(o){var l="Warning: "+o;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function i(){return null}return vt=function(o,l){var c=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function u(h){var v=h&&(c&&h[c]||h[f]);if(typeof v=="function")return v}var d="<<anonymous>>",m={array:_("array"),bigint:_("bigint"),bool:_("boolean"),func:_("function"),number:_("number"),object:_("object"),string:_("string"),symbol:_("symbol"),any:w(),arrayOf:S,element:E(),elementType:b(),instanceOf:j,node:T(),objectOf:I,oneOf:M,oneOfType:O,shape:$,exact:P};function p(h,v){return h===v?h!==0||1/h===1/v:h!==h&&v!==v}function y(h,v){this.message=h,this.data=v&&typeof v=="object"?v:{},this.stack=""}y.prototype=Error.prototype;function x(h){if(process.env.NODE_ENV!=="production")var v={},R=0;function L(N,W,H,B,X,K,se){if(B=B||d,K=K||H,se!==t){if(l){var F=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 F.name="Invariant Violation",F}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var G=B+":"+H;!v[G]&&R<3&&(a("You are manually calling a React.PropTypes validation function for the `"+K+"` prop on `"+B+"`. 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."),v[G]=!0,R++)}}return W[H]==null?N?W[H]===null?new y("The "+X+" `"+K+"` is marked as required "+("in `"+B+"`, but its value is `null`.")):new y("The "+X+" `"+K+"` is marked as required in "+("`"+B+"`, but its value is `undefined`.")):null:h(W,H,B,X,K)}var C=L.bind(null,!1);return C.isRequired=L.bind(null,!0),C}function _(h){function v(R,L,C,N,W,H){var B=R[L],X=Y(B);if(X!==h){var K=z(B);return new y("Invalid "+N+" `"+W+"` of type "+("`"+K+"` supplied to `"+C+"`, expected ")+("`"+h+"`."),{expectedType:h})}return null}return x(v)}function w(){return x(i)}function S(h){function v(R,L,C,N,W){if(typeof h!="function")return new y("Property `"+W+"` of component `"+C+"` has invalid PropType notation inside arrayOf.");var H=R[L];if(!Array.isArray(H)){var B=Y(H);return new y("Invalid "+N+" `"+W+"` of type "+("`"+B+"` supplied to `"+C+"`, expected an array."))}for(var X=0;X<H.length;X++){var K=h(H,X,C,N,W+"["+X+"]",t);if(K instanceof Error)return K}return null}return x(v)}function E(){function h(v,R,L,C,N){var W=v[R];if(!o(W)){var H=Y(W);return new y("Invalid "+C+" `"+N+"` of type "+("`"+H+"` supplied to `"+L+"`, expected a single ReactElement."))}return null}return x(h)}function b(){function h(v,R,L,C,N){var W=v[R];if(!r.isValidElementType(W)){var H=Y(W);return new y("Invalid "+C+" `"+N+"` of type "+("`"+H+"` supplied to `"+L+"`, expected a single ReactElement type."))}return null}return x(h)}function j(h){function v(R,L,C,N,W){if(!(R[L]instanceof h)){var H=h.name||d,B=U(R[L]);return new y("Invalid "+N+" `"+W+"` of type "+("`"+B+"` supplied to `"+C+"`, expected ")+("instance of `"+H+"`."))}return null}return x(v)}function M(h){if(!Array.isArray(h))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 v(R,L,C,N,W){for(var H=R[L],B=0;B<h.length;B++)if(p(H,h[B]))return null;var X=JSON.stringify(h,function(se,F){var G=z(F);return G==="symbol"?String(F):F});return new y("Invalid "+N+" `"+W+"` of value `"+String(H)+"` "+("supplied to `"+C+"`, expected one of "+X+"."))}return x(v)}function I(h){function v(R,L,C,N,W){if(typeof h!="function")return new y("Property `"+W+"` of component `"+C+"` has invalid PropType notation inside objectOf.");var H=R[L],B=Y(H);if(B!=="object")return new y("Invalid "+N+" `"+W+"` of type "+("`"+B+"` supplied to `"+C+"`, expected an object."));for(var X in H)if(n(H,X)){var K=h(H,X,C,N,W+"."+X,t);if(K instanceof Error)return K}return null}return x(v)}function O(h){if(!Array.isArray(h))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var v=0;v<h.length;v++){var R=h[v];if(typeof R!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+J(R)+" at index "+v+"."),i}function L(C,N,W,H,B){for(var X=[],K=0;K<h.length;K++){var se=h[K],F=se(C,N,W,H,B,t);if(F==null)return null;F.data&&n(F.data,"expectedType")&&X.push(F.data.expectedType)}var G=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new y("Invalid "+H+" `"+B+"` supplied to "+("`"+W+"`"+G+"."))}return x(L)}function T(){function h(v,R,L,C,N){return V(v[R])?null:new y("Invalid "+C+" `"+N+"` supplied to "+("`"+L+"`, expected a ReactNode."))}return x(h)}function k(h,v,R,L,C){return new y((h||"React class")+": "+v+" type `"+R+"."+L+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+C+"`.")}function $(h){function v(R,L,C,N,W){var H=R[L],B=Y(H);if(B!=="object")return new y("Invalid "+N+" `"+W+"` of type `"+B+"` "+("supplied to `"+C+"`, expected `object`."));for(var X in h){var K=h[X];if(typeof K!="function")return k(C,N,W,X,z(K));var se=K(H,X,C,N,W+"."+X,t);if(se)return se}return null}return x(v)}function P(h){function v(R,L,C,N,W){var H=R[L],B=Y(H);if(B!=="object")return new y("Invalid "+N+" `"+W+"` of type `"+B+"` "+("supplied to `"+C+"`, expected `object`."));var X=e({},R[L],h);for(var K in X){var se=h[K];if(n(h,K)&&typeof se!="function")return k(C,N,W,K,z(se));if(!se)return new y("Invalid "+N+" `"+W+"` key `"+K+"` supplied to `"+C+"`.\nBad object: "+JSON.stringify(R[L],null," ")+`
45
+ Valid keys: `+JSON.stringify(Object.keys(h),null," "));var F=se(H,K,C,N,W+"."+K,t);if(F)return F}return null}return x(v)}function V(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(V);if(h===null||o(h))return!0;var v=u(h);if(v){var R=v.call(h),L;if(v!==h.entries){for(;!(L=R.next()).done;)if(!V(L.value))return!1}else for(;!(L=R.next()).done;){var C=L.value;if(C&&!V(C[1]))return!1}}else return!1;return!0;default:return!1}}function A(h,v){return h==="symbol"?!0:v?v["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&v instanceof Symbol:!1}function Y(h){var v=typeof h;return Array.isArray(h)?"array":h instanceof RegExp?"object":A(v,h)?"symbol":v}function z(h){if(typeof h>"u"||h===null)return""+h;var v=Y(h);if(v==="object"){if(h instanceof Date)return"date";if(h instanceof RegExp)return"regexp"}return v}function J(h){var v=z(h);switch(v){case"array":case"object":return"an "+v;case"boolean":case"date":case"regexp":return"a "+v;default:return v}}function U(h){return!h.constructor||!h.constructor.name?d:h.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},vt}var xt,Zt;function dn(){if(Zt)return xt;Zt=1;var r=Dt();function e(){}function t(){}return t.resetWarningCache=e,xt=function(){function n(i,o,l,c,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},xt}var Qt;function pn(){if(Qt)return Ke.exports;if(Qt=1,process.env.NODE_ENV!=="production"){var r=_r(),e=!0;Ke.exports=fn()(r.isElement,e)}else Ke.exports=dn()();return Ke.exports}var ie=pn(),hn=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},mn=function(e,t){for(var n in e)if(!(n in t))return!0;for(var s in t)if(e[s]!==t[s])return!0;return!1},gn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],ze="http://www.w3.org/2000/svg",er="http://www.w3.org/1999/xlink",Ie=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}Jr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof hn(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,l=a.httpRequestWithCredentials,c=a.renumerateIRIElements,f=a.src,u=a.title,d=a.useRequestCache,m=this.props.onError,p=this.props.beforeInjection,y=this.props.afterInjection,x=this.props.wrapper,_,w;x==="svg"?(_=document.createElementNS(ze,x),_.setAttribute("xmlns",ze),_.setAttribute("xmlns:xlink",er),w=document.createElementNS(ze,x)):(_=document.createElement(x),w=document.createElement(x)),_.appendChild(w),w.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(_);var S=function(M){if(s.removeSVG(),!s._isMounted){m(M);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){m(M)})},E=function(M,I){if(M){S(M);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{y(I)}catch(O){S(O)}})},b=function(M){if(M.setAttribute("role","img"),i){var I=M.querySelector(":scope > desc");I&&M.removeChild(I);var O=document.createElement("desc");O.innerHTML=i,M.prepend(O)}if(u){var T=M.querySelector(":scope > title");T&&M.removeChild(T);var k=document.createElement("title");k.innerHTML=u,M.prepend(k)}try{p(M)}catch($){S($)}};an(w,{afterEach:E,beforeEach:b,cacheRequests:d,evalScripts:o,httpRequestWithCredentials:l,renumerateIRIElements:c})}},t.removeSVG=function(){var s;(s=this.nonReactWrapper)!=null&&s.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},t.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},t.componentDidUpdate=function(s){var a=this;mn(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,l=zr(s,gn),c=o;return Be.createElement(c,tt({},l,{ref:this.refCallback},o==="svg"?{xmlns:ze,xmlnsXlink:er}:{}),this.state.isLoading&&i&&Be.createElement(i,null),this.state.hasError&&a&&Be.createElement(a,null))},e}(Be.Component);Ie.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Ie.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 Et={assets:"/"};const yn=r=>{Et={...Et,...r}},tr=r=>`${Et.assets}/${r}`.replace(/\/+/g,"/"),oe=D.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:l,isInteractable:c=!1,spin:f=!1,title:u,tabIndex:d})=>{const[m,p]=D.useState(r),y=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),x=y&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),_=tr(`assets/svg/${r}.svg`),w=tr(`assets/svg/${n}.svg`),S={img:`${c?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${c?"smp-icon-interactable":""} ${f?"smp-icon-spin":""}`},E=()=>{!a&&c&&l&&l()},b=j=>{!a&&c&&(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),E())};return g.jsx(g.Fragment,{children:x?g.jsx(Ie,{src:r,fallback:()=>g.jsx(Ie,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:S.svg,onClick:E,onKeyDown:b,tabIndex:d}):y?g.jsx("img",{src:m,width:e||"16px",height:t||"auto",alt:u,onError:()=>p(w),onClick:E,className:S.img,title:u,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&E()}}):g.jsx(Ie,{src:_,fallback:()=>g.jsx(Ie,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:S.svg,onClick:E,onKeyDown:b,tabIndex:d})})}),rr=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],nr=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],Se=({bindValue:r,onClick:e,ariaLabel:t,icon:n,disabled:s,sizing:a="base",variant:i="primary",appearance:o="raised",showIcon:l=!0,showText:c=!0,fullWidth:f=!1,loading:u=!1,justify:d="center",title:m,optionalDisplayValue:p,squared:y=!1,submit:x=!1})=>{const _={container:`smp-button smp-button-container ${a?`smp-button-${a}`:""} ${i?`smp-buttonVariant-${i}`:""} ${o?`smp-buttonType-${o}`:""} ${f?"smp-button-fullWidth":""} smp-justifyContent-${d} ${y&&!c?"smp-button-squared":""}`};return g.jsx("button",{"data-component":"button",type:x?"submit":"button",className:_.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":u,title:m||p,children:u?g.jsx(oe,{icon:"spinner",state:nr(i),spin:!0}):g.jsxs(g.Fragment,{children:[n&&l&&g.jsx(oe,{icon:n,disabled:s,state:nr(i),width:rr(a),height:rr(a)}),c&&g.jsx("span",{children:p||r})]})})},bn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},_e=({variant:r="body",bindValue:e,color:t,...n})=>{const s=bn[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return g.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},ye={"smp-tabbar-container":"_smp-tabbar-container_1scvh_1","smp-tabbar-scroll-button":"_smp-tabbar-scroll-button_1scvh_8","smp-tabbar-scroll-buttonRight":"_smp-tabbar-scroll-buttonRight_1scvh_13","smp-tabbar-scroll-buttonLeft":"_smp-tabbar-scroll-buttonLeft_1scvh_17","smp-tabbar-list-wrapper":"_smp-tabbar-list-wrapper_1scvh_21","smp-tabbar-list":"_smp-tabbar-list_1scvh_21","smp-tabbar-tab":"_smp-tabbar-tab_1scvh_38","smp-active":"_smp-active_1scvh_62","smp-tabbar-tab-extraSmall":"_smp-tabbar-tab-extraSmall_1scvh_75","smp-tabbar-tab-small":"_smp-tabbar-tab-small_1scvh_80","smp-tabbar-tab-base":"_smp-tabbar-tab-base_1scvh_85","smp-tabbar-tab-large":"_smp-tabbar-tab-large_1scvh_90","smp-tabbar-tab-extraLarge":"_smp-tabbar-tab-extraLarge_1scvh_95"},Dr=({data:r,sizing:e="large",toolbar:t=!0,selectedIndex:n,onTabChange:s})=>{const[a,i]=D.useState(0),o=n??a,[l,c]=D.useState(!1),[f,u]=D.useState(!1),d=D.useRef(null);if(D.useEffect(()=>{const S=d.current;if(!S)return;x();const E=()=>x();return S.addEventListener("scroll",E),window.addEventListener("resize",x),()=>{S.removeEventListener("scroll",E),window.removeEventListener("resize",x)}},[]),!r.children||r.children.length===0)return g.jsx("div",{className:"tab-bar-empty",children:"No tabs available"});const m={container:ye["smp-tabbar-container"],listWrapper:ye["smp-tabbar-list-wrapper"],list:ye["smp-tabbar-list"],tab:`${ye["smp-tabbar-tab"]} ${e?ye[`smp-tabbar-tab-${e}`]:""}`,scrollButtonRight:`${ye["smp-tabbar-scroll-button"]} ${ye["smp-tabbar-scroll-buttonRight"]}`,scrollButtonLeft:`${ye["smp-tabbar-scroll-button"]} ${ye["smp-tabbar-scroll-buttonLeft"]}`,active:ye["smp-active"]},p=100,y=2,x=()=>{const S=d.current;S&&(c(S.scrollLeft>0),u(S.scrollLeft+S.clientWidth<S.scrollWidth-y))},_=()=>{var S;(S=d.current)==null||S.scrollBy({left:-p,behavior:"smooth"})},w=()=>{var S;(S=d.current)==null||S.scrollBy({left:p,behavior:"smooth"})};return g.jsxs("div",{className:m.container,role:"tabpanel","data-component":"tab-bar",children:[l&&g.jsx("div",{className:m.scrollButtonLeft,children:g.jsx(Se,{bindValue:"",optionalDisplayValue:"<",onClick:_,variant:"base",sizing:e})}),g.jsx("div",{className:m.listWrapper,children:g.jsx("div",{className:m.list,ref:d,role:"tablist",children:r.children.map((S,E)=>g.jsxs("button",{type:"button",className:`${E===a?m.active:""} ${m.tab} `,role:"tab","aria-selected":E===o,tabIndex:E===o?0:-1,onClick:()=>{s&&s(E),i(E)},children:[S.icon&&g.jsx(oe,{icon:S.icon,placeholderIcon:S.placeholderIcon}),g.jsx(_e,{variant:"body",bindValue:S.decode||"Tab[object Object]"}),t&&(o===E?g.jsx(oe,{icon:"more_vert",placeholderIcon:S.placeholderIcon,isInteractable:!0,onClick:()=>{console.log("clicked icon")}}):g.jsx(oe,{icon:"empty"}))]},E))})}),f&&g.jsx("div",{className:m.scrollButtonRight,children:g.jsx(Se,{bindValue:"",optionalDisplayValue:">",onClick:w,variant:"base",sizing:e})})]})},rt=({children:r,layout:e={horizontal:!1,sectionsType:"tab",sections:[{id:"1",content:Array.isArray(r)?r.map(t=>({id:t.props.id})):[{id:r.props.id}]}]}})=>{const[t,n]=D.useState(0),s={};D.Children.forEach(r,p=>{D.isValidElement(p)&&(s[p.props.id]=p)});const a="--smp-grid-template-cols",i="--smp-grid-template-rows",o=Er(e.sections??[],Object.keys(s)),l=p=>p.reduce((y,x)=>{var b,j;let _="",w={},S={},E="";return(b=x.sections)!=null&&b.length?(_=pe["smp-layout-section-grid"],w=l(x.sections),x.gridCols===void 0&&(E=pe[x.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"],(x.horizontal||Mt(x.sections))&&(S=Nt(x.sections,x.horizontal?a:i)))):(j=x.content)!=null&&j.length&&(x.gridCols!==void 0&&x.gridCols>0?(_=pe["smp-layout-section-grid"],E=pe["smp-grid-template-cols"],S={[a]:`repeat(${x.gridCols}, 1fr)`}):_=pe["smp-layout-section-flex"]),{...y,...w,[x.id]:{classes:`${_} ${pe[x.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${E} ${x.justify?`smp-justifyContent-${x.justify}`:""} ${x.align?`smp-alignItems-${x.align}`:""}`,styles:S}}},{}),c=l(o),f=`${pe["smp-layout"]} ${e.horizontal?pe["smp-layout-horizontal"]:pe["smp-layout-vertical"]}`,u=e.horizontal||Mt(e.sections||[])?Nt(o,e.horizontal?a:i):{},d=(p,y)=>{var _,w;const x=g.jsx("div",{"smp-id":`section-${p.id}`,className:c[p.id].classes,style:c[p.id].styles,children:(_=p.sections)!=null&&_.length?p.sections.map(S=>d(S)):(w=p.content)==null?void 0:w.map(S=>m(S,p.justify,p.align))},`section-${p.id}`);return p.title&&!y?g.jsxs("div",{className:pe["smp-layout-section-with-title"],children:[g.jsx("span",{className:`${pe["smp-layout-section-title"]} ${p.justify?`smp-justifyContent-${p.justify}`:""} ${p.align?`smp-alignItems-${p.align}`:""}`,children:g.jsx(De,{label:p.title})}),x]},`title-section-${p.id}`):x},m=(p,y,x)=>{const _=s[p.id];if(!_)return null;const S={gridColumnStart:(p.colSpan&&p.colSpan>0?`span ${p.colSpan}`:p.colStart&&p.colStart<1?"1":void 0)??p.colStart,gridColumnEnd:p.colEnd&&p.colEnd>0?p.colEnd:void 0},E=`${pe["smp-layout-cell-container"]} ${y?`smp-justifyContent-${y}`:""} ${x?`smp-alignItems-${x}`:""}`;return g.jsx("div",{className:E,style:S,"smp-id":p.id,children:_},p.id)};return g.jsxs("div",{className:f,style:u,"smp-id":"layout",children:[e.sectionsType==="tab"&&e.sections&&(e==null?void 0:e.sections.length)>1&&g.jsx(Dr,{data:{type:"SmeupDataTree",children:o.map(p=>({decode:p.title||p.id||"Tab",obj:{t:"",p:"",k:""},placeholderIcon:"tab",cells:{},children:[],shape:void 0}))},selectedIndex:t,onTabChange:n,toolbar:!1}),e.sectionsType?d(o[t],!0):o.map(p=>d(p))]})},te={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",EDITOR:"EDT",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"},vn=r=>r.t=="D8",xn=r=>r.t=="I1",Sn=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 nt{constructor(e,t){de(this,"class");de(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new nt(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 wn(r,e){if(jt(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,l=0,c="";switch(n.length){case 1:case 2:return o=parseInt(n),t.setDate(o),Je(t)?t:r;case 3:case 4:return o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),i===0?(t.setMonth(o-1),t.setDate(l)):a===0&&(t.setMonth(l-1),t.setDate(o)),Je(t)?t:r;case 5:case 6:{o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),Number(n.substring(4))>50?c="19"+n.substring(4):c="20"+n.substring(4);let f=0,u=0;return i===0?(f=l,u=o-1,t.setFullYear(parseInt(c),u,f)):a===0&&(f=o,u=l-1,t.setFullYear(parseInt(c),u,f)),Tt(o,u,parseInt(c))&&Je(t)?t:r}case 7:case 8:{o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),c=n.substring(4);let f=0,u=0;return i===0?(f=l,u=o-1,t.setFullYear(parseInt(c),u,f)):a===0&&(f=o,u=l-1,t.setFullYear(parseInt(c),u,f)),Tt(f,u,parseInt(c))&&Je(t)?t:r}}return r}function jt(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function Je(r){return r instanceof Date&&!isNaN(r.getTime())}function En(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 Tt(n,t-1,e)}function Tt(r,e,t){const n=[31,Tn(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Tn(r){return r%4===0&&(r%100!==0||r%400===0)}function On(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 st{constructor(e,t){de(this,"class");de(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=sr.get(`${e.t}${e.p}`);if(t)return new st(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=sr.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 sr=new Map([["D8*YYMD",{legacyToIso(r){return En(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return jt(r)&&r.replaceAll("-","")||r}}]]);function ct({position:r="bottom",enabled:e=!0}){const t=D.useRef(null),n=D.useRef(null),[s,a]=D.useState(0),i=D.useCallback(()=>{const o=t.current,l=n.current;if(!o||!l)return;const{top:c,left:f,width:u,height:d}=o.getBoundingClientRect();a(u);const m=l.offsetHeight,p=l.offsetWidth;if(p===0||m===0){requestAnimationFrame(i);return}let y=c+window.scrollY,x=f+window.scrollX;switch(r){case"top":y-=m;break;case"bottom":y+=d;break;case"left":x-=p;break;case"right":x+=u;break}requestAnimationFrame(()=>{l.style.transform=`translate(${x}px, ${y}px)`,l.style.opacity="1"})},[r]);return D.useLayoutEffect(()=>{if(!e)return;let o;const l=()=>{const f=t.current,u=n.current;f&&u?i():o=requestAnimationFrame(l)};o=requestAnimationFrame(l);const c=new MutationObserver(()=>{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 Pe=(r,e,t)=>{if(r==""&&(e==""||e==null))return"";if(t)switch(t){case"CodeOnly":return r;case"DescOnly":return e||"";case"Both":return`${r} - ${e}`}return r},jr=({helperText:r,disabled:e,state:t,id:n})=>{const s={container:`smp-helper-text ${e?"smp-helper-text-disabled":""} ${t?`smp-helper-text-${t}`:""}`};return g.jsx("label",{className:s.container,id:n,children:r})},he={"smp-textfield-wrapper":"_smp-textfield-wrapper_ep1c3_4","smp-textfield":"_smp-textfield_ep1c3_4","smp-textfield-variant-notSelectable":"_smp-textfield-variant-notSelectable_ep1c3_29","smp-textfield-extraSmall":"_smp-textfield-extraSmall_ep1c3_35","smp-textfield-small":"_smp-textfield-small_ep1c3_40","smp-textfield-medium":"_smp-textfield-medium_ep1c3_45","smp-textfield-large":"_smp-textfield-large_ep1c3_50","smp-textfield-extraLarge":"_smp-textfield-extraLarge_ep1c3_55","smp-textfield-input":"_smp-textfield-input_ep1c3_61","smp-textfield-outlined":"_smp-textfield-outlined_ep1c3_84","smp-textfield-danger":"_smp-textfield-danger_ep1c3_95","smp-textfield-readOnly":"_smp-textfield-readOnly_ep1c3_99","smp-textfield-disabled":"_smp-textfield-disabled_ep1c3_114","smp-textfield-fullWidth":"_smp-textfield-fullWidth_ep1c3_123","smp-textfield-top-right-indicator":"_smp-textfield-top-right-indicator_ep1c3_127"},we=({disabled:r,bindValue:e,icon:t,placeholder:n,isEditable:s=!0,shapeIcon:a,sizing:i,state:o,variant:l,tooltip:c=!1,rotatedShapeIcon:f=!1,ref:u,inputRef:d,inputType:m="text",ariaLabel:p="input field",label:y,helperText:x=!1,error:_,appearance:w="base",fullWidth:S=!1,_dataComponent:E="textfield",min:b,max:j,step:M,inputMode:I="text",width:O,autocomplete:T,size:k,maxLength:$,onBlur:P,onChange:V,onKeyDown:A,onShapeIconClick:Y,onClick:z})=>{const J=D.useId(),U=`${J}-helper`,h=_?"danger":o,v=_||o=="danger"?"error":a,R=x||!!_,L=W=>{V==null||V(W.target.value)},C={wrapper:`${he["smp-textfield-wrapper"]} ${S?he["smp-textfield-fullWidth"]:""}`,container:`${he["smp-textfield"]} ${r?he["smp-textfield-disabled"]:""} ${n?he["smp-textfield-placeholder"]:""} ${i?he[`smp-textfield-${i}`]:""} ${h?he[`smp-textfield-${h}`]:""} ${w?he[`smp-textfield-${w}`]:""} ${s?"":he["smp-textfield-readOnly"]} ${c?he["smp-textfield-top-right-indicator"]:""}`,input:`${he["smp-textfield-input"]}`};if(l&&(l!=="notSelectable"||s)){const W=he[`smp-textfield-variant-${l}`];W&&(C.container+=` ${W}`)}const N=O?{"--smp-textField-width-base":O}:void 0;return g.jsxs("div",{className:C.wrapper,"data-component":E,children:[y&&g.jsx(De,{label:y,disabled:r,htmlFor:J}),g.jsxs("div",{className:C.container,ref:u,style:N,children:[t&&g.jsx(oe,{icon:t,disabled:r}),g.jsx("input",{id:J,type:m,value:e,placeholder:n,onChange:L,onBlur:P,className:C.input,disabled:r,readOnly:!s,onKeyDown:A,"aria-label":p,ref:d,"aria-describedby":R?U:void 0,min:b,max:j,step:M,inputMode:I,autoComplete:T,size:k,maxLength:$,onClick:z}),v&&g.jsx(oe,{icon:v,disabled:r,state:h,onClick:Y,rotated:f,isInteractable:s,tabIndex:0})]}),R&&g.jsx(jr,{helperText:_,disabled:r,state:h,id:U})]})};function $r({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=D.useState(0),i=D.useRef(null),o=r.length*e,l=Math.max(0,Math.floor(s/e)-n),c=Math.min(r.length-1,Math.floor((s+t)/e)+n),f=[];for(let m=l;m<=c;m++)f.push({item:r[m],index:m,offsetTop:m*e});const u=D.useCallback(m=>{const p=m.target.scrollTop;a(p)},[]),d=m=>{if(!i.current)return;const p=m*e,y=p+e,x=i.current,_=x.scrollTop,w=_+t;p<_?x.scrollTop=p:y>w&&(x.scrollTop=y-t)};return{virtualItems:f,containerProps:{ref:i,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:u},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:o,startIndex:l,endIndex:c},scrollToIndex:d}}const Xe={"smp-list":"_smp-list_6ni6l_1","smp-list-container":"_smp-list-container_6ni6l_12","smp-list-listItem":"_smp-list-listItem_6ni6l_17"};function _n(r,e,t="14px IBM Plex Sans, sans-serif",n=32){const a=document.createElement("canvas").getContext("2d");if(!a)return 200;a.font=t;let i=0;for(const o of r){const l=Pe(o.id,o.label,e),c=a.measureText(l);i=Math.max(i,c.width)}return Math.ceil(i+n)}const Rn=10,Cr=({id:r,options:e,displayMode:t="Both",ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:l,onKeyDown:c,isOpen:f})=>{var V;const[u,d]=D.useState(""),m=40,[p,y]=D.useState(a!==null?a:-1),[x,_]=D.useState(o||200),w=D.useRef(null),S=s!==void 0?s:e.length>Rn,E=u?e.filter(A=>A.label.toLowerCase().includes(u.toLowerCase())):e,b=A=>{d(A)},{virtualItems:j,containerProps:M,innerProps:I,scrollToIndex:O}=$r({items:E,itemHeight:m,containerHeight:200,overscan:5});D.useEffect(()=>{a!==null&&a!==p&&y(a)},[a]),D.useEffect(()=>{p>=0&&p<E.length&&O(p)},[p,E]),D.useEffect(()=>{f&&(w!=null&&w.current)&&w.current.focus()},[f,w]),D.useEffect(()=>{const A=_n(e,t);_(A)},[e,t]);const T=A=>{if(A.key==="ArrowDown"||A.key==="ArrowUp"){A.preventDefault();let Y=p;A.key==="ArrowDown"?Y=p<E.length-1?p+1:0:A.key==="ArrowUp"&&(Y=p>0?p-1:E.length-1),y(Y)}else A.key==="Enter"?p>=0&&p<E.length&&(l==null||l(E[p])):A.key==="Escape"&&(A.preventDefault(),A.stopPropagation());c&&c(A)},k=A=>{T(A)},$=A=>{T(A)},P={wrapper:`${Xe["smp-list"]}`,container:`${Xe["smp-list-container"]}`,virtualScroll:`${Xe["smp-list-virtualScroll"]}`,listItem:`${Xe["smp-list-listItem"]}`};return g.jsxs("div",{id:r,ref:n,className:P.wrapper,"data-component":"list",style:{width:x,minWidth:o},children:[S&&g.jsx(we,{bindValue:u,placeholder:"Search...",fullWidth:!0,onChange:b,onKeyDown:k,inputRef:w}),g.jsx("div",{...M,className:P.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:$,"aria-activedescendant":p>=0&&p<E.length?(V=E[p])==null?void 0:V.id:void 0,children:g.jsx("div",{...I,className:P.virtualScroll,children:j.map(({item:A,index:Y,offsetTop:z})=>{const J=i.includes(A.id);return g.jsxs("li",{role:"option",id:A.id,"aria-selected":p===Y?"true":"false",tabIndex:-1,className:`${P.listItem} ${p===Y?"selected-item":""}`,"aria-label":A.id+"-"+A.label,style:{height:`${m}px`,lineHeight:`calc(${m}px - 2*2px)`,transform:`translateY(${z}px)`},onClick:()=>{l==null||l(A),y(Y)},children:[Pe(A.id,A.label,t),J&&g.jsx(oe,{icon:"check",width:16})]},A.id)})})})]})},$t=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=D.useState(Pe(e,t,r));return D.useEffect(()=>{a(e)},[e]),D.useEffect(()=>{a(Pe(e,t,r))},[t,r]),g.jsx(we,{...n,bindValue:s})},Dn=r=>{const e=D.useRef(null);return D.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}};function ut({children:r}){const[e,t]=D.useState(!1);return D.useEffect(()=>{t(!0)},[]),e?Wr.createPortal(r,document.body):null}const ft=(r,e,t)=>{D.useEffect(()=>{if(!e)return;const n=s=>{(r==null?void 0:r.some(i=>{if(typeof i=="object"&&i!==null&&"current"in i){const o=i==null?void 0:i.current;return o&&o.contains(s.target)}}))||t()};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[r,t,e])},q=r=>typeof r=="string",Me=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},ar=r=>r==null?"":""+r,jn=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},$n=/###/g,ir=r=>r&&r.indexOf("###")>-1?r.replace($n,"."):r,or=r=>!r||q(r),Ve=(r,e,t)=>{const n=q(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(or(r))return{};const a=ir(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return or(r)?{}:{obj:r,k:ir(n[s])}},lr=(r,e,t)=>{const{obj:n,k:s}=Ve(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=Ve(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=Ve(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},Cn=(r,e,t,n)=>{const{obj:s,k:a}=Ve(r,e,Object);s[a]=s[a]||[],s[a].push(t)},at=(r,e)=>{const{obj:t,k:n}=Ve(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},kn=(r,e,t)=>{const n=at(r,t);return n!==void 0?n:at(e,t)},kr=(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]):kr(r[n],e[n],t):r[n]=e[n]);return r},Ce=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Ln={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const In=r=>q(r)?r.replace(/[&<>"'\/]/g,e=>Ln[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 An=[" ",",","?","!",";"],Nn=new Pn(20),Mn=(r,e,t)=>{e=e||"",t=t||"";const n=An.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=Nn.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},Ot=(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 l=a;l<n.length;++l)if(l!==a&&(o+=t),o+=n[l],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&l<n.length-1)continue;a+=l-a+1;break}s=i}return s},Ye=r=>r==null?void 0:r.replace("_","-"),Fn={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 it{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Fn,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 it(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new it(this.logger,e)}}var be=new it;class dt{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 cr extends dt{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 c,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 l=at(this.data,o);return!l&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),l||!i||!q(n)?l:Ot((f=(c=this.data)==null?void 0:c[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),lr(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 l=at(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?kr(l,n,a):l={...l,...n},lr(this.data,o,l),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 Lr={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 ur={},fr=r=>!q(r)&&typeof r!="boolean"&&typeof r!="number";class ot extends dt{constructor(e,t={}){super(),jn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=be.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&&!Mn(e,n,s);if(i&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:q(a)?[a]:a};const c=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(c[0])>-1)&&(a=c.shift()),e=c.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:l}=this.extractFromKey(e[e.length-1],s),c=l[l.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:`${c}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:`${c}${f}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:o;const m=this.resolve(e,s);let p=m==null?void 0:m.res;const y=(m==null?void 0:m.usedKey)||o,x=(m==null?void 0:m.exactUsedKey)||o,_=["[object Number]","[object Function]","[object RegExp]"],w=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,E=s.count!==void 0&&!q(s.count),b=ot.hasDefaultValue(s),j=E?this.pluralResolver.getSuffix(u,s.count,s):"",M=s.ordinal&&E?this.pluralResolver.getSuffix(u,s.count,{ordinal:!1}):"",I=E&&!s.ordinal&&s.count===0,O=I&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${j}`]||s[`defaultValue${M}`]||s.defaultValue;let T=p;S&&!p&&b&&(T=O);const k=fr(T),$=Object.prototype.toString.apply(T);if(S&&T&&k&&_.indexOf($)<0&&!(q(w)&&Array.isArray(T))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const P=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,T,{...s,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(m.res=P,m.usedParams=this.getUsedParamsDetails(s),m):P}if(i){const P=Array.isArray(T),V=P?[]:{},A=P?x:y;for(const Y in T)if(Object.prototype.hasOwnProperty.call(T,Y)){const z=`${A}${i}${Y}`;b&&!p?V[Y]=this.translate(z,{...s,defaultValue:fr(O)?O[Y]:void 0,joinArrays:!1,ns:l}):V[Y]=this.translate(z,{...s,joinArrays:!1,ns:l}),V[Y]===z&&(V[Y]=T[Y])}p=V}}else if(S&&q(w)&&Array.isArray(p))p=p.join(w),p&&(p=this.extendTranslation(p,e,s,n));else{let P=!1,V=!1;!this.isValidLookup(p)&&b&&(P=!0,p=O),this.isValidLookup(p)||(V=!0,p=o);const Y=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&V?void 0:p,z=b&&O!==p&&this.options.updateMissing;if(V||P||z){if(this.logger.log(z?"updateKey":"missingKey",u,c,o,z?O:p),i){const v=this.resolve(o,{...s,keySeparator:!1});v&&v.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 J=[];const U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&U&&U[0])for(let v=0;v<U.length;v++)J.push(U[v]);else this.options.saveMissingTo==="all"?J=this.languageUtils.toResolveHierarchy(s.lng||this.language):J.push(s.lng||this.language);const h=(v,R,L)=>{var N;const C=b&&L!==p?L:Y;this.options.missingKeyHandler?this.options.missingKeyHandler(v,c,R,C,z,s):(N=this.backendConnector)!=null&&N.saveMissing&&this.backendConnector.saveMissing(v,c,R,C,z,s),this.emit("missingKey",v,c,R,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&E?J.forEach(v=>{const R=this.pluralResolver.getSuffixes(v,s);I&&s[`defaultValue${this.options.pluralSeparator}zero`]&&R.indexOf(`${this.options.pluralSeparator}zero`)<0&&R.push(`${this.options.pluralSeparator}zero`),R.forEach(L=>{h([v],o+L,s[`defaultValue${L}`]||O)})}):h(J,o,O))}p=this.extendTranslation(p,e,s,m,n),V&&p===o&&this.options.appendNamespaceToMissingKey&&(p=`${c}${f}${o}`),(V||P)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${f}${o}`:o,P?p:void 0,s))}return a?(m.res=p,m.usedParams=this.getUsedParamsDetails(s),m):p}extendTranslation(e,t,n,s,a){var l,c;if((l=this.i18nFormat)!=null&&l.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)&&(((c=n==null?void 0:n.interpolation)==null?void 0:c.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),p=m&&m.length;u<p&&(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=Lr.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(l=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(l,t),f=c.key;s=f;let u=c.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,p=t.context!==void 0&&(q(t.context)||typeof t.context=="number")&&t.context!=="",y=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(x=>{var _,w;this.isValidLookup(n)||(o=x,!ur[`${y[0]}-${x}`]&&((_=this.utils)!=null&&_.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.hasLoadedNamespace(o))&&(ur[`${y[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${y.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(S=>{var j;if(this.isValidLookup(n))return;i=S;const E=[f];if((j=this.i18nFormat)!=null&&j.addLookupKeys)this.i18nFormat.addLookupKeys(E,f,S,x,t);else{let M;d&&(M=this.pluralResolver.getSuffix(S,t.count,t));const I=`${this.options.pluralSeparator}zero`,O=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(E.push(f+M),t.ordinal&&M.indexOf(O)===0&&E.push(f+M.replace(O,this.options.pluralSeparator)),m&&E.push(f+I)),p){const T=`${f}${this.options.contextSeparator}${t.context}`;E.push(T),d&&(E.push(T+M),t.ordinal&&M.indexOf(O)===0&&E.push(T+M.replace(O,this.options.pluralSeparator)),m&&E.push(T+I))}}let b;for(;b=E.pop();)this.isValidLookup(n)||(a=b,n=this.getResource(S,x,b,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 dr{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=be.create("languageUtils")}getScriptPartFromCode(e){if(e=Ye(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=Ye(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 pr={zero:0,one:1,two:2,few:3,many:4,other:5},hr={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Vn{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=be.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Ye(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!"),hr;if(!e.match(/-|_/))return hr;const l=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(l,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)=>pr[s]-pr[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 mr=(r,e,t,n=".",s=!0)=>{let a=kn(r,e,t);return!a&&s&&q(t)&&(a=Ot(r,t,n),a===void 0&&(a=Ot(e,t,n))),a},St=r=>r.replace(/\$/g,"$$$$");class Yn{constructor(e={}){var t;this.logger=be.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:l,formatSeparator:c,unescapeSuffix:f,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:m,nestingSuffix:p,nestingSuffixEscaped:y,nestingOptionsSeparator:x,maxReplaces:_,alwaysFormat:w}=e.interpolation;this.escape=t!==void 0?t:In,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Ce(a):i||"{{",this.suffix=o?Ce(o):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=f?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Ce(d):m||Ce("$t("),this.nestingSuffix=p?Ce(p):y||Ce(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=_||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 l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=p=>{if(p.indexOf(this.formatSeparator)<0){const w=mr(t,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,n,{...s,...t,interpolationkey:p}):w}const y=p.split(this.formatSeparator),x=y.shift().trim(),_=y.join(this.formatSeparator).trim();return this.format(mr(t,l,x,this.options.keySeparator,this.options.ignoreJSONStructure),_,n,{...s,...t,interpolationkey:x})};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:p=>St(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?St(this.escape(p)):St(p)}].forEach(p=>{for(o=0;a=p.regex.exec(e);){const y=a[1].trim();if(i=c(y),i===void 0)if(typeof f=="function"){const _=f(e,a,s);i=q(_)?_:""}else if(s&&Object.prototype.hasOwnProperty.call(s,y))i="";else if(u){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),i="";else!q(i)&&!this.useRawValueToEscape&&(i=ar(i));const x=p.safeValue(i);if(e=e.replace(a[0],x),u?(p.regex.lastIndex+=i.length,p.regex.lastIndex-=a[0].length):p.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(l,c)=>{const f=this.nestingOptionsSeparator;if(l.indexOf(f)<0)return l;const u=l.split(new RegExp(`${f}[ ]*{`));let d=`{${u[1]}`;l=u[0],d=this.interpolate(d,i);const m=d.match(/'/g),p=d.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!p||p.length%2!==0)&&(d=d.replace(/'/g,'"'));try{i=JSON.parse(d),c&&(i={...c,...i})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${f}${d}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,l};for(;s=this.nestingRegexp.exec(e);){let l=[];i={...n},i=i.replace&&!q(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let c=!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(),l=f,c=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!q(a))return a;q(a)||(a=ar(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),c&&(a=l.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 Un=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,...l]=i.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();t[f]||(t[f]=c),c==="false"&&(t[f]=!1),c==="true"&&(t[f]=!0),isNaN(c)||(t[f]=parseInt(c,10))}})}return{formatName:e,formatOptions:t}},gr=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(Ye(n),s),e[i]=o),o(t)}},Wn=r=>(e,t,n)=>r(Ye(t),n)(e);class Bn{constructor(e={}){this.logger=be.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?gr:Wn;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()]=gr(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(l=>l.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,l)=>{var u;const{formatName:c,formatOptions:f}=Un(l);if(this.formats[c]){let d=o;try{const m=((u=s==null?void 0:s.formatParams)==null?void 0:u[s.interpolationkey])||{},p=m.locale||m.lng||s.locale||s.lng||n;d=this.formats[c](o,p,{...f,...s,...m})}catch(m){this.logger.warn(m)}return d}else this.logger.warn(`there was no format function for ${c}`);return o},e)}}const Hn=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Gn extends dt{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=be.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={},l={};return e.forEach(c=>{let f=!0;t.forEach(u=>{const d=`${c}|${u}`;!n.reload&&this.store.hasResourceBundle(c,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),l[u]===void 0&&(l[u]=!0)))}),f||(o[c]=!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(l)}}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(l=>{Cn(l.loaded,[a],i),Hn(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{o[c]||(o[c]={});const f=l.loaded[c];f.length&&f.forEach(u=>{o[c][u]===void 0&&(o[c][u]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.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=(c,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(c&&f&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,a*2,i)},a);return}i(c,f)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const c=l(e,t);c&&typeof c.then=="function"?c.then(f=>o(null,f)).catch(o):o(null,c)}catch(c){o(c)}return}return l(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 l,c,f,u,d;if((c=(l=this.services)==null?void 0:l.utils)!=null&&c.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},p=this.backend.create.bind(this.backend);if(p.length<6)try{let y;p.length===5?y=p(e,t,n,s,m):y=p(e,t,n,s),y&&typeof y.then=="function"?y.then(x=>o(null,x)).catch(o):o(null,y)}catch(y){o(y)}else p(e,t,n,s,o,m)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const yr=()=>({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}),br=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=()=>{},Kn=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class Ue extends dt{constructor(e={},t){if(super(),this.options=br(e),this.services={},this.logger=be,this.modules={external:[]},Kn(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=yr();this.options={...n,...this.options,...br(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=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?be.init(s(this.modules.logger),this.options):be.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=Bn;const f=new dr(this.options);this.store=new cr(this.options.resources,this.options);const u=this.services;u.logger=be,u.resourceStore=this.store,u.languageUtils=f,u.pluralResolver=new Vn(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(u.formatter=s(c),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new Yn(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Gn(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 ot(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 c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[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(c=>{this[c]=(...f)=>this.store[c](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...f)=>(this.store[c](...f),this)});const o=Me(),l=()=>{const c=(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 c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,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=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};s?l(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>l(f)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,c=>l(c)),this.services.backendConnector.load(o,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(c)})}else n(null)}reloadResources(e,t,n){const s=Me();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"&&Lr.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=Me();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,l)=>{l?this.isLanguageChangingTo===e&&(s(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,n.resolve((...c)=>this.t(...c)),t&&t(o,(...c)=>this.t(...c))},i=o=>{var f,u;!e&&!o&&this.services.languageDetector&&(o=[]);const l=q(o)?o:o&&o[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(q(o)?[o]:o);c&&(this.language||s(c),this.translator.language||this.translator.changeLanguage(c),(u=(f=this.services.languageDetector)==null?void 0:f.cacheUserLanguage)==null||u.call(f,c)),this.loadResources(c,d=>{a(d,c)})};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 l;typeof i!="object"?l=this.options.overloadTranslationOptionHandler([a,i].concat(o)):l={...i},l.lng=l.lng||s.lng,l.lngs=l.lngs||s.lngs,l.ns=l.ns||s.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||n||s.keyPrefix);const c=this.options.keySeparator||".";let f;return l.keyPrefix&&Array.isArray(a)?f=a.map(u=>`${l.keyPrefix}${c}${u}`):f=l.keyPrefix?`${l.keyPrefix}${c}${a}`:a,this.t(f,l)};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,l)=>{const c=this.services.backendConnector.state[`${o}|${l}`];return c===-1||c===0||c===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=Me();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=Me();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 dr(yr());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new Ue(e,t)}cloneInstance(e={},t=Ze){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new Ue(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((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((f,u)=>(f[u]={...l[c][u]},f),l[c]),l),{});a.store=new cr(o,s),a.services.resourceStore=a.store}return a.translator=new ot(a.services,s),a.translator.on("*",(o,...l)=>{a.emit(o,...l)}),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=Ue.createInstance();ae.createInstance=Ue.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 qn={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"},zn={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},Jn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando",CheckObjectWrongValidation:"Oggetto non valido",ConfirmButton:"Conferma",AutocompleteDefaultPlaceholder:"Inserisci codice o descrizione"},Xn={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:qn,Month:zn,Generic:Jn},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"},Qn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},es={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command",CheckObjectWrongValidation:"Object not valid",ConfirmButton:"Confirm",AutocompleteDefaultPlaceholder:"Type code or description"},ts={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:Qn,Generic:es};function vr(r,e){return new RegExp(rs(r),e)}function rs(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const ns=(r,e,t)=>{let n=r;return isNaN(n)||(e!=null&&(n=Math.max(n,e)),t!=null&&(n=Math.min(n,t))),n},ss=(r,e)=>{var i,o;const n=Intl.NumberFormat(r).formatToParts(1000.1),s=((i=n.find(l=>l.type==="group"))==null?void 0:i.value)??",",a=e??((o=n.find(l=>l.type==="decimal"))==null?void 0:o.value)??".";return{groupingChar:s,decimalChar:a}};function as(r,e,t,n){let s=e;const a=ls(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=cs(s);return new Intl.NumberFormat(n,i).format(a)}const is=(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},os=(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 l=n.includes(".")?".":",",c=l==="."?a:i;c>1||c===1&&l===e&&n.length-n.lastIndexOf(l)-1===3||(s=l)}const o=s==="."?",":".";return n=n.replace(new RegExp(`\\${o}`,"g"),""),s!=="."&&(n=n.replace(new RegExp(`\\${s}`,"g"),".")),parseFloat(n)};function ls(r,e,t,n,s){let a=r;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const l=o=="."?",":".";a=a.replace(vr(l,"g"),""),a=a.replace(vr(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function cs(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 as(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:ts},it:{translation:Xn}}});const us=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),fs=(r,e)=>ae.t(r,e);function je(){const r=D.useCallback((n,s,a,i)=>us(n,s,a||void 0,i),[]),e=D.useCallback(()=>ae.languages[0],[]),t=D.useCallback((n,s)=>fs(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var Te=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r.CHECK_OBJECT_WRONG_VALIDATION="Generic.CheckObjectWrongValidation",r.CONFIRM_BUTTON="Generic.ConfirmButton",r.AUTOCOMPLETE_DEFAULT_PLACEHOLDER="Generic.AutocompleteDefaultPlaceholder",r))(Te||{}),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||{}),_t=(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))(_t||{});const Ct=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,isEditable:i=!0,fun:o,_changeOnEnter:l=!1,onChange:c,onOptionsRequest:f,onBlur:u,_multiActiveIndex:d,...m})=>{const p=D.useRef(null),[y,x]=D.useState(r),[_,w]=D.useState(e),{translate:S}=je(),[E,b]=D.useState(!1),[j,M]=D.useState(t||[]),[I,O]=D.useState(0),[T,k]=D.useState([r]),{anchorRef:$,targetRef:P,anchorWidth:V}=ct({position:"bottom",enabled:E}),A=D.useCallback(()=>{var R;b(!1),(R=p==null?void 0:p.current)==null||R.focus()},[]);ft([P],E,()=>A());const Y=Dn(400),z=R=>{R.length>=a?o&&f&&Y(async()=>{const L=await f(o,R);M(L),O(L.length>0?0:-1),b(!0)}):A(),x(R),w(e),l||c==null||c(R,e)},J=()=>{E||u==null||u()},U=R=>{l?(x(""),w("")):(x(R.id),w(R.label)),c==null||c(R.id,R.label);const L=j.findIndex(C=>C.id===R.id);O(L),k([R.id]),A()},h=R=>{R.key==="Escape"&&(A(),O(-1))},v=R=>{if((R.key==="ArrowDown"||R.key==="ArrowUp")&&(R.preventDefault(),E)){const L=R.key==="ArrowDown"?(I+1)%j.length:(I-1+j.length)%j.length;O(L)}switch(R.key){case"Enter":I>=0&&I<j.length?U(j[I]):l&&(c==null||c(y,""),A(),x(""),w(""));break;case"Escape":A(),O(-1);break}};return g.jsxs("div",{"data-component":"autocomplete",children:[g.jsx($t,{...m,bindValue:y,optionalDisplayValue:_,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:S(Te.AUTOCOMPLETE_DEFAULT_PLACEHOLDER),ref:$,inputRef:p,onChange:z,onKeyDown:v,onBlur:J,"aria-autocomplete":"list"}),E&&g.jsx(ut,{children:g.jsx(Cr,{options:j,displayMode:s,onClick:U,ref:P,selectedIndex:I,activeIndex:d||T,width:V,showFilter:!1,onKeyDown:h,isOpen:E})})]})},Ir=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:l,fullWidth:c,disabled:f,justify:u,squared:d,onClick:m,onOptionsRequest:p})=>{const[y,x]=D.useState(r);D.useEffect(()=>{!y&&p&&e&&p(e,void 0).then(S=>x(S)).catch(S=>{console.error("Errore nel caricamento delle opzioni per ButtonList",S)})},[y,e,p]);const _={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},w=y==null?void 0:y.map((S,E)=>{const b={bindValue:S.id,optionalDisplayValue:S.label,fun:S.fun,icon:S.icon,variant:a,appearance:i,showText:o,showIcon:l,fullWidth:c,disabled:f,sizing:s,justify:u,squared:d,onClick:()=>{m==null||m(S.id,S.fun)}};return g.jsx(Se,{...b},`button-${E}`)});return g.jsx("div",{role:"list","data-component":"button-list",className:_.container,children:w})},ds={"smp-checkbox-wrapper":"_smp-checkbox-wrapper_z14lq_2"},Pr=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i,variant:o="checkbox"})=>{const l=D.useId(),c=u=>{s&&a&&a(u.target.checked)},f={wrapper:`${ds["smp-checkbox-wrapper"]}`};return g.jsxs("div",{className:f.wrapper,"data-component":e,children:[n&&g.jsx(De,{label:n,disabled:t,htmlFor:l}),g.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:c,onBlur:i,role:o==="switch"?"switch":"checkbox",id:l})]})},kt=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,l]=D.useState(null),c={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=m=>{n==null||n(r.filter((p,y)=>y!==m))},u=m=>{l(m)},d=m=>{if(o===null||o===m)return;const p=[...r],[y]=p.splice(o,1);p.splice(m,0,y),n==null||n(p),l(null)};return g.jsx("div",{className:c.container,role:"list","data-component":"chip",children:r.flatMap((m,p)=>{const y=Pe(m.bindValue,m.optionalDisplayValue,t),x=g.jsxs("div",{className:c.element,role:"listitem",draggable:i,onDragStart:()=>u(p),onDragOver:w=>i&&w.preventDefault(),onDrop:()=>i&&d(p),style:{"--smp-chips-backgroundColor-base":a},children:[i&&g.jsx(oe,{icon:"drag_indicator_horizontal",isInteractable:!0}),g.jsx(_e,{variant:"label",bindValue:y,color:s}),e&&g.jsx(oe,{icon:"close",isInteractable:!0,onClick:()=>f(p),color:s})]},`chip-${p}`),_=i&&p<r.length-1?g.jsx(oe,{icon:"chevron-right",color:s},`separator-${p}`):null;return[x,_].filter(Boolean)})})};function Lt(r,e){const t=D.useRef(null);D.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(c=>!c.hasAttribute("disabled")&&c.offsetParent!==null):[];(()=>{const c=s();c.length>0&&requestAnimationFrame(()=>c[0].focus())})();const i=c=>{if(c.key==="Escape"||c.key!=="Tab")return;const f=s();if(f.length===0)return;const u=f[0],d=f[f.length-1];c.shiftKey&&document.activeElement===u?(c.preventDefault(),d.focus()):!c.shiftKey&&document.activeElement===d&&(c.preventDefault(),u.focus())},o=c=>{if(n&&!n.contains(c.target)){c.preventDefault();const f=s();f.length>0&&f[0].focus()}};document.addEventListener("keydown",i),document.addEventListener("mousedown",o);const l=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=l,t.current&&requestAnimationFrame(()=>{var c;(c=t.current)==null||c.focus()})}},[r,e])}const Ar=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:l,multiActiveIndex:c,...f})=>{const u=D.useRef(null),[d,m]=D.useState(!1),[p,y]=D.useState(t),[x,_]=D.useState(-1),[w,S]=D.useState([r]),E=D.useId(),{anchorRef:b,targetRef:j,anchorWidth:M}=ct({position:"bottom",enabled:d}),I=D.useCallback(()=>{var P;m(!1),(P=u==null?void 0:u.current)==null||P.focus()},[]);ft([j,b],d,()=>I()),Lt(d,j);const O=P=>{e==null||e(P.id,P.label);const V=p.findIndex(A=>A.id===P.id);_(V),S([P.id]),I()},T=P=>{P.key==="Escape"&&(I(),_(-1))},k=P=>{(P.key==="ArrowDown"||P.key==="ArrowUp")&&(P.preventDefault(),$())},$=()=>{s&&(o&&l?d?m(!1):l(o,void 0).then(P=>{y(P),_(P.length>0?0:-1),m(!0)}):m(P=>!P))};return g.jsxs("div",{role:"combobox","aria-expanded":d,"aria-controls":E,"aria-owns":E,"data-component":"combobox",children:[g.jsx($t,{...f,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:$,onKeyDown:k,onClick:$,shapeIcon:"arrow_drop_down",rotatedShapeIcon:d,isEditable:s,ref:b,inputRef:u,"aria-autocomplete":"list",variant:"notSelectable"}),d&&g.jsx(ut,{children:g.jsx(Cr,{id:E,options:p,displayMode:i,ref:j,isOpen:d,selectedIndex:x,activeIndex:c||w,width:M,onClick:O,onKeyDown:T})})]})},ps={"smp-datepickercalendar-position":"_smp-datepickercalendar-position_1lf9g_1"};function hs({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=je(),i=()=>{if(!n)return;const U=new Date(n);return isNaN(U.getTime())?void 0:U},[o]=D.useState(new Date),[l,c]=D.useState(r||i()||new Date),[f,u]=D.useState(l?l.getMonth():new Date().getMonth()),[d,m]=D.useState(l?l.getFullYear():new Date().getFullYear()),[p,y]=D.useState(l?l.getDate():null),x=D.useRef(null),_=D.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)],S=[{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)}],E=U=>t.some(h=>{const v=h.start.getTime(),R=h.end.getTime(),L=U.getTime();return L>=v&&L<=R}),b=U=>{E(U)||(c(U),y(U.getDate()),e&&e(On(U)))},j=()=>{f===0?(u(11),m(d-1)):u(f-1),y(1)},M=()=>{f===11?(u(0),m(d+1)):u(f+1),y(1)},I=(U,h)=>new Date(U,h+1,0).getDate(),O=(U,h)=>new Date(U,h,1).getDay(),T=U=>{var v;const h=V.findIndex(R=>R!==null&&R.getDate()===U);h!==-1&&_.current[h]&&((v=_.current[h])==null||v.focus(),y(U))},k=(U,h)=>{const v=V[h];if(!v)return;const R=I(d,f),L=v.getDate();switch(U.key){case"ArrowRight":U.preventDefault();{let C=L+1,N=new Date(d,f,C);if(C>R){const W=f===11?d+1:d,H=f===11?0:f+1;C=1,N=new Date(W,H,C),M(),setTimeout(()=>{$(1,"forward")},0);return}E(N)?$(C,"forward"):T(C)}break;case"Tab":break;case"ArrowLeft":U.preventDefault();{let C=L-1,N=new Date(d,f,C);if(C<1){const W=f===0?d-1:d,H=f===0?11:f-1,B=I(W,H);C=B,N=new Date(W,H,C),j(),setTimeout(()=>{$(B,"backward")},0);return}E(N)?$(C,"backward"):T(C)}break;case"ArrowUp":U.preventDefault();{let C=L-7,N=new Date(d,f,C);if(C<1){const W=f===0?d-1:d,H=f===0?11:f-1;C=I(W,H)+C,N=new Date(W,H,C),j(),setTimeout(()=>{$(C,"backward")},0);return}E(N)?$(C,"backward"):T(C)}break;case"ArrowDown":U.preventDefault();{let C=L+7,N=new Date(d,f,C);if(C>R){const W=f===11?d+1:d,H=f===11?0:f+1;C=C-R,N=new Date(W,H,C),M(),setTimeout(()=>{$(C,"forward")},0);return}E(N)?$(C,"forward"):T(C)}break;case"Home":U.preventDefault(),$(1,"forward");break;case"End":U.preventDefault(),$(R,"backward");break;case"PageUp":U.preventDefault(),j(),setTimeout(()=>{const C=I(f===0?d-1:d,f===0?11:f-1),N=Math.min(L,C);$(N,"forward")},0);break;case"PageDown":U.preventDefault(),M(),setTimeout(()=>{const C=I(f===11?d+1:d,f===11?0:f+1),N=Math.min(L,C);$(N,"forward")},0);break;case" ":case"Space":if(E(v))return;y(v.getDate()),c(v);break;case"Enter":U.preventDefault(),b(v);break}},$=(U,h)=>{const v=I(d,f);if(h==="forward"){for(let R=U;R<=v;R++){const L=new Date(d,f,R);if(!E(L)){T(R);return}}M(),setTimeout(()=>{$(1,"forward")},0)}else{for(let N=U;N>=1;N--){const W=new Date(d,f,N);if(!E(W)){T(N);return}}const R=f===0?d-1:d,L=f===0?11:f-1,C=I(R,L);j(),setTimeout(()=>{$(C,"backward")},0)}},V=(()=>{const U=I(d,f),h=O(d,f),v=[];for(let R=0;R<h;R++)v.push(null);for(let R=1;R<=U;R++){const L=new Date(d,f,R);v.push(L)}return v})(),A=[];let Y=[];V.forEach((U,h)=>{if(Y.push(U),Y.length===7||h===V.length-1){for(;Y.length<7;)Y.push(null);A.push(Y),Y=[]}}),D.useEffect(()=>{var U;if(p!==null){const h=V.findIndex(v=>v!==null&&v.getDate()===p);h!==-1&&_.current[h]&&((U=_.current[h])==null||U.focus())}},[f,d,p,V]);const z={label:"smp-datepickercalendar-label",wrapper:`smp-datepickercalendar ${ps["smp-datepickercalendar-position"]}`,calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(U,h,v,R)=>`smp-datepickercalendar-td
46
46
  ${U?"smp-datepickercalendar-td-today":""}
47
47
  ${h?"smp-datepickercalendar-td-selected":""}
48
48
  ${v?"smp-datepickercalendar-td-focused":""}
49
- ${R?"smp-datepickercalendar-td-disabled":""}`},J=()=>`${w[f]} ${p.toString()}`;return g.jsxs("div",{className:z.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[g.jsx(Se,{onClick:j,ariaLabel:a(_t.PREVIOUS_MONTH),optionalDisplayValue:"<",appearance:"ghost",variant:"base",bindValue:"<"}),g.jsx("div",{"aria-label":J(),className:z.label,children:J()}),g.jsx(Se,{onClick:M,ariaLabel:a(_t.NEXT_MONTH),bindValue:">",optionalDisplayValue:">",appearance:"ghost",variant:"base"})]}),g.jsxs("table",{ref:x,role:"grid","aria-label":`${a(Te.CALENDAR_FOR)} ${w[f]} ${p}`,className:z.table,children:[g.jsx("thead",{children:g.jsx("tr",{children:S.map(U=>g.jsx("th",{scope:"col",abbr:U.full,className:z.th,children:U.value},U.value))})}),g.jsx("tbody",{children:A.map((U,h)=>g.jsx("tr",{children:U.map((v,R)=>{const L=h*7+R;if(v===null)return g.jsx("td",{className:z.td(!1,!1,!1,!0)},`empty-${R}`);const C=v.getDate()===o.getDate()&&v.getMonth()===o.getMonth()&&v.getFullYear()===o.getFullYear(),N=l&&v.getDate()===l.getDate()&&v.getMonth()===l.getMonth()&&v.getFullYear()===l.getFullYear(),W=d===v.getDate(),H=E(v);return g.jsx("td",{role:"gridcell","aria-selected":N,tabIndex:W?0:-1,onClick:()=>b(v),onKeyDown:B=>I(B,L),"aria-label":`${v.getDate()} ${w[v.getMonth()]} ${v.getFullYear()}`,"data-selected":N,"aria-disabled":H,ref:B=>{_.current[L]=B},className:z.td(C,N,W,H),children:v.getDate()},`day-${R}`)})},`week-${h}`))})]})]})}const Nr=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const i=D.useRef(null),[o,l]=D.useState(!1),[c,f]=D.useState(r||""),[u,p]=D.useState(""),{anchorRef:m,targetRef:d}=ct({position:"bottom",enabled:o}),y=D.useCallback(()=>{var O;l(!1),(O=i==null?void 0:i.current)==null||O.focus()},[]);ft([d,m],o,()=>{y()}),Lt(o,d);const{format:x,getCurrentLanguage:_}=je(),w=D.useCallback(O=>{const T=O.length>5&&wn(O,_())||O,I=x(T,void 0,void 0,{type:"date"}),$=typeof T!="string",P=$&&T.toISOString().substring(0,10)||"";return{isValid:$,formattedDate:I,isoDate:P,normalizedDate:T}},[_,x]);D.useEffect(()=>{const{formattedDate:O,isoDate:T,isValid:I}=w(r);f(I&&T||r),p(I&&O||r)},[r,x,w]);const S=()=>l(O=>!O),E=()=>{j(u)},b=O=>{j(O),y()},j=O=>{const{isoDate:T,isValid:I}=w(O);t&&t(I&&T||O)},M=O=>{p(O)},k=O=>{O.key==="Enter"&&(O.preventDefault(),j(u))};return g.jsxs("div",{"data-component":"date-picker",children:[g.jsx(we,{...a,bindValue:u,placeholder:e,onBlur:E,onChange:M,onKeyDown:k,shapeIcon:"calendar",onShapeIconClick:S,ref:m,inputRef:i,isEditable:s,size:10,maxLength:a.maxLength?a.maxLength:10}),o&&g.jsx(ut,{children:g.jsx(hs,{disabledDateRanges:n,onDateChange:b,initialValue:jt(c)&&c||"",targetRef:d})})]})},ms=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:l,error:c,onOptionsRequest:f,onChange:u,onBlur:p})=>{const m=r.map(x=>x.bindValue),d=(x,_)=>{const w=[...r];if(x=="")w.pop();else{const S=w.findIndex(E=>E.bindValue===x&&E.optionalDisplayValue===_);S>=0?w.splice(S,1):w.push({bindValue:x,optionalDisplayValue:_})}u==null||u(w)},y={container:"smp-multipleAutocomplete-container"};return g.jsxs("div",{className:y.container,"data-component":"multiple-autocomplete",children:[i&&g.jsx(De,{label:i,disabled:o}),g.jsx(It,{elements:r,displayMode:e,isEditable:s,onChange:x=>{u==null||u(x)}}),g.jsx(Ct,{bindValue:"",fun:l,isEditable:s,onChange:d,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:f,_multiActiveIndex:m,error:c,onBlur:p})]})},Mr=({...r})=>{const[e,t]=D.useState(!1),n=e?"visibility-off":"visibility";return g.jsx(we,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},gs=({...r})=>{const[e,t]=D.useState(r.bindValue),{translate:n}=je(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return g.jsx(we,{...r,placeholder:r.placeholder?r.placeholder:n(Te.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},ys=({bindValue:r,optionalDisplayValue:e,label:t})=>{const n={wrapper:"smp-text-wrapper"};return t?g.jsxs("div",{className:n.wrapper,children:[g.jsx(De,{label:t}),g.jsx(_e,{variant:"body",bindValue:e||r})]}):g.jsx(_e,{variant:"body",bindValue:e||r})};class Re{constructor(e,t){de(this,"class");de(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Re(e,e.k==""?[]:e.k.split(";"))}static fromString(e){return new Re({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const Le=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),xr=r=>{const e=Re.fromDataObj(r.obj),t=r.decode?Re.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},bs=(r,e)=>{const t=new Re(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new Re(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return Le(r,t,n)},vs=({min:r,max:e,step:t=1,inputMode:n="decimal",dSep:s,bindValue:a,onChange:i,onEnter:o,...l})=>{const{getCurrentLanguage:c}=je(),f=D.useRef(null),u=c(),{groupingChar:p,decimalChar:m}=D.useMemo(()=>ss(u,s),[u,s]),d=D.useCallback(($,P)=>new Intl.NumberFormat(u,{minimumFractionDigits:P,maximumFractionDigits:P,useGrouping:!0}).format($),[u]),y=D.useCallback(os,[p,m]),x=D.useCallback(ns,[r,e]),_=a!=null&&a.toString().includes(".")?a.toString().split(".")[1].length:0,[w,S]=D.useState(_),[E,b]=D.useState(a!=null?d(a,w):""),j=D.useRef(a??null);D.useEffect(()=>{if(a==null){b(""),j.current=null;return}const $=a.toString().includes(".")?a.toString().split(".")[1].length:0,P=$===0?w:$;P!==w&&S(P),b(d(a,P)),j.current=a},[a,d]);const M=D.useCallback(($,P=!1)=>{if($.trim()===""){b(""),j.current=null,i==null||i(void 0,""),P&&(o==null||o(void 0));return}const Y=y($,p,m);if(isNaN(Y))if(j.current!=null){const A=d(j.current,w);b(A)}else b("");else{const A=x(Y,r,e),V=is($,p,m);S(V);const z=d(A,V);b(z),j.current=A,i==null||i(A,z),P&&(o==null||o(A))}},[y,p,m,x,r,e,d,i,o,w]),k=$=>b($),O=()=>M(E),T=$=>{if($.key==="Enter"){$.preventDefault(),M(E,!0);return}if($.key==="ArrowUp"||$.key==="ArrowDown"){$.preventDefault();const P=$.key==="ArrowUp"?1:-1,Y=j.current??0,A=x(Y+P*t,r,e);M(d(A,w))}},I=$=>{if(!$.currentTarget.contains(document.activeElement))return;$.preventDefault();const P=$.deltaY<0?1:-1,Y=j.current??0,A=x(Y+P*t,r,e);M(d(A,w))};return g.jsx("div",{ref:f,"data-component":"input-number",onWheel:I,children:g.jsx(we,{...l,"aria-valuemin":r,"aria-valuemax":e,"aria-valuenow":j.current??void 0,bindValue:E,inputType:"text",inputMode:n,min:r,max:e,step:t,onChange:k,onBlur:O,onKeyDown:T})})};class We{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==="."?",":".";if(e.k=="")return new We(e,void 0,t);const s=e.k.replace(new RegExp(`\\${n}`,"g"),""),a=parseFloat(s.replace(t,"."));return new We(e,a,t)}getLegacyValue(){return this.value!=null?this.value.toString().replace(".",this.decimalSeparator):""}getValue(){return this.value}}const xs=({disabled:r,bindValue:e,onChange:t,placeholder:n,state:s,appearance:a,isEditable:i,label:o,ariaLabel:l,helperText:c,error:f,onBlur:u,onKeyDown:p,rows:m=10,cols:d=150})=>{const y=D.useId(),x=`${y}-helper`,_=f?"danger":s,w=c||!!f,S=b=>{t==null||t(b.target.value)},E={wrapper:"smp-textarea-wrapper",container:`smp-textarea ${r?"smp-textarea-disabled":""} ${n?"smp-textarea-placeholder":""} ${_?`smp-textarea-${_}`:""} ${a?`smp-textarea-${a}`:""} ${i?"":"smp-textarea-readOnly"}`};return g.jsxs("div",{className:E.wrapper,"data-component":"textarea",children:[o&&g.jsx(De,{htmlFor:y,label:o,disabled:r}),g.jsx("textarea",{id:y,value:e,placeholder:n,onChange:S,onBlur:u,className:E.container,disabled:r,readOnly:!i,onKeyDown:p,"aria-label":o?void 0:l,"aria-labelledby":o?y:void 0,"aria-describedby":w?x:void 0,rows:m,cols:d}),w&&g.jsx(jr,{id:x,helperText:f,disabled:r,state:_})]})};var Rt=(r=>(r.PAGE_DIRECTION="pageDirection",r.LINE_DIRECTION="lineDirection",r))(Rt||{});const Fe={"smp-radio":"_smp-radio_1wj31_1","smp-radio-options-container":"_smp-radio-options-container_1wj31_10","smp-radio-horizontal":"_smp-radio-horizontal_1wj31_16","smp-radio-element":"_smp-radio-element_1wj31_20","smp-radio-disabled":"_smp-radio-disabled_1wj31_26"},Ss=({disabled:r=!1,displayMode:e="DescOnly",RadLay:t=Rt.PAGE_DIRECTION,options:n,onOptionsRequest:s,fun:a,label:i,...o})=>{const[l,c]=D.useState(n),f=D.useId();D.useEffect(()=>{!l&&s&&a&&s(a,void 0).then(y=>c(y)).catch(y=>{console.error("Error during loading options (radio)",y)})},[l,s,a]);const u={container:Fe["smp-radio"],optionsContainer:`${Fe["smp-radio-options-container"]} ${t==Rt.LINE_DIRECTION?Fe["smp-radio-horizontal"]:""}`,option:`${Fe["smp-radio-element"]} ${r?Fe["smp-radio-disabled"]:""}`},p=()=>{var y;r||(y=o.onBlur)==null||y.call(o)},m=y=>{var x;r||(x=o.onChange)==null||x.call(o,y.id,y.label)},d=D.useId();return g.jsxs("div",{"smp-id":"radio-container",className:u.container,id:f,children:[i&&g.jsx(De,{label:i,disabled:r,htmlFor:f}),g.jsx("div",{className:u.optionsContainer,children:l==null?void 0:l.map((y,x)=>g.jsxs("label",{className:u.option,children:[g.jsx("input",{type:"radio",name:d,value:y.id,disabled:r,checked:y.id===o.bindValue,onChange:()=>m(y),onBlur:p}),g.jsx(_e,{variant:"body",bindValue:Pe(y.id,y.label,e)})]},x))})]})},ws=({value:r,onChange:e,targetRef:t,isOpen:n})=>{const s=D.useRef(null);D.useEffect(()=>{n&&(s!=null&&s.current)&&s.current.focus()},[n,s]);const[a,i,o]=r,l=c=>Array.from({length:c},(f,u)=>g.jsx("option",{value:u,children:u.toString().padStart(2,"0")},u));return g.jsxs("div",{className:"smp-timepicker-widget",ref:t,children:[g.jsx("select",{value:a,ref:s,onChange:c=>e(+c.target.value,i,o),id:"time-picker-hours",children:l(24)}),":",g.jsx("select",{value:i,onChange:c=>e(a,+c.target.value,o),id:"time-picker-minutes",children:l(60)}),":",g.jsx("select",{value:o||0,onChange:c=>e(a,i,+c.target.value),id:"time-picker-seconds",children:l(60)})]})},Sr=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)},Es=r=>{const e=r.split(":").map(t=>parseInt(t,10));return[e[0]||0,e[1]||0,e[2]||0]},Ts=(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},Os=({bindValue:r,placeholder:e="HH:MM:SS",onChange:t,isEditable:n=!0,...s})=>{const a=D.useRef(null),[i,o]=D.useState(!1),[l,c]=D.useState(r||""),[f,u]=D.useState(""),{anchorRef:p,targetRef:m}=ct({position:"bottom",enabled:i}),d=D.useCallback(()=>{var b;o(!1),(b=a==null?void 0:a.current)==null||b.focus()},[]);ft([m,p],i,()=>o(!1)),Lt(i,m),D.useEffect(()=>{const b=r||"",j=Sr(b)?b:r||"";c(b),u(j)},[r]),D.useEffect(()=>{const b=j=>{j.key==="Escape"&&o(!1)};return i&&document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[i]);const y=()=>{n&&o(b=>!b)},x=b=>{u(b)},_=(b,j,M)=>{const k=Ts(b,j,M);c(k),u(k),t==null||t(k),d()},w=()=>{E(f)},S=b=>{b.key==="Enter"&&(b.preventDefault(),E(f))},E=b=>{if(b.trim()===""){c(""),u(""),t==null||t("");return}Sr(b)?(c(b),u(b),t==null||t(b)):u(b)};return g.jsxs("div",{"data-component":"time-picker",children:[g.jsx($t,{...s,bindValue:f,placeholder:e,onChange:x,onBlur:w,onKeyDown:S,shapeIcon:"clock",onShapeIconClick:y,isEditable:n,ref:p,inputRef:a}),i&&g.jsx(ut,{children:g.jsx(ws,{value:Es(l),onChange:_,targetRef:m,isOpen:i})})]})};function _s(r){return typeof r=="string"&&/^\d{6}$/.test(r)}class lt{constructor(e,t){de(this,"class");de(this,"time");this.class=e,this.time=t}static fromDataObj(e){const t=wr.get(`${e.t}${e.p}`);if(t)return new lt(e,t.legacyToIso(e.k));throw new Error(`time creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=wr.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 wr=new Map([["I12",{legacyToIso(r){return _s(r)&&`${r.substring(0,2)}:${r.substring(2,4)}:${r.substring(4,6)}`||r},isoToLegacy(r){return r.replaceAll(":","")||r}}]]),Rs={"smp-cell-wrapper":"_smp-cell-wrapper_mdlkz_1"},Oe=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,tooltip:l,options:c,onChange:f,onClick:u,onEnter:p,onBlur:m,onOptionsRequest:d,onContextMenu:y,isEditable:x,dSep:_="."})=>{const w={obj:t,shape:e,decode:r,icon:s,fun:a},S={onBlur:m,onOptionsRequest:d,fun:a,icon:s,tooltip:l,label:o,isEditable:x,...n},E=(T,I,$)=>vn(t)?Le(T,new st(t,I).getLegacyValue()):xn(t)?Le(T,new lt(t,I).getLegacyValue()):Le(T,I,$),b=(T,I)=>Le(T,new We(t,I,_).getLegacyValue()),j=T=>Le(w,new nt(t,T).getLegacyValue()),M=T=>bs(w,T),k=()=>{switch(e){case te.AUTOCOMPLETE:{const T={...S,bindValue:t.k,optionalDisplayValue:r,onChange:(I,$)=>{f==null||f(E(w,I,$))}};return g.jsx(Ct,{...T})}case te.BUTTON:{const T={...S,bindValue:t.k,optionalDisplayValue:n!=null&&n.label&&typeof n.label=="string"?n.label:void 0,title:r,onClick:()=>{u==null||u(E(w,t.k))}};return g.jsx(Se,{...T})}case te.BUTTON_LIST:{const T={...S,options:c,onClick:(I,$)=>{const P={...w,fun:$};u==null||u(E(P,I))}};return g.jsx(kr,{...T})}case te.CHIP:{const T={...S,elements:xr(w)};return g.jsx(It,{...T})}case te.CHECKBOX:case te.SWITCH:{const T=e===te.SWITCH,I={...S,bindValue:nt.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:$=>{f==null||f(j($))},...T&&{variant:"switch"}};return g.jsx(Pr,{...I})}case te.COMBOBOX:{const T={...S,bindValue:t.k,optionalDisplayValue:r,onChange:(I,$)=>{f==null||f(E(w,I,$))}};return g.jsx(Ar,{...T})}case te.DATE:{const T={...S,bindValue:st.fromDataObj(t).getValue(),onChange:I=>{f==null||f(E(w,I))}};return g.jsx(Nr,{...T})}case te.ICON:case te.IMAGE:{const T={...S,icon:s,placeholderIcon:i,isInteractable:!!S.fun,onClick:()=>{u==null||u(E(w,t.k))}};return g.jsx(oe,{...T})}case te.INPUT_NUMBER:{const T={...S,bindValue:We.fromDataObj(t,_).getValue(),onChange:I=>{f==null||f(b(w,I))}};return g.jsx(vs,{...T})}case te.MEMO:{const T={...S,bindValue:t.k,optionalDisplayValue:r,onChange:I=>{f==null||f(E(w,I))}};return g.jsx(xs,{...T})}case te.MULTI_AUTOCOMPLETE:{const T={...S,elements:xr(w),onChange:I=>{f==null||f(M(I))}};return g.jsx(ms,{...T})}case te.PASSWORD:{const T={...S,bindValue:t.k,onChange:I=>{f==null||f(E(w,I))}};return g.jsx(Mr,{...T})}case te.RADIO:{const T={...S,bindValue:t.k,onChange:(I,$)=>{f==null||f(E(w,I,$))}};return g.jsx(Ss,{...T})}case te.SPOTLIGHT:{const T={...S,bindValue:t.k,onEnter:I=>{p==null||p(E(w,I))}};return g.jsx(gs,{...T})}case te.TEXT_FIELD:{const T={...S,bindValue:t.k,optionalDisplayValue:r,onChange:I=>{f==null||f(E(w,I))}};return g.jsx(we,{...T})}case te.TIME:{const T={...S,bindValue:lt.fromDataObj(t).getValue(),onChange:I=>{f==null||f(E(w,I))}};return g.jsx(Os,{...T})}default:{const T={...S,bindValue:t.k,optionalDisplayValue:r};return g.jsx(ys,{...T})}}},O={wrapper:`${Rs["smp-cell-wrapper"]}`};return g.jsx("span",{className:O.wrapper,onContextMenu:T=>{y&&l&&(T.preventDefault(),y(w,T.currentTarget))},children:k()})},Ds=({data:r,onClick:e,onEnter:t,onContextMenu:n})=>{var o,l;const[s,a]=D.useState(),i=D.useCallback(c=>{var u,p;if(!((u=c.rows)!=null&&u.length)||!((p=c.columns)!=null&&p.length))return{};const f=c.rows[0];return c.columns.filter(m=>m.visible).reduce((m,d)=>{const y=f.cells[d.name],x={...y,id:d.name,onChange:_=>{a(w=>w&&{...w,[d.name]:{...w[d.name],obj:{...w[d.name].obj,k:_.obj.k}}})},onClick:()=>{y.fun&&e&&e({...y})},onEnter:_=>{t&&t(_)},onContextMenu:(_,w)=>{n&&n(_,w)}};return{...m,[d.name]:x}},{})},[e,t,n]);return D.useEffect(()=>{r&&a(i(r))},[r,i]),!((o=r==null?void 0:r.rows)!=null&&o.length)||!((l=r.columns)!=null&&l.length)?null:s&&g.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:g.jsx(rt,{layout:r.rows[0].layout,children:Object.values(s).map(c=>g.jsx(Oe,{...c}))})})},js=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,$s=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:l,onContextMenu:c})=>{var E,b;const[f,u]=D.useState(),[p,m]=D.useState(t??!0),d=D.useRef(null),y=s.trim()?s:"100vh",x=D.useCallback(j=>{var k,O;if(!((k=j==null?void 0:j.rows)!=null&&k.length)||!((O=j==null?void 0:j.columns)!=null&&O.length))return{};const M=j.rows[0];return j.columns.filter(T=>T.visible??!0).reduce((T,I)=>{const $=M.cells[I.name];if(!$||!p&&ce(n)&&$.shape!==te.BUTTON&&$.shape!==te.BUTTON_LIST)return T;const P={...$,id:I.name,onChange:Y=>{u(A=>{const V={...A};return V!=null&&V[I.name]&&(V[I.name].obj.k=Y.obj.k),V})},onClick:Y=>{Y.fun&&a&&a(Y)},onEnter:Y=>{i&&i(Y)},onContextMenu:(Y,A)=>{c&&c(Y,A)}};return l&&$.shape==te.BUTTON_LIST&&(P.onOptionsRequest=(Y,A)=>l(Y,A).then(V=>js(V))),!p&&ce(n)&&(P.data={...P.data,showText:!1,justify:"center",squared:!0}),{...T,[I.name]:P}},{})},[p,n,a,i,l,c]),_=D.useCallback(()=>{o==null||o()},[o]),w=()=>{ce(n)?m(j=>!j):(m(!1),o==null||o())};if(D.useEffect(()=>{u(x(r))},[r]),D.useEffect(()=>{if(!d.current)return;if(!ce(n)){u(x(r));return}const j=getComputedStyle(d.current).getPropertyValue("--smp-drawer-slide-transition");let M=Number(j);j.endsWith("ms")?M=parseFloat(j):j.endsWith("s")&&(M=parseFloat(j)*1e3),setTimeout(()=>{u(x(r))},M/2)},[p,n]),D.useEffect(()=>{t!==void 0&&!ce(n)&&m(t)},[n,t]),!((E=r==null?void 0:r.rows)!=null&&E.length)||!((b=r.columns)!=null&&b.length))return null;const S={drawer:`smp-drawer ${ce(n)?"smp-drawer-minified":"smp-drawer-fixed"} ${p?"smp-drawer-open":""} ${!ce(n)&&!p?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${p?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${p?"smp-drawer-backdrop-open":""}`};return f&&g.jsxs(g.Fragment,{children:[!ce(n)&&g.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:S.backdrop,onClick:_}),g.jsx("aside",{ref:d,className:S.drawer,style:{height:y},"aria-label":"Drawer","smp-id":"drawer",children:g.jsxs("div",{className:S.container,children:[g.jsxs("div",{className:S.containerHeader,children:[e&&g.jsx("div",{className:S.containerLogo,children:g.jsx(oe,{icon:e,title:"drawer_logo",width:"100%",height:24})}),g.jsx("div",{className:S.containerIcon,children:g.jsx(oe,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!p,isInteractable:!0,onClick:w,width:20,height:20})})]}),g.jsx("div",{className:S.containerLayout,children:g.jsx(rt,{layout:r.rows[0].layout,children:Object.values(f).map(j=>g.jsx(Oe,{...j}))})})]})})]})},Cs=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:l,IconColName:c,IconColor:f="var(--smp-dashList-color-base)",NumberFormat:u,ForceUM:p,UmColName:m,UmColor:d="var(--smp-dashList-color-base)",ForceValue:y,ValueColName:x,ValueColor:_="var(--smp-dashList-color-base)",SelectLayout:w="1",onClick:S})=>{const E="N/A",b=(e==null?void 0:e.columns)||[],j=(e==null?void 0:e.rows)||[],M=j.length>0,k="--smp-dashList-color",O="smp-layout",T="descr",I="icon",$="um",P="value",Y=i||"1em",A="18px",V="--smp-dashList-columns",z="--smp-dashList-fontSize",J={dash:(G="1")=>{const Z=h(G),re=Z,ne=v(Z,T),fe=v(Z,I),ve=v(Z,$),me=v(Z,P);return{container:re,descr:ne,icon:fe,um:ve,value:me}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
50
- ${ce(o)?"smp-dash-list-horizontal":""}`},{format:U}=je(),h=G=>`${O}-${G}`,v=(G,Z)=>`${G}__${Z}`,R=G=>`${k}-${G}`,L=G=>{const Z=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(Z.test(G)){const ne=G.match(Z)||[];if((ne==null?void 0:ne.length)>3)return"rgb("+ne[1]+","+ne[2]+","+ne[3]+")"}return G},C=G=>{if(!u)return G;const[Z,re]=N(u).map($e=>parseInt($e||"0")),ne="0,0"+(re?"."+"0".repeat(re):""),fe=U(G,ne,"it");if(!Z)return fe;const[ve,me]=fe.split(",");return ve+(me?`,${me}`:"")},N=G=>G.includes(";")?G.split(";"):[G],W=G=>{const Z=ne=>{var fe;if(ne)return(fe=G==null?void 0:G.cells[ne])==null?void 0:fe.obj.k},re=ne=>{var fe,ve;if(!(b.length<=ne))return(ve=(fe=G==null?void 0:G.cells[b[ne].name])==null?void 0:fe.obj)==null?void 0:ve.k};return{descr:t||Z(n)||re(2)||"",icon:l||Z(c)||re(3)||"",um:p||Z(m)||re(1)||"",value:y||Z(x)||re(0)||""}},H=G=>{S==null||S(G)},B=(G,Z)=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),G.stopPropagation(),H(Z))},K=(G=>{const Z=J.dash(G);return{className:Z,descr:re=>g.jsx("div",{className:Z.descr,children:re},`${G}-${T}`),icon:re=>g.jsx("div",{className:Z.icon,children:g.jsx(oe,{color:f,height:A,icon:re,width:A})},`${G}-${I}`),um:re=>g.jsx("div",{className:Z.um,children:re},`${G}-${$}`),value:re=>g.jsx("div",{className:Z.value,children:re},`${G}-${P}`)}})(w),se=G=>{const{descr:Z,icon:re,um:ne,value:fe}=W(G),ve={[R(T)]:L(s),[R($)]:L(d),[R(P)]:L(_)},me=[],$e=C(fe);switch(w){case"2":re&&me.push(K.icon(re)),me.push(K.descr(Z)),me.push(K.value(ne?$e+" "+ne:$e));break;default:case"1":me.push(K.descr(Z)),me.push(K.value(ne?$e+" "+ne:$e))}return g.jsx("div",{className:K.className.container,role:"button",style:ve,tabIndex:0,onClick:()=>H(G),onKeyDown:Vr=>B(Vr,G),children:me},G.rowId)},F={[V]:String(r),[z]:Y};return g.jsx("div",{className:J.dashList,style:F,children:M?j.map(G=>se(G)):E})},Qe={"smp-table":"_smp-table_1qmju_1","smp-headerCell":"_smp-headerCell_1qmju_35","smp-resizer":"_smp-resizer_1qmju_44"},Is="_rowContent_20wit_2",Ls="_clickable_20wit_21",ks="_indent_20wit_26",Ps="_toggle_20wit_32",As="_cell_20wit_38",Ns="_leftSection_20wit_46",Ee={rowContent:Is,clickable:Ls,indent:ks,toggle:Ps,cell:As,leftSection:Ns};function et(r){return!!r&&"children"in r}function Ms(r){return!et(r)}function Fs(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 Fr=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var w;const[a,i]=D.useState(!1),o=et(r)&&!!((w=r.children)!=null&&w.length),l=r.cells&&Object.keys(r.cells).length>0,c=o,f=t*20,u=()=>{o&&i(!a)},p={content:`${Ee.rowContent} ${o?Ee.clickable:""}`,toggle:`${Ee.toggle}`,indent:`${Ee.indent}`,cell:`${Ee.cell}`},m=S=>g.jsx(Oe,{...S}),d=()=>g.jsx("span",{className:p.toggle,children:c&&g.jsx(oe,{icon:a?"arrow_drop_right":"arrow_drop_down",width:16})}),y=()=>g.jsx("span",{className:p.indent,style:{width:`${f}px`},"aria-hidden":"true"}),x=()=>{const S=Ms(r)?"":r.decode||(l?"":"Untitled"),E=s??n*t;return g.jsxs("tr",{className:p.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(${E}px)`},children:[et(r)&&g.jsxs("td",{className:Ee.leftSection,style:{height:`${n}px`},children:[y(),d(),g.jsx("span",{className:Ee.rowLabel,children:S})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([b,j])=>g.jsx("td",{className:p.cell,style:{width:e[b],minWidth:e[b],height:`${n}px`},children:m({...j,id:b})},Fs(j)||b))]})},_=()=>{var S;return a||!o?null:g.jsx(g.Fragment,{children:et(r)&&((S=r.children)==null?void 0:S.map((E,b)=>g.jsx(Fr,{row:E,level:t+1},`child-${b}`)))})};return g.jsxs(g.Fragment,{children:[x(),_()]})},Vs=({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 g.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:g.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[g.jsx(oe,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),g.jsx(_e,{variant:"title",bindValue:r})]})})};function Ys(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function Us(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 Ws(r,e,t,n){const s=[];let a=0;return i(r,0,[]),{flatRows:s,offset:a};function i(u,p,m){if(p>=e.length){f(u);return}const d=e[p].column,y=o(u,d);for(const[x,_]of y){const w=[...m,x],S=l(w,p),E=n.has(S);s.push(c(x,S,p,E)),a+=t,E&&i(_,p+1,w)}}function o(u,p){var d;const m=new Map;for(const y of u){const x=((d=y.cells[p])==null?void 0:d.decode)??"N/D";m.has(x)||m.set(x,[]),m.get(x).push(y)}return m}function l(u,p){return`group-${u.join("-")}-${p}`}function c(u,p,m,d){return{isGroup:!0,value:u,cells:{},rowId:p,level:m,isExpanded:d}}function f(u){for(const p of u)s.push(p),a+=t}}const Bs=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return g.jsxs("tr",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[g.jsx("td",{children:g.jsx(oe,{icon:"groups"})}),g.jsx("td",{children:g.jsx(It,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})})]})},Hs=({columns:r,columnWidths:e})=>g.jsx("tfoot",{children:g.jsx("tr",{children:r.map(t=>t.visible&&g.jsx("td",{className:Qe["smp-headerCell"],style:{width:e[t.name],minWidth:e[t.name],maxWidth:e[t.name]}},t.name))})}),Gs=({columns:r,rows:e,containerRef:t,sizingMode:n})=>{const[s,a]=D.useState({});return D.useEffect(()=>{var i,o;if(!(!r||r.length===0)){if(n==="fixed"){const c=Object.fromEntries(r.map(f=>[f.name,120]));a(c)}else if(n==="fit-grid"){const l=((i=t.current)==null?void 0:i.offsetWidth)||800,c=r.filter(p=>p.visible!==!1),f=l/c.length,u=Object.fromEntries(c.map(p=>[p.name,f]));a(u)}else if(n==="fit-content"){const l={};for(const c of r){if(!c.visible)continue;const f=((o=c.title)==null?void 0:o.length)||0,u=Math.max(...e.map(p=>{var m,d,y,x;return`${((d=(m=p.cells)==null?void 0:m[c.name])==null?void 0:d.decode)||((x=(y=p.cells)==null?void 0:y[c.name])==null?void 0:x.value)||""}`.length}),f);l[c.name]=u*8+24}a(l)}}},[r,e,t,n]),[s,a]},Ks=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var M;const[i,o]=D.useState(r??{columns:[],rows:[]}),[l,c]=D.useState(n||[]),[f,u]=D.useState(new Set),p=D.useRef(null),[m,d]=Gs({columns:(i==null?void 0:i.columns)??[],rows:(i==null?void 0:i.rows)??[],containerRef:p,sizingMode:s});D.useEffect(()=>{if(l!=null&&l.length&&r.rows){const{flatRows:k}=Ws(r.rows,l,e,f);o({...r,rows:k})}else o(r)},[r,l,f,e]);const y=k=>{c(Us(k,l))},x=k=>{k.preventDefault();const O=k.dataTransfer.getData("text/plain");if(!O||l.some($=>$.column===O))return;const I=[...l,{column:O,visible:!0}];c(I)},_=k=>{k.preventDefault()},{virtualItems:w,containerProps:S,innerProps:E}=$r({items:(i==null?void 0:i.rows)??[],itemHeight:e,containerHeight:t,overscan:5}),b=(k,O)=>{const T=k.clientX,I=m[O],$=Y=>{const A=Y.clientX-T,V=Math.max(50,I+A);d(z=>({...z,[O]:V}))},P=()=>{window.removeEventListener("mousemove",$),window.removeEventListener("mouseup",P)};window.addEventListener("mousemove",$),window.addEventListener("mouseup",P)},j={smpTable:`${Qe["smp-table"]}`,headerCell:`${Qe["smp-headerCell"]}`,resizer:`${Qe["smp-resizer"]}`};return i&&g.jsx("div",{className:j.smpTable,...S,ref:p,children:g.jsxs("table",{children:[g.jsxs("thead",{children:[(n||a)&&g.jsx(Bs,{groups:l,onChange:y,onDrop:x,onDragOver:_}),g.jsx("tr",{children:i.columns&&((M=i.columns)==null?void 0:M.map(k=>k.visible&&g.jsxs("th",{className:j.headerCell,draggable:!0,onDragStart:O=>{O.dataTransfer.setData("text/plain",k.name)},style:{width:m[k.name],minWidth:m[k.name],maxWidth:m[k.name]},children:[g.jsx(_e,{variant:"title",bindValue:k.title}),g.jsx("div",{className:j.resizer,onMouseDown:O=>b(O,k.name),role:"region"})]},k.name)))})]}),g.jsx("tbody",{...E,children:w.map(({item:k,index:O,offsetTop:T})=>{const I=k.rowId||k.value||`${k.isGroup?"group":"row"}-${O}`;return k.isGroup?g.jsx(Vs,{label:k.value||"",rowHeight:e,offsetTop:T,level:k.level,onClick:()=>{const $=k.rowId;$&&u(P=>Ys(P,$))},isExpanded:k.isExpanded},`group-${I}`):g.jsx(Fr,{row:k,columnWidths:m,rowHeight:e,offsetTop:T,isGroup:!1},`row-${I}`)})}),g.jsx(Hs,{columns:i.columns,columnWidths:m})]})})},qs=({data:r,Type:e,ShowSubmit:t=!1,SubmitPosition:n="Right",DefaultValue:s,Label:a,LabelPosition:i="Left",onBlur:o,onClick:l,onOptionsRequest:c})=>{const[f,u]=D.useState();D.useEffect(()=>{u(()=>{if(!r)return;const y={...r};return e&&(y.shape=e),y.shape==null&&(y.shape=te.TEXT_FIELD),s&&(y.obj=Sn(s)),y})},[r,s,e]);const m={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},d=()=>{ce(t)||o==null||o(f)};if(f)return g.jsxs("div",{className:m.container,children:[g.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:g.jsx(Oe,{...f,id:"FLD",onChange:u,onOptionsRequest:c,fun:r==null?void 0:r.fun,onBlur:d,label:a,labelPosition:i})}),ce(t)&&g.jsx(Se,{optionalDisplayValue:"Confirm",onClick:()=>l==null?void 0:l(f),bindValue:"Confirm"})]})},zs=r=>(r==null?void 0:r.type)==="SmeupDataTree",Js=r=>(r==null?void 0:r.type)==="SmeupDataTable",Xs=r=>zs(r)?r.children?r.children.map(e=>({id:e.obj.k,label:e.value??""})):[]:Js(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}}):[],Zs=({data:r,id:e,readOnly:t=!1,hiddenSubmitButton:n=!1,updateOnClick:s=!1,decimalSeparator:a=".",optionsHandler:i,onSubmit:o,onCheck:l,onCheckObj:c,onContextMenu:f,onButtonClick:u})=>{var M,k;const[p,m]=D.useState({}),{translate:d}=je(),y=D.useId();D.useEffect(()=>{m(E(r))},[r]);const x=(O,T)=>{m(I=>({...I,[O]:{...I[O],obj:{...I[O].obj,k:T.obj.k},decode:T.decode,data:{...I[O].data,error:void 0},value:T.obj.k}})),s&&(T.shape==te.CHECKBOX||T.shape==te.SWITCH)&&_()},_=O=>{const T=b();o({value:T,cell:O})},w=(O,T)=>{u==null||u({cellId:O,currentState:{type:"SmeupDataTable",columns:r.columns,rows:[{cells:p}]},fun:T||""})},S=async O=>{var T,I;if(p[O].obj.k!=r.rows[0].cells[O].obj.k&&((T=p[O].inputSettings)!=null&&T.checkObject&&c&&((await c({obj:p[O].obj,fun:p[O].fun,cellId:O})).valid||m(P=>({...P,[O]:{...P[O],data:{...P[O].data,error:d(Te.CHECK_OBJECT_WRONG_VALIDATION)}}}))),(I=p[O].inputSettings)!=null&&I.checkValueOnExit)){const $=b();l==null||l({value:$,cell:O})}},E=O=>{var I,$,P;if(!((I=O.rows)!=null&&I.length)||!(($=O.columns)!=null&&$.length))return{};const T=(P=O.rows)==null?void 0:P[0];return O.columns.filter(Y=>Y.visible??!0).reduce((Y,A)=>{const V={...T.cells[A.name],id:A.name,label:A.title,dSep:a,data:{...T.cells[A.name].data,dSep:a}};return V.fun&&(V.onOptionsRequest=async(z,J)=>Xs(await i(z,J,r,A.name))),V.isEditable==null&&(V.isEditable=!0),t&&(V.isEditable=!1),V.isEditable&&V.shape==null&&(V.shape=te.TEXT_FIELD),{...Y,[A.name]:V}},{})},b=()=>({before:r,after:{type:"SmeupDataTable",columns:JSON.parse(JSON.stringify(r.columns)),rows:[{cells:JSON.parse(JSON.stringify(p))}]}}),j=((k=(M=r.setup)==null?void 0:M.commands)==null?void 0:k.map((O,T)=>D.createElement(Oe,{...O,decode:O.value,data:{label:O.value},id:`command-${T}`,key:`command-${T}`,shape:te.BUTTON,onClick:()=>_(O.obj.k)})))||[];return n||j.unshift(g.jsx(Oe,{decode:d(Te.CONFIRM_BUTTON),shape:te.BUTTON,id:"",obj:{t:"",p:"",k:""},data:{submit:!0,label:d(Te.CONFIRM_BUTTON)}},"submit-command")),p&&g.jsxs("form",{"data-component":"input-panel",id:e||y,onSubmit:O=>{O.preventDefault(),_()},children:[g.jsx("div",{style:{padding:"1em 0"},children:g.jsx(rt,{layout:r.rows[0].layout,children:Object.values(p).map(O=>g.jsx(Oe,{...O,onChange:T=>x(O.id,T),onBlur:()=>S(O.id),onContextMenu:f,onClick:()=>{O.shape=="BTN"&&w(O.id,O.fun)},data:{...O.data,autocomplete:"off"}}))})}),j.length>0&&g.jsx(rt,{layout:{sections:[{id:"1",horizontal:!0,justify:"start",content:j.map(O=>({id:O.props.id}))}]},children:j})]})};exports.AppBar=Ds;exports.Autocomplete=Ct;exports.Button=Se;exports.ButtonList=kr;exports.Checkbox=Pr;exports.Combobox=Ar;exports.DashList=Cs;exports.DataTableComponent=Ks;exports.DatePicker=Nr;exports.Drawer=$s;exports.Field=qs;exports.Icon=oe;exports.InputPanel=Zs;exports.Password=Mr;exports.TabBar=Dr;exports.Textfield=we;exports.configurePaths=yn;
49
+ ${R?"smp-datepickercalendar-td-disabled":""}`},J=()=>`${w[f]} ${d.toString()}`;return g.jsxs("div",{className:z.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[g.jsx(Se,{onClick:j,ariaLabel:a(_t.PREVIOUS_MONTH),optionalDisplayValue:"<",appearance:"ghost",variant:"base",bindValue:"<"}),g.jsx("div",{"aria-label":J(),className:z.label,children:J()}),g.jsx(Se,{onClick:M,ariaLabel:a(_t.NEXT_MONTH),bindValue:">",optionalDisplayValue:">",appearance:"ghost",variant:"base"})]}),g.jsxs("table",{ref:x,role:"grid","aria-label":`${a(Te.CALENDAR_FOR)} ${w[f]} ${d}`,className:z.table,children:[g.jsx("thead",{children:g.jsx("tr",{children:S.map(U=>g.jsx("th",{scope:"col",abbr:U.full,className:z.th,children:U.value},U.value))})}),g.jsx("tbody",{children:A.map((U,h)=>g.jsx("tr",{children:U.map((v,R)=>{const L=h*7+R;if(v===null)return g.jsx("td",{className:z.td(!1,!1,!1,!0)},`empty-${R}`);const C=v.getDate()===o.getDate()&&v.getMonth()===o.getMonth()&&v.getFullYear()===o.getFullYear(),N=l&&v.getDate()===l.getDate()&&v.getMonth()===l.getMonth()&&v.getFullYear()===l.getFullYear(),W=p===v.getDate(),H=E(v);return g.jsx("td",{role:"gridcell","aria-selected":N,tabIndex:W?0:-1,onClick:()=>b(v),onKeyDown:B=>k(B,L),"aria-label":`${v.getDate()} ${w[v.getMonth()]} ${v.getFullYear()}`,"data-selected":N,"aria-disabled":H,ref:B=>{_.current[L]=B},className:z.td(C,N,W,H),children:v.getDate()},`day-${R}`)})},`week-${h}`))})]})]})}const Nr=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const i=D.useRef(null),[o,l]=D.useState(!1),[c,f]=D.useState(r||""),[u,d]=D.useState(""),{anchorRef:m,targetRef:p}=ct({position:"bottom",enabled:o}),y=D.useCallback(()=>{var O;l(!1),(O=i==null?void 0:i.current)==null||O.focus()},[]);ft([p,m],o,()=>{y()}),Lt(o,p);const{format:x,getCurrentLanguage:_}=je(),w=D.useCallback(O=>{const T=O.length>5&&wn(O,_())||O,k=x(T,void 0,void 0,{type:"date"}),$=typeof T!="string",P=$&&T.toISOString().substring(0,10)||"";return{isValid:$,formattedDate:k,isoDate:P,normalizedDate:T}},[_,x]);D.useEffect(()=>{const{formattedDate:O,isoDate:T,isValid:k}=w(r);f(k&&T||r),d(k&&O||r)},[r,x,w]);const S=()=>l(O=>!O),E=()=>{j(u)},b=O=>{j(O),y()},j=O=>{const{isoDate:T,isValid:k}=w(O);t&&t(k&&T||O)},M=O=>{d(O)},I=O=>{O.key==="Enter"&&(O.preventDefault(),j(u))};return g.jsxs("div",{"data-component":"date-picker",children:[g.jsx(we,{...a,bindValue:u,placeholder:e,onBlur:E,onChange:M,onKeyDown:I,shapeIcon:"calendar",onShapeIconClick:S,ref:m,inputRef:i,isEditable:s,size:10,maxLength:a.maxLength?a.maxLength:10}),o&&g.jsx(ut,{children:g.jsx(hs,{disabledDateRanges:n,onDateChange:b,initialValue:jt(c)&&c||"",targetRef:p})})]})},ms=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:l,error:c,onOptionsRequest:f,onChange:u,onBlur:d})=>{const m=r.map(x=>x.bindValue),p=(x,_)=>{const w=[...r];if(x=="")w.pop();else{const S=w.findIndex(E=>E.bindValue===x&&E.optionalDisplayValue===_);S>=0?w.splice(S,1):w.push({bindValue:x,optionalDisplayValue:_})}u==null||u(w)},y={container:"smp-multipleAutocomplete-container"};return g.jsxs("div",{className:y.container,"data-component":"multiple-autocomplete",children:[i&&g.jsx(De,{label:i,disabled:o}),g.jsx(kt,{elements:r,displayMode:e,isEditable:s,onChange:x=>{u==null||u(x)}}),g.jsx(Ct,{bindValue:"",fun:l,isEditable:s,onChange:p,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:f,_multiActiveIndex:m,error:c,onBlur:d})]})},Mr=({...r})=>{const[e,t]=D.useState(!1),n=e?"visibility-off":"visibility";return g.jsx(we,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},gs=({...r})=>{const[e,t]=D.useState(r.bindValue),{translate:n}=je(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return g.jsx(we,{...r,placeholder:r.placeholder?r.placeholder:n(Te.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},ys=({bindValue:r,optionalDisplayValue:e,label:t})=>{const n={wrapper:"smp-text-wrapper"};return t?g.jsxs("div",{className:n.wrapper,children:[g.jsx(De,{label:t}),g.jsx(_e,{variant:"body",bindValue:e||r})]}):g.jsx(_e,{variant:"body",bindValue:e||r})};class Re{constructor(e,t){de(this,"class");de(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Re(e,e.k==""?[]:e.k.split(";"))}static fromString(e){return new Re({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const Le=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),xr=r=>{const e=Re.fromDataObj(r.obj),t=r.decode?Re.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},bs=(r,e)=>{const t=new Re(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new Re(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return Le(r,t,n)},vs=({min:r,max:e,step:t=1,inputMode:n="decimal",dSep:s,bindValue:a,onChange:i,onEnter:o,...l})=>{const{getCurrentLanguage:c}=je(),f=D.useRef(null),u=c(),{groupingChar:d,decimalChar:m}=D.useMemo(()=>ss(u,s),[u,s]),p=D.useCallback(($,P)=>new Intl.NumberFormat(u,{minimumFractionDigits:P,maximumFractionDigits:P,useGrouping:!0}).format($),[u]),y=D.useCallback(os,[d,m]),x=D.useCallback(ns,[r,e]),_=a!=null&&a.toString().includes(".")?a.toString().split(".")[1].length:0,[w,S]=D.useState(_),[E,b]=D.useState(a!=null?p(a,w):""),j=D.useRef(a??null);D.useEffect(()=>{if(a==null){b(""),j.current=null;return}const $=a.toString().includes(".")?a.toString().split(".")[1].length:0,P=$===0?w:$;P!==w&&S(P),b(p(a,P)),j.current=a},[a,p]);const M=D.useCallback(($,P=!1)=>{if($.trim()===""){b(""),j.current=null,i==null||i(void 0,""),P&&(o==null||o(void 0));return}const V=y($,d,m);if(isNaN(V))if(j.current!=null){const A=p(j.current,w);b(A)}else b("");else{const A=x(V,r,e),Y=is($,d,m);S(Y);const z=p(A,Y);b(z),j.current=A,i==null||i(A,z),P&&(o==null||o(A))}},[y,d,m,x,r,e,p,i,o,w]),I=$=>b($),O=()=>M(E),T=$=>{if($.key==="Enter"){$.preventDefault(),M(E,!0);return}if($.key==="ArrowUp"||$.key==="ArrowDown"){$.preventDefault();const P=$.key==="ArrowUp"?1:-1,V=j.current??0,A=x(V+P*t,r,e);M(p(A,w))}},k=$=>{if(!$.currentTarget.contains(document.activeElement))return;$.preventDefault();const P=$.deltaY<0?1:-1,V=j.current??0,A=x(V+P*t,r,e);M(p(A,w))};return g.jsx("div",{ref:f,"data-component":"input-number",onWheel:k,children:g.jsx(we,{...l,"aria-valuemin":r,"aria-valuemax":e,"aria-valuenow":j.current??void 0,bindValue:E,inputType:"text",inputMode:n,min:r,max:e,step:t,onChange:I,onBlur:O,onKeyDown:T})})};class We{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==="."?",":".";if(e.k=="")return new We(e,void 0,t);const s=e.k.replace(new RegExp(`\\${n}`,"g"),""),a=parseFloat(s.replace(t,"."));return new We(e,a,t)}getLegacyValue(){return this.value!=null?this.value.toString().replace(".",this.decimalSeparator):""}getValue(){return this.value}}const xs=({disabled:r,bindValue:e,onChange:t,placeholder:n,state:s,appearance:a,isEditable:i,label:o,ariaLabel:l,helperText:c,error:f,onBlur:u,onKeyDown:d,rows:m=10,cols:p=150})=>{const y=D.useId(),x=`${y}-helper`,_=f?"danger":s,w=c||!!f,S=b=>{t==null||t(b.target.value)},E={wrapper:"smp-textarea-wrapper",container:`smp-textarea ${r?"smp-textarea-disabled":""} ${n?"smp-textarea-placeholder":""} ${_?`smp-textarea-${_}`:""} ${a?`smp-textarea-${a}`:""} ${i?"":"smp-textarea-readOnly"}`};return g.jsxs("div",{className:E.wrapper,"data-component":"textarea",children:[o&&g.jsx(De,{htmlFor:y,label:o,disabled:r}),g.jsx("textarea",{id:y,value:e,placeholder:n,onChange:S,onBlur:u,className:E.container,disabled:r,readOnly:!i,onKeyDown:d,"aria-label":o?void 0:l,"aria-labelledby":o?y:void 0,"aria-describedby":w?x:void 0,rows:m,cols:p}),w&&g.jsx(jr,{id:x,helperText:f,disabled:r,state:_})]})};var Rt=(r=>(r.PAGE_DIRECTION="pageDirection",r.LINE_DIRECTION="lineDirection",r))(Rt||{});const Fe={"smp-radio":"_smp-radio_1wj31_1","smp-radio-options-container":"_smp-radio-options-container_1wj31_10","smp-radio-horizontal":"_smp-radio-horizontal_1wj31_16","smp-radio-element":"_smp-radio-element_1wj31_20","smp-radio-disabled":"_smp-radio-disabled_1wj31_26"},Ss=({disabled:r=!1,displayMode:e="DescOnly",RadLay:t=Rt.PAGE_DIRECTION,options:n,onOptionsRequest:s,fun:a,label:i,...o})=>{const[l,c]=D.useState(n),f=D.useId();D.useEffect(()=>{!l&&s&&a&&s(a,void 0).then(y=>c(y)).catch(y=>{console.error("Error during loading options (radio)",y)})},[l,s,a]);const u={container:Fe["smp-radio"],optionsContainer:`${Fe["smp-radio-options-container"]} ${t==Rt.LINE_DIRECTION?Fe["smp-radio-horizontal"]:""}`,option:`${Fe["smp-radio-element"]} ${r?Fe["smp-radio-disabled"]:""}`},d=()=>{var y;r||(y=o.onBlur)==null||y.call(o)},m=y=>{var x;r||(x=o.onChange)==null||x.call(o,y.id,y.label)},p=D.useId();return g.jsxs("div",{"smp-id":"radio-container",className:u.container,id:f,children:[i&&g.jsx(De,{label:i,disabled:r,htmlFor:f}),g.jsx("div",{className:u.optionsContainer,children:l==null?void 0:l.map((y,x)=>g.jsxs("label",{className:u.option,children:[g.jsx("input",{type:"radio",name:p,value:y.id,disabled:r,checked:y.id===o.bindValue,onChange:()=>m(y),onBlur:d}),g.jsx(_e,{variant:"body",bindValue:Pe(y.id,y.label,e)})]},x))})]})},ws=({value:r,onChange:e,targetRef:t,isOpen:n})=>{const s=D.useRef(null);D.useEffect(()=>{n&&(s!=null&&s.current)&&s.current.focus()},[n,s]);const[a,i,o]=r,l=c=>Array.from({length:c},(f,u)=>g.jsx("option",{value:u,children:u.toString().padStart(2,"0")},u));return g.jsxs("div",{className:"smp-timepicker-widget",ref:t,children:[g.jsx("select",{value:a,ref:s,onChange:c=>e(+c.target.value,i,o),id:"time-picker-hours",children:l(24)}),":",g.jsx("select",{value:i,onChange:c=>e(a,+c.target.value,o),id:"time-picker-minutes",children:l(60)}),":",g.jsx("select",{value:o||0,onChange:c=>e(a,i,+c.target.value),id:"time-picker-seconds",children:l(60)})]})},Sr=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)},Es=r=>{const e=r.split(":").map(t=>parseInt(t,10));return[e[0]||0,e[1]||0,e[2]||0]},Ts=(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},Os=({bindValue:r,placeholder:e="HH:MM:SS",onChange:t,isEditable:n=!0,...s})=>{const a=D.useRef(null),[i,o]=D.useState(!1),[l,c]=D.useState(r||""),[f,u]=D.useState(""),{anchorRef:d,targetRef:m}=ct({position:"bottom",enabled:i}),p=D.useCallback(()=>{var b;o(!1),(b=a==null?void 0:a.current)==null||b.focus()},[]);ft([m,d],i,()=>o(!1)),Lt(i,m),D.useEffect(()=>{const b=r||"",j=Sr(b)?b:r||"";c(b),u(j)},[r]),D.useEffect(()=>{const b=j=>{j.key==="Escape"&&o(!1)};return i&&document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[i]);const y=()=>{n&&o(b=>!b)},x=b=>{u(b)},_=(b,j,M)=>{const I=Ts(b,j,M);c(I),u(I),t==null||t(I),p()},w=()=>{E(f)},S=b=>{b.key==="Enter"&&(b.preventDefault(),E(f))},E=b=>{if(b.trim()===""){c(""),u(""),t==null||t("");return}Sr(b)?(c(b),u(b),t==null||t(b)):u(b)};return g.jsxs("div",{"data-component":"time-picker",children:[g.jsx($t,{...s,bindValue:f,placeholder:e,onChange:x,onBlur:w,onKeyDown:S,shapeIcon:"clock",onShapeIconClick:y,isEditable:n,ref:d,inputRef:a}),i&&g.jsx(ut,{children:g.jsx(ws,{value:Es(l),onChange:_,targetRef:m,isOpen:i})})]})};function _s(r){return typeof r=="string"&&/^\d{6}$/.test(r)}class lt{constructor(e,t){de(this,"class");de(this,"time");this.class=e,this.time=t}static fromDataObj(e){const t=wr.get(`${e.t}${e.p}`);if(t)return new lt(e,t.legacyToIso(e.k));throw new Error(`time creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=wr.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 wr=new Map([["I12",{legacyToIso(r){return _s(r)&&`${r.substring(0,2)}:${r.substring(2,4)}:${r.substring(4,6)}`||r},isoToLegacy(r){return r.replaceAll(":","")||r}}]]),Rs={"smp-cell-wrapper":"_smp-cell-wrapper_mdlkz_1"},Oe=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,tooltip:l,options:c,onChange:f,onClick:u,onEnter:d,onBlur:m,onOptionsRequest:p,onContextMenu:y,isEditable:x,dSep:_="."})=>{const w={obj:t,shape:e,decode:r,icon:s,fun:a},S={onBlur:m,onOptionsRequest:p,fun:a,icon:s,tooltip:l,label:o,isEditable:x,...n},E=(T,k,$)=>vn(t)?Le(T,new st(t,k).getLegacyValue()):xn(t)?Le(T,new lt(t,k).getLegacyValue()):Le(T,k,$),b=(T,k)=>Le(T,new We(t,k,_).getLegacyValue()),j=T=>Le(w,new nt(t,T).getLegacyValue()),M=T=>bs(w,T),I=()=>{switch(e){case te.AUTOCOMPLETE:{const T={...S,bindValue:t.k,optionalDisplayValue:r,onChange:(k,$)=>{f==null||f(E(w,k,$))}};return g.jsx(Ct,{...T})}case te.BUTTON:{const T={...S,bindValue:t.k,optionalDisplayValue:n!=null&&n.label&&typeof n.label=="string"?n.label:void 0,title:r,onClick:()=>{u==null||u(E(w,t.k))}};return g.jsx(Se,{...T})}case te.BUTTON_LIST:{const T={...S,options:c,onClick:(k,$)=>{const P={...w,fun:$};u==null||u(E(P,k))}};return g.jsx(Ir,{...T})}case te.CHIP:{const T={...S,elements:xr(w)};return g.jsx(kt,{...T})}case te.CHECKBOX:case te.SWITCH:{const T=e===te.SWITCH,k={...S,bindValue:nt.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:$=>{f==null||f(j($))},...T&&{variant:"switch"}};return g.jsx(Pr,{...k})}case te.COMBOBOX:{const T={...S,bindValue:t.k,optionalDisplayValue:r,onChange:(k,$)=>{f==null||f(E(w,k,$))}};return g.jsx(Ar,{...T})}case te.DATE:{const T={...S,bindValue:st.fromDataObj(t).getValue(),onChange:k=>{f==null||f(E(w,k))}};return g.jsx(Nr,{...T})}case te.ICON:case te.IMAGE:{const T={...S,icon:s,placeholderIcon:i,isInteractable:!!S.fun,onClick:()=>{u==null||u(E(w,t.k))}};return g.jsx(oe,{...T})}case te.INPUT_NUMBER:{const T={...S,bindValue:We.fromDataObj(t,_).getValue(),onChange:k=>{f==null||f(b(w,k))}};return g.jsx(vs,{...T})}case te.EDITOR:case te.MEMO:{const T={...S,bindValue:t.k,optionalDisplayValue:r,onChange:k=>{f==null||f(E(w,k))}};return g.jsx(xs,{...T})}case te.MULTI_AUTOCOMPLETE:{const T={...S,elements:xr(w),onChange:k=>{f==null||f(M(k))}};return g.jsx(ms,{...T})}case te.PASSWORD:{const T={...S,bindValue:t.k,onChange:k=>{f==null||f(E(w,k))}};return g.jsx(Mr,{...T})}case te.RADIO:{const T={...S,bindValue:t.k,onChange:(k,$)=>{f==null||f(E(w,k,$))}};return g.jsx(Ss,{...T})}case te.SPOTLIGHT:{const T={...S,bindValue:t.k,onEnter:k=>{d==null||d(E(w,k))}};return g.jsx(gs,{...T})}case te.TEXT_FIELD:{const T={...S,bindValue:t.k,optionalDisplayValue:r,onChange:k=>{f==null||f(E(w,k))}};return g.jsx(we,{...T})}case te.TIME:{const T={...S,bindValue:lt.fromDataObj(t).getValue(),onChange:k=>{f==null||f(E(w,k))}};return g.jsx(Os,{...T})}default:{const T={...S,bindValue:t.k,optionalDisplayValue:r};return g.jsx(ys,{...T})}}},O={wrapper:`${Rs["smp-cell-wrapper"]}`};return g.jsx("span",{className:O.wrapper,onContextMenu:T=>{y&&l&&(T.preventDefault(),y(w,T.currentTarget))},children:I()})},Ds=({data:r,onClick:e,onEnter:t,onContextMenu:n})=>{var o,l;const[s,a]=D.useState(),i=D.useCallback(c=>{var u,d;if(!((u=c.rows)!=null&&u.length)||!((d=c.columns)!=null&&d.length))return{};const f=c.rows[0];return c.columns.filter(m=>m.visible).reduce((m,p)=>{const y=f.cells[p.name],x={...y,id:p.name,onChange:_=>{a(w=>w&&{...w,[p.name]:{...w[p.name],obj:{...w[p.name].obj,k:_.obj.k}}})},onClick:()=>{y.fun&&e&&e({...y})},onEnter:_=>{t&&t(_)},onContextMenu:(_,w)=>{n&&n(_,w)}};return{...m,[p.name]:x}},{})},[e,t,n]);return D.useEffect(()=>{r&&a(i(r))},[r,i]),!((o=r==null?void 0:r.rows)!=null&&o.length)||!((l=r.columns)!=null&&l.length)?null:s&&g.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:g.jsx(rt,{layout:r.rows[0].layout,children:Object.values(s).map(c=>g.jsx(Oe,{...c}))})})},js=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,$s=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:l,onContextMenu:c})=>{var E,b;const[f,u]=D.useState(),[d,m]=D.useState(t??!0),p=D.useRef(null),y=s.trim()?s:"100vh",x=D.useCallback(j=>{var I,O;if(!((I=j==null?void 0:j.rows)!=null&&I.length)||!((O=j==null?void 0:j.columns)!=null&&O.length))return{};const M=j.rows[0];return j.columns.filter(T=>T.visible??!0).reduce((T,k)=>{const $=M.cells[k.name];if(!$||!d&&ce(n)&&$.shape!==te.BUTTON&&$.shape!==te.BUTTON_LIST)return T;const P={...$,id:k.name,onChange:V=>{u(A=>{const Y={...A};return Y!=null&&Y[k.name]&&(Y[k.name].obj.k=V.obj.k),Y})},onClick:V=>{V.fun&&a&&a(V)},onEnter:V=>{i&&i(V)},onContextMenu:(V,A)=>{c&&c(V,A)}};return l&&$.shape==te.BUTTON_LIST&&(P.onOptionsRequest=(V,A)=>l(V,A).then(Y=>js(Y))),!d&&ce(n)&&(P.data={...P.data,showText:!1,justify:"center",squared:!0}),{...T,[k.name]:P}},{})},[d,n,a,i,l,c]),_=D.useCallback(()=>{o==null||o()},[o]),w=()=>{ce(n)?m(j=>!j):(m(!1),o==null||o())};if(D.useEffect(()=>{u(x(r))},[r]),D.useEffect(()=>{if(!p.current)return;if(!ce(n)){u(x(r));return}const j=getComputedStyle(p.current).getPropertyValue("--smp-drawer-slide-transition");let M=Number(j);j.endsWith("ms")?M=parseFloat(j):j.endsWith("s")&&(M=parseFloat(j)*1e3),setTimeout(()=>{u(x(r))},M/2)},[d,n]),D.useEffect(()=>{t!==void 0&&!ce(n)&&m(t)},[n,t]),!((E=r==null?void 0:r.rows)!=null&&E.length)||!((b=r.columns)!=null&&b.length))return null;const S={drawer:`smp-drawer ${ce(n)?"smp-drawer-minified":"smp-drawer-fixed"} ${d?"smp-drawer-open":""} ${!ce(n)&&!d?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${d?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${d?"smp-drawer-backdrop-open":""}`};return f&&g.jsxs(g.Fragment,{children:[!ce(n)&&g.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:S.backdrop,onClick:_}),g.jsx("aside",{ref:p,className:S.drawer,style:{height:y},"aria-label":"Drawer","smp-id":"drawer",children:g.jsxs("div",{className:S.container,children:[g.jsxs("div",{className:S.containerHeader,children:[e&&g.jsx("div",{className:S.containerLogo,children:g.jsx(oe,{icon:e,title:"drawer_logo",width:"100%",height:24})}),g.jsx("div",{className:S.containerIcon,children:g.jsx(oe,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!d,isInteractable:!0,onClick:w,width:20,height:20})})]}),g.jsx("div",{className:S.containerLayout,children:g.jsx(rt,{layout:r.rows[0].layout,children:Object.values(f).map(j=>g.jsx(Oe,{...j}))})})]})})]})},Cs=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:l,IconColName:c,IconColor:f="var(--smp-dashList-color-base)",NumberFormat:u,ForceUM:d,UmColName:m,UmColor:p="var(--smp-dashList-color-base)",ForceValue:y,ValueColName:x,ValueColor:_="var(--smp-dashList-color-base)",SelectLayout:w="1",onClick:S})=>{const E="N/A",b=(e==null?void 0:e.columns)||[],j=(e==null?void 0:e.rows)||[],M=j.length>0,I="--smp-dashList-color",O="smp-layout",T="descr",k="icon",$="um",P="value",V=i||"1em",A="18px",Y="--smp-dashList-columns",z="--smp-dashList-fontSize",J={dash:(G="1")=>{const Z=h(G),re=Z,ne=v(Z,T),fe=v(Z,k),ve=v(Z,$),me=v(Z,P);return{container:re,descr:ne,icon:fe,um:ve,value:me}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
50
+ ${ce(o)?"smp-dash-list-horizontal":""}`},{format:U}=je(),h=G=>`${O}-${G}`,v=(G,Z)=>`${G}__${Z}`,R=G=>`${I}-${G}`,L=G=>{const Z=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(Z.test(G)){const ne=G.match(Z)||[];if((ne==null?void 0:ne.length)>3)return"rgb("+ne[1]+","+ne[2]+","+ne[3]+")"}return G},C=G=>{if(!u)return G;const[Z,re]=N(u).map($e=>parseInt($e||"0")),ne="0,0"+(re?"."+"0".repeat(re):""),fe=U(G,ne,"it");if(!Z)return fe;const[ve,me]=fe.split(",");return ve+(me?`,${me}`:"")},N=G=>G.includes(";")?G.split(";"):[G],W=G=>{const Z=ne=>{var fe;if(ne)return(fe=G==null?void 0:G.cells[ne])==null?void 0:fe.obj.k},re=ne=>{var fe,ve;if(!(b.length<=ne))return(ve=(fe=G==null?void 0:G.cells[b[ne].name])==null?void 0:fe.obj)==null?void 0:ve.k};return{descr:t||Z(n)||re(2)||"",icon:l||Z(c)||re(3)||"",um:d||Z(m)||re(1)||"",value:y||Z(x)||re(0)||""}},H=G=>{S==null||S(G)},B=(G,Z)=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),G.stopPropagation(),H(Z))},K=(G=>{const Z=J.dash(G);return{className:Z,descr:re=>g.jsx("div",{className:Z.descr,children:re},`${G}-${T}`),icon:re=>g.jsx("div",{className:Z.icon,children:g.jsx(oe,{color:f,height:A,icon:re,width:A})},`${G}-${k}`),um:re=>g.jsx("div",{className:Z.um,children:re},`${G}-${$}`),value:re=>g.jsx("div",{className:Z.value,children:re},`${G}-${P}`)}})(w),se=G=>{const{descr:Z,icon:re,um:ne,value:fe}=W(G),ve={[R(T)]:L(s),[R($)]:L(p),[R(P)]:L(_)},me=[],$e=C(fe);switch(w){case"2":re&&me.push(K.icon(re)),me.push(K.descr(Z)),me.push(K.value(ne?$e+" "+ne:$e));break;default:case"1":me.push(K.descr(Z)),me.push(K.value(ne?$e+" "+ne:$e))}return g.jsx("div",{className:K.className.container,role:"button",style:ve,tabIndex:0,onClick:()=>H(G),onKeyDown:Vr=>B(Vr,G),children:me},G.rowId)},F={[Y]:String(r),[z]:V};return g.jsx("div",{className:J.dashList,style:F,children:M?j.map(G=>se(G)):E})},Qe={"smp-table":"_smp-table_1qmju_1","smp-headerCell":"_smp-headerCell_1qmju_35","smp-resizer":"_smp-resizer_1qmju_44"},ks="_rowContent_20wit_2",Ls="_clickable_20wit_21",Is="_indent_20wit_26",Ps="_toggle_20wit_32",As="_cell_20wit_38",Ns="_leftSection_20wit_46",Ee={rowContent:ks,clickable:Ls,indent:Is,toggle:Ps,cell:As,leftSection:Ns};function et(r){return!!r&&"children"in r}function Ms(r){return!et(r)}function Fs(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 Fr=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var w;const[a,i]=D.useState(!1),o=et(r)&&!!((w=r.children)!=null&&w.length),l=r.cells&&Object.keys(r.cells).length>0,c=o,f=t*20,u=()=>{o&&i(!a)},d={content:`${Ee.rowContent} ${o?Ee.clickable:""}`,toggle:`${Ee.toggle}`,indent:`${Ee.indent}`,cell:`${Ee.cell}`},m=S=>g.jsx(Oe,{...S}),p=()=>g.jsx("span",{className:d.toggle,children:c&&g.jsx(oe,{icon:a?"arrow_drop_right":"arrow_drop_down",width:16})}),y=()=>g.jsx("span",{className:d.indent,style:{width:`${f}px`},"aria-hidden":"true"}),x=()=>{const S=Ms(r)?"":r.decode||(l?"":"Untitled"),E=s??n*t;return g.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(${E}px)`},children:[et(r)&&g.jsxs("td",{className:Ee.leftSection,style:{height:`${n}px`},children:[y(),p(),g.jsx("span",{className:Ee.rowLabel,children:S})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([b,j])=>g.jsx("td",{className:d.cell,style:{width:e[b],minWidth:e[b],height:`${n}px`},children:m({...j,id:b})},Fs(j)||b))]})},_=()=>{var S;return a||!o?null:g.jsx(g.Fragment,{children:et(r)&&((S=r.children)==null?void 0:S.map((E,b)=>g.jsx(Fr,{row:E,level:t+1},`child-${b}`)))})};return g.jsxs(g.Fragment,{children:[x(),_()]})},Vs=({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 g.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:g.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[g.jsx(oe,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),g.jsx(_e,{variant:"title",bindValue:r})]})})};function Ys(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function Us(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 Ws(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 p=e[d].column,y=o(u,p);for(const[x,_]of y){const w=[...m,x],S=l(w,d),E=n.has(S);s.push(c(x,S,d,E)),a+=t,E&&i(_,d+1,w)}}function o(u,d){var p;const m=new Map;for(const y of u){const x=((p=y.cells[d])==null?void 0:p.decode)??"N/D";m.has(x)||m.set(x,[]),m.get(x).push(y)}return m}function l(u,d){return`group-${u.join("-")}-${d}`}function c(u,d,m,p){return{isGroup:!0,value:u,cells:{},rowId:d,level:m,isExpanded:p}}function f(u){for(const d of u)s.push(d),a+=t}}const Bs=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return g.jsxs("tr",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[g.jsx("td",{children:g.jsx(oe,{icon:"groups"})}),g.jsx("td",{children:g.jsx(kt,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})})]})},Hs=({columns:r,columnWidths:e})=>g.jsx("tfoot",{children:g.jsx("tr",{children:r.map(t=>t.visible&&g.jsx("td",{className:Qe["smp-headerCell"],style:{width:e[t.name],minWidth:e[t.name],maxWidth:e[t.name]}},t.name))})}),Gs=({columns:r,rows:e,containerRef:t,sizingMode:n})=>{const[s,a]=D.useState({});return D.useEffect(()=>{var i,o;if(!(!r||r.length===0)){if(n==="fixed"){const c=Object.fromEntries(r.map(f=>[f.name,120]));a(c)}else if(n==="fit-grid"){const l=((i=t.current)==null?void 0:i.offsetWidth)||800,c=r.filter(d=>d.visible!==!1),f=l/c.length,u=Object.fromEntries(c.map(d=>[d.name,f]));a(u)}else if(n==="fit-content"){const l={};for(const c of r){if(!c.visible)continue;const f=((o=c.title)==null?void 0:o.length)||0,u=Math.max(...e.map(d=>{var m,p,y,x;return`${((p=(m=d.cells)==null?void 0:m[c.name])==null?void 0:p.decode)||((x=(y=d.cells)==null?void 0:y[c.name])==null?void 0:x.value)||""}`.length}),f);l[c.name]=u*8+24}a(l)}}},[r,e,t,n]),[s,a]},Ks=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var M;const[i,o]=D.useState(r??{columns:[],rows:[]}),[l,c]=D.useState(n||[]),[f,u]=D.useState(new Set),d=D.useRef(null),[m,p]=Gs({columns:(i==null?void 0:i.columns)??[],rows:(i==null?void 0:i.rows)??[],containerRef:d,sizingMode:s});D.useEffect(()=>{if(l!=null&&l.length&&r.rows){const{flatRows:I}=Ws(r.rows,l,e,f);o({...r,rows:I})}else o(r)},[r,l,f,e]);const y=I=>{c(Us(I,l))},x=I=>{I.preventDefault();const O=I.dataTransfer.getData("text/plain");if(!O||l.some($=>$.column===O))return;const k=[...l,{column:O,visible:!0}];c(k)},_=I=>{I.preventDefault()},{virtualItems:w,containerProps:S,innerProps:E}=$r({items:(i==null?void 0:i.rows)??[],itemHeight:e,containerHeight:t,overscan:5}),b=(I,O)=>{const T=I.clientX,k=m[O],$=V=>{const A=V.clientX-T,Y=Math.max(50,k+A);p(z=>({...z,[O]:Y}))},P=()=>{window.removeEventListener("mousemove",$),window.removeEventListener("mouseup",P)};window.addEventListener("mousemove",$),window.addEventListener("mouseup",P)},j={smpTable:`${Qe["smp-table"]}`,headerCell:`${Qe["smp-headerCell"]}`,resizer:`${Qe["smp-resizer"]}`};return i&&g.jsx("div",{className:j.smpTable,...S,ref:d,children:g.jsxs("table",{children:[g.jsxs("thead",{children:[(n||a)&&g.jsx(Bs,{groups:l,onChange:y,onDrop:x,onDragOver:_}),g.jsx("tr",{children:i.columns&&((M=i.columns)==null?void 0:M.map(I=>I.visible&&g.jsxs("th",{className:j.headerCell,draggable:!0,onDragStart:O=>{O.dataTransfer.setData("text/plain",I.name)},style:{width:m[I.name],minWidth:m[I.name],maxWidth:m[I.name]},children:[g.jsx(_e,{variant:"title",bindValue:I.title}),g.jsx("div",{className:j.resizer,onMouseDown:O=>b(O,I.name),role:"region"})]},I.name)))})]}),g.jsx("tbody",{...E,children:w.map(({item:I,index:O,offsetTop:T})=>{const k=I.rowId||I.value||`${I.isGroup?"group":"row"}-${O}`;return I.isGroup?g.jsx(Vs,{label:I.value||"",rowHeight:e,offsetTop:T,level:I.level,onClick:()=>{const $=I.rowId;$&&u(P=>Ys(P,$))},isExpanded:I.isExpanded},`group-${k}`):g.jsx(Fr,{row:I,columnWidths:m,rowHeight:e,offsetTop:T,isGroup:!1},`row-${k}`)})}),g.jsx(Hs,{columns:i.columns,columnWidths:m})]})})},qs=({data:r,Type:e,ShowSubmit:t=!1,SubmitPosition:n="Right",DefaultValue:s,Label:a,LabelPosition:i="Left",onBlur:o,onClick:l,onOptionsRequest:c})=>{const[f,u]=D.useState();D.useEffect(()=>{u(()=>{if(!r)return;const y={...r};return e&&(y.shape=e),y.shape==null&&(y.shape=te.TEXT_FIELD),s&&(y.obj=Sn(s)),y})},[r,s,e]);const m={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},p=()=>{ce(t)||o==null||o(f)};if(f)return g.jsxs("div",{className:m.container,children:[g.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:g.jsx(Oe,{...f,id:"FLD",onChange:u,onOptionsRequest:c,fun:r==null?void 0:r.fun,onBlur:p,label:a,labelPosition:i})}),ce(t)&&g.jsx(Se,{optionalDisplayValue:"Confirm",onClick:()=>l==null?void 0:l(f),bindValue:"Confirm"})]})},zs=r=>(r==null?void 0:r.type)==="SmeupDataTree",Js=r=>(r==null?void 0:r.type)==="SmeupDataTable",Xs=r=>zs(r)?r.children?r.children.map(e=>({id:e.obj.k,label:e.value??""})):[]:Js(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}}):[],Zs=({data:r,id:e,readOnly:t=!1,hiddenSubmitButton:n=!1,updateOnClick:s=!1,decimalSeparator:a=".",optionsHandler:i,onSubmit:o,onCheck:l,onCheckObj:c,onContextMenu:f,onButtonClick:u})=>{var M,I;const[d,m]=D.useState({}),{translate:p}=je(),y=D.useId();D.useEffect(()=>{m(E(r))},[r]);const x=(O,T)=>{if(m(k=>({...k,[O]:{...k[O],obj:{...k[O].obj,k:T.obj.k},decode:T.decode,data:{...k[O].data,error:void 0},value:T.obj.k}})),s&&(T.shape==te.CHECKBOX||T.shape==te.SWITCH)){const k=structuredClone(d);k[O].obj.k=T.obj.k,k[O].value=T.obj.k,o({value:b(k),cell:O})}},_=O=>{const T=b(d);o({value:T,cell:O})},w=(O,T)=>{u==null||u({cellId:O,currentState:{type:"SmeupDataTable",columns:r.columns,rows:[{cells:d}]},fun:T||""})},S=async O=>{var T,k;if(d[O].obj.k!=r.rows[0].cells[O].obj.k&&((T=d[O].inputSettings)!=null&&T.checkObject&&c&&((await c({obj:d[O].obj,fun:d[O].fun,cellId:O})).valid||m(P=>({...P,[O]:{...P[O],data:{...P[O].data,error:p(Te.CHECK_OBJECT_WRONG_VALIDATION)}}}))),(k=d[O].inputSettings)!=null&&k.checkValueOnExit)){const $=b(d);l==null||l({value:$,cell:O})}},E=O=>{var k,$,P;if(!((k=O.rows)!=null&&k.length)||!(($=O.columns)!=null&&$.length))return{};const T=(P=O.rows)==null?void 0:P[0];return O.columns.filter(V=>V.visible??!0).reduce((V,A)=>{const Y={...T.cells[A.name],id:A.name,label:A.title,dSep:a,data:{...T.cells[A.name].data,dSep:a}};return Y.isEditable==null&&(Y.isEditable=!0),t&&(Y.isEditable=!1),Y.isEditable&&Y.shape==null&&(Y.shape=te.TEXT_FIELD),{...V,[A.name]:Y}},{})},b=O=>({before:r,after:{type:"SmeupDataTable",columns:JSON.parse(JSON.stringify(r.columns)),rows:[{cells:JSON.parse(JSON.stringify(O))}]}}),j=((I=(M=r.setup)==null?void 0:M.commands)==null?void 0:I.map((O,T)=>D.createElement(Oe,{...O,decode:O.value,data:{label:O.value},id:`command-${T}`,key:`command-${T}`,shape:te.BUTTON,onClick:()=>_(O.obj.k)})))||[];return n||j.unshift(g.jsx(Oe,{decode:p(Te.CONFIRM_BUTTON),shape:te.BUTTON,id:"",obj:{t:"",p:"",k:""},data:{submit:!0,label:p(Te.CONFIRM_BUTTON)}},"submit-command")),d&&g.jsxs("form",{"data-component":"input-panel",id:e||y,onSubmit:O=>{O.preventDefault(),_()},children:[g.jsx("div",{style:{padding:"1em 0"},children:g.jsx(rt,{layout:r.rows[0].layout,children:Object.values(d).map(O=>g.jsx(Oe,{...O,onOptionsRequest:O.fun?async(T,k)=>Xs(await i(T,k,r,O.id)):void 0,onChange:T=>x(O.id,T),onBlur:()=>S(O.id),onContextMenu:f,onClick:()=>{O.shape=="BTN"&&w(O.id,O.fun)},data:{...O.data,autocomplete:"off"}}))})}),j.length>0&&g.jsx(rt,{layout:{sections:[{id:"1",horizontal:!0,justify:"start",content:j.map(O=>({id:O.props.id}))}]},children:j})]})};exports.AppBar=Ds;exports.Autocomplete=Ct;exports.Button=Se;exports.ButtonList=Ir;exports.Checkbox=Pr;exports.Combobox=Ar;exports.DashList=Cs;exports.DataTableComponent=Ks;exports.DatePicker=Nr;exports.Drawer=$s;exports.Field=qs;exports.Icon=oe;exports.InputPanel=Zs;exports.Password=Mr;exports.TabBar=Dr;exports.Textfield=we;exports.configurePaths=yn;