@memori.ai/memori-webcomponent 5.0.0 → 5.0.2
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/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/dist/memori-webcomponent.js +1 -1
- package/package.json +2 -2
|
@@ -243,4 +243,4 @@ const Am="144",Em={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Mm={ROTATE:0,
|
|
|
243
243
|
* @license qrcode.react
|
|
244
244
|
* Copyright (c) Paul O'Shannessy
|
|
245
245
|
* SPDX-License-Identifier: ISC
|
|
246
|
-
*/function rL(e,t=0){const n=[];return e.forEach((function(e,r){let i=null;e.forEach((function(o,s){if(!o&&null!==i)return n.push(`M${i+t} ${r+t}h${s-i}v1H${i+t}z`),void(i=null);if(s!==e.length-1)o&&null===i&&(i=s);else{if(!o)return;null===i?n.push(`M${s+t},${r+t} h1v1H${s+t}z`):n.push(`M${i+t},${r+t} h${s+1-i}v1H${i+t}z`)}}))})),n.join("")}function iL(e,t){return e.slice().map(((e,n)=>n<t.y||n>=t.y+t.h?e:e.map(((e,n)=>(n<t.x||n>=t.x+t.w)&&e))))}function oL(e,t,n,r){if(null==r)return null;const i=n?4:0,o=e.length+2*i,s=Math.floor(.1*t),a=o/t,l=(r.width||s)*a,c=(r.height||s)*a,u=null==r.x?e.length/2-l/2:r.x*a,d=null==r.y?e.length/2-c/2:r.y*a;let p=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);p={x:e,y:t,w:Math.ceil(l+u-e),h:Math.ceil(c+d-t)}}return{x:u,y:d,h:c,w:l,excavation:p}}var sL=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function aL(e){const n=e,{value:r,size:i=$N,level:o=ZN,bgColor:s=eL,fgColor:a=tL,includeMargin:l=nL,style:u,imageSettings:d}=n,p=QN(n,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=null==d?void 0:d.src,f=(0,c.useRef)(null),m=(0,c.useRef)(null),[g,v]=(0,c.useState)(!1);(0,c.useEffect)((()=>{if(null!=f.current){const e=f.current,t=e.getContext("2d");if(!t)return;let n=YN.QrCode.encodeText(r,XN[o]).getModules();const c=l?4:0,u=n.length+2*c,p=oL(n,i,l,d),h=m.current,g=null!=p&&null!==h&&h.complete&&0!==h.naturalHeight&&0!==h.naturalWidth;g&&null!=p.excavation&&(n=iL(n,p.excavation));const v=window.devicePixelRatio||1;e.height=e.width=i*v;const y=i/u*v;t.scale(y,y),t.fillStyle=s,t.fillRect(0,0,u,u),t.fillStyle=a,sL?t.fill(new Path2D(rL(n,c))):n.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+c,n+c,1,1)}))})),g&&t.drawImage(h,p.x+c,p.y+c,p.w,p.h)}})),(0,c.useEffect)((()=>{v(!1)}),[h]);const y=JN({height:i,width:i},u);let b=null;return null!=h&&(b=t(c).createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),t(c).createElement(t(c).Fragment,null,t(c).createElement("canvas",JN({style:y,height:i,width:i,ref:f},p)),b)}var lL=({tenant:e,url:n,title:r="",className:i,baseUrl:o,primary:a=!0,showQrCode:l=!0,align:u="right"})=>{const{t:d}=ve(),[p,h]=(0,c.useState)(n),f=(0,c.useMemo)((()=>(null==e?void 0:e.theme)?`${null!=o?o:"https://aisuru.com"}/images/${e.theme}/square_logo.png`:`${null!=o?o:"https://aisuru.com"}/images/memori_logo.png`),[e,o]);(0,c.useEffect)((()=>{n||h(window.location.href)}),[n]);const m=[{id:"facebook",title:"Facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${p}`,icon:NN},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${p}`,icon:LN},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${r}&url=${p}`,icon:DN},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${p}`,icon:BN},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${r}&url=${p}`,icon:HN},{id:"email",title:"Email",url:`mailto:?subject=${(null==r?void 0:r.length)>0?r:n}&body=${p}`,icon:zN}];return(0,s.jsxs)(qd,{as:"div",className:t(ys)("memori-share-button",{"memori-share-button--align-left":"left"===u}),children:[(0,s.jsx)(qd.Button,{className:t(ys)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button",i,{"memori-button--primary":a}),title:d("widget.share")||void 0,children:(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(FN,{})})}),(0,s.jsxs)(qd.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,s.jsx)(qd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsx)(La,{className:"memori-share-button--link",ghost:!0,icon:(0,s.jsx)(np,{}),onClick:()=>{p&&navigator.clipboard.writeText(p)},children:d("copyToClipboard")||void 0})},"copy"),m.map((e=>{var n;return(0,s.jsx)(qd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsxs)("a",{className:t(ys)("memori-button","memori-button--with-icon","memori-button--ghost","memori-button--padded","memori-share-button--link"),href:null!==(n=e.url)&&void 0!==n?n:"",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(e.icon,{})}),e.title]})},e.id)})),l&&(0,s.jsxs)(qd.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,s.jsx)(aL,{id:"qr-canvas",value:null!=p?p:"",size:128,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:f,x:void 0,y:void 0,height:32,width:32,excavate:!0}}),(0,s.jsx)("div",{children:(0,s.jsx)(La,{onClick:()=>{const e=document.getElementById("qr-canvas");if(!e)return;const t=document.createElement("a");t.href=e.toDataURL(),t.download=`memori-${r}-share.png`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},icon:(0,s.jsx)(UN,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};var cL=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M290 236.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0 0 13.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 0 0 0 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 0 0-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"})});var uL=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",focusable:"false",role:"img",className:e,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","aria-label":t,children:[(0,s.jsx)("path",{d:"M23 4L23 10 17 10"}),(0,s.jsx)("path",{d:"M1 20L1 14 7 14"}),(0,s.jsx)("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})]});var dL=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6c-.3 1.5-.4 3-.4 4.4 0 14.4 11.6 26 26 26h723c1.5 0 3-.1 4.4-.4 14.2-2.4 23.7-15.9 21.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"})});var pL=({className:e,memori:n,tenant:r,history:i,position:o,setShowPositionDrawer:a,setShowSettingsDrawer:l,setShowKnownFactsDrawer:u,setShowExpertsDrawer:d,speakerMuted:p,setSpeakerMuted:h,hasUserActivatedSpeak:f=!1,showShare:m=!0,showSettings:g=!0,showSpeaker:v=!0,showReload:y=!1,showClear:b=!1,clearHistory:S,loginToken:x,user:w,sessionID:C})=>{const{t:A}=ve(),[E,M]=(0,c.useState)(!1),[_,T]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{document.fullscreenEnabled&&M(!0)}),[]),(0,s.jsxs)("div",{className:t(ys)("memori-header",e),children:[y&&(0,s.jsx)(La,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--reload",title:A("reload")||"Reload",icon:(0,s.jsx)(uL,{}),onClick:()=>{window.location.reload()}}),b&&(0,s.jsx)(La,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--clear",title:A("clearHistory")||"Clear chat",icon:(0,s.jsx)(dL,{}),onClick:S}),n.needsPosition&&o&&(0,s.jsxs)("div",{className:"memori-header--position",children:[(0,s.jsx)("span",{className:"memori-header--position-placeName",children:o.placeName}),(0,s.jsx)(La,{icon:(0,s.jsx)(lN,{}),shape:"circle",className:"memori-header--button memori-header--button--position",onClick:()=>a(!0)})]}),E&&(0,s.jsx)(La,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--fullscreen",title:_?A("fullscreenExit")||"Exit fullscreen":A("fullscreenEnter")||"Enter fullscreen",icon:_?(0,s.jsx)(tm,{}):(0,s.jsx)(cL,{}),onClick:()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),T(!1)):(document.documentElement.requestFullscreen(),T(!0))}}),n.enableDeepThought&&!!x&&(null==w?void 0:w.pAndCUAccepted)&&(0,s.jsx)(La,{primary:!!C&&!!f,shape:"circle",icon:(0,s.jsx)(mm,{}),className:"memori-header--button memori-header--button--knownfacts",disabled:!f||!C,onClick:()=>u(!0),title:A("knownFacts.title")||"Known facts"}),n.enableBoardOfExperts&&(0,s.jsx)(La,{primary:!0,shape:"circle",icon:(0,s.jsx)(fm,{}),className:"memori-header--button memori-header--button--experts",disabled:!f||!C,onClick:()=>d(!0),title:A("widget.showExpertsInTheBoard")||"Experts in this board"}),v&&(0,s.jsx)(La,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--speaker",icon:p?(0,s.jsx)(cN,{}):(0,s.jsx)(dN,{}),onClick:()=>h(!p),title:A("widget.sound")||"Sound"}),(0,s.jsx)(kN,{history:i,memori:n,className:"memori-header--button memori-header--button--export",disabled:!f||0===i.length}),g&&(0,s.jsx)(La,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-settings",icon:(0,s.jsx)(ON,{}),onClick:()=>l(!0),title:A("widget.settings")||"Settings"}),m&&(0,s.jsx)(lL,{className:"memori-header--button memori-header--button-share",title:n.name,tenant:r,showQrCode:!0,align:"left"})]})};var hL=({tenant:e,userLang:t="en"})=>{const n="memorytwin"===(null==e?void 0:e.theme)?"memorytwin":"twincreator"===(null==e?void 0:e.theme)?"twincreator":"aisuru";return(0,s.jsxs)("div",{className:"memori--powered-by",children:[(0,s.jsx)("img",{src:`https://aisuru.com/images/${n}/logo.png`,alt:""}),(0,s.jsxs)("p",{children:["Powered by"," ",(0,s.jsx)("a",{href:`https://${"twincreator"===(null==e?void 0:e.theme)?"app.twincreator.com":"memorytwin"===(null==e?void 0:e.theme)?"app.memorytwin.com":"aisuru.com"}/${t?t.toLowerCase():""}`,target:"_blank",rel:"noopener noreferrer",children:"memorytwin"===n?"MemoryTwin":"twincreator"===n?"TwinCreator":"AIsuru"})]})]})},fL={};function mL(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(i=r.key,o=void 0,"symbol"==typeof(o=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"))?o:String(o)),r)}var i,o}function gL(e,t,n){return t&&mL(e.prototype,t),n&&mL(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function vL(){return vL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vL.apply(this,arguments)}function yL(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,SL(e,t)}function bL(e){return bL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bL(e)}function SL(e,t){return SL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},SL(e,t)}function xL(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function wL(e,t,n){return wL=xL()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&SL(i,n.prototype),i},wL.apply(null,arguments)}function CL(e){var t="function"==typeof Map?new Map:void 0;return CL=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return wL(e,arguments,bL(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),SL(r,e)},CL(e)}function AL(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function EL(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ML(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return EL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?EL(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}Object.defineProperty(fL,"__esModule",{value:!0});var _L=function(e){function t(){return e.apply(this,arguments)||this}return yL(t,e),t}(CL(Error)),TL=function(e){function t(t){return e.call(this,"Invalid DateTime: "+t.toMessage())||this}return yL(t,e),t}(_L),IL=function(e){function t(t){return e.call(this,"Invalid Interval: "+t.toMessage())||this}return yL(t,e),t}(_L),RL=function(e){function t(t){return e.call(this,"Invalid Duration: "+t.toMessage())||this}return yL(t,e),t}(_L),PL=function(e){function t(){return e.apply(this,arguments)||this}return yL(t,e),t}(_L),kL=function(e){function t(t){return e.call(this,"Invalid unit "+t)||this}return yL(t,e),t}(_L),OL=function(e){function t(){return e.apply(this,arguments)||this}return yL(t,e),t}(_L),NL=function(e){function t(){return e.call(this,"Zone is an abstract class")||this}return yL(t,e),t}(_L),LL="numeric",DL="short",BL="long",zL={year:LL,month:LL,day:LL},FL={year:LL,month:DL,day:LL},UL={year:LL,month:DL,day:LL,weekday:DL},jL={year:LL,month:BL,day:LL},HL={year:LL,month:BL,day:LL,weekday:BL},VL={hour:LL,minute:LL},GL={hour:LL,minute:LL,second:LL},WL={hour:LL,minute:LL,second:LL,timeZoneName:DL},qL={hour:LL,minute:LL,second:LL,timeZoneName:BL},KL={hour:LL,minute:LL,hourCycle:"h23"},JL={hour:LL,minute:LL,second:LL,hourCycle:"h23"},QL={hour:LL,minute:LL,second:LL,hourCycle:"h23",timeZoneName:DL},YL={hour:LL,minute:LL,second:LL,hourCycle:"h23",timeZoneName:BL},XL={year:LL,month:LL,day:LL,hour:LL,minute:LL},$L={year:LL,month:LL,day:LL,hour:LL,minute:LL,second:LL},ZL={year:LL,month:DL,day:LL,hour:LL,minute:LL},eD={year:LL,month:DL,day:LL,hour:LL,minute:LL,second:LL},tD={year:LL,month:DL,day:LL,weekday:DL,hour:LL,minute:LL},nD={year:LL,month:BL,day:LL,hour:LL,minute:LL,timeZoneName:DL},rD={year:LL,month:BL,day:LL,hour:LL,minute:LL,second:LL,timeZoneName:DL},iD={year:LL,month:BL,day:LL,weekday:BL,hour:LL,minute:LL,timeZoneName:BL},oD={year:LL,month:BL,day:LL,weekday:BL,hour:LL,minute:LL,second:LL,timeZoneName:BL},sD=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new NL},t.formatOffset=function(e,t){throw new NL},t.offset=function(e){throw new NL},t.equals=function(e){throw new NL},gL(e,[{key:"type",get:function(){throw new NL}},{key:"name",get:function(){throw new NL}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new NL}},{key:"isValid",get:function(){throw new NL}}]),e}(),aD=null,lD=function(e){function t(){return e.apply(this,arguments)||this}yL(t,e);var n=t.prototype;return n.offsetName=function(e,t){return CB(e,t.format,t.locale)},n.formatOffset=function(e,t){return _B(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return"system"===e.type},gL(t,[{key:"type",get:function(){return"system"}},{key:"name",get:function(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!0}}],[{key:"instance",get:function(){return null===aD&&(aD=new t),aD}}]),t}(sD),cD={};var uD={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};var dD={},pD=function(e){function t(n){var r;return(r=e.call(this)||this).zoneName=n,r.valid=t.isValidZone(n),r}yL(t,e),t.create=function(e){return dD[e]||(dD[e]=new t(e)),dD[e]},t.resetCache=function(){dD={},cD={}},t.isValidSpecifier=function(e){return this.isValidZone(e)},t.isValidZone=function(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}};var n=t.prototype;return n.offsetName=function(e,t){return CB(e,t.format,t.locale,this.name)},n.formatOffset=function(e,t){return _B(this.offset(e),t)},n.offset=function(e){var t=new Date(e);if(isNaN(t))return NaN;var n,r=(n=this.name,cD[n]||(cD[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),cD[n]),i=r.formatToParts?function(e,t){for(var n=e.formatToParts(t),r=[],i=0;i<n.length;i++){var o=n[i],s=o.type,a=o.value,l=uD[s];"era"===s?r[l]=a:nB(l)||(r[l]=parseInt(a,10))}return r}(r,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),i=r[1],o=r[2];return[r[3],i,o,r[4],r[5],r[6],r[7]]}(r,t),o=i[0],s=i[1],a=i[2],l=i[3],c=i[4],u=i[5],d=i[6];"BC"===l&&(o=1-Math.abs(o));var p=+t,h=p%1e3;return(bB({year:o,month:s,day:a,hour:24===c?0:c,minute:u,second:d,millisecond:0})-(p-=h>=0?h:1e3+h))/6e4},n.equals=function(e){return"iana"===e.type&&e.name===this.name},gL(t,[{key:"type",get:function(){return"iana"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return this.valid}}]),t}(sD),hD=["base"],fD=["padTo","floor"],mD={};var gD={};function vD(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=gD[n];return r||(r=new Intl.DateTimeFormat(e,t),gD[n]=r),r}var yD={};var bD={};var SD=null;var xD={};function wD(e,t,n,r){var i=e.listingMode();return"error"===i?null:"en"===i?n(t):r(t)}var CD=function(){function e(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1,n.padTo,n.floor;var r=AL(n,fD);if(!t||Object.keys(r).length>0){var i=vL({useGrouping:!1},n);n.padTo>0&&(i.minimumIntegerDigits=n.padTo),this.inf=function(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=yD[n];return r||(r=new Intl.NumberFormat(e,t),yD[n]=r),r}(e,i)}}return e.prototype.format=function(e){if(this.inf){var t=this.floor?Math.floor(e):e;return this.inf.format(t)}return dB(this.floor?Math.floor(e):mB(e,3),this.padTo)},e}(),AD=function(){function e(e,t,n){this.opts=n,this.originalZone=void 0;var r=void 0;if(this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){var i=e.offset/60*-1,o=i>=0?"Etc/GMT+"+i:"Etc/GMT"+i;0!==e.offset&&pD.create(o).valid?(r=o,this.dt=e):(r="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);var s=vL({},this.opts);s.timeZone=s.timeZone||r,this.dtf=vD(t,s)}var t=e.prototype;return t.format=function(){return this.originalZone?this.formatToParts().map((function(e){return e.value})).join(""):this.dtf.format(this.dt.toJSDate())},t.formatToParts=function(){var e=this,t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map((function(t){return"timeZoneName"===t.type?vL({},t,{value:e.originalZone.offsetName(e.dt.ts,{locale:e.dt.locale,format:e.opts.timeZoneName})}):t})):t},t.resolvedOptions=function(){return this.dtf.resolvedOptions()},e}(),ED=function(){function e(e,t,n){this.opts=vL({style:"long"},n),!t&&oB()&&(this.rtf=function(e,t){void 0===t&&(t={});var n=t;n.base;var r=AL(n,hD),i=JSON.stringify([e,r]),o=bD[i];return o||(o=new Intl.RelativeTimeFormat(e,t),bD[i]=o),o}(e,n))}var t=e.prototype;return t.format=function(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n,r){void 0===n&&(n="always");void 0===r&&(r=!1);var i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&o){var s="days"===e;switch(t){case 1:return s?"tomorrow":"next "+i[e][0];case-1:return s?"yesterday":"last "+i[e][0];case 0:return s?"today":"this "+i[e][0]}}var a=Object.is(t,-0)||t<0,l=Math.abs(t),c=1===l,u=i[e],d=r?c?u[1]:u[2]||u[1]:c?i[e][0]:e;return a?l+" "+d+" ago":"in "+l+" "+d}(t,e,this.opts.numeric,"long"!==this.opts.style)},t.formatToParts=function(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]},e}(),MD={firstDay:1,minimalDays:4,weekend:[6,7]},_D=function(){function e(e,t,n,r,i){var o=function(e){var t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));var n,r,i=e.indexOf("-u-");if(-1===i)return[e];try{n=vD(e).resolvedOptions(),r=e}catch(t){var o=e.substring(0,i);n=vD(o).resolvedOptions(),r=o}var s=n;return[r,s.numberingSystem,s.calendar]}(e),s=o[0],a=o[1],l=o[2];this.locale=s,this.numberingSystem=t||a||null,this.outputCalendar=n||l||null,this.weekSettings=r,this.intl=function(e,t,n){return n||t?(e.includes("-u-")||(e+="-u"),n&&(e+="-ca-"+n),t&&(e+="-nu-"+t),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}e.fromOpts=function(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)},e.create=function(t,n,r,i,o){void 0===o&&(o=!1);var s=t||UD.defaultLocale;return new e(s||(o?"en-US":SD||(SD=(new Intl.DateTimeFormat).resolvedOptions().locale)),n||UD.defaultNumberingSystem,r||UD.defaultOutputCalendar,cB(i)||UD.defaultWeekSettings,s)},e.resetCache=function(){SD=null,gD={},yD={},bD={}},e.fromObject=function(t){var n=void 0===t?{}:t,r=n.locale,i=n.numberingSystem,o=n.outputCalendar,s=n.weekSettings;return e.create(r,i,o,s)};var t=e.prototype;return t.listingMode=function(){var e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"},t.clone=function(t){return t&&0!==Object.getOwnPropertyNames(t).length?e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,cB(t.weekSettings)||this.weekSettings,t.defaultToEN||!1):this},t.redefaultToEN=function(e){return void 0===e&&(e={}),this.clone(vL({},e,{defaultToEN:!0}))},t.redefaultToSystem=function(e){return void 0===e&&(e={}),this.clone(vL({},e,{defaultToEN:!1}))},t.months=function(e,t){var n=this;return void 0===t&&(t=!1),wD(this,e,kB,(function(){var r=t?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";return n.monthsCache[i][e]||(n.monthsCache[i][e]=function(e){for(var t=[],n=1;n<=12;n++){var r=DF.utc(2009,n,1);t.push(e(r))}return t}((function(e){return n.extract(e,r,"month")}))),n.monthsCache[i][e]}))},t.weekdays=function(e,t){var n=this;return void 0===t&&(t=!1),wD(this,e,DB,(function(){var r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=t?"format":"standalone";return n.weekdaysCache[i][e]||(n.weekdaysCache[i][e]=function(e){for(var t=[],n=1;n<=7;n++){var r=DF.utc(2016,11,13+n);t.push(e(r))}return t}((function(e){return n.extract(e,r,"weekday")}))),n.weekdaysCache[i][e]}))},t.meridiems=function(){var e=this;return wD(this,void 0,(function(){return BB}),(function(){if(!e.meridiemCache){var t={hour:"numeric",hourCycle:"h12"};e.meridiemCache=[DF.utc(2016,11,13,9),DF.utc(2016,11,13,19)].map((function(n){return e.extract(n,t,"dayperiod")}))}return e.meridiemCache}))},t.eras=function(e){var t=this;return wD(this,e,jB,(function(){var n={era:e};return t.eraCache[e]||(t.eraCache[e]=[DF.utc(-40,1,1),DF.utc(2017,1,1)].map((function(e){return t.extract(e,n,"era")}))),t.eraCache[e]}))},t.extract=function(e,t,n){var r=this.dtFormatter(e,t).formatToParts().find((function(e){return e.type.toLowerCase()===n}));return r?r.value:null},t.numberFormatter=function(e){return void 0===e&&(e={}),new CD(this.intl,e.forceSimple||this.fastNumbers,e)},t.dtFormatter=function(e,t){return void 0===t&&(t={}),new AD(e,this.intl,t)},t.relFormatter=function(e){return void 0===e&&(e={}),new ED(this.intl,this.isEnglish(),e)},t.listFormatter=function(e){return void 0===e&&(e={}),function(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=mD[n];return r||(r=new Intl.ListFormat(e,t),mD[n]=r),r}(this.intl,e)},t.isEnglish=function(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")},t.getWeekSettings=function(){return this.weekSettings?this.weekSettings:sB()?function(e){var t=xD[e];if(!t){var n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,xD[e]=t}return t}(this.locale):MD},t.getStartOfWeek=function(){return this.getWeekSettings().firstDay},t.getMinDaysInFirstWeek=function(){return this.getWeekSettings().minimalDays},t.getWeekendDays=function(){return this.getWeekSettings().weekend},t.equals=function(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar},gL(e,[{key:"fastNumbers",get:function(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}}]),e}(),TD=null,ID=function(e){function t(t){var n;return(n=e.call(this)||this).fixed=t,n}yL(t,e),t.instance=function(e){return 0===e?t.utcInstance:new t(e)},t.parseSpecifier=function(e){if(e){var n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new t(AB(n[1],n[2]))}return null};var n=t.prototype;return n.offsetName=function(){return this.name},n.formatOffset=function(e,t){return _B(this.fixed,t)},n.offset=function(){return this.fixed},n.equals=function(e){return"fixed"===e.type&&e.fixed===this.fixed},gL(t,[{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC"+_B(this.fixed,"narrow")}},{key:"ianaName",get:function(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+_B(-this.fixed,"narrow")}},{key:"isUniversal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}],[{key:"utcInstance",get:function(){return null===TD&&(TD=new t(0)),TD}}]),t}(sD),RD=function(e){function t(t){var n;return(n=e.call(this)||this).zoneName=t,n}yL(t,e);var n=t.prototype;return n.offsetName=function(){return null},n.formatOffset=function(){return""},n.offset=function(){return NaN},n.equals=function(){return!1},gL(t,[{key:"type",get:function(){return"invalid"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!1}}]),t}(sD);function PD(e,t){if(nB(e)||null===e)return t;if(e instanceof sD)return e;if(function(e){return"string"==typeof e}(e)){var n=e.toLowerCase();return"default"===n?t:"local"===n||"system"===n?lD.instance:"utc"===n||"gmt"===n?ID.utcInstance:ID.parseSpecifier(n)||pD.create(e)}return rB(e)?ID.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new RD(e)}var kD,OD=function(){return Date.now()},ND="system",LD=null,DD=null,BD=null,zD=60,FD=null,UD=function(){function e(){}return e.resetCaches=function(){_D.resetCache(),pD.resetCache()},gL(e,null,[{key:"now",get:function(){return OD},set:function(e){OD=e}},{key:"defaultZone",get:function(){return PD(ND,lD.instance)},set:function(e){ND=e}},{key:"defaultLocale",get:function(){return LD},set:function(e){LD=e}},{key:"defaultNumberingSystem",get:function(){return DD},set:function(e){DD=e}},{key:"defaultOutputCalendar",get:function(){return BD},set:function(e){BD=e}},{key:"defaultWeekSettings",get:function(){return FD},set:function(e){FD=cB(e)}},{key:"twoDigitCutoffYear",get:function(){return zD},set:function(e){zD=e%100}},{key:"throwOnInvalid",get:function(){return kD},set:function(e){kD=e}}]),e}(),jD=function(){function e(e,t){this.reason=e,this.explanation=t}return e.prototype.toMessage=function(){return this.explanation?this.reason+": "+this.explanation:this.reason},e}(),HD=[0,31,59,90,120,151,181,212,243,273,304,334],VD=[0,31,60,91,121,152,182,213,244,274,305,335];function GD(e,t){return new jD("unit out of range","you specified "+t+" (of type "+typeof t+") as a "+e+", which is invalid")}function WD(e,t,n){var r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);var i=r.getUTCDay();return 0===i?7:i}function qD(e,t,n){return n+(gB(e)?VD:HD)[t-1]}function KD(e,t){var n=gB(e)?VD:HD,r=n.findIndex((function(e){return e<t}));return{month:r+1,day:t-n[r]}}function JD(e,t){return(e-t+7)%7+1}function QD(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r,i=e.year,o=e.month,s=e.day,a=qD(i,o,s),l=JD(WD(i,o,s),n),c=Math.floor((a-l+14-t)/7);return c<1?c=xB(r=i-1,t,n):c>xB(i,t,n)?(r=i+1,c=1):r=i,vL({weekYear:r,weekNumber:c,weekday:l},TB(e))}function YD(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r,i=e.weekYear,o=e.weekNumber,s=e.weekday,a=JD(WD(i,1,t),n),l=vB(i),c=7*o+s-a-7+t;c<1?c+=vB(r=i-1):c>l?(r=i+1,c-=vB(i)):r=i;var u=KD(r,c);return vL({year:r,month:u.month,day:u.day},TB(e))}function XD(e){var t=e.year;return vL({year:t,ordinal:qD(t,e.month,e.day)},TB(e))}function $D(e){var t=e.year,n=KD(t,e.ordinal);return vL({year:t,month:n.month,day:n.day},TB(e))}function ZD(e,t){if(!nB(e.localWeekday)||!nB(e.localWeekNumber)||!nB(e.localWeekYear)){if(!nB(e.weekday)||!nB(e.weekNumber)||!nB(e.weekYear))throw new PL("Cannot mix locale-based week fields with ISO-based week fields");return nB(e.localWeekday)||(e.weekday=e.localWeekday),nB(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),nB(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function eB(e){var t=iB(e.year),n=uB(e.month,1,12),r=uB(e.day,1,yB(e.year,e.month));return t?n?!r&&GD("day",e.day):GD("month",e.month):GD("year",e.year)}function tB(e){var t=e.hour,n=e.minute,r=e.second,i=e.millisecond,o=uB(t,0,23)||24===t&&0===n&&0===r&&0===i,s=uB(n,0,59),a=uB(r,0,59),l=uB(i,0,999);return o?s?a?!l&&GD("millisecond",i):GD("second",r):GD("minute",n):GD("hour",t)}function nB(e){return void 0===e}function rB(e){return"number"==typeof e}function iB(e){return"number"==typeof e&&e%1==0}function oB(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function sB(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function aB(e,t,n){if(0!==e.length)return e.reduce((function(e,r){var i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i}),null)[1]}function lB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function cB(e){if(null==e)return null;if("object"!=typeof e)throw new OL("Week settings must be an object");if(!uB(e.firstDay,1,7)||!uB(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some((function(e){return!uB(e,1,7)})))throw new OL("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function uB(e,t,n){return iB(e)&&e>=t&&e<=n}function dB(e,t){return void 0===t&&(t=2),e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0")}function pB(e){return nB(e)||null===e||""===e?void 0:parseInt(e,10)}function hB(e){return nB(e)||null===e||""===e?void 0:parseFloat(e)}function fB(e){if(!nB(e)&&null!==e&&""!==e){var t=1e3*parseFloat("0."+e);return Math.floor(t)}}function mB(e,t,n){void 0===n&&(n=!1);var r=Math.pow(10,t);return(n?Math.trunc:Math.round)(e*r)/r}function gB(e){return e%4==0&&(e%100!=0||e%400==0)}function vB(e){return gB(e)?366:365}function yB(e,t){var n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?gB(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function bB(e){var t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t)).setUTCFullYear(e.year,e.month-1,e.day),+t}function SB(e,t,n){return-JD(WD(e,1,t),n)+t-1}function xB(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r=SB(e,t,n),i=SB(e+1,t,n);return(vB(e)-r+i)/7}function wB(e){return e>99?e:e>UD.twoDigitCutoffYear?1900+e:2e3+e}function CB(e,t,n,r){void 0===r&&(r=null);var i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);var s=vL({timeZoneName:t},o),a=new Intl.DateTimeFormat(n,s).formatToParts(i).find((function(e){return"timezonename"===e.type.toLowerCase()}));return a?a.value:null}function AB(e,t){var n=parseInt(e,10);Number.isNaN(n)&&(n=0);var r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function EB(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new OL("Invalid unit value "+e);return t}function MB(e,t){var n={};for(var r in e)if(lB(e,r)){var i=e[r];if(null==i)continue;n[t(r)]=EB(i)}return n}function _B(e,t){var n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return""+i+dB(n,2)+":"+dB(r,2);case"narrow":return""+i+n+(r>0?":"+r:"");case"techie":return""+i+dB(n,2)+dB(r,2);default:throw new RangeError("Value format "+t+" is out of range for property format")}}function TB(e){return function(e,t){return t.reduce((function(t,n){return t[n]=e[n],t}),{})}(e,["hour","minute","second","millisecond"])}var IB=["January","February","March","April","May","June","July","August","September","October","November","December"],RB=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],PB=["J","F","M","A","M","J","J","A","S","O","N","D"];function kB(e){switch(e){case"narrow":return[].concat(PB);case"short":return[].concat(RB);case"long":return[].concat(IB);case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var OB=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],NB=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],LB=["M","T","W","T","F","S","S"];function DB(e){switch(e){case"narrow":return[].concat(LB);case"short":return[].concat(NB);case"long":return[].concat(OB);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var BB=["AM","PM"],zB=["Before Christ","Anno Domini"],FB=["BC","AD"],UB=["B","A"];function jB(e){switch(e){case"narrow":return[].concat(UB);case"short":return[].concat(FB);case"long":return[].concat(zB);default:return null}}function HB(e,t){for(var n,r="",i=ML(e);!(n=i()).done;){var o=n.value;o.literal?r+=o.val:r+=t(o.val)}return r}var VB={D:zL,DD:FL,DDD:jL,DDDD:HL,t:VL,tt:GL,ttt:WL,tttt:qL,T:KL,TT:JL,TTT:QL,TTTT:YL,f:XL,ff:ZL,fff:nD,ffff:iD,F:$L,FF:eD,FFF:rD,FFFF:oD},GB=function(){function e(e,t){this.opts=t,this.loc=e,this.systemLoc=null}e.create=function(t,n){return void 0===n&&(n={}),new e(t,n)},e.parseFormat=function(e){for(var t=null,n="",r=!1,i=[],o=0;o<e.length;o++){var s=e.charAt(o);"'"===s?(n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),t=null,n="",r=!r):r||s===t?n+=s:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=s,t=s)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i},e.macroTokenToFormatOpts=function(e){return VB[e]};var t=e.prototype;return t.formatWithSystemDefault=function(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,vL({},this.opts,t)).format()},t.dtFormatter=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,vL({},this.opts,t))},t.formatDateTime=function(e,t){return this.dtFormatter(e,t).format()},t.formatDateTimeParts=function(e,t){return this.dtFormatter(e,t).formatToParts()},t.formatInterval=function(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())},t.resolvedOptions=function(e,t){return this.dtFormatter(e,t).resolvedOptions()},t.num=function(e,t){if(void 0===t&&(t=0),this.opts.forceSimple)return dB(e,t);var n=vL({},this.opts);return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)},t.formatDateTimeFromString=function(t,n){var r=this,i="en"===this.loc.listingMode(),o=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,s=function(e,n){return r.loc.extract(t,e,n)},a=function(e){return t.isOffsetFixed&&0===t.offset&&e.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,e.format):""},l=function(){return i?function(e){return BB[e.hour<12?0:1]}(t):s({hour:"numeric",hourCycle:"h12"},"dayperiod")},c=function(e,n){return i?function(e,t){return kB(t)[e.month-1]}(t,e):s(n?{month:e}:{month:e,day:"numeric"},"month")},u=function(e,n){return i?function(e,t){return DB(t)[e.weekday-1]}(t,e):s(n?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday")},d=function(e){return i?function(e,t){return jB(t)[e.year<0?0:1]}(t,e):s({era:e},"era")};return HB(e.parseFormat(n),(function(n){switch(n){case"S":return r.num(t.millisecond);case"u":case"SSS":return r.num(t.millisecond,3);case"s":return r.num(t.second);case"ss":return r.num(t.second,2);case"uu":return r.num(Math.floor(t.millisecond/10),2);case"uuu":return r.num(Math.floor(t.millisecond/100));case"m":return r.num(t.minute);case"mm":return r.num(t.minute,2);case"h":return r.num(t.hour%12==0?12:t.hour%12);case"hh":return r.num(t.hour%12==0?12:t.hour%12,2);case"H":return r.num(t.hour);case"HH":return r.num(t.hour,2);case"Z":return a({format:"narrow",allowZ:r.opts.allowZ});case"ZZ":return a({format:"short",allowZ:r.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:r.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:r.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:r.loc.locale});case"z":return t.zoneName;case"a":return l();case"d":return o?s({day:"numeric"},"day"):r.num(t.day);case"dd":return o?s({day:"2-digit"},"day"):r.num(t.day,2);case"c":case"E":return r.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return o?s({month:"numeric",day:"numeric"},"month"):r.num(t.month);case"LL":return o?s({month:"2-digit",day:"numeric"},"month"):r.num(t.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return o?s({month:"numeric"},"month"):r.num(t.month);case"MM":return o?s({month:"2-digit"},"month"):r.num(t.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return o?s({year:"numeric"},"year"):r.num(t.year);case"yy":return o?s({year:"2-digit"},"year"):r.num(t.year.toString().slice(-2),2);case"yyyy":return o?s({year:"numeric"},"year"):r.num(t.year,4);case"yyyyyy":return o?s({year:"numeric"},"year"):r.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return r.num(t.weekYear.toString().slice(-2),2);case"kkkk":return r.num(t.weekYear,4);case"W":return r.num(t.weekNumber);case"WW":return r.num(t.weekNumber,2);case"n":return r.num(t.localWeekNumber);case"nn":return r.num(t.localWeekNumber,2);case"ii":return r.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return r.num(t.localWeekYear,4);case"o":return r.num(t.ordinal);case"ooo":return r.num(t.ordinal,3);case"q":return r.num(t.quarter);case"qq":return r.num(t.quarter,2);case"X":return r.num(Math.floor(t.ts/1e3));case"x":return r.num(t.ts);default:return function(n){var i=e.macroTokenToFormatOpts(n);return i?r.formatWithSystemDefault(t,i):n}(n)}}))},t.formatDurationFromString=function(t,n){var r,i=this,o=function(e){switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=e.parseFormat(n),a=s.reduce((function(e,t){var n=t.literal,r=t.val;return n?e:e.concat(r)}),[]),l=t.shiftTo.apply(t,a.map(o).filter((function(e){return e})));return HB(s,(r=l,function(e){var t=o(e);return t?i.num(r.get(t),e.length):e}))},e}(),WB=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function qB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.reduce((function(e,t){return e+t.source}),"");return RegExp("^"+r+"$")}function KB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduce((function(t,n){var r=t[0],i=t[1],o=t[2],s=n(e,o),a=s[0],l=s[1],c=s[2];return[vL({},r,a),l||i,c]}),[{},null,1]).slice(0,2)}}function JB(e){if(null==e)return[null,null];for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=0,o=n;i<o.length;i++){var s=o[i],a=s[0],l=s[1],c=a.exec(e);if(c)return l(c)}return[null,null]}function QB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n){var r,i={};for(r=0;r<t.length;r++)i[t[r]]=pB(e[n+r]);return[i,null,n+r]}}var YB=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,XB=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,$B=RegExp(""+XB.source+("(?:"+YB.source+"?(?:\\[("+WB.source+")\\])?)?")),ZB=RegExp("(?:T"+$B.source+")?"),ez=QB("weekYear","weekNumber","weekDay"),tz=QB("year","ordinal"),nz=RegExp(XB.source+" ?(?:"+YB.source+"|("+WB.source+"))?"),rz=RegExp("(?: "+nz.source+")?");function iz(e,t,n){var r=e[t];return nB(r)?n:pB(r)}function oz(e,t){return[{hours:iz(e,t,0),minutes:iz(e,t+1,0),seconds:iz(e,t+2,0),milliseconds:fB(e[t+3])},null,t+4]}function sz(e,t){var n=!e[t]&&!e[t+1],r=AB(e[t+1],e[t+2]);return[{},n?null:ID.instance(r),t+3]}function az(e,t){return[{},e[t]?pD.create(e[t]):null,t+1]}var lz=RegExp("^T?"+XB.source+"$"),cz=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function uz(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u="-"===t[0],d=l&&"-"===l[0],p=function(e,t){return void 0===t&&(t=!1),void 0!==e&&(t||e&&u)?-e:e};return[{years:p(hB(n)),months:p(hB(r)),weeks:p(hB(i)),days:p(hB(o)),hours:p(hB(s)),minutes:p(hB(a)),seconds:p(hB(l),"-0"===l),milliseconds:p(fB(c),d)}]}var dz={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function pz(e,t,n,r,i,o,s){var a={year:2===t.length?wB(pB(t)):pB(t),month:RB.indexOf(n)+1,day:pB(r),hour:pB(i),minute:pB(o)};return s&&(a.second=pB(s)),e&&(a.weekday=e.length>3?OB.indexOf(e)+1:NB.indexOf(e)+1),a}var hz=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function fz(e){var t,n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],d=e[10],p=e[11],h=pz(n,o,i,r,s,a,l);return t=c?dz[c]:u?0:AB(d,p),[h,new ID(t)]}var mz=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,gz=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,vz=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function yz(e){var t=e[1],n=e[2],r=e[3];return[pz(t,e[4],r,n,e[5],e[6],e[7]),ID.utcInstance]}function bz(e){var t=e[1],n=e[2],r=e[3],i=e[4],o=e[5],s=e[6];return[pz(t,e[7],n,r,i,o,s),ID.utcInstance]}var Sz=qB(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,ZB),xz=qB(/(\d{4})-?W(\d\d)(?:-?(\d))?/,ZB),wz=qB(/(\d{4})-?(\d{3})/,ZB),Cz=qB($B),Az=KB((function(e,t){return[{year:iz(e,t),month:iz(e,t+1,1),day:iz(e,t+2,1)},null,t+3]}),oz,sz,az),Ez=KB(ez,oz,sz,az),Mz=KB(tz,oz,sz,az),_z=KB(oz,sz,az);var Tz=KB(oz);var Iz=qB(/(\d{4})-(\d\d)-(\d\d)/,rz),Rz=qB(nz),Pz=KB(oz,sz,az);var kz="Invalid Duration",Oz={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Nz=vL({years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},Oz),Lz=365.2425,Dz=30.436875,Bz=vL({years:{quarters:4,months:12,weeks:52.1775,days:Lz,hours:8765.82,minutes:525949.2,seconds:31556952,milliseconds:31556952e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:7889238,milliseconds:7889238e3},months:{weeks:4.3481250000000005,days:Dz,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},Oz),zz=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Fz=zz.slice(0).reverse();function Uz(e,t,n){void 0===n&&(n=!1);var r={values:n?t.values:vL({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Vz(r)}function jz(e,t){for(var n,r,i=null!=(n=t.milliseconds)?n:0,o=ML(Fz.slice(1));!(r=o()).done;){var s=r.value;t[s]&&(i+=t[s]*e[s].milliseconds)}return i}function Hz(e,t){var n=jz(e,t)<0?-1:1;zz.reduceRight((function(r,i){if(nB(t[i]))return r;if(r){var o=t[r]*n,s=e[i][r],a=Math.floor(o/s);t[i]+=a*n,t[r]-=a*s*n}return i}),null),zz.reduce((function(n,r){if(nB(t[r]))return n;if(n){var i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r}),null)}var Vz=function(e){function t(e){var t="longterm"===e.conversionAccuracy||!1,n=t?Bz:Nz;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||_D.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}t.fromMillis=function(e,n){return t.fromObject({milliseconds:e},n)},t.fromObject=function(e,n){if(void 0===n&&(n={}),null==e||"object"!=typeof e)throw new OL("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new t({values:MB(e,t.normalizeUnit),loc:_D.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})},t.fromDurationLike=function(e){if(rB(e))return t.fromMillis(e);if(t.isDuration(e))return e;if("object"==typeof e)return t.fromObject(e);throw new OL("Unknown duration argument "+e+" of type "+typeof e)},t.fromISO=function(e,n){var r=function(e){return JB(e,[cz,uz])}(e),i=r[0];return i?t.fromObject(i,n):t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.fromISOTime=function(e,n){var r=function(e){return JB(e,[lz,Tz])}(e),i=r[0];return i?t.fromObject(i,n):t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new OL("need to specify a reason the Duration is invalid");var r=e instanceof jD?e:new jD(e,n);if(UD.throwOnInvalid)throw new RL(r);return new t({invalid:r})},t.normalizeUnit=function(e){var t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new kL(e);return t},t.isDuration=function(e){return e&&e.isLuxonDuration||!1};var n=t.prototype;return n.toFormat=function(e,t){void 0===t&&(t={});var n=vL({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?GB.create(this.loc,n).formatDurationFromString(this,e):kz},n.toHuman=function(e){var t=this;if(void 0===e&&(e={}),!this.isValid)return kz;var n=zz.map((function(n){var r=t.values[n];return nB(r)?null:t.loc.numberFormatter(vL({style:"unit",unitDisplay:"long"},e,{unit:n.slice(0,-1)})).format(r)})).filter((function(e){return e}));return this.loc.listFormatter(vL({type:"conjunction",style:e.listStyle||"narrow"},e)).format(n)},n.toObject=function(){return this.isValid?vL({},this.values):{}},n.toISO=function(){if(!this.isValid)return null;var e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=mB(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e},n.toISOTime=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var t=this.toMillis();return t<0||t>=864e5?null:(e=vL({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e,{includeOffset:!1}),DF.fromMillis(t,{zone:"UTC"}).toISOTime(e))},n.toJSON=function(){return this.toISO()},n.toString=function(){return this.toISO()},n[e]=function(){return this.isValid?"Duration { values: "+JSON.stringify(this.values)+" }":"Duration { Invalid, reason: "+this.invalidReason+" }"},n.toMillis=function(){return this.isValid?jz(this.matrix,this.values):NaN},n.valueOf=function(){return this.toMillis()},n.plus=function(e){if(!this.isValid)return this;for(var n=t.fromDurationLike(e),r={},i=0,o=zz;i<o.length;i++){var s=o[i];(lB(n.values,s)||lB(this.values,s))&&(r[s]=n.get(s)+this.get(s))}return Uz(this,{values:r},!0)},n.minus=function(e){if(!this.isValid)return this;var n=t.fromDurationLike(e);return this.plus(n.negate())},n.mapUnits=function(e){if(!this.isValid)return this;for(var t={},n=0,r=Object.keys(this.values);n<r.length;n++){var i=r[n];t[i]=EB(e(this.values[i],i))}return Uz(this,{values:t},!0)},n.get=function(e){return this[t.normalizeUnit(e)]},n.set=function(e){return this.isValid?Uz(this,{values:vL({},this.values,MB(e,t.normalizeUnit))}):this},n.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.conversionAccuracy,o=t.matrix;return Uz(this,{loc:this.loc.clone({locale:n,numberingSystem:r}),matrix:o,conversionAccuracy:i})},n.as=function(e){return this.isValid?this.shiftTo(e).get(e):NaN},n.normalize=function(){if(!this.isValid)return this;var e=this.toObject();return Hz(this.matrix,e),Uz(this,{values:e},!0)},n.rescale=function(){return this.isValid?Uz(this,{values:function(e){for(var t={},n=0,r=Object.entries(e);n<r.length;n++){var i=r[n],o=i[0],s=i[1];0!==s&&(t[o]=s)}return t}(this.normalize().shiftToAll().toObject())},!0):this},n.shiftTo=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!this.isValid)return this;if(0===n.length)return this;n=n.map((function(e){return t.normalizeUnit(e)}));for(var i,o={},s={},a=this.toObject(),l=0,c=zz;l<c.length;l++){var u=c[l];if(n.indexOf(u)>=0){i=u;var d=0;for(var p in s)d+=this.matrix[p][u]*s[p],s[p]=0;rB(a[u])&&(d+=a[u]);var h=Math.trunc(d);o[u]=h,s[u]=(1e3*d-1e3*h)/1e3}else rB(a[u])&&(s[u]=a[u])}for(var f in s)0!==s[f]&&(o[i]+=f===i?s[f]:s[f]/this.matrix[i][f]);return Hz(this.matrix,o),Uz(this,{values:o},!0)},n.shiftToAll=function(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this},n.negate=function(){if(!this.isValid)return this;for(var e={},t=0,n=Object.keys(this.values);t<n.length;t++){var r=n[t];e[r]=0===this.values[r]?0:-this.values[r]}return Uz(this,{values:e},!0)},n.equals=function(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(var t=0,n=zz;t<n.length;t++){var r=n[t];if(i=this.values[r],o=e.values[r],!(void 0===i||0===i?void 0===o||0===o:i===o))return!1}var i,o;return!0},gL(t,[{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"years",get:function(){return this.isValid?this.values.years||0:NaN}},{key:"quarters",get:function(){return this.isValid?this.values.quarters||0:NaN}},{key:"months",get:function(){return this.isValid?this.values.months||0:NaN}},{key:"weeks",get:function(){return this.isValid?this.values.weeks||0:NaN}},{key:"days",get:function(){return this.isValid?this.values.days||0:NaN}},{key:"hours",get:function(){return this.isValid?this.values.hours||0:NaN}},{key:"minutes",get:function(){return this.isValid?this.values.minutes||0:NaN}},{key:"seconds",get:function(){return this.isValid?this.values.seconds||0:NaN}},{key:"milliseconds",get:function(){return this.isValid?this.values.milliseconds||0:NaN}},{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),t}(Symbol.for("nodejs.util.inspect.custom")),Gz="Invalid Interval";var Wz=function(e){function t(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new OL("need to specify a reason the Interval is invalid");var r=e instanceof jD?e:new jD(e,n);if(UD.throwOnInvalid)throw new IL(r);return new t({invalid:r})},t.fromDateTimes=function(e,n){var r=BF(e),i=BF(n),o=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?Wz.invalid("end before start","The end of an interval must be after its start, but you had start="+e.toISO()+" and end="+t.toISO()):null:Wz.invalid("missing or invalid end"):Wz.invalid("missing or invalid start")}(r,i);return null==o?new t({start:r,end:i}):o},t.after=function(e,n){var r=Vz.fromDurationLike(n),i=BF(e);return t.fromDateTimes(i,i.plus(r))},t.before=function(e,n){var r=Vz.fromDurationLike(n),i=BF(e);return t.fromDateTimes(i.minus(r),i)},t.fromISO=function(e,n){var r=(e||"").split("/",2),i=r[0],o=r[1];if(i&&o){var s,a,l,c;try{a=(s=DF.fromISO(i,n)).isValid}catch(e){a=!1}try{c=(l=DF.fromISO(o,n)).isValid}catch(e){c=!1}if(a&&c)return t.fromDateTimes(s,l);if(a){var u=Vz.fromISO(o,n);if(u.isValid)return t.after(s,u)}else if(c){var d=Vz.fromISO(i,n);if(d.isValid)return t.before(l,d)}}return t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.isInterval=function(e){return e&&e.isLuxonInterval||!1};var n=t.prototype;return n.length=function(e){return void 0===e&&(e="milliseconds"),this.isValid?this.toDuration.apply(this,[e]).get(e):NaN},n.count=function(e,t){if(void 0===e&&(e="milliseconds"),!this.isValid)return NaN;var n,r=this.start.startOf(e,t);return n=(n=null!=t&&t.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end).startOf(e,t),Math.floor(n.diff(r,e).get(e))+(n.valueOf()!==this.end.valueOf())},n.hasSame=function(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))},n.isEmpty=function(){return this.s.valueOf()===this.e.valueOf()},n.isAfter=function(e){return!!this.isValid&&this.s>e},n.isBefore=function(e){return!!this.isValid&&this.e<=e},n.contains=function(e){return!!this.isValid&&(this.s<=e&&this.e>e)},n.set=function(e){var n=void 0===e?{}:e,r=n.start,i=n.end;return this.isValid?t.fromDateTimes(r||this.s,i||this.e):this},n.splitAt=function(){var e=this;if(!this.isValid)return[];for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=r.map(BF).filter((function(t){return e.contains(t)})).sort((function(e,t){return e.toMillis()-t.toMillis()})),s=[],a=this.s,l=0;a<this.e;){var c=o[l]||this.e,u=+c>+this.e?this.e:c;s.push(t.fromDateTimes(a,u)),a=u,l+=1}return s},n.splitBy=function(e){var n=Vz.fromDurationLike(e);if(!this.isValid||!n.isValid||0===n.as("milliseconds"))return[];for(var r,i=this.s,o=1,s=[];i<this.e;){var a=this.start.plus(n.mapUnits((function(e){return e*o})));r=+a>+this.e?this.e:a,s.push(t.fromDateTimes(i,r)),i=r,o+=1}return s},n.divideEqually=function(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},n.overlaps=function(e){return this.e>e.s&&this.s<e.e},n.abutsStart=function(e){return!!this.isValid&&+this.e==+e.s},n.abutsEnd=function(e){return!!this.isValid&&+e.e==+this.s},n.engulfs=function(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)},n.equals=function(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))},n.intersection=function(e){if(!this.isValid)return this;var n=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return n>=r?null:t.fromDateTimes(n,r)},n.union=function(e){if(!this.isValid)return this;var n=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return t.fromDateTimes(n,r)},t.merge=function(e){var t=e.sort((function(e,t){return e.s-t.s})).reduce((function(e,t){var n=e[0],r=e[1];return r?r.overlaps(t)||r.abutsStart(t)?[n,r.union(t)]:[n.concat([r]),t]:[n,t]}),[[],null]),n=t[0],r=t[1];return r&&n.push(r),n},t.xor=function(e){for(var n,r,i=null,o=0,s=[],a=e.map((function(e){return[{time:e.s,type:"s"},{time:e.e,type:"e"}]})),l=(n=Array.prototype).concat.apply(n,a).sort((function(e,t){return e.time-t.time})),c=ML(l);!(r=c()).done;){var u=r.value;1===(o+="s"===u.type?1:-1)?i=u.time:(i&&+i!=+u.time&&s.push(t.fromDateTimes(i,u.time)),i=null)}return t.merge(s)},n.difference=function(){for(var e=this,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.xor([this].concat(r)).map((function(t){return e.intersection(t)})).filter((function(e){return e&&!e.isEmpty()}))},n.toString=function(){return this.isValid?"["+this.s.toISO()+" – "+this.e.toISO()+")":Gz},n[e]=function(){return this.isValid?"Interval { start: "+this.s.toISO()+", end: "+this.e.toISO()+" }":"Interval { Invalid, reason: "+this.invalidReason+" }"},n.toLocaleString=function(e,t){return void 0===e&&(e=zL),void 0===t&&(t={}),this.isValid?GB.create(this.s.loc.clone(t),e).formatInterval(this):Gz},n.toISO=function(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):Gz},n.toISODate=function(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():Gz},n.toISOTime=function(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):Gz},n.toFormat=function(e,t){var n=(void 0===t?{}:t).separator,r=void 0===n?" – ":n;return this.isValid?""+this.s.toFormat(e)+r+this.e.toFormat(e):Gz},n.toDuration=function(e,t){return this.isValid?this.e.diff(this.s,e,t):Vz.invalid(this.invalidReason)},n.mapEndpoints=function(e){return t.fromDateTimes(e(this.s),e(this.e))},gL(t,[{key:"start",get:function(){return this.isValid?this.s:null}},{key:"end",get:function(){return this.isValid?this.e:null}},{key:"isValid",get:function(){return null===this.invalidReason}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),t}(Symbol.for("nodejs.util.inspect.custom")),qz=function(){function e(){}return e.hasDST=function(e){void 0===e&&(e=UD.defaultZone);var t=DF.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset},e.isValidIANAZone=function(e){return pD.isValidZone(e)},e.normalizeZone=function(e){return PD(e,UD.defaultZone)},e.getStartOfWeek=function(e){var t=void 0===e?{}:e,n=t.locale,r=void 0===n?null:n,i=t.locObj;return((void 0===i?null:i)||_D.create(r)).getStartOfWeek()},e.getMinimumDaysInFirstWeek=function(e){var t=void 0===e?{}:e,n=t.locale,r=void 0===n?null:n,i=t.locObj;return((void 0===i?null:i)||_D.create(r)).getMinDaysInFirstWeek()},e.getWeekendWeekdays=function(e){var t=void 0===e?{}:e,n=t.locale,r=void 0===n?null:n,i=t.locObj;return((void 0===i?null:i)||_D.create(r)).getWeekendDays().slice()},e.months=function(e,t){void 0===e&&(e="long");var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,s=void 0===o?null:o,a=n.locObj,l=void 0===a?null:a,c=n.outputCalendar,u=void 0===c?"gregory":c;return(l||_D.create(i,s,u)).months(e)},e.monthsFormat=function(e,t){void 0===e&&(e="long");var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,s=void 0===o?null:o,a=n.locObj,l=void 0===a?null:a,c=n.outputCalendar,u=void 0===c?"gregory":c;return(l||_D.create(i,s,u)).months(e,!0)},e.weekdays=function(e,t){void 0===e&&(e="long");var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,s=void 0===o?null:o,a=n.locObj;return((void 0===a?null:a)||_D.create(i,s,null)).weekdays(e)},e.weekdaysFormat=function(e,t){void 0===e&&(e="long");var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,s=void 0===o?null:o,a=n.locObj;return((void 0===a?null:a)||_D.create(i,s,null)).weekdays(e,!0)},e.meridiems=function(e){var t=(void 0===e?{}:e).locale,n=void 0===t?null:t;return _D.create(n).meridiems()},e.eras=function(e,t){void 0===e&&(e="short");var n=(void 0===t?{}:t).locale,r=void 0===n?null:n;return _D.create(r,null,"gregory").eras(e)},e.features=function(){return{relative:oB(),localeWeek:sB()}},e}();function Kz(e,t){var n=function(e){return e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf()},r=n(t)-n(e);return Math.floor(Vz.fromMillis(r).as("days"))}function Jz(e,t,n,r){var i=function(e,t,n){for(var r,i,o=[["years",function(e,t){return t.year-e.year}],["quarters",function(e,t){return t.quarter-e.quarter+4*(t.year-e.year)}],["months",function(e,t){return t.month-e.month+12*(t.year-e.year)}],["weeks",function(e,t){var n=Kz(e,t);return(n-n%7)/7}],["days",Kz]],s={},a=e,l=0,c=o;l<c.length;l++){var u=c[l],d=u[0],p=u[1];n.indexOf(d)>=0&&(r=d,s[d]=p(e,t),(i=a.plus(s))>t?(s[d]--,(e=a.plus(s))>t&&(i=e,s[d]--,e=a.plus(s))):e=i)}return[e,s,i,r]}(e,t,n),o=i[0],s=i[1],a=i[2],l=i[3],c=t-o,u=n.filter((function(e){return["hours","minutes","seconds","milliseconds"].indexOf(e)>=0}));if(0===u.length){var d;if(a<t)a=o.plus(((d={})[l]=1,d));a!==o&&(s[l]=(s[l]||0)+c/(a-o))}var p,h=Vz.fromObject(s,r);return u.length>0?(p=Vz.fromMillis(c,r)).shiftTo.apply(p,u).plus(h):h}var Qz={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Yz={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Xz=Qz.hanidec.replace(/[\[|\]]/g,"").split("");function $z(e,t){var n=e.numberingSystem;return void 0===t&&(t=""),new RegExp(""+Qz[n||"latn"]+t)}function Zz(e,t){return void 0===t&&(t=function(e){return e}),{regex:e,deser:function(e){var n=e[0];return t(function(e){var t=parseInt(e,10);if(isNaN(t)){t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(-1!==e[n].search(Qz.hanidec))t+=Xz.indexOf(e[n]);else for(var i in Yz){var o=Yz[i],s=o[0],a=o[1];r>=s&&r<=a&&(t+=r-s)}}return parseInt(t,10)}return t}(n))}}}var eF="[ "+String.fromCharCode(160)+"]",tF=new RegExp(eF,"g");function nF(e){return e.replace(/\./g,"\\.?").replace(tF,eF)}function rF(e){return e.replace(/\./g,"").replace(tF," ").toLowerCase()}function iF(e,t){return null===e?null:{regex:RegExp(e.map(nF).join("|")),deser:function(n){var r=n[0];return e.findIndex((function(e){return rF(r)===rF(e)}))+t}}}function oF(e,t){return{regex:e,deser:function(e){return AB(e[1],e[2])},groups:t}}function sF(e){return{regex:e,deser:function(e){return e[0]}}}var aF={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};var lF=null;function cF(e,t){var n;return(n=Array.prototype).concat.apply(n,e.map((function(e){return function(e,t){if(e.literal)return e;var n=dF(GB.macroTokenToFormatOpts(e.val),t);return null==n||n.includes(void 0)?e:n}(e,t)})))}function uF(e,t,n){var r=cF(GB.parseFormat(n),e),i=r.map((function(t){return n=t,i=$z(r=e),o=$z(r,"{2}"),s=$z(r,"{3}"),a=$z(r,"{4}"),l=$z(r,"{6}"),c=$z(r,"{1,2}"),u=$z(r,"{1,3}"),d=$z(r,"{1,6}"),p=$z(r,"{1,9}"),h=$z(r,"{2,4}"),f=$z(r,"{4,6}"),m=function(e){return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:function(e){return e[0]},literal:!0};var t},g=function(e){if(n.literal)return m(e);switch(e.val){case"G":return iF(r.eras("short"),0);case"GG":return iF(r.eras("long"),0);case"y":return Zz(d);case"yy":case"kk":return Zz(h,wB);case"yyyy":case"kkkk":return Zz(a);case"yyyyy":return Zz(f);case"yyyyyy":return Zz(l);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Zz(c);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Zz(o);case"MMM":return iF(r.months("short",!0),1);case"MMMM":return iF(r.months("long",!0),1);case"LLL":return iF(r.months("short",!1),1);case"LLLL":return iF(r.months("long",!1),1);case"o":case"S":return Zz(u);case"ooo":case"SSS":return Zz(s);case"u":return sF(p);case"uu":return sF(c);case"uuu":case"E":case"c":return Zz(i);case"a":return iF(r.meridiems(),0);case"EEE":return iF(r.weekdays("short",!1),1);case"EEEE":return iF(r.weekdays("long",!1),1);case"ccc":return iF(r.weekdays("short",!0),1);case"cccc":return iF(r.weekdays("long",!0),1);case"Z":case"ZZ":return oF(new RegExp("([+-]"+c.source+")(?::("+o.source+"))?"),2);case"ZZZ":return oF(new RegExp("([+-]"+c.source+")("+o.source+")?"),2);case"z":return sF(/[a-z_+-/]{1,256}?/i);case" ":return sF(/[^\S\n\r]/);default:return m(e)}}(n)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"},g.token=n,g;var n,r,i,o,s,a,l,c,u,d,p,h,f,m,g})),o=i.find((function(e){return e.invalidReason}));if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};var s=function(e){var t=e.map((function(e){return e.regex})).reduce((function(e,t){return e+"("+t.source+")"}),"");return["^"+t+"$",e]}(i),a=s[0],l=s[1],c=RegExp(a,"i"),u=function(e,t,n){var r=e.match(t);if(r){var i={},o=1;for(var s in n)if(lB(n,s)){var a=n[s],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+l))),o+=l}return[r,i]}return[r,{}]}(t,c,l),d=u[0],p=u[1],h=p?function(e){var t,n=null;nB(e.z)||(n=pD.create(e.z)),nB(e.Z)||(n||(n=new ID(e.Z)),t=e.Z),nB(e.q)||(e.M=3*(e.q-1)+1),nB(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),nB(e.u)||(e.S=fB(e.u));var r=Object.keys(e).reduce((function(t,n){var r=function(e){switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}}(n);return r&&(t[r]=e[n]),t}),{});return[r,n,t]}(p):[null,null,void 0],f=h[0],m=h[1],g=h[2];if(lB(p,"a")&&lB(p,"H"))throw new PL("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:c,rawMatches:d,matches:p,result:f,zone:m,specificOffset:g}}function dF(e,t){if(!e)return null;var n=GB.create(t,e).dtFormatter((lF||(lF=DF.fromMillis(1555555555555)),lF)),r=n.formatToParts(),i=n.resolvedOptions();return r.map((function(t){return function(e,t,n){var r=e.type,i=e.value;if("literal"===r){var o=/^\s+$/.test(i);return{literal:!o,val:o?" ":i}}var s=t[r],a=r;"hour"===r&&(a=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":n.hour12?"hour12":"hour24");var l=aF[a];if("object"==typeof l&&(l=l[s]),l)return{literal:!1,val:l}}(t,e,i)}))}var pF="Invalid DateTime",hF=864e13;function fF(e){return new jD("unsupported zone",'the zone "'+e.name+'" is not supported')}function mF(e){return null===e.weekData&&(e.weekData=QD(e.c)),e.weekData}function gF(e){return null===e.localWeekData&&(e.localWeekData=QD(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function vF(e,t){var n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new DF(vL({},n,t,{old:n}))}function yF(e,t,n){var r=e-6e4*t,i=n.offset(r);if(t===i)return[r,t];r-=6e4*(i-t);var o=n.offset(r);return i===o?[r,i]:[e-6e4*Math.min(i,o),Math.max(i,o)]}function bF(e,t){var n=new Date(e+=6e4*t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function SF(e,t,n){return yF(bB(e),t,n)}function xF(e,t){var n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),o=vL({},e.c,{year:r,month:i,day:Math.min(e.c.day,yB(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)}),s=Vz.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=yF(bB(o),n,e.zone),l=a[0],c=a[1];return 0!==s&&(l+=s,c=e.zone.offset(l)),{ts:l,o:c}}function wF(e,t,n,r,i,o){var s=n.setZone,a=n.zone;if(e&&0!==Object.keys(e).length||t){var l=t||a,c=DF.fromObject(e,vL({},n,{zone:l,specificOffset:o}));return s?c:c.setZone(a)}return DF.invalid(new jD("unparsable",'the input "'+i+"\" can't be parsed as "+r))}function CF(e,t,n){return void 0===n&&(n=!0),e.isValid?GB.create(_D.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function AF(e,t){var n=e.c.year>9999||e.c.year<0,r="";return n&&e.c.year>=0&&(r+="+"),r+=dB(e.c.year,n?6:4),t?(r+="-",r+=dB(e.c.month),r+="-",r+=dB(e.c.day)):(r+=dB(e.c.month),r+=dB(e.c.day)),r}function EF(e,t,n,r,i,o){var s=dB(e.c.hour);return t?(s+=":",s+=dB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=":")):s+=dB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=dB(e.c.second),0===e.c.millisecond&&r||(s+=".",s+=dB(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!o?s+="Z":e.o<0?(s+="-",s+=dB(Math.trunc(-e.o/60)),s+=":",s+=dB(Math.trunc(-e.o%60))):(s+="+",s+=dB(Math.trunc(e.o/60)),s+=":",s+=dB(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}var MF={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},_F={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},TF={ordinal:1,hour:0,minute:0,second:0,millisecond:0},IF=["year","month","day","hour","minute","second","millisecond"],RF=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],PF=["year","ordinal","hour","minute","second","millisecond"];function kF(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function(e){var t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new kL(e);return t}(e)}}function OF(e,t){var n,r,i=PD(t.zone,UD.defaultZone),o=_D.fromObject(t),s=UD.now();if(nB(e.year))n=s;else{for(var a=0,l=IF;a<l.length;a++){var c=l[a];nB(e[c])&&(e[c]=MF[c])}var u=eB(e)||tB(e);if(u)return DF.invalid(u);var d=SF(e,i.offset(s),i);n=d[0],r=d[1]}return new DF({ts:n,zone:i,loc:o,o:r})}function NF(e,t,n){var r=!!nB(n.round)||n.round,i=function(e,i){return e=mB(e,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(e,i)},o=function(r){return n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r)};if(n.unit)return i(o(n.unit),n.unit);for(var s,a=ML(n.units);!(s=a()).done;){var l=s.value,c=o(l);if(Math.abs(c)>=1)return i(c,l)}return i(e>t?-0:0,n.units[n.units.length-1])}function LF(e){var t,n={};return e.length>0&&"object"==typeof e[e.length-1]?(n=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[n,t]}var DF=function(e){function t(e){var t=e.zone||UD.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new jD("invalid input"):null)||(t.isValid?null:fF(t));this.ts=nB(e.ts)?UD.now():e.ts;var r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t)){var o=[e.old.c,e.old.o];r=o[0],i=o[1]}else{var s=t.offset(this.ts);r=bF(this.ts,s),r=(n=Number.isNaN(r.year)?new jD("invalid input"):null)?null:r,i=n?null:s}this._zone=t,this.loc=e.loc||_D.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}t.now=function(){return new t({})},t.local=function(){var e=LF(arguments),t=e[0],n=e[1],r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],c=n[6];return OF({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:c},t)},t.utc=function(){var e=LF(arguments),t=e[0],n=e[1],r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],c=n[6];return t.zone=ID.utcInstance,OF({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:c},t)},t.fromJSDate=function(e,n){void 0===n&&(n={});var r=function(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?e.valueOf():NaN;if(Number.isNaN(r))return t.invalid("invalid input");var i=PD(n.zone,UD.defaultZone);return i.isValid?new t({ts:r,zone:i,loc:_D.fromObject(n)}):t.invalid(fF(i))},t.fromMillis=function(e,n){if(void 0===n&&(n={}),rB(e))return e<-864e13||e>hF?t.invalid("Timestamp out of range"):new t({ts:e,zone:PD(n.zone,UD.defaultZone),loc:_D.fromObject(n)});throw new OL("fromMillis requires a numerical input, but received a "+typeof e+" with value "+e)},t.fromSeconds=function(e,n){if(void 0===n&&(n={}),rB(e))return new t({ts:1e3*e,zone:PD(n.zone,UD.defaultZone),loc:_D.fromObject(n)});throw new OL("fromSeconds requires a numerical input")},t.fromObject=function(e,n){void 0===n&&(n={}),e=e||{};var r=PD(n.zone,UD.defaultZone);if(!r.isValid)return t.invalid(fF(r));var i=_D.fromObject(n),o=MB(e,kF),s=ZD(o,i),a=s.minDaysInFirstWeek,l=s.startOfWeek,c=UD.now(),u=nB(n.specificOffset)?r.offset(c):n.specificOffset,d=!nB(o.ordinal),p=!nB(o.year),h=!nB(o.month)||!nB(o.day),f=p||h,m=o.weekYear||o.weekNumber;if((f||d)&&m)throw new PL("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&d)throw new PL("Can't mix ordinal dates with month/day");var g,v,y=m||o.weekday&&!f,b=bF(c,u);y?(g=RF,v=_F,b=QD(b,a,l)):d?(g=PF,v=TF,b=XD(b)):(g=IF,v=MF);for(var S,x=!1,w=ML(g);!(S=w()).done;){var C=S.value;nB(o[C])?o[C]=x?v[C]:b[C]:x=!0}var A=y?function(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r=iB(e.weekYear),i=uB(e.weekNumber,1,xB(e.weekYear,t,n)),o=uB(e.weekday,1,7);return r?i?!o&&GD("weekday",e.weekday):GD("week",e.weekNumber):GD("weekYear",e.weekYear)}(o,a,l):d?function(e){var t=iB(e.year),n=uB(e.ordinal,1,vB(e.year));return t?!n&&GD("ordinal",e.ordinal):GD("year",e.year)}(o):eB(o),E=A||tB(o);if(E)return t.invalid(E);var M=SF(y?YD(o,a,l):d?$D(o):o,u,r),_=new t({ts:M[0],zone:r,o:M[1],loc:i});return o.weekday&&f&&e.weekday!==_.weekday?t.invalid("mismatched weekday","you can't specify both a weekday of "+o.weekday+" and a date of "+_.toISO()):_},t.fromISO=function(e,t){void 0===t&&(t={});var n=function(e){return JB(e,[Sz,Az],[xz,Ez],[wz,Mz],[Cz,_z])}(e);return wF(n[0],n[1],t,"ISO 8601",e)},t.fromRFC2822=function(e,t){void 0===t&&(t={});var n=function(e){return JB(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[hz,fz])}(e);return wF(n[0],n[1],t,"RFC 2822",e)},t.fromHTTP=function(e,t){void 0===t&&(t={});var n=function(e){return JB(e,[mz,yz],[gz,yz],[vz,bz])}(e);return wF(n[0],n[1],t,"HTTP",t)},t.fromFormat=function(e,n,r){if(void 0===r&&(r={}),nB(e)||nB(n))throw new OL("fromFormat requires an input string and a format");var i=r,o=i.locale,s=void 0===o?null:o,a=i.numberingSystem,l=void 0===a?null:a,c=function(e,t,n){var r=uF(e,t,n);return[r.result,r.zone,r.specificOffset,r.invalidReason]}(_D.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),e,n),u=c[0],d=c[1],p=c[2],h=c[3];return h?t.invalid(h):wF(u,d,r,"format "+n,e,p)},t.fromString=function(e,n,r){return void 0===r&&(r={}),t.fromFormat(e,n,r)},t.fromSQL=function(e,t){void 0===t&&(t={});var n=function(e){return JB(e,[Iz,Az],[Rz,Pz])}(e);return wF(n[0],n[1],t,"SQL",e)},t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new OL("need to specify a reason the DateTime is invalid");var r=e instanceof jD?e:new jD(e,n);if(UD.throwOnInvalid)throw new TL(r);return new t({invalid:r})},t.isDateTime=function(e){return e&&e.isLuxonDateTime||!1},t.parseFormatForOpts=function(e,t){void 0===t&&(t={});var n=dF(e,_D.fromObject(t));return n?n.map((function(e){return e?e.val:null})).join(""):null},t.expandFormat=function(e,t){return void 0===t&&(t={}),cF(GB.parseFormat(e),_D.fromObject(t)).map((function(e){return e.val})).join("")};var n=t.prototype;return n.get=function(e){return this[e]},n.getPossibleOffsets=function(){if(!this.isValid||this.isOffsetFixed)return[this];var e=864e5,t=6e4,n=bB(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),o=this.zone.offset(n-r*t),s=this.zone.offset(n-i*t);if(o===s)return[this];var a=n-o*t,l=n-s*t,c=bF(a,o),u=bF(l,s);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[vF(this,{ts:a}),vF(this,{ts:l})]:[this]},n.resolvedLocaleOptions=function(e){void 0===e&&(e={});var t=GB.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t.locale,numberingSystem:t.numberingSystem,outputCalendar:t.calendar}},n.toUTC=function(e,t){return void 0===e&&(e=0),void 0===t&&(t={}),this.setZone(ID.instance(e),t)},n.toLocal=function(){return this.setZone(UD.defaultZone)},n.setZone=function(e,n){var r=void 0===n?{}:n,i=r.keepLocalTime,o=void 0!==i&&i,s=r.keepCalendarTime,a=void 0!==s&&s;if((e=PD(e,UD.defaultZone)).equals(this.zone))return this;if(e.isValid){var l=this.ts;if(o||a){var c=e.offset(this.ts);l=SF(this.toObject(),c,e)[0]}return vF(this,{ts:l,zone:e})}return t.invalid(fF(e))},n.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.outputCalendar;return vF(this,{loc:this.loc.clone({locale:n,numberingSystem:r,outputCalendar:i})})},n.setLocale=function(e){return this.reconfigure({locale:e})},n.set=function(e){if(!this.isValid)return this;var t,n=MB(e,kF),r=ZD(n,this.loc),i=r.minDaysInFirstWeek,o=r.startOfWeek,s=!nB(n.weekYear)||!nB(n.weekNumber)||!nB(n.weekday),a=!nB(n.ordinal),l=!nB(n.year),c=!nB(n.month)||!nB(n.day),u=l||c,d=n.weekYear||n.weekNumber;if((u||a)&&d)throw new PL("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new PL("Can't mix ordinal dates with month/day");s?t=YD(vL({},QD(this.c,i,o),n),i,o):nB(n.ordinal)?(t=vL({},this.toObject(),n),nB(n.day)&&(t.day=Math.min(yB(t.year,t.month),t.day))):t=$D(vL({},XD(this.c),n));var p=SF(t,this.o,this.zone);return vF(this,{ts:p[0],o:p[1]})},n.plus=function(e){return this.isValid?vF(this,xF(this,Vz.fromDurationLike(e))):this},n.minus=function(e){return this.isValid?vF(this,xF(this,Vz.fromDurationLike(e).negate())):this},n.startOf=function(e,t){var n=(void 0===t?{}:t).useLocaleWeeks,r=void 0!==n&&n;if(!this.isValid)return this;var i={},o=Vz.normalizeUnit(e);switch(o){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0}if("weeks"===o)if(r){var s=this.loc.getStartOfWeek();this.weekday<s&&(i.weekNumber=this.weekNumber-1),i.weekday=s}else i.weekday=1;if("quarters"===o){var a=Math.ceil(this.month/3);i.month=3*(a-1)+1}return this.set(i)},n.endOf=function(e,t){var n;return this.isValid?this.plus((n={},n[e]=1,n)).startOf(e,t).minus(1):this},n.toFormat=function(e,t){return void 0===t&&(t={}),this.isValid?GB.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):pF},n.toLocaleString=function(e,t){return void 0===e&&(e=zL),void 0===t&&(t={}),this.isValid?GB.create(this.loc.clone(t),e).formatDateTime(this):pF},n.toLocaleParts=function(e){return void 0===e&&(e={}),this.isValid?GB.create(this.loc.clone(e),e).formatDateTimeParts(this):[]},n.toISO=function(e){var t=void 0===e?{}:e,n=t.format,r=void 0===n?"extended":n,i=t.suppressSeconds,o=void 0!==i&&i,s=t.suppressMilliseconds,a=void 0!==s&&s,l=t.includeOffset,c=void 0===l||l,u=t.extendedZone,d=void 0!==u&&u;if(!this.isValid)return null;var p="extended"===r,h=AF(this,p);return h+="T",h+=EF(this,p,o,a,c,d)},n.toISODate=function(e){var t=(void 0===e?{}:e).format,n=void 0===t?"extended":t;return this.isValid?AF(this,"extended"===n):null},n.toISOWeekDate=function(){return CF(this,"kkkk-'W'WW-c")},n.toISOTime=function(e){var t=void 0===e?{}:e,n=t.suppressMilliseconds,r=void 0!==n&&n,i=t.suppressSeconds,o=void 0!==i&&i,s=t.includeOffset,a=void 0===s||s,l=t.includePrefix,c=void 0!==l&&l,u=t.extendedZone,d=void 0!==u&&u,p=t.format,h=void 0===p?"extended":p;return this.isValid?(c?"T":"")+EF(this,"extended"===h,o,r,a,d):null},n.toRFC2822=function(){return CF(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},n.toHTTP=function(){return CF(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},n.toSQLDate=function(){return this.isValid?AF(this,!0):null},n.toSQLTime=function(e){var t=void 0===e?{}:e,n=t.includeOffset,r=void 0===n||n,i=t.includeZone,o=void 0!==i&&i,s=t.includeOffsetSpace,a="HH:mm:ss.SSS";return(o||r)&&((void 0===s||s)&&(a+=" "),o?a+="z":r&&(a+="ZZ")),CF(this,a,!0)},n.toSQL=function(e){return void 0===e&&(e={}),this.isValid?this.toSQLDate()+" "+this.toSQLTime(e):null},n.toString=function(){return this.isValid?this.toISO():pF},n[e]=function(){return this.isValid?"DateTime { ts: "+this.toISO()+", zone: "+this.zone.name+", locale: "+this.locale+" }":"DateTime { Invalid, reason: "+this.invalidReason+" }"},n.valueOf=function(){return this.toMillis()},n.toMillis=function(){return this.isValid?this.ts:NaN},n.toSeconds=function(){return this.isValid?this.ts/1e3:NaN},n.toUnixInteger=function(){return this.isValid?Math.floor(this.ts/1e3):NaN},n.toJSON=function(){return this.toISO()},n.toBSON=function(){return this.toJSDate()},n.toObject=function(e){if(void 0===e&&(e={}),!this.isValid)return{};var t=vL({},this.c);return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t},n.toJSDate=function(){return new Date(this.isValid?this.ts:NaN)},n.diff=function(e,t,n){if(void 0===t&&(t="milliseconds"),void 0===n&&(n={}),!this.isValid||!e.isValid)return Vz.invalid("created by diffing an invalid DateTime");var r,i=vL({locale:this.locale,numberingSystem:this.numberingSystem},n),o=(r=t,Array.isArray(r)?r:[r]).map(Vz.normalizeUnit),s=e.valueOf()>this.valueOf(),a=Jz(s?this:e,s?e:this,o,i);return s?a.negate():a},n.diffNow=function(e,n){return void 0===e&&(e="milliseconds"),void 0===n&&(n={}),this.diff(t.now(),e,n)},n.until=function(e){return this.isValid?Wz.fromDateTimes(this,e):this},n.hasSame=function(e,t,n){if(!this.isValid)return!1;var r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)},n.equals=function(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},n.toRelative=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var n=e.base||t.fromObject({},{zone:this.zone}),r=e.padding?this<n?-e.padding:e.padding:0,i=["years","months","days","hours","minutes","seconds"],o=e.unit;return Array.isArray(e.unit)&&(i=e.unit,o=void 0),NF(n,this.plus(r),vL({},e,{numeric:"always",units:i,unit:o}))},n.toRelativeCalendar=function(e){return void 0===e&&(e={}),this.isValid?NF(e.base||t.fromObject({},{zone:this.zone}),this,vL({},e,{numeric:"auto",units:["years","months","days"],calendary:!0})):null},t.min=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!n.every(t.isDateTime))throw new OL("min requires all arguments be DateTimes");return aB(n,(function(e){return e.valueOf()}),Math.min)},t.max=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!n.every(t.isDateTime))throw new OL("max requires all arguments be DateTimes");return aB(n,(function(e){return e.valueOf()}),Math.max)},t.fromFormatExplain=function(e,t,n){void 0===n&&(n={});var r=n,i=r.locale,o=void 0===i?null:i,s=r.numberingSystem,a=void 0===s?null:s;return uF(_D.fromOpts({locale:o,numberingSystem:a,defaultToEN:!0}),e,t)},t.fromStringExplain=function(e,n,r){return void 0===r&&(r={}),t.fromFormatExplain(e,n,r)},gL(t,[{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}},{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"outputCalendar",get:function(){return this.isValid?this.loc.outputCalendar:null}},{key:"zone",get:function(){return this._zone}},{key:"zoneName",get:function(){return this.isValid?this.zone.name:null}},{key:"year",get:function(){return this.isValid?this.c.year:NaN}},{key:"quarter",get:function(){return this.isValid?Math.ceil(this.c.month/3):NaN}},{key:"month",get:function(){return this.isValid?this.c.month:NaN}},{key:"day",get:function(){return this.isValid?this.c.day:NaN}},{key:"hour",get:function(){return this.isValid?this.c.hour:NaN}},{key:"minute",get:function(){return this.isValid?this.c.minute:NaN}},{key:"second",get:function(){return this.isValid?this.c.second:NaN}},{key:"millisecond",get:function(){return this.isValid?this.c.millisecond:NaN}},{key:"weekYear",get:function(){return this.isValid?mF(this).weekYear:NaN}},{key:"weekNumber",get:function(){return this.isValid?mF(this).weekNumber:NaN}},{key:"weekday",get:function(){return this.isValid?mF(this).weekday:NaN}},{key:"isWeekend",get:function(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}},{key:"localWeekday",get:function(){return this.isValid?gF(this).weekday:NaN}},{key:"localWeekNumber",get:function(){return this.isValid?gF(this).weekNumber:NaN}},{key:"localWeekYear",get:function(){return this.isValid?gF(this).weekYear:NaN}},{key:"ordinal",get:function(){return this.isValid?XD(this.c).ordinal:NaN}},{key:"monthShort",get:function(){return this.isValid?qz.months("short",{locObj:this.loc})[this.month-1]:null}},{key:"monthLong",get:function(){return this.isValid?qz.months("long",{locObj:this.loc})[this.month-1]:null}},{key:"weekdayShort",get:function(){return this.isValid?qz.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}},{key:"weekdayLong",get:function(){return this.isValid?qz.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}},{key:"offset",get:function(){return this.isValid?+this.o:NaN}},{key:"offsetNameShort",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}},{key:"offsetNameLong",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}},{key:"isOffsetFixed",get:function(){return this.isValid?this.zone.isUniversal:null}},{key:"isInDST",get:function(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function(){return gB(this.year)}},{key:"daysInMonth",get:function(){return yB(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?vB(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?xB(this.weekYear):NaN}},{key:"weeksInLocalWeekYear",get:function(){return this.isValid?xB(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}}],[{key:"DATE_SHORT",get:function(){return zL}},{key:"DATE_MED",get:function(){return FL}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return UL}},{key:"DATE_FULL",get:function(){return jL}},{key:"DATE_HUGE",get:function(){return HL}},{key:"TIME_SIMPLE",get:function(){return VL}},{key:"TIME_WITH_SECONDS",get:function(){return GL}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return WL}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return qL}},{key:"TIME_24_SIMPLE",get:function(){return KL}},{key:"TIME_24_WITH_SECONDS",get:function(){return JL}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return QL}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return YL}},{key:"DATETIME_SHORT",get:function(){return XL}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return $L}},{key:"DATETIME_MED",get:function(){return ZL}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return eD}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return tD}},{key:"DATETIME_FULL",get:function(){return nD}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return rD}},{key:"DATETIME_HUGE",get:function(){return iD}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return oD}}]),t}(Symbol.for("nodejs.util.inspect.custom"));function BF(e){if(DF.isDateTime(e))return e;if(e&&e.valueOf&&rB(e.valueOf()))return DF.fromJSDate(e);if(e&&"object"==typeof e)return DF.fromObject(e);throw new OL("Unknown datetime argument: "+e+", of type "+typeof e)}fL.DateTime=DF,fL.Duration=Vz,fL.FixedOffsetZone=ID,fL.IANAZone=pD,fL.Info=qz,fL.Interval=Wz,fL.InvalidZone=RD,fL.Settings=UD,fL.SystemZone=lD,fL.VERSION="3.4.4",fL.Zone=sD;c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");function zF(e,t){let[n,r]=(0,c.useState)(e),i=Ja(e);return Ka((()=>r(i.current)),[i,r,...t]),n}var FF=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(FF||{}),UF=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(UF||{}),jF=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(jF||{}),HF=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.SetOrientation=3]="SetOrientation",e[e.GoToOption=4]="GoToOption",e[e.Search=5]="Search",e[e.ClearSearch=6]="ClearSearch",e[e.RegisterOption=7]="RegisterOption",e[e.UnregisterOption=8]="UnregisterOption",e))(HF||{});function VF(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=El(t(e.options.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{options:r,activeOptionIndex:i}}let GF={1:e=>e.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1},0(e){if(e.disabled||0===e.listboxState)return e;let t=e.activeOptionIndex,{value:n,mode:r,compare:i}=e.propsRef.current,o=e.options.findIndex((e=>{let t=e.dataRef.current.value;return Da(r,{1:()=>n.some((e=>i(e,t))),0:()=>i(n,t)})}));return-1!==o&&(t=o),{...e,listboxState:0,activeOptionIndex:t}},2:(e,t)=>e.disabled===t.disabled?e:{...e,disabled:t.disabled},3:(e,t)=>e.orientation===t.orientation?e:{...e,orientation:t.orientation},4(e,t){var n;if(e.disabled||1===e.listboxState)return e;let r=VF(e),i=_d(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},5:(e,t)=>{if(e.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find((e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))})),o=i?e.options.indexOf(i):-1;return-1===o||o===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:o,activationTrigger:1}},6:e=>e.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},7:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=VF(e,(e=>[...e,n]));if(null===e.activeOptionIndex){let{value:i,mode:o,compare:s}=e.propsRef.current,a=t.dataRef.current.value;Da(o,{1:()=>i.some((e=>s(e,a))),0:()=>s(i,a)})&&(r.activeOptionIndex=r.options.indexOf(n))}return{...e,...r}},8:(e,t)=>{let n=VF(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},WF=(0,c.createContext)(null);function qF(e){let t=(0,c.useContext)(WF);if(null===t){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,qF),t}return t}function KF(e,t){return Da(t.type,GF,e,t)}WF.displayName="ListboxContext";let JF=c.Fragment,QF=Va((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,horizontal:u=!1,multiple:d=!1,...p}=e;const h=u?"horizontal":"vertical";let f=$a(n),[m,g]=Hf(r,s,i),v=(0,c.useReducer)(KF,{listboxState:1,propsRef:{current:{value:m,onChange:g,mode:d?1:0,compare:Qa("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a)}},labelRef:(0,c.createRef)(),buttonRef:(0,c.createRef)(),optionsRef:(0,c.createRef)(),disabled:l,orientation:h,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1}),[{listboxState:y,propsRef:b,optionsRef:S,buttonRef:x},w]=v;b.current.value=m,b.current.mode=d?1:0,Ka((()=>{b.current.onChange=e=>Da(b.current.mode,{0:()=>g(e),1(){let t=b.current.value.slice(),{compare:n}=b.current,r=t.findIndex((t=>n(t,e)));return-1===r?t.push(e):t.splice(r,1),g(t)}})}),[g,b]),Ka((()=>w({type:2,disabled:l})),[l]),Ka((()=>w({type:3,orientation:h})),[h]),cc([x,S],((e,t)=>{var n;w({type:1}),xl(t,Sl.Loose)||(e.preventDefault(),null==(n=x.current)||n.focus())}),0===y);let C=(0,c.useMemo)((()=>({open:0===y,disabled:l,value:m})),[y,l,m]),A={ref:f};return t(c).createElement(WF.Provider,{value:v},t(c).createElement(ic,{value:Da(y,{0:nc.Open,1:nc.Closed})},null!=o&&null!=m&&zf({[o]:m}).map((([e,n])=>t(c).createElement(cl,{features:ll.Hidden,...Ga({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:n})}))),Ua({ourProps:A,theirProps:p,slot:C,defaultTag:JF,name:"Listbox"})))})),YF=Va((function(e,t){var n;let[r,i]=qF("Listbox.Button"),o=$a(r.buttonRef,t),s=`headlessui-listbox-button-${al()}`,a=Ic(),l=Qa((e=>{switch(e.key){case el.Space:case el.Enter:case el.ArrowDown:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Md.First})}));break;case el.ArrowUp:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Md.Last})}))}})),u=Qa((e=>{if(e.key===el.Space)e.preventDefault()})),d=Qa((e=>{if(tl(e.currentTarget))return e.preventDefault();0===r.listboxState?(i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),i({type:0}))})),p=zF((()=>{if(r.labelRef.current)return[r.labelRef.current.id,s].join(" ")}),[r.labelRef.current,s]),h=(0,c.useMemo)((()=>({open:0===r.listboxState,disabled:r.disabled,value:r.propsRef.current.value})),[r]),f=e;return Ua({ourProps:{ref:o,id:s,type:Rd(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.optionsRef.current)?void 0:n.id,"aria-expanded":r.disabled?void 0:0===r.listboxState,"aria-labelledby":p,disabled:r.disabled,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:f,slot:h,defaultTag:"button",name:"Listbox.Button"})})),XF=Va((function(e,t){let[n]=qF("Listbox.Label"),r=`headlessui-listbox-label-${al()}`;return Ua({ourProps:{ref:$a(n.labelRef,t),id:r,onClick:Qa((()=>{var e;return null==(e=n.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))},theirProps:e,slot:(0,c.useMemo)((()=>({open:0===n.listboxState,disabled:n.disabled})),[n]),defaultTag:"label",name:"Listbox.Label"})})),$F=za.RenderStrategy|za.Static,ZF=Va((function(e,t){var n;let[r,i]=qF("Listbox.Options"),o=$a(r.optionsRef,t),s=`headlessui-listbox-options-${al()}`,a=Ic(),l=Ic(),u=rc(),d=null!==u?u===nc.Open:0===r.listboxState;(0,c.useEffect)((()=>{var e;let t=r.optionsRef.current;!t||0===r.listboxState&&t!==(null==(e=pl(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})}),[r.listboxState,r.optionsRef]);let p=Qa((e=>{switch(l.dispose(),e.key){case el.Space:if(""!==r.searchQuery)return e.preventDefault(),e.stopPropagation(),i({type:5,value:e.key});case el.Enter:if(e.preventDefault(),e.stopPropagation(),null!==r.activeOptionIndex){let{dataRef:e}=r.options[r.activeOptionIndex];r.propsRef.current.onChange(e.current.value)}0===r.propsRef.current.mode&&(i({type:1}),dl().nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})})));break;case Da(r.orientation,{vertical:el.ArrowDown,horizontal:el.ArrowRight}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Md.Next});case Da(r.orientation,{vertical:el.ArrowUp,horizontal:el.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Md.Previous});case el.Home:case el.PageUp:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Md.First});case el.End:case el.PageDown:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Md.Last});case el.Escape:return e.preventDefault(),e.stopPropagation(),i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case el.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(i({type:5,value:e.key}),l.setTimeout((()=>i({type:6})),350))}})),h=zF((()=>{var e,t,n;return null!=(n=null==(e=r.labelRef.current)?void 0:e.id)?n:null==(t=r.buttonRef.current)?void 0:t.id}),[r.labelRef.current,r.buttonRef.current]),f=(0,c.useMemo)((()=>({open:0===r.listboxState})),[r]),m=e;return Ua({ourProps:{"aria-activedescendant":null===r.activeOptionIndex||null==(n=r.options[r.activeOptionIndex])?void 0:n.id,"aria-multiselectable":1===r.propsRef.current.mode||void 0,"aria-labelledby":h,"aria-orientation":r.orientation,id:s,onKeyDown:p,role:"listbox",tabIndex:0,ref:o},theirProps:m,slot:f,defaultTag:"ul",features:$F,visible:d,name:"Listbox.Options"})})),eU=Va((function(e,t){let{disabled:n=!1,value:r,...i}=e,[o,s]=qF("Listbox.Option"),a=`headlessui-listbox-option-${al()}`,l=null!==o.activeOptionIndex&&o.options[o.activeOptionIndex].id===a,{value:u,compare:d}=o.propsRef.current,p=Da(o.propsRef.current.mode,{1:()=>u.some((e=>d(e,r))),0:()=>d(u,r)}),h=(0,c.useRef)(null),f=$a(t,h);Ka((()=>{if(0!==o.listboxState||!l||0===o.activationTrigger)return;let e=dl();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=h.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[h,l,o.listboxState,o.activationTrigger,o.activeOptionIndex]);let m=(0,c.useRef)({disabled:n,value:r,domRef:h});Ka((()=>{m.current.disabled=n}),[m,n]),Ka((()=>{m.current.value=r}),[m,r]),Ka((()=>{var e,t;m.current.textValue=null==(t=null==(e=h.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[m,h]);let g=Qa((()=>o.propsRef.current.onChange(r)));Ka((()=>(s({type:7,id:a,dataRef:m}),()=>s({type:8,id:a}))),[m,a]);let v=Qa((e=>{if(n)return e.preventDefault();g(),0===o.propsRef.current.mode&&(s({type:1}),dl().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})})))})),y=Qa((()=>{if(n)return s({type:4,focus:Md.Nothing});s({type:4,focus:Md.Specific,id:a})})),b=Qa((()=>{n||l||s({type:4,focus:Md.Specific,id:a,trigger:0})})),S=Qa((()=>{n||!l||s({type:4,focus:Md.Nothing})})),x=(0,c.useMemo)((()=>({active:l,selected:p,disabled:n})),[l,p,n]);return Ua({ourProps:{id:a,ref:f,role:"option",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,"aria-selected":p,disabled:void 0,onClick:v,onFocus:y,onPointerMove:b,onMouseMove:b,onPointerLeave:S,onMouseLeave:S},theirProps:i,slot:x,defaultTag:"li",name:"Listbox.Option"})})),tU=Object.assign(QF,{Button:YF,Label:XF,Options:ZF,Option:eU});var nU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",focusable:"false",role:"img",className:e,fill:"currentColor","aria-label":t,children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z",clipRule:"evenodd"})});const rU={en:["January","February","March","April","May","June","July","August","September","October","November","December"],it:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"]},iU=(0,c.memo)((({defaultDate:e,onChange:t,disabled:n=!1})=>{const{t:r,i18n:i}=ve(),[o,a]=(0,c.useState)(e?"string"==typeof e?fL.DateTime.fromISO(e):fL.DateTime.fromJSDate(e):fL.DateTime.now());return(0,c.useEffect)((()=>{t(o)}),[o,t]),(0,s.jsxs)("div",{className:"memori--date-selector",children:[(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(tU,{value:o,onChange:e=>{a(e)},disabled:n,name:"day",children:[(0,s.jsxs)(tU.Label,{className:"memori--date-selector__select-label",children:[r("day"),":"]}),(0,s.jsxs)(tU.Button,{"aria-label":r("day"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.day}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(nU,{})})]}),(0,s.jsx)(Wc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(tU.Options,{className:"memori--date-selector__select-options",children:[...Array(31).keys()].map((e=>(0,s.jsx)(tU.Option,{value:o.set({day:e+1}),className:"memori--date-selector__select-option",children:e+1},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(tU,{value:o,onChange:e=>{a(e)},disabled:n,name:"month",children:[(0,s.jsxs)(tU.Label,{className:"memori--date-selector__select-label",children:[r("month"),":"]}),(0,s.jsxs)(tU.Button,{"aria-label":r("month"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:rU["it"===i.language?"it":"en"][o.month-1]}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(nU,{})})]}),(0,s.jsx)(Wc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(tU.Options,{className:"memori--date-selector__select-options",children:rU["it"===i.language?"it":"en"].map((e=>(0,s.jsx)(tU.Option,{className:"memori--date-selector__select-option",value:o.set({month:rU["it"===i.language?"it":"en"].findIndex((t=>t===e))+1}),children:e},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(tU,{value:o,onChange:e=>{a(e)},disabled:n,name:"year",children:[(0,s.jsxs)(tU.Label,{className:"memori--date-selector__select-label",children:[r("year"),":"]}),(0,s.jsxs)(tU.Button,{"aria-label":r("year"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.year}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(nU,{})})]}),(0,s.jsx)(Wc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(tU.Options,{className:"memori--date-selector__select-options",children:[...Array(fL.DateTime.now().year-1899).keys()].sort(((e,t)=>t-e)).map((e=>(0,s.jsx)(tU.Option,{value:o.set({year:e+1900}),className:"memori--date-selector__select-option",children:e+1900},e)))})})]})})]})}));iU.displayName="DateSelector";var oU=iU;c=o("85Hg2");var sU=({visible:e=!1,onClose:n,minAge:r})=>{const{t:i}=ve(),[o,a]=(0,c.useState)(),[l,u]=(0,c.useState)(),[d,p]=(0,c.useState)(!1),h=(0,c.useCallback)((()=>{if(p(!0),!o)return t(Ss).error(i("requiredField")),u(i("requiredField")||"Required field"),void p(!1);if(fL.DateTime.now().diff(o,"years").years<r)return t(Ss).error(i("underageTwinSession",{age:r})),u(i("underageTwinSession",{age:r})||`You must be at least ${r} years old to interact with this Twin`),void p(!1);n(o.toJSDate().toISOString())}),[o,r,n,i]);return(0,s.jsxs)(Jc,{open:e,title:i("ageVerification"),className:"age-verification-modal",closable:!0,onClose:()=>n(),children:[(0,s.jsx)("p",{children:i("ageVerificationText",{minAge:r})}),(0,s.jsxs)("form",{className:"age-verification-form",onSubmit:e=>{e.preventDefault(),h()},children:[(0,s.jsx)("div",{className:"form-item",children:(0,s.jsxs)("fieldset",{name:"birthDate",children:[(0,s.jsx)("legend",{className:"sr-only",children:i("birthDate")}),(0,s.jsx)(oU,{defaultDate:new Date(Date.now()),onChange:e=>{a(e)}}),(0,s.jsx)("p",{className:"form-item-help",children:i("birthDateHelper")}),l&&(0,s.jsx)("p",{className:"form-item-error",children:l})]})}),(0,s.jsx)("div",{className:"form-item form-submit",children:(0,s.jsx)(La,{primary:!0,htmlType:"submit",className:"age-verification-submit",loading:d,disabled:!o,children:i("confirm")})})]})]})};c=o("85Hg2");var aU=({open:e=!1,onClose:n,className:r,title:i,description:o,children:a,footer:l,loading:u=!1,side:d="right",closable:p=!0,width:h="100%",widthMd:f="80%",widthLg:m="60%"})=>(0,s.jsx)(Wc,{appear:!0,show:e,as:t(c).Fragment,children:(0,s.jsxs)(Cc,{open:e,onClose:n,className:t(ys)("memori-drawer",r),children:[(0,s.jsx)(Wc.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)("div",{className:"memori-drawer--backdrop"})}),(0,s.jsx)("div",{className:"memori-drawer--container",children:(0,s.jsx)("div",{className:"memori-drawer--container-scrollable",children:(0,s.jsx)(Wc.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"max-w-0 opacity-0",enterTo:"max-w-100 opacity-100",leave:"ease-in duration-200",leaveFrom:"max-w-100 opacity-100",leaveTo:"max-w-0 opacity-0",children:(0,s.jsxs)(Cc.Panel,{className:t(ys)("memori-drawer--panel",{"memori-drawer--panel-left":"left"===d,"memori-drawer--with-footer":!!l}),children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n .memori-drawer--panel {\n --memori-drawer--width: ${h};\n --memori-drawer--width-lg: ${m};\n --memori-drawer--width-md: ${f};\n }\n `}}),p&&(0,s.jsx)("div",{className:"memori-drawer--close",children:(0,s.jsx)(La,{shape:"circle",outlined:!0,icon:(0,s.jsx)(Kc,{}),onClick:()=>n(!1)})}),(0,s.jsxs)(qc,{spinning:u,children:[i&&(0,s.jsx)(Cc.Title,{className:"memori-drawer--title",children:i}),o&&(0,s.jsx)(Cc.Description,{className:"memori-drawer--description",children:o}),a,l&&(0,s.jsx)("div",{className:"memori-drawer--footer",children:l})]})]})})})})]})});c=o("85Hg2");var lU=({label:e,className:n,disabled:r=!1,indeterminate:i=!1,checked:o,children:a,onChange:l,name:u,...d})=>{const p=(0,c.useRef)(null);return(0,c.useEffect)((()=>{p.current&&(p.current.indeterminate=i)}),[p,i]),(0,s.jsxs)("label",{className:t(ys)("memori-checkbox",n,{"memori-checkbox--disabled":r,"memori-checkbox--indeterminate":i}),children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{ref:p,type:"checkbox",...d,name:u,disabled:r,checked:o||i,className:"memori-checkbox--input",onChange:l}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),!!(null==e?void 0:e.length)&&(0,s.jsx)("span",{className:"memori-checkbox--text",children:e})]})};c=o("85Hg2");var cU=({className:e,value:n,displayValue:r,options:i,onChange:o,disabled:a=!1,label:l,placeholder:u})=>(0,s.jsx)("div",{className:t(ys)("memori-select",e),children:(0,s.jsxs)(tU,{value:n,onChange:e=>{o(e)},disabled:a,name:"day",children:[l&&(0,s.jsxs)(tU.Label,{className:"memori-select--label",children:[l,":"]}),(0,s.jsxs)(tU.Button,{"aria-label":l,className:"memori-select--button",children:[(0,s.jsx)("span",{className:t(ys)("memori-select--value",{"memori-select--value-placeholder":!n}),children:n?r||n:u}),(0,s.jsx)("span",{className:"memori-select--icon",children:(0,s.jsx)(nU,{})})]}),(0,s.jsx)(Wc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(tU.Options,{className:"memori-select--options",children:i.map((e=>(0,s.jsx)(tU.Option,{value:e.value,className:"memori-select--option",children:e.label},e.value)))})})]})});const uU={muteSpeaker:"@memori:muteSpeaker",microphoneMode:"@memori:microphoneMode",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",sendOnEnter:"@memori:sendOnEnter",birthDate:"@memori:birthDate",controlsPosition:"@memori:controlsPosition",hideEmissions:"@memori:hideEmissions"},dU=(e,t)=>{var n;const r=window.localStorage.getItem(null!==(n=uU[e])&&void 0!==n?n:e);if(!r)return t;try{return JSON.parse(r)}catch(e){return r}},pU=(e,t)=>{var n;window.localStorage.setItem(null!==(n=uU[e])&&void 0!==n?n:e,t.toString())},hU=[2,3,5,10,15,20,30,60];var fU=({open:e,layout:t="DEFAULT",onClose:n,microphoneMode:r="HOLD_TO_TALK",continuousSpeechTimeout:i,setMicrophoneMode:o,setContinuousSpeechTimeout:a,controlsPosition:l,setControlsPosition:c,hideEmissions:u,setHideEmissions:d,additionalSettings:p})=>{const{t:h}=ve();return(0,s.jsxs)(aU,{className:"memori-settings-drawer",open:e,onClose:n,title:h("widget.settings")||"Settings",description:h("write_and_speak.settingsHeaderLabel"),children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#microphoneMode",children:[h("write_and_speak.microphoneMode")||"Microphone mode",":"]}),(0,s.jsxs)($f,{id:"microphoneMode",name:"microphoneMode",value:r,defaultValue:r,className:"memori-settings-drawer--microphoneMode-radio",onChange:e=>{let t="CONTINUOUS"===e?"CONTINUOUS":"HOLD_TO_TALK";o(t),pU("microphoneMode",t)},children:[(0,s.jsx)($f.Option,{value:"HOLD_TO_TALK",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(La,{primary:e,children:h("write_and_speak.holdToSpeak")||"Hold to speak"})}),(0,s.jsx)($f.Option,{value:"CONTINUOUS",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(La,{primary:e,children:h("write_and_speak.continuousSpeechLabel")||"Continuous speech"})})]})]}),"CONTINUOUS"===r&&(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(cU,{label:h("write_and_speak.secondsLabel")||"Seconds",placeholder:h("write_and_speak.secondsLabel")||"Seconds",options:hU.map((e=>({value:e,label:e}))),value:i,onChange:e=>{a(e),pU("continuousSpeechTimeout",e)}})}),"TOTEM"===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#controlsPosition",children:[h("write_and_speak.controlsPosition")||"Controls",":"]}),(0,s.jsxs)($f,{id:"controlsPosition",name:"controlsPosition",value:l,defaultValue:l,className:"memori-settings-drawer--controlsposition-radio",onChange:e=>{c(e),pU("controlsPosition",e)},children:[(0,s.jsx)($f.Option,{value:"center",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(La,{primary:e,children:h("center")||"Center"})}),(0,s.jsx)($f.Option,{value:"bottom",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(La,{primary:e,children:h("bottom")||"Bottom"})})]})]}),(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(lU,{label:h("write_and_speak.hideEmissionsLabel")||"Hide emissions",name:"hideControls",checked:u,onChange:e=>{d(e.target.checked),pU("hideEmissions",e.target.checked)}})})]}),p&&(0,s.jsx)("div",{className:"memori-settings-drawer--field controls",children:p})]})};c=o("85Hg2");const mU=new Map(Object.entries({TENANT_NOT_FOUND:-1,TENANT_REGISTRATION_DISABLED:-2,TENANT_MISSING_NAME:-3,TENANT_MAX_USERS_REACHED:-4,TENANT_MAX_ADMINS_REACHED:-5,USER_NOT_CONFIRMED:-11,USER_NOT_FOUND:-12,USER_OR_PASSWORD_INVALID:-13,USER_MUST_CHANGE_PASSWORD:-14,USER_MUST_ENTER_VERIFICATION_CODE:-15,USER_MISSING_TENANT:-21,USER_MISSING_NAME:-22,USER_MISSING_PASSWORD:-23,USER_MISSING_EMAIL:-24,USER_MISSING_VERIFICATION_CODE:-25,USER_NAME_ALREADY_USED:-26,USER_PASSWORD_NOT_CONFORMING_TO_POLICY:-27,USER_EMAIL_ALREADY_USED:-28,USER_EMAIL_INVALID:-29,USER_VERIFICATION_CODE_INVALID:-30,USER_MISSING_NAME_OR_EMAIL:-31,USER_NAME_INVALID:-32,USER_HAS_ONE_OR_MORE_MEMORI:-33,USER_MISSING_NEW_PASSWORD:-34,USER_CANT_CREATE_MEMORI:-35,USER_MAX_MEMORI_REACHED:-36,USER_CANT_EDIT_INTEGRATIONS:-37,MEMORI_NOT_FOUND:-51,MEMORI_NOT_ACCESSIBLE:-52,MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN:-53,SESSION_NOT_FOUND:-101,SESSION_IS_NOT_ADMINISTRATIVE:-102,MEMORI_MISSING_CONFIGURATION:-201,MEMORI_CONFIGURATION_NOT_FOUND:-202,MEMORI_INVALID_PRIVACY_TYPE:-203,MEMORI_MISSING_PASSWORD:-204,MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS:-205,MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS:-206,MEMORI_INVALID_VOICE_TYPE:-207,MEMORI_MISSING_NAME:-208,MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS:-209,MEMORI_INVALID_ID:-210,MEMORI_NAME_ALREADY_USED:-211,MEMORI_INVALID_PIN:-212,MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION:-213,MEMORI_NO_PASSWORD_WHEN_PUBLIC:-214,MEMORI_TRANSFER_MISSING_DESTINATION_USER:-231,MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID:-232,MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT:-233,MEMORI_TRANSFER_NOTHING_TO_DO:-234,MEMORI_CONFIGURATION_CANT_BE_CHANGED:-251,MEMORI_MISSING_NEW_PASSWORD:-252,MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT:-261,MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT:-262,INTEGRATION_NOT_FOUND:-301,INTEGRATION_INVALID_TYPE:-401,INTEGRATION_ALREADY_EXISTS:-402,INTEGRATION_MEMORI_IS_NOT_PUBLIC:-403,INTEGRATION_MISSING_INVOCATION_TEXT:-404,INTEGRATION_MISSING_DEVICE_EMAILS:-405,INTEGRATION_MEMORI_IS_EMPTY:-406,INTEGRATION_MISSING_PRIVACY_POLICY:-407,INTEGRATION_MISSING_CATEGORY:-408,INTEGRATION_MISSING_DESCRIPTION:-409,INTEGRATION_INVALID_INVOCATION_TEXT:-410,INTEGRATION_GOOGLE_NO_MORE_AVAILABLE:-411,UPLOAD_REQUIRES_MULTIPART_ENCODING:-501,UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY:-502,UPLOAD_MAX_LENGTH_EXCEEDED:-503,UPLOAD_FILE_IS_EMPTY:-504,UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE:-505,UPLOAD_MISSING_FILE_NAME:-506,UPLOAD_INVALID_MEMORY_ID:-507,UPLOAD_MISSING_FILE_CONTENT:-508,ASSET_NOT_FOUND:-601,ASSET_NOT_ACCESSIBLE:-602,ASSET_MISSING_SESSION_ID:-603,ASSET_INVALID_FILE_NAME:-604,INVITATION_NOT_FOUND:-701,INVITATION_NOT_ACCESSIBLE:-702,INVITATION_ALREADY_ACCEPTED:-703,INVITATION_ALREADY_REJECTED:-704,INVITATION_MISSING_DESTINATION_EMAIL:-705,INVITATION_DESTINATION_EMAIL_INVALID:-706,INVITATION_MISSING_TAG:-707,INVITATION_MISSING_PIN:-708,INVITATION_INVALID_PIN:-709,INVITATION_INVALID_TYPE:-710,INVITATION_MISSING_DESTINATION_NAME:-711,INVITATION_TAG_PIN_CANT_BE_CHANGED:-712,INVITATION_CANT_BE_CHANGED:-713,ACTIONLOG_INVALID_USER_ID:-801,ACTIONLOG_INVALID_DATE_FROM_FORMAT:-802,ACTIONLOG_INVALID_DATE_TO_FORMAT:-803,ACTIONLOG_INVALID_MEMORI_ID:-804,CONSUMPTIONLOG_INVALID_TYPE:-901,CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT:-902,CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT:-903,CONSUMPTIONLOG_INVALID_USER_ID:-904,CONSUMPTIONLOG_INVALID_MEMORI_ID:-905}).map((([e,t])=>[t,e]))),gU=e=>{if(!e)return"error.generic";if(401===e||403===e)return"error.unauthorized";if(404===e)return"error.notFound";if(422===e)return"error.unprocessableEntity";if(500===e)return"internal server error";let t=mU.get(e);return t?`errors.${t}`:"error.generic"};var vU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"})});var yU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M15 18L9 12 15 6"})});var bU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M9 18L15 12 9 6"})});var SU=({apiURL:e,sessionID:n,memori:r,visible:i=!0,initialKnownFacts:o=[],closeDrawer:a})=>{var l;const{t:u}=ve(),d=q(e),{getKnownFactsPaginated:p,deleteKnownFact:h}=d.knownFacts,[f,m]=(0,c.useState)(o),[g,v]=(0,c.useState)(25),[y,b]=(0,c.useState)(0),[S,x]=(0,c.useState)(null!==(l=null==o?void 0:o.length)&&void 0!==l?l:0),[w,C]=(0,c.useState)(!1),A=async(e,r,i)=>{if(n||e){C(!0);try{const{knownFacts:o,count:s,...a}=await p(null!=e?e:n,null!=r?r:y,null!=i?i:g);m(null!=o?o:[]),x(null!=s?s:0),0!==a.resultCode&&(console.error(a),t(Ss).error(u(gU(a.resultCode))))}catch(e){console.error("KNOWN_FACTS/FETCH",e),m(null!=o?o:[])}C(!1)}};(0,c.useEffect)((()=>{A()}),[]);const[E,M]=(0,c.useState)(!1),[_,T]=(0,c.useState)(),[I,R]=(0,c.useState)([]);return(0,s.jsxs)(aU,{open:i,width:"80%",className:"memori-known-facts-drawer",onClose:()=>a(),title:u("knownFacts.title"),children:[(0,s.jsx)("p",{children:u("knownFacts.description",{memoriName:r.name})}),(0,s.jsxs)(qc,{spinning:w,children:[(0,s.jsxs)("div",{className:"memori-known-facts-actions",children:[(0,s.jsxs)(La,{primary:!0,danger:!0,onClick:()=>{M(!0)},className:"memori-known-facts-delete-selected",disabled:0===(null==I?void 0:I.length),icon:(0,s.jsx)(vU,{}),loading:w,children:[u("selected")," (",null==I?void 0:I.length,")"]}),(0,s.jsx)(Jc,{className:"memori-known-facts-modal",open:E,closable:!0,title:I.length>1?u("knownFacts.deleteSelectedConfirmTitle"):u("knownFacts.deleteConfirmTitle"),description:I.length>1?u("knownFacts.deleteSelectedConfirmMessage",{number:I.length}):u("knownFacts.deleteConfirmMessage"),onClose:()=>{M(!1)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(La,{ghost:!0,onClick:()=>{M(!1)},children:u("cancel")}),(0,s.jsx)(La,{primary:!0,danger:!0,onClick:async()=>{try{const e=I.map((e=>h(n,e)));Promise.all(e).then((e=>{if(e.every((e=>0===e.resultCode)))t(Ss).success(u("knownFacts.deleteSuccess")),R([]),A(),M(!1);else{let n=e.find((e=>0!==e.resultCode));console.error(n),void 0!==(null==n?void 0:n.resultCode)&&t(Ss).error(u(gU(null==n?void 0:n.resultCode)))}}))}catch(e){let n=e;t(Ss).error(u("Error")+n.message)}},children:u("confirm")})]})})]}),S>25&&(0,s.jsxs)("nav",{className:"memori--table--pagination",children:[S>g&&(0,s.jsxs)("div",{className:"memori--table--pagination--pages",children:[(0,s.jsx)(La,{shape:"circle",disabled:0===y||y<g,padded:!1,title:u("previous")||"Previous",icon:(0,s.jsx)(yU,{}),onClick:()=>{let e=(y/g-1)*g;b(e),A(void 0,e,g)}}),(0,s.jsxs)("span",{className:"memori--table--pagination--pages--current",children:[Math.ceil(y/g)+1," /"," ",Math.ceil(S/g)]}),(0,s.jsx)(La,{shape:"circle",padded:!1,title:u("next")||"Next",icon:(0,s.jsx)(bU,{}),disabled:(y/g+1)*g>=S,onClick:()=>{let e=(y/g+1)*g;b(e),A(void 0,e,g)}})]}),(0,s.jsx)(cU,{options:[{label:`25 / ${u("page")||"page"}`,value:25},{label:`50 / ${u("page")||"page"}`,value:50},{label:`100 / ${u("page")||"page"}`,value:100}],value:g,displayValue:`${g} / ${u("page")||"page"}`,onChange:e=>{v(e),b(0),A(void 0,0,e)}})]}),(0,s.jsxs)("table",{className:"memori--table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(lU,{checked:!!(null==f?void 0:f.length)&&(null==I?void 0:I.length)===f.length,indeterminate:!!(null==f?void 0:f.length)&&!!(null==I?void 0:I.length)&&(null==I?void 0:I.length)!==(null==f?void 0:f.length),onChange:e=>{e.target.checked?R(f.map((e=>e.knownFactID))):R([])}})}),(0,s.jsx)("th",{children:u("knownFacts.text")}),(0,s.jsx)("th",{className:"mobile-hidden",children:u("createdAt")}),(0,s.jsx)("th",{className:"memori--table--column-right",children:u("actions")})]})}),(0,s.jsx)("tbody",{children:f.map((e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(lU,{checked:null==I?void 0:I.includes(e.knownFactID),onChange:t=>{t.target.checked?R((t=>[...new Set([...t,e.knownFactID])])):R((t=>t.filter((t=>t!==e.knownFactID))))}})}),(0,s.jsx)("td",{children:e.text}),(0,s.jsx)("td",{className:"mobile-hidden",children:(0,s.jsx)("span",{className:"memori--table--date",children:e.creationTimestamp?new Intl.DateTimeFormat("it",{dateStyle:"short",timeStyle:"short"}).format(new Date(e.creationTimestamp)):"-"})}),(0,s.jsx)("td",{className:"memori--table--column-right",children:(0,s.jsxs)("div",{className:"memori--table--action-column",children:[(0,s.jsx)(La,{danger:!0,ghost:!0,shape:"circle",icon:(0,s.jsx)(vU,{}),disabled:(null==I?void 0:I.length)>0,title:u("delete")||"Delete",onClick:()=>T(e.knownFactID)}),(0,s.jsx)(Jc,{className:"memori-known-facts-modal",open:_===e.knownFactID,closable:!0,title:u("knownFacts.deleteConfirmTitle"),description:u("knownFacts.deleteConfirmMessage"),onClose:()=>{T(void 0)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(La,{ghost:!0,onClick:()=>{T(void 0)},children:u("cancel")}),(0,s.jsx)(La,{primary:!0,danger:!0,onClick:async()=>{try{const r=await h(n,e.knownFactID);0===r.resultCode?(t(Ss).success(u("knownFacts.deleteSuccess")),R([]),A(),T(void 0)):(console.error(r),t(Ss).error(u(gU(r.resultCode),{ns:"common"})))}catch(e){let n=e;t(Ss).error(u("Error")+n.message)}},children:u("confirm")})]})})]})})]},e.knownFactID)))})]})]})]})};var xU=({open:e=!1,baseUrl:t,apiUrl:n,tenant:r,experts:i,onClose:o})=>{const{t:a}=ve();return(0,s.jsx)(aU,{open:e,onClose:o,className:"memori--experts-drawer",title:(0,s.jsx)("h2",{className:"memori--experts-drawer--title",children:a("widget.expertsInTheBoard")}),children:(0,s.jsx)("ul",{className:"memori--experts-drawer--list",children:i.map((e=>(0,s.jsxs)("li",{className:"memori--experts-drawer--item",children:[(0,s.jsx)("figure",{className:"memori--experts-drawer--avatar",children:(0,s.jsx)("img",{src:`${n}/api/v1/memoriai/memori/avatar/${e.expertMemoriID}`,alt:e.name,onError:e=>{e.currentTarget.src=wd({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:t}),e.currentTarget.onerror=null}})}),(0,s.jsxs)("div",{className:"memori--experts-drawer--content",children:[(0,s.jsx)("h3",{className:"memori--experts-drawer--name",children:e.name}),(0,s.jsx)("p",{className:"memori--experts-drawer--description",children:e.description})]})]},e.expertID)))})})};var wU=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(qc,{spinning:g,children:[m&&d&&p&&(0,s.jsx)(d,{...p}),e&&t&&(0,s.jsx)(e,{...t}),(0,s.jsxs)("div",{className:"memori--grid",children:[(0,s.jsxs)("div",{className:"memori--grid-column memori--grid-column-left",children:[n&&r&&(0,s.jsx)(n,{...r}),(0,s.jsx)("div",{id:"extension"})]}),(0,s.jsx)("div",{className:"memori--grid-column memori--grid-column-right",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null}),v]})]})]});var CU=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(qc,{spinning:g,className:"memori-totem-layout",children:[v,m&&d&&p&&(0,s.jsx)(d,{...p}),(0,s.jsx)("div",{className:"memori-totem-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{className:"memori-totem-layout--avatar",children:n&&r&&(0,s.jsx)(n,{...r})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-totem-layout--controls",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]});var AU=({Header:e,headerProps:t,Chat:n,chatProps:r,StartPanel:i,startPanelProps:o,integrationStyle:a,integrationBackground:l,ChangeMode:c,changeModeProps:u,sessionId:d,hasUserActivatedSpeak:p,showInstruct:h=!1,loading:f=!1,poweredBy:m})=>(0,s.jsxs)(s.Fragment,{children:[a,l,(0,s.jsxs)(qc,{spinning:f,className:"memori-chat-layout",children:[m,h&&c&&u&&(0,s.jsx)(c,{...u}),(0,s.jsx)("div",{className:"memori-chat-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-chat-layout--controls",children:d&&p&&n&&r?(0,s.jsx)(n,{...r}):o?(0,s.jsx)(i,{...o}):null})]})]});c=o("85Hg2"),c=o("85Hg2");var EU=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>{var y,b;const{t:S}=ve(),[x,w]=(0,c.useState)(!0),[C,A]=(0,c.useState)(),E=(0,c.useMemo)((()=>null==o?void 0:o.stopAudio),[null==o?void 0:o.stopAudio]),M=e=>{w(e),A(e?void 0:(new Date).toISOString());try{null==E||E()}catch(e){console.log(e)}};return(0,s.jsx)("div",{className:"memori-website_assistant--"+(x?"collapsed":"expanded"),children:x?(0,s.jsx)("div",{className:"memori-website_assistant--trigger",children:(0,s.jsx)(La,{className:"memori-website_assistant--trigger-button",ghost:!0,shape:"circle",onClick:()=>M(!1),title:S("expand")||"Expand",children:(0,s.jsx)(nN,{avatar:null==r?void 0:r.memori.avatarURL})})}):(0,s.jsxs)(s.Fragment,{children:[u,(0,s.jsxs)(qc,{spinning:g,className:"memori-website_assistant-layout",children:[v,(0,s.jsx)("div",{className:"memori-website_assistant--close-button-wrapper",children:(0,s.jsx)(La,{className:"memori-website_assistant--close-button",primary:!0,shape:"circle",onClick:()=>M(!0),icon:(0,s.jsx)(Kc,{}),title:S("close")||"Close"})}),m&&d&&p&&(0,s.jsx)(d,{...p}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--header",children:e&&t&&(0,s.jsx)(e,{...t,showSettings:!1,showReload:!1})}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--avatar",children:n&&r&&(0,c.createElement)(n,{...r,integrationConfig:r.integrationConfig?{...r.integrationConfig,avatarURL:(null===(y=r.integrationConfig)||void 0===y?void 0:y.avatarURL)?`${null===(b=r.integrationConfig)||void 0===b?void 0:b.avatarURL.split("#")[0]}#${C}`:void 0}:{},key:C})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--controls",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]})})};const{deleteSession:MU,getStatistics:_U,initSession:TU}=q(),IU=new Map([[0,"🆕"],[10,"🐹"],[20,"🐇"],[30,"🐰"],[40,"💡"],[50,"🏆"],[60,"🏅"],[70,"🥉"],[80,"🥈"],[90,"🥇"],[100,"🔥"],[110,"🎓"],[120,"🤖"],[130,"👾"],[150,"🌍"],[180,"💜"],[200,"💙"],[250,"🧡"],[300,"💚"],[350,"💛"],[400,"💖"],[450,"💝"],[500,"🖤"],[550,"❤️"],[600,"🧠"]]),RU=e=>{const t=Array.from(IU.keys()).filter((t=>t<=e));if(t.length>0){const e=t[t.length-1];return IU.get(e)}return""},PU=e=>{if("🆕"===e)return{points:10,badge:"🐹"};let t,n,r=!1;for(const[i,o]of IU){if(r){t=i,n=o;break}o===e&&(r=!0)}return n&&t?{points:t,badge:n}:void 0},kU=e=>{let t=0;for(const[n,r]of IU)if(r===e){t=n;break}return t},OU=e=>{const t=Math.round(e),n=RU(t);return{points:t,badge:n,pointsForCurrentBadge:kU(n),nextBadge:PU(n)}},NU=(e,t=!0,n=!1,r,i=!1,o=!1)=>{const s=new CustomEvent("MemoriTextEntered",{detail:{text:e,waitForPrevious:t,hidden:n,typingText:r,useLoaderTextAsMsg:i,hasBatchQueued:o}});document.dispatchEvent(s);window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak"))}),300)};let LU,DU,BU,zU,FU,UU;window.getMemoriState=e=>{var t,n,r,i,o;let s=e?document.querySelector(`.memori-widget[data-memori-integration="${e}"]`)||(null===(n=null===(t=document.querySelector("memori-client"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector(".memori-widget[data-memori-integration]")):document.querySelector(".memori-widget")||(null===(i=null===(r=document.querySelector("memori-client"))||void 0===r?void 0:r.shadowRoot)||void 0===i?void 0:i.querySelector(".memori-widget"));if(!s)return null;let a=null===(o=s.dataset)||void 0===o?void 0:o.memoriEngineState;return a?JSON.parse(a):null},window.typeMessage=NU,window.typeMessageHidden=(e,t=!0,n,r=!1,i=!1)=>NU(e,t,!0,n,r,i),window.typeBatchMessages=e=>{function t(){var e,t,n,r;null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e||e.setAttribute("disabled","");const i="opacity: 0.5; touch-action: none; pointer-events: none;";null===(t=document.querySelector("textarea.memori-chat-textarea--input"))||void 0===t||t.setAttribute("style",i),null===(n=document.querySelector("button.memori-chat-inputs--send"))||void 0===n||n.setAttribute("style",i),null===(r=document.querySelector("button.memori-chat-inputs--mic"))||void 0===r||r.setAttribute("style",i)}function n(){var e,t,n,r;null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e||e.removeAttribute("disabled"),null===(t=document.querySelector("textarea.memori-chat-textarea--input"))||void 0===t||t.removeAttribute("style"),null===(n=document.querySelector("button.memori-chat-inputs--send"))||void 0===n||n.removeAttribute("style"),null===(r=document.querySelector("button.memori-chat-inputs--mic"))||void 0===r||r.removeAttribute("style")}function r(){var e;return!!(null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e?void 0:e.hasAttribute("disabled"))}const i=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent),o=function*(){yield*e}();t();const s=()=>{const e=o.next(),a=e.value;if(a){r()||t();let o=a.waitForPrevious;i&&(o=!1),NU(a.message,o,a.hidden,a.typingText,a.useLoaderTextAsMsg,!e.done),i&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak")),n()}),3e3)}else r()&&n();if(e.done)return document.removeEventListener("MemoriEndSpeak",s),void(r()&&n())};document.addEventListener("MemoriEndSpeak",s),s()};let jU=!1,HU=!1;var VU=({memori:e,memoriConfigs:n,memoriLang:r,multilingual:i,integration:o,layout:a="DEFAULT",customLayout:l,showInstruct:u=!1,showShare:d,preview:p=!1,embed:h=!1,showInputs:f=!0,showDates:m=!1,showContextPerLine:g=!1,showSettings:v=!0,showTypingText:y=!1,showClear:b=!1,showOnlyLastMessages:S,height:x="100vh",secret:w,baseUrl:C="https://aisuru.com",apiUrl:A="https://backend.memori.ai",initialContextVars:E,initialQuestion:M,ogImage:_,sessionID:T,tenant:I,personification:R,authToken:P,AZURE_COGNITIVE_SERVICES_TTS_KEY:k,onStateChange:O,additionalInfo:N,additionalSettings:L,customMediaRenderer:D,userAvatar:B})=>{var z,F,U,j,H,V,G,W,K,J,Q,Y,X,$,Z,ee,te,ne,re,ie,oe,se;const{t:ae,i18n:le}=ve(),[ce,ue]=(0,c.useState)(!1);(0,c.useEffect)((()=>{ue(!0)}),[]);const de=q(A),{initSession:pe,postTextEnteredEvent:he,postPlaceChangedEvent:fe,postTimeoutEvent:me,postTagChangedEvent:ge,getSession:ye,getContentQualityIndexes:be,getExpertReferences:Se}=de,[xe,we]=(0,c.useState)(!1),[Ce,Ae]=(0,c.useState)(null!==(z=null==N?void 0:N.loginToken)&&void 0!==z?z:P),[Ee,Me]=(0,c.useState)({avatarURL:"string"==typeof B?B:void 0});(0,c.useEffect)((()=>{Ce&&de.backend.getCurrentUser(Ce).then((({user:e,resultCode:t})=>{e&&0===t&&Me(e)}))}),[Ce]);const[_e,Te]=(0,c.useState)(!1),[Ie,Re]=(0,c.useState)(!1),Pe=(null===(j=null===(U=null===(F=e.culture)||void 0===F?void 0:F.split("-"))||void 0===U?void 0:U[0])||void 0===j?void 0:j.toUpperCase())||(null===(W=null===(G=null===(V=null===(H=null==n?void 0:n.find((t=>t.memoriConfigID===e.memoriConfigurationID)))||void 0===H?void 0:H.culture)||void 0===V?void 0:V.split("-"))||void 0===G?void 0:G[0])||void 0===W?void 0:W.toUpperCase()),ke=(null==o?void 0:o.customData)?JSON.parse(o.customData):null,Oe=void 0!==i?i:!!(null==ke?void 0:ke.multilanguage),[Ne,Le]=(0,c.useState)(null!==(Y=null!==(Q=null!==(J=null!==(K=null!=r?r:null==ke?void 0:ke.lang)&&void 0!==K?K:Pe)&&void 0!==J?J:null==ke?void 0:ke.uiLang)&&void 0!==Q?Q:le.language)&&void 0!==Y?Y:"IT"),[De,Be]=(0,c.useState)(!1),[ze,Fe]=(0,c.useState)(!1),[Ue,je]=(0,c.useState)(),He=a||(null==ke?void 0:ke.layout)||"DEFAULT",[Ve,Ge]=(0,c.useState)(!1),[We,qe]=(0,c.useState)(!1),[Ke,Je]=(0,c.useState)(!1),[Qe,Ye]=(0,c.useState)(!1),[Xe,$e]=(0,c.useState)(!1),[Ze,et]=(0,c.useState)(!1),[tt,nt]=(0,c.useState)(!1),[rt,it]=(0,c.useState)(!1),[ot,st]=(0,c.useState)(2),[at,lt]=(0,c.useState)(!1),[ct,ut]=(0,c.useState)("center"),[dt,pt]=(0,c.useState)(!1);(0,c.useEffect)((()=>{lt(!!BU),HU=!!BU}),[BU]),(0,c.useEffect)((()=>{let e="bottom",t=dU("microphoneMode","HOLD_TO_TALK");window.innerWidth<=768?(e="bottom",t="HOLD_TO_TALK"):e=window.matchMedia("(orientation: portrait)").matches||window.innerHeight>window.innerWidth?"center":"bottom",nt(dU("muteSpeaker",!1)),jU=dU("muteSpeaker",!1),it("CONTINUOUS"===t),st(dU("continuousSpeechTimeout",2)),ut(dU("controlsPosition",e)),pt(dU("hideEmissions",!1))}),[]);const[ht,ft]=(0,c.useState)(w),[mt,gt]=(0,c.useState)(),[vt,yt]=(0,c.useState)(null),[bt,St]=(0,c.useState)(),xt=async(e,t)=>{var n;const r=null!=t?t:Dt;if(e&&r){const{currentState:t,...i}=await fe({sessionId:r,placeName:e.placeName,latitude:e.latitude,longitude:e.longitude,uncertaintyKm:null!==(n=e.uncertainty)&&void 0!==n?n:0});t&&0===i.resultCode&&Ut({...zt,...t})}},[wt,Ct]=(0,c.useState)(""),[At,Et]=(0,c.useState)(!1),[Mt,_t]=(0,c.useState)([]),Tt=e=>{_t((t=>{var n,r;return[...t,{...e,media:null!==(r=null===(n=e.media)||void 0===n?void 0:n.filter((e=>{var t;return!("text/javascript"===e.mimeType&&(null===(t=e.properties)||void 0===t?void 0:t.executable))})))&&void 0!==r?r:[]}]}))},It=async(n,r,i,o=!0,s,a=!1,l,c=!1,u=!1)=>{var d,p,h,f;const m=i||Dt||(null===(d=window.getMemoriState())||void 0===d?void 0:d.sessionID);if(!m||!(null==n?void 0:n.length))return;a||Tt({text:n,translatedText:s,fromUser:!0,media:null!=r?r:[],initial:Dt?!!i&&i!==Dt:!!i}),Fe(!0),je(l);let g=n,v=!1;if(o&&!xe&&Oe&&Ne.toUpperCase()!==Pe.toUpperCase()){g=(await lp(n,Pe,Ne,C)).text}const{currentState:y,...b}=await he({sessionId:m,text:g});if(0===b.resultCode&&y){const n=c&&l?l:null!==(p=y.emission)&&void 0!==p?p:null==zt?void 0:zt.emission;if("X4"===y.state&&e.giverTag){const{currentState:r,...i}=await ge(m,e.giverTag);0===i.resultCode?(Ut(r),n&&(Tt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),nn(n))):(console.error(b,i),t(Ss).error(ae(gU(i.resultCode))),v=!0)}else if("X2d"===y.state&&e.giverTag){const{currentState:r,...i}=await he({sessionId:m,text:Math.random().toString().substring(2,8)});if(0===i.resultCode){const{currentState:r,...i}=await ge(m,e.giverTag);0===i.resultCode?(Ut(r),n&&(Tt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),nn(n))):(console.error(b,i),t(Ss).error(ae(gU(i.resultCode))),v=!0)}else console.error(b,i),t(Ss).error(ae(gU(i.resultCode))),v=!0}else Ne.toLowerCase()!==Pe.toLowerCase()&&n&&!xe&&Oe?Rt(y,Ne).then((e=>{e.emission&&nn(e.emission)})):(Ut({...y,emission:n}),n&&(Tt({text:n,emitter:y.emitter,media:y.media,fromUser:!1,generatedByAI:!!y.completion}),nn(n)))}else 404===b.resultCode&&(_t((e=>[...e.slice(0,e.length-1)])),Ht(!1,ht||e.secretToken,mt,xe&&e.giverTag?e.giverTag:void 0,xe&&e.giverPIN?e.giverPIN:void 0,{PATHNAME:window.location.pathname,ROUTE:(null===(f=null===(h=window.location.pathname)||void 0===h?void 0:h.split("/"))||void 0===f?void 0:f.pop())||"",...E||{}},M).then((e=>{console.info("session timeout"),(null==e?void 0:e.sessionID)&&setTimeout((()=>{It(n,r,null==e?void 0:e.sessionID)}),500)})));u||(je(void 0),Fe(!1))},Rt=async(e,t)=>{var n,r,i;const o=null!==(n=e.emission)&&void 0!==n?n:null==zt?void 0:zt.emission;let s={...e},a=null;if(o&&!xe&&Pe.toUpperCase()!==t.toUpperCase()&&Oe){const n=await lp(o,t,Pe,C);if(e.hints&&e.hints.length>0){const i=await Promise.all((null!==(r=e.hints)&&void 0!==r?r:[]).map((async e=>{var n;const r=await lp(e,t,Pe,C);return{text:null!==(n=null==r?void 0:r.text)&&void 0!==n?n:e,originalText:e}})));s={...e,emission:n.text,translatedHints:i}}else s={...e,emission:n.text,hints:null!==(i=e.hints)&&void 0!==i?i:"G1"===e.state?null==zt?void 0:zt.hints:[]};n.text.length>0&&(a={text:n.text,emitter:e.emitter,media:e.media,fromUser:!1,generatedByAI:!!e.completion})}else s={...e,emission:o},o&&(a={text:o,emitter:e.emitter,media:e.media,fromUser:!1});return Ut(s),a&&Tt(a),s},Pt=void 0!==e.ageRestriction?e.ageRestriction:e.nsfw?18:e.enableCompletions?14:0,[kt,Ot]=(0,c.useState)(),[Nt,Lt]=(0,c.useState)(!1),[Dt,Bt]=(0,c.useState)(T),[zt,Ft]=(0,c.useState)(),Ut=e=>{var t;Ft(e),O&&O(e);const n=null===(t=null==e?void 0:e.media)||void 0===t?void 0:t.filter((e=>{var t;return"text/javascript"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)}));null==n||n.forEach((e=>{try{setTimeout((()=>{var t;console.log("snippet",e),new Function(null!==(t=e.content)&&void 0!==t?t:"")(),setTimeout((()=>{var e,t,n;null===(e=document.querySelector(".memori-chat--content"))||void 0===e||e.scrollTo(0,null!==(n=null===(t=document.querySelector(".memori-chat--content"))||void 0===t?void 0:t.scrollHeight)&&void 0!==n?n:0)}),400)}),1e3)}catch(e){console.error(e)}}))},jt=async n=>{var r,i,o,s,a;let l=dU("birthDate",void 0);if(kt||l||!Pt)if("PUBLIC"===e.privacyType||e.secretToken||ht||mt){Be(!0);try{if(!e.giverTag&&(null===(r=e.receivedInvitations)||void 0===r?void 0:r.length)){let t=e.receivedInvitations.find((e=>"GIVER"===e.type&&"ACCEPTED"===e.state));t&&(e.giverTag=t.tag,e.giverPIN=t.pin)}let l;try{l=window.location.href}catch(e){console.error(e)}const c=await pe({...n,tag:null!==(i=n.tag)&&void 0!==i?i:null==R?void 0:R.tag,pin:null!==(o=n.pin)&&void 0!==o?o:null==R?void 0:R.pin,additionalInfo:{...N||{},loginToken:null!==(a=null!==(s=null==N?void 0:N.loginToken)&&void 0!==s?s:Ce)&&void 0!==a?a:P,language:$t(Ne),referral:l}});if((null==c?void 0:c.sessionID)&&(null==c?void 0:c.currentState)&&0===c.resultCode)return Bt(c.sessionID),bt&&xt(bt,c.sessionID),Be(!1),{dialogState:c.currentState,sessionID:c.sessionID};(null==c?void 0:c.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(c),t(Ss).error(ae("underageTwinSession",{age:Pt})),Re(!0)):403===(null==c?void 0:c.resultCode)?(ft(void 0),yt("password")):(console.error(c),t(Ss).error(ae(gU(null==c?void 0:c.resultCode))),Re(!0))}catch(e){console.error(e),new Error("Error fetching session")}}else yt("password");else Lt(!0)},Ht=async(n=!1,r,i,o,s,a,l,c)=>{var u,d,p,h,f;Be(!0);try{let m,g=dU("birthDate",void 0);if(!c&&!g&&Pt)return void Lt(!0);if(!("PUBLIC"===e.privacyType||r||e.secretToken||ht||i||mt))return void yt("password");try{m=window.location.href}catch(e){console.error(e)}const{sessionID:v,currentState:y,...b}=await pe({memoriID:null!==(u=e.engineMemoriID)&&void 0!==u?u:"",password:r||ht||e.secretToken,recoveryTokens:i||mt,tag:o,pin:s,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(p=null===(d=window.location.pathname)||void 0===d?void 0:d.split("/"))||void 0===p?void 0:p.pop())||"",...a||{}},initialQuestion:l,birthDate:c||g||void 0,additionalInfo:{...N||{},loginToken:null!==(f=null!==(h=null==N?void 0:N.loginToken)&&void 0!==h?h:Ce)&&void 0!==f?f:P,language:$t(Ne),referral:m}});if(v&&y&&0===b.resultCode)return Bt(v),n&&(Ut(y),y.emission&&(Mt.length<=1?_t([{text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}]):Tt({text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}))),bt&&xt(bt,v),Be(!1),{dialogState:y,sessionID:v};(null==b?void 0:b.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(b),t(Ss).error(ae("underageTwinSession",{age:Pt})),Re(!0)):403===(null==b?void 0:b.resultCode)?(ft(void 0),yt("password")):(console.error(b),t(Ss).error(ae(gU(b.resultCode))),Re(!0))}catch(e){console.error(e)}return Be(!1),null},Vt=async(t,n,r,i)=>{var o,s,a,l,c;if(!t||!n)return console.error("CHANGETAG/Session not found"),Promise.reject("Session not found");try{const{currentState:t,resultCode:u}=await ge(n,null!=r?r:up);if(0===u){let d=0;if(r!==up&&i&&("X1a"===t.state||"X1b"===t.state)){const{resultCode:e}=await he({sessionId:n,text:null!=i?i:""});d=e}if(0===d){const{currentState:e,...t}=await ye(n);if(0===t.resultCode&&e)return{currentState:e,sessionId:n,...t}}else if([400,401,403,404,500].includes(u)){console.warn("[APPCONTEXT/CHANGETAG]",u);let t,n=dU("birthDate",void 0);try{t=window.location.href}catch(e){console.error(e)}jt({memoriID:null!==(o=e.engineMemoriID)&&void 0!==o?o:"",password:w||ht||e.secretToken,tag:e.giverTag,pin:e.giverPIN,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(a=null===(s=window.location.pathname)||void 0===s?void 0:s.split("/"))||void 0===a?void 0:a.pop())||"",...E||{}},initialQuestion:M,birthDate:kt||n||void 0,additionalInfo:{...N||{},loginToken:null!==(c=null!==(l=null==N?void 0:N.loginToken)&&void 0!==l?l:Ce)&&void 0!==c?c:P,language:$t(Ne),referral:t}})}else if(t)return{currentState:t,sessionId:n,resultCode:u}}}catch(e){let t=e;return console.error("[APPCONTEXT/CHANGETAG]",t),Promise.reject(t)}return null};(0,c.useEffect)((()=>()=>{zt&&(null==zt?void 0:zt.currentTag)===e.giverTag||(async()=>{Dt&&e.giverTag&&e.giverPIN&&(_t([]),await Vt(e.engineMemoriID,Dt,e.giverTag,e.giverPIN))})()}),[]);const[Gt,Wt]=(0,c.useState)(),qt=(0,c.useRef)(),Kt=()=>{Gt&&(clearTimeout(Gt),Wt(void 0)),(null==qt?void 0:qt.current)&&(clearTimeout(qt.current),qt.current=void 0)},Jt=()=>{Kt(),!(null==zt?void 0:zt.acceptsTimeout)||BU||at||wt.length||ze||At||Yt()},Qt=async()=>{var e;if(BU||at||wt.length||ze||At)Jt();else if(Dt&&Ve&&(null==zt?void 0:zt.acceptsTimeout)){const{currentState:t,...n}=await me(Dt);if(0===n.resultCode&&t){const n=t.emission;!xe&&Oe&&Ne!==(null==le?void 0:le.language)&&n&&n.length>0?Rt({...t,emission:n},Ne).then((e=>{e.emission&&nn(e.emission)})):n&&n.length>0&&(Tt({text:n,emitter:t.emitter,media:t.media,fromUser:!1,generatedByAI:!!t.completion}),nn(n),Ut({...t,hints:null!==(e=t.hints)&&void 0!==e?e:"G1"===t.state?null==zt?void 0:zt.hints:[]}))}}},Yt=()=>{let e=null==zt?void 0:zt.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==zt?void 0:zt.emission){e+=zt.emission.length/26.5}}let t=setTimeout(Qt,1e3*e);Wt(t),qt.current=t};(0,c.useEffect)((()=>{(wt.length||at||ze)&&Kt(),Dt&&!wt.length&&Jt()}),[null==zt?void 0:zt.acceptsTimeout,null==zt?void 0:zt.timeout,null==zt?void 0:zt.state,at,Dt,Mt,wt,ze]),(0,c.useEffect)((()=>()=>{Ge(!1),Te(!1),Kt(),qt.current=void 0}),[]);const Xt=(0,c.useCallback)((t=>{var n,r,i,o;let s="",a=(null!==(o=null!==(i=null!=t?t:null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])&&void 0!==i?i:le.language)&&void 0!==o?o:"IT").toUpperCase(),l=e.voiceType;if(e.enableBoardOfExperts&&(null==zt?void 0:zt.emitter)){null==Nn||Nn.find((e=>e.name===(null==zt?void 0:zt.emitter)))}switch(a){case"IT":s=""+("MALE"===l?"it-IT-DiegoNeural":"it-IT-ElsaNeural");break;case"DE":s=""+("MALE"===l?"de-DE-ConradNeural":"de-DE-KatjaNeural");break;case"EN":s=""+("MALE"===l?"en-GB-RyanNeural":"en-GB-SoniaNeural");break;case"ES":s=""+("MALE"===l?"es-ES-AlvaroNeural":"es-ES-ElviraNeural");break;case"FR":s=""+("MALE"===l?"fr-FR-HenriNeural":"fr-FR-DeniseNeural");break;case"PT":s=""+("MALE"===l?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural");break;case"UK":s=""+("MALE"===l?"uk-UA-OstapNeural":"uk-UA-PolinaNeural");break;case"RU":s=""+("MALE"===l?"ru-RU-DmitryNeural":"ru-RU-SvetlanaNeural");break;case"PL":s=""+("MALE"===l?"pl-PL-MarekNeural":"pl-PL-AgnieszkaNeural");break;case"FI":s=""+("MALE"===l?"fi-FI-HarriNeural":"fi-FI-SelmaNeural");break;default:s=""+("MALE"===l?"it-IT-DiegoNeural":"it-IT-IsabellaNeural")}return s}),[e.voiceType,e.enableBoardOfExperts,null==zt?void 0:zt.emitter,le.language,e.culture]),$t=t=>{var n,r;let i="";switch((t||(null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])||le.language||"IT").toUpperCase()){case"IT":default:i="it-IT";break;case"DE":i="de-DE";break;case"EN":i="en-GB";break;case"ES":i="es-ES";break;case"FR":i="fr-FR";break;case"PT":i="pt-PT";break;case"UK":i="uk-UK";break;case"RU":i="ru-RU";break;case"PL":i="pl-PL";break;case"FI":i="fi-FI"}return i},[Zt,en]=(0,c.useState)();(0,c.useEffect)((()=>{(async()=>{try{const e=await fetch(`${C||"https://aisuru.com"}/api/lexiconmap`);return await e.json()}catch(e){console.error(e)}})().then((e=>{en(e)}))}),[]);const tn=()=>{const e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e)},nn=e=>{if(!k||p)return void tn();if(hn(),p)return;if(tt||jU)return HU=!1,Fe(!1),tn(),void(rt&&un());zU&&zU.pause();let t=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),n=/iPad|iPhone|iPod/.test(navigator.userAgent);if("interrupted"===FU.state)return void FU.resume().then((()=>nn(e)));if("closed"===FU.state){FU=new Wo;let e=FU.createBuffer(1,1e4,22050),t=FU.createBufferSource();t.buffer=e,t.connect(FU.destination)}else if("suspended"===FU.state){rn(),FU=new Wo;let e=FU.createBuffer(1,1e4,22050),t=FU.createBufferSource();t.buffer=e,t.connect(FU.destination)}if(!BU){n||(zU=new ms.SpeakerAudioDestination);let e=ms.AudioConfig.fromSpeakerOutput(zU);BU=new ms.SpeechSynthesizer(DU,e)}const r=FU.createBufferSource();r.addEventListener("ended",(()=>{lt(!1),HU=!1})),zU.onAudioEnd=()=>{lt(!1),HU=!1,r.disconnect(),tn(),yn()},BU.speakSsmlAsync(`<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" xml:lang="${$t(Ne)}"><voice name="${Xt(Ne)}"><s>${((e,t)=>{var n;if(!Zt)return e;const r={...null!==(n=Zt.common)&&void 0!==n?n:{},...(null==I?void 0:I.id)&&Zt[I.id]?Zt[I.id]:{}},i=Object.keys(r).map((e=>{var n;return{word:e,phoneme:null!==(n=r[e][t.toLowerCase()])&&void 0!==n?n:r[e].default,caseSensitive:r[e].caseSensitive}}));return i.reduce(((e,{word:t,phoneme:n,caseSensitive:r})=>e.replace(new RegExp(`\\b${t}\\b`,r?"g":"gi"),`<phoneme alphabet="ipa" ph="${n}">${t}</phoneme>`)),e)})((e=>{const t=document.createElement("textarea");return t.textContent=e,t.innerHTML})(Sd(e)),Ne.toLowerCase())}</s></voice></speak>`,(i=>{if(i){lt(!0),HU=!0;try{FU.decodeAudioData(i.audioData,(function(e){r.buffer=e,r.connect(FU.destination),(Mt.length<1||t&&n)&&r.start(0)})),FU.onstatechange=()=>{"suspended"===FU.state||"closed"===FU.state?(r.disconnect(),lt(!1),HU=!1):"interrupted"===FU.state&&FU.resume()},FU.resume(),BU&&(BU.close(),BU=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),lt(!1),HU=!1,BU&&(BU.close(),BU=null),tn()}}else FU.resume(),lt(!1),HU=!1,tn()}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),lt(!1),HU=!1,tn()})),Fe(!1)},rn=()=>{lt(!1),HU=!1;try{BU&&(BU.close(),BU=null),"closed"!==FU.state&&FU.close(),zU&&(zU.pause(),zU.close())}catch(e){console.error("stopAudio error: ",e)}};(0,c.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==zt?void 0:zt.emission]);const[on,sn]=(0,c.useState)(""),an=()=>sn(""),[ln,cn]=(0,c.useState)(null),un=()=>{let e=setTimeout((async()=>{fn();const e=bd(on);e.length>0&&At?(It(e),an(),Ct("")):At&&Jt()}),1e3*ot);cn(e)},dn=()=>{ln&&(clearTimeout(ln),cn(null))};(0,c.useEffect)((()=>{dn(),rt&&un(),Jt()}),[on]);const pn=()=>{if(k){fn(),sn(""),an();try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){qe(!0),DU||(DU=ms.SpeechConfig.fromSubscription(k,"eastus"),DU.speechRecognitionLanguage=$t(Ne),DU.speechSynthesisLanguage=$t(Ne),DU.speechSynthesisVoiceName=Xt(Ne));const t=ms.AudioConfig.fromDefaultMicrophoneInput();LU=new ms.SpeechRecognizer(DU,t),Et(!0),LU.recognized=(e,t)=>{if(t.result.text)if(t.result.reason===ms.ResultReason.RecognizedSpeech){let e=t.result.text;if(sn(e||""),(null==e?void 0:e.length)>0){const t=bd(e);t.length>0&&Ct((e=>`${e} ${t}`))}}else t.result.reason===ms.ResultReason.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},LU.canceled=(e,t)=>{t.reason===ms.CancellationReason.Error&&(console.debug(`"CANCELED: ErrorCode=${t.errorCode}`),console.debug(`"CANCELED: ErrorDetails=${t.errorDetails}`),console.debug("CANCELED: Did you set the speech resource key and region values?")),hn()},LU.sessionStopped=(e,t)=>{hn()},an(),LU.startContinuousRecognitionAsync()})).catch(console.error)}catch(e){console.error(e)}}},hn=()=>{LU&&(LU.stopContinuousRecognitionAsync(),LU.close(),LU=null),Et(!1)},fn=()=>{qe(!1),hn(),dn()},mn=()=>{try{fn(),Kt(),Te(!1),qt.current=void 0,rn()}catch(e){console.log("Error: resetUIEffects",e)}};(0,c.useEffect)((()=>()=>{mn()}),[]),(0,c.useEffect)((()=>(document.addEventListener("MemoriResetUIEffects",mn),()=>{document.removeEventListener("MemoriResetUIEffects",mn)})),[]),(0,c.useEffect)((()=>{"Z0"===(null==zt?void 0:zt.state)&&fn()}),[null==zt?void 0:zt.state]);const[gn,vn]=(0,c.useState)(!1),yn=(0,c.useCallback)((e=>{at&&BU&&(BU.close(),BU=null),!rt||!We&&gn||(vn(!0),pn())}),[rt,We]);(0,c.useEffect)((()=>{Mt.length>1&&!at&&rt&&(We||!gn)?pn():at&&At&&hn()}),[at]),(0,c.useEffect)((()=>{At&&(fn(),an(),Ct(""),pn())}),[Pe]);const[bn,Sn]=(0,c.useState)("keypress");(0,c.useEffect)((()=>{const e=dU("sendOnEnter","keypress");window.innerWidth<=768?Sn("click"):Sn(e)}),[]),(0,c.useEffect)((()=>{pU("sendOnEnter",bn)}),[bn]);const[xn,wn]=(0,c.useState)(),Cn=null==ke?void 0:ke.globalBackground,An=Cn?`url(${Cn})`:null,En=o?{"--memori-chat-bubble-bg":"#fff",...ke&&!u?{"--memori-text-color":null!==(X=ke.textColor)&&void 0!==X?X:"#000"}:{},...(null==ke?void 0:ke.buttonBgColor)?{"--memori-button-bg":ke.buttonBgColor,"--memori-primary":ke.buttonBgColor}:{},...(null==ke?void 0:ke.buttonTextColor)?{"--memori-button-text":ke.buttonTextColor}:{},...(null==ke?void 0:ke.blurBackground)?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...(null==ke?void 0:ke.innerBgColor)?{"--memori-inner-bg":`rgba(${"dark"===ke.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==($=ke.innerBgAlpha)&&void 0!==$?$:.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===ke.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(Z=null==ke?void 0:ke.innerBgAlpha)&&void 0!==Z?Z:.4})`}:{"--memori-inner-content-pad":"0px"}}:{},Mn=`\n ${p?"#preview,":"WEBSITE_ASSISTANT"===He?"":":root,"} .memori-widget {\n ${Object.entries(En).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,_n=void 0===(null==ke?void 0:ke.showAIicon)||(null==ke?void 0:ke.showAIicon),[Tn,In]=(0,c.useState)(!1);(0,c.useEffect)((()=>{(window.innerWidth>=768&&"FULLPAGE"===He||"FULLPAGE"!==He)&&In(!0)}),[]);const[Rn,Pn]=(0,c.useState)();(0,c.useEffect)((()=>{e.engineMemoriID&&(async e=>{let t,n;try{const{contentQualityIndex:r,answerQualityIndex:i,unansweredQuestions:o,...s}=await be(e);0===s.resultCode&&(t=r,n=o)}catch(e){let t=e;console.error("[APPCONTEXT/QUERYGAMIFICATIONPOINTS]",t)}return{points:null!=t?t:0,unansweredQuestions:null!=n?n:0}})(e.engineMemoriID).then((e=>{Pn(OU(e.points))})).catch(console.error)}),[e.engineMemoriID]),(0,c.useEffect)((()=>{if(null==ke?void 0:ke.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",ke.seoTitle),document.head.append(e)}if(null==ke?void 0:ke.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",ke.seoDescription),document.head.append(e)}if(null==ke?void 0:ke.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",ke.seoUrl),document.head.append(e)}let t=_||e.avatarURL;if((null==ke?void 0:ke.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}}),[ke,e.avatarURL,_]);const kn=(0,c.useCallback)((e=>{const{text:t,waitForPrevious:n,hidden:r,typingText:i,useLoaderTextAsMsg:o,hasBatchQueued:s}=e.detail;t&&(n&&!jU&&(HU||ze)?setTimeout((()=>{kn(e)}),1e3):(hn(),rn(),It(t,void 0,void 0,void 0,void 0,r,i,o,s)))}),[Dt,at,ze,Ne]);(0,c.useEffect)((()=>(document.addEventListener("MemoriTextEntered",kn),()=>{document.removeEventListener("MemoriTextEntered",kn)})),[Dt,Ne]);const On=(0,c.useCallback)((async t=>{var n,r,i,o,s,a,l,c;const u=(null==t?void 0:t.sessionID)||Dt,d=(null==t?void 0:t.dialogState)||zt;Te(!0);let p=document.getElementById("memori-audio"),h=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome");p&&h&&(p.muted=!1,p.play().catch((e=>{console.error("error playing intro audio",e)})));let f=dU("birthDate",void 0),m=kt||f||void 0;if(u||!Pt||m){if(!u&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!ht&&!mt||!u&&Ie)return yt("password"),void Te(!1);if(!u){Te(!1),Re(!1);const t=await jt({memoriID:e.engineMemoriID,password:w||ht||e.secretToken,tag:null==R?void 0:R.tag,pin:null==R?void 0:R.pin,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(r=null===(n=window.location.pathname)||void 0===n?void 0:n.split("/"))||void 0===r?void 0:r.pop())||"",...E||{}},initialQuestion:M,birthDate:m});return void((null==t?void 0:t.dialogState)?(_t([]),Rt(t.dialogState,Ne).then((e=>{e.emission&&nn(e.emission)})).finally((()=>{Ge(!0)}))):await On(t||void 0))}if(T){const{currentState:t,...n}=await ye(u);if(0!==n.resultCode||!t)return console.debug("session expired, opening new session"),Re(!0),Bt(void 0),Te(!1),void await On();if(_t([]),xe&&e.giverTag&&(null==zt?void 0:zt.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await Vt(e.engineMemoriID,u,"-");const t=await Vt(e.engineMemoriID,u,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");Rt(t.currentState,Ne).then((e=>{e.emission&&nn(e.emission)})).finally((()=>{Ge(!0)}))}catch(t){console.error("session #2",t),Ht(!0,null==e?void 0:e.secretToken,void 0,null==e?void 0:e.giverTag,null==e?void 0:e.giverPIN,{PATHNAME:window.location.pathname,ROUTE:(null===(o=null===(i=window.location.pathname)||void 0===i?void 0:i.split("/"))||void 0===o?void 0:o.pop())||"",...E||{}},M,m).then((()=>{Ge(!0)}))}else if(!xe&&R&&(null==zt?void 0:zt.currentTag)!==R.tag)try{console.debug("change tag #3"),await Vt(e.engineMemoriID,u,"-");const t=await Vt(e.engineMemoriID,u,R.tag,R.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");Rt(t.currentState,Ne).then((e=>{e.emission&&nn(e.emission)})).finally((()=>{Ge(!0)}))}catch(t){console.error("session #5",t),Ht(!0,null==e?void 0:e.secretToken,void 0,R.tag,R.pin,{PATHNAME:window.location.pathname,ROUTE:(null===(a=null===(s=window.location.pathname)||void 0===s?void 0:s.split("/"))||void 0===a?void 0:a.pop())||"",...E||{}},M,m).then((()=>{Ge(!0)}))}else if(xe||R||(null==zt?void 0:zt.currentTag)===up)Rt(t,Ne).then((e=>{e.emission&&nn(e.emission)})).finally((()=>{Ge(!0)}));else try{console.debug("change tag #6"),await Vt(e.engineMemoriID,u,"-");const t=await Vt(e.engineMemoriID,u,up);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");Rt(t.currentState,Ne).then((e=>{e.emission&&nn(e.emission)})).finally((()=>{Ge(!0)}))}catch(t){console.error("session #8",t),Ht(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,{PATHNAME:window.location.pathname,ROUTE:(null===(c=null===(l=window.location.pathname)||void 0===l?void 0:l.split("/"))||void 0===c?void 0:c.pop())||"",...E||{}},M,m).then((()=>{Ge(!0)}))}}else _t([]),Rt(d,Ne).then((e=>{e.emission&&nn(e.emission)})).finally((()=>{Ge(!0)}))}else Lt(!0),Te(!1)}),[ht,e,mt,kt,Dt,Ne]);(0,c.useEffect)((()=>{const t=document.querySelector(`memori-client[memoriname="${e.name}"]`)||document.querySelector(`memori-client[memoriid="${e.memoriID}"]`)||document.querySelector("memori-client");if(!t)return;const n=new MutationObserver(((e,t)=>{var n,r,i;for(const t of e)"attributes"===t.type&&"authtoken"===(null===(n=t.attributeName)||void 0===n?void 0:n.toLowerCase())&&("MEMORI-CLIENT"===t.target.nodeName?Ae(t.target.getAttribute("authtoken")||void 0):Ae((null===(i=null===(r=t.target)||void 0===r?void 0:r.parentElement)||void 0===i?void 0:i.getAttribute("authtoken"))||void 0))}));return n.observe(t,{attributes:!0,childList:!1,subtree:!1}),()=>{n.disconnect()}}),[]);const[Nn,Ln]=(0,c.useState)(),Dn=(0,c.useCallback)((async()=>{if(Dt&&(null==e?void 0:e.enableBoardOfExperts))try{const{experts:e,count:t,...n}=await Se(Dt);0===n.resultCode?Ln(e):console.warn("Error fetching experts",n)}catch(e){console.warn(e)}}),[Dt,null==e?void 0:e.enableBoardOfExperts]);(0,c.useEffect)((()=>{Dn()}),[Dt,Dn]);const Bn=void 0===S?"TOTEM"!==a&&"WEBSITE_ASSISTANT"!==a:!S,zn={memori:e,tenant:I,history:Mt,showShare:null===(ee=null!=d?d:null==ke?void 0:ke.showShare)||void 0===ee||ee,position:bt,setShowPositionDrawer:Je,setShowSettingsDrawer:Ye,setShowKnownFactsDrawer:$e,setShowExpertsDrawer:et,showSpeaker:!!k,speakerMuted:tt||jU,setSpeakerMuted:e=>{if(jU=!!e,nt(e),pU("muteSpeaker",!!e),e)rn();else{FU=new Wo;let e=FU.createBuffer(1,1e4,22050),t=FU.createBufferSource();t.buffer=e,t.connect(FU.destination)}},showSettings:v,hasUserActivatedSpeak:Ve,showReload:"TOTEM"===He,showClear:b,clearHistory:()=>_t((e=>e.slice(-1))),loginToken:Ce,user:Ee,sessionID:Dt},Fn={memori:e,integration:o,integrationConfig:ke,tenant:I,instruct:xe,avatar3dVisible:Tn,setAvatar3dVisible:In,hasUserActivatedSpeak:Ve,isPlayingAudio:at&&!tt,loading:!!ze,baseUrl:C,apiUrl:A},Un={memori:e,tenant:I,gamificationLevel:Rn,language:Pe,userLang:Ne,setUserLang:Le,baseUrl:C,apiUrl:A,position:bt,openPositionDrawer:()=>Je(!0),integrationConfig:ke,instruct:xe,sessionId:Dt,clickedStart:_e,onClickStart:On,initializeTTS:()=>{if(!k)return;DU=ms.SpeechConfig.fromSubscription(k,"eastus"),DU.speechSynthesisLanguage=$t(Ne),DU.speechSynthesisVoiceName=Xt(Ne),DU.speechRecognitionLanguage=$t(Ne),vd()&&(DU.speechSynthesisOutputFormat=ms.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3),FU=new Wo;let e=FU.createBuffer(1,1e4,22050),t=FU.createBufferSource();t.buffer=e,t.connect(FU.destination),zU=new ms.SpeakerAudioDestination;let n=ms.AudioConfig.fromSpeakerOutput(zU);BU=new ms.SpeechSynthesizer(DU,n)},isUserLoggedIn:!!Ce,user:Ee},jn={memori:e,sessionID:Dt||"",tenant:I,translateTo:Oe&&Ne.toUpperCase()!==(null===(oe=null!==(ie=null!==(re=null===(ne=null===(te=e.culture)||void 0===te?void 0:te.split("-"))||void 0===ne?void 0:ne[0])&&void 0!==re?re:le.language)&&void 0!==ie?ie:"IT")||void 0===oe?void 0:oe.toUpperCase())?Ne:void 0,baseUrl:C,apiUrl:A,layout:a,memoriTyping:ze,typingText:Ue,showTypingText:y,history:Bn?Mt:Mt.slice(-2),authToken:Ce,dialogState:zt,setDialogState:Ut,pushMessage:Tt,simulateUserPrompt:(e,t)=>{hn(),rn(),It(e,void 0,void 0,!1,t)},showDates:m,showContextPerLine:g,showAIicon:_n,client:de,selectReceiverTag:async n=>{var r;if(Dt)try{const{currentState:i,...o}=await ge(Dt,n);if(0===o.resultCode)if(Tt({text:n,fromUser:!0}),"X4"===i.state&&e.giverTag){const{currentState:n,...r}=await de.postTagChangedEvent(Dt,e.giverTag);0===r.resultCode?(Ut(n),n.emission&&Tt({text:n.emission,emitter:n.emitter,media:n.media,fromUser:!1})):(console.error(r),t(Ss).error(ae(gU(r.resultCode))))}else Ut(i),i.emission&&Tt({text:i.emission,emitter:i.emitter,media:i.media,fromUser:!1});else console.error(o,n,null===(r=null==zt?void 0:zt.knownTags)||void 0===r?void 0:r[n]),t(Ss).error(ae(gU(o.resultCode)))}catch(e){let n=e;console.error(n),t(Ss).error(n.message)}},preview:p,sendOnEnter:bn,setSendOnEnter:Sn,microphoneMode:rt?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen:xn,setAttachmentsMenuOpen:wn,instruct:xe,showInputs:f,showMicrophone:!!k,userMessage:wt,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return Ct(""),void Jt();Ct(e),Kt()},sendMessage:e=>{rn(),hn(),It(e),Ct(""),an()},stopListening:fn,startListening:pn,stopAudio:rn,resetTranscript:an,listening:At,isPlayingAudio:at,customMediaRenderer:D,user:Ee,userAvatar:B,experts:Nn},Hn=o&&An?(0,s.jsx)("div",{className:"memori--global-background",children:(0,s.jsx)("div",{className:"memori--global-background-image",style:{backgroundImage:An}})}):(0,s.jsx)("div",{className:"memori--global-background no-background-image"}),Vn=o?(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:Mn}}):null,Gn={canInstruct:!!e.giverTag,instruct:!!xe,onChangeMode:e=>{we("instruct"===e),Ge(!1),Te(!1)}},Wn=(0,s.jsx)(hL,{tenant:I,userLang:Ne}),qn=l||("TOTEM"===He?CU:"CHAT"===He?AU:"FULLPAGE"===He?wU:"WEBSITE_ASSISTANT"===He?EU:wU);return(0,s.jsxs)("div",{className:t(ys)("memori","memori-widget",`memori-layout-${a.toLowerCase()}`,`memori-controls-${ct.toLowerCase()}`,`memori--avatar-${(null==ke?void 0:ke.avatar)||"default"}`,{"memori--preview":p,"memori--embed":h,"memori--with-integration":o,"memori--with-speechkey":!!k,"memori--active":Ve,"memori--hide-emissions":dt,"memori--has-active-session":!!Dt}),"data-memori-name":null==e?void 0:e.name,"data-memori-id":null==e?void 0:e.engineMemoriID,"data-memori-secondary-id":null==e?void 0:e.memoriID,"data-memori-session-id":Dt,"data-memori-integration":null==o?void 0:o.integrationID,"data-memori-engine-state":JSON.stringify({...zt,sessionID:Dt}),style:{height:x},children:[(0,s.jsx)(qn,{Header:pL,headerProps:zn,Avatar:sN,avatarProps:Fn,Chat:um,chatProps:jn,StartPanel:vm,startPanelProps:Un,integrationStyle:Vn,integrationBackground:Hn,ChangeMode:aN,changeModeProps:Gn,poweredBy:Wn,sessionId:Dt,hasUserActivatedSpeak:Ve,showInstruct:u,loading:De}),(0,s.jsx)("audio",{id:"memori-audio",style:{display:"none"},src:"https://aisuru.com/intro.mp3"}),ce&&(0,s.jsx)(gd,{withModal:!0,pwdOrTokens:vt,openModal:!!vt,setPwdOrTokens:yt,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{var n,r;t.password&&ft(t.password),t.password&&(UU=t.password),t.tokens&>(t.tokens),Ht(!Dt,t.password,t.tokens,xe?e.giverTag:null==R?void 0:R.tag,xe?e.giverPIN:null==R?void 0:R.pin,{PATHNAME:window.location.pathname,ROUTE:(null===(r=null===(n=window.location.pathname)||void 0===n?void 0:n.split("/"))||void 0===r?void 0:r.pop())||"",...E||{}},M,kt).then((e=>{yt(null),On(e||void 0)})).catch((()=>{yt(null),Re(!0)}))},minimumNumberOfRecoveryTokens:null!==(se=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==se?se:1}),ce&&(0,s.jsx)(sU,{visible:Nt,minAge:Pt,onClose:t=>{var n,r;t?(Ot(t),pU("birthDate",t),Ht(!Dt,UU||ht||(null==e?void 0:e.secretToken),mt,xe?e.giverTag:null==R?void 0:R.tag,xe?e.giverPIN:null==R?void 0:R.pin,{PATHNAME:window.location.pathname,ROUTE:(null===(r=null===(n=window.location.pathname)||void 0===n?void 0:n.split("/"))||void 0===r?void 0:r.pop())||"",...E||{}},M,t).then((e=>{Lt(!1),yt(null),On(e||void 0)})).catch((()=>{Lt(!1),Re(!0)}))):(Lt(!1),Te(!1))}}),Qe&&(0,s.jsx)(fU,{layout:He,open:!!Qe,onClose:()=>Ye(!1),microphoneMode:rt?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout:ot,setMicrophoneMode:e=>it("CONTINUOUS"===e),setContinuousSpeechTimeout:st,controlsPosition:ct,setControlsPosition:ut,hideEmissions:dt,setHideEmissions:pt,additionalSettings:L}),Xe&&Dt&&(0,s.jsx)(SU,{apiURL:A,memori:e,sessionID:Dt,visible:Xe,closeDrawer:()=>$e(!1)}),Ze&&!!Nn&&(0,s.jsx)(xU,{apiUrl:A,baseUrl:C,tenant:I,experts:Nn,open:Ze,onClose:()=>et(!1)})]})};const GU={id:"aisuru.com",theme:"aisuru",config:{name:"Memori",showNewUser:!1,requirePosition:!1}},WU=async(e,t)=>{const n=t?new URL(`${t.startsWith("http")?"":t.includes("localhost")?"http://":"https://"}${t}`).origin:"https://aisuru.com";try{const t=await fetch(`${n}/api/tenant/${e}`),{tenant:r}=await t.json();return r||{...GU,tenantID:e}}catch(t){return{...GU,tenantID:e}}};function qU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KU(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,WO(r.key),r)}}function JU(e,t,n){return t&&KU(e.prototype,t),n&&KU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function QU(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YU(e,t){return YU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},YU(e,t)}function XU(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&YU(e,t)}function $U(e,t){if(t&&("object"===VO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return QU(e)}function ZU(e){return ZU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ZU(e)}function ej(e){if(Array.isArray(e))return e}function tj(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function nj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rj(e,t){if(e){if("string"==typeof e)return nj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nj(e,t):void 0}}function ij(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function oj(e){return ej(e)||tj(e)||rj(e)||ij()}function sj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function aj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var lj={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},cj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};qU(this,e),this.init(t,n)}return JU(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||lj,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,aj(aj({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}(),uj=new cj,dj=function(){function e(){qU(this,e),this.observers={}}return JU(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function pj(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function hj(e){return null==e?"":""+e}function fj(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function mj(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function gj(e,t,n){var r=mj(e,t,Object);r.obj[r.k]=n}function vj(e,t){var n=mj(e,t),r=n.obj,i=n.k;if(r)return r[i]}function yj(e,t,n){var r=vj(e,n);return void 0!==r?r:vj(t,n)}function bj(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):bj(e[r],t[r],n):e[r]=t[r]);return e}function Sj(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var xj={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function wj(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return xj[e]})):e}var Cj="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Aj=[" ",",","?","!",";"];function Ej(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ej(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ej(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ZU(e);if(t){var i=ZU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return $U(this,n)}}function Tj(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;o<r.length;++o){if(!i)return;if("string"==typeof i[r[o]]&&o+1<r.length)return;if(void 0===i[r[o]]){for(var s=2,a=r.slice(o,o+s).join(n),l=i[a];void 0===l&&r.length>o+s;)s++,l=i[a=r.slice(o,o+s).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(a)){if("string"==typeof l)return l;if(a&&"string"==typeof l[a])return l[a]}var c=r.slice(o+s).join(n);return c?Tj(l,c,n):void 0}i=i[r[o]]}return i}}var Ij=function(e){XU(n,e);var t=_j(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return qU(this,n),r=t.call(this),Cj&&dj.call(QU(r)),r.data=e||{},r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return JU(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[e,t];n&&"string"!=typeof n&&(s=s.concat(n)),n&&"string"==typeof n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."));var a=vj(this.data,s);return a||!o||"string"!=typeof n?a:Tj(this.data&&this.data[e]&&this.data[e][t],n,i)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var s=[e,t];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(s=e.split("."))[1]),this.addNamespaces(t),gj(this.data,s,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var a=vj(this.data,s)||{};r?bj(a,n,i):a=Mj(Mj({},a),n),gj(this.data,s,a),o.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?Mj(Mj({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(dj),Rj={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}};function Pj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Oj(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ZU(e);if(t){var i=ZU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return $U(this,n)}}var Nj={},Lj=function(e){XU(n,e);var t=Oj(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return qU(this,n),r=t.call(this),Cj&&dj.call(QU(r)),fj(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,QU(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=uj.create("translator"),r}return JU(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=n&&e.indexOf(n)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=Aj.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var i=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),o=!i.test(e);if(!o){var s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o}(e,n,r));if(o&&!s){var a=e.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:e,namespaces:i};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(i=l.shift()),e=l.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,r){var i=this;if("object"!==VO(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],t),l=a.key,c=a.namespaces,u=c[c.length-1],d=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(p){var h=t.nsSeparator||this.options.nsSeparator;return o?(f.res="".concat(u).concat(h).concat(l),f):"".concat(u).concat(h).concat(l)}return o?(f.res=l,f):l}var f=this.resolve(e,t),m=f&&f.res,g=f&&f.usedKey||l,v=f&&f.exactUsedKey||l,y=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],S=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,w="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(x&&m&&w&&b.indexOf(y)<0&&("string"!=typeof S||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,kj(kj({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return o?(f.res=C,f):C}if(s){var A="[object Array]"===y,E=A?[]:{},M=A?v:g;for(var _ in m)if(Object.prototype.hasOwnProperty.call(m,_)){var T="".concat(M).concat(s).concat(_);E[_]=this.translate(T,kj(kj({},t),{joinArrays:!1,ns:c})),E[_]===T&&(E[_]=m[_])}m=E}}else if(x&&"string"==typeof S&&"[object Array]"===y)(m=m.join(S))&&(m=this.extendTranslation(m,e,t,r));else{var I=!1,R=!1,P=void 0!==t.count&&"string"!=typeof t.count,k=n.hasDefaultValue(t),O=P?this.pluralResolver.getSuffix(d,t.count,t):"",N=t["defaultValue".concat(O)]||t.defaultValue;!this.isValidLookup(m)&&k&&(I=!0,m=N),this.isValidLookup(m)||(R=!0,m=l);var L=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,D=L&&R?void 0:m,B=k&&N!==m&&this.options.updateMissing;if(R||I||B){if(this.logger.log(B?"updateKey":"missingKey",d,u,l,B?N:m),s){var z=this.resolve(l,kj(kj({},t),{},{keySeparator:!1}));z&&z.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.")}var F=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&U&&U[0])for(var j=0;j<U.length;j++)F.push(U[j]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var H=function(e,n,r){var o=k&&r!==m?r:D;i.options.missingKeyHandler?i.options.missingKeyHandler(e,u,n,o,B,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,u,n,o,B,t),i.emit("missingKey",e,u,n,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&P?F.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],l+n,t["defaultValue".concat(n)]||N)}))})):H(F,l,N))}m=this.extendTranslation(m,e,t,f,r),R&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(u,":").concat(l)),(R||I)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(l):l,I?m:void 0):this.options.parseMissingKeyHandler(m))}return o?(f.res=m,f):m}},{key:"extendTranslation",value:function(e,t,n,r,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,kj(kj({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(kj(kj({},n),{interpolation:kj(kj({},this.options.interpolation),n.interpolation)}));var s,a="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){var l=e.match(this.interpolator.nestingRegexp);s=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=kj(kj({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),a){var u=e.match(this.interpolator.nestingRegexp);s<(u&&u.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return i&&i[0]===r[0]&&!n.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):o.translate.apply(o,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,p="string"==typeof d?[d]:d;return null!=e&&p&&p.length&&!1!==n.applyPostProcessor&&(e=Rj.handle(p,e,t,this.options&&this.options.postProcessPassResolved?kj({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,o,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var l=s.extractFromKey(e,a),c=l.key;n=c;var u=l.namespaces;s.options.fallbackNS&&(u=u.concat(s.options.fallbackNS));var d=void 0!==a.count&&"string"!=typeof a.count,p=d&&!a.ordinal&&0===a.count&&s.pluralResolver.shouldUseIntlApi(),h=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,f=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);u.forEach((function(e){s.isValidLookup(t)||(o=e,!Nj["".concat(f[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(Nj["".concat(f[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(n,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((function(n){if(!s.isValidLookup(t)){i=n;var o,l=[c];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(l,c,n,e,a);else{var u;d&&(u=s.pluralResolver.getSuffix(n,a.count,a));var f="".concat(s.options.pluralSeparator,"zero");if(d&&(l.push(c+u),p&&l.push(c+f)),h){var m="".concat(c).concat(s.options.contextSeparator).concat(a.context);l.push(m),d&&(l.push(m+u),p&&l.push(m+f))}}for(;o=l.pop();)s.isValidLookup(t)||(r=o,t=s.getResource(n,e,o,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(dj);function Dj(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Bj=function(){function e(t){qU(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=uj.create("languageUtils")}return JU(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Dj(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Dj(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Dj(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var 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||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),zj=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Fj={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},Uj=["v1","v2","v3"],jj={zero:0,one:1,two:2,few:3,many:4,other:5};function Hj(){var e={};return zj.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:Fj[t.fc]}}))})),e}var Vj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};qU(this,e),this.languageUtils=t,this.options=n,this.logger=uj.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Hj()}return JU(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return jj[e]-jj[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var o=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!Uj.includes(this.options.compatibilityJSON)}}]),e}();function Gj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var qj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};qU(this,e),this.logger=uj.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return JU(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:wj,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?Sj(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?Sj(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?Sj(t.nestingPrefix):t.nestingPrefixEscaped||Sj("$t("),this.nestingSuffix=t.nestingSuffix?Sj(t.nestingSuffix):t.nestingSuffixEscaped||Sj(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,s,a=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(a.formatSeparator)<0){var i=yj(t,l,e);return a.alwaysFormat?a.format(i,void 0,n,Wj(Wj(Wj({},r),t),{},{interpolationkey:e})):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(yj(t,l,s),c,n,Wj(Wj(Wj({},r),t),{},{interpolationkey:s}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,p=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?c(a.escape(e)):c(e)}}].forEach((function(t){for(s=0;i=t.regex.exec(e);){var n=i[1].trim();if(void 0===(o=u(n)))if("function"==typeof d){var l=d(e,i,r);o="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))o="";else{if(p){o=i[0];continue}a.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),o=""}else"string"==typeof o||a.useRawValueToEscape||(o=hj(o));var c=t.safeValue(o);if(e=e.replace(i[0],c),p?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=Wj({},o);function a(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var o=(i=this.interpolate(i,s)).match(/'/g),a=i.match(/"/g);(o&&o.length%2==0&&!a||a.length%2!=0)&&(i=i.replace(/'/g,'"'));try{s=JSON.parse(i),t&&(s=Wj(Wj({},t),s))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete s.defaultValue,e}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(e);){var l=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),l=u,c=!0}if((r=t(a.call(this,n[1].trim(),s),s))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=hj(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return i.format(e,t,o.lng,Wj(Wj({},o),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function Kj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Jj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qj(e){var t={};return function(n,r,i){var o=r+JSON.stringify(i),s=t[o];return s||(s=e(r,i),t[o]=s),s(n)}}var Yj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};qU(this,e),this.logger=uj.create("formatter"),this.options=t,this.formats={number:Qj((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:Qj((function(e,t){var n=new Intl.NumberFormat(e,Jj(Jj({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:Qj((function(e,t){var n=new Intl.DateTimeFormat(e,Jj({},t));return function(e){return n.format(e)}})),relativetime:Qj((function(e,t){var n=new Intl.RelativeTimeFormat(e,Jj({},t));return function(e){return n.format(e,t.range||"day")}})),list:Qj((function(e,t){var n=new Intl.ListFormat(e,Jj({},t));return function(e){return n.format(e)}}))},this.init(t)}return JU(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=Qj(t)}},{key:"format",value:function(e,t,n,r){var i=this,o=t.split(this.formatSeparator).reduce((function(e,t){var o=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=oj(e.split(":")),r=t[0],i=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=i),"false"===i&&(n[r.trim()]=!1),"true"===i&&(n[r.trim()]=!0),isNaN(i)||(n[r.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}}(t),s=o.formatName,a=o.formatOptions;if(i.formats[s]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=i.formats[s](e,u,Jj(Jj(Jj({},a),r),c))}catch(e){i.logger.warn(e)}return l}return i.logger.warn("there was no format function for ".concat(s)),e}),e);return o}}]),e}();function Xj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zj(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ZU(e);if(t){var i=ZU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return $U(this,n)}}var eH=function(e){XU(n,e);var t=Zj(n);function n(e,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return qU(this,n),o=t.call(this),Cj&&dj.call(QU(o)),o.backend=e,o.store=r,o.services=i,o.languageUtils=i.languageUtils,o.options=s,o.logger=uj.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=s.maxParallelReads||10,o.readingCalls=0,o.maxRetries=s.maxRetries>=0?s.maxRetries:5,o.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(i,s.backend,s),o}return JU(n,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o={},s={},a={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?void 0===s[a]&&(s[a]=!0):(i.state[a]=1,r=!1,void 0===s[a]&&(s[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(a[e]=!0)})),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){var r,a,l,c,u,d;r=n.loaded,a=o,c=mj(r,[i],Object),u=c.obj,d=c.k,u[d]=u[d]||[],l&&(u[d]=u[d].concat(a)),l||u[d].push(a),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===s[e][t]&&(s[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:o,callback:s}):(this.readingCalls++,this.backend[n](e,t,(function(a,l){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}a&&l&&i<r.maxRetries?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,s)}),o):s(a,l)}))):s(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,s){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&s&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),s),t.loaded(e,r,s)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(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!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,$j($j({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(dj);function tH(){return{debug:!1,initImmediate:!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:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===VO(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===VO(e[2])||"object"===VO(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function nH(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function rH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function iH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rH(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function oH(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ZU(e);if(t){var i=ZU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return $U(this,n)}}function sH(){}function aH(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var lH=function(e){XU(n,e);var t=oH(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(qU(this,n),e=t.call(this),Cj&&dj.call(QU(e)),e.options=nH(r),e.services={},e.logger=uj,e.modules={external:[]},aH(QU(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),$U(e,QU(e));setTimeout((function(){e.init(r,i)}),0)}return e}return JU(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=tH();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=iH(iH(iH({},r),this.options),nH(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=iH(iH({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var o;this.modules.logger?uj.init(i(this.modules.logger),this.options):uj.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=Yj);var s=new Bj(this.options);this.store=new Ij(this.options.resources,this.options);var a=this.services;a.logger=uj,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new Vj(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!o||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(a.formatter=i(o),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new qj(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new eH(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new Lj(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=sH),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=pj(),p=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sH,r=n,i="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return r();var o=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(i)s(i);else{var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.forEach((function(e){return s(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=pj();return e||(e=this.languages),t||(t=this.options.ns),n||(n=sH),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(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"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Rj.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=pj();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},o=function(o){e||o||!n.services.languageDetector||(o=[]);var s="string"==typeof o?o:n.services.languageUtils.getBestMatchFromCodes(o);s&&(n.language||i(s),n.translator.language||n.translator.changeLanguage(s),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(s)),n.loadResources(s,(function(e){!function(e,o){o?(i(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,s)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,i=function e(t,i){var o;if("object"!==VO(i)){for(var s=arguments.length,a=new Array(s>2?s-2:0),l=2;l<s;l++)a[l-2]=arguments[l];o=r.options.overloadTranslationOptionHandler([t,i].concat(a))}else o=iH({},i);o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,o.keyPrefix=o.keyPrefix||n||e.keyPrefix;var c=r.options.keySeparator||".",u=o.keyPrefix?"".concat(o.keyPrefix).concat(c).concat(t):t;return r.t(u,o)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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;var r=this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var a=n.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!s(r,e)||i&&!s(o,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=pj();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=pj();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["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"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sH,i=iH(iH(iH({},this.options),t),{isClone:!0}),o=new n(i);void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t));var s=["store","services","language"];return s.forEach((function(t){o[t]=e[t]})),o.services=iH({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new Lj(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit.apply(o,[e].concat(n))})),o.init(i,r),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(dj);qO(lH,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new lH(e,t)}));var cH=lH.createInstance();cH.createInstance=lH.createInstance;var uH,dH=cH.createInstance;cH.init,cH.loadResources,cH.reloadResources,cH.use,cH.changeLanguage,cH.getFixedT,cH.t,cH.exists,cH.setDefaultNamespace,cH.hasLoadedNamespace,cH.loadNamespaces,cH.loadLanguages;uH=JSON.parse('{"yes":"Si","no":"No","confirm":"Conferma","apply":"Applica","cancel":"Annulla","show":"Mostra","hide":"Nascondi","send":"Invia","close":"Chiudi","edit":"Modifica","delete":"Elimina","loading":"Caricamento","expand":"Espandi","collapse":"Riduci","fullscreenEnter":"Passa a schermo intero","fullscreenExit":"Esci da schermo intero","center":"Centro","bottom":"In basso","hidden":"Nascosto","day":"Giorno","month":"Mese","year":"Anno","createdAt":"Data creazione","selected":"Selezionati","page":"pagina","actions":"Azioni","next":"Successivo","previous":"Precedente","copy":"Copia","copyToClipboard":"Copia negli appunti","showOriginalText":"Mostra originale","showTranslatedText":"Mostra traduzione","memoriBlockedTitle":"Bloccato","memoriBlockedUntil":"Memori bloccato fino al {{date}}","memoriBlockedAnon":"Attualmente \\"{{name}}\\" non può rispondere, torna qui il {{date}}","memoriBlockedReasonExceedChats":"perchè ha superato la soglia mensile di chat ammesse.","memoriBlockedGiverHelper":"Puoi sempre gestirlo in qualità di amministratore, ma altri utenti non potranno interrogarlo.","generatedByAI":"Risposta generata da IA, può talvolta generare informazioni non corrette","completionsEnabled":"IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette","completionProviderDown":"Questo Twin è integrato con una IA generativa di {{provider}}, ma al momento non è disponibile. Riprova più tardi.","completionProviderFallbackName":"un provider esterno","completionProviderCheckStatusPage":"Vedi pagina di stato","boardOfExperts":"Gruppo di esperti","birthDate":"Data di nascita","birthDateHelper":"Ti chiediamo la data di nascita esclusivamente per abilitare o disabilitare le funzionalità che hanno restrizioni in base all\'età","underage":"Devi avere almeno {{age}} anni per registrarti.","underageTwinSession":"Devi avere almeno {{age}} anni per interagire con questo Twin.","ageVerification":"Verifica dell\'età","ageVerificationText":"Per interagire con questo Twin, devi aver almeno {{minAge}} anni.","nsfw":"NSFW: Questo Twin contiene contenuti per adulti","deepThought":"Pensiero profondo","deepThoughtHelper":"Pensiero Profondo è una funzionalità avanzata delle AI che ti consentirà di poter sfruttare a pieno le tue conversazioni mantenendo memoria delle stesse. Le AI con Pensiero Profondo possono darti informazioni adattandosi a te e alle cose che condividerete insieme.","deepThoughtDisclaimerTitle":"Pensiero profondo abilitato","deepThoughtDisclaimer":"Pensiero Profondo è una funzionalità avanzata delle AI che ti consentirà di poter sfruttare a pieno le tue conversazioni mantenendo memoria delle stesse. Le AI con Pensiero Profondo possono darti informazioni adattandosi a te e alle cose che condividerete insieme.","deepThoughtPreDisclaimerUnlogged":"Accedi per abilitare Pensiero Profondo.","deepThoughtPreDisclaimerNotAllowed":"Pensiero Profondo è disabilitato poiché non hai acconsentito al suo utilizzo, puoi cambiare la tua scelta in qualsiasi momento nelle impostazioni del tuo account.","knownFacts":{"title":"Fatti noti","description":"Dettagli delle informazioni condivise tra te e {{memoriName}}","type":"Tipo","typeShortTerm":"Breve termine","typeLongTerm":"Lungo termine","typeHelper":"Tipi:\\n- Breve termine: questo fatto noto è sempre utilizzato durante le conversazioni\\n- Lungo termine: questo fatto noto è utilizzato durante le conversazioni solo se rilevante per la domanda corrente","text":"Testo","deleteSuccess":"Fatto noto eliminato","deleteConfirmTitle":"Elimina il fatto noto","deleteConfirmMessage":"Confermi di voler eliminare questo fatto noto?","deleteSelectedConfirmTitle":"Elimina i fatti noti selezionati","deleteSelectedConfirmMessage":"Confermi di voler eliminare i fatti noti selezionati?"},"auth":{"title":"Autenticazione","useRecoveryTokens":"Utilizza i token di recupero","tokens":"Token","addToken":"Aggiungi token","usePassword":"Utilizza la password","atLeast":"Almeno"},"widget":{"instruct":"Istruisci","test":"Prova","sound":"Audio","position":"Posizione","settings":"Impostazioni","share":"Condividi","sendOnKeypress":"Premi Invio per inviare","sendOnClick":"Clicca sul bottone di invio","boardOfExperts":"Gruppo di esperti","showExpertsInTheBoard":"Mostra gli esperti di questo gruppo","expertsInTheBoard":"Esperti di questo gruppo","goToIntegrationsToCustomizeAvatar":"Per personalizzare l\'avatar, vai a Condividimi e configura la pagina pubblica"},"write_and_speak":{"micButtonPopover":"Premi il pulsante per parlare","micButtonPopoverListening":"Premi il pulsante per smettere di parlare","pageInstructExplanation":"Per insegnarmi nuove cose clicca sul pulsante ISTRUISCIMI per cominciare","pageTryMeExplanation":"Per parlare con me clicca sul pulsante INIZIAMO per cominciare","instructButton":"ISTRUISCIMI","tryMeButton":"INIZIAMO","chatHistory":"Cronologia chat","exportChatHistory":"Esporta la cronologia chat","exportChatHistoryMessage":"Vuoi esportare la cronologia chat?","chatBotButtonText":"CLICCA QUI PER APRIRE LA CHAT","conversationStartedLabel":"Conversazione avvenuta il","settingsHeaderLabel":"Configura qui il memori se vuoi impostare una conversazione continua. Setta i secondi di silenzio prima dell\'invio.","continuousSpeechLabel":"Conversazione continua","holdToSpeak":"Tieni premuto per parlare","releaseToEndListening":"Rilascia per smettere di parlare","pressAndHoldToSpeak":"Premi e tieni premuto per parlare","microphoneMode":"Modalità microfono","hideEmissionsLabel":"Nascondi testo emesso dal Twin","secondsLabel":"Secondi","controlsPosition":"Posizione dei controlli","tryMeHeaderLabel":"PROVA","unknownPosition":"Posizione sconosciuta","fieldPlace":"Indica la posizione (es \'Milano\')","showMapLinkFor":"Visualizza sulla mappa la posizione","useMyPosition":"Usa la mia posizione","myPosition":"Posizione corrente","updatingPosition":"Aggiorno la posizione...","placeNotFound":"Luogo sconosciuto!","requirePosition":"Inserisci la posizione prima di iniziare","attachmentsLabel":"Arricchisci il tuo messaggio","iWantToTalkToIn":"Voglio parlare con {{name}} in"},"media":{"title":"Titolo","editAttributes":"Modifica attributi media","uploadMimeTypeNotAllowed":"Il tipo di file non è permesso","uploadSizeLimitMessage":"Il file caricato è troppo grande (max {{size}}MB)","uploadWrongResolutionMessage":"La risoluzione deve essere {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"Hai già un Twin con questo nome","uploadHelperImages":"Caricare un file con estensione png, jpg, jpeg o gif e con dimensione massima di {{size}}MB","uploadHelper":"Caricare un file di dimensione massima di {{size}}MB","uploadError":"Errore nel caricamento","square":"quadrato","scaleRatio":"Proporzioni","addMediaLabel":"Aggiungi media","insertThisMediaMsg":"Inserisci questi media","mediaUploadMessage":"Clicca per caricare un nuovo media","addLinkLabel":"Aggiungi un link","linkKey":"URL","linkValue":"Titolo link","insertThisLink":"Inserisci un link a {{url}} con titolo {{title}}"},"gamification":{"level":"Livello","points":"punti","memoriReachedLevel":"è diventato più evoluto ed ha raggiunto il livello","levelGoToStatistics":"{{memori}} è al livello {{level}} con {{points}} punti. Clicca per andare alle statistiche.","congratulationsNewLevel":"Congratulazioni, hai raggiunto un nuovo livello!","congratulationsNewLevelDescription":"Il tuo Memori è diventato più evoluto con {{points}} punti, guarda le","statistics":"statistiche"},"success":"Operazione andata a buon fine","Error":"Errore","internal server error":"Ops, scusa... qualcosa è andato storto nel server","error":"Errore","error.loading":"Errore durante il caricamento dei contenuti.","error.notFound":"Ops, non abbiamo trovato ciò che cercavi.","error.generic":"Ops, qualcosa è andato storto.","error.serverNotResponding":"Stiamo facendo manutenzione o rilasciando aggiornamenti. Riprova più tardi.","error.unprocessableEntity":"Errore durante il salvataggio dei dati. Ricontrolla i dati inseriti.","error.goBackTo":"Prova a tornare alla","error.reloadPage":"Ricarica la pagina","error.tryAgain":"Riprova","error.unauthorized":"Non sei autorizzato a visualizzare questo contenuto.","errors":{"TENANT_NOT_FOUND":"Tenant non trovato","TENANT_REGISTRATION_DISABLED":"La registrazione su questa piattaforma è disabilitata","TENANT_MISSING_NAME":"Tenant: nome mancante","TENANT_MAX_USERS_REACHED":"Numero massimo di utenti raggiunto","TENANT_MAX_ADMINS_REACHED":"Numero massimo di utenti amministratori raggiunto","USER_NOT_CONFIRMED":"Utente ancora non confermato","USER_NOT_FOUND":"Utente non trovato","USER_OR_PASSWORD_INVALID":"Utente o password non validi","USER_MUST_CHANGE_PASSWORD":"Devi cambiare la password","USER_MUST_ENTER_VERIFICATION_CODE":"Devi inserire il codice di verifica","USER_MISSING_TENANT":"Utente: tenant mancante","USER_MISSING_NAME":"Utente: nome mancante","USER_MISSING_PASSWORD":"Utente: password mancante","USER_MISSING_EMAIL":"Utente: email mancante","USER_MISSING_VERIFICATION_CODE":"Utente: codice di verifica mancante","USER_NAME_ALREADY_USED":"Nome utente già in uso","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"La password non rispetta le regole di sicurezza","USER_EMAIL_ALREADY_USED":"Email già in uso","USER_EMAIL_INVALID":"Email non valida","USER_VERIFICATION_CODE_INVALID":"Codice di verifica non valido","USER_MISSING_NAME_OR_EMAIL":"Nome utente o email mancante","USER_NAME_INVALID":"Nome utente non valido","USER_HAS_ONE_OR_MORE_MEMORI":"L\'utente ha uno o più memori","USER_MISSING_NEW_PASSWORD":"Utente: nuova password mancante","USER_NOTHING_TO_DO":"Niente da fare","USER_CANT_CREATE_MEMORI":"Utente non abilitato a creare Memori","USER_MAX_MEMORI_REACHED":"Massimo numero di Memori raggiunto","USER_CANT_EDIT_INTEGRATIONS":"Utente non abilitato a gestire integrazioni","MEMORI_NOT_FOUND":"Memori non trovato","MEMORI_NOT_ACCESSIBLE":"Memori non accessibile","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Solo il proprietario può cambiare il tag e il pin","SESSION_NOT_FOUND":"Sessione non trovata","SESSION_IS_NOT_ADMINISTRATIVE":"Sessione non amministrativa","MEMORI_MISSING_CONFIGURATION":"Memori: configurazione mancante","MEMORI_CONFIGURATION_NOT_FOUND":"Memori: configurazione non trovata","MEMORI_INVALID_PRIVACY_TYPE":"Memori: tipo di privacy non valido","MEMORI_MISSING_PASSWORD":"Memori: password mancante","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero totale di token di recupero non valido","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero minimo di token di recupero non valido","MEMORI_INVALID_VOICE_TYPE":"Memori: tipo di voce non valido","MEMORI_MISSING_NAME":"Memori: nome mancante","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memori: password o token di recupero mancanti","MEMORI_INVALID_ID":"Memori: ID non valido","MEMORI_NAME_ALREADY_USED":"Nome memori già in uso","MEMORI_INVALID_PIN":"Memori: PIN non valido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memori: cambio TAG e PIN richiedono operazioni separate","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memori: password non richiesta su Memori pubblico","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Trasferimento: utente di destinazione mancante","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Trasferimento: ID utente di destinazione non valido","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Trasferimento: dati utente di destinazione non validi","MEMORI_TRANSFER_NOTHING_TO_DO":"Trasferimento: alcuna operazione da fare","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memori: la configurazione non può essere modificata","MEMORI_MISSING_NEW_PASSWORD":"Memori: nuova password mancante","INTEGRATION_NOT_FOUND":"Integrazione non trovata","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Formato non valido data a partire da","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Formato non valido data fino a","INTEGRATION_INVALID_TYPE":"Tipo integrazione non valido","INTEGRATION_ALREADY_EXISTS":"Integrazione già esistente","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Memori non pubblici non possono essere integrati","INTEGRATION_MISSING_INVOCATION_TEXT":"Integrazione: testo di invocazione mancante","INTEGRATION_MISSING_DEVICE_EMAILS":"Integrazione: email del dispositivo mancante","INTEGRATION_MEMORI_IS_EMPTY":"Memori vuoti non possono essere integrati","INTEGRATION_MISSING_PRIVACY_POLICY":"Integrazione: privacy policy mancante","INTEGRATION_MISSING_CATEGORY":"Categoria integrazione mancante","INTEGRATION_MISSING_DESCRIPTION":"Descrizione integrazione mancante","INTEGRATION_INVALID_INVOCATION_TEXT":"Testo di invocazione non valido","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home non più disponibile","UPLOAD_REQUIRES_MULTIPART_ENCODING":"L\'upload richiede l\'encoding multipart","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: manca il content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: dimensione massima superata","UPLOAD_FILE_IS_EMPTY":"Upload: file vuoto","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: tipo di file o firma non validi","UPLOAD_MISSING_FILE_NAME":"Upload: nome file mancante","UPLOAD_INVALID_MEMORY_ID":"Upload: ID contenuto non valido","UPLOAD_MISSING_FILE_CONTENT":"Upload: contenuto file mancante","ASSET_NOT_FOUND":"Asset non trovato","ASSET_NOT_ACCESSIBLE":"Asset non accessibile","ASSET_MISSING_SESSION_ID":"Asset: ID sessione mancante","ASSET_INVALID_FILE_NAME":"Asset: nome file non valido","INVITATION_NOT_FOUND":"Invito non trovato","INVITATION_NOT_ACCESSIBLE":"Invito non accessibile","INVITATION_ALREADY_ACCEPTED":"Invito già accettato","INVITATION_ALREADY_REJECTED":"Invito già rifiutato","INVITATION_MISSING_DESTINATION_EMAIL":"Invito: email di destinazione mancante","INVITATION_DESTINATION_EMAIL_INVALID":"Invito: email di destinazione non valida","INVITATION_MISSING_TAG":"Invito: tag mancante","INVITATION_MISSING_PIN":"Invito: PIN mancante","INVITATION_INVALID_PIN":"Invito: PIN non valido","INVITATION_INVALID_TYPE":"Invito: tipo non valido","INVITATION_MISSING_DESTINATION_NAME":"Invito: nome destinatario mancante","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invito: tag e pin non possono essere cambiati","INVITATION_CANT_BE_CHANGED":"Invito: non può essere modificato","ACTIONLOG_INVALID_USER_ID":"ID utente non valido","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","ACTIONLOG_INVALID_MEMORI_ID":"ID Memori non valido","CONSUMPTIONLOG_INVALID_TYPE":"Tipo di log non valido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","CONSUMPTIONLOG_INVALID_USER_ID":"ID utente non valido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Memori ID non valido"}}');const pH=dH({resources:{en:{translation:t(JSON.parse('{"yes":"Yes","no":"No","confirm":"Confirm","apply":"Apply","cancel":"Cancel","show":"Show","hide":"Hide","send":"Send","close":"Close","edit":"Edit","delete":"Delete","loading":"Loading","expand":"Expand","collapse":"Collapse","fullscreenEnter":"Enter fullscreen","fullscreenExit":"Exit fullscreen","center":"Center","bottom":"Bottom","hidden":"Hidden","day":"Day","month":"Month","year":"Year","createdAt":"Creation date","selected":"Selected","page":"page","actions":"Actions","next":"Next","previous":"Previous","copy":"Copy","copyToClipboard":"Copy to clipboard","showOriginalText":"Show original","showTranslatedText":"Show translation","memoriBlockedTitle":"Blocked","memoriBlockedUntil":"Memori blocked until {{date}}","memoriBlockedAnon":"Currently \\"{{name}}\\" can\'t answer, come back here on {{date}}","memoriBlockedReasonExceedChats":"because it has exceeded the monthly threshold of allowed chats.","memoriBlockedGiverHelper":"You can still manage it as administrator, but other users will not be able to interact with it.","generatedByAI":"Answer generated by AI, may occasionally generate incorrect informations","completionsEnabled":"Advanced AI, can respond with automatically generated answers that may sometimes contain incorrect information","completionProviderDown":"This Twin is integrated with a generative AI from {{provider}}, but it is currently unavailable. Try again later.","completionProviderFallbackName":"an external provider","completionProviderCheckStatusPage":"Check status page","boardOfExperts":"Board of experts","birthDate":"Birth date","birthDateHelper":"We ask for your birth date only to enable or disable functionalities that have age restrictions","underage":"You must be at least {{age}} years old to sign up.","underageTwinSession":"You must be at least {{age}} years old to interact with this Twin.","ageVerification":"Age verification","ageVerificationText":"To interact with this Twin, you must be at least {{minAge}} years old.","nsfw":"NSFW: This Twin contains adult contents","deepThought":"Deep Thought","deepThoughtHelper":"Deep Thought is an advanced feature of the AI that will allow you to fully exploit your conversations by keeping track of them. The AI with Deep Thought can give you information tailored to you and the things you will share together. Allow the twin\'s author to contact you for commercial offers regarding products you have shown interest in.","deepThoughtDisclaimerTitle":"Deep Thought enabled","deepThoughtDisclaimer":"Deep Thought is an advanced feature of the AI that will allow you to fully exploit your conversations by keeping track of them. The AI with Deep Thought can give you information tailored to you and the things you will share together.","deepThoughtPreDisclaimerUnlogged":"Log in to enable Deep Thought.","deepThoughtPreDisclaimerNotAllowed":"Deep Thought is disabled since you didn\'t consent its usage, you can change this any time in your account settings.","knownFacts":{"title":"Known facts","description":"Details of the information shared between you and {{memoriName}}","type":"Type","typeShortTerm":"Short term","typeLongTerm":"Long term","typeHelper":"Types:\\n- Short Term: this Known Fact is always used during conversations\\n- Long Term: this Known Fact is used during conversations only if relevant to the current question","text":"Text","deleteSuccess":"Known fact deleted","deleteConfirmTitle":"Delete known fact","deleteConfirmMessage":"Are you sure you want to delete this known fact?","deleteSelectedConfirmTitle":"Delete selected known facts","deleteSelectedConfirmMessage":"Are you sure you want to delete the selected known facts?"},"auth":{"title":"Authentication","useRecoveryTokens":"Use recovery tokens","tokens":"Tokens","addToken":"Add token","usePassword":"Use password","atLeast":"At least"},"widget":{"instruct":"Instruct","test":"Test","sound":"Sound","position":"Position","settings":"Settings","share":"Share","sendOnKeypress":"Hit Enter to send","sendOnClick":"Click on Submit","boardOfExperts":"Board of experts","showExpertsInTheBoard":"Show experts in this board","expertsInTheBoard":"Experts in this board","goToIntegrationsToCustomizeAvatar":"To customize the avatar, go to Share and customize the public page"},"write_and_speak":{"micButtonPopover":"Click the button to speak","micButtonPopoverListening":"Click the button to stop speak","pageInstructExplanation":"To teach me new things click on the INSTRUCT ME button to get started","pageTryMeExplanation":"To talk to me click on the START button to get started","instructButton":"INSTRUCT ME","tryMeButton":"START","chatHistory":"Chat history","exportChatHistory":"Export chat history","exportChatHistoryMessage":"Do you want to export chat history?","chatBotButtonText":"CLICK HERE TO OPEN CHATBOT","conversationStartedLabel":"Conversation started on","settingsHeaderLabel":"Setup here if you want to set the memori as continuous speech, and change the silence seconds if you want to customize them.","continuousSpeechLabel":"Continuous speech","holdToSpeak":"Hold to speak","releaseToEndListening":"Release to end listening","pressAndHoldToSpeak":"Press and hold to speak","microphoneMode":"Microphone mode","hideEmissionsLabel":"Hide text emitted by the Twin","secondsLabel":"Set seconds","controlsPosition":"Controls position","tryMeHeaderLabel":"TRY","unknownPosition":"Unknown position","fieldPlace":"Write the place (eg \'Milano\')","showMapLinkFor":"Show the position on the map","useMyPosition":"Use my position","myPosition":"Your position","updatingPosition":"Updating position...","placeNotFound":"Place not found!","requirePosition":"Insert your position before start","attachmentsLabel":"Enrich your message","iWantToTalkToIn":"I want to talk to {{name}} in"},"media":{"title":"Title","editAttributes":"Edit media attributes","uploadMimeTypeNotAllowed":"The file type is not allowed","uploadSizeLimitMessage":"The uploaded size is too big (max {{size}}MB)","uploadWrongResolutionMessage":"The resolution must be {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"You already have a Twin with this name","uploadHelperImages":"Upload a file with extension png, jpg, jpeg or gif, and having at maximum a size of {{size}}MB","uploadHelper":"Upload a file having at maximum a size of {{size}}MB","uploadError":"Upload failed","square":"square","scaleRatio":"Scale ratio","addMediaLabel":"Add a media","insertThisMediaMsg":"Insert these media","mediaUploadMessage":"Click to load a new media","addLinkLabel":"Add a link","linkKey":"URL","linkValue":"Link title","insertThisLink":"Insert a link to {{url}} with title {{title}}"},"gamification":{"level":"Level","points":"points","memoriReachedLevel":"became more evolved and reached level","levelGoToStatistics":"{{memori}} is at level {{level}} with {{points}} points. Click to go to statistics.","congratulationsNewLevel":"Congratulations, you have reached a new level!","congratulationsNewLevelDescription":"Your Memori became more evolved with {{points}} points, look at the","statistics":"statistics"},"success":"Success","Error":"Error","internal server error":"Oupsie, sorry... Something went wrong on the server","error":"Error","error.loading":"Error while loading content.","error.generic":"Oupsie, sorry... something went wrong.","error.serverNotResponding":"We are doing maintenance or releasing updates. Please try again later.","error.notFound":"Oupsie, we didn\'t find the page you were looking for.","error.goBackTo":"You can try to go back to the","error.reloadPage":"Reload the page","error.tryAgain":"Try again","error.unauthorized":"You are unauthorized to view this content.","error.unprocessableEntity":"Error while processing the request. Check the data you entered.","errors":{"TENANT_NOT_FOUND":"Tenant not found","TENANT_REGISTRATION_DISABLED":"Registration on this platform is disabled","TENANT_MISSING_NAME":"Tenant: name missing","TENANT_MAX_USERS_REACHED":"Maximum number of users reached","TENANT_MAX_ADMINS_REACHED":"Maximum number of admin users reached","USER_NOT_CONFIRMED":"User still not confirmed","USER_NOT_FOUND":"User not found","USER_OR_PASSWORD_INVALID":"Invalid user or password","USER_MUST_CHANGE_PASSWORD":"You must change your password","USER_MUST_ENTER_VERIFICATION_CODE":"You must enter the verification code","USER_MISSING_TENANT":"User: missing tenant","USER_MISSING_NAME":"User: name is missing","USER_MISSING_PASSWORD":"User: password missing","USER_MISSING_EMAIL":"User: Missing email","USER_MISSING_VERIFICATION_CODE":"User: Missing verification code","USER_NAME_ALREADY_USED":"User name already in use","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"The password does not meet the security rules","USER_EMAIL_ALREADY_USED":"Email already in use","USER_EMAIL_INVALID":"Invalid email","USER_VERIFICATION_CODE_INVALID":"Invalid verification code","USER_MISSING_NAME_OR_EMAIL":"Missing username or email","USER_NAME_INVALID":"Invalid user name","USER_HAS_ONE_OR_MORE_MEMORI":"The user has one or more memories","USER_MISSING_NEW_PASSWORD":"User: new password missing","USER_NOTHING_TO_DO":"Nothing to do","USER_CANT_CREATE_MEMORI":"User not allowed to create Memori","USER_MAX_MEMORI_REACHED":"Maximum number of Memori reached","USER_CANT_EDIT_INTEGRATIONS":"User not allowed to manage integrations","MEMORI_NOT_FOUND":"Memori not found","MEMORI_NOT_ACCESSIBLE":"Memori not accessible","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Only owner can change tag or pin","SESSION_NOT_FOUND":"Session not found","SESSION_IS_NOT_ADMINISTRATIVE":"Non-administrative session","MEMORI_MISSING_CONFIGURATION":"Memori: missing configuration","MEMORI_CONFIGURATION_NOT_FOUND":"Memories: configuration not found","MEMORI_INVALID_PRIVACY_TYPE":"Memories: invalid privacy type","MEMORI_MISSING_PASSWORD":"Memori: missing password","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memories: total number of invalid recovery tokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memories: minimum number of invalid recovery tokens","MEMORI_INVALID_VOICE_TYPE":"Memories: invalid voice type","MEMORI_MISSING_NAME":"Memories: missing name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memories: missing password or recovery token","MEMORI_INVALID_ID":"Memories: invalid ID","MEMORI_NAME_ALREADY_USED":"Memory name already in use","MEMORI_INVALID_PIN":"Memories: Invalid PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memories: TAG and PIN change require separate operations","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memories: no password required when public","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transfer: missing destination user","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transfer: invalid destination user ID","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transfer: invalid destination user data","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfer: nothing to do","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memories: configuration cannot be changed","MEMORI_MISSING_NEW_PASSWORD":"Memories: new password missing","INTEGRATION_NOT_FOUND":"Integration not found","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Invalid date from format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Invalid date to format","INTEGRATION_INVALID_TYPE":"Invalid integration type","INTEGRATION_ALREADY_EXISTS":"Integration already exists","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Non-public memories cannot be integrated","INTEGRATION_MISSING_INVOCATION_TEXT":"Integration: missing invocation text","INTEGRATION_MISSING_DEVICE_EMAILS":"Integration: missing device email","INTEGRATION_MEMORI_IS_EMPTY":"Empty memories cannot be integrated","INTEGRATION_MISSING_PRIVACY_POLICY":"Integration: privacy policy missing","INTEGRATION_MISSING_CATEGORY":"Integration category missing","INTEGRATION_MISSING_DESCRIPTION":"Missing integration description","INTEGRATION_INVALID_INVOCATION_TEXT":"Invalid invocation text","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home no more available","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Upload requires multipart encoding","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: missing content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: maximum size exceeded","UPLOAD_FILE_IS_EMPTY":"Upload: empty file","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: invalid file type or signature","UPLOAD_MISSING_FILE_NAME":"Upload: missing file name","UPLOAD_INVALID_MEMORY_ID":"Upload: Invalid content ID","UPLOAD_MISSING_FILE_CONTENT":"Upload: Missing file content","ASSET_NOT_FOUND":"Asset not found","ASSET_NOT_ACCESSIBLE":"Asset not accessible","ASSET_MISSING_SESSION_ID":"Asset: missing session ID","ASSET_INVALID_FILE_NAME":"Asset: invalid file name","INVITATION_NOT_FOUND":"Invitation not found","INVITATION_NOT_ACCESSIBLE":"Invitation not accessible","INVITATION_ALREADY_ACCEPTED":"Invitation already accepted","INVITATION_ALREADY_REJECTED":"Invitation already rejected","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation: missing destination email","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation: destination email invalid","INVITATION_MISSING_TAG":"Invitation: missing tag","INVITATION_MISSING_PIN":"Invitation: PIN missing","INVITATION_INVALID_PIN":"Invitation: invalid PIN","INVITATION_INVALID_TYPE":"Invitation: invalid type","INVITATION_MISSING_DESTINATION_NAME":"Invitation: destination name missing","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation: tag and pin can\'t be changed","INVITATION_CANT_BE_CHANGED":"Intation: can\'t be changed","ACTIONLOG_INVALID_USER_ID":"Invalid user ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","ACTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","CONSUMPTIONLOG_INVALID_TYPE":"Invalid log type","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","CONSUMPTIONLOG_INVALID_USER_ID":"Invalid user ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID"}}'))},it:{translation:t(uH)}},lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});pH.init();var hH=pH;c=o("85Hg2");function fH(e){var t=e.i18n,n=e.defaultNS,r=e.children,i=(0,c.useMemo)((function(){return{i18n:t,defaultNS:n}}),[t,n]);return(0,c.createElement)(re.Provider,{value:i},r)}const mH=({ownerUserName:e,ownerUserID:t,memoriName:n,memoriID:r,integrationID:i,tenantID:o,secretToken:a,sessionID:l,layout:u="DEFAULT",customLayout:d,showShare:p=!0,showSettings:h=!0,showInstruct:f=!1,showTypingText:m=!1,showClear:g=!1,showOnlyLastMessages:v=!1,showInputs:y=!0,showDates:b=!1,showContextPerLine:S=!1,height:x="100%",baseURL:w,apiURL:C="https://backend.memori.ai",tag:A,pin:E,context:M,initialQuestion:_,uiLang:T,spokenLang:I,multilingual:R,authToken:P,AZURE_COGNITIVE_SERVICES_TTS_KEY:k,onStateChange:O,additionalInfo:N,customMediaRenderer:L,additionalSettings:D,userAvatar:B})=>{var z,F,U;const[j,H]=(0,c.useState)(),[V,G]=(0,c.useState)(),[W,K]=(0,c.useState)(k),{t:J}=ve();if(!(r&&t||n&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const Q=q(C),Y=(0,c.useCallback)((async()=>{const e=w||(o.startsWith("https://")?o:`https://${o}`),t=await fetch(`${e}/api/speechkey`),n=await t.json();n.AZURE_COGNITIVE_SERVICES_TTS_KEY&&K(n.AZURE_COGNITIVE_SERVICES_TTS_KEY)}),[]);(0,c.useEffect)((()=>{k||Y()}),[k]);const X=(0,c.useCallback)((async()=>{if(r&&t){const{memori:e,...n}=await Q.backend.getMemoriByUserAndId(o,t,r);0===n.resultCode&&e?H(e):console.error("[MEMORI]",n,e)}else if(n&&e){const{memori:t,...r}=await Q.backend.getMemori(o,e,n);0===r.resultCode&&t?H(t):console.error("[MEMORI]",r,t)}}),[r,t,n,e,o]);(0,c.useEffect)((()=>{X()}),[X,o]);const $=(0,c.useCallback)((async()=>{const e=await WU(o,w);e&&G(e)}),[o,C]);(0,c.useEffect)((()=>{$()}),[$]),(0,c.useEffect)((()=>{if(T)hH.changeLanguage(T.toLowerCase());else{const{lng:e,fallbackLng:t}=(()=>{const e=navigator.language;if(e){let t=e.split("-")[0];if(["en","it"].includes(t))return{lng:t,fallbackLng:"en"===t?"it":"en"}}return{lng:"en",fallbackLng:"it"}})();hH.changeLanguage(e).catch((()=>{hH.changeLanguage(t)}))}}),[T]);const Z=j?(0,s.jsx)(VU,{layout:u,customLayout:d,height:x,baseUrl:w||(o.startsWith("https://")?o:`https://${o}`),apiUrl:C,memori:{...j,secretToken:a},memoriLang:null!=I?I:null===(F=null===(z=j.culture)||void 0===z?void 0:z.split("-"))||void 0===F?void 0:F[0],multilingual:R,tenant:V,secret:a,sessionID:l,showShare:p,showSettings:h,showInstruct:f,showTypingText:m,showClear:g,showOnlyLastMessages:v,showInputs:y,showDates:b,showContextPerLine:S,integration:null===(U=null==j?void 0:j.integrations)||void 0===U?void 0:U.find((e=>i?e.integrationID===i:!!e.publish&&"LANDING_EXPERIENCE"===e.type)),initialContextVars:M,initialQuestion:_,authToken:P,AZURE_COGNITIVE_SERVICES_TTS_KEY:W||k,onStateChange:O,additionalInfo:N,customMediaRenderer:L,additionalSettings:D,userAvatar:B,...A&&E?{personification:{tag:A,pin:E}}:{}}):(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,s.jsxs)("p",{style:{textAlign:"center",margin:"2rem auto",textTransform:"capitalize"},children:[J("loading")||"Loading","..."]})});return(0,s.jsxs)(fH,{i18n:hH,children:[(0,s.jsx)(Ss.Toaster,{position:"top-center",reverseOrder:!0}),Z]})};mH.propTypes={memoriName:t(l).string,memoriID:t(l).string,ownerUserName:t(l).string,ownerUserID:t(l).string,integrationID:t(l).string,tenantID:t(l).string.isRequired,secretToken:t(l).string,sessionID:t(l).string,layout:t(l).oneOf(["DEFAULT","FULLPAGE","TOTEM","WEBSITE_ASSISTANT","CHAT"]),customLayout:t(l).any,showShare:t(l).bool,showInstruct:t(l).bool,showInputs:t(l).bool,showDates:t(l).bool,showContextPerLine:t(l).bool,showSettings:t(l).bool,showClear:t(l).bool,showOnlyLastMessages:t(l).bool,showTypingText:t(l).bool,height:t(l).oneOfType([t(l).string,t(l).number]),baseURL:t(l).string,apiURL:t(l).string,tag:t(l).string,pin:t(l).string,context:t(l).objectOf(t(l).any),initialQuestion:t(l).string,uiLang:t(l).oneOf(["en","it","EN","IT"]),spokenLang:t(l).string,multilingual:t(l).bool,authToken:t(l).string,AZURE_COGNITIVE_SERVICES_TTS_KEY:t(l).string,onStateChange:t(l).func,additionalInfo:t(l).objectOf(t(l).any),customMediaRenderer:t(l).func,additionalSettings:t(l).any,userAvatar:t(l).oneOfType([t(l).string,t(l).any])};var gH=mH;class vH extends HTMLElement{connectedCallback(){const e=document.createElement("div"),n=document.createElement("div");n.setAttribute("id","memori-root"),e.appendChild(n),this.appendChild(e);const r=Object.keys(gH.propTypes).reduce(((e,t)=>(this.hasAttribute(t)&&(e[t]=this.getAttribute(t)),e)),{}),i=this.getAttribute("tenantId"),o=this.getAttribute("context")?.split(",")?.reduce(((e,t)=>{const[n,r]=t.split(":").map((e=>e.trim()));return{...e,[n]:r}}),{}),l=(e=>{try{return JSON.parse(e)}catch(e){return null}})(this.getAttribute("additionalInfo")||"{}")||{};i?t(a).render((0,s.jsx)(gH,{...r,context:o,tenantID:i,additionalInfo:l}),n):console.error("No tenantId attribute found")}}customElements.define("memori-client",vH)})();
|
|
246
|
+
*/function rL(e,t=0){const n=[];return e.forEach((function(e,r){let i=null;e.forEach((function(o,s){if(!o&&null!==i)return n.push(`M${i+t} ${r+t}h${s-i}v1H${i+t}z`),void(i=null);if(s!==e.length-1)o&&null===i&&(i=s);else{if(!o)return;null===i?n.push(`M${s+t},${r+t} h1v1H${s+t}z`):n.push(`M${i+t},${r+t} h${s+1-i}v1H${i+t}z`)}}))})),n.join("")}function iL(e,t){return e.slice().map(((e,n)=>n<t.y||n>=t.y+t.h?e:e.map(((e,n)=>(n<t.x||n>=t.x+t.w)&&e))))}function oL(e,t,n,r){if(null==r)return null;const i=n?4:0,o=e.length+2*i,s=Math.floor(.1*t),a=o/t,l=(r.width||s)*a,c=(r.height||s)*a,u=null==r.x?e.length/2-l/2:r.x*a,d=null==r.y?e.length/2-c/2:r.y*a;let p=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);p={x:e,y:t,w:Math.ceil(l+u-e),h:Math.ceil(c+d-t)}}return{x:u,y:d,h:c,w:l,excavation:p}}var sL=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function aL(e){const n=e,{value:r,size:i=$N,level:o=ZN,bgColor:s=eL,fgColor:a=tL,includeMargin:l=nL,style:u,imageSettings:d}=n,p=QN(n,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=null==d?void 0:d.src,f=(0,c.useRef)(null),m=(0,c.useRef)(null),[g,v]=(0,c.useState)(!1);(0,c.useEffect)((()=>{if(null!=f.current){const e=f.current,t=e.getContext("2d");if(!t)return;let n=YN.QrCode.encodeText(r,XN[o]).getModules();const c=l?4:0,u=n.length+2*c,p=oL(n,i,l,d),h=m.current,g=null!=p&&null!==h&&h.complete&&0!==h.naturalHeight&&0!==h.naturalWidth;g&&null!=p.excavation&&(n=iL(n,p.excavation));const v=window.devicePixelRatio||1;e.height=e.width=i*v;const y=i/u*v;t.scale(y,y),t.fillStyle=s,t.fillRect(0,0,u,u),t.fillStyle=a,sL?t.fill(new Path2D(rL(n,c))):n.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+c,n+c,1,1)}))})),g&&t.drawImage(h,p.x+c,p.y+c,p.w,p.h)}})),(0,c.useEffect)((()=>{v(!1)}),[h]);const y=JN({height:i,width:i},u);let b=null;return null!=h&&(b=t(c).createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),t(c).createElement(t(c).Fragment,null,t(c).createElement("canvas",JN({style:y,height:i,width:i,ref:f},p)),b)}var lL=({tenant:e,url:n,title:r="",className:i,baseUrl:o,primary:a=!0,showQrCode:l=!0,align:u="right"})=>{const{t:d}=ve(),[p,h]=(0,c.useState)(n),f=(0,c.useMemo)((()=>(null==e?void 0:e.theme)?`${null!=o?o:"https://aisuru.com"}/images/${e.theme}/square_logo.png`:`${null!=o?o:"https://aisuru.com"}/images/memori_logo.png`),[e,o]);(0,c.useEffect)((()=>{n||h(window.location.href)}),[n]);const m=[{id:"facebook",title:"Facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${p}`,icon:NN},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${p}`,icon:LN},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${r}&url=${p}`,icon:DN},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${p}`,icon:BN},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${r}&url=${p}`,icon:HN},{id:"email",title:"Email",url:`mailto:?subject=${(null==r?void 0:r.length)>0?r:n}&body=${p}`,icon:zN}];return(0,s.jsxs)(qd,{as:"div",className:t(ys)("memori-share-button",{"memori-share-button--align-left":"left"===u}),children:[(0,s.jsx)(qd.Button,{className:t(ys)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button",i,{"memori-button--primary":a}),title:d("widget.share")||void 0,children:(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(FN,{})})}),(0,s.jsxs)(qd.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,s.jsx)(qd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsx)(La,{className:"memori-share-button--link",ghost:!0,icon:(0,s.jsx)(np,{}),onClick:()=>{p&&navigator.clipboard.writeText(p)},children:d("copyToClipboard")||void 0})},"copy"),m.map((e=>{var n;return(0,s.jsx)(qd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsxs)("a",{className:t(ys)("memori-button","memori-button--with-icon","memori-button--ghost","memori-button--padded","memori-share-button--link"),href:null!==(n=e.url)&&void 0!==n?n:"",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(e.icon,{})}),e.title]})},e.id)})),l&&(0,s.jsxs)(qd.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,s.jsx)(aL,{id:"qr-canvas",value:null!=p?p:"",size:128,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:f,x:void 0,y:void 0,height:32,width:32,excavate:!0}}),(0,s.jsx)("div",{children:(0,s.jsx)(La,{onClick:()=>{const e=document.getElementById("qr-canvas");if(!e)return;const t=document.createElement("a");t.href=e.toDataURL(),t.download=`memori-${r}-share.png`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},icon:(0,s.jsx)(UN,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};var cL=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M290 236.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0 0 13.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 0 0 0 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 0 0-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"})});var uL=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",focusable:"false",role:"img",className:e,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2","aria-label":t,children:[(0,s.jsx)("path",{d:"M23 4L23 10 17 10"}),(0,s.jsx)("path",{d:"M1 20L1 14 7 14"}),(0,s.jsx)("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})]});var dL=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6c-.3 1.5-.4 3-.4 4.4 0 14.4 11.6 26 26 26h723c1.5 0 3-.1 4.4-.4 14.2-2.4 23.7-15.9 21.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"})});var pL=({className:e,memori:n,tenant:r,history:i,position:o,setShowPositionDrawer:a,setShowSettingsDrawer:l,setShowKnownFactsDrawer:u,setShowExpertsDrawer:d,speakerMuted:p,setSpeakerMuted:h,hasUserActivatedSpeak:f=!1,showShare:m=!0,showSettings:g=!0,showSpeaker:v=!0,showReload:y=!1,showClear:b=!1,clearHistory:S,loginToken:x,user:w,sessionID:C})=>{const{t:A}=ve(),[E,M]=(0,c.useState)(!1),[_,T]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{document.fullscreenEnabled&&M(!0)}),[]),(0,s.jsxs)("div",{className:t(ys)("memori-header",e),children:[y&&(0,s.jsx)(La,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--reload",title:A("reload")||"Reload",icon:(0,s.jsx)(uL,{}),onClick:()=>{window.location.reload()}}),b&&(0,s.jsx)(La,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--clear",title:A("clearHistory")||"Clear chat",icon:(0,s.jsx)(dL,{}),onClick:S}),n.needsPosition&&o&&(0,s.jsxs)("div",{className:"memori-header--position",children:[(0,s.jsx)("span",{className:"memori-header--position-placeName",children:o.placeName}),(0,s.jsx)(La,{icon:(0,s.jsx)(lN,{}),shape:"circle",className:"memori-header--button memori-header--button--position",onClick:()=>a(!0)})]}),E&&(0,s.jsx)(La,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--fullscreen",title:_?A("fullscreenExit")||"Exit fullscreen":A("fullscreenEnter")||"Enter fullscreen",icon:_?(0,s.jsx)(tm,{}):(0,s.jsx)(cL,{}),onClick:()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),T(!1)):(document.documentElement.requestFullscreen(),T(!0))}}),n.enableDeepThought&&!!x&&(null==w?void 0:w.pAndCUAccepted)&&(0,s.jsx)(La,{primary:!!C&&!!f,shape:"circle",icon:(0,s.jsx)(mm,{}),className:"memori-header--button memori-header--button--knownfacts",disabled:!f||!C,onClick:()=>u(!0),title:A("knownFacts.title")||"Known facts"}),n.enableBoardOfExperts&&(0,s.jsx)(La,{primary:!0,shape:"circle",icon:(0,s.jsx)(fm,{}),className:"memori-header--button memori-header--button--experts",disabled:!f||!C,onClick:()=>d(!0),title:A("widget.showExpertsInTheBoard")||"Experts in this board"}),v&&(0,s.jsx)(La,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--speaker",icon:p?(0,s.jsx)(cN,{}):(0,s.jsx)(dN,{}),onClick:()=>h(!p),title:A("widget.sound")||"Sound"}),(0,s.jsx)(kN,{history:i,memori:n,className:"memori-header--button memori-header--button--export",disabled:!f||0===i.length}),g&&(0,s.jsx)(La,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-settings",icon:(0,s.jsx)(ON,{}),onClick:()=>l(!0),title:A("widget.settings")||"Settings"}),m&&(0,s.jsx)(lL,{className:"memori-header--button memori-header--button-share",title:n.name,tenant:r,showQrCode:!0,align:"left"})]})};var hL=({tenant:e,userLang:t="en",integrationID:n,memoriHash:r})=>{const i="memorytwin"===(null==e?void 0:e.theme)?"memorytwin":"twincreator"===(null==e?void 0:e.theme)?"twincreator":"aisuru";return(0,s.jsxs)("div",{className:"memori--powered-by",children:[(0,s.jsx)("img",{src:`https://aisuru.com/images/${i}/logo.png`,alt:""}),(0,s.jsxs)("p",{children:["Powered by"," ",(0,s.jsx)("a",{href:`https://memori.ai/${"it"===(null==t?void 0:t.toLowerCase())?"it":"en"}${n?`?integrationID=${n}`:""}${r?`${n?"&":"?"}memori=${r}`:""}`,target:"_blank",rel:"noopener noreferrer",children:"Memori.AI"})]})]})},fL={};function mL(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(i=r.key,o=void 0,"symbol"==typeof(o=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"))?o:String(o)),r)}var i,o}function gL(e,t,n){return t&&mL(e.prototype,t),n&&mL(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function vL(){return vL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vL.apply(this,arguments)}function yL(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,SL(e,t)}function bL(e){return bL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bL(e)}function SL(e,t){return SL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},SL(e,t)}function xL(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function wL(e,t,n){return wL=xL()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&SL(i,n.prototype),i},wL.apply(null,arguments)}function CL(e){var t="function"==typeof Map?new Map:void 0;return CL=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return wL(e,arguments,bL(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),SL(r,e)},CL(e)}function AL(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function EL(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ML(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return EL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?EL(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}Object.defineProperty(fL,"__esModule",{value:!0});var _L=function(e){function t(){return e.apply(this,arguments)||this}return yL(t,e),t}(CL(Error)),TL=function(e){function t(t){return e.call(this,"Invalid DateTime: "+t.toMessage())||this}return yL(t,e),t}(_L),IL=function(e){function t(t){return e.call(this,"Invalid Interval: "+t.toMessage())||this}return yL(t,e),t}(_L),RL=function(e){function t(t){return e.call(this,"Invalid Duration: "+t.toMessage())||this}return yL(t,e),t}(_L),PL=function(e){function t(){return e.apply(this,arguments)||this}return yL(t,e),t}(_L),kL=function(e){function t(t){return e.call(this,"Invalid unit "+t)||this}return yL(t,e),t}(_L),OL=function(e){function t(){return e.apply(this,arguments)||this}return yL(t,e),t}(_L),NL=function(e){function t(){return e.call(this,"Zone is an abstract class")||this}return yL(t,e),t}(_L),LL="numeric",DL="short",BL="long",zL={year:LL,month:LL,day:LL},FL={year:LL,month:DL,day:LL},UL={year:LL,month:DL,day:LL,weekday:DL},jL={year:LL,month:BL,day:LL},HL={year:LL,month:BL,day:LL,weekday:BL},VL={hour:LL,minute:LL},GL={hour:LL,minute:LL,second:LL},WL={hour:LL,minute:LL,second:LL,timeZoneName:DL},qL={hour:LL,minute:LL,second:LL,timeZoneName:BL},KL={hour:LL,minute:LL,hourCycle:"h23"},JL={hour:LL,minute:LL,second:LL,hourCycle:"h23"},QL={hour:LL,minute:LL,second:LL,hourCycle:"h23",timeZoneName:DL},YL={hour:LL,minute:LL,second:LL,hourCycle:"h23",timeZoneName:BL},XL={year:LL,month:LL,day:LL,hour:LL,minute:LL},$L={year:LL,month:LL,day:LL,hour:LL,minute:LL,second:LL},ZL={year:LL,month:DL,day:LL,hour:LL,minute:LL},eD={year:LL,month:DL,day:LL,hour:LL,minute:LL,second:LL},tD={year:LL,month:DL,day:LL,weekday:DL,hour:LL,minute:LL},nD={year:LL,month:BL,day:LL,hour:LL,minute:LL,timeZoneName:DL},rD={year:LL,month:BL,day:LL,hour:LL,minute:LL,second:LL,timeZoneName:DL},iD={year:LL,month:BL,day:LL,weekday:BL,hour:LL,minute:LL,timeZoneName:BL},oD={year:LL,month:BL,day:LL,weekday:BL,hour:LL,minute:LL,second:LL,timeZoneName:BL},sD=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new NL},t.formatOffset=function(e,t){throw new NL},t.offset=function(e){throw new NL},t.equals=function(e){throw new NL},gL(e,[{key:"type",get:function(){throw new NL}},{key:"name",get:function(){throw new NL}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new NL}},{key:"isValid",get:function(){throw new NL}}]),e}(),aD=null,lD=function(e){function t(){return e.apply(this,arguments)||this}yL(t,e);var n=t.prototype;return n.offsetName=function(e,t){return CB(e,t.format,t.locale)},n.formatOffset=function(e,t){return _B(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return"system"===e.type},gL(t,[{key:"type",get:function(){return"system"}},{key:"name",get:function(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!0}}],[{key:"instance",get:function(){return null===aD&&(aD=new t),aD}}]),t}(sD),cD={};var uD={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};var dD={},pD=function(e){function t(n){var r;return(r=e.call(this)||this).zoneName=n,r.valid=t.isValidZone(n),r}yL(t,e),t.create=function(e){return dD[e]||(dD[e]=new t(e)),dD[e]},t.resetCache=function(){dD={},cD={}},t.isValidSpecifier=function(e){return this.isValidZone(e)},t.isValidZone=function(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}};var n=t.prototype;return n.offsetName=function(e,t){return CB(e,t.format,t.locale,this.name)},n.formatOffset=function(e,t){return _B(this.offset(e),t)},n.offset=function(e){var t=new Date(e);if(isNaN(t))return NaN;var n,r=(n=this.name,cD[n]||(cD[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),cD[n]),i=r.formatToParts?function(e,t){for(var n=e.formatToParts(t),r=[],i=0;i<n.length;i++){var o=n[i],s=o.type,a=o.value,l=uD[s];"era"===s?r[l]=a:nB(l)||(r[l]=parseInt(a,10))}return r}(r,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),i=r[1],o=r[2];return[r[3],i,o,r[4],r[5],r[6],r[7]]}(r,t),o=i[0],s=i[1],a=i[2],l=i[3],c=i[4],u=i[5],d=i[6];"BC"===l&&(o=1-Math.abs(o));var p=+t,h=p%1e3;return(bB({year:o,month:s,day:a,hour:24===c?0:c,minute:u,second:d,millisecond:0})-(p-=h>=0?h:1e3+h))/6e4},n.equals=function(e){return"iana"===e.type&&e.name===this.name},gL(t,[{key:"type",get:function(){return"iana"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return this.valid}}]),t}(sD),hD=["base"],fD=["padTo","floor"],mD={};var gD={};function vD(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=gD[n];return r||(r=new Intl.DateTimeFormat(e,t),gD[n]=r),r}var yD={};var bD={};var SD=null;var xD={};function wD(e,t,n,r){var i=e.listingMode();return"error"===i?null:"en"===i?n(t):r(t)}var CD=function(){function e(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1,n.padTo,n.floor;var r=AL(n,fD);if(!t||Object.keys(r).length>0){var i=vL({useGrouping:!1},n);n.padTo>0&&(i.minimumIntegerDigits=n.padTo),this.inf=function(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=yD[n];return r||(r=new Intl.NumberFormat(e,t),yD[n]=r),r}(e,i)}}return e.prototype.format=function(e){if(this.inf){var t=this.floor?Math.floor(e):e;return this.inf.format(t)}return dB(this.floor?Math.floor(e):mB(e,3),this.padTo)},e}(),AD=function(){function e(e,t,n){this.opts=n,this.originalZone=void 0;var r=void 0;if(this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){var i=e.offset/60*-1,o=i>=0?"Etc/GMT+"+i:"Etc/GMT"+i;0!==e.offset&&pD.create(o).valid?(r=o,this.dt=e):(r="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);var s=vL({},this.opts);s.timeZone=s.timeZone||r,this.dtf=vD(t,s)}var t=e.prototype;return t.format=function(){return this.originalZone?this.formatToParts().map((function(e){return e.value})).join(""):this.dtf.format(this.dt.toJSDate())},t.formatToParts=function(){var e=this,t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map((function(t){return"timeZoneName"===t.type?vL({},t,{value:e.originalZone.offsetName(e.dt.ts,{locale:e.dt.locale,format:e.opts.timeZoneName})}):t})):t},t.resolvedOptions=function(){return this.dtf.resolvedOptions()},e}(),ED=function(){function e(e,t,n){this.opts=vL({style:"long"},n),!t&&oB()&&(this.rtf=function(e,t){void 0===t&&(t={});var n=t;n.base;var r=AL(n,hD),i=JSON.stringify([e,r]),o=bD[i];return o||(o=new Intl.RelativeTimeFormat(e,t),bD[i]=o),o}(e,n))}var t=e.prototype;return t.format=function(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n,r){void 0===n&&(n="always");void 0===r&&(r=!1);var i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&o){var s="days"===e;switch(t){case 1:return s?"tomorrow":"next "+i[e][0];case-1:return s?"yesterday":"last "+i[e][0];case 0:return s?"today":"this "+i[e][0]}}var a=Object.is(t,-0)||t<0,l=Math.abs(t),c=1===l,u=i[e],d=r?c?u[1]:u[2]||u[1]:c?i[e][0]:e;return a?l+" "+d+" ago":"in "+l+" "+d}(t,e,this.opts.numeric,"long"!==this.opts.style)},t.formatToParts=function(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]},e}(),MD={firstDay:1,minimalDays:4,weekend:[6,7]},_D=function(){function e(e,t,n,r,i){var o=function(e){var t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));var n,r,i=e.indexOf("-u-");if(-1===i)return[e];try{n=vD(e).resolvedOptions(),r=e}catch(t){var o=e.substring(0,i);n=vD(o).resolvedOptions(),r=o}var s=n;return[r,s.numberingSystem,s.calendar]}(e),s=o[0],a=o[1],l=o[2];this.locale=s,this.numberingSystem=t||a||null,this.outputCalendar=n||l||null,this.weekSettings=r,this.intl=function(e,t,n){return n||t?(e.includes("-u-")||(e+="-u"),n&&(e+="-ca-"+n),t&&(e+="-nu-"+t),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}e.fromOpts=function(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)},e.create=function(t,n,r,i,o){void 0===o&&(o=!1);var s=t||UD.defaultLocale;return new e(s||(o?"en-US":SD||(SD=(new Intl.DateTimeFormat).resolvedOptions().locale)),n||UD.defaultNumberingSystem,r||UD.defaultOutputCalendar,cB(i)||UD.defaultWeekSettings,s)},e.resetCache=function(){SD=null,gD={},yD={},bD={}},e.fromObject=function(t){var n=void 0===t?{}:t,r=n.locale,i=n.numberingSystem,o=n.outputCalendar,s=n.weekSettings;return e.create(r,i,o,s)};var t=e.prototype;return t.listingMode=function(){var e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"},t.clone=function(t){return t&&0!==Object.getOwnPropertyNames(t).length?e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,cB(t.weekSettings)||this.weekSettings,t.defaultToEN||!1):this},t.redefaultToEN=function(e){return void 0===e&&(e={}),this.clone(vL({},e,{defaultToEN:!0}))},t.redefaultToSystem=function(e){return void 0===e&&(e={}),this.clone(vL({},e,{defaultToEN:!1}))},t.months=function(e,t){var n=this;return void 0===t&&(t=!1),wD(this,e,kB,(function(){var r=t?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";return n.monthsCache[i][e]||(n.monthsCache[i][e]=function(e){for(var t=[],n=1;n<=12;n++){var r=DF.utc(2009,n,1);t.push(e(r))}return t}((function(e){return n.extract(e,r,"month")}))),n.monthsCache[i][e]}))},t.weekdays=function(e,t){var n=this;return void 0===t&&(t=!1),wD(this,e,DB,(function(){var r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=t?"format":"standalone";return n.weekdaysCache[i][e]||(n.weekdaysCache[i][e]=function(e){for(var t=[],n=1;n<=7;n++){var r=DF.utc(2016,11,13+n);t.push(e(r))}return t}((function(e){return n.extract(e,r,"weekday")}))),n.weekdaysCache[i][e]}))},t.meridiems=function(){var e=this;return wD(this,void 0,(function(){return BB}),(function(){if(!e.meridiemCache){var t={hour:"numeric",hourCycle:"h12"};e.meridiemCache=[DF.utc(2016,11,13,9),DF.utc(2016,11,13,19)].map((function(n){return e.extract(n,t,"dayperiod")}))}return e.meridiemCache}))},t.eras=function(e){var t=this;return wD(this,e,jB,(function(){var n={era:e};return t.eraCache[e]||(t.eraCache[e]=[DF.utc(-40,1,1),DF.utc(2017,1,1)].map((function(e){return t.extract(e,n,"era")}))),t.eraCache[e]}))},t.extract=function(e,t,n){var r=this.dtFormatter(e,t).formatToParts().find((function(e){return e.type.toLowerCase()===n}));return r?r.value:null},t.numberFormatter=function(e){return void 0===e&&(e={}),new CD(this.intl,e.forceSimple||this.fastNumbers,e)},t.dtFormatter=function(e,t){return void 0===t&&(t={}),new AD(e,this.intl,t)},t.relFormatter=function(e){return void 0===e&&(e={}),new ED(this.intl,this.isEnglish(),e)},t.listFormatter=function(e){return void 0===e&&(e={}),function(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=mD[n];return r||(r=new Intl.ListFormat(e,t),mD[n]=r),r}(this.intl,e)},t.isEnglish=function(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")},t.getWeekSettings=function(){return this.weekSettings?this.weekSettings:sB()?function(e){var t=xD[e];if(!t){var n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,xD[e]=t}return t}(this.locale):MD},t.getStartOfWeek=function(){return this.getWeekSettings().firstDay},t.getMinDaysInFirstWeek=function(){return this.getWeekSettings().minimalDays},t.getWeekendDays=function(){return this.getWeekSettings().weekend},t.equals=function(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar},gL(e,[{key:"fastNumbers",get:function(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}}]),e}(),TD=null,ID=function(e){function t(t){var n;return(n=e.call(this)||this).fixed=t,n}yL(t,e),t.instance=function(e){return 0===e?t.utcInstance:new t(e)},t.parseSpecifier=function(e){if(e){var n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new t(AB(n[1],n[2]))}return null};var n=t.prototype;return n.offsetName=function(){return this.name},n.formatOffset=function(e,t){return _B(this.fixed,t)},n.offset=function(){return this.fixed},n.equals=function(e){return"fixed"===e.type&&e.fixed===this.fixed},gL(t,[{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC"+_B(this.fixed,"narrow")}},{key:"ianaName",get:function(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+_B(-this.fixed,"narrow")}},{key:"isUniversal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}],[{key:"utcInstance",get:function(){return null===TD&&(TD=new t(0)),TD}}]),t}(sD),RD=function(e){function t(t){var n;return(n=e.call(this)||this).zoneName=t,n}yL(t,e);var n=t.prototype;return n.offsetName=function(){return null},n.formatOffset=function(){return""},n.offset=function(){return NaN},n.equals=function(){return!1},gL(t,[{key:"type",get:function(){return"invalid"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!1}}]),t}(sD);function PD(e,t){if(nB(e)||null===e)return t;if(e instanceof sD)return e;if(function(e){return"string"==typeof e}(e)){var n=e.toLowerCase();return"default"===n?t:"local"===n||"system"===n?lD.instance:"utc"===n||"gmt"===n?ID.utcInstance:ID.parseSpecifier(n)||pD.create(e)}return rB(e)?ID.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new RD(e)}var kD,OD=function(){return Date.now()},ND="system",LD=null,DD=null,BD=null,zD=60,FD=null,UD=function(){function e(){}return e.resetCaches=function(){_D.resetCache(),pD.resetCache()},gL(e,null,[{key:"now",get:function(){return OD},set:function(e){OD=e}},{key:"defaultZone",get:function(){return PD(ND,lD.instance)},set:function(e){ND=e}},{key:"defaultLocale",get:function(){return LD},set:function(e){LD=e}},{key:"defaultNumberingSystem",get:function(){return DD},set:function(e){DD=e}},{key:"defaultOutputCalendar",get:function(){return BD},set:function(e){BD=e}},{key:"defaultWeekSettings",get:function(){return FD},set:function(e){FD=cB(e)}},{key:"twoDigitCutoffYear",get:function(){return zD},set:function(e){zD=e%100}},{key:"throwOnInvalid",get:function(){return kD},set:function(e){kD=e}}]),e}(),jD=function(){function e(e,t){this.reason=e,this.explanation=t}return e.prototype.toMessage=function(){return this.explanation?this.reason+": "+this.explanation:this.reason},e}(),HD=[0,31,59,90,120,151,181,212,243,273,304,334],VD=[0,31,60,91,121,152,182,213,244,274,305,335];function GD(e,t){return new jD("unit out of range","you specified "+t+" (of type "+typeof t+") as a "+e+", which is invalid")}function WD(e,t,n){var r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);var i=r.getUTCDay();return 0===i?7:i}function qD(e,t,n){return n+(gB(e)?VD:HD)[t-1]}function KD(e,t){var n=gB(e)?VD:HD,r=n.findIndex((function(e){return e<t}));return{month:r+1,day:t-n[r]}}function JD(e,t){return(e-t+7)%7+1}function QD(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r,i=e.year,o=e.month,s=e.day,a=qD(i,o,s),l=JD(WD(i,o,s),n),c=Math.floor((a-l+14-t)/7);return c<1?c=xB(r=i-1,t,n):c>xB(i,t,n)?(r=i+1,c=1):r=i,vL({weekYear:r,weekNumber:c,weekday:l},TB(e))}function YD(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r,i=e.weekYear,o=e.weekNumber,s=e.weekday,a=JD(WD(i,1,t),n),l=vB(i),c=7*o+s-a-7+t;c<1?c+=vB(r=i-1):c>l?(r=i+1,c-=vB(i)):r=i;var u=KD(r,c);return vL({year:r,month:u.month,day:u.day},TB(e))}function XD(e){var t=e.year;return vL({year:t,ordinal:qD(t,e.month,e.day)},TB(e))}function $D(e){var t=e.year,n=KD(t,e.ordinal);return vL({year:t,month:n.month,day:n.day},TB(e))}function ZD(e,t){if(!nB(e.localWeekday)||!nB(e.localWeekNumber)||!nB(e.localWeekYear)){if(!nB(e.weekday)||!nB(e.weekNumber)||!nB(e.weekYear))throw new PL("Cannot mix locale-based week fields with ISO-based week fields");return nB(e.localWeekday)||(e.weekday=e.localWeekday),nB(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),nB(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function eB(e){var t=iB(e.year),n=uB(e.month,1,12),r=uB(e.day,1,yB(e.year,e.month));return t?n?!r&&GD("day",e.day):GD("month",e.month):GD("year",e.year)}function tB(e){var t=e.hour,n=e.minute,r=e.second,i=e.millisecond,o=uB(t,0,23)||24===t&&0===n&&0===r&&0===i,s=uB(n,0,59),a=uB(r,0,59),l=uB(i,0,999);return o?s?a?!l&&GD("millisecond",i):GD("second",r):GD("minute",n):GD("hour",t)}function nB(e){return void 0===e}function rB(e){return"number"==typeof e}function iB(e){return"number"==typeof e&&e%1==0}function oB(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function sB(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function aB(e,t,n){if(0!==e.length)return e.reduce((function(e,r){var i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i}),null)[1]}function lB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function cB(e){if(null==e)return null;if("object"!=typeof e)throw new OL("Week settings must be an object");if(!uB(e.firstDay,1,7)||!uB(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some((function(e){return!uB(e,1,7)})))throw new OL("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function uB(e,t,n){return iB(e)&&e>=t&&e<=n}function dB(e,t){return void 0===t&&(t=2),e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0")}function pB(e){return nB(e)||null===e||""===e?void 0:parseInt(e,10)}function hB(e){return nB(e)||null===e||""===e?void 0:parseFloat(e)}function fB(e){if(!nB(e)&&null!==e&&""!==e){var t=1e3*parseFloat("0."+e);return Math.floor(t)}}function mB(e,t,n){void 0===n&&(n=!1);var r=Math.pow(10,t);return(n?Math.trunc:Math.round)(e*r)/r}function gB(e){return e%4==0&&(e%100!=0||e%400==0)}function vB(e){return gB(e)?366:365}function yB(e,t){var n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?gB(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function bB(e){var t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t)).setUTCFullYear(e.year,e.month-1,e.day),+t}function SB(e,t,n){return-JD(WD(e,1,t),n)+t-1}function xB(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r=SB(e,t,n),i=SB(e+1,t,n);return(vB(e)-r+i)/7}function wB(e){return e>99?e:e>UD.twoDigitCutoffYear?1900+e:2e3+e}function CB(e,t,n,r){void 0===r&&(r=null);var i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);var s=vL({timeZoneName:t},o),a=new Intl.DateTimeFormat(n,s).formatToParts(i).find((function(e){return"timezonename"===e.type.toLowerCase()}));return a?a.value:null}function AB(e,t){var n=parseInt(e,10);Number.isNaN(n)&&(n=0);var r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function EB(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new OL("Invalid unit value "+e);return t}function MB(e,t){var n={};for(var r in e)if(lB(e,r)){var i=e[r];if(null==i)continue;n[t(r)]=EB(i)}return n}function _B(e,t){var n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return""+i+dB(n,2)+":"+dB(r,2);case"narrow":return""+i+n+(r>0?":"+r:"");case"techie":return""+i+dB(n,2)+dB(r,2);default:throw new RangeError("Value format "+t+" is out of range for property format")}}function TB(e){return function(e,t){return t.reduce((function(t,n){return t[n]=e[n],t}),{})}(e,["hour","minute","second","millisecond"])}var IB=["January","February","March","April","May","June","July","August","September","October","November","December"],RB=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],PB=["J","F","M","A","M","J","J","A","S","O","N","D"];function kB(e){switch(e){case"narrow":return[].concat(PB);case"short":return[].concat(RB);case"long":return[].concat(IB);case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var OB=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],NB=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],LB=["M","T","W","T","F","S","S"];function DB(e){switch(e){case"narrow":return[].concat(LB);case"short":return[].concat(NB);case"long":return[].concat(OB);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var BB=["AM","PM"],zB=["Before Christ","Anno Domini"],FB=["BC","AD"],UB=["B","A"];function jB(e){switch(e){case"narrow":return[].concat(UB);case"short":return[].concat(FB);case"long":return[].concat(zB);default:return null}}function HB(e,t){for(var n,r="",i=ML(e);!(n=i()).done;){var o=n.value;o.literal?r+=o.val:r+=t(o.val)}return r}var VB={D:zL,DD:FL,DDD:jL,DDDD:HL,t:VL,tt:GL,ttt:WL,tttt:qL,T:KL,TT:JL,TTT:QL,TTTT:YL,f:XL,ff:ZL,fff:nD,ffff:iD,F:$L,FF:eD,FFF:rD,FFFF:oD},GB=function(){function e(e,t){this.opts=t,this.loc=e,this.systemLoc=null}e.create=function(t,n){return void 0===n&&(n={}),new e(t,n)},e.parseFormat=function(e){for(var t=null,n="",r=!1,i=[],o=0;o<e.length;o++){var s=e.charAt(o);"'"===s?(n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),t=null,n="",r=!r):r||s===t?n+=s:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=s,t=s)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i},e.macroTokenToFormatOpts=function(e){return VB[e]};var t=e.prototype;return t.formatWithSystemDefault=function(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,vL({},this.opts,t)).format()},t.dtFormatter=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,vL({},this.opts,t))},t.formatDateTime=function(e,t){return this.dtFormatter(e,t).format()},t.formatDateTimeParts=function(e,t){return this.dtFormatter(e,t).formatToParts()},t.formatInterval=function(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())},t.resolvedOptions=function(e,t){return this.dtFormatter(e,t).resolvedOptions()},t.num=function(e,t){if(void 0===t&&(t=0),this.opts.forceSimple)return dB(e,t);var n=vL({},this.opts);return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)},t.formatDateTimeFromString=function(t,n){var r=this,i="en"===this.loc.listingMode(),o=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,s=function(e,n){return r.loc.extract(t,e,n)},a=function(e){return t.isOffsetFixed&&0===t.offset&&e.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,e.format):""},l=function(){return i?function(e){return BB[e.hour<12?0:1]}(t):s({hour:"numeric",hourCycle:"h12"},"dayperiod")},c=function(e,n){return i?function(e,t){return kB(t)[e.month-1]}(t,e):s(n?{month:e}:{month:e,day:"numeric"},"month")},u=function(e,n){return i?function(e,t){return DB(t)[e.weekday-1]}(t,e):s(n?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday")},d=function(e){return i?function(e,t){return jB(t)[e.year<0?0:1]}(t,e):s({era:e},"era")};return HB(e.parseFormat(n),(function(n){switch(n){case"S":return r.num(t.millisecond);case"u":case"SSS":return r.num(t.millisecond,3);case"s":return r.num(t.second);case"ss":return r.num(t.second,2);case"uu":return r.num(Math.floor(t.millisecond/10),2);case"uuu":return r.num(Math.floor(t.millisecond/100));case"m":return r.num(t.minute);case"mm":return r.num(t.minute,2);case"h":return r.num(t.hour%12==0?12:t.hour%12);case"hh":return r.num(t.hour%12==0?12:t.hour%12,2);case"H":return r.num(t.hour);case"HH":return r.num(t.hour,2);case"Z":return a({format:"narrow",allowZ:r.opts.allowZ});case"ZZ":return a({format:"short",allowZ:r.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:r.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:r.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:r.loc.locale});case"z":return t.zoneName;case"a":return l();case"d":return o?s({day:"numeric"},"day"):r.num(t.day);case"dd":return o?s({day:"2-digit"},"day"):r.num(t.day,2);case"c":case"E":return r.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return o?s({month:"numeric",day:"numeric"},"month"):r.num(t.month);case"LL":return o?s({month:"2-digit",day:"numeric"},"month"):r.num(t.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return o?s({month:"numeric"},"month"):r.num(t.month);case"MM":return o?s({month:"2-digit"},"month"):r.num(t.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return o?s({year:"numeric"},"year"):r.num(t.year);case"yy":return o?s({year:"2-digit"},"year"):r.num(t.year.toString().slice(-2),2);case"yyyy":return o?s({year:"numeric"},"year"):r.num(t.year,4);case"yyyyyy":return o?s({year:"numeric"},"year"):r.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return r.num(t.weekYear.toString().slice(-2),2);case"kkkk":return r.num(t.weekYear,4);case"W":return r.num(t.weekNumber);case"WW":return r.num(t.weekNumber,2);case"n":return r.num(t.localWeekNumber);case"nn":return r.num(t.localWeekNumber,2);case"ii":return r.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return r.num(t.localWeekYear,4);case"o":return r.num(t.ordinal);case"ooo":return r.num(t.ordinal,3);case"q":return r.num(t.quarter);case"qq":return r.num(t.quarter,2);case"X":return r.num(Math.floor(t.ts/1e3));case"x":return r.num(t.ts);default:return function(n){var i=e.macroTokenToFormatOpts(n);return i?r.formatWithSystemDefault(t,i):n}(n)}}))},t.formatDurationFromString=function(t,n){var r,i=this,o=function(e){switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=e.parseFormat(n),a=s.reduce((function(e,t){var n=t.literal,r=t.val;return n?e:e.concat(r)}),[]),l=t.shiftTo.apply(t,a.map(o).filter((function(e){return e})));return HB(s,(r=l,function(e){var t=o(e);return t?i.num(r.get(t),e.length):e}))},e}(),WB=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function qB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.reduce((function(e,t){return e+t.source}),"");return RegExp("^"+r+"$")}function KB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduce((function(t,n){var r=t[0],i=t[1],o=t[2],s=n(e,o),a=s[0],l=s[1],c=s[2];return[vL({},r,a),l||i,c]}),[{},null,1]).slice(0,2)}}function JB(e){if(null==e)return[null,null];for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=0,o=n;i<o.length;i++){var s=o[i],a=s[0],l=s[1],c=a.exec(e);if(c)return l(c)}return[null,null]}function QB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n){var r,i={};for(r=0;r<t.length;r++)i[t[r]]=pB(e[n+r]);return[i,null,n+r]}}var YB=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,XB=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,$B=RegExp(""+XB.source+("(?:"+YB.source+"?(?:\\[("+WB.source+")\\])?)?")),ZB=RegExp("(?:T"+$B.source+")?"),ez=QB("weekYear","weekNumber","weekDay"),tz=QB("year","ordinal"),nz=RegExp(XB.source+" ?(?:"+YB.source+"|("+WB.source+"))?"),rz=RegExp("(?: "+nz.source+")?");function iz(e,t,n){var r=e[t];return nB(r)?n:pB(r)}function oz(e,t){return[{hours:iz(e,t,0),minutes:iz(e,t+1,0),seconds:iz(e,t+2,0),milliseconds:fB(e[t+3])},null,t+4]}function sz(e,t){var n=!e[t]&&!e[t+1],r=AB(e[t+1],e[t+2]);return[{},n?null:ID.instance(r),t+3]}function az(e,t){return[{},e[t]?pD.create(e[t]):null,t+1]}var lz=RegExp("^T?"+XB.source+"$"),cz=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function uz(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u="-"===t[0],d=l&&"-"===l[0],p=function(e,t){return void 0===t&&(t=!1),void 0!==e&&(t||e&&u)?-e:e};return[{years:p(hB(n)),months:p(hB(r)),weeks:p(hB(i)),days:p(hB(o)),hours:p(hB(s)),minutes:p(hB(a)),seconds:p(hB(l),"-0"===l),milliseconds:p(fB(c),d)}]}var dz={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function pz(e,t,n,r,i,o,s){var a={year:2===t.length?wB(pB(t)):pB(t),month:RB.indexOf(n)+1,day:pB(r),hour:pB(i),minute:pB(o)};return s&&(a.second=pB(s)),e&&(a.weekday=e.length>3?OB.indexOf(e)+1:NB.indexOf(e)+1),a}var hz=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function fz(e){var t,n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],d=e[10],p=e[11],h=pz(n,o,i,r,s,a,l);return t=c?dz[c]:u?0:AB(d,p),[h,new ID(t)]}var mz=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,gz=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,vz=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function yz(e){var t=e[1],n=e[2],r=e[3];return[pz(t,e[4],r,n,e[5],e[6],e[7]),ID.utcInstance]}function bz(e){var t=e[1],n=e[2],r=e[3],i=e[4],o=e[5],s=e[6];return[pz(t,e[7],n,r,i,o,s),ID.utcInstance]}var Sz=qB(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,ZB),xz=qB(/(\d{4})-?W(\d\d)(?:-?(\d))?/,ZB),wz=qB(/(\d{4})-?(\d{3})/,ZB),Cz=qB($B),Az=KB((function(e,t){return[{year:iz(e,t),month:iz(e,t+1,1),day:iz(e,t+2,1)},null,t+3]}),oz,sz,az),Ez=KB(ez,oz,sz,az),Mz=KB(tz,oz,sz,az),_z=KB(oz,sz,az);var Tz=KB(oz);var Iz=qB(/(\d{4})-(\d\d)-(\d\d)/,rz),Rz=qB(nz),Pz=KB(oz,sz,az);var kz="Invalid Duration",Oz={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Nz=vL({years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},Oz),Lz=365.2425,Dz=30.436875,Bz=vL({years:{quarters:4,months:12,weeks:52.1775,days:Lz,hours:8765.82,minutes:525949.2,seconds:31556952,milliseconds:31556952e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:7889238,milliseconds:7889238e3},months:{weeks:4.3481250000000005,days:Dz,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},Oz),zz=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Fz=zz.slice(0).reverse();function Uz(e,t,n){void 0===n&&(n=!1);var r={values:n?t.values:vL({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Vz(r)}function jz(e,t){for(var n,r,i=null!=(n=t.milliseconds)?n:0,o=ML(Fz.slice(1));!(r=o()).done;){var s=r.value;t[s]&&(i+=t[s]*e[s].milliseconds)}return i}function Hz(e,t){var n=jz(e,t)<0?-1:1;zz.reduceRight((function(r,i){if(nB(t[i]))return r;if(r){var o=t[r]*n,s=e[i][r],a=Math.floor(o/s);t[i]+=a*n,t[r]-=a*s*n}return i}),null),zz.reduce((function(n,r){if(nB(t[r]))return n;if(n){var i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r}),null)}var Vz=function(e){function t(e){var t="longterm"===e.conversionAccuracy||!1,n=t?Bz:Nz;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||_D.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}t.fromMillis=function(e,n){return t.fromObject({milliseconds:e},n)},t.fromObject=function(e,n){if(void 0===n&&(n={}),null==e||"object"!=typeof e)throw new OL("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new t({values:MB(e,t.normalizeUnit),loc:_D.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})},t.fromDurationLike=function(e){if(rB(e))return t.fromMillis(e);if(t.isDuration(e))return e;if("object"==typeof e)return t.fromObject(e);throw new OL("Unknown duration argument "+e+" of type "+typeof e)},t.fromISO=function(e,n){var r=function(e){return JB(e,[cz,uz])}(e),i=r[0];return i?t.fromObject(i,n):t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.fromISOTime=function(e,n){var r=function(e){return JB(e,[lz,Tz])}(e),i=r[0];return i?t.fromObject(i,n):t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new OL("need to specify a reason the Duration is invalid");var r=e instanceof jD?e:new jD(e,n);if(UD.throwOnInvalid)throw new RL(r);return new t({invalid:r})},t.normalizeUnit=function(e){var t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new kL(e);return t},t.isDuration=function(e){return e&&e.isLuxonDuration||!1};var n=t.prototype;return n.toFormat=function(e,t){void 0===t&&(t={});var n=vL({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?GB.create(this.loc,n).formatDurationFromString(this,e):kz},n.toHuman=function(e){var t=this;if(void 0===e&&(e={}),!this.isValid)return kz;var n=zz.map((function(n){var r=t.values[n];return nB(r)?null:t.loc.numberFormatter(vL({style:"unit",unitDisplay:"long"},e,{unit:n.slice(0,-1)})).format(r)})).filter((function(e){return e}));return this.loc.listFormatter(vL({type:"conjunction",style:e.listStyle||"narrow"},e)).format(n)},n.toObject=function(){return this.isValid?vL({},this.values):{}},n.toISO=function(){if(!this.isValid)return null;var e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=mB(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e},n.toISOTime=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var t=this.toMillis();return t<0||t>=864e5?null:(e=vL({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e,{includeOffset:!1}),DF.fromMillis(t,{zone:"UTC"}).toISOTime(e))},n.toJSON=function(){return this.toISO()},n.toString=function(){return this.toISO()},n[e]=function(){return this.isValid?"Duration { values: "+JSON.stringify(this.values)+" }":"Duration { Invalid, reason: "+this.invalidReason+" }"},n.toMillis=function(){return this.isValid?jz(this.matrix,this.values):NaN},n.valueOf=function(){return this.toMillis()},n.plus=function(e){if(!this.isValid)return this;for(var n=t.fromDurationLike(e),r={},i=0,o=zz;i<o.length;i++){var s=o[i];(lB(n.values,s)||lB(this.values,s))&&(r[s]=n.get(s)+this.get(s))}return Uz(this,{values:r},!0)},n.minus=function(e){if(!this.isValid)return this;var n=t.fromDurationLike(e);return this.plus(n.negate())},n.mapUnits=function(e){if(!this.isValid)return this;for(var t={},n=0,r=Object.keys(this.values);n<r.length;n++){var i=r[n];t[i]=EB(e(this.values[i],i))}return Uz(this,{values:t},!0)},n.get=function(e){return this[t.normalizeUnit(e)]},n.set=function(e){return this.isValid?Uz(this,{values:vL({},this.values,MB(e,t.normalizeUnit))}):this},n.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.conversionAccuracy,o=t.matrix;return Uz(this,{loc:this.loc.clone({locale:n,numberingSystem:r}),matrix:o,conversionAccuracy:i})},n.as=function(e){return this.isValid?this.shiftTo(e).get(e):NaN},n.normalize=function(){if(!this.isValid)return this;var e=this.toObject();return Hz(this.matrix,e),Uz(this,{values:e},!0)},n.rescale=function(){return this.isValid?Uz(this,{values:function(e){for(var t={},n=0,r=Object.entries(e);n<r.length;n++){var i=r[n],o=i[0],s=i[1];0!==s&&(t[o]=s)}return t}(this.normalize().shiftToAll().toObject())},!0):this},n.shiftTo=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!this.isValid)return this;if(0===n.length)return this;n=n.map((function(e){return t.normalizeUnit(e)}));for(var i,o={},s={},a=this.toObject(),l=0,c=zz;l<c.length;l++){var u=c[l];if(n.indexOf(u)>=0){i=u;var d=0;for(var p in s)d+=this.matrix[p][u]*s[p],s[p]=0;rB(a[u])&&(d+=a[u]);var h=Math.trunc(d);o[u]=h,s[u]=(1e3*d-1e3*h)/1e3}else rB(a[u])&&(s[u]=a[u])}for(var f in s)0!==s[f]&&(o[i]+=f===i?s[f]:s[f]/this.matrix[i][f]);return Hz(this.matrix,o),Uz(this,{values:o},!0)},n.shiftToAll=function(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this},n.negate=function(){if(!this.isValid)return this;for(var e={},t=0,n=Object.keys(this.values);t<n.length;t++){var r=n[t];e[r]=0===this.values[r]?0:-this.values[r]}return Uz(this,{values:e},!0)},n.equals=function(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(var t=0,n=zz;t<n.length;t++){var r=n[t];if(i=this.values[r],o=e.values[r],!(void 0===i||0===i?void 0===o||0===o:i===o))return!1}var i,o;return!0},gL(t,[{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"years",get:function(){return this.isValid?this.values.years||0:NaN}},{key:"quarters",get:function(){return this.isValid?this.values.quarters||0:NaN}},{key:"months",get:function(){return this.isValid?this.values.months||0:NaN}},{key:"weeks",get:function(){return this.isValid?this.values.weeks||0:NaN}},{key:"days",get:function(){return this.isValid?this.values.days||0:NaN}},{key:"hours",get:function(){return this.isValid?this.values.hours||0:NaN}},{key:"minutes",get:function(){return this.isValid?this.values.minutes||0:NaN}},{key:"seconds",get:function(){return this.isValid?this.values.seconds||0:NaN}},{key:"milliseconds",get:function(){return this.isValid?this.values.milliseconds||0:NaN}},{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),t}(Symbol.for("nodejs.util.inspect.custom")),Gz="Invalid Interval";var Wz=function(e){function t(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new OL("need to specify a reason the Interval is invalid");var r=e instanceof jD?e:new jD(e,n);if(UD.throwOnInvalid)throw new IL(r);return new t({invalid:r})},t.fromDateTimes=function(e,n){var r=BF(e),i=BF(n),o=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?Wz.invalid("end before start","The end of an interval must be after its start, but you had start="+e.toISO()+" and end="+t.toISO()):null:Wz.invalid("missing or invalid end"):Wz.invalid("missing or invalid start")}(r,i);return null==o?new t({start:r,end:i}):o},t.after=function(e,n){var r=Vz.fromDurationLike(n),i=BF(e);return t.fromDateTimes(i,i.plus(r))},t.before=function(e,n){var r=Vz.fromDurationLike(n),i=BF(e);return t.fromDateTimes(i.minus(r),i)},t.fromISO=function(e,n){var r=(e||"").split("/",2),i=r[0],o=r[1];if(i&&o){var s,a,l,c;try{a=(s=DF.fromISO(i,n)).isValid}catch(e){a=!1}try{c=(l=DF.fromISO(o,n)).isValid}catch(e){c=!1}if(a&&c)return t.fromDateTimes(s,l);if(a){var u=Vz.fromISO(o,n);if(u.isValid)return t.after(s,u)}else if(c){var d=Vz.fromISO(i,n);if(d.isValid)return t.before(l,d)}}return t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.isInterval=function(e){return e&&e.isLuxonInterval||!1};var n=t.prototype;return n.length=function(e){return void 0===e&&(e="milliseconds"),this.isValid?this.toDuration.apply(this,[e]).get(e):NaN},n.count=function(e,t){if(void 0===e&&(e="milliseconds"),!this.isValid)return NaN;var n,r=this.start.startOf(e,t);return n=(n=null!=t&&t.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end).startOf(e,t),Math.floor(n.diff(r,e).get(e))+(n.valueOf()!==this.end.valueOf())},n.hasSame=function(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))},n.isEmpty=function(){return this.s.valueOf()===this.e.valueOf()},n.isAfter=function(e){return!!this.isValid&&this.s>e},n.isBefore=function(e){return!!this.isValid&&this.e<=e},n.contains=function(e){return!!this.isValid&&(this.s<=e&&this.e>e)},n.set=function(e){var n=void 0===e?{}:e,r=n.start,i=n.end;return this.isValid?t.fromDateTimes(r||this.s,i||this.e):this},n.splitAt=function(){var e=this;if(!this.isValid)return[];for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=r.map(BF).filter((function(t){return e.contains(t)})).sort((function(e,t){return e.toMillis()-t.toMillis()})),s=[],a=this.s,l=0;a<this.e;){var c=o[l]||this.e,u=+c>+this.e?this.e:c;s.push(t.fromDateTimes(a,u)),a=u,l+=1}return s},n.splitBy=function(e){var n=Vz.fromDurationLike(e);if(!this.isValid||!n.isValid||0===n.as("milliseconds"))return[];for(var r,i=this.s,o=1,s=[];i<this.e;){var a=this.start.plus(n.mapUnits((function(e){return e*o})));r=+a>+this.e?this.e:a,s.push(t.fromDateTimes(i,r)),i=r,o+=1}return s},n.divideEqually=function(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},n.overlaps=function(e){return this.e>e.s&&this.s<e.e},n.abutsStart=function(e){return!!this.isValid&&+this.e==+e.s},n.abutsEnd=function(e){return!!this.isValid&&+e.e==+this.s},n.engulfs=function(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)},n.equals=function(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))},n.intersection=function(e){if(!this.isValid)return this;var n=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return n>=r?null:t.fromDateTimes(n,r)},n.union=function(e){if(!this.isValid)return this;var n=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return t.fromDateTimes(n,r)},t.merge=function(e){var t=e.sort((function(e,t){return e.s-t.s})).reduce((function(e,t){var n=e[0],r=e[1];return r?r.overlaps(t)||r.abutsStart(t)?[n,r.union(t)]:[n.concat([r]),t]:[n,t]}),[[],null]),n=t[0],r=t[1];return r&&n.push(r),n},t.xor=function(e){for(var n,r,i=null,o=0,s=[],a=e.map((function(e){return[{time:e.s,type:"s"},{time:e.e,type:"e"}]})),l=(n=Array.prototype).concat.apply(n,a).sort((function(e,t){return e.time-t.time})),c=ML(l);!(r=c()).done;){var u=r.value;1===(o+="s"===u.type?1:-1)?i=u.time:(i&&+i!=+u.time&&s.push(t.fromDateTimes(i,u.time)),i=null)}return t.merge(s)},n.difference=function(){for(var e=this,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.xor([this].concat(r)).map((function(t){return e.intersection(t)})).filter((function(e){return e&&!e.isEmpty()}))},n.toString=function(){return this.isValid?"["+this.s.toISO()+" – "+this.e.toISO()+")":Gz},n[e]=function(){return this.isValid?"Interval { start: "+this.s.toISO()+", end: "+this.e.toISO()+" }":"Interval { Invalid, reason: "+this.invalidReason+" }"},n.toLocaleString=function(e,t){return void 0===e&&(e=zL),void 0===t&&(t={}),this.isValid?GB.create(this.s.loc.clone(t),e).formatInterval(this):Gz},n.toISO=function(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):Gz},n.toISODate=function(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():Gz},n.toISOTime=function(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):Gz},n.toFormat=function(e,t){var n=(void 0===t?{}:t).separator,r=void 0===n?" – ":n;return this.isValid?""+this.s.toFormat(e)+r+this.e.toFormat(e):Gz},n.toDuration=function(e,t){return this.isValid?this.e.diff(this.s,e,t):Vz.invalid(this.invalidReason)},n.mapEndpoints=function(e){return t.fromDateTimes(e(this.s),e(this.e))},gL(t,[{key:"start",get:function(){return this.isValid?this.s:null}},{key:"end",get:function(){return this.isValid?this.e:null}},{key:"isValid",get:function(){return null===this.invalidReason}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),t}(Symbol.for("nodejs.util.inspect.custom")),qz=function(){function e(){}return e.hasDST=function(e){void 0===e&&(e=UD.defaultZone);var t=DF.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset},e.isValidIANAZone=function(e){return pD.isValidZone(e)},e.normalizeZone=function(e){return PD(e,UD.defaultZone)},e.getStartOfWeek=function(e){var t=void 0===e?{}:e,n=t.locale,r=void 0===n?null:n,i=t.locObj;return((void 0===i?null:i)||_D.create(r)).getStartOfWeek()},e.getMinimumDaysInFirstWeek=function(e){var t=void 0===e?{}:e,n=t.locale,r=void 0===n?null:n,i=t.locObj;return((void 0===i?null:i)||_D.create(r)).getMinDaysInFirstWeek()},e.getWeekendWeekdays=function(e){var t=void 0===e?{}:e,n=t.locale,r=void 0===n?null:n,i=t.locObj;return((void 0===i?null:i)||_D.create(r)).getWeekendDays().slice()},e.months=function(e,t){void 0===e&&(e="long");var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,s=void 0===o?null:o,a=n.locObj,l=void 0===a?null:a,c=n.outputCalendar,u=void 0===c?"gregory":c;return(l||_D.create(i,s,u)).months(e)},e.monthsFormat=function(e,t){void 0===e&&(e="long");var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,s=void 0===o?null:o,a=n.locObj,l=void 0===a?null:a,c=n.outputCalendar,u=void 0===c?"gregory":c;return(l||_D.create(i,s,u)).months(e,!0)},e.weekdays=function(e,t){void 0===e&&(e="long");var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,s=void 0===o?null:o,a=n.locObj;return((void 0===a?null:a)||_D.create(i,s,null)).weekdays(e)},e.weekdaysFormat=function(e,t){void 0===e&&(e="long");var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,s=void 0===o?null:o,a=n.locObj;return((void 0===a?null:a)||_D.create(i,s,null)).weekdays(e,!0)},e.meridiems=function(e){var t=(void 0===e?{}:e).locale,n=void 0===t?null:t;return _D.create(n).meridiems()},e.eras=function(e,t){void 0===e&&(e="short");var n=(void 0===t?{}:t).locale,r=void 0===n?null:n;return _D.create(r,null,"gregory").eras(e)},e.features=function(){return{relative:oB(),localeWeek:sB()}},e}();function Kz(e,t){var n=function(e){return e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf()},r=n(t)-n(e);return Math.floor(Vz.fromMillis(r).as("days"))}function Jz(e,t,n,r){var i=function(e,t,n){for(var r,i,o=[["years",function(e,t){return t.year-e.year}],["quarters",function(e,t){return t.quarter-e.quarter+4*(t.year-e.year)}],["months",function(e,t){return t.month-e.month+12*(t.year-e.year)}],["weeks",function(e,t){var n=Kz(e,t);return(n-n%7)/7}],["days",Kz]],s={},a=e,l=0,c=o;l<c.length;l++){var u=c[l],d=u[0],p=u[1];n.indexOf(d)>=0&&(r=d,s[d]=p(e,t),(i=a.plus(s))>t?(s[d]--,(e=a.plus(s))>t&&(i=e,s[d]--,e=a.plus(s))):e=i)}return[e,s,i,r]}(e,t,n),o=i[0],s=i[1],a=i[2],l=i[3],c=t-o,u=n.filter((function(e){return["hours","minutes","seconds","milliseconds"].indexOf(e)>=0}));if(0===u.length){var d;if(a<t)a=o.plus(((d={})[l]=1,d));a!==o&&(s[l]=(s[l]||0)+c/(a-o))}var p,h=Vz.fromObject(s,r);return u.length>0?(p=Vz.fromMillis(c,r)).shiftTo.apply(p,u).plus(h):h}var Qz={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Yz={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Xz=Qz.hanidec.replace(/[\[|\]]/g,"").split("");function $z(e,t){var n=e.numberingSystem;return void 0===t&&(t=""),new RegExp(""+Qz[n||"latn"]+t)}function Zz(e,t){return void 0===t&&(t=function(e){return e}),{regex:e,deser:function(e){var n=e[0];return t(function(e){var t=parseInt(e,10);if(isNaN(t)){t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(-1!==e[n].search(Qz.hanidec))t+=Xz.indexOf(e[n]);else for(var i in Yz){var o=Yz[i],s=o[0],a=o[1];r>=s&&r<=a&&(t+=r-s)}}return parseInt(t,10)}return t}(n))}}}var eF="[ "+String.fromCharCode(160)+"]",tF=new RegExp(eF,"g");function nF(e){return e.replace(/\./g,"\\.?").replace(tF,eF)}function rF(e){return e.replace(/\./g,"").replace(tF," ").toLowerCase()}function iF(e,t){return null===e?null:{regex:RegExp(e.map(nF).join("|")),deser:function(n){var r=n[0];return e.findIndex((function(e){return rF(r)===rF(e)}))+t}}}function oF(e,t){return{regex:e,deser:function(e){return AB(e[1],e[2])},groups:t}}function sF(e){return{regex:e,deser:function(e){return e[0]}}}var aF={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};var lF=null;function cF(e,t){var n;return(n=Array.prototype).concat.apply(n,e.map((function(e){return function(e,t){if(e.literal)return e;var n=dF(GB.macroTokenToFormatOpts(e.val),t);return null==n||n.includes(void 0)?e:n}(e,t)})))}function uF(e,t,n){var r=cF(GB.parseFormat(n),e),i=r.map((function(t){return n=t,i=$z(r=e),o=$z(r,"{2}"),s=$z(r,"{3}"),a=$z(r,"{4}"),l=$z(r,"{6}"),c=$z(r,"{1,2}"),u=$z(r,"{1,3}"),d=$z(r,"{1,6}"),p=$z(r,"{1,9}"),h=$z(r,"{2,4}"),f=$z(r,"{4,6}"),m=function(e){return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:function(e){return e[0]},literal:!0};var t},g=function(e){if(n.literal)return m(e);switch(e.val){case"G":return iF(r.eras("short"),0);case"GG":return iF(r.eras("long"),0);case"y":return Zz(d);case"yy":case"kk":return Zz(h,wB);case"yyyy":case"kkkk":return Zz(a);case"yyyyy":return Zz(f);case"yyyyyy":return Zz(l);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Zz(c);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Zz(o);case"MMM":return iF(r.months("short",!0),1);case"MMMM":return iF(r.months("long",!0),1);case"LLL":return iF(r.months("short",!1),1);case"LLLL":return iF(r.months("long",!1),1);case"o":case"S":return Zz(u);case"ooo":case"SSS":return Zz(s);case"u":return sF(p);case"uu":return sF(c);case"uuu":case"E":case"c":return Zz(i);case"a":return iF(r.meridiems(),0);case"EEE":return iF(r.weekdays("short",!1),1);case"EEEE":return iF(r.weekdays("long",!1),1);case"ccc":return iF(r.weekdays("short",!0),1);case"cccc":return iF(r.weekdays("long",!0),1);case"Z":case"ZZ":return oF(new RegExp("([+-]"+c.source+")(?::("+o.source+"))?"),2);case"ZZZ":return oF(new RegExp("([+-]"+c.source+")("+o.source+")?"),2);case"z":return sF(/[a-z_+-/]{1,256}?/i);case" ":return sF(/[^\S\n\r]/);default:return m(e)}}(n)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"},g.token=n,g;var n,r,i,o,s,a,l,c,u,d,p,h,f,m,g})),o=i.find((function(e){return e.invalidReason}));if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};var s=function(e){var t=e.map((function(e){return e.regex})).reduce((function(e,t){return e+"("+t.source+")"}),"");return["^"+t+"$",e]}(i),a=s[0],l=s[1],c=RegExp(a,"i"),u=function(e,t,n){var r=e.match(t);if(r){var i={},o=1;for(var s in n)if(lB(n,s)){var a=n[s],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+l))),o+=l}return[r,i]}return[r,{}]}(t,c,l),d=u[0],p=u[1],h=p?function(e){var t,n=null;nB(e.z)||(n=pD.create(e.z)),nB(e.Z)||(n||(n=new ID(e.Z)),t=e.Z),nB(e.q)||(e.M=3*(e.q-1)+1),nB(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),nB(e.u)||(e.S=fB(e.u));var r=Object.keys(e).reduce((function(t,n){var r=function(e){switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}}(n);return r&&(t[r]=e[n]),t}),{});return[r,n,t]}(p):[null,null,void 0],f=h[0],m=h[1],g=h[2];if(lB(p,"a")&&lB(p,"H"))throw new PL("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:c,rawMatches:d,matches:p,result:f,zone:m,specificOffset:g}}function dF(e,t){if(!e)return null;var n=GB.create(t,e).dtFormatter((lF||(lF=DF.fromMillis(1555555555555)),lF)),r=n.formatToParts(),i=n.resolvedOptions();return r.map((function(t){return function(e,t,n){var r=e.type,i=e.value;if("literal"===r){var o=/^\s+$/.test(i);return{literal:!o,val:o?" ":i}}var s=t[r],a=r;"hour"===r&&(a=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":n.hour12?"hour12":"hour24");var l=aF[a];if("object"==typeof l&&(l=l[s]),l)return{literal:!1,val:l}}(t,e,i)}))}var pF="Invalid DateTime",hF=864e13;function fF(e){return new jD("unsupported zone",'the zone "'+e.name+'" is not supported')}function mF(e){return null===e.weekData&&(e.weekData=QD(e.c)),e.weekData}function gF(e){return null===e.localWeekData&&(e.localWeekData=QD(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function vF(e,t){var n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new DF(vL({},n,t,{old:n}))}function yF(e,t,n){var r=e-6e4*t,i=n.offset(r);if(t===i)return[r,t];r-=6e4*(i-t);var o=n.offset(r);return i===o?[r,i]:[e-6e4*Math.min(i,o),Math.max(i,o)]}function bF(e,t){var n=new Date(e+=6e4*t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function SF(e,t,n){return yF(bB(e),t,n)}function xF(e,t){var n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),o=vL({},e.c,{year:r,month:i,day:Math.min(e.c.day,yB(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)}),s=Vz.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=yF(bB(o),n,e.zone),l=a[0],c=a[1];return 0!==s&&(l+=s,c=e.zone.offset(l)),{ts:l,o:c}}function wF(e,t,n,r,i,o){var s=n.setZone,a=n.zone;if(e&&0!==Object.keys(e).length||t){var l=t||a,c=DF.fromObject(e,vL({},n,{zone:l,specificOffset:o}));return s?c:c.setZone(a)}return DF.invalid(new jD("unparsable",'the input "'+i+"\" can't be parsed as "+r))}function CF(e,t,n){return void 0===n&&(n=!0),e.isValid?GB.create(_D.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function AF(e,t){var n=e.c.year>9999||e.c.year<0,r="";return n&&e.c.year>=0&&(r+="+"),r+=dB(e.c.year,n?6:4),t?(r+="-",r+=dB(e.c.month),r+="-",r+=dB(e.c.day)):(r+=dB(e.c.month),r+=dB(e.c.day)),r}function EF(e,t,n,r,i,o){var s=dB(e.c.hour);return t?(s+=":",s+=dB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=":")):s+=dB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=dB(e.c.second),0===e.c.millisecond&&r||(s+=".",s+=dB(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!o?s+="Z":e.o<0?(s+="-",s+=dB(Math.trunc(-e.o/60)),s+=":",s+=dB(Math.trunc(-e.o%60))):(s+="+",s+=dB(Math.trunc(e.o/60)),s+=":",s+=dB(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}var MF={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},_F={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},TF={ordinal:1,hour:0,minute:0,second:0,millisecond:0},IF=["year","month","day","hour","minute","second","millisecond"],RF=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],PF=["year","ordinal","hour","minute","second","millisecond"];function kF(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function(e){var t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new kL(e);return t}(e)}}function OF(e,t){var n,r,i=PD(t.zone,UD.defaultZone),o=_D.fromObject(t),s=UD.now();if(nB(e.year))n=s;else{for(var a=0,l=IF;a<l.length;a++){var c=l[a];nB(e[c])&&(e[c]=MF[c])}var u=eB(e)||tB(e);if(u)return DF.invalid(u);var d=SF(e,i.offset(s),i);n=d[0],r=d[1]}return new DF({ts:n,zone:i,loc:o,o:r})}function NF(e,t,n){var r=!!nB(n.round)||n.round,i=function(e,i){return e=mB(e,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(e,i)},o=function(r){return n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r)};if(n.unit)return i(o(n.unit),n.unit);for(var s,a=ML(n.units);!(s=a()).done;){var l=s.value,c=o(l);if(Math.abs(c)>=1)return i(c,l)}return i(e>t?-0:0,n.units[n.units.length-1])}function LF(e){var t,n={};return e.length>0&&"object"==typeof e[e.length-1]?(n=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[n,t]}var DF=function(e){function t(e){var t=e.zone||UD.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new jD("invalid input"):null)||(t.isValid?null:fF(t));this.ts=nB(e.ts)?UD.now():e.ts;var r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t)){var o=[e.old.c,e.old.o];r=o[0],i=o[1]}else{var s=t.offset(this.ts);r=bF(this.ts,s),r=(n=Number.isNaN(r.year)?new jD("invalid input"):null)?null:r,i=n?null:s}this._zone=t,this.loc=e.loc||_D.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}t.now=function(){return new t({})},t.local=function(){var e=LF(arguments),t=e[0],n=e[1],r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],c=n[6];return OF({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:c},t)},t.utc=function(){var e=LF(arguments),t=e[0],n=e[1],r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],c=n[6];return t.zone=ID.utcInstance,OF({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:c},t)},t.fromJSDate=function(e,n){void 0===n&&(n={});var r=function(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?e.valueOf():NaN;if(Number.isNaN(r))return t.invalid("invalid input");var i=PD(n.zone,UD.defaultZone);return i.isValid?new t({ts:r,zone:i,loc:_D.fromObject(n)}):t.invalid(fF(i))},t.fromMillis=function(e,n){if(void 0===n&&(n={}),rB(e))return e<-864e13||e>hF?t.invalid("Timestamp out of range"):new t({ts:e,zone:PD(n.zone,UD.defaultZone),loc:_D.fromObject(n)});throw new OL("fromMillis requires a numerical input, but received a "+typeof e+" with value "+e)},t.fromSeconds=function(e,n){if(void 0===n&&(n={}),rB(e))return new t({ts:1e3*e,zone:PD(n.zone,UD.defaultZone),loc:_D.fromObject(n)});throw new OL("fromSeconds requires a numerical input")},t.fromObject=function(e,n){void 0===n&&(n={}),e=e||{};var r=PD(n.zone,UD.defaultZone);if(!r.isValid)return t.invalid(fF(r));var i=_D.fromObject(n),o=MB(e,kF),s=ZD(o,i),a=s.minDaysInFirstWeek,l=s.startOfWeek,c=UD.now(),u=nB(n.specificOffset)?r.offset(c):n.specificOffset,d=!nB(o.ordinal),p=!nB(o.year),h=!nB(o.month)||!nB(o.day),f=p||h,m=o.weekYear||o.weekNumber;if((f||d)&&m)throw new PL("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&d)throw new PL("Can't mix ordinal dates with month/day");var g,v,y=m||o.weekday&&!f,b=bF(c,u);y?(g=RF,v=_F,b=QD(b,a,l)):d?(g=PF,v=TF,b=XD(b)):(g=IF,v=MF);for(var S,x=!1,w=ML(g);!(S=w()).done;){var C=S.value;nB(o[C])?o[C]=x?v[C]:b[C]:x=!0}var A=y?function(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r=iB(e.weekYear),i=uB(e.weekNumber,1,xB(e.weekYear,t,n)),o=uB(e.weekday,1,7);return r?i?!o&&GD("weekday",e.weekday):GD("week",e.weekNumber):GD("weekYear",e.weekYear)}(o,a,l):d?function(e){var t=iB(e.year),n=uB(e.ordinal,1,vB(e.year));return t?!n&&GD("ordinal",e.ordinal):GD("year",e.year)}(o):eB(o),E=A||tB(o);if(E)return t.invalid(E);var M=SF(y?YD(o,a,l):d?$D(o):o,u,r),_=new t({ts:M[0],zone:r,o:M[1],loc:i});return o.weekday&&f&&e.weekday!==_.weekday?t.invalid("mismatched weekday","you can't specify both a weekday of "+o.weekday+" and a date of "+_.toISO()):_},t.fromISO=function(e,t){void 0===t&&(t={});var n=function(e){return JB(e,[Sz,Az],[xz,Ez],[wz,Mz],[Cz,_z])}(e);return wF(n[0],n[1],t,"ISO 8601",e)},t.fromRFC2822=function(e,t){void 0===t&&(t={});var n=function(e){return JB(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[hz,fz])}(e);return wF(n[0],n[1],t,"RFC 2822",e)},t.fromHTTP=function(e,t){void 0===t&&(t={});var n=function(e){return JB(e,[mz,yz],[gz,yz],[vz,bz])}(e);return wF(n[0],n[1],t,"HTTP",t)},t.fromFormat=function(e,n,r){if(void 0===r&&(r={}),nB(e)||nB(n))throw new OL("fromFormat requires an input string and a format");var i=r,o=i.locale,s=void 0===o?null:o,a=i.numberingSystem,l=void 0===a?null:a,c=function(e,t,n){var r=uF(e,t,n);return[r.result,r.zone,r.specificOffset,r.invalidReason]}(_D.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),e,n),u=c[0],d=c[1],p=c[2],h=c[3];return h?t.invalid(h):wF(u,d,r,"format "+n,e,p)},t.fromString=function(e,n,r){return void 0===r&&(r={}),t.fromFormat(e,n,r)},t.fromSQL=function(e,t){void 0===t&&(t={});var n=function(e){return JB(e,[Iz,Az],[Rz,Pz])}(e);return wF(n[0],n[1],t,"SQL",e)},t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new OL("need to specify a reason the DateTime is invalid");var r=e instanceof jD?e:new jD(e,n);if(UD.throwOnInvalid)throw new TL(r);return new t({invalid:r})},t.isDateTime=function(e){return e&&e.isLuxonDateTime||!1},t.parseFormatForOpts=function(e,t){void 0===t&&(t={});var n=dF(e,_D.fromObject(t));return n?n.map((function(e){return e?e.val:null})).join(""):null},t.expandFormat=function(e,t){return void 0===t&&(t={}),cF(GB.parseFormat(e),_D.fromObject(t)).map((function(e){return e.val})).join("")};var n=t.prototype;return n.get=function(e){return this[e]},n.getPossibleOffsets=function(){if(!this.isValid||this.isOffsetFixed)return[this];var e=864e5,t=6e4,n=bB(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),o=this.zone.offset(n-r*t),s=this.zone.offset(n-i*t);if(o===s)return[this];var a=n-o*t,l=n-s*t,c=bF(a,o),u=bF(l,s);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[vF(this,{ts:a}),vF(this,{ts:l})]:[this]},n.resolvedLocaleOptions=function(e){void 0===e&&(e={});var t=GB.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t.locale,numberingSystem:t.numberingSystem,outputCalendar:t.calendar}},n.toUTC=function(e,t){return void 0===e&&(e=0),void 0===t&&(t={}),this.setZone(ID.instance(e),t)},n.toLocal=function(){return this.setZone(UD.defaultZone)},n.setZone=function(e,n){var r=void 0===n?{}:n,i=r.keepLocalTime,o=void 0!==i&&i,s=r.keepCalendarTime,a=void 0!==s&&s;if((e=PD(e,UD.defaultZone)).equals(this.zone))return this;if(e.isValid){var l=this.ts;if(o||a){var c=e.offset(this.ts);l=SF(this.toObject(),c,e)[0]}return vF(this,{ts:l,zone:e})}return t.invalid(fF(e))},n.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.outputCalendar;return vF(this,{loc:this.loc.clone({locale:n,numberingSystem:r,outputCalendar:i})})},n.setLocale=function(e){return this.reconfigure({locale:e})},n.set=function(e){if(!this.isValid)return this;var t,n=MB(e,kF),r=ZD(n,this.loc),i=r.minDaysInFirstWeek,o=r.startOfWeek,s=!nB(n.weekYear)||!nB(n.weekNumber)||!nB(n.weekday),a=!nB(n.ordinal),l=!nB(n.year),c=!nB(n.month)||!nB(n.day),u=l||c,d=n.weekYear||n.weekNumber;if((u||a)&&d)throw new PL("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new PL("Can't mix ordinal dates with month/day");s?t=YD(vL({},QD(this.c,i,o),n),i,o):nB(n.ordinal)?(t=vL({},this.toObject(),n),nB(n.day)&&(t.day=Math.min(yB(t.year,t.month),t.day))):t=$D(vL({},XD(this.c),n));var p=SF(t,this.o,this.zone);return vF(this,{ts:p[0],o:p[1]})},n.plus=function(e){return this.isValid?vF(this,xF(this,Vz.fromDurationLike(e))):this},n.minus=function(e){return this.isValid?vF(this,xF(this,Vz.fromDurationLike(e).negate())):this},n.startOf=function(e,t){var n=(void 0===t?{}:t).useLocaleWeeks,r=void 0!==n&&n;if(!this.isValid)return this;var i={},o=Vz.normalizeUnit(e);switch(o){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0}if("weeks"===o)if(r){var s=this.loc.getStartOfWeek();this.weekday<s&&(i.weekNumber=this.weekNumber-1),i.weekday=s}else i.weekday=1;if("quarters"===o){var a=Math.ceil(this.month/3);i.month=3*(a-1)+1}return this.set(i)},n.endOf=function(e,t){var n;return this.isValid?this.plus((n={},n[e]=1,n)).startOf(e,t).minus(1):this},n.toFormat=function(e,t){return void 0===t&&(t={}),this.isValid?GB.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):pF},n.toLocaleString=function(e,t){return void 0===e&&(e=zL),void 0===t&&(t={}),this.isValid?GB.create(this.loc.clone(t),e).formatDateTime(this):pF},n.toLocaleParts=function(e){return void 0===e&&(e={}),this.isValid?GB.create(this.loc.clone(e),e).formatDateTimeParts(this):[]},n.toISO=function(e){var t=void 0===e?{}:e,n=t.format,r=void 0===n?"extended":n,i=t.suppressSeconds,o=void 0!==i&&i,s=t.suppressMilliseconds,a=void 0!==s&&s,l=t.includeOffset,c=void 0===l||l,u=t.extendedZone,d=void 0!==u&&u;if(!this.isValid)return null;var p="extended"===r,h=AF(this,p);return h+="T",h+=EF(this,p,o,a,c,d)},n.toISODate=function(e){var t=(void 0===e?{}:e).format,n=void 0===t?"extended":t;return this.isValid?AF(this,"extended"===n):null},n.toISOWeekDate=function(){return CF(this,"kkkk-'W'WW-c")},n.toISOTime=function(e){var t=void 0===e?{}:e,n=t.suppressMilliseconds,r=void 0!==n&&n,i=t.suppressSeconds,o=void 0!==i&&i,s=t.includeOffset,a=void 0===s||s,l=t.includePrefix,c=void 0!==l&&l,u=t.extendedZone,d=void 0!==u&&u,p=t.format,h=void 0===p?"extended":p;return this.isValid?(c?"T":"")+EF(this,"extended"===h,o,r,a,d):null},n.toRFC2822=function(){return CF(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},n.toHTTP=function(){return CF(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},n.toSQLDate=function(){return this.isValid?AF(this,!0):null},n.toSQLTime=function(e){var t=void 0===e?{}:e,n=t.includeOffset,r=void 0===n||n,i=t.includeZone,o=void 0!==i&&i,s=t.includeOffsetSpace,a="HH:mm:ss.SSS";return(o||r)&&((void 0===s||s)&&(a+=" "),o?a+="z":r&&(a+="ZZ")),CF(this,a,!0)},n.toSQL=function(e){return void 0===e&&(e={}),this.isValid?this.toSQLDate()+" "+this.toSQLTime(e):null},n.toString=function(){return this.isValid?this.toISO():pF},n[e]=function(){return this.isValid?"DateTime { ts: "+this.toISO()+", zone: "+this.zone.name+", locale: "+this.locale+" }":"DateTime { Invalid, reason: "+this.invalidReason+" }"},n.valueOf=function(){return this.toMillis()},n.toMillis=function(){return this.isValid?this.ts:NaN},n.toSeconds=function(){return this.isValid?this.ts/1e3:NaN},n.toUnixInteger=function(){return this.isValid?Math.floor(this.ts/1e3):NaN},n.toJSON=function(){return this.toISO()},n.toBSON=function(){return this.toJSDate()},n.toObject=function(e){if(void 0===e&&(e={}),!this.isValid)return{};var t=vL({},this.c);return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t},n.toJSDate=function(){return new Date(this.isValid?this.ts:NaN)},n.diff=function(e,t,n){if(void 0===t&&(t="milliseconds"),void 0===n&&(n={}),!this.isValid||!e.isValid)return Vz.invalid("created by diffing an invalid DateTime");var r,i=vL({locale:this.locale,numberingSystem:this.numberingSystem},n),o=(r=t,Array.isArray(r)?r:[r]).map(Vz.normalizeUnit),s=e.valueOf()>this.valueOf(),a=Jz(s?this:e,s?e:this,o,i);return s?a.negate():a},n.diffNow=function(e,n){return void 0===e&&(e="milliseconds"),void 0===n&&(n={}),this.diff(t.now(),e,n)},n.until=function(e){return this.isValid?Wz.fromDateTimes(this,e):this},n.hasSame=function(e,t,n){if(!this.isValid)return!1;var r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)},n.equals=function(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},n.toRelative=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var n=e.base||t.fromObject({},{zone:this.zone}),r=e.padding?this<n?-e.padding:e.padding:0,i=["years","months","days","hours","minutes","seconds"],o=e.unit;return Array.isArray(e.unit)&&(i=e.unit,o=void 0),NF(n,this.plus(r),vL({},e,{numeric:"always",units:i,unit:o}))},n.toRelativeCalendar=function(e){return void 0===e&&(e={}),this.isValid?NF(e.base||t.fromObject({},{zone:this.zone}),this,vL({},e,{numeric:"auto",units:["years","months","days"],calendary:!0})):null},t.min=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!n.every(t.isDateTime))throw new OL("min requires all arguments be DateTimes");return aB(n,(function(e){return e.valueOf()}),Math.min)},t.max=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!n.every(t.isDateTime))throw new OL("max requires all arguments be DateTimes");return aB(n,(function(e){return e.valueOf()}),Math.max)},t.fromFormatExplain=function(e,t,n){void 0===n&&(n={});var r=n,i=r.locale,o=void 0===i?null:i,s=r.numberingSystem,a=void 0===s?null:s;return uF(_D.fromOpts({locale:o,numberingSystem:a,defaultToEN:!0}),e,t)},t.fromStringExplain=function(e,n,r){return void 0===r&&(r={}),t.fromFormatExplain(e,n,r)},gL(t,[{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}},{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"outputCalendar",get:function(){return this.isValid?this.loc.outputCalendar:null}},{key:"zone",get:function(){return this._zone}},{key:"zoneName",get:function(){return this.isValid?this.zone.name:null}},{key:"year",get:function(){return this.isValid?this.c.year:NaN}},{key:"quarter",get:function(){return this.isValid?Math.ceil(this.c.month/3):NaN}},{key:"month",get:function(){return this.isValid?this.c.month:NaN}},{key:"day",get:function(){return this.isValid?this.c.day:NaN}},{key:"hour",get:function(){return this.isValid?this.c.hour:NaN}},{key:"minute",get:function(){return this.isValid?this.c.minute:NaN}},{key:"second",get:function(){return this.isValid?this.c.second:NaN}},{key:"millisecond",get:function(){return this.isValid?this.c.millisecond:NaN}},{key:"weekYear",get:function(){return this.isValid?mF(this).weekYear:NaN}},{key:"weekNumber",get:function(){return this.isValid?mF(this).weekNumber:NaN}},{key:"weekday",get:function(){return this.isValid?mF(this).weekday:NaN}},{key:"isWeekend",get:function(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}},{key:"localWeekday",get:function(){return this.isValid?gF(this).weekday:NaN}},{key:"localWeekNumber",get:function(){return this.isValid?gF(this).weekNumber:NaN}},{key:"localWeekYear",get:function(){return this.isValid?gF(this).weekYear:NaN}},{key:"ordinal",get:function(){return this.isValid?XD(this.c).ordinal:NaN}},{key:"monthShort",get:function(){return this.isValid?qz.months("short",{locObj:this.loc})[this.month-1]:null}},{key:"monthLong",get:function(){return this.isValid?qz.months("long",{locObj:this.loc})[this.month-1]:null}},{key:"weekdayShort",get:function(){return this.isValid?qz.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}},{key:"weekdayLong",get:function(){return this.isValid?qz.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}},{key:"offset",get:function(){return this.isValid?+this.o:NaN}},{key:"offsetNameShort",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}},{key:"offsetNameLong",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}},{key:"isOffsetFixed",get:function(){return this.isValid?this.zone.isUniversal:null}},{key:"isInDST",get:function(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function(){return gB(this.year)}},{key:"daysInMonth",get:function(){return yB(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?vB(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?xB(this.weekYear):NaN}},{key:"weeksInLocalWeekYear",get:function(){return this.isValid?xB(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}}],[{key:"DATE_SHORT",get:function(){return zL}},{key:"DATE_MED",get:function(){return FL}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return UL}},{key:"DATE_FULL",get:function(){return jL}},{key:"DATE_HUGE",get:function(){return HL}},{key:"TIME_SIMPLE",get:function(){return VL}},{key:"TIME_WITH_SECONDS",get:function(){return GL}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return WL}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return qL}},{key:"TIME_24_SIMPLE",get:function(){return KL}},{key:"TIME_24_WITH_SECONDS",get:function(){return JL}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return QL}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return YL}},{key:"DATETIME_SHORT",get:function(){return XL}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return $L}},{key:"DATETIME_MED",get:function(){return ZL}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return eD}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return tD}},{key:"DATETIME_FULL",get:function(){return nD}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return rD}},{key:"DATETIME_HUGE",get:function(){return iD}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return oD}}]),t}(Symbol.for("nodejs.util.inspect.custom"));function BF(e){if(DF.isDateTime(e))return e;if(e&&e.valueOf&&rB(e.valueOf()))return DF.fromJSDate(e);if(e&&"object"==typeof e)return DF.fromObject(e);throw new OL("Unknown datetime argument: "+e+", of type "+typeof e)}fL.DateTime=DF,fL.Duration=Vz,fL.FixedOffsetZone=ID,fL.IANAZone=pD,fL.Info=qz,fL.Interval=Wz,fL.InvalidZone=RD,fL.Settings=UD,fL.SystemZone=lD,fL.VERSION="3.4.4",fL.Zone=sD;c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");function zF(e,t){let[n,r]=(0,c.useState)(e),i=Ja(e);return Ka((()=>r(i.current)),[i,r,...t]),n}var FF=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(FF||{}),UF=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(UF||{}),jF=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(jF||{}),HF=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.SetOrientation=3]="SetOrientation",e[e.GoToOption=4]="GoToOption",e[e.Search=5]="Search",e[e.ClearSearch=6]="ClearSearch",e[e.RegisterOption=7]="RegisterOption",e[e.UnregisterOption=8]="UnregisterOption",e))(HF||{});function VF(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=El(t(e.options.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{options:r,activeOptionIndex:i}}let GF={1:e=>e.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1},0(e){if(e.disabled||0===e.listboxState)return e;let t=e.activeOptionIndex,{value:n,mode:r,compare:i}=e.propsRef.current,o=e.options.findIndex((e=>{let t=e.dataRef.current.value;return Da(r,{1:()=>n.some((e=>i(e,t))),0:()=>i(n,t)})}));return-1!==o&&(t=o),{...e,listboxState:0,activeOptionIndex:t}},2:(e,t)=>e.disabled===t.disabled?e:{...e,disabled:t.disabled},3:(e,t)=>e.orientation===t.orientation?e:{...e,orientation:t.orientation},4(e,t){var n;if(e.disabled||1===e.listboxState)return e;let r=VF(e),i=_d(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},5:(e,t)=>{if(e.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find((e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))})),o=i?e.options.indexOf(i):-1;return-1===o||o===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:o,activationTrigger:1}},6:e=>e.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},7:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=VF(e,(e=>[...e,n]));if(null===e.activeOptionIndex){let{value:i,mode:o,compare:s}=e.propsRef.current,a=t.dataRef.current.value;Da(o,{1:()=>i.some((e=>s(e,a))),0:()=>s(i,a)})&&(r.activeOptionIndex=r.options.indexOf(n))}return{...e,...r}},8:(e,t)=>{let n=VF(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},WF=(0,c.createContext)(null);function qF(e){let t=(0,c.useContext)(WF);if(null===t){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,qF),t}return t}function KF(e,t){return Da(t.type,GF,e,t)}WF.displayName="ListboxContext";let JF=c.Fragment,QF=Va((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,horizontal:u=!1,multiple:d=!1,...p}=e;const h=u?"horizontal":"vertical";let f=$a(n),[m,g]=Hf(r,s,i),v=(0,c.useReducer)(KF,{listboxState:1,propsRef:{current:{value:m,onChange:g,mode:d?1:0,compare:Qa("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a)}},labelRef:(0,c.createRef)(),buttonRef:(0,c.createRef)(),optionsRef:(0,c.createRef)(),disabled:l,orientation:h,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1}),[{listboxState:y,propsRef:b,optionsRef:S,buttonRef:x},w]=v;b.current.value=m,b.current.mode=d?1:0,Ka((()=>{b.current.onChange=e=>Da(b.current.mode,{0:()=>g(e),1(){let t=b.current.value.slice(),{compare:n}=b.current,r=t.findIndex((t=>n(t,e)));return-1===r?t.push(e):t.splice(r,1),g(t)}})}),[g,b]),Ka((()=>w({type:2,disabled:l})),[l]),Ka((()=>w({type:3,orientation:h})),[h]),cc([x,S],((e,t)=>{var n;w({type:1}),xl(t,Sl.Loose)||(e.preventDefault(),null==(n=x.current)||n.focus())}),0===y);let C=(0,c.useMemo)((()=>({open:0===y,disabled:l,value:m})),[y,l,m]),A={ref:f};return t(c).createElement(WF.Provider,{value:v},t(c).createElement(ic,{value:Da(y,{0:nc.Open,1:nc.Closed})},null!=o&&null!=m&&zf({[o]:m}).map((([e,n])=>t(c).createElement(cl,{features:ll.Hidden,...Ga({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:n})}))),Ua({ourProps:A,theirProps:p,slot:C,defaultTag:JF,name:"Listbox"})))})),YF=Va((function(e,t){var n;let[r,i]=qF("Listbox.Button"),o=$a(r.buttonRef,t),s=`headlessui-listbox-button-${al()}`,a=Ic(),l=Qa((e=>{switch(e.key){case el.Space:case el.Enter:case el.ArrowDown:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Md.First})}));break;case el.ArrowUp:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Md.Last})}))}})),u=Qa((e=>{if(e.key===el.Space)e.preventDefault()})),d=Qa((e=>{if(tl(e.currentTarget))return e.preventDefault();0===r.listboxState?(i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),i({type:0}))})),p=zF((()=>{if(r.labelRef.current)return[r.labelRef.current.id,s].join(" ")}),[r.labelRef.current,s]),h=(0,c.useMemo)((()=>({open:0===r.listboxState,disabled:r.disabled,value:r.propsRef.current.value})),[r]),f=e;return Ua({ourProps:{ref:o,id:s,type:Rd(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.optionsRef.current)?void 0:n.id,"aria-expanded":r.disabled?void 0:0===r.listboxState,"aria-labelledby":p,disabled:r.disabled,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:f,slot:h,defaultTag:"button",name:"Listbox.Button"})})),XF=Va((function(e,t){let[n]=qF("Listbox.Label"),r=`headlessui-listbox-label-${al()}`;return Ua({ourProps:{ref:$a(n.labelRef,t),id:r,onClick:Qa((()=>{var e;return null==(e=n.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))},theirProps:e,slot:(0,c.useMemo)((()=>({open:0===n.listboxState,disabled:n.disabled})),[n]),defaultTag:"label",name:"Listbox.Label"})})),$F=za.RenderStrategy|za.Static,ZF=Va((function(e,t){var n;let[r,i]=qF("Listbox.Options"),o=$a(r.optionsRef,t),s=`headlessui-listbox-options-${al()}`,a=Ic(),l=Ic(),u=rc(),d=null!==u?u===nc.Open:0===r.listboxState;(0,c.useEffect)((()=>{var e;let t=r.optionsRef.current;!t||0===r.listboxState&&t!==(null==(e=pl(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})}),[r.listboxState,r.optionsRef]);let p=Qa((e=>{switch(l.dispose(),e.key){case el.Space:if(""!==r.searchQuery)return e.preventDefault(),e.stopPropagation(),i({type:5,value:e.key});case el.Enter:if(e.preventDefault(),e.stopPropagation(),null!==r.activeOptionIndex){let{dataRef:e}=r.options[r.activeOptionIndex];r.propsRef.current.onChange(e.current.value)}0===r.propsRef.current.mode&&(i({type:1}),dl().nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})})));break;case Da(r.orientation,{vertical:el.ArrowDown,horizontal:el.ArrowRight}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Md.Next});case Da(r.orientation,{vertical:el.ArrowUp,horizontal:el.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Md.Previous});case el.Home:case el.PageUp:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Md.First});case el.End:case el.PageDown:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Md.Last});case el.Escape:return e.preventDefault(),e.stopPropagation(),i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case el.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(i({type:5,value:e.key}),l.setTimeout((()=>i({type:6})),350))}})),h=zF((()=>{var e,t,n;return null!=(n=null==(e=r.labelRef.current)?void 0:e.id)?n:null==(t=r.buttonRef.current)?void 0:t.id}),[r.labelRef.current,r.buttonRef.current]),f=(0,c.useMemo)((()=>({open:0===r.listboxState})),[r]),m=e;return Ua({ourProps:{"aria-activedescendant":null===r.activeOptionIndex||null==(n=r.options[r.activeOptionIndex])?void 0:n.id,"aria-multiselectable":1===r.propsRef.current.mode||void 0,"aria-labelledby":h,"aria-orientation":r.orientation,id:s,onKeyDown:p,role:"listbox",tabIndex:0,ref:o},theirProps:m,slot:f,defaultTag:"ul",features:$F,visible:d,name:"Listbox.Options"})})),eU=Va((function(e,t){let{disabled:n=!1,value:r,...i}=e,[o,s]=qF("Listbox.Option"),a=`headlessui-listbox-option-${al()}`,l=null!==o.activeOptionIndex&&o.options[o.activeOptionIndex].id===a,{value:u,compare:d}=o.propsRef.current,p=Da(o.propsRef.current.mode,{1:()=>u.some((e=>d(e,r))),0:()=>d(u,r)}),h=(0,c.useRef)(null),f=$a(t,h);Ka((()=>{if(0!==o.listboxState||!l||0===o.activationTrigger)return;let e=dl();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=h.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[h,l,o.listboxState,o.activationTrigger,o.activeOptionIndex]);let m=(0,c.useRef)({disabled:n,value:r,domRef:h});Ka((()=>{m.current.disabled=n}),[m,n]),Ka((()=>{m.current.value=r}),[m,r]),Ka((()=>{var e,t;m.current.textValue=null==(t=null==(e=h.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[m,h]);let g=Qa((()=>o.propsRef.current.onChange(r)));Ka((()=>(s({type:7,id:a,dataRef:m}),()=>s({type:8,id:a}))),[m,a]);let v=Qa((e=>{if(n)return e.preventDefault();g(),0===o.propsRef.current.mode&&(s({type:1}),dl().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})})))})),y=Qa((()=>{if(n)return s({type:4,focus:Md.Nothing});s({type:4,focus:Md.Specific,id:a})})),b=Qa((()=>{n||l||s({type:4,focus:Md.Specific,id:a,trigger:0})})),S=Qa((()=>{n||!l||s({type:4,focus:Md.Nothing})})),x=(0,c.useMemo)((()=>({active:l,selected:p,disabled:n})),[l,p,n]);return Ua({ourProps:{id:a,ref:f,role:"option",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,"aria-selected":p,disabled:void 0,onClick:v,onFocus:y,onPointerMove:b,onMouseMove:b,onPointerLeave:S,onMouseLeave:S},theirProps:i,slot:x,defaultTag:"li",name:"Listbox.Option"})})),tU=Object.assign(QF,{Button:YF,Label:XF,Options:ZF,Option:eU});var nU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",focusable:"false",role:"img",className:e,fill:"currentColor","aria-label":t,children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z",clipRule:"evenodd"})});const rU={en:["January","February","March","April","May","June","July","August","September","October","November","December"],it:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"]},iU=(0,c.memo)((({defaultDate:e,onChange:t,disabled:n=!1})=>{const{t:r,i18n:i}=ve(),[o,a]=(0,c.useState)(e?"string"==typeof e?fL.DateTime.fromISO(e):fL.DateTime.fromJSDate(e):fL.DateTime.now());return(0,c.useEffect)((()=>{t(o)}),[o,t]),(0,s.jsxs)("div",{className:"memori--date-selector",children:[(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(tU,{value:o,onChange:e=>{a(e)},disabled:n,name:"day",children:[(0,s.jsxs)(tU.Label,{className:"memori--date-selector__select-label",children:[r("day"),":"]}),(0,s.jsxs)(tU.Button,{"aria-label":r("day"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.day}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(nU,{})})]}),(0,s.jsx)(Wc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(tU.Options,{className:"memori--date-selector__select-options",children:[...Array(31).keys()].map((e=>(0,s.jsx)(tU.Option,{value:o.set({day:e+1}),className:"memori--date-selector__select-option",children:e+1},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(tU,{value:o,onChange:e=>{a(e)},disabled:n,name:"month",children:[(0,s.jsxs)(tU.Label,{className:"memori--date-selector__select-label",children:[r("month"),":"]}),(0,s.jsxs)(tU.Button,{"aria-label":r("month"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:rU["it"===i.language?"it":"en"][o.month-1]}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(nU,{})})]}),(0,s.jsx)(Wc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(tU.Options,{className:"memori--date-selector__select-options",children:rU["it"===i.language?"it":"en"].map((e=>(0,s.jsx)(tU.Option,{className:"memori--date-selector__select-option",value:o.set({month:rU["it"===i.language?"it":"en"].findIndex((t=>t===e))+1}),children:e},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(tU,{value:o,onChange:e=>{a(e)},disabled:n,name:"year",children:[(0,s.jsxs)(tU.Label,{className:"memori--date-selector__select-label",children:[r("year"),":"]}),(0,s.jsxs)(tU.Button,{"aria-label":r("year"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.year}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(nU,{})})]}),(0,s.jsx)(Wc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(tU.Options,{className:"memori--date-selector__select-options",children:[...Array(fL.DateTime.now().year-1899).keys()].sort(((e,t)=>t-e)).map((e=>(0,s.jsx)(tU.Option,{value:o.set({year:e+1900}),className:"memori--date-selector__select-option",children:e+1900},e)))})})]})})]})}));iU.displayName="DateSelector";var oU=iU;c=o("85Hg2");var sU=({visible:e=!1,onClose:n,minAge:r})=>{const{t:i}=ve(),[o,a]=(0,c.useState)(),[l,u]=(0,c.useState)(),[d,p]=(0,c.useState)(!1),h=(0,c.useCallback)((()=>{if(p(!0),!o)return t(Ss).error(i("requiredField")),u(i("requiredField")||"Required field"),void p(!1);if(fL.DateTime.now().diff(o,"years").years<r)return t(Ss).error(i("underageTwinSession",{age:r})),u(i("underageTwinSession",{age:r})||`You must be at least ${r} years old to interact with this Twin`),void p(!1);n(o.toJSDate().toISOString())}),[o,r,n,i]);return(0,s.jsxs)(Jc,{open:e,title:i("ageVerification"),className:"age-verification-modal",closable:!0,onClose:()=>n(),children:[(0,s.jsx)("p",{children:i("ageVerificationText",{minAge:r})}),(0,s.jsxs)("form",{className:"age-verification-form",onSubmit:e=>{e.preventDefault(),h()},children:[(0,s.jsx)("div",{className:"form-item",children:(0,s.jsxs)("fieldset",{name:"birthDate",children:[(0,s.jsx)("legend",{className:"sr-only",children:i("birthDate")}),(0,s.jsx)(oU,{defaultDate:new Date(Date.now()),onChange:e=>{a(e)}}),(0,s.jsx)("p",{className:"form-item-help",children:i("birthDateHelper")}),l&&(0,s.jsx)("p",{className:"form-item-error",children:l})]})}),(0,s.jsx)("div",{className:"form-item form-submit",children:(0,s.jsx)(La,{primary:!0,htmlType:"submit",className:"age-verification-submit",loading:d,disabled:!o,children:i("confirm")})})]})]})};c=o("85Hg2");var aU=({open:e=!1,onClose:n,className:r,title:i,description:o,children:a,footer:l,loading:u=!1,side:d="right",closable:p=!0,width:h="100%",widthMd:f="80%",widthLg:m="60%"})=>(0,s.jsx)(Wc,{appear:!0,show:e,as:t(c).Fragment,children:(0,s.jsxs)(Cc,{open:e,onClose:n,className:t(ys)("memori-drawer",r),children:[(0,s.jsx)(Wc.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)("div",{className:"memori-drawer--backdrop"})}),(0,s.jsx)("div",{className:"memori-drawer--container",children:(0,s.jsx)("div",{className:"memori-drawer--container-scrollable",children:(0,s.jsx)(Wc.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"max-w-0 opacity-0",enterTo:"max-w-100 opacity-100",leave:"ease-in duration-200",leaveFrom:"max-w-100 opacity-100",leaveTo:"max-w-0 opacity-0",children:(0,s.jsxs)(Cc.Panel,{className:t(ys)("memori-drawer--panel",{"memori-drawer--panel-left":"left"===d,"memori-drawer--with-footer":!!l}),children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n .memori-drawer--panel {\n --memori-drawer--width: ${h};\n --memori-drawer--width-lg: ${m};\n --memori-drawer--width-md: ${f};\n }\n `}}),p&&(0,s.jsx)("div",{className:"memori-drawer--close",children:(0,s.jsx)(La,{shape:"circle",outlined:!0,icon:(0,s.jsx)(Kc,{}),onClick:()=>n(!1)})}),(0,s.jsxs)(qc,{spinning:u,children:[i&&(0,s.jsx)(Cc.Title,{className:"memori-drawer--title",children:i}),o&&(0,s.jsx)(Cc.Description,{className:"memori-drawer--description",children:o}),a,l&&(0,s.jsx)("div",{className:"memori-drawer--footer",children:l})]})]})})})})]})});c=o("85Hg2");var lU=({label:e,className:n,disabled:r=!1,indeterminate:i=!1,checked:o,children:a,onChange:l,name:u,...d})=>{const p=(0,c.useRef)(null);return(0,c.useEffect)((()=>{p.current&&(p.current.indeterminate=i)}),[p,i]),(0,s.jsxs)("label",{className:t(ys)("memori-checkbox",n,{"memori-checkbox--disabled":r,"memori-checkbox--indeterminate":i}),children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{ref:p,type:"checkbox",...d,name:u,disabled:r,checked:o||i,className:"memori-checkbox--input",onChange:l}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),!!(null==e?void 0:e.length)&&(0,s.jsx)("span",{className:"memori-checkbox--text",children:e})]})};c=o("85Hg2");var cU=({className:e,value:n,displayValue:r,options:i,onChange:o,disabled:a=!1,label:l,placeholder:u})=>(0,s.jsx)("div",{className:t(ys)("memori-select",e),children:(0,s.jsxs)(tU,{value:n,onChange:e=>{o(e)},disabled:a,name:"day",children:[l&&(0,s.jsxs)(tU.Label,{className:"memori-select--label",children:[l,":"]}),(0,s.jsxs)(tU.Button,{"aria-label":l,className:"memori-select--button",children:[(0,s.jsx)("span",{className:t(ys)("memori-select--value",{"memori-select--value-placeholder":!n}),children:n?r||n:u}),(0,s.jsx)("span",{className:"memori-select--icon",children:(0,s.jsx)(nU,{})})]}),(0,s.jsx)(Wc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(tU.Options,{className:"memori-select--options",children:i.map((e=>(0,s.jsx)(tU.Option,{value:e.value,className:"memori-select--option",children:e.label},e.value)))})})]})});const uU={muteSpeaker:"@memori:muteSpeaker",microphoneMode:"@memori:microphoneMode",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",sendOnEnter:"@memori:sendOnEnter",birthDate:"@memori:birthDate",controlsPosition:"@memori:controlsPosition",hideEmissions:"@memori:hideEmissions"},dU=(e,t)=>{var n;const r=window.localStorage.getItem(null!==(n=uU[e])&&void 0!==n?n:e);if(!r)return t;try{return JSON.parse(r)}catch(e){return r}},pU=(e,t)=>{var n;window.localStorage.setItem(null!==(n=uU[e])&&void 0!==n?n:e,t.toString())},hU=[2,3,5,10,15,20,30,60];var fU=({open:e,layout:t="DEFAULT",onClose:n,microphoneMode:r="HOLD_TO_TALK",continuousSpeechTimeout:i,setMicrophoneMode:o,setContinuousSpeechTimeout:a,controlsPosition:l,setControlsPosition:c,hideEmissions:u,setHideEmissions:d,additionalSettings:p})=>{const{t:h}=ve();return(0,s.jsxs)(aU,{className:"memori-settings-drawer",open:e,onClose:n,title:h("widget.settings")||"Settings",description:h("write_and_speak.settingsHeaderLabel"),children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#microphoneMode",children:[h("write_and_speak.microphoneMode")||"Microphone mode",":"]}),(0,s.jsxs)($f,{id:"microphoneMode",name:"microphoneMode",value:r,defaultValue:r,className:"memori-settings-drawer--microphoneMode-radio",onChange:e=>{let t="CONTINUOUS"===e?"CONTINUOUS":"HOLD_TO_TALK";o(t),pU("microphoneMode",t)},children:[(0,s.jsx)($f.Option,{value:"HOLD_TO_TALK",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(La,{primary:e,children:h("write_and_speak.holdToSpeak")||"Hold to speak"})}),(0,s.jsx)($f.Option,{value:"CONTINUOUS",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(La,{primary:e,children:h("write_and_speak.continuousSpeechLabel")||"Continuous speech"})})]})]}),"CONTINUOUS"===r&&(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(cU,{label:h("write_and_speak.secondsLabel")||"Seconds",placeholder:h("write_and_speak.secondsLabel")||"Seconds",options:hU.map((e=>({value:e,label:e}))),value:i,onChange:e=>{a(e),pU("continuousSpeechTimeout",e)}})}),"TOTEM"===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#controlsPosition",children:[h("write_and_speak.controlsPosition")||"Controls",":"]}),(0,s.jsxs)($f,{id:"controlsPosition",name:"controlsPosition",value:l,defaultValue:l,className:"memori-settings-drawer--controlsposition-radio",onChange:e=>{c(e),pU("controlsPosition",e)},children:[(0,s.jsx)($f.Option,{value:"center",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(La,{primary:e,children:h("center")||"Center"})}),(0,s.jsx)($f.Option,{value:"bottom",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(La,{primary:e,children:h("bottom")||"Bottom"})})]})]}),(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(lU,{label:h("write_and_speak.hideEmissionsLabel")||"Hide emissions",name:"hideControls",checked:u,onChange:e=>{d(e.target.checked),pU("hideEmissions",e.target.checked)}})})]}),p&&(0,s.jsx)("div",{className:"memori-settings-drawer--field controls",children:p})]})};c=o("85Hg2");const mU=new Map(Object.entries({TENANT_NOT_FOUND:-1,TENANT_REGISTRATION_DISABLED:-2,TENANT_MISSING_NAME:-3,TENANT_MAX_USERS_REACHED:-4,TENANT_MAX_ADMINS_REACHED:-5,USER_NOT_CONFIRMED:-11,USER_NOT_FOUND:-12,USER_OR_PASSWORD_INVALID:-13,USER_MUST_CHANGE_PASSWORD:-14,USER_MUST_ENTER_VERIFICATION_CODE:-15,USER_MISSING_TENANT:-21,USER_MISSING_NAME:-22,USER_MISSING_PASSWORD:-23,USER_MISSING_EMAIL:-24,USER_MISSING_VERIFICATION_CODE:-25,USER_NAME_ALREADY_USED:-26,USER_PASSWORD_NOT_CONFORMING_TO_POLICY:-27,USER_EMAIL_ALREADY_USED:-28,USER_EMAIL_INVALID:-29,USER_VERIFICATION_CODE_INVALID:-30,USER_MISSING_NAME_OR_EMAIL:-31,USER_NAME_INVALID:-32,USER_HAS_ONE_OR_MORE_MEMORI:-33,USER_MISSING_NEW_PASSWORD:-34,USER_CANT_CREATE_MEMORI:-35,USER_MAX_MEMORI_REACHED:-36,USER_CANT_EDIT_INTEGRATIONS:-37,MEMORI_NOT_FOUND:-51,MEMORI_NOT_ACCESSIBLE:-52,MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN:-53,SESSION_NOT_FOUND:-101,SESSION_IS_NOT_ADMINISTRATIVE:-102,MEMORI_MISSING_CONFIGURATION:-201,MEMORI_CONFIGURATION_NOT_FOUND:-202,MEMORI_INVALID_PRIVACY_TYPE:-203,MEMORI_MISSING_PASSWORD:-204,MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS:-205,MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS:-206,MEMORI_INVALID_VOICE_TYPE:-207,MEMORI_MISSING_NAME:-208,MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS:-209,MEMORI_INVALID_ID:-210,MEMORI_NAME_ALREADY_USED:-211,MEMORI_INVALID_PIN:-212,MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION:-213,MEMORI_NO_PASSWORD_WHEN_PUBLIC:-214,MEMORI_TRANSFER_MISSING_DESTINATION_USER:-231,MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID:-232,MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT:-233,MEMORI_TRANSFER_NOTHING_TO_DO:-234,MEMORI_CONFIGURATION_CANT_BE_CHANGED:-251,MEMORI_MISSING_NEW_PASSWORD:-252,MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT:-261,MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT:-262,INTEGRATION_NOT_FOUND:-301,INTEGRATION_INVALID_TYPE:-401,INTEGRATION_ALREADY_EXISTS:-402,INTEGRATION_MEMORI_IS_NOT_PUBLIC:-403,INTEGRATION_MISSING_INVOCATION_TEXT:-404,INTEGRATION_MISSING_DEVICE_EMAILS:-405,INTEGRATION_MEMORI_IS_EMPTY:-406,INTEGRATION_MISSING_PRIVACY_POLICY:-407,INTEGRATION_MISSING_CATEGORY:-408,INTEGRATION_MISSING_DESCRIPTION:-409,INTEGRATION_INVALID_INVOCATION_TEXT:-410,INTEGRATION_GOOGLE_NO_MORE_AVAILABLE:-411,UPLOAD_REQUIRES_MULTIPART_ENCODING:-501,UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY:-502,UPLOAD_MAX_LENGTH_EXCEEDED:-503,UPLOAD_FILE_IS_EMPTY:-504,UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE:-505,UPLOAD_MISSING_FILE_NAME:-506,UPLOAD_INVALID_MEMORY_ID:-507,UPLOAD_MISSING_FILE_CONTENT:-508,ASSET_NOT_FOUND:-601,ASSET_NOT_ACCESSIBLE:-602,ASSET_MISSING_SESSION_ID:-603,ASSET_INVALID_FILE_NAME:-604,INVITATION_NOT_FOUND:-701,INVITATION_NOT_ACCESSIBLE:-702,INVITATION_ALREADY_ACCEPTED:-703,INVITATION_ALREADY_REJECTED:-704,INVITATION_MISSING_DESTINATION_EMAIL:-705,INVITATION_DESTINATION_EMAIL_INVALID:-706,INVITATION_MISSING_TAG:-707,INVITATION_MISSING_PIN:-708,INVITATION_INVALID_PIN:-709,INVITATION_INVALID_TYPE:-710,INVITATION_MISSING_DESTINATION_NAME:-711,INVITATION_TAG_PIN_CANT_BE_CHANGED:-712,INVITATION_CANT_BE_CHANGED:-713,ACTIONLOG_INVALID_USER_ID:-801,ACTIONLOG_INVALID_DATE_FROM_FORMAT:-802,ACTIONLOG_INVALID_DATE_TO_FORMAT:-803,ACTIONLOG_INVALID_MEMORI_ID:-804,CONSUMPTIONLOG_INVALID_TYPE:-901,CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT:-902,CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT:-903,CONSUMPTIONLOG_INVALID_USER_ID:-904,CONSUMPTIONLOG_INVALID_MEMORI_ID:-905}).map((([e,t])=>[t,e]))),gU=e=>{if(!e)return"error.generic";if(401===e||403===e)return"error.unauthorized";if(404===e)return"error.notFound";if(422===e)return"error.unprocessableEntity";if(500===e)return"internal server error";let t=mU.get(e);return t?`errors.${t}`:"error.generic"};var vU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"})});var yU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M15 18L9 12 15 6"})});var bU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M9 18L15 12 9 6"})});var SU=({apiURL:e,sessionID:n,memori:r,visible:i=!0,initialKnownFacts:o=[],closeDrawer:a})=>{var l;const{t:u}=ve(),d=q(e),{getKnownFactsPaginated:p,deleteKnownFact:h}=d.knownFacts,[f,m]=(0,c.useState)(o),[g,v]=(0,c.useState)(25),[y,b]=(0,c.useState)(0),[S,x]=(0,c.useState)(null!==(l=null==o?void 0:o.length)&&void 0!==l?l:0),[w,C]=(0,c.useState)(!1),A=async(e,r,i)=>{if(n||e){C(!0);try{const{knownFacts:o,count:s,...a}=await p(null!=e?e:n,null!=r?r:y,null!=i?i:g);m(null!=o?o:[]),x(null!=s?s:0),0!==a.resultCode&&(console.error(a),t(Ss).error(u(gU(a.resultCode))))}catch(e){console.error("KNOWN_FACTS/FETCH",e),m(null!=o?o:[])}C(!1)}};(0,c.useEffect)((()=>{A()}),[]);const[E,M]=(0,c.useState)(!1),[_,T]=(0,c.useState)(),[I,R]=(0,c.useState)([]);return(0,s.jsxs)(aU,{open:i,width:"80%",className:"memori-known-facts-drawer",onClose:()=>a(),title:u("knownFacts.title"),children:[(0,s.jsx)("p",{children:u("knownFacts.description",{memoriName:r.name})}),(0,s.jsxs)(qc,{spinning:w,children:[(0,s.jsxs)("div",{className:"memori-known-facts-actions",children:[(0,s.jsxs)(La,{primary:!0,danger:!0,onClick:()=>{M(!0)},className:"memori-known-facts-delete-selected",disabled:0===(null==I?void 0:I.length),icon:(0,s.jsx)(vU,{}),loading:w,children:[u("selected")," (",null==I?void 0:I.length,")"]}),(0,s.jsx)(Jc,{className:"memori-known-facts-modal",open:E,closable:!0,title:I.length>1?u("knownFacts.deleteSelectedConfirmTitle"):u("knownFacts.deleteConfirmTitle"),description:I.length>1?u("knownFacts.deleteSelectedConfirmMessage",{number:I.length}):u("knownFacts.deleteConfirmMessage"),onClose:()=>{M(!1)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(La,{ghost:!0,onClick:()=>{M(!1)},children:u("cancel")}),(0,s.jsx)(La,{primary:!0,danger:!0,onClick:async()=>{try{const e=I.map((e=>h(n,e)));Promise.all(e).then((e=>{if(e.every((e=>0===e.resultCode)))t(Ss).success(u("knownFacts.deleteSuccess")),R([]),A(),M(!1);else{let n=e.find((e=>0!==e.resultCode));console.error(n),void 0!==(null==n?void 0:n.resultCode)&&t(Ss).error(u(gU(null==n?void 0:n.resultCode)))}}))}catch(e){let n=e;t(Ss).error(u("Error")+n.message)}},children:u("confirm")})]})})]}),S>25&&(0,s.jsxs)("nav",{className:"memori--table--pagination",children:[S>g&&(0,s.jsxs)("div",{className:"memori--table--pagination--pages",children:[(0,s.jsx)(La,{shape:"circle",disabled:0===y||y<g,padded:!1,title:u("previous")||"Previous",icon:(0,s.jsx)(yU,{}),onClick:()=>{let e=(y/g-1)*g;b(e),A(void 0,e,g)}}),(0,s.jsxs)("span",{className:"memori--table--pagination--pages--current",children:[Math.ceil(y/g)+1," /"," ",Math.ceil(S/g)]}),(0,s.jsx)(La,{shape:"circle",padded:!1,title:u("next")||"Next",icon:(0,s.jsx)(bU,{}),disabled:(y/g+1)*g>=S,onClick:()=>{let e=(y/g+1)*g;b(e),A(void 0,e,g)}})]}),(0,s.jsx)(cU,{options:[{label:`25 / ${u("page")||"page"}`,value:25},{label:`50 / ${u("page")||"page"}`,value:50},{label:`100 / ${u("page")||"page"}`,value:100}],value:g,displayValue:`${g} / ${u("page")||"page"}`,onChange:e=>{v(e),b(0),A(void 0,0,e)}})]}),(0,s.jsxs)("table",{className:"memori--table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(lU,{checked:!!(null==f?void 0:f.length)&&(null==I?void 0:I.length)===f.length,indeterminate:!!(null==f?void 0:f.length)&&!!(null==I?void 0:I.length)&&(null==I?void 0:I.length)!==(null==f?void 0:f.length),onChange:e=>{e.target.checked?R(f.map((e=>e.knownFactID))):R([])}})}),(0,s.jsx)("th",{children:u("knownFacts.text")}),(0,s.jsx)("th",{className:"mobile-hidden",children:u("createdAt")}),(0,s.jsx)("th",{className:"memori--table--column-right",children:u("actions")})]})}),(0,s.jsx)("tbody",{children:f.map((e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(lU,{checked:null==I?void 0:I.includes(e.knownFactID),onChange:t=>{t.target.checked?R((t=>[...new Set([...t,e.knownFactID])])):R((t=>t.filter((t=>t!==e.knownFactID))))}})}),(0,s.jsx)("td",{children:e.text}),(0,s.jsx)("td",{className:"mobile-hidden",children:(0,s.jsx)("span",{className:"memori--table--date",children:e.creationTimestamp?new Intl.DateTimeFormat("it",{dateStyle:"short",timeStyle:"short"}).format(new Date(e.creationTimestamp)):"-"})}),(0,s.jsx)("td",{className:"memori--table--column-right",children:(0,s.jsxs)("div",{className:"memori--table--action-column",children:[(0,s.jsx)(La,{danger:!0,ghost:!0,shape:"circle",icon:(0,s.jsx)(vU,{}),disabled:(null==I?void 0:I.length)>0,title:u("delete")||"Delete",onClick:()=>T(e.knownFactID)}),(0,s.jsx)(Jc,{className:"memori-known-facts-modal",open:_===e.knownFactID,closable:!0,title:u("knownFacts.deleteConfirmTitle"),description:u("knownFacts.deleteConfirmMessage"),onClose:()=>{T(void 0)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(La,{ghost:!0,onClick:()=>{T(void 0)},children:u("cancel")}),(0,s.jsx)(La,{primary:!0,danger:!0,onClick:async()=>{try{const r=await h(n,e.knownFactID);0===r.resultCode?(t(Ss).success(u("knownFacts.deleteSuccess")),R([]),A(),T(void 0)):(console.error(r),t(Ss).error(u(gU(r.resultCode),{ns:"common"})))}catch(e){let n=e;t(Ss).error(u("Error")+n.message)}},children:u("confirm")})]})})]})})]},e.knownFactID)))})]})]})]})};var xU=({open:e=!1,baseUrl:t,apiUrl:n,tenant:r,experts:i,onClose:o})=>{const{t:a}=ve();return(0,s.jsx)(aU,{open:e,onClose:o,className:"memori--experts-drawer",title:(0,s.jsx)("h2",{className:"memori--experts-drawer--title",children:a("widget.expertsInTheBoard")}),children:(0,s.jsx)("ul",{className:"memori--experts-drawer--list",children:i.map((e=>(0,s.jsxs)("li",{className:"memori--experts-drawer--item",children:[(0,s.jsx)("figure",{className:"memori--experts-drawer--avatar",children:(0,s.jsx)("img",{src:`${n}/api/v1/memoriai/memori/avatar/${e.expertMemoriID}`,alt:e.name,onError:e=>{e.currentTarget.src=wd({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:t}),e.currentTarget.onerror=null}})}),(0,s.jsxs)("div",{className:"memori--experts-drawer--content",children:[(0,s.jsx)("h3",{className:"memori--experts-drawer--name",children:e.name}),(0,s.jsx)("p",{className:"memori--experts-drawer--description",children:e.description})]})]},e.expertID)))})})};var wU=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(qc,{spinning:g,children:[m&&d&&p&&(0,s.jsx)(d,{...p}),e&&t&&(0,s.jsx)(e,{...t}),(0,s.jsxs)("div",{className:"memori--grid",children:[(0,s.jsxs)("div",{className:"memori--grid-column memori--grid-column-left",children:[n&&r&&(0,s.jsx)(n,{...r}),(0,s.jsx)("div",{id:"extension"})]}),(0,s.jsx)("div",{className:"memori--grid-column memori--grid-column-right",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null}),v]})]})]});var CU=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(qc,{spinning:g,className:"memori-totem-layout",children:[v,m&&d&&p&&(0,s.jsx)(d,{...p}),(0,s.jsx)("div",{className:"memori-totem-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{className:"memori-totem-layout--avatar",children:n&&r&&(0,s.jsx)(n,{...r})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-totem-layout--controls",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]});var AU=({Header:e,headerProps:t,Chat:n,chatProps:r,StartPanel:i,startPanelProps:o,integrationStyle:a,integrationBackground:l,ChangeMode:c,changeModeProps:u,sessionId:d,hasUserActivatedSpeak:p,showInstruct:h=!1,loading:f=!1,poweredBy:m})=>(0,s.jsxs)(s.Fragment,{children:[a,l,(0,s.jsxs)(qc,{spinning:f,className:"memori-chat-layout",children:[m,h&&c&&u&&(0,s.jsx)(c,{...u}),(0,s.jsx)("div",{className:"memori-chat-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-chat-layout--controls",children:d&&p&&n&&r?(0,s.jsx)(n,{...r}):o?(0,s.jsx)(i,{...o}):null})]})]});c=o("85Hg2"),c=o("85Hg2");var EU=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>{var y,b;const{t:S}=ve(),[x,w]=(0,c.useState)(!0),[C,A]=(0,c.useState)(),E=(0,c.useMemo)((()=>null==o?void 0:o.stopAudio),[null==o?void 0:o.stopAudio]),M=e=>{w(e),A(e?void 0:(new Date).toISOString());try{null==E||E()}catch(e){console.log(e)}};return(0,s.jsx)("div",{className:"memori-website_assistant--"+(x?"collapsed":"expanded"),children:x?(0,s.jsx)("div",{className:"memori-website_assistant--trigger",children:(0,s.jsx)(La,{className:"memori-website_assistant--trigger-button",ghost:!0,shape:"circle",onClick:()=>M(!1),title:S("expand")||"Expand",children:(0,s.jsx)(nN,{avatar:null==r?void 0:r.memori.avatarURL})})}):(0,s.jsxs)(s.Fragment,{children:[u,(0,s.jsxs)(qc,{spinning:g,className:"memori-website_assistant-layout",children:[v,(0,s.jsx)("div",{className:"memori-website_assistant--close-button-wrapper",children:(0,s.jsx)(La,{className:"memori-website_assistant--close-button",primary:!0,shape:"circle",onClick:()=>M(!0),icon:(0,s.jsx)(Kc,{}),title:S("close")||"Close"})}),m&&d&&p&&(0,s.jsx)(d,{...p}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--header",children:e&&t&&(0,s.jsx)(e,{...t,showSettings:!1,showReload:!1})}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--avatar",children:n&&r&&(0,c.createElement)(n,{...r,integrationConfig:r.integrationConfig?{...r.integrationConfig,avatarURL:(null===(y=r.integrationConfig)||void 0===y?void 0:y.avatarURL)?`${null===(b=r.integrationConfig)||void 0===b?void 0:b.avatarURL.split("#")[0]}#${C}`:void 0}:{},key:C})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--controls",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]})})};const{deleteSession:MU,getStatistics:_U,initSession:TU}=q(),IU=new Map([[0,"🆕"],[10,"🐹"],[20,"🐇"],[30,"🐰"],[40,"💡"],[50,"🏆"],[60,"🏅"],[70,"🥉"],[80,"🥈"],[90,"🥇"],[100,"🔥"],[110,"🎓"],[120,"🤖"],[130,"👾"],[150,"🌍"],[180,"💜"],[200,"💙"],[250,"🧡"],[300,"💚"],[350,"💛"],[400,"💖"],[450,"💝"],[500,"🖤"],[550,"❤️"],[600,"🧠"]]),RU=e=>{const t=Array.from(IU.keys()).filter((t=>t<=e));if(t.length>0){const e=t[t.length-1];return IU.get(e)}return""},PU=e=>{if("🆕"===e)return{points:10,badge:"🐹"};let t,n,r=!1;for(const[i,o]of IU){if(r){t=i,n=o;break}o===e&&(r=!0)}return n&&t?{points:t,badge:n}:void 0},kU=e=>{let t=0;for(const[n,r]of IU)if(r===e){t=n;break}return t},OU=e=>{const t=Math.round(e),n=RU(t);return{points:t,badge:n,pointsForCurrentBadge:kU(n),nextBadge:PU(n)}},NU=(e,t=!0,n=!1,r,i=!1,o=!1)=>{const s=new CustomEvent("MemoriTextEntered",{detail:{text:e,waitForPrevious:t,hidden:n,typingText:r,useLoaderTextAsMsg:i,hasBatchQueued:o}});document.dispatchEvent(s);window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak"))}),300)};let LU,DU,BU,zU,FU,UU;window.getMemoriState=e=>{var t,n,r,i,o;let s=e?document.querySelector(`.memori-widget[data-memori-integration="${e}"]`)||(null===(n=null===(t=document.querySelector("memori-client"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector(".memori-widget[data-memori-integration]")):document.querySelector(".memori-widget")||(null===(i=null===(r=document.querySelector("memori-client"))||void 0===r?void 0:r.shadowRoot)||void 0===i?void 0:i.querySelector(".memori-widget"));if(!s)return null;let a=null===(o=s.dataset)||void 0===o?void 0:o.memoriEngineState;return a?JSON.parse(a):null},window.typeMessage=NU,window.typeMessageHidden=(e,t=!0,n,r=!1,i=!1)=>NU(e,t,!0,n,r,i),window.typeBatchMessages=e=>{function t(){var e,t,n,r;null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e||e.setAttribute("disabled","");const i="opacity: 0.5; touch-action: none; pointer-events: none;";null===(t=document.querySelector("textarea.memori-chat-textarea--input"))||void 0===t||t.setAttribute("style",i),null===(n=document.querySelector("button.memori-chat-inputs--send"))||void 0===n||n.setAttribute("style",i),null===(r=document.querySelector("button.memori-chat-inputs--mic"))||void 0===r||r.setAttribute("style",i)}function n(){var e,t,n,r;null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e||e.removeAttribute("disabled"),null===(t=document.querySelector("textarea.memori-chat-textarea--input"))||void 0===t||t.removeAttribute("style"),null===(n=document.querySelector("button.memori-chat-inputs--send"))||void 0===n||n.removeAttribute("style"),null===(r=document.querySelector("button.memori-chat-inputs--mic"))||void 0===r||r.removeAttribute("style")}function r(){var e;return!!(null===(e=document.querySelector("fieldset#chat-fieldset"))||void 0===e?void 0:e.hasAttribute("disabled"))}const i=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent),o=function*(){yield*e}();t();const s=()=>{const e=o.next(),a=e.value;if(a){r()||t();let o=a.waitForPrevious;i&&(o=!1),NU(a.message,o,a.hidden,a.typingText,a.useLoaderTextAsMsg,!e.done),i&&setTimeout((()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak")),n()}),3e3)}else r()&&n();if(e.done)return document.removeEventListener("MemoriEndSpeak",s),void(r()&&n())};document.addEventListener("MemoriEndSpeak",s),s()};let jU=!1,HU=!1;var VU=({memori:e,memoriConfigs:n,memoriLang:r,multilingual:i,integration:o,layout:a="DEFAULT",customLayout:l,showInstruct:u=!1,showShare:d,preview:p=!1,embed:h=!1,showInputs:f=!0,showDates:m=!1,showContextPerLine:g=!1,showSettings:v=!0,showTypingText:y=!1,showClear:b=!1,showOnlyLastMessages:S,height:x="100vh",secret:w,baseUrl:C="https://aisuru.com",apiUrl:A="https://backend.memori.ai",initialContextVars:E,initialQuestion:M,ogImage:_,sessionID:T,tenant:I,personification:R,authToken:P,AZURE_COGNITIVE_SERVICES_TTS_KEY:k,onStateChange:O,additionalInfo:N,additionalSettings:L,customMediaRenderer:D,userAvatar:B})=>{var z,F,U,j,H,V,G,W,K,J,Q,Y,X,$,Z,ee,te,ne,re,ie,oe,se;const{t:ae,i18n:le}=ve(),[ce,ue]=(0,c.useState)(!1);(0,c.useEffect)((()=>{ue(!0)}),[]);const de=q(A),{initSession:pe,postTextEnteredEvent:he,postPlaceChangedEvent:fe,postTimeoutEvent:me,postTagChangedEvent:ge,getSession:ye,getContentQualityIndexes:be,getExpertReferences:Se}=de,[xe,we]=(0,c.useState)(!1),[Ce,Ae]=(0,c.useState)(null!==(z=null==N?void 0:N.loginToken)&&void 0!==z?z:P),[Ee,Me]=(0,c.useState)({avatarURL:"string"==typeof B?B:void 0});(0,c.useEffect)((()=>{Ce&&de.backend.getCurrentUser(Ce).then((({user:e,resultCode:t})=>{e&&0===t&&Me(e)}))}),[Ce]);const[_e,Te]=(0,c.useState)(!1),[Ie,Re]=(0,c.useState)(!1),Pe=(null===(j=null===(U=null===(F=e.culture)||void 0===F?void 0:F.split("-"))||void 0===U?void 0:U[0])||void 0===j?void 0:j.toUpperCase())||(null===(W=null===(G=null===(V=null===(H=null==n?void 0:n.find((t=>t.memoriConfigID===e.memoriConfigurationID)))||void 0===H?void 0:H.culture)||void 0===V?void 0:V.split("-"))||void 0===G?void 0:G[0])||void 0===W?void 0:W.toUpperCase()),ke=(null==o?void 0:o.customData)?JSON.parse(o.customData):null,Oe=void 0!==i?i:!!(null==ke?void 0:ke.multilanguage),[Ne,Le]=(0,c.useState)(null!==(Y=null!==(Q=null!==(J=null!==(K=null!=r?r:null==ke?void 0:ke.lang)&&void 0!==K?K:Pe)&&void 0!==J?J:null==ke?void 0:ke.uiLang)&&void 0!==Q?Q:le.language)&&void 0!==Y?Y:"IT"),[De,Be]=(0,c.useState)(!1),[ze,Fe]=(0,c.useState)(!1),[Ue,je]=(0,c.useState)(),He=a||(null==ke?void 0:ke.layout)||"DEFAULT",[Ve,Ge]=(0,c.useState)(!1),[We,qe]=(0,c.useState)(!1),[Ke,Je]=(0,c.useState)(!1),[Qe,Ye]=(0,c.useState)(!1),[Xe,$e]=(0,c.useState)(!1),[Ze,et]=(0,c.useState)(!1),[tt,nt]=(0,c.useState)(!1),[rt,it]=(0,c.useState)(!1),[ot,st]=(0,c.useState)(2),[at,lt]=(0,c.useState)(!1),[ct,ut]=(0,c.useState)("center"),[dt,pt]=(0,c.useState)(!1);(0,c.useEffect)((()=>{lt(!!BU),HU=!!BU}),[BU]),(0,c.useEffect)((()=>{let e="bottom",t=dU("microphoneMode","HOLD_TO_TALK");window.innerWidth<=768?(e="bottom",t="HOLD_TO_TALK"):e=window.matchMedia("(orientation: portrait)").matches||window.innerHeight>window.innerWidth?"center":"bottom",nt(dU("muteSpeaker",!1)),jU=dU("muteSpeaker",!1),it("CONTINUOUS"===t),st(dU("continuousSpeechTimeout",2)),ut(dU("controlsPosition",e)),pt(dU("hideEmissions",!1))}),[]);const[ht,ft]=(0,c.useState)(w),[mt,gt]=(0,c.useState)(),[vt,yt]=(0,c.useState)(null),[bt,St]=(0,c.useState)(),xt=async(e,t)=>{var n;const r=null!=t?t:Dt;if(e&&r){const{currentState:t,...i}=await fe({sessionId:r,placeName:e.placeName,latitude:e.latitude,longitude:e.longitude,uncertaintyKm:null!==(n=e.uncertainty)&&void 0!==n?n:0});t&&0===i.resultCode&&Ut({...zt,...t})}},[wt,Ct]=(0,c.useState)(""),[At,Et]=(0,c.useState)(!1),[Mt,_t]=(0,c.useState)([]),Tt=e=>{_t((t=>{var n,r;return[...t,{...e,media:null!==(r=null===(n=e.media)||void 0===n?void 0:n.filter((e=>{var t;return!("text/javascript"===e.mimeType&&(null===(t=e.properties)||void 0===t?void 0:t.executable))})))&&void 0!==r?r:[]}]}))},It=async(n,r,i,o=!0,s,a=!1,l,c=!1,u=!1)=>{var d,p,h,f;const m=i||Dt||(null===(d=window.getMemoriState())||void 0===d?void 0:d.sessionID);if(!m||!(null==n?void 0:n.length))return;a||Tt({text:n,translatedText:s,fromUser:!0,media:null!=r?r:[],initial:Dt?!!i&&i!==Dt:!!i}),Fe(!0),je(l);let g=n,v=!1;if(o&&!xe&&Oe&&Ne.toUpperCase()!==Pe.toUpperCase()){g=(await lp(n,Pe,Ne,C)).text}const{currentState:y,...b}=await he({sessionId:m,text:g});if(0===b.resultCode&&y){const n=c&&l?l:null!==(p=y.emission)&&void 0!==p?p:null==zt?void 0:zt.emission;if("X4"===y.state&&e.giverTag){const{currentState:r,...i}=await ge(m,e.giverTag);0===i.resultCode?(Ut(r),n&&(Tt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),nn(n))):(console.error(b,i),t(Ss).error(ae(gU(i.resultCode))),v=!0)}else if("X2d"===y.state&&e.giverTag){const{currentState:r,...i}=await he({sessionId:m,text:Math.random().toString().substring(2,8)});if(0===i.resultCode){const{currentState:r,...i}=await ge(m,e.giverTag);0===i.resultCode?(Ut(r),n&&(Tt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),nn(n))):(console.error(b,i),t(Ss).error(ae(gU(i.resultCode))),v=!0)}else console.error(b,i),t(Ss).error(ae(gU(i.resultCode))),v=!0}else Ne.toLowerCase()!==Pe.toLowerCase()&&n&&!xe&&Oe?Rt(y,Ne).then((e=>{e.emission&&nn(e.emission)})):(Ut({...y,emission:n}),n&&(Tt({text:n,emitter:y.emitter,media:y.media,fromUser:!1,generatedByAI:!!y.completion}),nn(n)))}else 404===b.resultCode&&(_t((e=>[...e.slice(0,e.length-1)])),Ht(!1,ht||e.secretToken,mt,xe&&e.giverTag?e.giverTag:void 0,xe&&e.giverPIN?e.giverPIN:void 0,{PATHNAME:window.location.pathname,ROUTE:(null===(f=null===(h=window.location.pathname)||void 0===h?void 0:h.split("/"))||void 0===f?void 0:f.pop())||"",...E||{}},M).then((e=>{console.info("session timeout"),(null==e?void 0:e.sessionID)&&setTimeout((()=>{It(n,r,null==e?void 0:e.sessionID)}),500)})));u||(je(void 0),Fe(!1))},Rt=async(e,t)=>{var n,r,i;const o=null!==(n=e.emission)&&void 0!==n?n:null==zt?void 0:zt.emission;let s={...e},a=null;if(o&&!xe&&Pe.toUpperCase()!==t.toUpperCase()&&Oe){const n=await lp(o,t,Pe,C);if(e.hints&&e.hints.length>0){const i=await Promise.all((null!==(r=e.hints)&&void 0!==r?r:[]).map((async e=>{var n;const r=await lp(e,t,Pe,C);return{text:null!==(n=null==r?void 0:r.text)&&void 0!==n?n:e,originalText:e}})));s={...e,emission:n.text,translatedHints:i}}else s={...e,emission:n.text,hints:null!==(i=e.hints)&&void 0!==i?i:"G1"===e.state?null==zt?void 0:zt.hints:[]};n.text.length>0&&(a={text:n.text,emitter:e.emitter,media:e.media,fromUser:!1,generatedByAI:!!e.completion})}else s={...e,emission:o},o&&(a={text:o,emitter:e.emitter,media:e.media,fromUser:!1});return Ut(s),a&&Tt(a),s},Pt=void 0!==e.ageRestriction?e.ageRestriction:e.nsfw?18:e.enableCompletions?14:0,[kt,Ot]=(0,c.useState)(),[Nt,Lt]=(0,c.useState)(!1),[Dt,Bt]=(0,c.useState)(T),[zt,Ft]=(0,c.useState)(),Ut=e=>{var t;Ft(e),O&&O(e);const n=null===(t=null==e?void 0:e.media)||void 0===t?void 0:t.filter((e=>{var t;return"text/javascript"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)}));null==n||n.forEach((e=>{try{setTimeout((()=>{var t;console.log("snippet",e),new Function(null!==(t=e.content)&&void 0!==t?t:"")(),setTimeout((()=>{var e,t,n;null===(e=document.querySelector(".memori-chat--content"))||void 0===e||e.scrollTo(0,null!==(n=null===(t=document.querySelector(".memori-chat--content"))||void 0===t?void 0:t.scrollHeight)&&void 0!==n?n:0)}),400)}),1e3)}catch(e){console.error(e)}}))},jt=async n=>{var r,i,o,s,a;let l=dU("birthDate",void 0);if(kt||l||!Pt)if("PUBLIC"===e.privacyType||e.secretToken||ht||mt){Be(!0);try{if(!e.giverTag&&(null===(r=e.receivedInvitations)||void 0===r?void 0:r.length)){let t=e.receivedInvitations.find((e=>"GIVER"===e.type&&"ACCEPTED"===e.state));t&&(e.giverTag=t.tag,e.giverPIN=t.pin)}let l;try{l=window.location.href}catch(e){console.error(e)}const c=await pe({...n,tag:null!==(i=n.tag)&&void 0!==i?i:null==R?void 0:R.tag,pin:null!==(o=n.pin)&&void 0!==o?o:null==R?void 0:R.pin,additionalInfo:{...N||{},loginToken:null!==(a=null!==(s=null==N?void 0:N.loginToken)&&void 0!==s?s:Ce)&&void 0!==a?a:P,language:$t(Ne),referral:l}});if((null==c?void 0:c.sessionID)&&(null==c?void 0:c.currentState)&&0===c.resultCode)return Bt(c.sessionID),bt&&xt(bt,c.sessionID),Be(!1),{dialogState:c.currentState,sessionID:c.sessionID};(null==c?void 0:c.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(c),t(Ss).error(ae("underageTwinSession",{age:Pt})),Re(!0)):403===(null==c?void 0:c.resultCode)?(ft(void 0),yt("password")):(console.error(c),t(Ss).error(ae(gU(null==c?void 0:c.resultCode))),Re(!0))}catch(e){console.error(e),new Error("Error fetching session")}}else yt("password");else Lt(!0)},Ht=async(n=!1,r,i,o,s,a,l,c)=>{var u,d,p,h,f;Be(!0);try{let m,g=dU("birthDate",void 0);if(!c&&!g&&Pt)return void Lt(!0);if(!("PUBLIC"===e.privacyType||r||e.secretToken||ht||i||mt))return void yt("password");try{m=window.location.href}catch(e){console.error(e)}const{sessionID:v,currentState:y,...b}=await pe({memoriID:null!==(u=e.engineMemoriID)&&void 0!==u?u:"",password:r||ht||e.secretToken,recoveryTokens:i||mt,tag:o,pin:s,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(p=null===(d=window.location.pathname)||void 0===d?void 0:d.split("/"))||void 0===p?void 0:p.pop())||"",...a||{}},initialQuestion:l,birthDate:c||g||void 0,additionalInfo:{...N||{},loginToken:null!==(f=null!==(h=null==N?void 0:N.loginToken)&&void 0!==h?h:Ce)&&void 0!==f?f:P,language:$t(Ne),referral:m}});if(v&&y&&0===b.resultCode)return Bt(v),n&&(Ut(y),y.emission&&(Mt.length<=1?_t([{text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}]):Tt({text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}))),bt&&xt(bt,v),Be(!1),{dialogState:y,sessionID:v};(null==b?void 0:b.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(b),t(Ss).error(ae("underageTwinSession",{age:Pt})),Re(!0)):403===(null==b?void 0:b.resultCode)?(ft(void 0),yt("password")):(console.error(b),t(Ss).error(ae(gU(b.resultCode))),Re(!0))}catch(e){console.error(e)}return Be(!1),null},Vt=async(t,n,r,i)=>{var o,s,a,l,c;if(!t||!n)return console.error("CHANGETAG/Session not found"),Promise.reject("Session not found");try{const{currentState:t,resultCode:u}=await ge(n,null!=r?r:up);if(0===u){let d=0;if(r!==up&&i&&("X1a"===t.state||"X1b"===t.state)){const{resultCode:e}=await he({sessionId:n,text:null!=i?i:""});d=e}if(0===d){const{currentState:e,...t}=await ye(n);if(0===t.resultCode&&e)return{currentState:e,sessionId:n,...t}}else if([400,401,403,404,500].includes(u)){console.warn("[APPCONTEXT/CHANGETAG]",u);let t,n=dU("birthDate",void 0);try{t=window.location.href}catch(e){console.error(e)}jt({memoriID:null!==(o=e.engineMemoriID)&&void 0!==o?o:"",password:w||ht||e.secretToken,tag:e.giverTag,pin:e.giverPIN,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(a=null===(s=window.location.pathname)||void 0===s?void 0:s.split("/"))||void 0===a?void 0:a.pop())||"",...E||{}},initialQuestion:M,birthDate:kt||n||void 0,additionalInfo:{...N||{},loginToken:null!==(c=null!==(l=null==N?void 0:N.loginToken)&&void 0!==l?l:Ce)&&void 0!==c?c:P,language:$t(Ne),referral:t}})}else if(t)return{currentState:t,sessionId:n,resultCode:u}}}catch(e){let t=e;return console.error("[APPCONTEXT/CHANGETAG]",t),Promise.reject(t)}return null};(0,c.useEffect)((()=>()=>{zt&&(null==zt?void 0:zt.currentTag)===e.giverTag||(async()=>{Dt&&e.giverTag&&e.giverPIN&&(_t([]),await Vt(e.engineMemoriID,Dt,e.giverTag,e.giverPIN))})()}),[]);const[Gt,Wt]=(0,c.useState)(),qt=(0,c.useRef)(),Kt=()=>{Gt&&(clearTimeout(Gt),Wt(void 0)),(null==qt?void 0:qt.current)&&(clearTimeout(qt.current),qt.current=void 0)},Jt=()=>{Kt(),!(null==zt?void 0:zt.acceptsTimeout)||BU||at||wt.length||ze||At||Yt()},Qt=async()=>{var e;if(BU||at||wt.length||ze||At)Jt();else if(Dt&&Ve&&(null==zt?void 0:zt.acceptsTimeout)){const{currentState:t,...n}=await me(Dt);if(0===n.resultCode&&t){const n=t.emission;!xe&&Oe&&Ne!==(null==le?void 0:le.language)&&n&&n.length>0?Rt({...t,emission:n},Ne).then((e=>{e.emission&&nn(e.emission)})):n&&n.length>0&&(Tt({text:n,emitter:t.emitter,media:t.media,fromUser:!1,generatedByAI:!!t.completion}),nn(n),Ut({...t,hints:null!==(e=t.hints)&&void 0!==e?e:"G1"===t.state?null==zt?void 0:zt.hints:[]}))}}},Yt=()=>{let e=null==zt?void 0:zt.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==zt?void 0:zt.emission){e+=zt.emission.length/26.5}}let t=setTimeout(Qt,1e3*e);Wt(t),qt.current=t};(0,c.useEffect)((()=>{(wt.length||at||ze)&&Kt(),Dt&&!wt.length&&Jt()}),[null==zt?void 0:zt.acceptsTimeout,null==zt?void 0:zt.timeout,null==zt?void 0:zt.state,at,Dt,Mt,wt,ze]),(0,c.useEffect)((()=>()=>{Ge(!1),Te(!1),Kt(),qt.current=void 0}),[]);const Xt=(0,c.useCallback)((t=>{var n,r,i,o;let s="",a=(null!==(o=null!==(i=null!=t?t:null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])&&void 0!==i?i:le.language)&&void 0!==o?o:"IT").toUpperCase(),l=e.voiceType;if(e.enableBoardOfExperts&&(null==zt?void 0:zt.emitter)){null==Nn||Nn.find((e=>e.name===(null==zt?void 0:zt.emitter)))}switch(a){case"IT":s=""+("MALE"===l?"it-IT-DiegoNeural":"it-IT-ElsaNeural");break;case"DE":s=""+("MALE"===l?"de-DE-ConradNeural":"de-DE-KatjaNeural");break;case"EN":s=""+("MALE"===l?"en-GB-RyanNeural":"en-GB-SoniaNeural");break;case"ES":s=""+("MALE"===l?"es-ES-AlvaroNeural":"es-ES-ElviraNeural");break;case"FR":s=""+("MALE"===l?"fr-FR-HenriNeural":"fr-FR-DeniseNeural");break;case"PT":s=""+("MALE"===l?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural");break;case"UK":s=""+("MALE"===l?"uk-UA-OstapNeural":"uk-UA-PolinaNeural");break;case"RU":s=""+("MALE"===l?"ru-RU-DmitryNeural":"ru-RU-SvetlanaNeural");break;case"PL":s=""+("MALE"===l?"pl-PL-MarekNeural":"pl-PL-AgnieszkaNeural");break;case"FI":s=""+("MALE"===l?"fi-FI-HarriNeural":"fi-FI-SelmaNeural");break;default:s=""+("MALE"===l?"it-IT-DiegoNeural":"it-IT-IsabellaNeural")}return s}),[e.voiceType,e.enableBoardOfExperts,null==zt?void 0:zt.emitter,le.language,e.culture]),$t=t=>{var n,r;let i="";switch((t||(null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])||le.language||"IT").toUpperCase()){case"IT":default:i="it-IT";break;case"DE":i="de-DE";break;case"EN":i="en-GB";break;case"ES":i="es-ES";break;case"FR":i="fr-FR";break;case"PT":i="pt-PT";break;case"UK":i="uk-UK";break;case"RU":i="ru-RU";break;case"PL":i="pl-PL";break;case"FI":i="fi-FI"}return i},[Zt,en]=(0,c.useState)();(0,c.useEffect)((()=>{(async()=>{try{const e=await fetch(`${C||"https://aisuru.com"}/api/lexiconmap`);return await e.json()}catch(e){console.error(e)}})().then((e=>{en(e)}))}),[]);const tn=()=>{const e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e)},nn=e=>{if(!k||p)return void tn();if(hn(),p)return;if(tt||jU)return HU=!1,Fe(!1),tn(),void(rt&&un());zU&&zU.pause();let t=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),n=/iPad|iPhone|iPod/.test(navigator.userAgent);if("interrupted"===FU.state)return void FU.resume().then((()=>nn(e)));if("closed"===FU.state){FU=new Wo;let e=FU.createBuffer(1,1e4,22050),t=FU.createBufferSource();t.buffer=e,t.connect(FU.destination)}else if("suspended"===FU.state){rn(),FU=new Wo;let e=FU.createBuffer(1,1e4,22050),t=FU.createBufferSource();t.buffer=e,t.connect(FU.destination)}if(!BU){n||(zU=new ms.SpeakerAudioDestination);let e=ms.AudioConfig.fromSpeakerOutput(zU);BU=new ms.SpeechSynthesizer(DU,e)}const r=FU.createBufferSource();r.addEventListener("ended",(()=>{lt(!1),HU=!1})),zU.onAudioEnd=()=>{lt(!1),HU=!1,r.disconnect(),tn(),yn()},BU.speakSsmlAsync(`<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" xml:lang="${$t(Ne)}"><voice name="${Xt(Ne)}"><s>${((e,t)=>{var n;if(!Zt)return e;const r={...null!==(n=Zt.common)&&void 0!==n?n:{},...(null==I?void 0:I.id)&&Zt[I.id]?Zt[I.id]:{}},i=Object.keys(r).map((e=>{var n;return{word:e,phoneme:null!==(n=r[e][t.toLowerCase()])&&void 0!==n?n:r[e].default,caseSensitive:r[e].caseSensitive}}));return i.reduce(((e,{word:t,phoneme:n,caseSensitive:r})=>e.replace(new RegExp(`\\b${t}\\b`,r?"g":"gi"),`<phoneme alphabet="ipa" ph="${n}">${t}</phoneme>`)),e)})((e=>{const t=document.createElement("textarea");return t.textContent=e,t.innerHTML})(Sd(e)),Ne.toLowerCase())}</s></voice></speak>`,(i=>{if(i){lt(!0),HU=!0;try{FU.decodeAudioData(i.audioData,(function(e){r.buffer=e,r.connect(FU.destination),(Mt.length<1||t&&n)&&r.start(0)})),FU.onstatechange=()=>{"suspended"===FU.state||"closed"===FU.state?(r.disconnect(),lt(!1),HU=!1):"interrupted"===FU.state&&FU.resume()},FU.resume(),BU&&(BU.close(),BU=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),lt(!1),HU=!1,BU&&(BU.close(),BU=null),tn()}}else FU.resume(),lt(!1),HU=!1,tn()}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),lt(!1),HU=!1,tn()})),Fe(!1)},rn=()=>{lt(!1),HU=!1;try{BU&&(BU.close(),BU=null),"closed"!==FU.state&&FU.close(),zU&&(zU.pause(),zU.close())}catch(e){console.error("stopAudio error: ",e)}};(0,c.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==zt?void 0:zt.emission]);const[on,sn]=(0,c.useState)(""),an=()=>sn(""),[ln,cn]=(0,c.useState)(null),un=()=>{let e=setTimeout((async()=>{fn();const e=bd(on);e.length>0&&At?(It(e),an(),Ct("")):At&&Jt()}),1e3*ot);cn(e)},dn=()=>{ln&&(clearTimeout(ln),cn(null))};(0,c.useEffect)((()=>{dn(),rt&&un(),Jt()}),[on]);const pn=()=>{if(k){fn(),sn(""),an();try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){qe(!0),DU||(DU=ms.SpeechConfig.fromSubscription(k,"eastus"),DU.speechRecognitionLanguage=$t(Ne),DU.speechSynthesisLanguage=$t(Ne),DU.speechSynthesisVoiceName=Xt(Ne));const t=ms.AudioConfig.fromDefaultMicrophoneInput();LU=new ms.SpeechRecognizer(DU,t),Et(!0),LU.recognized=(e,t)=>{if(t.result.text)if(t.result.reason===ms.ResultReason.RecognizedSpeech){let e=t.result.text;if(sn(e||""),(null==e?void 0:e.length)>0){const t=bd(e);t.length>0&&Ct((e=>`${e} ${t}`))}}else t.result.reason===ms.ResultReason.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},LU.canceled=(e,t)=>{t.reason===ms.CancellationReason.Error&&(console.debug(`"CANCELED: ErrorCode=${t.errorCode}`),console.debug(`"CANCELED: ErrorDetails=${t.errorDetails}`),console.debug("CANCELED: Did you set the speech resource key and region values?")),hn()},LU.sessionStopped=(e,t)=>{hn()},an(),LU.startContinuousRecognitionAsync()})).catch(console.error)}catch(e){console.error(e)}}},hn=()=>{LU&&(LU.stopContinuousRecognitionAsync(),LU.close(),LU=null),Et(!1)},fn=()=>{qe(!1),hn(),dn()},mn=()=>{try{fn(),Kt(),Te(!1),qt.current=void 0,rn()}catch(e){console.log("Error: resetUIEffects",e)}};(0,c.useEffect)((()=>()=>{mn()}),[]),(0,c.useEffect)((()=>(document.addEventListener("MemoriResetUIEffects",mn),()=>{document.removeEventListener("MemoriResetUIEffects",mn)})),[]),(0,c.useEffect)((()=>{"Z0"===(null==zt?void 0:zt.state)&&fn()}),[null==zt?void 0:zt.state]);const[gn,vn]=(0,c.useState)(!1),yn=(0,c.useCallback)((e=>{at&&BU&&(BU.close(),BU=null),!rt||!We&&gn||(vn(!0),pn())}),[rt,We]);(0,c.useEffect)((()=>{Mt.length>1&&!at&&rt&&(We||!gn)?pn():at&&At&&hn()}),[at]),(0,c.useEffect)((()=>{At&&(fn(),an(),Ct(""),pn())}),[Pe]);const[bn,Sn]=(0,c.useState)("keypress");(0,c.useEffect)((()=>{const e=dU("sendOnEnter","keypress");window.innerWidth<=768?Sn("click"):Sn(e)}),[]),(0,c.useEffect)((()=>{pU("sendOnEnter",bn)}),[bn]);const[xn,wn]=(0,c.useState)(),Cn=null==ke?void 0:ke.globalBackground,An=Cn?`url(${Cn})`:null,En=o?{"--memori-chat-bubble-bg":"#fff",...ke&&!u?{"--memori-text-color":null!==(X=ke.textColor)&&void 0!==X?X:"#000"}:{},...(null==ke?void 0:ke.buttonBgColor)?{"--memori-button-bg":ke.buttonBgColor,"--memori-primary":ke.buttonBgColor}:{},...(null==ke?void 0:ke.buttonTextColor)?{"--memori-button-text":ke.buttonTextColor}:{},...(null==ke?void 0:ke.blurBackground)?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...(null==ke?void 0:ke.innerBgColor)?{"--memori-inner-bg":`rgba(${"dark"===ke.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==($=ke.innerBgAlpha)&&void 0!==$?$:.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===ke.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(Z=null==ke?void 0:ke.innerBgAlpha)&&void 0!==Z?Z:.4})`}:{"--memori-inner-content-pad":"0px"}}:{},Mn=`\n ${p?"#preview,":"WEBSITE_ASSISTANT"===He?"":":root,"} .memori-widget {\n ${Object.entries(En).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,_n=void 0===(null==ke?void 0:ke.showAIicon)||(null==ke?void 0:ke.showAIicon),[Tn,In]=(0,c.useState)(!1);(0,c.useEffect)((()=>{(window.innerWidth>=768&&"FULLPAGE"===He||"FULLPAGE"!==He)&&In(!0)}),[]);const[Rn,Pn]=(0,c.useState)();(0,c.useEffect)((()=>{e.engineMemoriID&&(async e=>{let t,n;try{const{contentQualityIndex:r,answerQualityIndex:i,unansweredQuestions:o,...s}=await be(e);0===s.resultCode&&(t=r,n=o)}catch(e){let t=e;console.error("[APPCONTEXT/QUERYGAMIFICATIONPOINTS]",t)}return{points:null!=t?t:0,unansweredQuestions:null!=n?n:0}})(e.engineMemoriID).then((e=>{Pn(OU(e.points))})).catch(console.error)}),[e.engineMemoriID]),(0,c.useEffect)((()=>{if(null==ke?void 0:ke.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",ke.seoTitle),document.head.append(e)}if(null==ke?void 0:ke.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",ke.seoDescription),document.head.append(e)}if(null==ke?void 0:ke.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",ke.seoUrl),document.head.append(e)}let t=_||e.avatarURL;if((null==ke?void 0:ke.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}}),[ke,e.avatarURL,_]);const kn=(0,c.useCallback)((e=>{const{text:t,waitForPrevious:n,hidden:r,typingText:i,useLoaderTextAsMsg:o,hasBatchQueued:s}=e.detail;t&&(n&&!jU&&(HU||ze)?setTimeout((()=>{kn(e)}),1e3):(hn(),rn(),It(t,void 0,void 0,void 0,void 0,r,i,o,s)))}),[Dt,at,ze,Ne]);(0,c.useEffect)((()=>(document.addEventListener("MemoriTextEntered",kn),()=>{document.removeEventListener("MemoriTextEntered",kn)})),[Dt,Ne]);const On=(0,c.useCallback)((async t=>{var n,r,i,o,s,a,l,c;const u=(null==t?void 0:t.sessionID)||Dt,d=(null==t?void 0:t.dialogState)||zt;Te(!0);let p=document.getElementById("memori-audio"),h=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome");p&&h&&(p.muted=!1,p.play().catch((e=>{console.error("error playing intro audio",e)})));let f=dU("birthDate",void 0),m=kt||f||void 0;if(u||!Pt||m){if(!u&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!ht&&!mt||!u&&Ie)return yt("password"),void Te(!1);if(!u){Te(!1),Re(!1);const t=await jt({memoriID:e.engineMemoriID,password:w||ht||e.secretToken,tag:null==R?void 0:R.tag,pin:null==R?void 0:R.pin,initialContextVars:{PATHNAME:window.location.pathname,ROUTE:(null===(r=null===(n=window.location.pathname)||void 0===n?void 0:n.split("/"))||void 0===r?void 0:r.pop())||"",...E||{}},initialQuestion:M,birthDate:m});return void((null==t?void 0:t.dialogState)?(_t([]),Rt(t.dialogState,Ne).then((e=>{e.emission&&nn(e.emission)})).finally((()=>{Ge(!0)}))):await On(t||void 0))}if(T){const{currentState:t,...n}=await ye(u);if(0!==n.resultCode||!t)return console.debug("session expired, opening new session"),Re(!0),Bt(void 0),Te(!1),void await On();if(_t([]),xe&&e.giverTag&&(null==zt?void 0:zt.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await Vt(e.engineMemoriID,u,"-");const t=await Vt(e.engineMemoriID,u,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");Rt(t.currentState,Ne).then((e=>{e.emission&&nn(e.emission)})).finally((()=>{Ge(!0)}))}catch(t){console.error("session #2",t),Ht(!0,null==e?void 0:e.secretToken,void 0,null==e?void 0:e.giverTag,null==e?void 0:e.giverPIN,{PATHNAME:window.location.pathname,ROUTE:(null===(o=null===(i=window.location.pathname)||void 0===i?void 0:i.split("/"))||void 0===o?void 0:o.pop())||"",...E||{}},M,m).then((()=>{Ge(!0)}))}else if(!xe&&R&&(null==zt?void 0:zt.currentTag)!==R.tag)try{console.debug("change tag #3"),await Vt(e.engineMemoriID,u,"-");const t=await Vt(e.engineMemoriID,u,R.tag,R.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");Rt(t.currentState,Ne).then((e=>{e.emission&&nn(e.emission)})).finally((()=>{Ge(!0)}))}catch(t){console.error("session #5",t),Ht(!0,null==e?void 0:e.secretToken,void 0,R.tag,R.pin,{PATHNAME:window.location.pathname,ROUTE:(null===(a=null===(s=window.location.pathname)||void 0===s?void 0:s.split("/"))||void 0===a?void 0:a.pop())||"",...E||{}},M,m).then((()=>{Ge(!0)}))}else if(xe||R||(null==zt?void 0:zt.currentTag)===up)Rt(t,Ne).then((e=>{e.emission&&nn(e.emission)})).finally((()=>{Ge(!0)}));else try{console.debug("change tag #6"),await Vt(e.engineMemoriID,u,"-");const t=await Vt(e.engineMemoriID,u,up);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");Rt(t.currentState,Ne).then((e=>{e.emission&&nn(e.emission)})).finally((()=>{Ge(!0)}))}catch(t){console.error("session #8",t),Ht(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,{PATHNAME:window.location.pathname,ROUTE:(null===(c=null===(l=window.location.pathname)||void 0===l?void 0:l.split("/"))||void 0===c?void 0:c.pop())||"",...E||{}},M,m).then((()=>{Ge(!0)}))}}else _t([]),Rt(d,Ne).then((e=>{e.emission&&nn(e.emission)})).finally((()=>{Ge(!0)}))}else Lt(!0),Te(!1)}),[ht,e,mt,kt,Dt,Ne]);(0,c.useEffect)((()=>{const t=document.querySelector(`memori-client[memoriname="${e.name}"]`)||document.querySelector(`memori-client[memoriid="${e.memoriID}"]`)||document.querySelector("memori-client");if(!t)return;const n=new MutationObserver(((e,t)=>{var n,r,i;for(const t of e)"attributes"===t.type&&"authtoken"===(null===(n=t.attributeName)||void 0===n?void 0:n.toLowerCase())&&("MEMORI-CLIENT"===t.target.nodeName?Ae(t.target.getAttribute("authtoken")||void 0):Ae((null===(i=null===(r=t.target)||void 0===r?void 0:r.parentElement)||void 0===i?void 0:i.getAttribute("authtoken"))||void 0))}));return n.observe(t,{attributes:!0,childList:!1,subtree:!1}),()=>{n.disconnect()}}),[]);const[Nn,Ln]=(0,c.useState)(),Dn=(0,c.useCallback)((async()=>{if(Dt&&(null==e?void 0:e.enableBoardOfExperts))try{const{experts:e,count:t,...n}=await Se(Dt);0===n.resultCode?Ln(e):console.warn("Error fetching experts",n)}catch(e){console.warn(e)}}),[Dt,null==e?void 0:e.enableBoardOfExperts]);(0,c.useEffect)((()=>{Dn()}),[Dt,Dn]);const Bn=void 0===S?"TOTEM"!==a&&"WEBSITE_ASSISTANT"!==a:!S,zn={memori:e,tenant:I,history:Mt,showShare:null===(ee=null!=d?d:null==ke?void 0:ke.showShare)||void 0===ee||ee,position:bt,setShowPositionDrawer:Je,setShowSettingsDrawer:Ye,setShowKnownFactsDrawer:$e,setShowExpertsDrawer:et,showSpeaker:!!k,speakerMuted:tt||jU,setSpeakerMuted:e=>{if(jU=!!e,nt(e),pU("muteSpeaker",!!e),e)rn();else{FU=new Wo;let e=FU.createBuffer(1,1e4,22050),t=FU.createBufferSource();t.buffer=e,t.connect(FU.destination)}},showSettings:v,hasUserActivatedSpeak:Ve,showReload:"TOTEM"===He,showClear:b,clearHistory:()=>_t((e=>e.slice(-1))),loginToken:Ce,user:Ee,sessionID:Dt},Fn={memori:e,integration:o,integrationConfig:ke,tenant:I,instruct:xe,avatar3dVisible:Tn,setAvatar3dVisible:In,hasUserActivatedSpeak:Ve,isPlayingAudio:at&&!tt,loading:!!ze,baseUrl:C,apiUrl:A},Un={memori:e,tenant:I,gamificationLevel:Rn,language:Pe,userLang:Ne,setUserLang:Le,baseUrl:C,apiUrl:A,position:bt,openPositionDrawer:()=>Je(!0),integrationConfig:ke,instruct:xe,sessionId:Dt,clickedStart:_e,onClickStart:On,initializeTTS:()=>{if(!k)return;DU=ms.SpeechConfig.fromSubscription(k,"eastus"),DU.speechSynthesisLanguage=$t(Ne),DU.speechSynthesisVoiceName=Xt(Ne),DU.speechRecognitionLanguage=$t(Ne),vd()&&(DU.speechSynthesisOutputFormat=ms.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3),FU=new Wo;let e=FU.createBuffer(1,1e4,22050),t=FU.createBufferSource();t.buffer=e,t.connect(FU.destination),zU=new ms.SpeakerAudioDestination;let n=ms.AudioConfig.fromSpeakerOutput(zU);BU=new ms.SpeechSynthesizer(DU,n)},isUserLoggedIn:!!Ce,user:Ee},jn={memori:e,sessionID:Dt||"",tenant:I,translateTo:Oe&&Ne.toUpperCase()!==(null===(oe=null!==(ie=null!==(re=null===(ne=null===(te=e.culture)||void 0===te?void 0:te.split("-"))||void 0===ne?void 0:ne[0])&&void 0!==re?re:le.language)&&void 0!==ie?ie:"IT")||void 0===oe?void 0:oe.toUpperCase())?Ne:void 0,baseUrl:C,apiUrl:A,layout:a,memoriTyping:ze,typingText:Ue,showTypingText:y,history:Bn?Mt:Mt.slice(-2),authToken:Ce,dialogState:zt,setDialogState:Ut,pushMessage:Tt,simulateUserPrompt:(e,t)=>{hn(),rn(),It(e,void 0,void 0,!1,t)},showDates:m,showContextPerLine:g,showAIicon:_n,client:de,selectReceiverTag:async n=>{var r;if(Dt)try{const{currentState:i,...o}=await ge(Dt,n);if(0===o.resultCode)if(Tt({text:n,fromUser:!0}),"X4"===i.state&&e.giverTag){const{currentState:n,...r}=await de.postTagChangedEvent(Dt,e.giverTag);0===r.resultCode?(Ut(n),n.emission&&Tt({text:n.emission,emitter:n.emitter,media:n.media,fromUser:!1})):(console.error(r),t(Ss).error(ae(gU(r.resultCode))))}else Ut(i),i.emission&&Tt({text:i.emission,emitter:i.emitter,media:i.media,fromUser:!1});else console.error(o,n,null===(r=null==zt?void 0:zt.knownTags)||void 0===r?void 0:r[n]),t(Ss).error(ae(gU(o.resultCode)))}catch(e){let n=e;console.error(n),t(Ss).error(n.message)}},preview:p,sendOnEnter:bn,setSendOnEnter:Sn,microphoneMode:rt?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen:xn,setAttachmentsMenuOpen:wn,instruct:xe,showInputs:f,showMicrophone:!!k,userMessage:wt,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return Ct(""),void Jt();Ct(e),Kt()},sendMessage:e=>{rn(),hn(),It(e),Ct(""),an()},stopListening:fn,startListening:pn,stopAudio:rn,resetTranscript:an,listening:At,isPlayingAudio:at,customMediaRenderer:D,user:Ee,userAvatar:B,experts:Nn},Hn=o&&An?(0,s.jsx)("div",{className:"memori--global-background",children:(0,s.jsx)("div",{className:"memori--global-background-image",style:{backgroundImage:An}})}):(0,s.jsx)("div",{className:"memori--global-background no-background-image"}),Vn=o?(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:Mn}}):null,Gn={canInstruct:!!e.giverTag,instruct:!!xe,onChangeMode:e=>{we("instruct"===e),Ge(!1),Te(!1)}},Wn=(0,s.jsx)(hL,{tenant:I,userLang:Ne,integrationID:null==o?void 0:o.integrationID,memoriHash:`${e.ownerTenantName}-${e.ownerUserName}-${e.name}`}),qn=l||("TOTEM"===He?CU:"CHAT"===He?AU:"FULLPAGE"===He?wU:"WEBSITE_ASSISTANT"===He?EU:wU);return(0,s.jsxs)("div",{className:t(ys)("memori","memori-widget",`memori-layout-${a.toLowerCase()}`,`memori-controls-${ct.toLowerCase()}`,`memori--avatar-${(null==ke?void 0:ke.avatar)||"default"}`,{"memori--preview":p,"memori--embed":h,"memori--with-integration":o,"memori--with-speechkey":!!k,"memori--active":Ve,"memori--hide-emissions":dt,"memori--has-active-session":!!Dt}),"data-memori-name":null==e?void 0:e.name,"data-memori-id":null==e?void 0:e.engineMemoriID,"data-memori-secondary-id":null==e?void 0:e.memoriID,"data-memori-session-id":Dt,"data-memori-integration":null==o?void 0:o.integrationID,"data-memori-engine-state":JSON.stringify({...zt,sessionID:Dt}),style:{height:x},children:[(0,s.jsx)(qn,{Header:pL,headerProps:zn,Avatar:sN,avatarProps:Fn,Chat:um,chatProps:jn,StartPanel:vm,startPanelProps:Un,integrationStyle:Vn,integrationBackground:Hn,ChangeMode:aN,changeModeProps:Gn,poweredBy:Wn,sessionId:Dt,hasUserActivatedSpeak:Ve,showInstruct:u,loading:De}),(0,s.jsx)("audio",{id:"memori-audio",style:{display:"none"},src:"https://aisuru.com/intro.mp3"}),ce&&(0,s.jsx)(gd,{withModal:!0,pwdOrTokens:vt,openModal:!!vt,setPwdOrTokens:yt,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{var n,r;t.password&&ft(t.password),t.password&&(UU=t.password),t.tokens&>(t.tokens),Ht(!Dt,t.password,t.tokens,xe?e.giverTag:null==R?void 0:R.tag,xe?e.giverPIN:null==R?void 0:R.pin,{PATHNAME:window.location.pathname,ROUTE:(null===(r=null===(n=window.location.pathname)||void 0===n?void 0:n.split("/"))||void 0===r?void 0:r.pop())||"",...E||{}},M,kt).then((e=>{yt(null),On(e||void 0)})).catch((()=>{yt(null),Re(!0)}))},minimumNumberOfRecoveryTokens:null!==(se=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==se?se:1}),ce&&(0,s.jsx)(sU,{visible:Nt,minAge:Pt,onClose:t=>{var n,r;t?(Ot(t),pU("birthDate",t),Ht(!Dt,UU||ht||(null==e?void 0:e.secretToken),mt,xe?e.giverTag:null==R?void 0:R.tag,xe?e.giverPIN:null==R?void 0:R.pin,{PATHNAME:window.location.pathname,ROUTE:(null===(r=null===(n=window.location.pathname)||void 0===n?void 0:n.split("/"))||void 0===r?void 0:r.pop())||"",...E||{}},M,t).then((e=>{Lt(!1),yt(null),On(e||void 0)})).catch((()=>{Lt(!1),Re(!0)}))):(Lt(!1),Te(!1))}}),Qe&&(0,s.jsx)(fU,{layout:He,open:!!Qe,onClose:()=>Ye(!1),microphoneMode:rt?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout:ot,setMicrophoneMode:e=>it("CONTINUOUS"===e),setContinuousSpeechTimeout:st,controlsPosition:ct,setControlsPosition:ut,hideEmissions:dt,setHideEmissions:pt,additionalSettings:L}),Xe&&Dt&&(0,s.jsx)(SU,{apiURL:A,memori:e,sessionID:Dt,visible:Xe,closeDrawer:()=>$e(!1)}),Ze&&!!Nn&&(0,s.jsx)(xU,{apiUrl:A,baseUrl:C,tenant:I,experts:Nn,open:Ze,onClose:()=>et(!1)})]})};const GU={id:"aisuru.com",theme:"aisuru",config:{name:"Memori",showNewUser:!1,requirePosition:!1}},WU=async(e,t)=>{const n=t?new URL(`${t.startsWith("http")?"":t.includes("localhost")?"http://":"https://"}${t}`).origin:"https://aisuru.com";try{const t=await fetch(`${n}/api/tenant/${e}`),{tenant:r}=await t.json();return r||{...GU,tenantID:e}}catch(t){return{...GU,tenantID:e}}};function qU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KU(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,WO(r.key),r)}}function JU(e,t,n){return t&&KU(e.prototype,t),n&&KU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function QU(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YU(e,t){return YU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},YU(e,t)}function XU(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&YU(e,t)}function $U(e,t){if(t&&("object"===VO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return QU(e)}function ZU(e){return ZU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ZU(e)}function ej(e){if(Array.isArray(e))return e}function tj(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function nj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rj(e,t){if(e){if("string"==typeof e)return nj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nj(e,t):void 0}}function ij(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function oj(e){return ej(e)||tj(e)||rj(e)||ij()}function sj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function aj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var lj={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},cj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};qU(this,e),this.init(t,n)}return JU(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||lj,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,aj(aj({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}(),uj=new cj,dj=function(){function e(){qU(this,e),this.observers={}}return JU(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function pj(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function hj(e){return null==e?"":""+e}function fj(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function mj(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function gj(e,t,n){var r=mj(e,t,Object);r.obj[r.k]=n}function vj(e,t){var n=mj(e,t),r=n.obj,i=n.k;if(r)return r[i]}function yj(e,t,n){var r=vj(e,n);return void 0!==r?r:vj(t,n)}function bj(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):bj(e[r],t[r],n):e[r]=t[r]);return e}function Sj(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var xj={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function wj(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return xj[e]})):e}var Cj="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Aj=[" ",",","?","!",";"];function Ej(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ej(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ej(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ZU(e);if(t){var i=ZU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return $U(this,n)}}function Tj(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;o<r.length;++o){if(!i)return;if("string"==typeof i[r[o]]&&o+1<r.length)return;if(void 0===i[r[o]]){for(var s=2,a=r.slice(o,o+s).join(n),l=i[a];void 0===l&&r.length>o+s;)s++,l=i[a=r.slice(o,o+s).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(a)){if("string"==typeof l)return l;if(a&&"string"==typeof l[a])return l[a]}var c=r.slice(o+s).join(n);return c?Tj(l,c,n):void 0}i=i[r[o]]}return i}}var Ij=function(e){XU(n,e);var t=_j(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return qU(this,n),r=t.call(this),Cj&&dj.call(QU(r)),r.data=e||{},r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return JU(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[e,t];n&&"string"!=typeof n&&(s=s.concat(n)),n&&"string"==typeof n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."));var a=vj(this.data,s);return a||!o||"string"!=typeof n?a:Tj(this.data&&this.data[e]&&this.data[e][t],n,i)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var s=[e,t];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(s=e.split("."))[1]),this.addNamespaces(t),gj(this.data,s,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(s=e.split("."))[1]),this.addNamespaces(t);var a=vj(this.data,s)||{};r?bj(a,n,i):a=Mj(Mj({},a),n),gj(this.data,s,a),o.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?Mj(Mj({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(dj),Rj={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}};function Pj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Oj(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ZU(e);if(t){var i=ZU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return $U(this,n)}}var Nj={},Lj=function(e){XU(n,e);var t=Oj(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return qU(this,n),r=t.call(this),Cj&&dj.call(QU(r)),fj(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,QU(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=uj.create("translator"),r}return JU(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=n&&e.indexOf(n)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=Aj.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var i=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),o=!i.test(e);if(!o){var s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o}(e,n,r));if(o&&!s){var a=e.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:e,namespaces:i};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(i=l.shift()),e=l.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,r){var i=this;if("object"!==VO(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],t),l=a.key,c=a.namespaces,u=c[c.length-1],d=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(p){var h=t.nsSeparator||this.options.nsSeparator;return o?(f.res="".concat(u).concat(h).concat(l),f):"".concat(u).concat(h).concat(l)}return o?(f.res=l,f):l}var f=this.resolve(e,t),m=f&&f.res,g=f&&f.usedKey||l,v=f&&f.exactUsedKey||l,y=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],S=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,w="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(x&&m&&w&&b.indexOf(y)<0&&("string"!=typeof S||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,kj(kj({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return o?(f.res=C,f):C}if(s){var A="[object Array]"===y,E=A?[]:{},M=A?v:g;for(var _ in m)if(Object.prototype.hasOwnProperty.call(m,_)){var T="".concat(M).concat(s).concat(_);E[_]=this.translate(T,kj(kj({},t),{joinArrays:!1,ns:c})),E[_]===T&&(E[_]=m[_])}m=E}}else if(x&&"string"==typeof S&&"[object Array]"===y)(m=m.join(S))&&(m=this.extendTranslation(m,e,t,r));else{var I=!1,R=!1,P=void 0!==t.count&&"string"!=typeof t.count,k=n.hasDefaultValue(t),O=P?this.pluralResolver.getSuffix(d,t.count,t):"",N=t["defaultValue".concat(O)]||t.defaultValue;!this.isValidLookup(m)&&k&&(I=!0,m=N),this.isValidLookup(m)||(R=!0,m=l);var L=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,D=L&&R?void 0:m,B=k&&N!==m&&this.options.updateMissing;if(R||I||B){if(this.logger.log(B?"updateKey":"missingKey",d,u,l,B?N:m),s){var z=this.resolve(l,kj(kj({},t),{},{keySeparator:!1}));z&&z.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.")}var F=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&U&&U[0])for(var j=0;j<U.length;j++)F.push(U[j]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var H=function(e,n,r){var o=k&&r!==m?r:D;i.options.missingKeyHandler?i.options.missingKeyHandler(e,u,n,o,B,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,u,n,o,B,t),i.emit("missingKey",e,u,n,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&P?F.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],l+n,t["defaultValue".concat(n)]||N)}))})):H(F,l,N))}m=this.extendTranslation(m,e,t,f,r),R&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(u,":").concat(l)),(R||I)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(l):l,I?m:void 0):this.options.parseMissingKeyHandler(m))}return o?(f.res=m,f):m}},{key:"extendTranslation",value:function(e,t,n,r,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,kj(kj({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(kj(kj({},n),{interpolation:kj(kj({},this.options.interpolation),n.interpolation)}));var s,a="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){var l=e.match(this.interpolator.nestingRegexp);s=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=kj(kj({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),a){var u=e.match(this.interpolator.nestingRegexp);s<(u&&u.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return i&&i[0]===r[0]&&!n.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):o.translate.apply(o,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,p="string"==typeof d?[d]:d;return null!=e&&p&&p.length&&!1!==n.applyPostProcessor&&(e=Rj.handle(p,e,t,this.options&&this.options.postProcessPassResolved?kj({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,o,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var l=s.extractFromKey(e,a),c=l.key;n=c;var u=l.namespaces;s.options.fallbackNS&&(u=u.concat(s.options.fallbackNS));var d=void 0!==a.count&&"string"!=typeof a.count,p=d&&!a.ordinal&&0===a.count&&s.pluralResolver.shouldUseIntlApi(),h=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,f=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);u.forEach((function(e){s.isValidLookup(t)||(o=e,!Nj["".concat(f[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(Nj["".concat(f[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(n,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((function(n){if(!s.isValidLookup(t)){i=n;var o,l=[c];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(l,c,n,e,a);else{var u;d&&(u=s.pluralResolver.getSuffix(n,a.count,a));var f="".concat(s.options.pluralSeparator,"zero");if(d&&(l.push(c+u),p&&l.push(c+f)),h){var m="".concat(c).concat(s.options.contextSeparator).concat(a.context);l.push(m),d&&(l.push(m+u),p&&l.push(m+f))}}for(;o=l.pop();)s.isValidLookup(t)||(r=o,t=s.getResource(n,e,o,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(dj);function Dj(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Bj=function(){function e(t){qU(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=uj.create("languageUtils")}return JU(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Dj(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Dj(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Dj(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var 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||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),zj=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Fj={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},Uj=["v1","v2","v3"],jj={zero:0,one:1,two:2,few:3,many:4,other:5};function Hj(){var e={};return zj.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:Fj[t.fc]}}))})),e}var Vj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};qU(this,e),this.languageUtils=t,this.options=n,this.logger=uj.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Hj()}return JU(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return jj[e]-jj[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var o=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!Uj.includes(this.options.compatibilityJSON)}}]),e}();function Gj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var qj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};qU(this,e),this.logger=uj.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return JU(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:wj,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?Sj(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?Sj(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?Sj(t.nestingPrefix):t.nestingPrefixEscaped||Sj("$t("),this.nestingSuffix=t.nestingSuffix?Sj(t.nestingSuffix):t.nestingSuffixEscaped||Sj(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,s,a=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(a.formatSeparator)<0){var i=yj(t,l,e);return a.alwaysFormat?a.format(i,void 0,n,Wj(Wj(Wj({},r),t),{},{interpolationkey:e})):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(yj(t,l,s),c,n,Wj(Wj(Wj({},r),t),{},{interpolationkey:s}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,p=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?c(a.escape(e)):c(e)}}].forEach((function(t){for(s=0;i=t.regex.exec(e);){var n=i[1].trim();if(void 0===(o=u(n)))if("function"==typeof d){var l=d(e,i,r);o="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))o="";else{if(p){o=i[0];continue}a.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),o=""}else"string"==typeof o||a.useRawValueToEscape||(o=hj(o));var c=t.safeValue(o);if(e=e.replace(i[0],c),p?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=Wj({},o);function a(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var o=(i=this.interpolate(i,s)).match(/'/g),a=i.match(/"/g);(o&&o.length%2==0&&!a||a.length%2!=0)&&(i=i.replace(/'/g,'"'));try{s=JSON.parse(i),t&&(s=Wj(Wj({},t),s))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete s.defaultValue,e}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(e);){var l=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),l=u,c=!0}if((r=t(a.call(this,n[1].trim(),s),s))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=hj(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return i.format(e,t,o.lng,Wj(Wj({},o),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function Kj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Jj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qj(e){var t={};return function(n,r,i){var o=r+JSON.stringify(i),s=t[o];return s||(s=e(r,i),t[o]=s),s(n)}}var Yj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};qU(this,e),this.logger=uj.create("formatter"),this.options=t,this.formats={number:Qj((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:Qj((function(e,t){var n=new Intl.NumberFormat(e,Jj(Jj({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:Qj((function(e,t){var n=new Intl.DateTimeFormat(e,Jj({},t));return function(e){return n.format(e)}})),relativetime:Qj((function(e,t){var n=new Intl.RelativeTimeFormat(e,Jj({},t));return function(e){return n.format(e,t.range||"day")}})),list:Qj((function(e,t){var n=new Intl.ListFormat(e,Jj({},t));return function(e){return n.format(e)}}))},this.init(t)}return JU(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=Qj(t)}},{key:"format",value:function(e,t,n,r){var i=this,o=t.split(this.formatSeparator).reduce((function(e,t){var o=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=oj(e.split(":")),r=t[0],i=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=i),"false"===i&&(n[r.trim()]=!1),"true"===i&&(n[r.trim()]=!0),isNaN(i)||(n[r.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}}(t),s=o.formatName,a=o.formatOptions;if(i.formats[s]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=i.formats[s](e,u,Jj(Jj(Jj({},a),r),c))}catch(e){i.logger.warn(e)}return l}return i.logger.warn("there was no format function for ".concat(s)),e}),e);return o}}]),e}();function Xj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zj(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ZU(e);if(t){var i=ZU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return $U(this,n)}}var eH=function(e){XU(n,e);var t=Zj(n);function n(e,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return qU(this,n),o=t.call(this),Cj&&dj.call(QU(o)),o.backend=e,o.store=r,o.services=i,o.languageUtils=i.languageUtils,o.options=s,o.logger=uj.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=s.maxParallelReads||10,o.readingCalls=0,o.maxRetries=s.maxRetries>=0?s.maxRetries:5,o.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(i,s.backend,s),o}return JU(n,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o={},s={},a={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?void 0===s[a]&&(s[a]=!0):(i.state[a]=1,r=!1,void 0===s[a]&&(s[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(a[e]=!0)})),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){var r,a,l,c,u,d;r=n.loaded,a=o,c=mj(r,[i],Object),u=c.obj,d=c.k,u[d]=u[d]||[],l&&(u[d]=u[d].concat(a)),l||u[d].push(a),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===s[e][t]&&(s[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:o,callback:s}):(this.readingCalls++,this.backend[n](e,t,(function(a,l){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}a&&l&&i<r.maxRetries?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,s)}),o):s(a,l)}))):s(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,s){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&s&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),s),t.loaded(e,r,s)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(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!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,$j($j({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(dj);function tH(){return{debug:!1,initImmediate:!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:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===VO(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===VO(e[2])||"object"===VO(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function nH(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function rH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function iH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rH(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function oH(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ZU(e);if(t){var i=ZU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return $U(this,n)}}function sH(){}function aH(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var lH=function(e){XU(n,e);var t=oH(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(qU(this,n),e=t.call(this),Cj&&dj.call(QU(e)),e.options=nH(r),e.services={},e.logger=uj,e.modules={external:[]},aH(QU(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),$U(e,QU(e));setTimeout((function(){e.init(r,i)}),0)}return e}return JU(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=tH();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=iH(iH(iH({},r),this.options),nH(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=iH(iH({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var o;this.modules.logger?uj.init(i(this.modules.logger),this.options):uj.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=Yj);var s=new Bj(this.options);this.store=new Ij(this.options.resources,this.options);var a=this.services;a.logger=uj,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new Vj(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!o||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(a.formatter=i(o),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new qj(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new eH(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new Lj(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=sH),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=pj(),p=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sH,r=n,i="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return r();var o=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(i)s(i);else{var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.forEach((function(e){return s(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=pj();return e||(e=this.languages),t||(t=this.options.ns),n||(n=sH),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(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"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Rj.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=pj();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},o=function(o){e||o||!n.services.languageDetector||(o=[]);var s="string"==typeof o?o:n.services.languageUtils.getBestMatchFromCodes(o);s&&(n.language||i(s),n.translator.language||n.translator.changeLanguage(s),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(s)),n.loadResources(s,(function(e){!function(e,o){o?(i(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,s)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,i=function e(t,i){var o;if("object"!==VO(i)){for(var s=arguments.length,a=new Array(s>2?s-2:0),l=2;l<s;l++)a[l-2]=arguments[l];o=r.options.overloadTranslationOptionHandler([t,i].concat(a))}else o=iH({},i);o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,o.keyPrefix=o.keyPrefix||n||e.keyPrefix;var c=r.options.keySeparator||".",u=o.keyPrefix?"".concat(o.keyPrefix).concat(c).concat(t):t;return r.t(u,o)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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;var r=this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var a=n.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!s(r,e)||i&&!s(o,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=pj();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=pj();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["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"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sH,i=iH(iH(iH({},this.options),t),{isClone:!0}),o=new n(i);void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t));var s=["store","services","language"];return s.forEach((function(t){o[t]=e[t]})),o.services=iH({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new Lj(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit.apply(o,[e].concat(n))})),o.init(i,r),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(dj);qO(lH,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new lH(e,t)}));var cH=lH.createInstance();cH.createInstance=lH.createInstance;var uH,dH=cH.createInstance;cH.init,cH.loadResources,cH.reloadResources,cH.use,cH.changeLanguage,cH.getFixedT,cH.t,cH.exists,cH.setDefaultNamespace,cH.hasLoadedNamespace,cH.loadNamespaces,cH.loadLanguages;uH=JSON.parse('{"yes":"Si","no":"No","confirm":"Conferma","apply":"Applica","cancel":"Annulla","show":"Mostra","hide":"Nascondi","send":"Invia","close":"Chiudi","edit":"Modifica","delete":"Elimina","loading":"Caricamento","expand":"Espandi","collapse":"Riduci","fullscreenEnter":"Passa a schermo intero","fullscreenExit":"Esci da schermo intero","center":"Centro","bottom":"In basso","hidden":"Nascosto","day":"Giorno","month":"Mese","year":"Anno","createdAt":"Data creazione","selected":"Selezionati","page":"pagina","actions":"Azioni","next":"Successivo","previous":"Precedente","copy":"Copia","copyToClipboard":"Copia negli appunti","showOriginalText":"Mostra originale","showTranslatedText":"Mostra traduzione","memoriBlockedTitle":"Bloccato","memoriBlockedUntil":"Memori bloccato fino al {{date}}","memoriBlockedAnon":"Attualmente \\"{{name}}\\" non può rispondere, torna qui il {{date}}","memoriBlockedReasonExceedChats":"perchè ha superato la soglia mensile di chat ammesse.","memoriBlockedGiverHelper":"Puoi sempre gestirlo in qualità di amministratore, ma altri utenti non potranno interrogarlo.","generatedByAI":"Risposta generata da IA, può talvolta generare informazioni non corrette","completionsEnabled":"IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette","completionProviderDown":"Questo Twin è integrato con una IA generativa di {{provider}}, ma al momento non è disponibile. Riprova più tardi.","completionProviderFallbackName":"un provider esterno","completionProviderCheckStatusPage":"Vedi pagina di stato","boardOfExperts":"Gruppo di esperti","birthDate":"Data di nascita","birthDateHelper":"Ti chiediamo la data di nascita esclusivamente per abilitare o disabilitare le funzionalità che hanno restrizioni in base all\'età","underage":"Devi avere almeno {{age}} anni per registrarti.","underageTwinSession":"Devi avere almeno {{age}} anni per interagire con questo Twin.","ageVerification":"Verifica dell\'età","ageVerificationText":"Per interagire con questo Twin, devi aver almeno {{minAge}} anni.","nsfw":"NSFW: Questo Twin contiene contenuti per adulti","deepThought":"Pensiero profondo","deepThoughtHelper":"Pensiero Profondo è una funzionalità avanzata delle AI che ti consentirà di poter sfruttare a pieno le tue conversazioni mantenendo memoria delle stesse. Le AI con Pensiero Profondo possono darti informazioni adattandosi a te e alle cose che condividerete insieme.","deepThoughtDisclaimerTitle":"Pensiero profondo abilitato","deepThoughtDisclaimer":"Pensiero Profondo è una funzionalità avanzata delle AI che ti consentirà di poter sfruttare a pieno le tue conversazioni mantenendo memoria delle stesse. Le AI con Pensiero Profondo possono darti informazioni adattandosi a te e alle cose che condividerete insieme.","deepThoughtPreDisclaimerUnlogged":"Accedi per abilitare Pensiero Profondo.","deepThoughtPreDisclaimerNotAllowed":"Pensiero Profondo è disabilitato poiché non hai acconsentito al suo utilizzo, puoi cambiare la tua scelta in qualsiasi momento nelle impostazioni del tuo account.","knownFacts":{"title":"Fatti noti","description":"Dettagli delle informazioni condivise tra te e {{memoriName}}","type":"Tipo","typeShortTerm":"Breve termine","typeLongTerm":"Lungo termine","typeHelper":"Tipi:\\n- Breve termine: questo fatto noto è sempre utilizzato durante le conversazioni\\n- Lungo termine: questo fatto noto è utilizzato durante le conversazioni solo se rilevante per la domanda corrente","text":"Testo","deleteSuccess":"Fatto noto eliminato","deleteConfirmTitle":"Elimina il fatto noto","deleteConfirmMessage":"Confermi di voler eliminare questo fatto noto?","deleteSelectedConfirmTitle":"Elimina i fatti noti selezionati","deleteSelectedConfirmMessage":"Confermi di voler eliminare i fatti noti selezionati?"},"auth":{"title":"Autenticazione","useRecoveryTokens":"Utilizza i token di recupero","tokens":"Token","addToken":"Aggiungi token","usePassword":"Utilizza la password","atLeast":"Almeno"},"widget":{"instruct":"Istruisci","test":"Prova","sound":"Audio","position":"Posizione","settings":"Impostazioni","share":"Condividi","sendOnKeypress":"Premi Invio per inviare","sendOnClick":"Clicca sul bottone di invio","boardOfExperts":"Gruppo di esperti","showExpertsInTheBoard":"Mostra gli esperti di questo gruppo","expertsInTheBoard":"Esperti di questo gruppo","goToIntegrationsToCustomizeAvatar":"Per personalizzare l\'avatar, vai a Condividimi e configura la pagina pubblica"},"write_and_speak":{"micButtonPopover":"Premi il pulsante per parlare","micButtonPopoverListening":"Premi il pulsante per smettere di parlare","pageInstructExplanation":"Per insegnarmi nuove cose clicca sul pulsante ISTRUISCIMI per cominciare","pageTryMeExplanation":"Per parlare con me clicca sul pulsante INIZIAMO per cominciare","instructButton":"ISTRUISCIMI","tryMeButton":"INIZIAMO","chatHistory":"Cronologia chat","exportChatHistory":"Esporta la cronologia chat","exportChatHistoryMessage":"Vuoi esportare la cronologia chat?","chatBotButtonText":"CLICCA QUI PER APRIRE LA CHAT","conversationStartedLabel":"Conversazione avvenuta il","settingsHeaderLabel":"Configura qui il memori se vuoi impostare una conversazione continua. Setta i secondi di silenzio prima dell\'invio.","continuousSpeechLabel":"Conversazione continua","holdToSpeak":"Tieni premuto per parlare","releaseToEndListening":"Rilascia per smettere di parlare","pressAndHoldToSpeak":"Premi e tieni premuto per parlare","microphoneMode":"Modalità microfono","hideEmissionsLabel":"Nascondi testo emesso dal Twin","secondsLabel":"Secondi","controlsPosition":"Posizione dei controlli","tryMeHeaderLabel":"PROVA","unknownPosition":"Posizione sconosciuta","fieldPlace":"Indica la posizione (es \'Milano\')","showMapLinkFor":"Visualizza sulla mappa la posizione","useMyPosition":"Usa la mia posizione","myPosition":"Posizione corrente","updatingPosition":"Aggiorno la posizione...","placeNotFound":"Luogo sconosciuto!","requirePosition":"Inserisci la posizione prima di iniziare","attachmentsLabel":"Arricchisci il tuo messaggio","iWantToTalkToIn":"Voglio parlare con {{name}} in"},"media":{"title":"Titolo","editAttributes":"Modifica attributi media","uploadMimeTypeNotAllowed":"Il tipo di file non è permesso","uploadSizeLimitMessage":"Il file caricato è troppo grande (max {{size}}MB)","uploadWrongResolutionMessage":"La risoluzione deve essere {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"Hai già un Twin con questo nome","uploadHelperImages":"Caricare un file con estensione png, jpg, jpeg o gif e con dimensione massima di {{size}}MB","uploadHelper":"Caricare un file di dimensione massima di {{size}}MB","uploadError":"Errore nel caricamento","square":"quadrato","scaleRatio":"Proporzioni","addMediaLabel":"Aggiungi media","insertThisMediaMsg":"Inserisci questi media","mediaUploadMessage":"Clicca per caricare un nuovo media","addLinkLabel":"Aggiungi un link","linkKey":"URL","linkValue":"Titolo link","insertThisLink":"Inserisci un link a {{url}} con titolo {{title}}"},"gamification":{"level":"Livello","points":"punti","memoriReachedLevel":"è diventato più evoluto ed ha raggiunto il livello","levelGoToStatistics":"{{memori}} è al livello {{level}} con {{points}} punti. Clicca per andare alle statistiche.","congratulationsNewLevel":"Congratulazioni, hai raggiunto un nuovo livello!","congratulationsNewLevelDescription":"Il tuo Memori è diventato più evoluto con {{points}} punti, guarda le","statistics":"statistiche"},"success":"Operazione andata a buon fine","Error":"Errore","internal server error":"Ops, scusa... qualcosa è andato storto nel server","error":"Errore","error.loading":"Errore durante il caricamento dei contenuti.","error.notFound":"Ops, non abbiamo trovato ciò che cercavi.","error.generic":"Ops, qualcosa è andato storto.","error.serverNotResponding":"Stiamo facendo manutenzione o rilasciando aggiornamenti. Riprova più tardi.","error.unprocessableEntity":"Errore durante il salvataggio dei dati. Ricontrolla i dati inseriti.","error.goBackTo":"Prova a tornare alla","error.reloadPage":"Ricarica la pagina","error.tryAgain":"Riprova","error.unauthorized":"Non sei autorizzato a visualizzare questo contenuto.","errors":{"TENANT_NOT_FOUND":"Tenant non trovato","TENANT_REGISTRATION_DISABLED":"La registrazione su questa piattaforma è disabilitata","TENANT_MISSING_NAME":"Tenant: nome mancante","TENANT_MAX_USERS_REACHED":"Numero massimo di utenti raggiunto","TENANT_MAX_ADMINS_REACHED":"Numero massimo di utenti amministratori raggiunto","USER_NOT_CONFIRMED":"Utente ancora non confermato","USER_NOT_FOUND":"Utente non trovato","USER_OR_PASSWORD_INVALID":"Utente o password non validi","USER_MUST_CHANGE_PASSWORD":"Devi cambiare la password","USER_MUST_ENTER_VERIFICATION_CODE":"Devi inserire il codice di verifica","USER_MISSING_TENANT":"Utente: tenant mancante","USER_MISSING_NAME":"Utente: nome mancante","USER_MISSING_PASSWORD":"Utente: password mancante","USER_MISSING_EMAIL":"Utente: email mancante","USER_MISSING_VERIFICATION_CODE":"Utente: codice di verifica mancante","USER_NAME_ALREADY_USED":"Nome utente già in uso","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"La password non rispetta le regole di sicurezza","USER_EMAIL_ALREADY_USED":"Email già in uso","USER_EMAIL_INVALID":"Email non valida","USER_VERIFICATION_CODE_INVALID":"Codice di verifica non valido","USER_MISSING_NAME_OR_EMAIL":"Nome utente o email mancante","USER_NAME_INVALID":"Nome utente non valido","USER_HAS_ONE_OR_MORE_MEMORI":"L\'utente ha uno o più memori","USER_MISSING_NEW_PASSWORD":"Utente: nuova password mancante","USER_NOTHING_TO_DO":"Niente da fare","USER_CANT_CREATE_MEMORI":"Utente non abilitato a creare Memori","USER_MAX_MEMORI_REACHED":"Massimo numero di Memori raggiunto","USER_CANT_EDIT_INTEGRATIONS":"Utente non abilitato a gestire integrazioni","MEMORI_NOT_FOUND":"Memori non trovato","MEMORI_NOT_ACCESSIBLE":"Memori non accessibile","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Solo il proprietario può cambiare il tag e il pin","SESSION_NOT_FOUND":"Sessione non trovata","SESSION_IS_NOT_ADMINISTRATIVE":"Sessione non amministrativa","MEMORI_MISSING_CONFIGURATION":"Memori: configurazione mancante","MEMORI_CONFIGURATION_NOT_FOUND":"Memori: configurazione non trovata","MEMORI_INVALID_PRIVACY_TYPE":"Memori: tipo di privacy non valido","MEMORI_MISSING_PASSWORD":"Memori: password mancante","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero totale di token di recupero non valido","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero minimo di token di recupero non valido","MEMORI_INVALID_VOICE_TYPE":"Memori: tipo di voce non valido","MEMORI_MISSING_NAME":"Memori: nome mancante","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memori: password o token di recupero mancanti","MEMORI_INVALID_ID":"Memori: ID non valido","MEMORI_NAME_ALREADY_USED":"Nome memori già in uso","MEMORI_INVALID_PIN":"Memori: PIN non valido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memori: cambio TAG e PIN richiedono operazioni separate","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memori: password non richiesta su Memori pubblico","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Trasferimento: utente di destinazione mancante","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Trasferimento: ID utente di destinazione non valido","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Trasferimento: dati utente di destinazione non validi","MEMORI_TRANSFER_NOTHING_TO_DO":"Trasferimento: alcuna operazione da fare","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memori: la configurazione non può essere modificata","MEMORI_MISSING_NEW_PASSWORD":"Memori: nuova password mancante","INTEGRATION_NOT_FOUND":"Integrazione non trovata","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Formato non valido data a partire da","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Formato non valido data fino a","INTEGRATION_INVALID_TYPE":"Tipo integrazione non valido","INTEGRATION_ALREADY_EXISTS":"Integrazione già esistente","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Memori non pubblici non possono essere integrati","INTEGRATION_MISSING_INVOCATION_TEXT":"Integrazione: testo di invocazione mancante","INTEGRATION_MISSING_DEVICE_EMAILS":"Integrazione: email del dispositivo mancante","INTEGRATION_MEMORI_IS_EMPTY":"Memori vuoti non possono essere integrati","INTEGRATION_MISSING_PRIVACY_POLICY":"Integrazione: privacy policy mancante","INTEGRATION_MISSING_CATEGORY":"Categoria integrazione mancante","INTEGRATION_MISSING_DESCRIPTION":"Descrizione integrazione mancante","INTEGRATION_INVALID_INVOCATION_TEXT":"Testo di invocazione non valido","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home non più disponibile","UPLOAD_REQUIRES_MULTIPART_ENCODING":"L\'upload richiede l\'encoding multipart","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: manca il content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: dimensione massima superata","UPLOAD_FILE_IS_EMPTY":"Upload: file vuoto","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: tipo di file o firma non validi","UPLOAD_MISSING_FILE_NAME":"Upload: nome file mancante","UPLOAD_INVALID_MEMORY_ID":"Upload: ID contenuto non valido","UPLOAD_MISSING_FILE_CONTENT":"Upload: contenuto file mancante","ASSET_NOT_FOUND":"Asset non trovato","ASSET_NOT_ACCESSIBLE":"Asset non accessibile","ASSET_MISSING_SESSION_ID":"Asset: ID sessione mancante","ASSET_INVALID_FILE_NAME":"Asset: nome file non valido","INVITATION_NOT_FOUND":"Invito non trovato","INVITATION_NOT_ACCESSIBLE":"Invito non accessibile","INVITATION_ALREADY_ACCEPTED":"Invito già accettato","INVITATION_ALREADY_REJECTED":"Invito già rifiutato","INVITATION_MISSING_DESTINATION_EMAIL":"Invito: email di destinazione mancante","INVITATION_DESTINATION_EMAIL_INVALID":"Invito: email di destinazione non valida","INVITATION_MISSING_TAG":"Invito: tag mancante","INVITATION_MISSING_PIN":"Invito: PIN mancante","INVITATION_INVALID_PIN":"Invito: PIN non valido","INVITATION_INVALID_TYPE":"Invito: tipo non valido","INVITATION_MISSING_DESTINATION_NAME":"Invito: nome destinatario mancante","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invito: tag e pin non possono essere cambiati","INVITATION_CANT_BE_CHANGED":"Invito: non può essere modificato","ACTIONLOG_INVALID_USER_ID":"ID utente non valido","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","ACTIONLOG_INVALID_MEMORI_ID":"ID Memori non valido","CONSUMPTIONLOG_INVALID_TYPE":"Tipo di log non valido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","CONSUMPTIONLOG_INVALID_USER_ID":"ID utente non valido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Memori ID non valido"}}');const pH=dH({resources:{en:{translation:t(JSON.parse('{"yes":"Yes","no":"No","confirm":"Confirm","apply":"Apply","cancel":"Cancel","show":"Show","hide":"Hide","send":"Send","close":"Close","edit":"Edit","delete":"Delete","loading":"Loading","expand":"Expand","collapse":"Collapse","fullscreenEnter":"Enter fullscreen","fullscreenExit":"Exit fullscreen","center":"Center","bottom":"Bottom","hidden":"Hidden","day":"Day","month":"Month","year":"Year","createdAt":"Creation date","selected":"Selected","page":"page","actions":"Actions","next":"Next","previous":"Previous","copy":"Copy","copyToClipboard":"Copy to clipboard","showOriginalText":"Show original","showTranslatedText":"Show translation","memoriBlockedTitle":"Blocked","memoriBlockedUntil":"Memori blocked until {{date}}","memoriBlockedAnon":"Currently \\"{{name}}\\" can\'t answer, come back here on {{date}}","memoriBlockedReasonExceedChats":"because it has exceeded the monthly threshold of allowed chats.","memoriBlockedGiverHelper":"You can still manage it as administrator, but other users will not be able to interact with it.","generatedByAI":"Answer generated by AI, may occasionally generate incorrect informations","completionsEnabled":"Advanced AI, can respond with automatically generated answers that may sometimes contain incorrect information","completionProviderDown":"This Twin is integrated with a generative AI from {{provider}}, but it is currently unavailable. Try again later.","completionProviderFallbackName":"an external provider","completionProviderCheckStatusPage":"Check status page","boardOfExperts":"Board of experts","birthDate":"Birth date","birthDateHelper":"We ask for your birth date only to enable or disable functionalities that have age restrictions","underage":"You must be at least {{age}} years old to sign up.","underageTwinSession":"You must be at least {{age}} years old to interact with this Twin.","ageVerification":"Age verification","ageVerificationText":"To interact with this Twin, you must be at least {{minAge}} years old.","nsfw":"NSFW: This Twin contains adult contents","deepThought":"Deep Thought","deepThoughtHelper":"Deep Thought is an advanced feature of the AI that will allow you to fully exploit your conversations by keeping track of them. The AI with Deep Thought can give you information tailored to you and the things you will share together. Allow the twin\'s author to contact you for commercial offers regarding products you have shown interest in.","deepThoughtDisclaimerTitle":"Deep Thought enabled","deepThoughtDisclaimer":"Deep Thought is an advanced feature of the AI that will allow you to fully exploit your conversations by keeping track of them. The AI with Deep Thought can give you information tailored to you and the things you will share together.","deepThoughtPreDisclaimerUnlogged":"Log in to enable Deep Thought.","deepThoughtPreDisclaimerNotAllowed":"Deep Thought is disabled since you didn\'t consent its usage, you can change this any time in your account settings.","knownFacts":{"title":"Known facts","description":"Details of the information shared between you and {{memoriName}}","type":"Type","typeShortTerm":"Short term","typeLongTerm":"Long term","typeHelper":"Types:\\n- Short Term: this Known Fact is always used during conversations\\n- Long Term: this Known Fact is used during conversations only if relevant to the current question","text":"Text","deleteSuccess":"Known fact deleted","deleteConfirmTitle":"Delete known fact","deleteConfirmMessage":"Are you sure you want to delete this known fact?","deleteSelectedConfirmTitle":"Delete selected known facts","deleteSelectedConfirmMessage":"Are you sure you want to delete the selected known facts?"},"auth":{"title":"Authentication","useRecoveryTokens":"Use recovery tokens","tokens":"Tokens","addToken":"Add token","usePassword":"Use password","atLeast":"At least"},"widget":{"instruct":"Instruct","test":"Test","sound":"Sound","position":"Position","settings":"Settings","share":"Share","sendOnKeypress":"Hit Enter to send","sendOnClick":"Click on Submit","boardOfExperts":"Board of experts","showExpertsInTheBoard":"Show experts in this board","expertsInTheBoard":"Experts in this board","goToIntegrationsToCustomizeAvatar":"To customize the avatar, go to Share and customize the public page"},"write_and_speak":{"micButtonPopover":"Click the button to speak","micButtonPopoverListening":"Click the button to stop speak","pageInstructExplanation":"To teach me new things click on the INSTRUCT ME button to get started","pageTryMeExplanation":"To talk to me click on the START button to get started","instructButton":"INSTRUCT ME","tryMeButton":"START","chatHistory":"Chat history","exportChatHistory":"Export chat history","exportChatHistoryMessage":"Do you want to export chat history?","chatBotButtonText":"CLICK HERE TO OPEN CHATBOT","conversationStartedLabel":"Conversation started on","settingsHeaderLabel":"Setup here if you want to set the memori as continuous speech, and change the silence seconds if you want to customize them.","continuousSpeechLabel":"Continuous speech","holdToSpeak":"Hold to speak","releaseToEndListening":"Release to end listening","pressAndHoldToSpeak":"Press and hold to speak","microphoneMode":"Microphone mode","hideEmissionsLabel":"Hide text emitted by the Twin","secondsLabel":"Set seconds","controlsPosition":"Controls position","tryMeHeaderLabel":"TRY","unknownPosition":"Unknown position","fieldPlace":"Write the place (eg \'Milano\')","showMapLinkFor":"Show the position on the map","useMyPosition":"Use my position","myPosition":"Your position","updatingPosition":"Updating position...","placeNotFound":"Place not found!","requirePosition":"Insert your position before start","attachmentsLabel":"Enrich your message","iWantToTalkToIn":"I want to talk to {{name}} in"},"media":{"title":"Title","editAttributes":"Edit media attributes","uploadMimeTypeNotAllowed":"The file type is not allowed","uploadSizeLimitMessage":"The uploaded size is too big (max {{size}}MB)","uploadWrongResolutionMessage":"The resolution must be {{width}}x{{height}} pixel","memoriNameAlreadyUsed":"You already have a Twin with this name","uploadHelperImages":"Upload a file with extension png, jpg, jpeg or gif, and having at maximum a size of {{size}}MB","uploadHelper":"Upload a file having at maximum a size of {{size}}MB","uploadError":"Upload failed","square":"square","scaleRatio":"Scale ratio","addMediaLabel":"Add a media","insertThisMediaMsg":"Insert these media","mediaUploadMessage":"Click to load a new media","addLinkLabel":"Add a link","linkKey":"URL","linkValue":"Link title","insertThisLink":"Insert a link to {{url}} with title {{title}}"},"gamification":{"level":"Level","points":"points","memoriReachedLevel":"became more evolved and reached level","levelGoToStatistics":"{{memori}} is at level {{level}} with {{points}} points. Click to go to statistics.","congratulationsNewLevel":"Congratulations, you have reached a new level!","congratulationsNewLevelDescription":"Your Memori became more evolved with {{points}} points, look at the","statistics":"statistics"},"success":"Success","Error":"Error","internal server error":"Oupsie, sorry... Something went wrong on the server","error":"Error","error.loading":"Error while loading content.","error.generic":"Oupsie, sorry... something went wrong.","error.serverNotResponding":"We are doing maintenance or releasing updates. Please try again later.","error.notFound":"Oupsie, we didn\'t find the page you were looking for.","error.goBackTo":"You can try to go back to the","error.reloadPage":"Reload the page","error.tryAgain":"Try again","error.unauthorized":"You are unauthorized to view this content.","error.unprocessableEntity":"Error while processing the request. Check the data you entered.","errors":{"TENANT_NOT_FOUND":"Tenant not found","TENANT_REGISTRATION_DISABLED":"Registration on this platform is disabled","TENANT_MISSING_NAME":"Tenant: name missing","TENANT_MAX_USERS_REACHED":"Maximum number of users reached","TENANT_MAX_ADMINS_REACHED":"Maximum number of admin users reached","USER_NOT_CONFIRMED":"User still not confirmed","USER_NOT_FOUND":"User not found","USER_OR_PASSWORD_INVALID":"Invalid user or password","USER_MUST_CHANGE_PASSWORD":"You must change your password","USER_MUST_ENTER_VERIFICATION_CODE":"You must enter the verification code","USER_MISSING_TENANT":"User: missing tenant","USER_MISSING_NAME":"User: name is missing","USER_MISSING_PASSWORD":"User: password missing","USER_MISSING_EMAIL":"User: Missing email","USER_MISSING_VERIFICATION_CODE":"User: Missing verification code","USER_NAME_ALREADY_USED":"User name already in use","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"The password does not meet the security rules","USER_EMAIL_ALREADY_USED":"Email already in use","USER_EMAIL_INVALID":"Invalid email","USER_VERIFICATION_CODE_INVALID":"Invalid verification code","USER_MISSING_NAME_OR_EMAIL":"Missing username or email","USER_NAME_INVALID":"Invalid user name","USER_HAS_ONE_OR_MORE_MEMORI":"The user has one or more memories","USER_MISSING_NEW_PASSWORD":"User: new password missing","USER_NOTHING_TO_DO":"Nothing to do","USER_CANT_CREATE_MEMORI":"User not allowed to create Memori","USER_MAX_MEMORI_REACHED":"Maximum number of Memori reached","USER_CANT_EDIT_INTEGRATIONS":"User not allowed to manage integrations","MEMORI_NOT_FOUND":"Memori not found","MEMORI_NOT_ACCESSIBLE":"Memori not accessible","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Only owner can change tag or pin","SESSION_NOT_FOUND":"Session not found","SESSION_IS_NOT_ADMINISTRATIVE":"Non-administrative session","MEMORI_MISSING_CONFIGURATION":"Memori: missing configuration","MEMORI_CONFIGURATION_NOT_FOUND":"Memories: configuration not found","MEMORI_INVALID_PRIVACY_TYPE":"Memories: invalid privacy type","MEMORI_MISSING_PASSWORD":"Memori: missing password","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memories: total number of invalid recovery tokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memories: minimum number of invalid recovery tokens","MEMORI_INVALID_VOICE_TYPE":"Memories: invalid voice type","MEMORI_MISSING_NAME":"Memories: missing name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memories: missing password or recovery token","MEMORI_INVALID_ID":"Memories: invalid ID","MEMORI_NAME_ALREADY_USED":"Memory name already in use","MEMORI_INVALID_PIN":"Memories: Invalid PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memories: TAG and PIN change require separate operations","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memories: no password required when public","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transfer: missing destination user","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transfer: invalid destination user ID","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transfer: invalid destination user data","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfer: nothing to do","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memories: configuration cannot be changed","MEMORI_MISSING_NEW_PASSWORD":"Memories: new password missing","INTEGRATION_NOT_FOUND":"Integration not found","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Invalid date from format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Invalid date to format","INTEGRATION_INVALID_TYPE":"Invalid integration type","INTEGRATION_ALREADY_EXISTS":"Integration already exists","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Non-public memories cannot be integrated","INTEGRATION_MISSING_INVOCATION_TEXT":"Integration: missing invocation text","INTEGRATION_MISSING_DEVICE_EMAILS":"Integration: missing device email","INTEGRATION_MEMORI_IS_EMPTY":"Empty memories cannot be integrated","INTEGRATION_MISSING_PRIVACY_POLICY":"Integration: privacy policy missing","INTEGRATION_MISSING_CATEGORY":"Integration category missing","INTEGRATION_MISSING_DESCRIPTION":"Missing integration description","INTEGRATION_INVALID_INVOCATION_TEXT":"Invalid invocation text","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home no more available","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Upload requires multipart encoding","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: missing content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: maximum size exceeded","UPLOAD_FILE_IS_EMPTY":"Upload: empty file","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: invalid file type or signature","UPLOAD_MISSING_FILE_NAME":"Upload: missing file name","UPLOAD_INVALID_MEMORY_ID":"Upload: Invalid content ID","UPLOAD_MISSING_FILE_CONTENT":"Upload: Missing file content","ASSET_NOT_FOUND":"Asset not found","ASSET_NOT_ACCESSIBLE":"Asset not accessible","ASSET_MISSING_SESSION_ID":"Asset: missing session ID","ASSET_INVALID_FILE_NAME":"Asset: invalid file name","INVITATION_NOT_FOUND":"Invitation not found","INVITATION_NOT_ACCESSIBLE":"Invitation not accessible","INVITATION_ALREADY_ACCEPTED":"Invitation already accepted","INVITATION_ALREADY_REJECTED":"Invitation already rejected","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation: missing destination email","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation: destination email invalid","INVITATION_MISSING_TAG":"Invitation: missing tag","INVITATION_MISSING_PIN":"Invitation: PIN missing","INVITATION_INVALID_PIN":"Invitation: invalid PIN","INVITATION_INVALID_TYPE":"Invitation: invalid type","INVITATION_MISSING_DESTINATION_NAME":"Invitation: destination name missing","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation: tag and pin can\'t be changed","INVITATION_CANT_BE_CHANGED":"Intation: can\'t be changed","ACTIONLOG_INVALID_USER_ID":"Invalid user ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","ACTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","CONSUMPTIONLOG_INVALID_TYPE":"Invalid log type","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","CONSUMPTIONLOG_INVALID_USER_ID":"Invalid user ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID"}}'))},it:{translation:t(uH)}},lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});pH.init();var hH=pH;c=o("85Hg2");function fH(e){var t=e.i18n,n=e.defaultNS,r=e.children,i=(0,c.useMemo)((function(){return{i18n:t,defaultNS:n}}),[t,n]);return(0,c.createElement)(re.Provider,{value:i},r)}const mH=({ownerUserName:e,ownerUserID:t,memoriName:n,memoriID:r,integrationID:i,tenantID:o,secretToken:a,sessionID:l,layout:u="DEFAULT",customLayout:d,showShare:p=!0,showSettings:h=!0,showInstruct:f=!1,showTypingText:m=!1,showClear:g=!1,showOnlyLastMessages:v=!1,showInputs:y=!0,showDates:b=!1,showContextPerLine:S=!1,height:x="100%",baseURL:w,apiURL:C="https://backend.memori.ai",tag:A,pin:E,context:M,initialQuestion:_,uiLang:T,spokenLang:I,multilingual:R,authToken:P,AZURE_COGNITIVE_SERVICES_TTS_KEY:k,onStateChange:O,additionalInfo:N,customMediaRenderer:L,additionalSettings:D,userAvatar:B})=>{var z,F,U;const[j,H]=(0,c.useState)(),[V,G]=(0,c.useState)(),[W,K]=(0,c.useState)(k),{t:J}=ve();if(!(r&&t||n&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const Q=q(C),Y=(0,c.useCallback)((async()=>{const e=w||(o.startsWith("https://")?o:`https://${o}`),t=await fetch(`${e}/api/speechkey`),n=await t.json();n.AZURE_COGNITIVE_SERVICES_TTS_KEY&&K(n.AZURE_COGNITIVE_SERVICES_TTS_KEY)}),[]);(0,c.useEffect)((()=>{k||Y()}),[k]);const X=(0,c.useCallback)((async()=>{if(r&&t){const{memori:e,...n}=await Q.backend.getMemoriByUserAndId(o,t,r);0===n.resultCode&&e?H(e):console.error("[MEMORI]",n,e)}else if(n&&e){const{memori:t,...r}=await Q.backend.getMemori(o,e,n);0===r.resultCode&&t?H(t):console.error("[MEMORI]",r,t)}}),[r,t,n,e,o]);(0,c.useEffect)((()=>{X()}),[X,o]);const $=(0,c.useCallback)((async()=>{const e=await WU(o,w);e&&G(e)}),[o,C]);(0,c.useEffect)((()=>{$()}),[$]),(0,c.useEffect)((()=>{if(T)hH.changeLanguage(T.toLowerCase());else{const{lng:e,fallbackLng:t}=(()=>{const e=navigator.language;if(e){let t=e.split("-")[0];if(["en","it"].includes(t))return{lng:t,fallbackLng:"en"===t?"it":"en"}}return{lng:"en",fallbackLng:"it"}})();hH.changeLanguage(e).catch((()=>{hH.changeLanguage(t)}))}}),[T]);const Z=j?(0,s.jsx)(VU,{layout:u,customLayout:d,height:x,baseUrl:w||(o.startsWith("https://")?o:`https://${o}`),apiUrl:C,memori:{...j,secretToken:a},memoriLang:null!=I?I:null===(F=null===(z=j.culture)||void 0===z?void 0:z.split("-"))||void 0===F?void 0:F[0],multilingual:R,tenant:V,secret:a,sessionID:l,showShare:p,showSettings:h,showInstruct:f,showTypingText:m,showClear:g,showOnlyLastMessages:v,showInputs:y,showDates:b,showContextPerLine:S,integration:null===(U=null==j?void 0:j.integrations)||void 0===U?void 0:U.find((e=>i?e.integrationID===i:!!e.publish&&"LANDING_EXPERIENCE"===e.type)),initialContextVars:M,initialQuestion:_,authToken:P,AZURE_COGNITIVE_SERVICES_TTS_KEY:W||k,onStateChange:O,additionalInfo:N,customMediaRenderer:L,additionalSettings:D,userAvatar:B,...A&&E?{personification:{tag:A,pin:E}}:{}}):(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,s.jsxs)("p",{style:{textAlign:"center",margin:"2rem auto",textTransform:"capitalize"},children:[J("loading")||"Loading","..."]})});return(0,s.jsxs)(fH,{i18n:hH,children:[(0,s.jsx)(Ss.Toaster,{position:"top-center",reverseOrder:!0}),Z]})};mH.propTypes={memoriName:t(l).string,memoriID:t(l).string,ownerUserName:t(l).string,ownerUserID:t(l).string,integrationID:t(l).string,tenantID:t(l).string.isRequired,secretToken:t(l).string,sessionID:t(l).string,layout:t(l).oneOf(["DEFAULT","FULLPAGE","TOTEM","WEBSITE_ASSISTANT","CHAT"]),customLayout:t(l).any,showShare:t(l).bool,showInstruct:t(l).bool,showInputs:t(l).bool,showDates:t(l).bool,showContextPerLine:t(l).bool,showSettings:t(l).bool,showClear:t(l).bool,showOnlyLastMessages:t(l).bool,showTypingText:t(l).bool,height:t(l).oneOfType([t(l).string,t(l).number]),baseURL:t(l).string,apiURL:t(l).string,tag:t(l).string,pin:t(l).string,context:t(l).objectOf(t(l).any),initialQuestion:t(l).string,uiLang:t(l).oneOf(["en","it","EN","IT"]),spokenLang:t(l).string,multilingual:t(l).bool,authToken:t(l).string,AZURE_COGNITIVE_SERVICES_TTS_KEY:t(l).string,onStateChange:t(l).func,additionalInfo:t(l).objectOf(t(l).any),customMediaRenderer:t(l).func,additionalSettings:t(l).any,userAvatar:t(l).oneOfType([t(l).string,t(l).any])};var gH=mH;class vH extends HTMLElement{connectedCallback(){const e=document.createElement("div"),n=document.createElement("div");n.setAttribute("id","memori-root"),e.appendChild(n),this.appendChild(e);const r=Object.keys(gH.propTypes).reduce(((e,t)=>(this.hasAttribute(t)&&(e[t]=this.getAttribute(t)),e)),{}),i=this.getAttribute("tenantId"),o=this.getAttribute("context")?.split(",")?.reduce(((e,t)=>{const[n,r]=t.split(":").map((e=>e.trim()));return{...e,[n]:r}}),{}),l=(e=>{try{return JSON.parse(e)}catch(e){return null}})(this.getAttribute("additionalInfo")||"{}")||{};i?t(a).render((0,s.jsx)(gH,{...r,context:o,tenantID:i,additionalInfo:l}),n):console.error("No tenantId attribute found")}}customElements.define("memori-client",vH)})();
|