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