@memori.ai/memori-webcomponent 6.1.2 → 6.1.3
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 +7 -0
- package/dist/memori-webcomponent.js +1 -1
- package/package.json +2 -2
|
@@ -243,4 +243,4 @@ const _m="144",Mm={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Tm={ROTATE:0,
|
|
|
243
243
|
* @license qrcode.react
|
|
244
244
|
* Copyright (c) Paul O'Shannessy
|
|
245
245
|
* SPDX-License-Identifier: ISC
|
|
246
|
-
*/function oD(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 sD(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 aD(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 lD=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function cD(e){const n=e,{value:r,size:i=eD,level:o=tD,bgColor:s=nD,fgColor:a=rD,includeMargin:l=iD,style:u,imageSettings:d}=n,p=XN(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=$N.QrCode.encodeText(r,ZN[o]).getModules();const c=l?4:0,u=n.length+2*c,p=aD(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=sD(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,lD?t.fill(new Path2D(oD(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=YN({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",YN({style:y,height:i,width:i,ref:f},p)),b)}var uD=({tenant:e,url:n,title:r="",className:i,baseUrl:o,primary:a=!0,showQrCode:l=!0,align:u="right"})=>{const{t:d}=be(),[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:LN},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${p}`,icon:BN},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${r}&url=${p}`,icon:zN},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${p}`,icon:UN},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${r}&url=${p}`,icon:VN},{id:"email",title:"Email",url:`mailto:?subject=${(null==r?void 0:r.length)>0?r:n}&body=${p}`,icon:FN}];return(0,s.jsxs)(Jd,{as:"div",className:t(Ss)("memori-share-button",{"memori-share-button--align-left":"left"===u}),children:[(0,s.jsx)(Jd.Button,{className:t(Ss)("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)(jN,{})})}),(0,s.jsxs)(Jd.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,s.jsx)(Jd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsx)(Ba,{className:"memori-share-button--link",ghost:!0,icon:(0,s.jsx)(ip,{}),onClick:()=>{p&&navigator.clipboard.writeText(p)},children:d("copyToClipboard")||void 0})},"copy"),m.map((e=>{var n;return(0,s.jsx)(Jd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsxs)("a",{className:t(Ss)("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)(Jd.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,s.jsx)(cD,{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)(Ba,{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)(HN,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};var dD=({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 pD=({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 hD=({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 fD=({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,showLogin:S=!0,setShowLoginDrawer:x,clearHistory:w,loginToken:C,user:A,sessionID:E})=>{const{t:_}=be(),[M,T]=(0,c.useState)(!1),[I,R]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{document.fullscreenEnabled&&T(!0)}),[]),(0,s.jsxs)("div",{className:t(Ss)("memori-header",e),children:[y&&(0,s.jsx)(Ba,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--reload",title:_("reload")||"Reload",icon:(0,s.jsx)(pD,{}),onClick:()=>{window.location.reload()}}),b&&(0,s.jsx)(Ba,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--clear",title:_("clearHistory")||"Clear chat",icon:(0,s.jsx)(hD,{}),onClick:w}),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)(Ba,{icon:(0,s.jsx)(uN,{}),shape:"circle",className:"memori-header--button memori-header--button--position",onClick:()=>a(!0)})]}),M&&(0,s.jsx)(Ba,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--fullscreen",title:I?_("fullscreenExit")||"Exit fullscreen":_("fullscreenEnter")||"Enter fullscreen",icon:I?(0,s.jsx)(rm,{}):(0,s.jsx)(dD,{}),onClick:()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),R(!1)):(document.documentElement.requestFullscreen(),R(!0))}}),n.enableDeepThought&&!!C&&(null==A?void 0:A.pAndCUAccepted)&&(0,s.jsx)(Ba,{primary:!!E&&!!f,shape:"circle",icon:(0,s.jsx)(vm,{}),className:"memori-header--button memori-header--button--knownfacts",disabled:!f||!E,onClick:()=>u(!0),title:_("knownFacts.title")||"Known facts"}),n.enableBoardOfExperts&&(0,s.jsx)(Ba,{primary:!0,shape:"circle",icon:(0,s.jsx)(gm,{}),className:"memori-header--button memori-header--button--experts",disabled:!f||!E,onClick:()=>d(!0),title:_("widget.showExpertsInTheBoard")||"Experts in this board"}),v&&(0,s.jsx)(Ba,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--speaker",icon:p?(0,s.jsx)(dN,{}):(0,s.jsx)(hN,{}),onClick:()=>h(!p),title:_("widget.sound")||"Sound"}),(0,s.jsx)(NN,{history:i,memori:n,className:"memori-header--button memori-header--button--export",disabled:!f||0===i.length}),g&&(0,s.jsx)(Ba,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-settings",icon:(0,s.jsx)(DN,{}),onClick:()=>l(!0),title:_("widget.settings")||"Settings"}),m&&(0,s.jsx)(uD,{className:"memori-header--button memori-header--button-share",title:n.name,tenant:r,showQrCode:!0,align:"left"}),S&&(0,s.jsx)(Ba,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-login",icon:(0,s.jsx)(Ed,{}),onClick:()=>x(!0),title:C?_("login.user")||"User":_("login.login")||"Login"})]})};var mD=({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"})]})]})},gD={};function vD(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 yD(e,t,n){return t&&vD(e.prototype,t),n&&vD(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function bD(){return bD=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},bD.apply(this,arguments)}function SD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,wD(e,t)}function xD(e){return xD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xD(e)}function wD(e,t){return wD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},wD(e,t)}function CD(){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 AD(e,t,n){return AD=CD()?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&&wD(i,n.prototype),i},AD.apply(null,arguments)}function ED(e){var t="function"==typeof Map?new Map:void 0;return ED=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 AD(e,arguments,xD(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),wD(r,e)},ED(e)}function _D(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 MD(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 TD(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 MD(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)?MD(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(gD,"__esModule",{value:!0});var ID=function(e){function t(){return e.apply(this,arguments)||this}return SD(t,e),t}(ED(Error)),RD=function(e){function t(t){return e.call(this,"Invalid DateTime: "+t.toMessage())||this}return SD(t,e),t}(ID),PD=function(e){function t(t){return e.call(this,"Invalid Interval: "+t.toMessage())||this}return SD(t,e),t}(ID),kD=function(e){function t(t){return e.call(this,"Invalid Duration: "+t.toMessage())||this}return SD(t,e),t}(ID),OD=function(e){function t(){return e.apply(this,arguments)||this}return SD(t,e),t}(ID),ND=function(e){function t(t){return e.call(this,"Invalid unit "+t)||this}return SD(t,e),t}(ID),DD=function(e){function t(){return e.apply(this,arguments)||this}return SD(t,e),t}(ID),LD=function(e){function t(){return e.call(this,"Zone is an abstract class")||this}return SD(t,e),t}(ID),BD="numeric",zD="short",UD="long",FD={year:BD,month:BD,day:BD},jD={year:BD,month:zD,day:BD},HD={year:BD,month:zD,day:BD,weekday:zD},GD={year:BD,month:UD,day:BD},VD={year:BD,month:UD,day:BD,weekday:UD},WD={hour:BD,minute:BD},qD={hour:BD,minute:BD,second:BD},KD={hour:BD,minute:BD,second:BD,timeZoneName:zD},JD={hour:BD,minute:BD,second:BD,timeZoneName:UD},QD={hour:BD,minute:BD,hourCycle:"h23"},YD={hour:BD,minute:BD,second:BD,hourCycle:"h23"},XD={hour:BD,minute:BD,second:BD,hourCycle:"h23",timeZoneName:zD},$D={hour:BD,minute:BD,second:BD,hourCycle:"h23",timeZoneName:UD},ZD={year:BD,month:BD,day:BD,hour:BD,minute:BD},eL={year:BD,month:BD,day:BD,hour:BD,minute:BD,second:BD},tL={year:BD,month:zD,day:BD,hour:BD,minute:BD},nL={year:BD,month:zD,day:BD,hour:BD,minute:BD,second:BD},rL={year:BD,month:zD,day:BD,weekday:zD,hour:BD,minute:BD},iL={year:BD,month:UD,day:BD,hour:BD,minute:BD,timeZoneName:zD},oL={year:BD,month:UD,day:BD,hour:BD,minute:BD,second:BD,timeZoneName:zD},sL={year:BD,month:UD,day:BD,weekday:UD,hour:BD,minute:BD,timeZoneName:UD},aL={year:BD,month:UD,day:BD,weekday:UD,hour:BD,minute:BD,second:BD,timeZoneName:UD},lL=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new LD},t.formatOffset=function(e,t){throw new LD},t.offset=function(e){throw new LD},t.equals=function(e){throw new LD},yD(e,[{key:"type",get:function(){throw new LD}},{key:"name",get:function(){throw new LD}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new LD}},{key:"isValid",get:function(){throw new LD}}]),e}(),cL=null,uL=function(e){function t(){return e.apply(this,arguments)||this}SD(t,e);var n=t.prototype;return n.offsetName=function(e,t){return EB(e,t.format,t.locale)},n.formatOffset=function(e,t){return IB(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return"system"===e.type},yD(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===cL&&(cL=new t),cL}}]),t}(lL),dL={};var pL={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};var hL={},fL=function(e){function t(n){var r;return(r=e.call(this)||this).zoneName=n,r.valid=t.isValidZone(n),r}SD(t,e),t.create=function(e){return hL[e]||(hL[e]=new t(e)),hL[e]},t.resetCache=function(){hL={},dL={}},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 EB(e,t.format,t.locale,this.name)},n.formatOffset=function(e,t){return IB(this.offset(e),t)},n.offset=function(e){var t=new Date(e);if(isNaN(t))return NaN;var n,r=(n=this.name,dL[n]||(dL[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"})),dL[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=pL[s];"era"===s?r[l]=a:iB(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(xB({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},yD(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}(lL),mL=["base"],gL=["padTo","floor"],vL={};var yL={};function bL(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=yL[n];return r||(r=new Intl.DateTimeFormat(e,t),yL[n]=r),r}var SL={};var xL={};var wL=null;var CL={};function AL(e,t,n,r){var i=e.listingMode();return"error"===i?null:"en"===i?n(t):r(t)}var EL=function(){function e(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1,n.padTo,n.floor;var r=_D(n,gL);if(!t||Object.keys(r).length>0){var i=bD({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=SL[n];return r||(r=new Intl.NumberFormat(e,t),SL[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 hB(this.floor?Math.floor(e):vB(e,3),this.padTo)},e}(),_L=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&&fL.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=bD({},this.opts);s.timeZone=s.timeZone||r,this.dtf=bL(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?bD({},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}(),ML=function(){function e(e,t,n){this.opts=bD({style:"long"},n),!t&&aB()&&(this.rtf=function(e,t){void 0===t&&(t={});var n=t;n.base;var r=_D(n,mL),i=JSON.stringify([e,r]),o=xL[i];return o||(o=new Intl.RelativeTimeFormat(e,t),xL[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}(),TL={firstDay:1,minimalDays:4,weekend:[6,7]},IL=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=bL(e).resolvedOptions(),r=e}catch(t){var o=e.substring(0,i);n=bL(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||HL.defaultLocale;return new e(s||(o?"en-US":wL||(wL=(new Intl.DateTimeFormat).resolvedOptions().locale)),n||HL.defaultNumberingSystem,r||HL.defaultOutputCalendar,dB(i)||HL.defaultWeekSettings,s)},e.resetCache=function(){wL=null,yL={},SL={},xL={}},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,dB(t.weekSettings)||this.weekSettings,t.defaultToEN||!1):this},t.redefaultToEN=function(e){return void 0===e&&(e={}),this.clone(bD({},e,{defaultToEN:!0}))},t.redefaultToSystem=function(e){return void 0===e&&(e={}),this.clone(bD({},e,{defaultToEN:!1}))},t.months=function(e,t){var n=this;return void 0===t&&(t=!1),AL(this,e,NB,(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=zU.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),AL(this,e,zB,(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=zU.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 AL(this,void 0,(function(){return UB}),(function(){if(!e.meridiemCache){var t={hour:"numeric",hourCycle:"h12"};e.meridiemCache=[zU.utc(2016,11,13,9),zU.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 AL(this,e,GB,(function(){var n={era:e};return t.eraCache[e]||(t.eraCache[e]=[zU.utc(-40,1,1),zU.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 EL(this.intl,e.forceSimple||this.fastNumbers,e)},t.dtFormatter=function(e,t){return void 0===t&&(t={}),new _L(e,this.intl,t)},t.relFormatter=function(e){return void 0===e&&(e={}),new ML(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=vL[n];return r||(r=new Intl.ListFormat(e,t),vL[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:lB()?function(e){var t=CL[e];if(!t){var n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,CL[e]=t}return t}(this.locale):TL},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},yD(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}(),RL=null,PL=function(e){function t(t){var n;return(n=e.call(this)||this).fixed=t,n}SD(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(_B(n[1],n[2]))}return null};var n=t.prototype;return n.offsetName=function(){return this.name},n.formatOffset=function(e,t){return IB(this.fixed,t)},n.offset=function(){return this.fixed},n.equals=function(e){return"fixed"===e.type&&e.fixed===this.fixed},yD(t,[{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC"+IB(this.fixed,"narrow")}},{key:"ianaName",get:function(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+IB(-this.fixed,"narrow")}},{key:"isUniversal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}],[{key:"utcInstance",get:function(){return null===RL&&(RL=new t(0)),RL}}]),t}(lL),kL=function(e){function t(t){var n;return(n=e.call(this)||this).zoneName=t,n}SD(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},yD(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}(lL);function OL(e,t){if(iB(e)||null===e)return t;if(e instanceof lL)return e;if(function(e){return"string"==typeof e}(e)){var n=e.toLowerCase();return"default"===n?t:"local"===n||"system"===n?uL.instance:"utc"===n||"gmt"===n?PL.utcInstance:PL.parseSpecifier(n)||fL.create(e)}return oB(e)?PL.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new kL(e)}var NL,DL=function(){return Date.now()},LL="system",BL=null,zL=null,UL=null,FL=60,jL=null,HL=function(){function e(){}return e.resetCaches=function(){IL.resetCache(),fL.resetCache()},yD(e,null,[{key:"now",get:function(){return DL},set:function(e){DL=e}},{key:"defaultZone",get:function(){return OL(LL,uL.instance)},set:function(e){LL=e}},{key:"defaultLocale",get:function(){return BL},set:function(e){BL=e}},{key:"defaultNumberingSystem",get:function(){return zL},set:function(e){zL=e}},{key:"defaultOutputCalendar",get:function(){return UL},set:function(e){UL=e}},{key:"defaultWeekSettings",get:function(){return jL},set:function(e){jL=dB(e)}},{key:"twoDigitCutoffYear",get:function(){return FL},set:function(e){FL=e%100}},{key:"throwOnInvalid",get:function(){return NL},set:function(e){NL=e}}]),e}(),GL=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}(),VL=[0,31,59,90,120,151,181,212,243,273,304,334],WL=[0,31,60,91,121,152,182,213,244,274,305,335];function qL(e,t){return new GL("unit out of range","you specified "+t+" (of type "+typeof t+") as a "+e+", which is invalid")}function KL(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 JL(e,t,n){return n+(yB(e)?WL:VL)[t-1]}function QL(e,t){var n=yB(e)?WL:VL,r=n.findIndex((function(e){return e<t}));return{month:r+1,day:t-n[r]}}function YL(e,t){return(e-t+7)%7+1}function XL(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=JL(i,o,s),l=YL(KL(i,o,s),n),c=Math.floor((a-l+14-t)/7);return c<1?c=CB(r=i-1,t,n):c>CB(i,t,n)?(r=i+1,c=1):r=i,bD({weekYear:r,weekNumber:c,weekday:l},RB(e))}function $L(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=YL(KL(i,1,t),n),l=bB(i),c=7*o+s-a-7+t;c<1?c+=bB(r=i-1):c>l?(r=i+1,c-=bB(i)):r=i;var u=QL(r,c);return bD({year:r,month:u.month,day:u.day},RB(e))}function ZL(e){var t=e.year;return bD({year:t,ordinal:JL(t,e.month,e.day)},RB(e))}function eB(e){var t=e.year,n=QL(t,e.ordinal);return bD({year:t,month:n.month,day:n.day},RB(e))}function tB(e,t){if(!iB(e.localWeekday)||!iB(e.localWeekNumber)||!iB(e.localWeekYear)){if(!iB(e.weekday)||!iB(e.weekNumber)||!iB(e.weekYear))throw new OD("Cannot mix locale-based week fields with ISO-based week fields");return iB(e.localWeekday)||(e.weekday=e.localWeekday),iB(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),iB(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 nB(e){var t=sB(e.year),n=pB(e.month,1,12),r=pB(e.day,1,SB(e.year,e.month));return t?n?!r&&qL("day",e.day):qL("month",e.month):qL("year",e.year)}function rB(e){var t=e.hour,n=e.minute,r=e.second,i=e.millisecond,o=pB(t,0,23)||24===t&&0===n&&0===r&&0===i,s=pB(n,0,59),a=pB(r,0,59),l=pB(i,0,999);return o?s?a?!l&&qL("millisecond",i):qL("second",r):qL("minute",n):qL("hour",t)}function iB(e){return void 0===e}function oB(e){return"number"==typeof e}function sB(e){return"number"==typeof e&&e%1==0}function aB(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function lB(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function cB(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 uB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function dB(e){if(null==e)return null;if("object"!=typeof e)throw new DD("Week settings must be an object");if(!pB(e.firstDay,1,7)||!pB(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some((function(e){return!pB(e,1,7)})))throw new DD("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function pB(e,t,n){return sB(e)&&e>=t&&e<=n}function hB(e,t){return void 0===t&&(t=2),e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0")}function fB(e){return iB(e)||null===e||""===e?void 0:parseInt(e,10)}function mB(e){return iB(e)||null===e||""===e?void 0:parseFloat(e)}function gB(e){if(!iB(e)&&null!==e&&""!==e){var t=1e3*parseFloat("0."+e);return Math.floor(t)}}function vB(e,t,n){void 0===n&&(n=!1);var r=Math.pow(10,t);return(n?Math.trunc:Math.round)(e*r)/r}function yB(e){return e%4==0&&(e%100!=0||e%400==0)}function bB(e){return yB(e)?366:365}function SB(e,t){var n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?yB(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function xB(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 wB(e,t,n){return-YL(KL(e,1,t),n)+t-1}function CB(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r=wB(e,t,n),i=wB(e+1,t,n);return(bB(e)-r+i)/7}function AB(e){return e>99?e:e>HL.twoDigitCutoffYear?1900+e:2e3+e}function EB(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=bD({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 _B(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 MB(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new DD("Invalid unit value "+e);return t}function TB(e,t){var n={};for(var r in e)if(uB(e,r)){var i=e[r];if(null==i)continue;n[t(r)]=MB(i)}return n}function IB(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+hB(n,2)+":"+hB(r,2);case"narrow":return""+i+n+(r>0?":"+r:"");case"techie":return""+i+hB(n,2)+hB(r,2);default:throw new RangeError("Value format "+t+" is out of range for property format")}}function RB(e){return function(e,t){return t.reduce((function(t,n){return t[n]=e[n],t}),{})}(e,["hour","minute","second","millisecond"])}var PB=["January","February","March","April","May","June","July","August","September","October","November","December"],kB=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],OB=["J","F","M","A","M","J","J","A","S","O","N","D"];function NB(e){switch(e){case"narrow":return[].concat(OB);case"short":return[].concat(kB);case"long":return[].concat(PB);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 DB=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],LB=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],BB=["M","T","W","T","F","S","S"];function zB(e){switch(e){case"narrow":return[].concat(BB);case"short":return[].concat(LB);case"long":return[].concat(DB);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var UB=["AM","PM"],FB=["Before Christ","Anno Domini"],jB=["BC","AD"],HB=["B","A"];function GB(e){switch(e){case"narrow":return[].concat(HB);case"short":return[].concat(jB);case"long":return[].concat(FB);default:return null}}function VB(e,t){for(var n,r="",i=TD(e);!(n=i()).done;){var o=n.value;o.literal?r+=o.val:r+=t(o.val)}return r}var WB={D:FD,DD:jD,DDD:GD,DDDD:VD,t:WD,tt:qD,ttt:KD,tttt:JD,T:QD,TT:YD,TTT:XD,TTTT:$D,f:ZD,ff:tL,fff:iL,ffff:sL,F:eL,FF:nL,FFF:oL,FFFF:aL},qB=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 WB[e]};var t=e.prototype;return t.formatWithSystemDefault=function(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,bD({},this.opts,t)).format()},t.dtFormatter=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,bD({},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 hB(e,t);var n=bD({},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 UB[e.hour<12?0:1]}(t):s({hour:"numeric",hourCycle:"h12"},"dayperiod")},c=function(e,n){return i?function(e,t){return NB(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 zB(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 GB(t)[e.year<0?0:1]}(t,e):s({era:e},"era")};return VB(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 VB(s,(r=l,function(e){var t=o(e);return t?i.num(r.get(t),e.length):e}))},e}(),KB=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function JB(){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 QB(){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[bD({},r,a),l||i,c]}),[{},null,1]).slice(0,2)}}function YB(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 XB(){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]]=fB(e[n+r]);return[i,null,n+r]}}var $B=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,ZB=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,ez=RegExp(""+ZB.source+("(?:"+$B.source+"?(?:\\[("+KB.source+")\\])?)?")),tz=RegExp("(?:T"+ez.source+")?"),nz=XB("weekYear","weekNumber","weekDay"),rz=XB("year","ordinal"),iz=RegExp(ZB.source+" ?(?:"+$B.source+"|("+KB.source+"))?"),oz=RegExp("(?: "+iz.source+")?");function sz(e,t,n){var r=e[t];return iB(r)?n:fB(r)}function az(e,t){return[{hours:sz(e,t,0),minutes:sz(e,t+1,0),seconds:sz(e,t+2,0),milliseconds:gB(e[t+3])},null,t+4]}function lz(e,t){var n=!e[t]&&!e[t+1],r=_B(e[t+1],e[t+2]);return[{},n?null:PL.instance(r),t+3]}function cz(e,t){return[{},e[t]?fL.create(e[t]):null,t+1]}var uz=RegExp("^T?"+ZB.source+"$"),dz=/^-?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 pz(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(mB(n)),months:p(mB(r)),weeks:p(mB(i)),days:p(mB(o)),hours:p(mB(s)),minutes:p(mB(a)),seconds:p(mB(l),"-0"===l),milliseconds:p(gB(c),d)}]}var hz={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function fz(e,t,n,r,i,o,s){var a={year:2===t.length?AB(fB(t)):fB(t),month:kB.indexOf(n)+1,day:fB(r),hour:fB(i),minute:fB(o)};return s&&(a.second=fB(s)),e&&(a.weekday=e.length>3?DB.indexOf(e)+1:LB.indexOf(e)+1),a}var mz=/^(?:(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 gz(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=fz(n,o,i,r,s,a,l);return t=c?hz[c]:u?0:_B(d,p),[h,new PL(t)]}var vz=/^(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$/,yz=/^(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$/,bz=/^(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 Sz(e){var t=e[1],n=e[2],r=e[3];return[fz(t,e[4],r,n,e[5],e[6],e[7]),PL.utcInstance]}function xz(e){var t=e[1],n=e[2],r=e[3],i=e[4],o=e[5],s=e[6];return[fz(t,e[7],n,r,i,o,s),PL.utcInstance]}var wz=JB(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,tz),Cz=JB(/(\d{4})-?W(\d\d)(?:-?(\d))?/,tz),Az=JB(/(\d{4})-?(\d{3})/,tz),Ez=JB(ez),_z=QB((function(e,t){return[{year:sz(e,t),month:sz(e,t+1,1),day:sz(e,t+2,1)},null,t+3]}),az,lz,cz),Mz=QB(nz,az,lz,cz),Tz=QB(rz,az,lz,cz),Iz=QB(az,lz,cz);var Rz=QB(az);var Pz=JB(/(\d{4})-(\d\d)-(\d\d)/,oz),kz=JB(iz),Oz=QB(az,lz,cz);var Nz="Invalid Duration",Dz={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}},Lz=bD({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}},Dz),Bz=365.2425,zz=30.436875,Uz=bD({years:{quarters:4,months:12,weeks:52.1775,days:Bz,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:zz,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},Dz),Fz=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],jz=Fz.slice(0).reverse();function Hz(e,t,n){void 0===n&&(n=!1);var r={values:n?t.values:bD({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Wz(r)}function Gz(e,t){for(var n,r,i=null!=(n=t.milliseconds)?n:0,o=TD(jz.slice(1));!(r=o()).done;){var s=r.value;t[s]&&(i+=t[s]*e[s].milliseconds)}return i}function Vz(e,t){var n=Gz(e,t)<0?-1:1;Fz.reduceRight((function(r,i){if(iB(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),Fz.reduce((function(n,r){if(iB(t[r]))return n;if(n){var i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r}),null)}var Wz=function(e){function t(e){var t="longterm"===e.conversionAccuracy||!1,n=t?Uz:Lz;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||IL.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 DD("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new t({values:TB(e,t.normalizeUnit),loc:IL.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})},t.fromDurationLike=function(e){if(oB(e))return t.fromMillis(e);if(t.isDuration(e))return e;if("object"==typeof e)return t.fromObject(e);throw new DD("Unknown duration argument "+e+" of type "+typeof e)},t.fromISO=function(e,n){var r=function(e){return YB(e,[dz,pz])}(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 YB(e,[uz,Rz])}(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 DD("need to specify a reason the Duration is invalid");var r=e instanceof GL?e:new GL(e,n);if(HL.throwOnInvalid)throw new kD(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 ND(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=bD({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?qB.create(this.loc,n).formatDurationFromString(this,e):Nz},n.toHuman=function(e){var t=this;if(void 0===e&&(e={}),!this.isValid)return Nz;var n=Fz.map((function(n){var r=t.values[n];return iB(r)?null:t.loc.numberFormatter(bD({style:"unit",unitDisplay:"long"},e,{unit:n.slice(0,-1)})).format(r)})).filter((function(e){return e}));return this.loc.listFormatter(bD({type:"conjunction",style:e.listStyle||"narrow"},e)).format(n)},n.toObject=function(){return this.isValid?bD({},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+=vB(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=bD({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e,{includeOffset:!1}),zU.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?Gz(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=Fz;i<o.length;i++){var s=o[i];(uB(n.values,s)||uB(this.values,s))&&(r[s]=n.get(s)+this.get(s))}return Hz(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]=MB(e(this.values[i],i))}return Hz(this,{values:t},!0)},n.get=function(e){return this[t.normalizeUnit(e)]},n.set=function(e){return this.isValid?Hz(this,{values:bD({},this.values,TB(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 Hz(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 Vz(this.matrix,e),Hz(this,{values:e},!0)},n.rescale=function(){return this.isValid?Hz(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=Fz;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;oB(a[u])&&(d+=a[u]);var h=Math.trunc(d);o[u]=h,s[u]=(1e3*d-1e3*h)/1e3}else oB(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 Vz(this.matrix,o),Hz(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 Hz(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=Fz;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},yD(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")),qz="Invalid Interval";var Kz=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 DD("need to specify a reason the Interval is invalid");var r=e instanceof GL?e:new GL(e,n);if(HL.throwOnInvalid)throw new PD(r);return new t({invalid:r})},t.fromDateTimes=function(e,n){var r=UU(e),i=UU(n),o=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?Kz.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:Kz.invalid("missing or invalid end"):Kz.invalid("missing or invalid start")}(r,i);return null==o?new t({start:r,end:i}):o},t.after=function(e,n){var r=Wz.fromDurationLike(n),i=UU(e);return t.fromDateTimes(i,i.plus(r))},t.before=function(e,n){var r=Wz.fromDurationLike(n),i=UU(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=zU.fromISO(i,n)).isValid}catch(e){a=!1}try{c=(l=zU.fromISO(o,n)).isValid}catch(e){c=!1}if(a&&c)return t.fromDateTimes(s,l);if(a){var u=Wz.fromISO(o,n);if(u.isValid)return t.after(s,u)}else if(c){var d=Wz.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(UU).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=Wz.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=TD(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()+")":qz},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=FD),void 0===t&&(t={}),this.isValid?qB.create(this.s.loc.clone(t),e).formatInterval(this):qz},n.toISO=function(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):qz},n.toISODate=function(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():qz},n.toISOTime=function(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):qz},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):qz},n.toDuration=function(e,t){return this.isValid?this.e.diff(this.s,e,t):Wz.invalid(this.invalidReason)},n.mapEndpoints=function(e){return t.fromDateTimes(e(this.s),e(this.e))},yD(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")),Jz=function(){function e(){}return e.hasDST=function(e){void 0===e&&(e=HL.defaultZone);var t=zU.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset},e.isValidIANAZone=function(e){return fL.isValidZone(e)},e.normalizeZone=function(e){return OL(e,HL.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)||IL.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)||IL.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)||IL.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||IL.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||IL.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)||IL.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)||IL.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 IL.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 IL.create(r,null,"gregory").eras(e)},e.features=function(){return{relative:aB(),localeWeek:lB()}},e}();function Qz(e,t){var n=function(e){return e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf()},r=n(t)-n(e);return Math.floor(Wz.fromMillis(r).as("days"))}function Yz(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=Qz(e,t);return(n-n%7)/7}],["days",Qz]],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=Wz.fromObject(s,r);return u.length>0?(p=Wz.fromMillis(c,r)).shiftTo.apply(p,u).plus(h):h}var Xz={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},$z={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]},Zz=Xz.hanidec.replace(/[\[|\]]/g,"").split("");function eU(e,t){var n=e.numberingSystem;return void 0===t&&(t=""),new RegExp(""+Xz[n||"latn"]+t)}function tU(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(Xz.hanidec))t+=Zz.indexOf(e[n]);else for(var i in $z){var o=$z[i],s=o[0],a=o[1];r>=s&&r<=a&&(t+=r-s)}}return parseInt(t,10)}return t}(n))}}}var nU="[ "+String.fromCharCode(160)+"]",rU=new RegExp(nU,"g");function iU(e){return e.replace(/\./g,"\\.?").replace(rU,nU)}function oU(e){return e.replace(/\./g,"").replace(rU," ").toLowerCase()}function sU(e,t){return null===e?null:{regex:RegExp(e.map(iU).join("|")),deser:function(n){var r=n[0];return e.findIndex((function(e){return oU(r)===oU(e)}))+t}}}function aU(e,t){return{regex:e,deser:function(e){return _B(e[1],e[2])},groups:t}}function lU(e){return{regex:e,deser:function(e){return e[0]}}}var cU={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 uU=null;function dU(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=hU(qB.macroTokenToFormatOpts(e.val),t);return null==n||n.includes(void 0)?e:n}(e,t)})))}function pU(e,t,n){var r=dU(qB.parseFormat(n),e),i=r.map((function(t){return n=t,i=eU(r=e),o=eU(r,"{2}"),s=eU(r,"{3}"),a=eU(r,"{4}"),l=eU(r,"{6}"),c=eU(r,"{1,2}"),u=eU(r,"{1,3}"),d=eU(r,"{1,6}"),p=eU(r,"{1,9}"),h=eU(r,"{2,4}"),f=eU(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 sU(r.eras("short"),0);case"GG":return sU(r.eras("long"),0);case"y":return tU(d);case"yy":case"kk":return tU(h,AB);case"yyyy":case"kkkk":return tU(a);case"yyyyy":return tU(f);case"yyyyyy":return tU(l);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return tU(c);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return tU(o);case"MMM":return sU(r.months("short",!0),1);case"MMMM":return sU(r.months("long",!0),1);case"LLL":return sU(r.months("short",!1),1);case"LLLL":return sU(r.months("long",!1),1);case"o":case"S":return tU(u);case"ooo":case"SSS":return tU(s);case"u":return lU(p);case"uu":return lU(c);case"uuu":case"E":case"c":return tU(i);case"a":return sU(r.meridiems(),0);case"EEE":return sU(r.weekdays("short",!1),1);case"EEEE":return sU(r.weekdays("long",!1),1);case"ccc":return sU(r.weekdays("short",!0),1);case"cccc":return sU(r.weekdays("long",!0),1);case"Z":case"ZZ":return aU(new RegExp("([+-]"+c.source+")(?::("+o.source+"))?"),2);case"ZZZ":return aU(new RegExp("([+-]"+c.source+")("+o.source+")?"),2);case"z":return lU(/[a-z_+-/]{1,256}?/i);case" ":return lU(/[^\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(uB(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;iB(e.z)||(n=fL.create(e.z)),iB(e.Z)||(n||(n=new PL(e.Z)),t=e.Z),iB(e.q)||(e.M=3*(e.q-1)+1),iB(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),iB(e.u)||(e.S=gB(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(uB(p,"a")&&uB(p,"H"))throw new OD("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 hU(e,t){if(!e)return null;var n=qB.create(t,e).dtFormatter((uU||(uU=zU.fromMillis(1555555555555)),uU)),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=cU[a];if("object"==typeof l&&(l=l[s]),l)return{literal:!1,val:l}}(t,e,i)}))}var fU="Invalid DateTime",mU=864e13;function gU(e){return new GL("unsupported zone",'the zone "'+e.name+'" is not supported')}function vU(e){return null===e.weekData&&(e.weekData=XL(e.c)),e.weekData}function yU(e){return null===e.localWeekData&&(e.localWeekData=XL(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function bU(e,t){var n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new zU(bD({},n,t,{old:n}))}function SU(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 xU(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 wU(e,t,n){return SU(xB(e),t,n)}function CU(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=bD({},e.c,{year:r,month:i,day:Math.min(e.c.day,SB(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)}),s=Wz.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=SU(xB(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 AU(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=zU.fromObject(e,bD({},n,{zone:l,specificOffset:o}));return s?c:c.setZone(a)}return zU.invalid(new GL("unparsable",'the input "'+i+"\" can't be parsed as "+r))}function EU(e,t,n){return void 0===n&&(n=!0),e.isValid?qB.create(IL.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function _U(e,t){var n=e.c.year>9999||e.c.year<0,r="";return n&&e.c.year>=0&&(r+="+"),r+=hB(e.c.year,n?6:4),t?(r+="-",r+=hB(e.c.month),r+="-",r+=hB(e.c.day)):(r+=hB(e.c.month),r+=hB(e.c.day)),r}function MU(e,t,n,r,i,o){var s=hB(e.c.hour);return t?(s+=":",s+=hB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=":")):s+=hB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=hB(e.c.second),0===e.c.millisecond&&r||(s+=".",s+=hB(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!o?s+="Z":e.o<0?(s+="-",s+=hB(Math.trunc(-e.o/60)),s+=":",s+=hB(Math.trunc(-e.o%60))):(s+="+",s+=hB(Math.trunc(e.o/60)),s+=":",s+=hB(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}var TU={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},IU={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},RU={ordinal:1,hour:0,minute:0,second:0,millisecond:0},PU=["year","month","day","hour","minute","second","millisecond"],kU=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],OU=["year","ordinal","hour","minute","second","millisecond"];function NU(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 ND(e);return t}(e)}}function DU(e,t){var n,r,i=OL(t.zone,HL.defaultZone),o=IL.fromObject(t),s=HL.now();if(iB(e.year))n=s;else{for(var a=0,l=PU;a<l.length;a++){var c=l[a];iB(e[c])&&(e[c]=TU[c])}var u=nB(e)||rB(e);if(u)return zU.invalid(u);var d=wU(e,i.offset(s),i);n=d[0],r=d[1]}return new zU({ts:n,zone:i,loc:o,o:r})}function LU(e,t,n){var r=!!iB(n.round)||n.round,i=function(e,i){return e=vB(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=TD(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 BU(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 zU=function(e){function t(e){var t=e.zone||HL.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new GL("invalid input"):null)||(t.isValid?null:gU(t));this.ts=iB(e.ts)?HL.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=xU(this.ts,s),r=(n=Number.isNaN(r.year)?new GL("invalid input"):null)?null:r,i=n?null:s}this._zone=t,this.loc=e.loc||IL.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=BU(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 DU({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:c},t)},t.utc=function(){var e=BU(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=PL.utcInstance,DU({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=OL(n.zone,HL.defaultZone);return i.isValid?new t({ts:r,zone:i,loc:IL.fromObject(n)}):t.invalid(gU(i))},t.fromMillis=function(e,n){if(void 0===n&&(n={}),oB(e))return e<-864e13||e>mU?t.invalid("Timestamp out of range"):new t({ts:e,zone:OL(n.zone,HL.defaultZone),loc:IL.fromObject(n)});throw new DD("fromMillis requires a numerical input, but received a "+typeof e+" with value "+e)},t.fromSeconds=function(e,n){if(void 0===n&&(n={}),oB(e))return new t({ts:1e3*e,zone:OL(n.zone,HL.defaultZone),loc:IL.fromObject(n)});throw new DD("fromSeconds requires a numerical input")},t.fromObject=function(e,n){void 0===n&&(n={}),e=e||{};var r=OL(n.zone,HL.defaultZone);if(!r.isValid)return t.invalid(gU(r));var i=IL.fromObject(n),o=TB(e,NU),s=tB(o,i),a=s.minDaysInFirstWeek,l=s.startOfWeek,c=HL.now(),u=iB(n.specificOffset)?r.offset(c):n.specificOffset,d=!iB(o.ordinal),p=!iB(o.year),h=!iB(o.month)||!iB(o.day),f=p||h,m=o.weekYear||o.weekNumber;if((f||d)&&m)throw new OD("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&d)throw new OD("Can't mix ordinal dates with month/day");var g,v,y=m||o.weekday&&!f,b=xU(c,u);y?(g=kU,v=IU,b=XL(b,a,l)):d?(g=OU,v=RU,b=ZL(b)):(g=PU,v=TU);for(var S,x=!1,w=TD(g);!(S=w()).done;){var C=S.value;iB(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=sB(e.weekYear),i=pB(e.weekNumber,1,CB(e.weekYear,t,n)),o=pB(e.weekday,1,7);return r?i?!o&&qL("weekday",e.weekday):qL("week",e.weekNumber):qL("weekYear",e.weekYear)}(o,a,l):d?function(e){var t=sB(e.year),n=pB(e.ordinal,1,bB(e.year));return t?!n&&qL("ordinal",e.ordinal):qL("year",e.year)}(o):nB(o),E=A||rB(o);if(E)return t.invalid(E);var _=wU(y?$L(o,a,l):d?eB(o):o,u,r),M=new t({ts:_[0],zone:r,o:_[1],loc:i});return o.weekday&&f&&e.weekday!==M.weekday?t.invalid("mismatched weekday","you can't specify both a weekday of "+o.weekday+" and a date of "+M.toISO()):M},t.fromISO=function(e,t){void 0===t&&(t={});var n=function(e){return YB(e,[wz,_z],[Cz,Mz],[Az,Tz],[Ez,Iz])}(e);return AU(n[0],n[1],t,"ISO 8601",e)},t.fromRFC2822=function(e,t){void 0===t&&(t={});var n=function(e){return YB(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[mz,gz])}(e);return AU(n[0],n[1],t,"RFC 2822",e)},t.fromHTTP=function(e,t){void 0===t&&(t={});var n=function(e){return YB(e,[vz,Sz],[yz,Sz],[bz,xz])}(e);return AU(n[0],n[1],t,"HTTP",t)},t.fromFormat=function(e,n,r){if(void 0===r&&(r={}),iB(e)||iB(n))throw new DD("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=pU(e,t,n);return[r.result,r.zone,r.specificOffset,r.invalidReason]}(IL.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):AU(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 YB(e,[Pz,_z],[kz,Oz])}(e);return AU(n[0],n[1],t,"SQL",e)},t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new DD("need to specify a reason the DateTime is invalid");var r=e instanceof GL?e:new GL(e,n);if(HL.throwOnInvalid)throw new RD(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=hU(e,IL.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={}),dU(qB.parseFormat(e),IL.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=xB(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=xU(a,o),u=xU(l,s);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[bU(this,{ts:a}),bU(this,{ts:l})]:[this]},n.resolvedLocaleOptions=function(e){void 0===e&&(e={});var t=qB.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(PL.instance(e),t)},n.toLocal=function(){return this.setZone(HL.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=OL(e,HL.defaultZone)).equals(this.zone))return this;if(e.isValid){var l=this.ts;if(o||a){var c=e.offset(this.ts);l=wU(this.toObject(),c,e)[0]}return bU(this,{ts:l,zone:e})}return t.invalid(gU(e))},n.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.outputCalendar;return bU(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=TB(e,NU),r=tB(n,this.loc),i=r.minDaysInFirstWeek,o=r.startOfWeek,s=!iB(n.weekYear)||!iB(n.weekNumber)||!iB(n.weekday),a=!iB(n.ordinal),l=!iB(n.year),c=!iB(n.month)||!iB(n.day),u=l||c,d=n.weekYear||n.weekNumber;if((u||a)&&d)throw new OD("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new OD("Can't mix ordinal dates with month/day");s?t=$L(bD({},XL(this.c,i,o),n),i,o):iB(n.ordinal)?(t=bD({},this.toObject(),n),iB(n.day)&&(t.day=Math.min(SB(t.year,t.month),t.day))):t=eB(bD({},ZL(this.c),n));var p=wU(t,this.o,this.zone);return bU(this,{ts:p[0],o:p[1]})},n.plus=function(e){return this.isValid?bU(this,CU(this,Wz.fromDurationLike(e))):this},n.minus=function(e){return this.isValid?bU(this,CU(this,Wz.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=Wz.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?qB.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):fU},n.toLocaleString=function(e,t){return void 0===e&&(e=FD),void 0===t&&(t={}),this.isValid?qB.create(this.loc.clone(t),e).formatDateTime(this):fU},n.toLocaleParts=function(e){return void 0===e&&(e={}),this.isValid?qB.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=_U(this,p);return h+="T",h+=MU(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?_U(this,"extended"===n):null},n.toISOWeekDate=function(){return EU(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":"")+MU(this,"extended"===h,o,r,a,d):null},n.toRFC2822=function(){return EU(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},n.toHTTP=function(){return EU(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},n.toSQLDate=function(){return this.isValid?_U(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")),EU(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():fU},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=bD({},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 Wz.invalid("created by diffing an invalid DateTime");var r,i=bD({locale:this.locale,numberingSystem:this.numberingSystem},n),o=(r=t,Array.isArray(r)?r:[r]).map(Wz.normalizeUnit),s=e.valueOf()>this.valueOf(),a=Yz(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?Kz.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),LU(n,this.plus(r),bD({},e,{numeric:"always",units:i,unit:o}))},n.toRelativeCalendar=function(e){return void 0===e&&(e={}),this.isValid?LU(e.base||t.fromObject({},{zone:this.zone}),this,bD({},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 DD("min requires all arguments be DateTimes");return cB(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 DD("max requires all arguments be DateTimes");return cB(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 pU(IL.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)},yD(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?vU(this).weekYear:NaN}},{key:"weekNumber",get:function(){return this.isValid?vU(this).weekNumber:NaN}},{key:"weekday",get:function(){return this.isValid?vU(this).weekday:NaN}},{key:"isWeekend",get:function(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}},{key:"localWeekday",get:function(){return this.isValid?yU(this).weekday:NaN}},{key:"localWeekNumber",get:function(){return this.isValid?yU(this).weekNumber:NaN}},{key:"localWeekYear",get:function(){return this.isValid?yU(this).weekYear:NaN}},{key:"ordinal",get:function(){return this.isValid?ZL(this.c).ordinal:NaN}},{key:"monthShort",get:function(){return this.isValid?Jz.months("short",{locObj:this.loc})[this.month-1]:null}},{key:"monthLong",get:function(){return this.isValid?Jz.months("long",{locObj:this.loc})[this.month-1]:null}},{key:"weekdayShort",get:function(){return this.isValid?Jz.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}},{key:"weekdayLong",get:function(){return this.isValid?Jz.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 yB(this.year)}},{key:"daysInMonth",get:function(){return SB(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?bB(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?CB(this.weekYear):NaN}},{key:"weeksInLocalWeekYear",get:function(){return this.isValid?CB(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}}],[{key:"DATE_SHORT",get:function(){return FD}},{key:"DATE_MED",get:function(){return jD}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return HD}},{key:"DATE_FULL",get:function(){return GD}},{key:"DATE_HUGE",get:function(){return VD}},{key:"TIME_SIMPLE",get:function(){return WD}},{key:"TIME_WITH_SECONDS",get:function(){return qD}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return KD}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return JD}},{key:"TIME_24_SIMPLE",get:function(){return QD}},{key:"TIME_24_WITH_SECONDS",get:function(){return YD}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return XD}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return $D}},{key:"DATETIME_SHORT",get:function(){return ZD}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return eL}},{key:"DATETIME_MED",get:function(){return tL}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return nL}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return rL}},{key:"DATETIME_FULL",get:function(){return iL}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return oL}},{key:"DATETIME_HUGE",get:function(){return sL}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return aL}}]),t}(Symbol.for("nodejs.util.inspect.custom"));function UU(e){if(zU.isDateTime(e))return e;if(e&&e.valueOf&&oB(e.valueOf()))return zU.fromJSDate(e);if(e&&"object"==typeof e)return zU.fromObject(e);throw new DD("Unknown datetime argument: "+e+", of type "+typeof e)}gD.DateTime=zU,gD.Duration=Wz,gD.FixedOffsetZone=PL,gD.IANAZone=fL,gD.Info=Jz,gD.Interval=Kz,gD.InvalidZone=kL,gD.Settings=HL,gD.SystemZone=uL,gD.VERSION="3.4.4",gD.Zone=lL;c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");function FU(e,t){let[n,r]=(0,c.useState)(e),i=Ya(e);return Qa((()=>r(i.current)),[i,r,...t]),n}var jU=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(jU||{}),HU=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(HU||{}),GU=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(GU||{}),VU=(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))(VU||{});function WU(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=Ml(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 qU={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 za(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=WU(e),i=Id(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=WU(e,(e=>[...e,n]));if(null===e.activeOptionIndex){let{value:i,mode:o,compare:s}=e.propsRef.current,a=t.dataRef.current.value;za(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=WU(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},KU=(0,c.createContext)(null);function JU(e){let t=(0,c.useContext)(KU);if(null===t){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,JU),t}return t}function QU(e,t){return za(t.type,qU,e,t)}KU.displayName="ListboxContext";let YU=c.Fragment,XU=Wa((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=el(n),[m,g]=Vf(r,s,i),v=(0,c.useReducer)(QU,{listboxState:1,propsRef:{current:{value:m,onChange:g,mode:d?1:0,compare:Xa("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,Qa((()=>{b.current.onChange=e=>za(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]),Qa((()=>w({type:2,disabled:l})),[l]),Qa((()=>w({type:3,orientation:h})),[h]),dc([x,S],((e,t)=>{var n;w({type:1}),Cl(t,wl.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(KU.Provider,{value:v},t(c).createElement(sc,{value:za(y,{0:ic.Open,1:ic.Closed})},null!=o&&null!=m&&Ff({[o]:m}).map((([e,n])=>t(c).createElement(dl,{features:ul.Hidden,...qa({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:n})}))),Ha({ourProps:A,theirProps:p,slot:C,defaultTag:YU,name:"Listbox"})))})),$U=Wa((function(e,t){var n;let[r,i]=JU("Listbox.Button"),o=el(r.buttonRef,t),s=`headlessui-listbox-button-${cl()}`,a=Pc(),l=Xa((e=>{switch(e.key){case nl.Space:case nl.Enter:case nl.ArrowDown:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Td.First})}));break;case nl.ArrowUp:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Td.Last})}))}})),u=Xa((e=>{if(e.key===nl.Space)e.preventDefault()})),d=Xa((e=>{if(rl(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=FU((()=>{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 Ha({ourProps:{ref:o,id:s,type:kd(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"})})),ZU=Wa((function(e,t){let[n]=JU("Listbox.Label"),r=`headlessui-listbox-label-${cl()}`;return Ha({ourProps:{ref:el(n.labelRef,t),id:r,onClick:Xa((()=>{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"})})),eF=Fa.RenderStrategy|Fa.Static,tF=Wa((function(e,t){var n;let[r,i]=JU("Listbox.Options"),o=el(r.optionsRef,t),s=`headlessui-listbox-options-${cl()}`,a=Pc(),l=Pc(),u=oc(),d=null!==u?u===ic.Open:0===r.listboxState;(0,c.useEffect)((()=>{var e;let t=r.optionsRef.current;!t||0===r.listboxState&&t!==(null==(e=fl(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})}),[r.listboxState,r.optionsRef]);let p=Xa((e=>{switch(l.dispose(),e.key){case nl.Space:if(""!==r.searchQuery)return e.preventDefault(),e.stopPropagation(),i({type:5,value:e.key});case nl.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}),hl().nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})})));break;case za(r.orientation,{vertical:nl.ArrowDown,horizontal:nl.ArrowRight}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Td.Next});case za(r.orientation,{vertical:nl.ArrowUp,horizontal:nl.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Td.Previous});case nl.Home:case nl.PageUp:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Td.First});case nl.End:case nl.PageDown:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Td.Last});case nl.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 nl.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(i({type:5,value:e.key}),l.setTimeout((()=>i({type:6})),350))}})),h=FU((()=>{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 Ha({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:eF,visible:d,name:"Listbox.Options"})})),nF=Wa((function(e,t){let{disabled:n=!1,value:r,...i}=e,[o,s]=JU("Listbox.Option"),a=`headlessui-listbox-option-${cl()}`,l=null!==o.activeOptionIndex&&o.options[o.activeOptionIndex].id===a,{value:u,compare:d}=o.propsRef.current,p=za(o.propsRef.current.mode,{1:()=>u.some((e=>d(e,r))),0:()=>d(u,r)}),h=(0,c.useRef)(null),f=el(t,h);Qa((()=>{if(0!==o.listboxState||!l||0===o.activationTrigger)return;let e=hl();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});Qa((()=>{m.current.disabled=n}),[m,n]),Qa((()=>{m.current.value=r}),[m,r]),Qa((()=>{var e,t;m.current.textValue=null==(t=null==(e=h.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[m,h]);let g=Xa((()=>o.propsRef.current.onChange(r)));Qa((()=>(s({type:7,id:a,dataRef:m}),()=>s({type:8,id:a}))),[m,a]);let v=Xa((e=>{if(n)return e.preventDefault();g(),0===o.propsRef.current.mode&&(s({type:1}),hl().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})})))})),y=Xa((()=>{if(n)return s({type:4,focus:Td.Nothing});s({type:4,focus:Td.Specific,id:a})})),b=Xa((()=>{n||l||s({type:4,focus:Td.Specific,id:a,trigger:0})})),S=Xa((()=>{n||!l||s({type:4,focus:Td.Nothing})})),x=(0,c.useMemo)((()=>({active:l,selected:p,disabled:n})),[l,p,n]);return Ha({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"})})),rF=Object.assign(XU,{Button:$U,Label:ZU,Options:tF,Option:nF});var iF=({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 oF={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"]},sF=(0,c.memo)((({defaultDate:e,onChange:t,disabled:n=!1})=>{const{t:r,i18n:i}=be(),[o,a]=(0,c.useState)(e?"string"==typeof e?gD.DateTime.fromISO(e):gD.DateTime.fromJSDate(e):gD.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)(rF,{value:o,onChange:e=>{a(e)},disabled:n,name:"day",children:[(0,s.jsxs)(rF.Label,{className:"memori--date-selector__select-label",children:[r("day"),":"]}),(0,s.jsxs)(rF.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)(iF,{})})]}),(0,s.jsx)(Kc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(rF.Options,{className:"memori--date-selector__select-options",children:[...Array(31).keys()].map((e=>(0,s.jsx)(rF.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)(rF,{value:o,onChange:e=>{a(e)},disabled:n,name:"month",children:[(0,s.jsxs)(rF.Label,{className:"memori--date-selector__select-label",children:[r("month"),":"]}),(0,s.jsxs)(rF.Button,{"aria-label":r("month"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:oF["it"===i.language?"it":"en"][o.month-1]}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(iF,{})})]}),(0,s.jsx)(Kc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(rF.Options,{className:"memori--date-selector__select-options",children:oF["it"===i.language?"it":"en"].map((e=>(0,s.jsx)(rF.Option,{className:"memori--date-selector__select-option",value:o.set({month:oF["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)(rF,{value:o,onChange:e=>{a(e)},disabled:n,name:"year",children:[(0,s.jsxs)(rF.Label,{className:"memori--date-selector__select-label",children:[r("year"),":"]}),(0,s.jsxs)(rF.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)(iF,{})})]}),(0,s.jsx)(Kc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(rF.Options,{className:"memori--date-selector__select-options",children:[...Array(gD.DateTime.now().year-1899).keys()].sort(((e,t)=>t-e)).map((e=>(0,s.jsx)(rF.Option,{value:o.set({year:e+1900}),className:"memori--date-selector__select-option",children:e+1900},e)))})})]})})]})}));sF.displayName="DateSelector";var aF=sF;c=o("85Hg2");var lF=({visible:e=!1,onClose:n,minAge:r})=>{const{t:i}=be(),[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(ws).error(i("requiredField")),u(i("requiredField")||"Required field"),void p(!1);if(gD.DateTime.now().diff(o,"years").years<r)return t(ws).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)(Yc,{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)(aF,{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)(Ba,{primary:!0,htmlType:"submit",className:"age-verification-submit",loading:d,disabled:!o,children:i("confirm")})})]})]})};c=o("85Hg2");var cF=({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)(Kc,{appear:!0,show:e,as:t(c).Fragment,children:(0,s.jsxs)(Ec,{open:e,onClose:n,className:t(Ss)("memori-drawer",r),children:[(0,s.jsx)(Kc.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)(Kc.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)(Ec.Panel,{className:t(Ss)("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)(Ba,{shape:"circle",outlined:!0,icon:(0,s.jsx)(Qc,{}),onClick:()=>n(!1)})}),(0,s.jsxs)(Jc,{spinning:u,children:[i&&(0,s.jsx)(Ec.Title,{className:"memori-drawer--title",children:i}),o&&(0,s.jsx)(Ec.Description,{className:"memori-drawer--description",children:o}),a,l&&(0,s.jsx)("div",{className:"memori-drawer--footer",children:l})]})]})})})})]})});c=o("85Hg2");var uF=({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(Ss)("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 dF=({className:e,value:n,displayValue:r,options:i,onChange:o,disabled:a=!1,label:l,placeholder:u})=>(0,s.jsx)("div",{className:t(Ss)("memori-select",e),children:(0,s.jsxs)(rF,{value:n,onChange:e=>{o(e)},disabled:a,name:"day",children:[l&&(0,s.jsxs)(rF.Label,{className:"memori-select--label",children:[l,":"]}),(0,s.jsxs)(rF.Button,{"aria-label":l,className:"memori-select--button",children:[(0,s.jsx)("span",{className:t(Ss)("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)(iF,{})})]}),(0,s.jsx)(Kc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(rF.Options,{className:"memori-select--options",children:i.map((e=>(0,s.jsx)(rF.Option,{value:e.value,className:"memori-select--option",children:e.label},e.value)))})})]})});const pF={muteSpeaker:"@memori:muteSpeaker",microphoneMode:"@memori:microphoneMode",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",sendOnEnter:"@memori:sendOnEnter",birthDate:"@memori:birthDate",controlsPosition:"@memori:controlsPosition",hideEmissions:"@memori:hideEmissions",loginToken:"@memori:loginToken"},hF=(e,t)=>{var n;try{const r=window.localStorage.getItem(null!==(n=pF[e])&&void 0!==n?n:e);if(!r)return t;try{return JSON.parse(r)}catch(e){return r}}catch(e){return console.error("error",e),t}},fF=(e,t)=>{var n;try{window.localStorage.setItem(null!==(n=pF[e])&&void 0!==n?n:e,t.toString())}catch(e){console.error("error",e)}},mF=e=>{var t;try{window.localStorage.removeItem(null!==(t=pF[e])&&void 0!==t?t:e)}catch(e){console.error("error",e)}},gF=[2,3,5,10,15,20,30,60];var vF=({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}=be();return(0,s.jsxs)(cF,{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)(em,{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),fF("microphoneMode",t)},children:[(0,s.jsx)(em.Option,{value:"HOLD_TO_TALK",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Ba,{primary:e,children:h("write_and_speak.holdToSpeak")||"Hold to speak"})}),(0,s.jsx)(em.Option,{value:"CONTINUOUS",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Ba,{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)(dF,{label:h("write_and_speak.secondsLabel")||"Seconds",placeholder:h("write_and_speak.secondsLabel")||"Seconds",options:gF.map((e=>({value:e,label:e}))),value:i,onChange:e=>{a(e),fF("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)(em,{id:"controlsPosition",name:"controlsPosition",value:l,defaultValue:l,className:"memori-settings-drawer--controlsposition-radio",onChange:e=>{c(e),fF("controlsPosition",e)},children:[(0,s.jsx)(em.Option,{value:"center",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Ba,{primary:e,children:h("center")||"Center"})}),(0,s.jsx)(em.Option,{value:"bottom",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Ba,{primary:e,children:h("bottom")||"Bottom"})})]})]}),(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(uF,{label:h("write_and_speak.hideEmissionsLabel")||"Hide emissions",name:"hideControls",checked:u,onChange:e=>{d(e.target.checked),fF("hideEmissions",e.target.checked)}})})]}),p&&(0,s.jsx)("div",{className:"memori-settings-drawer--field controls",children:p})]})};c=o("85Hg2");const yF=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,TENANT_ALREADY_EXISTS:-6,TENANT_MISSING_DESCRIPTION:-7,TENANT_CANT_SET_COMPLETION_PROVIDER:-8,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_TOO_MANY_ATTEMPTS:-38,USER_MUST_ACCEPT_TNC_AND_PP:-39,USER_BIRTH_DATE_CANT_BE_CHANGED:-40,USER_CANT_SET_COMPLETION_PROVIDER:-41,USER_CANT_ENABLE_DEEP_THOUGHT:-42,USER_CANT_ENABLE_DCM_INTEGRATION:-43,USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS:-44,MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS:-45,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,SESSION_EXPIRED:-103,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_DEEP_THOUGHT_REQUIRES_COMPLETIONS:-215,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,MEMORI_FEATURE_REQUIRES_SUBSCRIPTION:-271,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,NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD:-1001,PROCESS_INVALID_TYPE:-1401,PROCESS_ALREADY_RUNNING:-1401,PROCESS_NOT_FOUND:-1402,IMPORTCSV_MISSING_ROWS:-1501,IMPORTCSV_MISSING_CSV:-1502,IMPORTCSV_MISSING_SEPARATOR:-1503,IMPORTCSV_INVALID_SEPARATOR:-1504,IMPORTCSV_MISSING_HEADERS:-1505,IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR:-1506,IMPORTCSV_UNDETECTABLE_CHAR_ENCODING:-1521,IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI:-1531,IMPORTTXT_MISSING_ROWS:-1601,IMPORTTXT_INVALID_GRANULARITY:-1602,IMPORTTXT_UNDETECTABLE_CHAR_ENCODING:-1621,IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI:-1631,IMPORTTXT_IMPORT_LIMIT_EXCEEDED:-1632,IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY:-1633,IMPORTTXT_IMPORT_REQUIRES_PAYING:-1634,EXPORTCSV_MISSING_CSV_SPECS:-1801,EXPORTCSV_MISSING_SEPARATOR:-1802,EXPORTCSV_INVALID_SEPARATOR:-1803,EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR:-1804,EXPORTCSV_MISSING_NEW_LINE_CHAR:-1805,EXPORTCSV_INVALID_NEW_LINE_CHAR:-1806,EXPORTCSV_MISSING_PASSWORD:-1811,EXPORTJSONL_MISSING_JSONL_SPECS:-1821,EXPORTJSONL_MISSING_PLATFORM:-1822,EXPORTJSONL_INVALID_PLATFORM:-1823,EXPORTJSONL_MISSING_PASSWORD:-1831,EXPORTJSONL_EXPORT_REQUIRES_PAYING:-1832,ANALYSIS_MISSING_QUERY:-1901,ANALYSIS_CANT_ANALYZE_SECRET_MEMORI:-1902,ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT:-1903,BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS:-2001,BADGE_ASSIGNMENT_MISSING_REF_ID:-2002,BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND:-2003,BADGE_ASSIGNMENT_MISSING_ASSERTION_URL:-2004,BADGE_ASSIGNMENT_MISSING_BADGE_URL:-2005,BADGE_ASSIGNMENT_MISSING_ISSUER_URL:-2006,BADGE_ASSIGNMENT_INVALID_URL:-2007,BADGE_ASSIGNMENT_MISSING_RECIPIENT:-2021,BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE:-2022,BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY:-2023,BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE:-2024,BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE:-2025,BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY:-2026,BADGE_NOT_FOUND:-2051,OUTCOME_NO_DCM_CONFIGURED:-2071,OUTCOME_USER_BADGES_DISABLED:-2072}).map((([e,t])=>[t,e]))),bF=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=yF.get(e);return t?`errors.${t}`:"error.generic"};var SF=({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 xF=({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 wF=({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 CF=({apiURL:e,sessionID:n,memori:r,visible:i=!0,initialKnownFacts:o=[],closeDrawer:a})=>{var l;const{t:u}=be(),d=J(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(ws).error(u(bF(a.resultCode))))}catch(e){console.error("KNOWN_FACTS/FETCH",e),m(null!=o?o:[])}C(!1)}};(0,c.useEffect)((()=>{A()}),[]);const[E,_]=(0,c.useState)(!1),[M,T]=(0,c.useState)(),[I,R]=(0,c.useState)([]);return(0,s.jsxs)(cF,{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)(Jc,{spinning:w,children:[(0,s.jsxs)("div",{className:"memori-known-facts-actions",children:[(0,s.jsxs)(Ba,{primary:!0,danger:!0,onClick:()=>{_(!0)},className:"memori-known-facts-delete-selected",disabled:0===(null==I?void 0:I.length),icon:(0,s.jsx)(SF,{}),loading:w,children:[u("selected")," (",null==I?void 0:I.length,")"]}),(0,s.jsx)(Yc,{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:()=>{_(!1)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ba,{ghost:!0,onClick:()=>{_(!1)},children:u("cancel")}),(0,s.jsx)(Ba,{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(ws).success(u("knownFacts.deleteSuccess")),R([]),A(),_(!1);else{let n=e.find((e=>0!==e.resultCode));console.error(n),void 0!==(null==n?void 0:n.resultCode)&&t(ws).error(u(bF(null==n?void 0:n.resultCode)))}}))}catch(e){let n=e;t(ws).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)(Ba,{shape:"circle",disabled:0===y||y<g,padded:!1,title:u("previous")||"Previous",icon:(0,s.jsx)(xF,{}),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)(Ba,{shape:"circle",padded:!1,title:u("next")||"Next",icon:(0,s.jsx)(wF,{}),disabled:(y/g+1)*g>=S,onClick:()=>{let e=(y/g+1)*g;b(e),A(void 0,e,g)}})]}),(0,s.jsx)(dF,{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)(uF,{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)(uF,{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)(Ba,{danger:!0,ghost:!0,shape:"circle",icon:(0,s.jsx)(SF,{}),disabled:(null==I?void 0:I.length)>0,title:u("delete")||"Delete",onClick:()=>T(e.knownFactID)}),(0,s.jsx)(Yc,{className:"memori-known-facts-modal",open:M===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)(Ba,{ghost:!0,onClick:()=>{T(void 0)},children:u("cancel")}),(0,s.jsx)(Ba,{primary:!0,danger:!0,onClick:async()=>{try{const r=await h(n,e.knownFactID);0===r.resultCode?(t(ws).success(u("knownFacts.deleteSuccess")),R([]),A(),T(void 0)):(console.error(r),t(ws).error(u(bF(r.resultCode),{ns:"common"})))}catch(e){let n=e;t(ws).error(u("Error")+n.message)}},children:u("confirm")})]})})]})})]},e.knownFactID)))})]})]})]})};var AF=({open:e=!1,baseUrl:t,apiUrl:n,tenant:r,experts:i,onClose:o})=>{const{t:a}=be();return(0,s.jsx)(cF,{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=Ad({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)))})})};c=o("85Hg2");const EF=/^\w+([.-]?[+]?\w+)*@\w+([.-]?\w+)*(\.\w{2,})+$/;var _F=({open:e=!1,onClose:n,onLogin:r,onLogout:i,user:o,loginToken:a,tenant:l,apiUrl:u,__TEST__needMissingData:d=!1})=>{var p;const{t:h,i18n:f}=be(),m="it"===f.language?"it":"en",g=J(u),{userLogin:v,updateUser:y}=g.backend,[b,S]=(0,c.useState)(!1),[x,w]=(0,c.useState)(d?{token:"token",birthDate:!0,tnCAndPPAccepted:!0}:{}),[C,A]=(0,c.useState)(null),[E,_]=(0,c.useState)(null);(0,c.useEffect)((()=>{_(window.location.href)}),[]);const M=(null==o?void 0:o.userID)&&a;return(0,s.jsx)(cF,{open:e,onClose:n,className:t(Ss)("memori--login-drawer",{"memori--login-drawer--logged":M}),title:(0,s.jsx)("h2",{className:"memori--login-drawer--title",children:M?h("login.loggedDrawerTitle",{name:o.userName}):h("login.loginDrawerTitle")}),children:M?(0,s.jsx)("div",{className:"memori--login-drawer--logged",children:(0,s.jsx)(Ba,{primary:!0,onClick:()=>{i()},children:h("login.logout")})}):(null===(p=null==x?void 0:x.token)||void 0===p?void 0:p.length)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{children:h("login.missingData")}),(0,s.jsx)("p",{children:h("login.missingDataHelper")}),(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:async e=>{var n,i,s;e.preventDefault();const a=e.currentTarget,l=null===(n=a.birthDate)||void 0===n?void 0:n.value,c=null===(i=a.tnCAndPPAccepted)||void 0===i?void 0:i.checked,u=null===(s=a.pAndCUAccepted)||void 0===s?void 0:s.checked;if(!(null==o?void 0:o.userID)||!(null==x?void 0:x.token))return;if(!l||!c)return void A(h("missingData"));let d={userID:o.userID,birthDate:(null==o?void 0:o.birthDate)||!x.birthDate?void 0:l,tnCAndPPAccepted:c||(null==o?void 0:o.tnCAndPPAccepted),tnCAndPPAcceptanceDate:c?(new Date).toISOString():void 0,pAndCUAccepted:u||(null==o?void 0:o.pAndCUAccepted),pAndCUAcceptanceDate:u?(new Date).toISOString():void 0};const{user:p,...f}=await y(x.token,o.userID,d);0!==f.resultCode?(console.error(f),t(ws).error(h(bF(f.resultCode),{ns:"common"})),A(f.resultMessage)):(t(ws).success(h("success")),r(p||d,x.token))},children:[x.birthDate&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{htmlFor:"#birthDate",children:[h("login.birthDate"),(0,s.jsx)("input",{id:"birthDate",name:"birthDate",type:"date",required:!0,autoComplete:"bday"})]}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:h("login.birthDateHelper")})})]}),(null==x?void 0:x.tnCAndPPAccepted)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"tnCAndPPAccepted",className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[h("login.privacyLabel")," ",(0,s.jsx)("a",{href:`https://memori.ai/${m}/privacy_and_cookie`,target:"_blank",rel:"noopener noreferrer",children:h("login.privacyAndCookiePolicy")})," ",h("login.and")," ",(0,s.jsx)("a",{href:`https://memori.ai/${m}/tos`,target:"_blank",rel:"noopener noreferrer",children:h("login.termsOfService")})]})]}),(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"pAndCUAccepted",defaultChecked:null==o?void 0:o.pAndCUAccepted,className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[h("login.pAndCUAccepted")," ",(0,s.jsx)("small",{children:(0,s.jsxs)("em",{children:["(",h("login.optional"),")"]})})]})]}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:h("login.goToAccountToChangeYourPreferences")})}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:h("login.deepThoughtExplaination")})})]}),(0,s.jsx)(Ba,{htmlType:"submit",primary:!0,loading:b,children:h("login.save")})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:e=>{e.preventDefault();const n=e.currentTarget,i=n.userNameOrEmail.value,o=n.password.value,s=EF.test(i)?{tenant:null==l?void 0:l.id,eMail:i,password:o}:{tenant:null==l?void 0:l.id,userName:i,password:o};S(!0),A(null),v(s).then((e=>{var n,i,o,s;0!==e.resultCode?(console.error(e),t(ws).error(h(bF(e.resultCode),{ns:"common"})),A(e.resultMessage)):e.user&&e.token&&(r(e.user,e.token),(null===(n=e.user)||void 0===n?void 0:n.tnCAndPPAccepted)&&(null===(i=e.user)||void 0===i?void 0:i.birthDate)||w({token:e.token,birthDate:!(null===(o=e.user)||void 0===o?void 0:o.birthDate),tnCAndPPAccepted:!(null===(s=e.user)||void 0===s?void 0:s.tnCAndPPAccepted)}))})).catch((e=>{console.error("[LOGIN]",e),t(ws).error(e),e.message&&A(e.message)})).finally((()=>{S(!1)}))},children:[(0,s.jsxs)("label",{htmlFor:"#userNameOrEmail",children:[h("login.userNameOrEmail"),(0,s.jsx)("input",{id:"userNameOrEmail",name:"userNameOrEmail",required:!0,autoComplete:"email",placeholder:"Username/email"})]}),(0,s.jsxs)("label",{htmlFor:"#password",children:["Password",(0,s.jsx)("input",{id:"password",name:"password",type:"password",required:!0,autoComplete:"password",placeholder:"Password"})]}),(0,s.jsx)(Ba,{htmlType:"submit",primary:!0,loading:b,children:h("login.login")}),(null==l?void 0:l.disableRegistration)?l.adminEmail?(0,s.jsxs)("div",{className:"memori--login-drawer--signup",children:[(0,s.jsx)("p",{children:h("login.registrationDisabled")}),(0,s.jsxs)("p",{children:[h("login.contactAdmin"),":"," ",(0,s.jsx)("a",{href:`mailto:${l.adminEmail}`,children:l.adminEmail})]})]}):null:(0,s.jsxs)("p",{className:"memori--login-drawer--signup",children:[h("login.newUserSignUp")," ",(0,s.jsx)("a",{href:`https://${l.name||"www.aisuru.com"}/${m}/auth?signup=1&redirectTo=${E}`,children:h("login.signUp")})]})]}),C&&(0,s.jsx)("p",{role:"alert",className:"memori--login-drawer--error",children:C})]})})};var MF=({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)(Jc,{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 TF=({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)(Jc,{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 IF=({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)(Jc,{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 RF=({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}=be(),[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]),_=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)(Ba,{className:"memori-website_assistant--trigger-button",ghost:!0,shape:"circle",onClick:()=>_(!1),title:S("expand")||"Expand",children:(0,s.jsx)(iN,{avatar:null==r?void 0:r.memori.avatarURL})})}):(0,s.jsxs)(s.Fragment,{children:[u,(0,s.jsxs)(Jc,{spinning:g,className:"memori-website_assistant-layout",children:[v,(0,s.jsx)("div",{className:"memori-website_assistant--close-button-wrapper",children:(0,s.jsx)(Ba,{className:"memori-website_assistant--close-button",primary:!0,shape:"circle",onClick:()=>_(!0),icon:(0,s.jsx)(Qc,{}),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:PF,getStatistics:kF,initSession:OF}=J(),NF=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,"🧠"]]),DF=e=>{const t=Array.from(NF.keys()).filter((t=>t<=e));if(t.length>0){const e=t[t.length-1];return NF.get(e)}return""},LF=e=>{if("🆕"===e)return{points:10,badge:"🐹"};let t,n,r=!1;for(const[i,o]of NF){if(r){t=i,n=o;break}o===e&&(r=!0)}return n&&t?{points:t,badge:n}:void 0},BF=e=>{let t=0;for(const[n,r]of NF)if(r===e){t=n;break}return t},zF=e=>{const t=Math.round(e),n=DF(t);return{points:t,badge:n,pointsForCurrentBadge:BF(n),nextBadge:LF(n)}},UF=(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 FF,jF,HF,GF,VF,WF;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=UF,window.typeMessageHidden=(e,t=!0,n,r=!1,i=!1)=>UF(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),UF(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 qF,KF=!1,JF=!1;var QF=({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,showLogin:S=!1,showOnlyLastMessages:x,height:w="100vh",secret:C,baseUrl:A="https://aisuru.com",apiUrl:E="https://backend.memori.ai",initialContextVars:_,initialQuestion:M,ogImage:T,sessionID:I,tenant:R,personification:P,authToken:k,AZURE_COGNITIVE_SERVICES_TTS_KEY:O,defaultSpeakerActive:N=!0,onStateChange:D,additionalInfo:L,additionalSettings:B,customMediaRenderer:z,userAvatar:U})=>{var F,j,H,G,V,W,q,K,Q,Y,X,$,Z,ee,te,ne,re,ie,oe,se,ae,le,ce,ue;const{t:de,i18n:pe}=be(),[he,fe]=(0,c.useState)(!1);(0,c.useEffect)((()=>{fe(!0)}),[]);const me=J(E),{initSession:ge,postTextEnteredEvent:ve,postPlaceChangedEvent:ye,postTimeoutEvent:Se,postTagChangedEvent:xe,getSession:we,getContentQualityIndexes:Ce,getExpertReferences:Ae}=me,[Ee,_e]=(0,c.useState)(!1),[Me,Te]=(0,c.useState)(null!==(F=null==L?void 0:L.loginToken)&&void 0!==F?F:k),[Ie,Re]=(0,c.useState)({avatarURL:"string"==typeof U?U:void 0});(0,c.useEffect)((()=>{Me&&!(null==Ie?void 0:Ie.userID)&&S&&me.backend.getCurrentUser(Me).then((({user:e,resultCode:t})=>{e&&0===t?(Re(e),fF("loginToken",Me)):mF("loginToken")}))}),[Me,null==Ie?void 0:Ie.userID]);const[Pe,ke]=(0,c.useState)(!1),[Oe,Ne]=(0,c.useState)(!1),[De,Le]=(0,c.useState)(!1),Be=(null===(G=null===(H=null===(j=e.culture)||void 0===j?void 0:j.split("-"))||void 0===H?void 0:H[0])||void 0===G?void 0:G.toUpperCase())||(null===(K=null===(q=null===(W=null===(V=null==n?void 0:n.find((t=>t.memoriConfigID===e.memoriConfigurationID)))||void 0===V?void 0:V.culture)||void 0===W?void 0:W.split("-"))||void 0===q?void 0:q[0])||void 0===K?void 0:K.toUpperCase()),ze=(null==o?void 0:o.customData)?JSON.parse(o.customData):null,Ue=void 0!==i?i:!!(null==ze?void 0:ze.multilanguage),[Fe,je]=(0,c.useState)(null!==($=null!==(X=null!==(Y=null!==(Q=null!=r?r:null==ze?void 0:ze.lang)&&void 0!==Q?Q:Be)&&void 0!==Y?Y:null==ze?void 0:ze.uiLang)&&void 0!==X?X:pe.language)&&void 0!==$?$:"IT"),[He,Ge]=(0,c.useState)(!1),[Ve,We]=(0,c.useState)(!1),[qe,Ke]=(0,c.useState)(),Je=a||(null==ze?void 0:ze.layout)||"DEFAULT",[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)(!1),[at,lt]=(0,c.useState)(!N),[ct,ut]=(0,c.useState)(!1),[dt,pt]=(0,c.useState)(2),[ht,ft]=(0,c.useState)(!1),[mt,gt]=(0,c.useState)("center"),[vt,yt]=(0,c.useState)(!1);(0,c.useEffect)((()=>{ft(!!HF),JF=!!HF}),[HF]),(0,c.useEffect)((()=>{let e="bottom",t=hF("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",lt(hF("muteSpeaker",!N)),KF=hF("muteSpeaker",!N),ut("CONTINUOUS"===t),pt(hF("continuousSpeechTimeout",2)),gt(hF("controlsPosition",e)),yt(hF("hideEmissions",!1)),(null==L?void 0:L.loginToken)||k||(Te(hF("loginToken",void 0)),qF=hF("loginToken",void 0))}),[]);const[bt,St]=(0,c.useState)(C),[xt,wt]=(0,c.useState)(),[Ct,At]=(0,c.useState)(null),[Et,_t]=(0,c.useState)(),Mt=async(e,t)=>{var n;const r=null!=t?t:Ht;if(e&&r){const{currentState:t,...i}=await ye({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&&qt({...Vt,...t})}},[Tt,It]=(0,c.useState)(""),[Rt,Pt]=(0,c.useState)(!1),[kt,Ot]=(0,c.useState)([]),Nt=e=>{Ot((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:[]}]}))},Dt=async(n,r,i,o=!0,s,a=!1,l,c=!1,u=!1)=>{var d,p,h,f;const m=i||Ht||(null===(d=window.getMemoriState())||void 0===d?void 0:d.sessionID);if(!m||!(null==n?void 0:n.length))return;a||Nt({text:n,translatedText:s,fromUser:!0,media:null!=r?r:[],initial:Ht?!!i&&i!==Ht:!!i}),We(!0),Ke(l);let g=n,v=!1;if(o&&!Ee&&Ue&&Fe.toUpperCase()!==Be.toUpperCase()){g=(await up(n,Be,Fe,A)).text}const{currentState:y,...b}=await ve({sessionId:m,text:g});if(0===b.resultCode&&y){const n=c&&l?l:null!==(p=y.emission)&&void 0!==p?p:null==Vt?void 0:Vt.emission;if("X4"===y.state&&e.giverTag){const{currentState:r,...i}=await xe(m,e.giverTag);0===i.resultCode?(qt(r),n&&(Nt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),cn(n))):(console.error(b,i),t(ws).error(de(bF(i.resultCode))),v=!0)}else if("X2d"===y.state&&e.giverTag){const{currentState:r,...i}=await ve({sessionId:m,text:Math.random().toString().substring(2,8)});if(0===i.resultCode){const{currentState:r,...i}=await xe(m,e.giverTag);0===i.resultCode?(qt(r),n&&(Nt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),cn(n))):(console.error(b,i),t(ws).error(de(bF(i.resultCode))),v=!0)}else console.error(b,i),t(ws).error(de(bF(i.resultCode))),v=!0}else Fe.toLowerCase()!==Be.toLowerCase()&&n&&!Ee&&Ue?Lt(y,Fe).then((e=>{e.emission&&cn(e.emission)})):(qt({...y,emission:n}),n&&(Nt({text:n,emitter:y.emitter,media:y.media,fromUser:!1,generatedByAI:!!y.completion}),cn(n)))}else 404===b.resultCode&&(Ot((e=>[...e.slice(0,e.length-1)])),Jt(!1,bt||e.secretToken,xt,Ee&&e.giverTag?e.giverTag:void 0,Ee&&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())||"",..._||{}},M).then((e=>{console.info("session timeout"),(null==e?void 0:e.sessionID)&&setTimeout((()=>{Dt(n,r,null==e?void 0:e.sessionID)}),500)})));u||(Ke(void 0),We(!1))},Lt=async(e,t)=>{var n,r,i;const o=null!==(n=e.emission)&&void 0!==n?n:null==Vt?void 0:Vt.emission;let s={...e},a=null;if(o&&!Ee&&Be.toUpperCase()!==t.toUpperCase()&&Ue){const n=await up(o,t,Be,A);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 up(e,t,Be,A);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==Vt?void 0:Vt.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 qt(s),a&&Nt(a),s},Bt=void 0!==e.ageRestriction?e.ageRestriction:e.nsfw?18:e.enableCompletions?14:0,[zt,Ut]=(0,c.useState)(),[Ft,jt]=(0,c.useState)(!1),[Ht,Gt]=(0,c.useState)(I),[Vt,Wt]=(0,c.useState)(),qt=e=>{var t;Wt(e),D&&D(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)}}))},Kt=async n=>{var r,i,o,s,a;let l=hF("birthDate",void 0);if(zt||l||!Bt)if("PUBLIC"===e.privacyType||e.secretToken||bt||xt){Ge(!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 ge({...n,tag:null!==(i=n.tag)&&void 0!==i?i:null==P?void 0:P.tag,pin:null!==(o=n.pin)&&void 0!==o?o:null==P?void 0:P.pin,additionalInfo:{...L||{},loginToken:null!==(a=null!==(s=null!=qF?qF:Me)&&void 0!==s?s:null==L?void 0:L.loginToken)&&void 0!==a?a:k,language:on(Fe),referral:l}});if((null==c?void 0:c.sessionID)&&(null==c?void 0:c.currentState)&&0===c.resultCode)return Gt(c.sessionID),Et&&Mt(Et,c.sessionID),Ge(!1),{dialogState:c.currentState,sessionID:c.sessionID};(null==c?void 0:c.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(c),t(ws).error(de("underageTwinSession",{age:Bt})),Le(!0)):403===(null==c?void 0:c.resultCode)?(St(void 0),At("password")):(console.error(c),t(ws).error(de(bF(null==c?void 0:c.resultCode))),Le(!0))}catch(e){console.error(e),new Error("Error fetching session")}}else At("password");else jt(!0)},Jt=async(n=!1,r,i,o,s,a,l,c)=>{var u,d,p,h,f;Ge(!0);try{let m,g=hF("birthDate",void 0);if(!c&&!g&&Bt)return void jt(!0);if(!("PUBLIC"===e.privacyType||r||e.secretToken||bt||i||xt))return void At("password");try{m=window.location.href}catch(e){console.error(e)}const{sessionID:v,currentState:y,...b}=await ge({memoriID:null!==(u=e.engineMemoriID)&&void 0!==u?u:"",password:r||bt||e.secretToken,recoveryTokens:i||xt,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:{...L||{},loginToken:null!==(f=null!==(h=null!=qF?qF:Me)&&void 0!==h?h:null==L?void 0:L.loginToken)&&void 0!==f?f:k,language:on(Fe),referral:m}});if(v&&y&&0===b.resultCode)return Gt(v),n&&(qt(y),y.emission&&(kt.length<=1?Ot([{text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}]):Nt({text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}))),Et&&Mt(Et,v),Ge(!1),{dialogState:y,sessionID:v};(null==b?void 0:b.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(b),t(ws).error(de("underageTwinSession",{age:Bt})),Le(!0)):403===(null==b?void 0:b.resultCode)?(St(void 0),At("password")):(console.error(b),t(ws).error(de(bF(b.resultCode))),Le(!0))}catch(e){console.error(e)}return Ge(!1),null},Qt=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 xe(n,null!=r?r:pp);if(0===u){let d=0;if(r!==pp&&i&&("X1a"===t.state||"X1b"===t.state)){const{resultCode:e}=await ve({sessionId:n,text:null!=i?i:""});d=e}if(0===d){const{currentState:e,...t}=await we(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=hF("birthDate",void 0);try{t=window.location.href}catch(e){console.error(e)}Kt({memoriID:null!==(o=e.engineMemoriID)&&void 0!==o?o:"",password:C||bt||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())||"",..._||{}},initialQuestion:M,birthDate:zt||n||void 0,additionalInfo:{...L||{},loginToken:null!==(c=null!==(l=null!=qF?qF:Me)&&void 0!==l?l:null==L?void 0:L.loginToken)&&void 0!==c?c:k,language:on(Fe),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)((()=>()=>{Vt&&(null==Vt?void 0:Vt.currentTag)===e.giverTag||(async()=>{Ht&&e.giverTag&&e.giverPIN&&(Ot([]),await Qt(e.engineMemoriID,Ht,e.giverTag,e.giverPIN))})()}),[]);const[Yt,Xt]=(0,c.useState)(),$t=(0,c.useRef)(),Zt=()=>{Yt&&(clearTimeout(Yt),Xt(void 0)),(null==$t?void 0:$t.current)&&(clearTimeout($t.current),$t.current=void 0)},en=()=>{Zt(),!(null==Vt?void 0:Vt.acceptsTimeout)||HF||ht||Tt.length||Ve||Rt||nn()},tn=async()=>{var e;if(HF||ht||Tt.length||Ve||Rt)en();else if(Ht&&Qe&&(null==Vt?void 0:Vt.acceptsTimeout)){const{currentState:t,...n}=await Se(Ht);if(0===n.resultCode&&t){const n=t.emission;!Ee&&Ue&&Fe!==(null==pe?void 0:pe.language)&&n&&n.length>0?Lt({...t,emission:n},Fe).then((e=>{e.emission&&cn(e.emission)})):n&&n.length>0&&(Nt({text:n,emitter:t.emitter,media:t.media,fromUser:!1,generatedByAI:!!t.completion}),cn(n),qt({...t,hints:null!==(e=t.hints)&&void 0!==e?e:"G1"===t.state?null==Vt?void 0:Vt.hints:[]}))}}},nn=()=>{let e=null==Vt?void 0:Vt.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==Vt?void 0:Vt.emission){e+=Vt.emission.length/26.5}}let t=setTimeout(tn,1e3*e);Xt(t),$t.current=t};(0,c.useEffect)((()=>{(Tt.length||ht||Ve)&&Zt(),Ht&&!Tt.length&&en()}),[null==Vt?void 0:Vt.acceptsTimeout,null==Vt?void 0:Vt.timeout,null==Vt?void 0:Vt.state,ht,Ht,kt,Tt,Ve]),(0,c.useEffect)((()=>()=>{Ye(!1),Ne(!1),Zt(),$t.current=void 0}),[]);const rn=(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:pe.language)&&void 0!==o?o:"IT").toUpperCase(),l=e.voiceType;if(e.enableBoardOfExperts&&(null==Vt?void 0:Vt.emitter)){null==Fn||Fn.find((e=>e.name===(null==Vt?void 0:Vt.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==Vt?void 0:Vt.emitter,pe.language,e.culture]),on=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])||pe.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},[sn,an]=(0,c.useState)();(0,c.useEffect)((()=>{(async()=>{try{const e=await fetch(`${A||"https://aisuru.com"}/api/lexiconmap`);return await e.json()}catch(e){console.error(e)}})().then((e=>{an(e)}))}),[]);const ln=()=>{const e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e)},cn=e=>{if(!O||p)return void ln();if(bn(),p)return;if(at||KF)return JF=!1,We(!1),ln(),void(ct&&gn());GF&&GF.pause();let t=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),n=/iPad|iPhone|iPod/.test(navigator.userAgent);if("interrupted"===VF.state)return void VF.resume().then((()=>cn(e)));if("closed"===VF.state){VF=new Ko;let e=VF.createBuffer(1,1e4,22050),t=VF.createBufferSource();t.buffer=e,t.connect(VF.destination)}else if("suspended"===VF.state){un(),VF=new Ko;let e=VF.createBuffer(1,1e4,22050),t=VF.createBufferSource();t.buffer=e,t.connect(VF.destination)}if(!HF){n||(GF=new vs.SpeakerAudioDestination);let e=vs.AudioConfig.fromSpeakerOutput(GF);HF=new vs.SpeechSynthesizer(jF,e)}const r=VF.createBufferSource();r.addEventListener("ended",(()=>{ft(!1),JF=!1})),GF.onAudioEnd=()=>{ft(!1),JF=!1,r.disconnect(),ln(),An()},HF.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="${on(Fe)}"><voice name="${rn(Fe)}"><s>${((e,t)=>{var n;if(!sn)return e;const r={...null!==(n=sn.common)&&void 0!==n?n:{},...(null==R?void 0:R.id)&&sn[R.id]?sn[R.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})(wd(e)),Fe.toLowerCase())}</s></voice></speak>`,(i=>{if(i){ft(!0),JF=!0;try{VF.decodeAudioData(i.audioData,(function(e){r.buffer=e,r.connect(VF.destination),(kt.length<1||t&&n)&&r.start(0)})),VF.onstatechange=()=>{"suspended"===VF.state||"closed"===VF.state?(r.disconnect(),ft(!1),JF=!1):"interrupted"===VF.state&&VF.resume()},VF.resume(),HF&&(HF.close(),HF=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),ft(!1),JF=!1,HF&&(HF.close(),HF=null),ln()}}else VF.resume(),ft(!1),JF=!1,ln()}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),ft(!1),JF=!1,ln()})),We(!1)},un=()=>{ft(!1),JF=!1;try{HF&&(HF.close(),HF=null),"closed"!==VF.state&&VF.close(),GF&&(GF.pause(),GF.close())}catch(e){console.error("stopAudio error: ",e)}};(0,c.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==Vt?void 0:Vt.emission]);const[dn,pn]=(0,c.useState)(""),hn=()=>pn(""),[fn,mn]=(0,c.useState)(null),gn=()=>{let e=setTimeout((async()=>{Sn();const e=xd(dn);e.length>0&&Rt?(Dt(e),hn(),It("")):Rt&&en()}),1e3*dt);mn(e)},vn=()=>{fn&&(clearTimeout(fn),mn(null))};(0,c.useEffect)((()=>{vn(),ct&&gn(),en()}),[dn]);const yn=()=>{if(O){Sn(),pn(""),hn();try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){$e(!0),jF||(jF=vs.SpeechConfig.fromSubscription(O,"eastus"),jF.speechRecognitionLanguage=on(Fe),jF.speechSynthesisLanguage=on(Fe),jF.speechSynthesisVoiceName=rn(Fe));const t=vs.AudioConfig.fromDefaultMicrophoneInput();FF=new vs.SpeechRecognizer(jF,t),Pt(!0),FF.recognized=(e,t)=>{if(t.result.text)if(t.result.reason===vs.ResultReason.RecognizedSpeech){let e=t.result.text;if(pn(e||""),(null==e?void 0:e.length)>0){const t=xd(e);t.length>0&&It((e=>`${e} ${t}`))}}else t.result.reason===vs.ResultReason.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},FF.canceled=(e,t)=>{t.reason===vs.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?")),bn()},FF.sessionStopped=(e,t)=>{bn()},hn(),FF.startContinuousRecognitionAsync()})).catch(console.error)}catch(e){console.error(e)}}},bn=()=>{FF&&(FF.stopContinuousRecognitionAsync(),FF.close(),FF=null),Pt(!1)},Sn=()=>{$e(!1),bn(),vn()},xn=()=>{try{Sn(),Zt(),Ne(!1),$t.current=void 0,un()}catch(e){console.log("Error: resetUIEffects",e)}};(0,c.useEffect)((()=>()=>{xn()}),[]),(0,c.useEffect)((()=>(document.addEventListener("MemoriResetUIEffects",xn),()=>{document.removeEventListener("MemoriResetUIEffects",xn)})),[]),(0,c.useEffect)((()=>{"Z0"===(null==Vt?void 0:Vt.state)&&Sn()}),[null==Vt?void 0:Vt.state]);const[wn,Cn]=(0,c.useState)(!1),An=(0,c.useCallback)((e=>{ht&&HF&&(HF.close(),HF=null),!ct||!Xe&&wn||(Cn(!0),yn())}),[ct,Xe]);(0,c.useEffect)((()=>{kt.length>1&&!ht&&ct&&(Xe||!wn)?yn():ht&&Rt&&bn()}),[ht]),(0,c.useEffect)((()=>{Rt&&(Sn(),hn(),It(""),yn())}),[Be]);const[En,_n]=(0,c.useState)("keypress");(0,c.useEffect)((()=>{const e=hF("sendOnEnter","keypress");window.innerWidth<=768?_n("click"):_n(e)}),[]),(0,c.useEffect)((()=>{fF("sendOnEnter",En)}),[En]);const[Mn,Tn]=(0,c.useState)(),In=null==ze?void 0:ze.globalBackground,Rn=In?`url(${In})`:null,Pn=o?{"--memori-chat-bubble-bg":"#fff",...ze&&!u?{"--memori-text-color":null!==(Z=ze.textColor)&&void 0!==Z?Z:"#000"}:{},...(null==ze?void 0:ze.buttonBgColor)?{"--memori-button-bg":ze.buttonBgColor,"--memori-primary":ze.buttonBgColor}:{},...(null==ze?void 0:ze.buttonTextColor)?{"--memori-button-text":ze.buttonTextColor}:{},...(null==ze?void 0:ze.blurBackground)?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...(null==ze?void 0:ze.innerBgColor)?{"--memori-inner-bg":`rgba(${"dark"===ze.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(ee=ze.innerBgAlpha)&&void 0!==ee?ee:.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===ze.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(te=null==ze?void 0:ze.innerBgAlpha)&&void 0!==te?te:.4})`}:{"--memori-inner-content-pad":"0px"}}:{},kn=`\n ${p?"#preview,":"WEBSITE_ASSISTANT"===Je?"":":root,"} .memori-widget {\n ${Object.entries(Pn).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,On=void 0===(null==ze?void 0:ze.showAIicon)||(null==ze?void 0:ze.showAIicon),[Nn,Dn]=(0,c.useState)(!1);(0,c.useEffect)((()=>{(window.innerWidth>=768&&"FULLPAGE"===Je||"FULLPAGE"!==Je)&&Dn(!0)}),[]);const[Ln,Bn]=(0,c.useState)();(0,c.useEffect)((()=>{e.engineMemoriID&&(async e=>{let t,n;try{const{contentQualityIndex:r,answerQualityIndex:i,unansweredQuestions:o,...s}=await Ce(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=>{Bn(zF(e.points))})).catch(console.error)}),[e.engineMemoriID]),(0,c.useEffect)((()=>{if(null==ze?void 0:ze.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",ze.seoTitle),document.head.append(e)}if(null==ze?void 0:ze.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",ze.seoDescription),document.head.append(e)}if(null==ze?void 0:ze.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",ze.seoUrl),document.head.append(e)}let t=T||e.avatarURL;if((null==ze?void 0:ze.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}}),[ze,e.avatarURL,T]);const zn=(0,c.useCallback)((e=>{const{text:t,waitForPrevious:n,hidden:r,typingText:i,useLoaderTextAsMsg:o,hasBatchQueued:s}=e.detail;t&&(n&&!KF&&(JF||Ve)?setTimeout((()=>{zn(e)}),1e3):(bn(),un(),Dt(t,void 0,void 0,void 0,void 0,r,i,o,s)))}),[Ht,ht,Ve,Fe]);(0,c.useEffect)((()=>(document.addEventListener("MemoriTextEntered",zn),()=>{document.removeEventListener("MemoriTextEntered",zn)})),[Ht,Fe]);const Un=(0,c.useCallback)((async t=>{var n,r,i,o,s,a,l,c,u,d;const p=(null==t?void 0:t.sessionID)||Ht,h=(null==t?void 0:t.dialogState)||Vt;Ne(!0);let f=document.getElementById("memori-audio"),m=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome");f&&m&&(f.muted=!1,f.play().catch((e=>{console.error("error playing intro audio",e)})));let g=hF("birthDate",void 0),v=zt||g||void 0;if(p||!Bt||v){if(!p&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!bt&&!xt||!p&&De)return At("password"),void Ne(!1);if(!p){Ne(!1),Le(!1);const t=await Kt({memoriID:e.engineMemoriID,password:C||bt||e.secretToken,tag:null==P?void 0:P.tag,pin:null==P?void 0:P.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())||"",..._||{}},initialQuestion:M,birthDate:v,additionalInfo:{...L||{},loginToken:null!==(o=null!==(i=null!=qF?qF:Me)&&void 0!==i?i:null==L?void 0:L.loginToken)&&void 0!==o?o:k,language:on(Fe)}});return void((null==t?void 0:t.dialogState)?(Ot([]),Lt(t.dialogState,Fe).then((e=>{e.emission&&cn(e.emission)})).finally((()=>{Ye(!0)}))):await Un(t||void 0))}if(I){const{currentState:t,...n}=await we(p);if(0!==n.resultCode||!t)return console.debug("session expired, opening new session"),Le(!0),Gt(void 0),Ne(!1),void await Un();if(Ot([]),Ee&&e.giverTag&&(null==Vt?void 0:Vt.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await Qt(e.engineMemoriID,p,"-");const t=await Qt(e.engineMemoriID,p,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");Lt(t.currentState,Fe).then((e=>{e.emission&&cn(e.emission)})).finally((()=>{Ye(!0)}))}catch(t){console.error("session #2",t),Jt(!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===(a=null===(s=window.location.pathname)||void 0===s?void 0:s.split("/"))||void 0===a?void 0:a.pop())||"",..._||{}},M,v).then((()=>{Ye(!0)}))}else if(!Ee&&P&&(null==Vt?void 0:Vt.currentTag)!==P.tag)try{console.debug("change tag #3"),await Qt(e.engineMemoriID,p,"-");const t=await Qt(e.engineMemoriID,p,P.tag,P.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");Lt(t.currentState,Fe).then((e=>{e.emission&&cn(e.emission)})).finally((()=>{Ye(!0)}))}catch(t){console.error("session #5",t),Jt(!0,null==e?void 0:e.secretToken,void 0,P.tag,P.pin,{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())||"",..._||{}},M,v).then((()=>{Ye(!0)}))}else if(Ee||P||(null==Vt?void 0:Vt.currentTag)===pp)Lt(t,Fe).then((e=>{e.emission&&cn(e.emission)})).finally((()=>{Ye(!0)}));else try{console.debug("change tag #6"),await Qt(e.engineMemoriID,p,"-");const t=await Qt(e.engineMemoriID,p,pp);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");Lt(t.currentState,Fe).then((e=>{e.emission&&cn(e.emission)})).finally((()=>{Ye(!0)}))}catch(t){console.error("session #8",t),Jt(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,{PATHNAME:window.location.pathname,ROUTE:(null===(d=null===(u=window.location.pathname)||void 0===u?void 0:u.split("/"))||void 0===d?void 0:d.pop())||"",..._||{}},M,v).then((()=>{Ye(!0)}))}}else Ot([]),Lt(h,Fe).then((e=>{e.emission&&cn(e.emission)})).finally((()=>{Ye(!0)}))}else jt(!0),Ne(!1)}),[bt,e,xt,zt,Ht,Fe]);(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?(Te(t.target.getAttribute("authtoken")||void 0),qF=t.target.getAttribute("authtoken")||void 0):(Te((null===(i=null===(r=t.target)||void 0===r?void 0:r.parentElement)||void 0===i?void 0:i.getAttribute("authtoken"))||void 0),qF=t.target.getAttribute("authtoken")||void 0))}));return n.observe(t,{attributes:!0,childList:!1,subtree:!1}),()=>{n.disconnect()}}),[]);const[Fn,jn]=(0,c.useState)(),Hn=(0,c.useCallback)((async()=>{if(Ht&&(null==e?void 0:e.enableBoardOfExperts))try{const{experts:e,count:t,...n}=await Ae(Ht);0===n.resultCode?jn(e):console.warn("Error fetching experts",n)}catch(e){console.warn(e)}}),[Ht,null==e?void 0:e.enableBoardOfExperts]);(0,c.useEffect)((()=>{Hn()}),[Ht,Hn]);const Gn=void 0===x?"TOTEM"!==a&&"WEBSITE_ASSISTANT"!==a:!x,Vn={memori:e,tenant:R,history:kt,showShare:null===(ne=null!=d?d:null==ze?void 0:ze.showShare)||void 0===ne||ne,position:Et,setShowPositionDrawer:et,setShowSettingsDrawer:nt,setShowKnownFactsDrawer:it,setShowExpertsDrawer:st,showSpeaker:!!O,speakerMuted:at||KF,setSpeakerMuted:e=>{if(KF=!!e,lt(e),fF("muteSpeaker",!!e),e)un();else{VF=new Ko;let e=VF.createBuffer(1,1e4,22050),t=VF.createBufferSource();t.buffer=e,t.connect(VF.destination)}},showSettings:v,hasUserActivatedSpeak:Qe,showReload:"TOTEM"===Je,showClear:b,clearHistory:()=>Ot((e=>e.slice(-1))),showLogin:S,setShowLoginDrawer:ke,loginToken:Me,user:Ie,sessionID:Ht},Wn={memori:e,integration:o,integrationConfig:ze,tenant:R,instruct:Ee,avatar3dVisible:Nn,setAvatar3dVisible:Dn,hasUserActivatedSpeak:Qe,isPlayingAudio:ht&&!at,loading:!!Ve,baseUrl:A,apiUrl:E},qn={memori:e,tenant:R,gamificationLevel:Ln,language:Be,userLang:Fe,setUserLang:je,baseUrl:A,apiUrl:E,position:Et,openPositionDrawer:()=>et(!0),integrationConfig:ze,instruct:Ee,sessionId:Ht,clickedStart:Oe,onClickStart:Un,initializeTTS:()=>{if(!O)return;jF=vs.SpeechConfig.fromSubscription(O,"eastus"),jF.speechSynthesisLanguage=on(Fe),jF.speechSynthesisVoiceName=rn(Fe),jF.speechRecognitionLanguage=on(Fe),bd()&&(jF.speechSynthesisOutputFormat=vs.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3),VF=new Ko;let e=VF.createBuffer(1,1e4,22050),t=VF.createBufferSource();t.buffer=e,t.connect(VF.destination),GF=new vs.SpeakerAudioDestination;let n=vs.AudioConfig.fromSpeakerOutput(GF);HF=new vs.SpeechSynthesizer(jF,n)},isUserLoggedIn:!!Me&&!!(null==Ie?void 0:Ie.userID),showLogin:S,setShowLoginDrawer:ke,user:Ie},Kn={memori:e,sessionID:Ht||"",tenant:R,translateTo:Ue&&Fe.toUpperCase()!==(null===(ae=null!==(se=null!==(oe=null===(ie=null===(re=e.culture)||void 0===re?void 0:re.split("-"))||void 0===ie?void 0:ie[0])&&void 0!==oe?oe:pe.language)&&void 0!==se?se:"IT")||void 0===ae?void 0:ae.toUpperCase())?Fe:void 0,baseUrl:A,apiUrl:E,layout:a,memoriTyping:Ve,typingText:qe,showTypingText:y,history:Gn?kt:kt.slice(-2),authToken:null!==(ce=null!==(le=null!=Me?Me:qF)&&void 0!==le?le:null==L?void 0:L.loginToken)&&void 0!==ce?ce:k,dialogState:Vt,setDialogState:qt,pushMessage:Nt,simulateUserPrompt:(e,t)=>{bn(),un(),Dt(e,void 0,void 0,!1,t)},showDates:m,showContextPerLine:g,showAIicon:On,client:me,selectReceiverTag:async n=>{var r;if(Ht)try{const{currentState:i,...o}=await xe(Ht,n);if(0===o.resultCode)if(Nt({text:n,fromUser:!0}),"X4"===i.state&&e.giverTag){const{currentState:n,...r}=await me.postTagChangedEvent(Ht,e.giverTag);0===r.resultCode?(qt(n),n.emission&&Nt({text:n.emission,emitter:n.emitter,media:n.media,fromUser:!1})):(console.error(r),t(ws).error(de(bF(r.resultCode))))}else qt(i),i.emission&&Nt({text:i.emission,emitter:i.emitter,media:i.media,fromUser:!1});else console.error(o,n,null===(r=null==Vt?void 0:Vt.knownTags)||void 0===r?void 0:r[n]),t(ws).error(de(bF(o.resultCode)))}catch(e){let n=e;console.error(n),t(ws).error(n.message)}},preview:p,sendOnEnter:En,setSendOnEnter:_n,microphoneMode:ct?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen:Mn,setAttachmentsMenuOpen:Tn,instruct:Ee,showInputs:f,showMicrophone:!!O,userMessage:Tt,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return It(""),void en();It(e),Zt()},sendMessage:e=>{un(),bn(),Dt(e),It(""),hn()},stopListening:Sn,startListening:yn,stopAudio:un,resetTranscript:hn,listening:Rt,isPlayingAudio:ht,customMediaRenderer:z,user:Ie,userAvatar:U,experts:Fn},Jn=o&&Rn?(0,s.jsx)("div",{className:"memori--global-background",children:(0,s.jsx)("div",{className:"memori--global-background-image",style:{backgroundImage:Rn}})}):(0,s.jsx)("div",{className:"memori--global-background no-background-image"}),Qn=o?(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:kn}}):null,Yn={canInstruct:!!e.giverTag,instruct:!!Ee,onChangeMode:e=>{_e("instruct"===e),Ye(!1),Ne(!1)}},Xn=(0,s.jsx)(mD,{tenant:R,userLang:Fe,integrationID:null==o?void 0:o.integrationID,memoriHash:`${e.ownerTenantName}-${e.ownerUserName}-${e.name}`}),$n=l||("TOTEM"===Je?TF:"CHAT"===Je?IF:"FULLPAGE"===Je?MF:"WEBSITE_ASSISTANT"===Je?RF:MF);return(0,s.jsxs)("div",{className:t(Ss)("memori","memori-widget",`memori-layout-${a.toLowerCase()}`,`memori-controls-${mt.toLowerCase()}`,`memori--avatar-${(null==ze?void 0:ze.avatar)||"default"}`,{"memori--preview":p,"memori--embed":h,"memori--with-integration":o,"memori--with-speechkey":!!O,"memori--active":Qe,"memori--hide-emissions":vt,"memori--has-active-session":!!Ht}),"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":Ht,"data-memori-integration":null==o?void 0:o.integrationID,"data-memori-engine-state":JSON.stringify({...Vt,sessionID:Ht}),style:{height:w},children:[(0,s.jsx)($n,{Header:fD,headerProps:Vn,Avatar:lN,avatarProps:Wn,Chat:pm,chatProps:Kn,StartPanel:bm,startPanelProps:qn,integrationStyle:Qn,integrationBackground:Jn,ChangeMode:cN,changeModeProps:Yn,poweredBy:Xn,sessionId:Ht,hasUserActivatedSpeak:Qe,showInstruct:u,loading:He}),(0,s.jsx)("audio",{id:"memori-audio",style:{display:"none"},src:"https://aisuru.com/intro.mp3"}),he&&(0,s.jsx)(yd,{withModal:!0,pwdOrTokens:Ct,openModal:!!Ct,setPwdOrTokens:At,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{var n,r;t.password&&St(t.password),t.password&&(WF=t.password),t.tokens&&wt(t.tokens),Jt(!Ht,t.password,t.tokens,Ee?e.giverTag:null==P?void 0:P.tag,Ee?e.giverPIN:null==P?void 0:P.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())||"",..._||{}},M,zt).then((e=>{At(null),Un(e||void 0)})).catch((()=>{At(null),Le(!0)}))},minimumNumberOfRecoveryTokens:null!==(ue=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==ue?ue:1}),he&&(0,s.jsx)(lF,{visible:Ft,minAge:Bt,onClose:t=>{var n,r;t?(Ut(t),fF("birthDate",t),Jt(!Ht,WF||bt||(null==e?void 0:e.secretToken),xt,Ee?e.giverTag:null==P?void 0:P.tag,Ee?e.giverPIN:null==P?void 0:P.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())||"",..._||{}},M,t).then((e=>{jt(!1),At(null),Un(e||void 0)})).catch((()=>{jt(!1),Le(!0)}))):(jt(!1),Ne(!1))}}),tt&&(0,s.jsx)(vF,{layout:Je,open:!!tt,onClose:()=>nt(!1),microphoneMode:ct?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout:dt,setMicrophoneMode:e=>ut("CONTINUOUS"===e),setContinuousSpeechTimeout:pt,controlsPosition:mt,setControlsPosition:gt,hideEmissions:vt,setHideEmissions:yt,additionalSettings:B}),rt&&Ht&&(0,s.jsx)(CF,{apiURL:E,memori:e,sessionID:Ht,visible:rt,closeDrawer:()=>it(!1)}),ot&&!!Fn&&(0,s.jsx)(AF,{apiUrl:E,baseUrl:A,tenant:R,experts:Fn,open:ot,onClose:()=>st(!1)}),Pe&&(null==R?void 0:R.id)&&(0,s.jsx)(_F,{tenant:R,apiUrl:E,open:!!Pe,user:Ie,loginToken:Me,onClose:()=>ke(!1),onLogin:(e,t)=>{Re(e),Te(t),qF=t,ke(!1),fF("loginToken",t)},onLogout:()=>{Me&&me.backend.userLogout(Me).then((()=>{ke(!1),Re(void 0),Te(void 0),qF=void 0,mF("loginToken")}))}})]})};const YF={id:"aisuru.com",theme:"aisuru",config:{name:"Memori",showNewUser:!1,requirePosition:!1}},XF=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||{...YF,tenantID:e}}catch(t){return{...YF,tenantID:e}}};function $F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZF(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,KO(r.key),r)}}function ej(e,t,n){return t&&ZF(e.prototype,t),n&&ZF(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tj(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nj(e,t){return nj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},nj(e,t)}function rj(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&&nj(e,t)}function ij(e,t){if(t&&("object"===WO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return tj(e)}function oj(e){return oj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oj(e)}function sj(e){if(Array.isArray(e))return e}function aj(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function lj(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 cj(e,t){if(e){if("string"==typeof e)return lj(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)?lj(e,t):void 0}}function uj(){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 dj(e){return sj(e)||aj(e)||cj(e)||uj()}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 hj(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){JO(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}var fj={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)}},mj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};$F(this,e),this.init(t,n)}return ej(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||fj,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,hj(hj({},{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}(),gj=new mj,vj=function(){function e(){$F(this,e),this.observers={}}return ej(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 yj(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function bj(e){return null==e?"":""+e}function Sj(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function xj(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 wj(e,t,n){var r=xj(e,t,Object);r.obj[r.k]=n}function Cj(e,t){var n=xj(e,t),r=n.obj,i=n.k;if(r)return r[i]}function Aj(e,t,n){var r=Cj(e,n);return void 0!==r?r:Cj(t,n)}function Ej(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]):Ej(e[r],t[r],n):e[r]=t[r]);return e}function _j(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Mj={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Tj(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return Mj[e]})):e}var Ij="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Rj=[" ",",","?","!",";"];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){JO(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=oj(e);if(t){var i=oj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ij(this,n)}}function Nj(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?Nj(l,c,n):void 0}i=i[r[o]]}return i}}var Dj=function(e){rj(n,e);var t=Oj(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return $F(this,n),r=t.call(this),Ij&&vj.call(tj(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 ej(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=Cj(this.data,s);return a||!o||"string"!=typeof n?a:Nj(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),wj(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=Cj(this.data,s)||{};r?Ej(a,n,i):a=kj(kj({},a),n),wj(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?kj(kj({},{}),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}(vj),Lj={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 Bj(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 zj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bj(Object(n),!0).forEach((function(t){JO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Uj(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=oj(e);if(t){var i=oj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ij(this,n)}}var Fj={},jj=function(e){rj(n,e);var t=Uj(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return $F(this,n),r=t.call(this),Ij&&vj.call(tj(r)),Sj(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,tj(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=gj.create("translator"),r}return ej(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=Rj.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"!==WO(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,zj(zj({},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?[]:{},_=A?v:g;for(var M in m)if(Object.prototype.hasOwnProperty.call(m,M)){var T="".concat(_).concat(s).concat(M);E[M]=this.translate(T,zj(zj({},t),{joinArrays:!1,ns:c})),E[M]===T&&(E[M]=m[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 D=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,L=D&&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,zj(zj({},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 U=[],F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&F&&F[0])for(var j=0;j<F.length;j++)U.push(F[j]);else"all"===this.options.saveMissingTo?U=this.languageUtils.toResolveHierarchy(t.lng||this.language):U.push(t.lng||this.language);var H=function(e,n,r){var o=k&&r!==m?r:L;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?U.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],l+n,t["defaultValue".concat(n)]||N)}))})):H(U,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,zj(zj({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(zj(zj({},n),{interpolation:zj(zj({},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=zj(zj({},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=Lj.handle(p,e,t,this.options&&this.options.postProcessPassResolved?zj({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,!Fj["".concat(f[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(Fj["".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}(vj);function Hj(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Gj=function(){function e(t){$F(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=gj.create("languageUtils")}return ej(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]=Hj(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]=Hj(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Hj(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}(),Vj=[{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}],Wj={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)}},qj=["v1","v2","v3"],Kj={zero:0,one:1,two:2,few:3,many:4,other:5};function Jj(){var e={};return Vj.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:Wj[t.fc]}}))})),e}var Qj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};$F(this,e),this.languageUtils=t,this.options=n,this.logger=gj.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=Jj()}return ej(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 Kj[e]-Kj[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!qj.includes(this.options.compatibilityJSON)}}]),e}();function Yj(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 Xj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yj(Object(n),!0).forEach((function(t){JO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $j=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$F(this,e),this.logger=gj.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return ej(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:Tj,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?_j(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?_j(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?_j(t.nestingPrefix):t.nestingPrefixEscaped||_j("$t("),this.nestingSuffix=t.nestingSuffix?_j(t.nestingSuffix):t.nestingSuffixEscaped||_j(")"),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=Aj(t,l,e);return a.alwaysFormat?a.format(i,void 0,n,Xj(Xj(Xj({},r),t),{},{interpolationkey:e})):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(Aj(t,l,s),c,n,Xj(Xj(Xj({},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=bj(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=Xj({},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=Xj(Xj({},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=bj(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,Xj(Xj({},o),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function Zj(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 eH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zj(Object(n),!0).forEach((function(t){JO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function tH(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 nH=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$F(this,e),this.logger=gj.create("formatter"),this.options=t,this.formats={number:tH((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:tH((function(e,t){var n=new Intl.NumberFormat(e,eH(eH({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:tH((function(e,t){var n=new Intl.DateTimeFormat(e,eH({},t));return function(e){return n.format(e)}})),relativetime:tH((function(e,t){var n=new Intl.RelativeTimeFormat(e,eH({},t));return function(e){return n.format(e,t.range||"day")}})),list:tH((function(e,t){var n=new Intl.ListFormat(e,eH({},t));return function(e){return n.format(e)}}))},this.init(t)}return ej(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()]=tH(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=dj(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,eH(eH(eH({},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 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){JO(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=oj(e);if(t){var i=oj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ij(this,n)}}var sH=function(e){rj(n,e);var t=oH(n);function n(e,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return $F(this,n),o=t.call(this),Ij&&vj.call(tj(o)),o.backend=e,o.store=r,o.services=i,o.languageUtils=i.languageUtils,o.options=s,o.logger=gj.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 ej(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=xj(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,iH(iH({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(vj);function aH(){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"===WO(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===WO(e[2])||"object"===WO(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 lH(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 cH(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 uH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cH(Object(n),!0).forEach((function(t){JO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function dH(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=oj(e);if(t){var i=oj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ij(this,n)}}function pH(){}function hH(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var fH=function(e){rj(n,e);var t=dH(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if($F(this,n),e=t.call(this),Ij&&vj.call(tj(e)),e.options=lH(r),e.services={},e.logger=gj,e.modules={external:[]},hH(tj(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),ij(e,tj(e));setTimeout((function(){e.init(r,i)}),0)}return e}return ej(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=aH();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=uH(uH(uH({},r),this.options),lH(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=uH(uH({},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?gj.init(i(this.modules.logger),this.options):gj.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=nH);var s=new Gj(this.options);this.store=new Dj(this.options.resources,this.options);var a=this.services;a.logger=gj,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new Qj(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 $j(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new sH(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 jj(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=pH),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=yj(),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]:pH,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=yj();return e||(e=this.languages),t||(t=this.options.ns),n||(n=pH),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&&Lj.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=yj();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"!==WO(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=uH({},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=yj();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=yj();"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]:pH,i=uH(uH(uH({},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=uH({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new jj(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}(vj);JO(fH,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new fH(e,t)}));var mH=fH.createInstance();mH.createInstance=fH.createInstance;var gH,vH=mH.createInstance;mH.init,mH.loadResources,mH.reloadResources,mH.use,mH.changeLanguage,mH.getFixedT,mH.t,mH.exists,mH.setDefaultNamespace,mH.hasLoadedNamespace,mH.loadNamespaces,mH.loadLanguages;gH=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"},"login":{"login":"Accedi","logout":"Esci","user":"Utente","loggedDrawerTitle":"Ciao, {{name}}!","loginDrawerTitle":"Accedi","newUserSignUp":"Sei un nuovo utente?","signUp":"Registrati!","registrationDisabled":"La registrazione è disabilitata.","contactAdmin":"Contatta l\'amministratore per richiedere l\'accesso","userNameOrEmail":"Nome utente o email","underage":"Devi avere almeno {{age}} anni per registrarti.","optional":"opzionale","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à","missingData":"Informazioni mancanti","missingDataHelper":"Sappiamo che questo è un po\' fastidioso, ma abbiamo bisogno di alcune informazioni in più per completare la tua registrazione.","goToAccountToChangeYourPreferences":"Puoi cambiare la tua scelta in qualsiasi momento dalla tua pagina Account.","deepThoughtExplaination":"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. Consenti all\'autore del twin di contattarti per offerte commerciali riguardanti prodotti su cui hai espresso interesse.","tnCAndPPAcceptedHelper":"Dall\'ultimo accesso, i T&C e l\'Informativa sulla privacy sono stati modificati. Si prega di accettarle, altrimenti non sarà possibile apportare modifiche ai propri gemelli. Puoi sempre cancellare il tuo account nella pagina del tuo profilo utente.","privacyLabel":"Ho letto e accettato l\'","privacyAndCookiePolicy":"informativa sui cookie e sulla privacy","and":"e","termsOfService":"i termini del servizio","pAndCUAccepted":"Accetto le condizioni di utilizzo relative a Pensiero Profondo","save":"Salva"},"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","TENANT_ALREADY_EXISTS":"Tenant già esistente","TENANT_MISSING_DESCRIPTION":"Tenant: descrizione mancante","TENANT_CANT_SET_COMPLETION_PROVIDER":"Tenant: non abilitato a gestire il provider di completamento","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_TOO_MANY_ATTEMPTS":"Troppi tentativi","USER_MUST_ACCEPT_TNC_AND_PP":"Devi accettare i termini e le condizioni","USER_BIRTH_DATE_CANT_BE_CHANGED":"Data di nascita non può essere cambiata","USER_CANT_SET_COMPLETION_PROVIDER":"Utente: non abilitato a gestire il provider di completamento","USER_CANT_ENABLE_DEEP_THOUGHT":"Utente: non abilitato a gestire Pensiero Profondo","USER_CANT_ENABLE_DCM_INTEGRATION":"Utente: non abilitato a gestire l\'integrazione con DCM","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"Utente: non abilitato a gestire la concatenazione o il gruppo di esperti","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"Il gruppo di esperti richiede l\'abilitazione delle completions","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","SESSION_EXPIRED":"Sessione scaduta","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_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Pensiero Profondo richiede l\'abilitazione delle completions","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","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Memori: funzionalità richiede un abbonamento","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","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifiche: Periodo di estrazione chatlog non valido","PROCESS_INVALID_TYPE":"Tipo di processo non valido","PROCESS_ALREADY_RUNNING":"Processo già in esecuzione","PROCESS_NOT_FOUND":"Processo non trovato","IMPORTCSV_MISSING_ROWS":"Importazione CSV: righe mancanti","IMPORTCSV_MISSING_CSV":"Importazione CSV: CSV mancante","IMPORTCSV_MISSING_SEPARATOR":"Importazione CSV: separatore mancante","IMPORTCSV_INVALID_SEPARATOR":"Importazione CSV: separatore non valido","IMPORTCSV_MISSING_HEADERS":"Importazione CSV: intestazioni mancanti","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Importazione CSV: separatore varianti titolo mancante","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"Importazione CSV: encoding caratteri non rilevabile","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione CSV: impossibile importare in Memori segreti","IMPORTTXT_MISSING_ROWS":"Importazione TXT: righe mancanti","IMPORTTXT_INVALID_GRANULARITY":"Importazione TXT: granularità non valida","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"Importazione TXT: encoding caratteri non rilevabile","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione TXT: impossibile importare in Memori segreti","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Importazione TXT: limite importazione superato","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Importazione TXT: importazione su GPT-4 richiede API key","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Importazione TXT: importazione richiede un piano a pagamento","EXPORTCSV_MISSING_CSV_SPECS":"Esportazione CSV: specifiche CSV mancanti","EXPORTCSV_MISSING_SEPARATOR":"Esportazione CSV: separatore mancante","EXPORTCSV_INVALID_SEPARATOR":"Esportazione CSV: separatore non valido","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Esportazione CSV: separatore varianti titolo mancante","EXPORTCSV_MISSING_NEW_LINE_CHAR":"Esportazione CSV: carattere di nuova riga mancante","EXPORTCSV_INVALID_NEW_LINE_CHAR":"Esportazione CSV: carattere di nuova riga non valido","EXPORTCSV_MISSING_PASSWORD":"Esportazione CSV: password mancante","EXPORTJSONL_MISSING_JSONL_SPECS":"Esportazione JSONL: specifiche JSONL mancanti","EXPORTJSONL_MISSING_PLATFORM":"Esportazione JSONL: piattaforma mancante","EXPORTJSONL_INVALID_PLATFORM":"Esportazione JSONL: piattaforma non valida","EXPORTJSONL_MISSING_PASSWORD":"Esportazione JSONL: password mancante","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"Esportazione JSONL: esportazione richiede un piano a pagamento","ANALYSIS_MISSING_QUERY":"Analisi: query mancante","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analisi: impossibile analizzare Memori segreti","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analisi: corrispondenza query utente richiede Pensiero Profondo","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Assegnazione badge: credenziali errate o mancanti","BADGE_ASSIGNMENT_MISSING_REF_ID":"Assegnazione badge: ID ref mancante","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Assegnazione badge: esito non trovato","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Assegnazione badge: URL di asserzione mancante","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Assegnazione badge: URL badge mancante","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Assegnazione badge: URL issuer mancante","BADGE_ASSIGNMENT_INVALID_URL":"Assegnazione badge: URL non valido","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Assegnazione badge: destinatario mancante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Assegnazione badge: tipo destinatario sconosciuto","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Assegnazione badge: identità destinatario mancante","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Assegnazione badge: tipo hash destinatario mancante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Assegnazione badge: tipo hash destinatario sconosciuto","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Assegnazione badge: identità destinatario errata","BADGE_NOT_FOUND":"Badge non trovato","OUTCOME_NO_DCM_CONFIGURED":"Esito: nessun DCM configurato","OUTCOME_USER_BADGES_DISABLED":"Esito: badge utente disabilitati"}}');const yH=vH({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"},"login":{"login":"Login","logout":"Logout","user":"User","loggedDrawerTitle":"Hi, {{name}}!","loginDrawerTitle":"Login","newUserSignUp":"New user?","signUp":"Sign up!","registrationDisabled":"Registration is disabled","contactAdmin":"Contact the administrator to request access","userNameOrEmail":"Username or email","underage":"You must be at least {{age}} years old to sign up.","optional":"Optional","birthDate":"Birth date","birthDateHelper":"We ask for your birth date only to enable or disable functionalities that have age restrictions","missingData":"Missing informations","missingDataHelper":"We know that this is a bit annoying, but we need some more informations to complete your registration.","goToAccountToChangeYourPreferences":"You can change your choice at any time from your Account page.","deepThoughtExplaination":"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.","tnCAndPPAcceptedHelper":"Since your last login, T&C and Privacy Policy have changed. Please accept them, otherwise you won\'t be able to make changes to your Twins. You can always delete your account in your user profile page.","privacyLabel":"I have read and accepted the","privacyAndCookiePolicy":"Privacy e Cookie Policy","and":"and","termsOfService":"Terms of Service","pAndCUAccepted":"I accept the terms of service about Deep Thought","save":"Save"},"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","TENANT_ALREADY_EXISTS":"Tenant already exists","TENANT_MISSING_DESCRIPTION":"Tenant: description missing","TENANT_CANT_SET_COMPLETION_PROVIDER":"Tenant: can\'t set completion provider","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_TOO_MANY_ATTEMPTS":"Too many attempts","USER_MUST_ACCEPT_TNC_AND_PP":"You must accept the terms and conditions","USER_BIRTH_DATE_CANT_BE_CHANGED":"Date of birth cannot be changed","USER_CANT_SET_COMPLETION_PROVIDER":"User: not allowed to manage completion provider","USER_CANT_ENABLE_DEEP_THOUGHT":"User: not enabled to manage Deep Thought","USER_CANT_ENABLE_DCM_INTEGRATION":"User: not enabled to manage DCM integration","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"User: not allowed to manage chaining or expert group","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"The expert group requires completions to be enabled","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","SESSION_EXPIRED":"Session expired","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_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Deep Thought requires completions to be enabled","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","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Feature requires subscription","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","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifications: Invalid chat log extraction period","PROCESS_INVALID_TYPE":"Invalid process type","PROCESS_ALREADY_RUNNING":"Process already running","PROCESS_NOT_FOUND":"Process not found","IMPORTCSV_MISSING_ROWS":"CSV import: missing rows","IMPORTCSV_MISSING_CSV":"CSV Import: Missing CSV","IMPORTCSV_MISSING_SEPARATOR":"CSV import: missing separator","IMPORTCSV_INVALID_SEPARATOR":"CSV import: invalid separator","IMPORTCSV_MISSING_HEADERS":"CSV import: missing headers","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV import: missing title variant separator","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"CSV import: undetectable character encoding","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"CSV Import: Cannot import to Secret Memories","IMPORTTXT_MISSING_ROWS":"Importing TXT: missing rows","IMPORTTXT_INVALID_GRANULARITY":"Import TXT: invalid granularity","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"TXT import: undetectable character encoding","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"TXT Import: Cannot import to Secret Memories","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Import TXT: import limit exceeded","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Import TXT: import on GPT-4 requires API key","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Import TXT: Import requires a paying plan","EXPORTCSV_MISSING_CSV_SPECS":"CSV export: missing CSV specifications","EXPORTCSV_MISSING_SEPARATOR":"CSV export: missing separator","EXPORTCSV_INVALID_SEPARATOR":"CSV export: invalid separator","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV export: missing title variant separator","EXPORTCSV_MISSING_NEW_LINE_CHAR":"CSV export: missing newline character","EXPORTCSV_INVALID_NEW_LINE_CHAR":"CSV export: invalid newline character","EXPORTCSV_MISSING_PASSWORD":"CSV export: missing password","EXPORTJSONL_MISSING_JSONL_SPECS":"JSONL export: missing JSONL specifications","EXPORTJSONL_MISSING_PLATFORM":"JSONL export: missing platform","EXPORTJSONL_INVALID_PLATFORM":"JSONL export: invalid platform","EXPORTJSONL_MISSING_PASSWORD":"JSONL export: missing password","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"JSONL Export: Export requires a paid plan","ANALYSIS_MISSING_QUERY":"Analysis: missing query","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analysis: Unable to analyze Secret Memories","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analysis: matching user query requires Deep Thinking","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Badge assignment: incorrect or missing credentials","BADGE_ASSIGNMENT_MISSING_REF_ID":"Badge assignment: ref ID missing","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Badge assignment: result not found","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Badge assignment: Missing assertion URL","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Badge Assignment: Missing Badge URL","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Badge assignment: missing issuer URL","BADGE_ASSIGNMENT_INVALID_URL":"Badge assignment: Invalid URL","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Badge assignment: missing recipient","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Badge assignment: unknown recipient type","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Badge assignment: missing recipient identity","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Badge assignment: missing recipient hash type","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Badge assignment: recipient hash type unknown","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Badge assignment: incorrect recipient identity","BADGE_NOT_FOUND":"Badge not found","OUTCOME_NO_DCM_CONFIGURED":"Result: no DCM configured","OUTCOME_USER_BADGES_DISABLED":"Result: user badges disabled"}}'))},it:{translation:t(gH)}},lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});yH.init();var bH=yH;c=o("85Hg2");function SH(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)(oe.Provider,{value:i},r)}const xH=({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,showLogin:x,height:w="100%",baseURL:C,apiURL:A="https://backend.memori.ai",tag:E,pin:_,context:M,initialQuestion:T,uiLang:I,spokenLang:R,multilingual:P,authToken:k,AZURE_COGNITIVE_SERVICES_TTS_KEY:O,defaultSpeakerActive:N=!0,onStateChange:D,additionalInfo:L,customMediaRenderer:B,additionalSettings:z,userAvatar:U})=>{var F,j,H;const[G,V]=(0,c.useState)(),[W,q]=(0,c.useState)(),[K,Q]=(0,c.useState)(O),{t:Y}=be();if(!(r&&t||n&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const X=J(A),$=(0,c.useCallback)((async()=>{const e=C||(o.startsWith("https://")?o:`https://${o}`),t=await fetch(`${e}/api/speechkey`),n=await t.json();n.AZURE_COGNITIVE_SERVICES_TTS_KEY&&Q(n.AZURE_COGNITIVE_SERVICES_TTS_KEY)}),[]);(0,c.useEffect)((()=>{O||$()}),[O]);const Z=(0,c.useCallback)((async()=>{if(r&&t){const{memori:e,...n}=await X.backend.getMemoriByUserAndId(o,t,r);0===n.resultCode&&e?V(e):console.error("[MEMORI]",n,e)}else if(n&&e){const{memori:t,...r}=await X.backend.getMemori(o,e,n);0===r.resultCode&&t?V(t):console.error("[MEMORI]",r,t)}}),[r,t,n,e,o]);(0,c.useEffect)((()=>{Z()}),[Z,o]);const ee=(0,c.useCallback)((async()=>{const e=await XF(o,C);e&&q(e)}),[o,A]);(0,c.useEffect)((()=>{ee()}),[ee]),(0,c.useEffect)((()=>{if(I)bH.changeLanguage(I.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"}})();bH.changeLanguage(e).catch((()=>{bH.changeLanguage(t)}))}}),[I]);const te=G?(0,s.jsx)(QF,{layout:u,customLayout:d,height:w,baseUrl:C||(o.startsWith("https://")?o:`https://${o}`),apiUrl:A,memori:{...G,secretToken:a},memoriLang:null!=R?R:null===(j=null===(F=G.culture)||void 0===F?void 0:F.split("-"))||void 0===j?void 0:j[0],multilingual:P,tenant:W,secret:a,sessionID:l,showShare:p,showSettings:h,showInstruct:f,showTypingText:m,showClear:g,showOnlyLastMessages:v,showInputs:y,showDates:b,showContextPerLine:S,showLogin:null!=x?x:null==G?void 0:G.enableDeepThought,integration:null===(H=null==G?void 0:G.integrations)||void 0===H?void 0:H.find((e=>i?e.integrationID===i:!!e.publish&&"LANDING_EXPERIENCE"===e.type)),initialContextVars:M,initialQuestion:T,authToken:k,AZURE_COGNITIVE_SERVICES_TTS_KEY:K||O,defaultSpeakerActive:N,onStateChange:D,additionalInfo:L,customMediaRenderer:B,additionalSettings:z,userAvatar:U,...E&&_?{personification:{tag:E,pin:_}}:{}}):(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:[Y("loading")||"Loading","..."]})});return(0,s.jsxs)(SH,{i18n:bH,children:[(0,s.jsx)(ws.Toaster,{position:"top-center",reverseOrder:!0}),te]})};xH.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,showLogin: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,defaultSpeakerActive:t(l).bool,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 wH=xH;class CH 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(wH.propTypes).reduce(((e,t)=>(this.hasAttribute(t)&&(e[t]=this.getAttribute(t),"true"!==e[t]&&"false"!==e[t]||(e[t]="true"===e[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)(wH,{...r,context:o,tenantID:i,additionalInfo:l}),n):console.error("No tenantId attribute found")}}customElements.define("memori-client",CH)})();
|
|
246
|
+
*/function oD(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 sD(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 aD(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 lD=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function cD(e){const n=e,{value:r,size:i=eD,level:o=tD,bgColor:s=nD,fgColor:a=rD,includeMargin:l=iD,style:u,imageSettings:d}=n,p=XN(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=$N.QrCode.encodeText(r,ZN[o]).getModules();const c=l?4:0,u=n.length+2*c,p=aD(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=sD(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,lD?t.fill(new Path2D(oD(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=YN({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",YN({style:y,height:i,width:i,ref:f},p)),b)}var uD=({tenant:e,url:n,title:r="",className:i,baseUrl:o,primary:a=!0,showQrCode:l=!0,align:u="right"})=>{const{t:d}=be(),[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:LN},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${p}`,icon:BN},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${r}&url=${p}`,icon:zN},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${p}`,icon:UN},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${r}&url=${p}`,icon:VN},{id:"email",title:"Email",url:`mailto:?subject=${(null==r?void 0:r.length)>0?r:n}&body=${p}`,icon:FN}];return(0,s.jsxs)(Jd,{as:"div",className:t(Ss)("memori-share-button",{"memori-share-button--align-left":"left"===u}),children:[(0,s.jsx)(Jd.Button,{className:t(Ss)("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)(jN,{})})}),(0,s.jsxs)(Jd.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,s.jsx)(Jd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsx)(Ba,{className:"memori-share-button--link",ghost:!0,icon:(0,s.jsx)(ip,{}),onClick:()=>{p&&navigator.clipboard.writeText(p)},children:d("copyToClipboard")||void 0})},"copy"),m.map((e=>{var n;return(0,s.jsx)(Jd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsxs)("a",{className:t(Ss)("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)(Jd.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,s.jsx)(cD,{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)(Ba,{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)(HN,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};var dD=({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 pD=({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 hD=({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 fD=({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,showLogin:S=!0,setShowLoginDrawer:x,clearHistory:w,loginToken:C,user:A,sessionID:E})=>{const{t:_}=be(),[M,T]=(0,c.useState)(!1),[I,R]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{document.fullscreenEnabled&&T(!0)}),[]),(0,s.jsxs)("div",{className:t(Ss)("memori-header",e),children:[y&&(0,s.jsx)(Ba,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--reload",title:_("reload")||"Reload",icon:(0,s.jsx)(pD,{}),onClick:()=>{window.location.reload()}}),b&&(0,s.jsx)(Ba,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--clear",title:_("clearHistory")||"Clear chat",icon:(0,s.jsx)(hD,{}),onClick:w}),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)(Ba,{icon:(0,s.jsx)(uN,{}),shape:"circle",className:"memori-header--button memori-header--button--position",onClick:()=>a(!0)})]}),M&&(0,s.jsx)(Ba,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--fullscreen",title:I?_("fullscreenExit")||"Exit fullscreen":_("fullscreenEnter")||"Enter fullscreen",icon:I?(0,s.jsx)(rm,{}):(0,s.jsx)(dD,{}),onClick:()=>{document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),R(!1)):(document.documentElement.requestFullscreen(),R(!0))}}),n.enableDeepThought&&!!C&&(null==A?void 0:A.pAndCUAccepted)&&(0,s.jsx)(Ba,{primary:!!E&&!!f,shape:"circle",icon:(0,s.jsx)(vm,{}),className:"memori-header--button memori-header--button--knownfacts",disabled:!f||!E,onClick:()=>u(!0),title:_("knownFacts.title")||"Known facts"}),n.enableBoardOfExperts&&(0,s.jsx)(Ba,{primary:!0,shape:"circle",icon:(0,s.jsx)(gm,{}),className:"memori-header--button memori-header--button--experts",disabled:!f||!E,onClick:()=>d(!0),title:_("widget.showExpertsInTheBoard")||"Experts in this board"}),v&&(0,s.jsx)(Ba,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--speaker",icon:p?(0,s.jsx)(dN,{}):(0,s.jsx)(hN,{}),onClick:()=>h(!p),title:_("widget.sound")||"Sound"}),(0,s.jsx)(NN,{history:i,memori:n,className:"memori-header--button memori-header--button--export",disabled:!f||0===i.length}),g&&(0,s.jsx)(Ba,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-settings",icon:(0,s.jsx)(DN,{}),onClick:()=>l(!0),title:_("widget.settings")||"Settings"}),m&&(0,s.jsx)(uD,{className:"memori-header--button memori-header--button-share",title:n.name,tenant:r,showQrCode:!0,align:"left"}),S&&(0,s.jsx)(Ba,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-login",icon:(0,s.jsx)(Ed,{}),onClick:()=>x(!0),title:C?_("login.user")||"User":_("login.login")||"Login"})]})};var mD=({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"})]})]})},gD={};function vD(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 yD(e,t,n){return t&&vD(e.prototype,t),n&&vD(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function bD(){return bD=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},bD.apply(this,arguments)}function SD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,wD(e,t)}function xD(e){return xD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xD(e)}function wD(e,t){return wD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},wD(e,t)}function CD(){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 AD(e,t,n){return AD=CD()?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&&wD(i,n.prototype),i},AD.apply(null,arguments)}function ED(e){var t="function"==typeof Map?new Map:void 0;return ED=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 AD(e,arguments,xD(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),wD(r,e)},ED(e)}function _D(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 MD(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 TD(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 MD(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)?MD(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(gD,"__esModule",{value:!0});var ID=function(e){function t(){return e.apply(this,arguments)||this}return SD(t,e),t}(ED(Error)),RD=function(e){function t(t){return e.call(this,"Invalid DateTime: "+t.toMessage())||this}return SD(t,e),t}(ID),PD=function(e){function t(t){return e.call(this,"Invalid Interval: "+t.toMessage())||this}return SD(t,e),t}(ID),kD=function(e){function t(t){return e.call(this,"Invalid Duration: "+t.toMessage())||this}return SD(t,e),t}(ID),OD=function(e){function t(){return e.apply(this,arguments)||this}return SD(t,e),t}(ID),ND=function(e){function t(t){return e.call(this,"Invalid unit "+t)||this}return SD(t,e),t}(ID),DD=function(e){function t(){return e.apply(this,arguments)||this}return SD(t,e),t}(ID),LD=function(e){function t(){return e.call(this,"Zone is an abstract class")||this}return SD(t,e),t}(ID),BD="numeric",zD="short",UD="long",FD={year:BD,month:BD,day:BD},jD={year:BD,month:zD,day:BD},HD={year:BD,month:zD,day:BD,weekday:zD},GD={year:BD,month:UD,day:BD},VD={year:BD,month:UD,day:BD,weekday:UD},WD={hour:BD,minute:BD},qD={hour:BD,minute:BD,second:BD},KD={hour:BD,minute:BD,second:BD,timeZoneName:zD},JD={hour:BD,minute:BD,second:BD,timeZoneName:UD},QD={hour:BD,minute:BD,hourCycle:"h23"},YD={hour:BD,minute:BD,second:BD,hourCycle:"h23"},XD={hour:BD,minute:BD,second:BD,hourCycle:"h23",timeZoneName:zD},$D={hour:BD,minute:BD,second:BD,hourCycle:"h23",timeZoneName:UD},ZD={year:BD,month:BD,day:BD,hour:BD,minute:BD},eL={year:BD,month:BD,day:BD,hour:BD,minute:BD,second:BD},tL={year:BD,month:zD,day:BD,hour:BD,minute:BD},nL={year:BD,month:zD,day:BD,hour:BD,minute:BD,second:BD},rL={year:BD,month:zD,day:BD,weekday:zD,hour:BD,minute:BD},iL={year:BD,month:UD,day:BD,hour:BD,minute:BD,timeZoneName:zD},oL={year:BD,month:UD,day:BD,hour:BD,minute:BD,second:BD,timeZoneName:zD},sL={year:BD,month:UD,day:BD,weekday:UD,hour:BD,minute:BD,timeZoneName:UD},aL={year:BD,month:UD,day:BD,weekday:UD,hour:BD,minute:BD,second:BD,timeZoneName:UD},lL=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new LD},t.formatOffset=function(e,t){throw new LD},t.offset=function(e){throw new LD},t.equals=function(e){throw new LD},yD(e,[{key:"type",get:function(){throw new LD}},{key:"name",get:function(){throw new LD}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new LD}},{key:"isValid",get:function(){throw new LD}}]),e}(),cL=null,uL=function(e){function t(){return e.apply(this,arguments)||this}SD(t,e);var n=t.prototype;return n.offsetName=function(e,t){return EB(e,t.format,t.locale)},n.formatOffset=function(e,t){return IB(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return"system"===e.type},yD(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===cL&&(cL=new t),cL}}]),t}(lL),dL={};var pL={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};var hL={},fL=function(e){function t(n){var r;return(r=e.call(this)||this).zoneName=n,r.valid=t.isValidZone(n),r}SD(t,e),t.create=function(e){return hL[e]||(hL[e]=new t(e)),hL[e]},t.resetCache=function(){hL={},dL={}},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 EB(e,t.format,t.locale,this.name)},n.formatOffset=function(e,t){return IB(this.offset(e),t)},n.offset=function(e){var t=new Date(e);if(isNaN(t))return NaN;var n,r=(n=this.name,dL[n]||(dL[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"})),dL[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=pL[s];"era"===s?r[l]=a:iB(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(xB({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},yD(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}(lL),mL=["base"],gL=["padTo","floor"],vL={};var yL={};function bL(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=yL[n];return r||(r=new Intl.DateTimeFormat(e,t),yL[n]=r),r}var SL={};var xL={};var wL=null;var CL={};function AL(e,t,n,r){var i=e.listingMode();return"error"===i?null:"en"===i?n(t):r(t)}var EL=function(){function e(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1,n.padTo,n.floor;var r=_D(n,gL);if(!t||Object.keys(r).length>0){var i=bD({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=SL[n];return r||(r=new Intl.NumberFormat(e,t),SL[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 hB(this.floor?Math.floor(e):vB(e,3),this.padTo)},e}(),_L=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&&fL.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=bD({},this.opts);s.timeZone=s.timeZone||r,this.dtf=bL(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?bD({},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}(),ML=function(){function e(e,t,n){this.opts=bD({style:"long"},n),!t&&aB()&&(this.rtf=function(e,t){void 0===t&&(t={});var n=t;n.base;var r=_D(n,mL),i=JSON.stringify([e,r]),o=xL[i];return o||(o=new Intl.RelativeTimeFormat(e,t),xL[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}(),TL={firstDay:1,minimalDays:4,weekend:[6,7]},IL=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=bL(e).resolvedOptions(),r=e}catch(t){var o=e.substring(0,i);n=bL(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||HL.defaultLocale;return new e(s||(o?"en-US":wL||(wL=(new Intl.DateTimeFormat).resolvedOptions().locale)),n||HL.defaultNumberingSystem,r||HL.defaultOutputCalendar,dB(i)||HL.defaultWeekSettings,s)},e.resetCache=function(){wL=null,yL={},SL={},xL={}},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,dB(t.weekSettings)||this.weekSettings,t.defaultToEN||!1):this},t.redefaultToEN=function(e){return void 0===e&&(e={}),this.clone(bD({},e,{defaultToEN:!0}))},t.redefaultToSystem=function(e){return void 0===e&&(e={}),this.clone(bD({},e,{defaultToEN:!1}))},t.months=function(e,t){var n=this;return void 0===t&&(t=!1),AL(this,e,NB,(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=zU.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),AL(this,e,zB,(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=zU.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 AL(this,void 0,(function(){return UB}),(function(){if(!e.meridiemCache){var t={hour:"numeric",hourCycle:"h12"};e.meridiemCache=[zU.utc(2016,11,13,9),zU.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 AL(this,e,GB,(function(){var n={era:e};return t.eraCache[e]||(t.eraCache[e]=[zU.utc(-40,1,1),zU.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 EL(this.intl,e.forceSimple||this.fastNumbers,e)},t.dtFormatter=function(e,t){return void 0===t&&(t={}),new _L(e,this.intl,t)},t.relFormatter=function(e){return void 0===e&&(e={}),new ML(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=vL[n];return r||(r=new Intl.ListFormat(e,t),vL[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:lB()?function(e){var t=CL[e];if(!t){var n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,CL[e]=t}return t}(this.locale):TL},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},yD(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}(),RL=null,PL=function(e){function t(t){var n;return(n=e.call(this)||this).fixed=t,n}SD(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(_B(n[1],n[2]))}return null};var n=t.prototype;return n.offsetName=function(){return this.name},n.formatOffset=function(e,t){return IB(this.fixed,t)},n.offset=function(){return this.fixed},n.equals=function(e){return"fixed"===e.type&&e.fixed===this.fixed},yD(t,[{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC"+IB(this.fixed,"narrow")}},{key:"ianaName",get:function(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+IB(-this.fixed,"narrow")}},{key:"isUniversal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}],[{key:"utcInstance",get:function(){return null===RL&&(RL=new t(0)),RL}}]),t}(lL),kL=function(e){function t(t){var n;return(n=e.call(this)||this).zoneName=t,n}SD(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},yD(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}(lL);function OL(e,t){if(iB(e)||null===e)return t;if(e instanceof lL)return e;if(function(e){return"string"==typeof e}(e)){var n=e.toLowerCase();return"default"===n?t:"local"===n||"system"===n?uL.instance:"utc"===n||"gmt"===n?PL.utcInstance:PL.parseSpecifier(n)||fL.create(e)}return oB(e)?PL.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new kL(e)}var NL,DL=function(){return Date.now()},LL="system",BL=null,zL=null,UL=null,FL=60,jL=null,HL=function(){function e(){}return e.resetCaches=function(){IL.resetCache(),fL.resetCache()},yD(e,null,[{key:"now",get:function(){return DL},set:function(e){DL=e}},{key:"defaultZone",get:function(){return OL(LL,uL.instance)},set:function(e){LL=e}},{key:"defaultLocale",get:function(){return BL},set:function(e){BL=e}},{key:"defaultNumberingSystem",get:function(){return zL},set:function(e){zL=e}},{key:"defaultOutputCalendar",get:function(){return UL},set:function(e){UL=e}},{key:"defaultWeekSettings",get:function(){return jL},set:function(e){jL=dB(e)}},{key:"twoDigitCutoffYear",get:function(){return FL},set:function(e){FL=e%100}},{key:"throwOnInvalid",get:function(){return NL},set:function(e){NL=e}}]),e}(),GL=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}(),VL=[0,31,59,90,120,151,181,212,243,273,304,334],WL=[0,31,60,91,121,152,182,213,244,274,305,335];function qL(e,t){return new GL("unit out of range","you specified "+t+" (of type "+typeof t+") as a "+e+", which is invalid")}function KL(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 JL(e,t,n){return n+(yB(e)?WL:VL)[t-1]}function QL(e,t){var n=yB(e)?WL:VL,r=n.findIndex((function(e){return e<t}));return{month:r+1,day:t-n[r]}}function YL(e,t){return(e-t+7)%7+1}function XL(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=JL(i,o,s),l=YL(KL(i,o,s),n),c=Math.floor((a-l+14-t)/7);return c<1?c=CB(r=i-1,t,n):c>CB(i,t,n)?(r=i+1,c=1):r=i,bD({weekYear:r,weekNumber:c,weekday:l},RB(e))}function $L(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=YL(KL(i,1,t),n),l=bB(i),c=7*o+s-a-7+t;c<1?c+=bB(r=i-1):c>l?(r=i+1,c-=bB(i)):r=i;var u=QL(r,c);return bD({year:r,month:u.month,day:u.day},RB(e))}function ZL(e){var t=e.year;return bD({year:t,ordinal:JL(t,e.month,e.day)},RB(e))}function eB(e){var t=e.year,n=QL(t,e.ordinal);return bD({year:t,month:n.month,day:n.day},RB(e))}function tB(e,t){if(!iB(e.localWeekday)||!iB(e.localWeekNumber)||!iB(e.localWeekYear)){if(!iB(e.weekday)||!iB(e.weekNumber)||!iB(e.weekYear))throw new OD("Cannot mix locale-based week fields with ISO-based week fields");return iB(e.localWeekday)||(e.weekday=e.localWeekday),iB(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),iB(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 nB(e){var t=sB(e.year),n=pB(e.month,1,12),r=pB(e.day,1,SB(e.year,e.month));return t?n?!r&&qL("day",e.day):qL("month",e.month):qL("year",e.year)}function rB(e){var t=e.hour,n=e.minute,r=e.second,i=e.millisecond,o=pB(t,0,23)||24===t&&0===n&&0===r&&0===i,s=pB(n,0,59),a=pB(r,0,59),l=pB(i,0,999);return o?s?a?!l&&qL("millisecond",i):qL("second",r):qL("minute",n):qL("hour",t)}function iB(e){return void 0===e}function oB(e){return"number"==typeof e}function sB(e){return"number"==typeof e&&e%1==0}function aB(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function lB(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function cB(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 uB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function dB(e){if(null==e)return null;if("object"!=typeof e)throw new DD("Week settings must be an object");if(!pB(e.firstDay,1,7)||!pB(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some((function(e){return!pB(e,1,7)})))throw new DD("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function pB(e,t,n){return sB(e)&&e>=t&&e<=n}function hB(e,t){return void 0===t&&(t=2),e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0")}function fB(e){return iB(e)||null===e||""===e?void 0:parseInt(e,10)}function mB(e){return iB(e)||null===e||""===e?void 0:parseFloat(e)}function gB(e){if(!iB(e)&&null!==e&&""!==e){var t=1e3*parseFloat("0."+e);return Math.floor(t)}}function vB(e,t,n){void 0===n&&(n=!1);var r=Math.pow(10,t);return(n?Math.trunc:Math.round)(e*r)/r}function yB(e){return e%4==0&&(e%100!=0||e%400==0)}function bB(e){return yB(e)?366:365}function SB(e,t){var n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?yB(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function xB(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 wB(e,t,n){return-YL(KL(e,1,t),n)+t-1}function CB(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r=wB(e,t,n),i=wB(e+1,t,n);return(bB(e)-r+i)/7}function AB(e){return e>99?e:e>HL.twoDigitCutoffYear?1900+e:2e3+e}function EB(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=bD({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 _B(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 MB(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new DD("Invalid unit value "+e);return t}function TB(e,t){var n={};for(var r in e)if(uB(e,r)){var i=e[r];if(null==i)continue;n[t(r)]=MB(i)}return n}function IB(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+hB(n,2)+":"+hB(r,2);case"narrow":return""+i+n+(r>0?":"+r:"");case"techie":return""+i+hB(n,2)+hB(r,2);default:throw new RangeError("Value format "+t+" is out of range for property format")}}function RB(e){return function(e,t){return t.reduce((function(t,n){return t[n]=e[n],t}),{})}(e,["hour","minute","second","millisecond"])}var PB=["January","February","March","April","May","June","July","August","September","October","November","December"],kB=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],OB=["J","F","M","A","M","J","J","A","S","O","N","D"];function NB(e){switch(e){case"narrow":return[].concat(OB);case"short":return[].concat(kB);case"long":return[].concat(PB);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 DB=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],LB=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],BB=["M","T","W","T","F","S","S"];function zB(e){switch(e){case"narrow":return[].concat(BB);case"short":return[].concat(LB);case"long":return[].concat(DB);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var UB=["AM","PM"],FB=["Before Christ","Anno Domini"],jB=["BC","AD"],HB=["B","A"];function GB(e){switch(e){case"narrow":return[].concat(HB);case"short":return[].concat(jB);case"long":return[].concat(FB);default:return null}}function VB(e,t){for(var n,r="",i=TD(e);!(n=i()).done;){var o=n.value;o.literal?r+=o.val:r+=t(o.val)}return r}var WB={D:FD,DD:jD,DDD:GD,DDDD:VD,t:WD,tt:qD,ttt:KD,tttt:JD,T:QD,TT:YD,TTT:XD,TTTT:$D,f:ZD,ff:tL,fff:iL,ffff:sL,F:eL,FF:nL,FFF:oL,FFFF:aL},qB=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 WB[e]};var t=e.prototype;return t.formatWithSystemDefault=function(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,bD({},this.opts,t)).format()},t.dtFormatter=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,bD({},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 hB(e,t);var n=bD({},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 UB[e.hour<12?0:1]}(t):s({hour:"numeric",hourCycle:"h12"},"dayperiod")},c=function(e,n){return i?function(e,t){return NB(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 zB(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 GB(t)[e.year<0?0:1]}(t,e):s({era:e},"era")};return VB(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 VB(s,(r=l,function(e){var t=o(e);return t?i.num(r.get(t),e.length):e}))},e}(),KB=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function JB(){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 QB(){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[bD({},r,a),l||i,c]}),[{},null,1]).slice(0,2)}}function YB(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 XB(){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]]=fB(e[n+r]);return[i,null,n+r]}}var $B=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,ZB=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,ez=RegExp(""+ZB.source+("(?:"+$B.source+"?(?:\\[("+KB.source+")\\])?)?")),tz=RegExp("(?:T"+ez.source+")?"),nz=XB("weekYear","weekNumber","weekDay"),rz=XB("year","ordinal"),iz=RegExp(ZB.source+" ?(?:"+$B.source+"|("+KB.source+"))?"),oz=RegExp("(?: "+iz.source+")?");function sz(e,t,n){var r=e[t];return iB(r)?n:fB(r)}function az(e,t){return[{hours:sz(e,t,0),minutes:sz(e,t+1,0),seconds:sz(e,t+2,0),milliseconds:gB(e[t+3])},null,t+4]}function lz(e,t){var n=!e[t]&&!e[t+1],r=_B(e[t+1],e[t+2]);return[{},n?null:PL.instance(r),t+3]}function cz(e,t){return[{},e[t]?fL.create(e[t]):null,t+1]}var uz=RegExp("^T?"+ZB.source+"$"),dz=/^-?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 pz(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(mB(n)),months:p(mB(r)),weeks:p(mB(i)),days:p(mB(o)),hours:p(mB(s)),minutes:p(mB(a)),seconds:p(mB(l),"-0"===l),milliseconds:p(gB(c),d)}]}var hz={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function fz(e,t,n,r,i,o,s){var a={year:2===t.length?AB(fB(t)):fB(t),month:kB.indexOf(n)+1,day:fB(r),hour:fB(i),minute:fB(o)};return s&&(a.second=fB(s)),e&&(a.weekday=e.length>3?DB.indexOf(e)+1:LB.indexOf(e)+1),a}var mz=/^(?:(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 gz(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=fz(n,o,i,r,s,a,l);return t=c?hz[c]:u?0:_B(d,p),[h,new PL(t)]}var vz=/^(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$/,yz=/^(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$/,bz=/^(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 Sz(e){var t=e[1],n=e[2],r=e[3];return[fz(t,e[4],r,n,e[5],e[6],e[7]),PL.utcInstance]}function xz(e){var t=e[1],n=e[2],r=e[3],i=e[4],o=e[5],s=e[6];return[fz(t,e[7],n,r,i,o,s),PL.utcInstance]}var wz=JB(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,tz),Cz=JB(/(\d{4})-?W(\d\d)(?:-?(\d))?/,tz),Az=JB(/(\d{4})-?(\d{3})/,tz),Ez=JB(ez),_z=QB((function(e,t){return[{year:sz(e,t),month:sz(e,t+1,1),day:sz(e,t+2,1)},null,t+3]}),az,lz,cz),Mz=QB(nz,az,lz,cz),Tz=QB(rz,az,lz,cz),Iz=QB(az,lz,cz);var Rz=QB(az);var Pz=JB(/(\d{4})-(\d\d)-(\d\d)/,oz),kz=JB(iz),Oz=QB(az,lz,cz);var Nz="Invalid Duration",Dz={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}},Lz=bD({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}},Dz),Bz=365.2425,zz=30.436875,Uz=bD({years:{quarters:4,months:12,weeks:52.1775,days:Bz,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:zz,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},Dz),Fz=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],jz=Fz.slice(0).reverse();function Hz(e,t,n){void 0===n&&(n=!1);var r={values:n?t.values:bD({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Wz(r)}function Gz(e,t){for(var n,r,i=null!=(n=t.milliseconds)?n:0,o=TD(jz.slice(1));!(r=o()).done;){var s=r.value;t[s]&&(i+=t[s]*e[s].milliseconds)}return i}function Vz(e,t){var n=Gz(e,t)<0?-1:1;Fz.reduceRight((function(r,i){if(iB(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),Fz.reduce((function(n,r){if(iB(t[r]))return n;if(n){var i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r}),null)}var Wz=function(e){function t(e){var t="longterm"===e.conversionAccuracy||!1,n=t?Uz:Lz;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||IL.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 DD("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new t({values:TB(e,t.normalizeUnit),loc:IL.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})},t.fromDurationLike=function(e){if(oB(e))return t.fromMillis(e);if(t.isDuration(e))return e;if("object"==typeof e)return t.fromObject(e);throw new DD("Unknown duration argument "+e+" of type "+typeof e)},t.fromISO=function(e,n){var r=function(e){return YB(e,[dz,pz])}(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 YB(e,[uz,Rz])}(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 DD("need to specify a reason the Duration is invalid");var r=e instanceof GL?e:new GL(e,n);if(HL.throwOnInvalid)throw new kD(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 ND(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=bD({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?qB.create(this.loc,n).formatDurationFromString(this,e):Nz},n.toHuman=function(e){var t=this;if(void 0===e&&(e={}),!this.isValid)return Nz;var n=Fz.map((function(n){var r=t.values[n];return iB(r)?null:t.loc.numberFormatter(bD({style:"unit",unitDisplay:"long"},e,{unit:n.slice(0,-1)})).format(r)})).filter((function(e){return e}));return this.loc.listFormatter(bD({type:"conjunction",style:e.listStyle||"narrow"},e)).format(n)},n.toObject=function(){return this.isValid?bD({},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+=vB(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=bD({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e,{includeOffset:!1}),zU.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?Gz(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=Fz;i<o.length;i++){var s=o[i];(uB(n.values,s)||uB(this.values,s))&&(r[s]=n.get(s)+this.get(s))}return Hz(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]=MB(e(this.values[i],i))}return Hz(this,{values:t},!0)},n.get=function(e){return this[t.normalizeUnit(e)]},n.set=function(e){return this.isValid?Hz(this,{values:bD({},this.values,TB(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 Hz(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 Vz(this.matrix,e),Hz(this,{values:e},!0)},n.rescale=function(){return this.isValid?Hz(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=Fz;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;oB(a[u])&&(d+=a[u]);var h=Math.trunc(d);o[u]=h,s[u]=(1e3*d-1e3*h)/1e3}else oB(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 Vz(this.matrix,o),Hz(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 Hz(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=Fz;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},yD(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")),qz="Invalid Interval";var Kz=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 DD("need to specify a reason the Interval is invalid");var r=e instanceof GL?e:new GL(e,n);if(HL.throwOnInvalid)throw new PD(r);return new t({invalid:r})},t.fromDateTimes=function(e,n){var r=UU(e),i=UU(n),o=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?Kz.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:Kz.invalid("missing or invalid end"):Kz.invalid("missing or invalid start")}(r,i);return null==o?new t({start:r,end:i}):o},t.after=function(e,n){var r=Wz.fromDurationLike(n),i=UU(e);return t.fromDateTimes(i,i.plus(r))},t.before=function(e,n){var r=Wz.fromDurationLike(n),i=UU(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=zU.fromISO(i,n)).isValid}catch(e){a=!1}try{c=(l=zU.fromISO(o,n)).isValid}catch(e){c=!1}if(a&&c)return t.fromDateTimes(s,l);if(a){var u=Wz.fromISO(o,n);if(u.isValid)return t.after(s,u)}else if(c){var d=Wz.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(UU).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=Wz.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=TD(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()+")":qz},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=FD),void 0===t&&(t={}),this.isValid?qB.create(this.s.loc.clone(t),e).formatInterval(this):qz},n.toISO=function(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):qz},n.toISODate=function(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():qz},n.toISOTime=function(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):qz},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):qz},n.toDuration=function(e,t){return this.isValid?this.e.diff(this.s,e,t):Wz.invalid(this.invalidReason)},n.mapEndpoints=function(e){return t.fromDateTimes(e(this.s),e(this.e))},yD(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")),Jz=function(){function e(){}return e.hasDST=function(e){void 0===e&&(e=HL.defaultZone);var t=zU.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset},e.isValidIANAZone=function(e){return fL.isValidZone(e)},e.normalizeZone=function(e){return OL(e,HL.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)||IL.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)||IL.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)||IL.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||IL.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||IL.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)||IL.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)||IL.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 IL.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 IL.create(r,null,"gregory").eras(e)},e.features=function(){return{relative:aB(),localeWeek:lB()}},e}();function Qz(e,t){var n=function(e){return e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf()},r=n(t)-n(e);return Math.floor(Wz.fromMillis(r).as("days"))}function Yz(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=Qz(e,t);return(n-n%7)/7}],["days",Qz]],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=Wz.fromObject(s,r);return u.length>0?(p=Wz.fromMillis(c,r)).shiftTo.apply(p,u).plus(h):h}var Xz={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},$z={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]},Zz=Xz.hanidec.replace(/[\[|\]]/g,"").split("");function eU(e,t){var n=e.numberingSystem;return void 0===t&&(t=""),new RegExp(""+Xz[n||"latn"]+t)}function tU(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(Xz.hanidec))t+=Zz.indexOf(e[n]);else for(var i in $z){var o=$z[i],s=o[0],a=o[1];r>=s&&r<=a&&(t+=r-s)}}return parseInt(t,10)}return t}(n))}}}var nU="[ "+String.fromCharCode(160)+"]",rU=new RegExp(nU,"g");function iU(e){return e.replace(/\./g,"\\.?").replace(rU,nU)}function oU(e){return e.replace(/\./g,"").replace(rU," ").toLowerCase()}function sU(e,t){return null===e?null:{regex:RegExp(e.map(iU).join("|")),deser:function(n){var r=n[0];return e.findIndex((function(e){return oU(r)===oU(e)}))+t}}}function aU(e,t){return{regex:e,deser:function(e){return _B(e[1],e[2])},groups:t}}function lU(e){return{regex:e,deser:function(e){return e[0]}}}var cU={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 uU=null;function dU(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=hU(qB.macroTokenToFormatOpts(e.val),t);return null==n||n.includes(void 0)?e:n}(e,t)})))}function pU(e,t,n){var r=dU(qB.parseFormat(n),e),i=r.map((function(t){return n=t,i=eU(r=e),o=eU(r,"{2}"),s=eU(r,"{3}"),a=eU(r,"{4}"),l=eU(r,"{6}"),c=eU(r,"{1,2}"),u=eU(r,"{1,3}"),d=eU(r,"{1,6}"),p=eU(r,"{1,9}"),h=eU(r,"{2,4}"),f=eU(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 sU(r.eras("short"),0);case"GG":return sU(r.eras("long"),0);case"y":return tU(d);case"yy":case"kk":return tU(h,AB);case"yyyy":case"kkkk":return tU(a);case"yyyyy":return tU(f);case"yyyyyy":return tU(l);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return tU(c);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return tU(o);case"MMM":return sU(r.months("short",!0),1);case"MMMM":return sU(r.months("long",!0),1);case"LLL":return sU(r.months("short",!1),1);case"LLLL":return sU(r.months("long",!1),1);case"o":case"S":return tU(u);case"ooo":case"SSS":return tU(s);case"u":return lU(p);case"uu":return lU(c);case"uuu":case"E":case"c":return tU(i);case"a":return sU(r.meridiems(),0);case"EEE":return sU(r.weekdays("short",!1),1);case"EEEE":return sU(r.weekdays("long",!1),1);case"ccc":return sU(r.weekdays("short",!0),1);case"cccc":return sU(r.weekdays("long",!0),1);case"Z":case"ZZ":return aU(new RegExp("([+-]"+c.source+")(?::("+o.source+"))?"),2);case"ZZZ":return aU(new RegExp("([+-]"+c.source+")("+o.source+")?"),2);case"z":return lU(/[a-z_+-/]{1,256}?/i);case" ":return lU(/[^\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(uB(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;iB(e.z)||(n=fL.create(e.z)),iB(e.Z)||(n||(n=new PL(e.Z)),t=e.Z),iB(e.q)||(e.M=3*(e.q-1)+1),iB(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),iB(e.u)||(e.S=gB(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(uB(p,"a")&&uB(p,"H"))throw new OD("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 hU(e,t){if(!e)return null;var n=qB.create(t,e).dtFormatter((uU||(uU=zU.fromMillis(1555555555555)),uU)),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=cU[a];if("object"==typeof l&&(l=l[s]),l)return{literal:!1,val:l}}(t,e,i)}))}var fU="Invalid DateTime",mU=864e13;function gU(e){return new GL("unsupported zone",'the zone "'+e.name+'" is not supported')}function vU(e){return null===e.weekData&&(e.weekData=XL(e.c)),e.weekData}function yU(e){return null===e.localWeekData&&(e.localWeekData=XL(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function bU(e,t){var n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new zU(bD({},n,t,{old:n}))}function SU(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 xU(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 wU(e,t,n){return SU(xB(e),t,n)}function CU(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=bD({},e.c,{year:r,month:i,day:Math.min(e.c.day,SB(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)}),s=Wz.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=SU(xB(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 AU(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=zU.fromObject(e,bD({},n,{zone:l,specificOffset:o}));return s?c:c.setZone(a)}return zU.invalid(new GL("unparsable",'the input "'+i+"\" can't be parsed as "+r))}function EU(e,t,n){return void 0===n&&(n=!0),e.isValid?qB.create(IL.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function _U(e,t){var n=e.c.year>9999||e.c.year<0,r="";return n&&e.c.year>=0&&(r+="+"),r+=hB(e.c.year,n?6:4),t?(r+="-",r+=hB(e.c.month),r+="-",r+=hB(e.c.day)):(r+=hB(e.c.month),r+=hB(e.c.day)),r}function MU(e,t,n,r,i,o){var s=hB(e.c.hour);return t?(s+=":",s+=hB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=":")):s+=hB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=hB(e.c.second),0===e.c.millisecond&&r||(s+=".",s+=hB(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!o?s+="Z":e.o<0?(s+="-",s+=hB(Math.trunc(-e.o/60)),s+=":",s+=hB(Math.trunc(-e.o%60))):(s+="+",s+=hB(Math.trunc(e.o/60)),s+=":",s+=hB(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}var TU={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},IU={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},RU={ordinal:1,hour:0,minute:0,second:0,millisecond:0},PU=["year","month","day","hour","minute","second","millisecond"],kU=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],OU=["year","ordinal","hour","minute","second","millisecond"];function NU(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 ND(e);return t}(e)}}function DU(e,t){var n,r,i=OL(t.zone,HL.defaultZone),o=IL.fromObject(t),s=HL.now();if(iB(e.year))n=s;else{for(var a=0,l=PU;a<l.length;a++){var c=l[a];iB(e[c])&&(e[c]=TU[c])}var u=nB(e)||rB(e);if(u)return zU.invalid(u);var d=wU(e,i.offset(s),i);n=d[0],r=d[1]}return new zU({ts:n,zone:i,loc:o,o:r})}function LU(e,t,n){var r=!!iB(n.round)||n.round,i=function(e,i){return e=vB(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=TD(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 BU(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 zU=function(e){function t(e){var t=e.zone||HL.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new GL("invalid input"):null)||(t.isValid?null:gU(t));this.ts=iB(e.ts)?HL.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=xU(this.ts,s),r=(n=Number.isNaN(r.year)?new GL("invalid input"):null)?null:r,i=n?null:s}this._zone=t,this.loc=e.loc||IL.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=BU(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 DU({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:c},t)},t.utc=function(){var e=BU(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=PL.utcInstance,DU({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=OL(n.zone,HL.defaultZone);return i.isValid?new t({ts:r,zone:i,loc:IL.fromObject(n)}):t.invalid(gU(i))},t.fromMillis=function(e,n){if(void 0===n&&(n={}),oB(e))return e<-864e13||e>mU?t.invalid("Timestamp out of range"):new t({ts:e,zone:OL(n.zone,HL.defaultZone),loc:IL.fromObject(n)});throw new DD("fromMillis requires a numerical input, but received a "+typeof e+" with value "+e)},t.fromSeconds=function(e,n){if(void 0===n&&(n={}),oB(e))return new t({ts:1e3*e,zone:OL(n.zone,HL.defaultZone),loc:IL.fromObject(n)});throw new DD("fromSeconds requires a numerical input")},t.fromObject=function(e,n){void 0===n&&(n={}),e=e||{};var r=OL(n.zone,HL.defaultZone);if(!r.isValid)return t.invalid(gU(r));var i=IL.fromObject(n),o=TB(e,NU),s=tB(o,i),a=s.minDaysInFirstWeek,l=s.startOfWeek,c=HL.now(),u=iB(n.specificOffset)?r.offset(c):n.specificOffset,d=!iB(o.ordinal),p=!iB(o.year),h=!iB(o.month)||!iB(o.day),f=p||h,m=o.weekYear||o.weekNumber;if((f||d)&&m)throw new OD("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&d)throw new OD("Can't mix ordinal dates with month/day");var g,v,y=m||o.weekday&&!f,b=xU(c,u);y?(g=kU,v=IU,b=XL(b,a,l)):d?(g=OU,v=RU,b=ZL(b)):(g=PU,v=TU);for(var S,x=!1,w=TD(g);!(S=w()).done;){var C=S.value;iB(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=sB(e.weekYear),i=pB(e.weekNumber,1,CB(e.weekYear,t,n)),o=pB(e.weekday,1,7);return r?i?!o&&qL("weekday",e.weekday):qL("week",e.weekNumber):qL("weekYear",e.weekYear)}(o,a,l):d?function(e){var t=sB(e.year),n=pB(e.ordinal,1,bB(e.year));return t?!n&&qL("ordinal",e.ordinal):qL("year",e.year)}(o):nB(o),E=A||rB(o);if(E)return t.invalid(E);var _=wU(y?$L(o,a,l):d?eB(o):o,u,r),M=new t({ts:_[0],zone:r,o:_[1],loc:i});return o.weekday&&f&&e.weekday!==M.weekday?t.invalid("mismatched weekday","you can't specify both a weekday of "+o.weekday+" and a date of "+M.toISO()):M},t.fromISO=function(e,t){void 0===t&&(t={});var n=function(e){return YB(e,[wz,_z],[Cz,Mz],[Az,Tz],[Ez,Iz])}(e);return AU(n[0],n[1],t,"ISO 8601",e)},t.fromRFC2822=function(e,t){void 0===t&&(t={});var n=function(e){return YB(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[mz,gz])}(e);return AU(n[0],n[1],t,"RFC 2822",e)},t.fromHTTP=function(e,t){void 0===t&&(t={});var n=function(e){return YB(e,[vz,Sz],[yz,Sz],[bz,xz])}(e);return AU(n[0],n[1],t,"HTTP",t)},t.fromFormat=function(e,n,r){if(void 0===r&&(r={}),iB(e)||iB(n))throw new DD("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=pU(e,t,n);return[r.result,r.zone,r.specificOffset,r.invalidReason]}(IL.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):AU(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 YB(e,[Pz,_z],[kz,Oz])}(e);return AU(n[0],n[1],t,"SQL",e)},t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new DD("need to specify a reason the DateTime is invalid");var r=e instanceof GL?e:new GL(e,n);if(HL.throwOnInvalid)throw new RD(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=hU(e,IL.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={}),dU(qB.parseFormat(e),IL.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=xB(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=xU(a,o),u=xU(l,s);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[bU(this,{ts:a}),bU(this,{ts:l})]:[this]},n.resolvedLocaleOptions=function(e){void 0===e&&(e={});var t=qB.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(PL.instance(e),t)},n.toLocal=function(){return this.setZone(HL.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=OL(e,HL.defaultZone)).equals(this.zone))return this;if(e.isValid){var l=this.ts;if(o||a){var c=e.offset(this.ts);l=wU(this.toObject(),c,e)[0]}return bU(this,{ts:l,zone:e})}return t.invalid(gU(e))},n.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.outputCalendar;return bU(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=TB(e,NU),r=tB(n,this.loc),i=r.minDaysInFirstWeek,o=r.startOfWeek,s=!iB(n.weekYear)||!iB(n.weekNumber)||!iB(n.weekday),a=!iB(n.ordinal),l=!iB(n.year),c=!iB(n.month)||!iB(n.day),u=l||c,d=n.weekYear||n.weekNumber;if((u||a)&&d)throw new OD("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new OD("Can't mix ordinal dates with month/day");s?t=$L(bD({},XL(this.c,i,o),n),i,o):iB(n.ordinal)?(t=bD({},this.toObject(),n),iB(n.day)&&(t.day=Math.min(SB(t.year,t.month),t.day))):t=eB(bD({},ZL(this.c),n));var p=wU(t,this.o,this.zone);return bU(this,{ts:p[0],o:p[1]})},n.plus=function(e){return this.isValid?bU(this,CU(this,Wz.fromDurationLike(e))):this},n.minus=function(e){return this.isValid?bU(this,CU(this,Wz.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=Wz.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?qB.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):fU},n.toLocaleString=function(e,t){return void 0===e&&(e=FD),void 0===t&&(t={}),this.isValid?qB.create(this.loc.clone(t),e).formatDateTime(this):fU},n.toLocaleParts=function(e){return void 0===e&&(e={}),this.isValid?qB.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=_U(this,p);return h+="T",h+=MU(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?_U(this,"extended"===n):null},n.toISOWeekDate=function(){return EU(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":"")+MU(this,"extended"===h,o,r,a,d):null},n.toRFC2822=function(){return EU(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},n.toHTTP=function(){return EU(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},n.toSQLDate=function(){return this.isValid?_U(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")),EU(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():fU},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=bD({},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 Wz.invalid("created by diffing an invalid DateTime");var r,i=bD({locale:this.locale,numberingSystem:this.numberingSystem},n),o=(r=t,Array.isArray(r)?r:[r]).map(Wz.normalizeUnit),s=e.valueOf()>this.valueOf(),a=Yz(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?Kz.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),LU(n,this.plus(r),bD({},e,{numeric:"always",units:i,unit:o}))},n.toRelativeCalendar=function(e){return void 0===e&&(e={}),this.isValid?LU(e.base||t.fromObject({},{zone:this.zone}),this,bD({},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 DD("min requires all arguments be DateTimes");return cB(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 DD("max requires all arguments be DateTimes");return cB(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 pU(IL.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)},yD(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?vU(this).weekYear:NaN}},{key:"weekNumber",get:function(){return this.isValid?vU(this).weekNumber:NaN}},{key:"weekday",get:function(){return this.isValid?vU(this).weekday:NaN}},{key:"isWeekend",get:function(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}},{key:"localWeekday",get:function(){return this.isValid?yU(this).weekday:NaN}},{key:"localWeekNumber",get:function(){return this.isValid?yU(this).weekNumber:NaN}},{key:"localWeekYear",get:function(){return this.isValid?yU(this).weekYear:NaN}},{key:"ordinal",get:function(){return this.isValid?ZL(this.c).ordinal:NaN}},{key:"monthShort",get:function(){return this.isValid?Jz.months("short",{locObj:this.loc})[this.month-1]:null}},{key:"monthLong",get:function(){return this.isValid?Jz.months("long",{locObj:this.loc})[this.month-1]:null}},{key:"weekdayShort",get:function(){return this.isValid?Jz.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}},{key:"weekdayLong",get:function(){return this.isValid?Jz.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 yB(this.year)}},{key:"daysInMonth",get:function(){return SB(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?bB(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?CB(this.weekYear):NaN}},{key:"weeksInLocalWeekYear",get:function(){return this.isValid?CB(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}}],[{key:"DATE_SHORT",get:function(){return FD}},{key:"DATE_MED",get:function(){return jD}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return HD}},{key:"DATE_FULL",get:function(){return GD}},{key:"DATE_HUGE",get:function(){return VD}},{key:"TIME_SIMPLE",get:function(){return WD}},{key:"TIME_WITH_SECONDS",get:function(){return qD}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return KD}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return JD}},{key:"TIME_24_SIMPLE",get:function(){return QD}},{key:"TIME_24_WITH_SECONDS",get:function(){return YD}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return XD}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return $D}},{key:"DATETIME_SHORT",get:function(){return ZD}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return eL}},{key:"DATETIME_MED",get:function(){return tL}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return nL}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return rL}},{key:"DATETIME_FULL",get:function(){return iL}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return oL}},{key:"DATETIME_HUGE",get:function(){return sL}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return aL}}]),t}(Symbol.for("nodejs.util.inspect.custom"));function UU(e){if(zU.isDateTime(e))return e;if(e&&e.valueOf&&oB(e.valueOf()))return zU.fromJSDate(e);if(e&&"object"==typeof e)return zU.fromObject(e);throw new DD("Unknown datetime argument: "+e+", of type "+typeof e)}gD.DateTime=zU,gD.Duration=Wz,gD.FixedOffsetZone=PL,gD.IANAZone=fL,gD.Info=Jz,gD.Interval=Kz,gD.InvalidZone=kL,gD.Settings=HL,gD.SystemZone=uL,gD.VERSION="3.4.4",gD.Zone=lL;c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");function FU(e,t){let[n,r]=(0,c.useState)(e),i=Ya(e);return Qa((()=>r(i.current)),[i,r,...t]),n}var jU=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(jU||{}),HU=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(HU||{}),GU=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(GU||{}),VU=(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))(VU||{});function WU(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=Ml(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 qU={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 za(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=WU(e),i=Id(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=WU(e,(e=>[...e,n]));if(null===e.activeOptionIndex){let{value:i,mode:o,compare:s}=e.propsRef.current,a=t.dataRef.current.value;za(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=WU(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},KU=(0,c.createContext)(null);function JU(e){let t=(0,c.useContext)(KU);if(null===t){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,JU),t}return t}function QU(e,t){return za(t.type,qU,e,t)}KU.displayName="ListboxContext";let YU=c.Fragment,XU=Wa((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=el(n),[m,g]=Vf(r,s,i),v=(0,c.useReducer)(QU,{listboxState:1,propsRef:{current:{value:m,onChange:g,mode:d?1:0,compare:Xa("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,Qa((()=>{b.current.onChange=e=>za(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]),Qa((()=>w({type:2,disabled:l})),[l]),Qa((()=>w({type:3,orientation:h})),[h]),dc([x,S],((e,t)=>{var n;w({type:1}),Cl(t,wl.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(KU.Provider,{value:v},t(c).createElement(sc,{value:za(y,{0:ic.Open,1:ic.Closed})},null!=o&&null!=m&&Ff({[o]:m}).map((([e,n])=>t(c).createElement(dl,{features:ul.Hidden,...qa({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:n})}))),Ha({ourProps:A,theirProps:p,slot:C,defaultTag:YU,name:"Listbox"})))})),$U=Wa((function(e,t){var n;let[r,i]=JU("Listbox.Button"),o=el(r.buttonRef,t),s=`headlessui-listbox-button-${cl()}`,a=Pc(),l=Xa((e=>{switch(e.key){case nl.Space:case nl.Enter:case nl.ArrowDown:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Td.First})}));break;case nl.ArrowUp:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Td.Last})}))}})),u=Xa((e=>{if(e.key===nl.Space)e.preventDefault()})),d=Xa((e=>{if(rl(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=FU((()=>{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 Ha({ourProps:{ref:o,id:s,type:kd(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"})})),ZU=Wa((function(e,t){let[n]=JU("Listbox.Label"),r=`headlessui-listbox-label-${cl()}`;return Ha({ourProps:{ref:el(n.labelRef,t),id:r,onClick:Xa((()=>{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"})})),eF=Fa.RenderStrategy|Fa.Static,tF=Wa((function(e,t){var n;let[r,i]=JU("Listbox.Options"),o=el(r.optionsRef,t),s=`headlessui-listbox-options-${cl()}`,a=Pc(),l=Pc(),u=oc(),d=null!==u?u===ic.Open:0===r.listboxState;(0,c.useEffect)((()=>{var e;let t=r.optionsRef.current;!t||0===r.listboxState&&t!==(null==(e=fl(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})}),[r.listboxState,r.optionsRef]);let p=Xa((e=>{switch(l.dispose(),e.key){case nl.Space:if(""!==r.searchQuery)return e.preventDefault(),e.stopPropagation(),i({type:5,value:e.key});case nl.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}),hl().nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})})));break;case za(r.orientation,{vertical:nl.ArrowDown,horizontal:nl.ArrowRight}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Td.Next});case za(r.orientation,{vertical:nl.ArrowUp,horizontal:nl.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Td.Previous});case nl.Home:case nl.PageUp:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Td.First});case nl.End:case nl.PageDown:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Td.Last});case nl.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 nl.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(i({type:5,value:e.key}),l.setTimeout((()=>i({type:6})),350))}})),h=FU((()=>{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 Ha({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:eF,visible:d,name:"Listbox.Options"})})),nF=Wa((function(e,t){let{disabled:n=!1,value:r,...i}=e,[o,s]=JU("Listbox.Option"),a=`headlessui-listbox-option-${cl()}`,l=null!==o.activeOptionIndex&&o.options[o.activeOptionIndex].id===a,{value:u,compare:d}=o.propsRef.current,p=za(o.propsRef.current.mode,{1:()=>u.some((e=>d(e,r))),0:()=>d(u,r)}),h=(0,c.useRef)(null),f=el(t,h);Qa((()=>{if(0!==o.listboxState||!l||0===o.activationTrigger)return;let e=hl();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});Qa((()=>{m.current.disabled=n}),[m,n]),Qa((()=>{m.current.value=r}),[m,r]),Qa((()=>{var e,t;m.current.textValue=null==(t=null==(e=h.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[m,h]);let g=Xa((()=>o.propsRef.current.onChange(r)));Qa((()=>(s({type:7,id:a,dataRef:m}),()=>s({type:8,id:a}))),[m,a]);let v=Xa((e=>{if(n)return e.preventDefault();g(),0===o.propsRef.current.mode&&(s({type:1}),hl().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})})))})),y=Xa((()=>{if(n)return s({type:4,focus:Td.Nothing});s({type:4,focus:Td.Specific,id:a})})),b=Xa((()=>{n||l||s({type:4,focus:Td.Specific,id:a,trigger:0})})),S=Xa((()=>{n||!l||s({type:4,focus:Td.Nothing})})),x=(0,c.useMemo)((()=>({active:l,selected:p,disabled:n})),[l,p,n]);return Ha({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"})})),rF=Object.assign(XU,{Button:$U,Label:ZU,Options:tF,Option:nF});var iF=({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 oF={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"]},sF=(0,c.memo)((({defaultDate:e,onChange:t,disabled:n=!1})=>{const{t:r,i18n:i}=be(),[o,a]=(0,c.useState)(e?"string"==typeof e?gD.DateTime.fromISO(e):gD.DateTime.fromJSDate(e):gD.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)(rF,{value:o,onChange:e=>{a(e)},disabled:n,name:"day",children:[(0,s.jsxs)(rF.Label,{className:"memori--date-selector__select-label",children:[r("day"),":"]}),(0,s.jsxs)(rF.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)(iF,{})})]}),(0,s.jsx)(Kc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(rF.Options,{className:"memori--date-selector__select-options",children:[...Array(31).keys()].map((e=>(0,s.jsx)(rF.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)(rF,{value:o,onChange:e=>{a(e)},disabled:n,name:"month",children:[(0,s.jsxs)(rF.Label,{className:"memori--date-selector__select-label",children:[r("month"),":"]}),(0,s.jsxs)(rF.Button,{"aria-label":r("month"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:oF["it"===i.language?"it":"en"][o.month-1]}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(iF,{})})]}),(0,s.jsx)(Kc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(rF.Options,{className:"memori--date-selector__select-options",children:oF["it"===i.language?"it":"en"].map((e=>(0,s.jsx)(rF.Option,{className:"memori--date-selector__select-option",value:o.set({month:oF["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)(rF,{value:o,onChange:e=>{a(e)},disabled:n,name:"year",children:[(0,s.jsxs)(rF.Label,{className:"memori--date-selector__select-label",children:[r("year"),":"]}),(0,s.jsxs)(rF.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)(iF,{})})]}),(0,s.jsx)(Kc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(rF.Options,{className:"memori--date-selector__select-options",children:[...Array(gD.DateTime.now().year-1899).keys()].sort(((e,t)=>t-e)).map((e=>(0,s.jsx)(rF.Option,{value:o.set({year:e+1900}),className:"memori--date-selector__select-option",children:e+1900},e)))})})]})})]})}));sF.displayName="DateSelector";var aF=sF;c=o("85Hg2");var lF=({visible:e=!1,onClose:n,minAge:r})=>{const{t:i}=be(),[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(ws).error(i("requiredField")),u(i("requiredField")||"Required field"),void p(!1);if(gD.DateTime.now().diff(o,"years").years<r)return t(ws).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)(Yc,{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)(aF,{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)(Ba,{primary:!0,htmlType:"submit",className:"age-verification-submit",loading:d,disabled:!o,children:i("confirm")})})]})]})};c=o("85Hg2");var cF=({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)(Kc,{appear:!0,show:e,as:t(c).Fragment,children:(0,s.jsxs)(Ec,{open:e,onClose:n,className:t(Ss)("memori-drawer",r),children:[(0,s.jsx)(Kc.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)(Kc.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)(Ec.Panel,{className:t(Ss)("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)(Ba,{shape:"circle",outlined:!0,icon:(0,s.jsx)(Qc,{}),onClick:()=>n(!1)})}),(0,s.jsxs)(Jc,{spinning:u,children:[i&&(0,s.jsx)(Ec.Title,{className:"memori-drawer--title",children:i}),o&&(0,s.jsx)(Ec.Description,{className:"memori-drawer--description",children:o}),a,l&&(0,s.jsx)("div",{className:"memori-drawer--footer",children:l})]})]})})})})]})});c=o("85Hg2");var uF=({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(Ss)("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 dF=({className:e,value:n,displayValue:r,options:i,onChange:o,disabled:a=!1,label:l,placeholder:u})=>(0,s.jsx)("div",{className:t(Ss)("memori-select",e),children:(0,s.jsxs)(rF,{value:n,onChange:e=>{o(e)},disabled:a,name:"day",children:[l&&(0,s.jsxs)(rF.Label,{className:"memori-select--label",children:[l,":"]}),(0,s.jsxs)(rF.Button,{"aria-label":l,className:"memori-select--button",children:[(0,s.jsx)("span",{className:t(Ss)("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)(iF,{})})]}),(0,s.jsx)(Kc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(rF.Options,{className:"memori-select--options",children:i.map((e=>(0,s.jsx)(rF.Option,{value:e.value,className:"memori-select--option",children:e.label},e.value)))})})]})});const pF={muteSpeaker:"@memori:muteSpeaker",microphoneMode:"@memori:microphoneMode",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",sendOnEnter:"@memori:sendOnEnter",birthDate:"@memori:birthDate",controlsPosition:"@memori:controlsPosition",hideEmissions:"@memori:hideEmissions",loginToken:"@memori:loginToken"},hF=(e,t)=>{var n;try{const r=window.localStorage.getItem(null!==(n=pF[e])&&void 0!==n?n:e);if(!r)return t;try{return JSON.parse(r)}catch(e){return r}}catch(e){return console.error("error",e),t}},fF=(e,t)=>{var n;try{window.localStorage.setItem(null!==(n=pF[e])&&void 0!==n?n:e,t.toString())}catch(e){console.error("error",e)}},mF=e=>{var t;try{window.localStorage.removeItem(null!==(t=pF[e])&&void 0!==t?t:e)}catch(e){console.error("error",e)}},gF=[2,3,5,10,15,20,30,60];var vF=({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}=be();return(0,s.jsxs)(cF,{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)(em,{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),fF("microphoneMode",t)},children:[(0,s.jsx)(em.Option,{value:"HOLD_TO_TALK",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Ba,{primary:e,outlined:!e,children:h("write_and_speak.holdToSpeak")||"Hold to speak"})}),(0,s.jsx)(em.Option,{value:"CONTINUOUS",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Ba,{primary:e,outlined:!e,children:h("write_and_speak.continuousSpeechLabel")||"Continuous speech"})})]})]}),"CONTINUOUS"===r&&(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(dF,{label:h("write_and_speak.secondsLabel")||"Seconds",placeholder:h("write_and_speak.secondsLabel")||"Seconds",options:gF.map((e=>({value:e,label:e}))),value:i,onChange:e=>{a(e),fF("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)(em,{id:"controlsPosition",name:"controlsPosition",value:l,defaultValue:l,className:"memori-settings-drawer--controlsposition-radio",onChange:e=>{c(e),fF("controlsPosition",e)},children:[(0,s.jsx)(em.Option,{value:"center",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Ba,{primary:e,outlined:!e,children:h("center")||"Center"})}),(0,s.jsx)(em.Option,{value:"bottom",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Ba,{primary:e,outlined:!e,children:h("bottom")||"Bottom"})})]})]}),(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(uF,{label:h("write_and_speak.hideEmissionsLabel")||"Hide emissions",name:"hideControls",checked:u,onChange:e=>{d(e.target.checked),fF("hideEmissions",e.target.checked)}})})]}),p&&(0,s.jsx)("div",{className:"memori-settings-drawer--field controls",children:p})]})};c=o("85Hg2");const yF=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,TENANT_ALREADY_EXISTS:-6,TENANT_MISSING_DESCRIPTION:-7,TENANT_CANT_SET_COMPLETION_PROVIDER:-8,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_TOO_MANY_ATTEMPTS:-38,USER_MUST_ACCEPT_TNC_AND_PP:-39,USER_BIRTH_DATE_CANT_BE_CHANGED:-40,USER_CANT_SET_COMPLETION_PROVIDER:-41,USER_CANT_ENABLE_DEEP_THOUGHT:-42,USER_CANT_ENABLE_DCM_INTEGRATION:-43,USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS:-44,MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS:-45,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,SESSION_EXPIRED:-103,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_DEEP_THOUGHT_REQUIRES_COMPLETIONS:-215,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,MEMORI_FEATURE_REQUIRES_SUBSCRIPTION:-271,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,NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD:-1001,PROCESS_INVALID_TYPE:-1401,PROCESS_ALREADY_RUNNING:-1401,PROCESS_NOT_FOUND:-1402,IMPORTCSV_MISSING_ROWS:-1501,IMPORTCSV_MISSING_CSV:-1502,IMPORTCSV_MISSING_SEPARATOR:-1503,IMPORTCSV_INVALID_SEPARATOR:-1504,IMPORTCSV_MISSING_HEADERS:-1505,IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR:-1506,IMPORTCSV_UNDETECTABLE_CHAR_ENCODING:-1521,IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI:-1531,IMPORTTXT_MISSING_ROWS:-1601,IMPORTTXT_INVALID_GRANULARITY:-1602,IMPORTTXT_UNDETECTABLE_CHAR_ENCODING:-1621,IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI:-1631,IMPORTTXT_IMPORT_LIMIT_EXCEEDED:-1632,IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY:-1633,IMPORTTXT_IMPORT_REQUIRES_PAYING:-1634,EXPORTCSV_MISSING_CSV_SPECS:-1801,EXPORTCSV_MISSING_SEPARATOR:-1802,EXPORTCSV_INVALID_SEPARATOR:-1803,EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR:-1804,EXPORTCSV_MISSING_NEW_LINE_CHAR:-1805,EXPORTCSV_INVALID_NEW_LINE_CHAR:-1806,EXPORTCSV_MISSING_PASSWORD:-1811,EXPORTJSONL_MISSING_JSONL_SPECS:-1821,EXPORTJSONL_MISSING_PLATFORM:-1822,EXPORTJSONL_INVALID_PLATFORM:-1823,EXPORTJSONL_MISSING_PASSWORD:-1831,EXPORTJSONL_EXPORT_REQUIRES_PAYING:-1832,ANALYSIS_MISSING_QUERY:-1901,ANALYSIS_CANT_ANALYZE_SECRET_MEMORI:-1902,ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT:-1903,BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS:-2001,BADGE_ASSIGNMENT_MISSING_REF_ID:-2002,BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND:-2003,BADGE_ASSIGNMENT_MISSING_ASSERTION_URL:-2004,BADGE_ASSIGNMENT_MISSING_BADGE_URL:-2005,BADGE_ASSIGNMENT_MISSING_ISSUER_URL:-2006,BADGE_ASSIGNMENT_INVALID_URL:-2007,BADGE_ASSIGNMENT_MISSING_RECIPIENT:-2021,BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE:-2022,BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY:-2023,BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE:-2024,BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE:-2025,BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY:-2026,BADGE_NOT_FOUND:-2051,OUTCOME_NO_DCM_CONFIGURED:-2071,OUTCOME_USER_BADGES_DISABLED:-2072}).map((([e,t])=>[t,e]))),bF=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=yF.get(e);return t?`errors.${t}`:"error.generic"};var SF=({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 xF=({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 wF=({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 CF=({apiURL:e,sessionID:n,memori:r,visible:i=!0,initialKnownFacts:o=[],closeDrawer:a})=>{var l;const{t:u}=be(),d=J(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(ws).error(u(bF(a.resultCode))))}catch(e){console.error("KNOWN_FACTS/FETCH",e),m(null!=o?o:[])}C(!1)}};(0,c.useEffect)((()=>{A()}),[]);const[E,_]=(0,c.useState)(!1),[M,T]=(0,c.useState)(),[I,R]=(0,c.useState)([]);return(0,s.jsxs)(cF,{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)(Jc,{spinning:w,children:[(0,s.jsxs)("div",{className:"memori-known-facts-actions",children:[(0,s.jsxs)(Ba,{primary:!0,danger:!0,onClick:()=>{_(!0)},className:"memori-known-facts-delete-selected",disabled:0===(null==I?void 0:I.length),icon:(0,s.jsx)(SF,{}),loading:w,children:[u("selected")," (",null==I?void 0:I.length,")"]}),(0,s.jsx)(Yc,{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:()=>{_(!1)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ba,{ghost:!0,onClick:()=>{_(!1)},children:u("cancel")}),(0,s.jsx)(Ba,{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(ws).success(u("knownFacts.deleteSuccess")),R([]),A(),_(!1);else{let n=e.find((e=>0!==e.resultCode));console.error(n),void 0!==(null==n?void 0:n.resultCode)&&t(ws).error(u(bF(null==n?void 0:n.resultCode)))}}))}catch(e){let n=e;t(ws).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)(Ba,{shape:"circle",disabled:0===y||y<g,padded:!1,title:u("previous")||"Previous",icon:(0,s.jsx)(xF,{}),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)(Ba,{shape:"circle",padded:!1,title:u("next")||"Next",icon:(0,s.jsx)(wF,{}),disabled:(y/g+1)*g>=S,onClick:()=>{let e=(y/g+1)*g;b(e),A(void 0,e,g)}})]}),(0,s.jsx)(dF,{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)(uF,{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)(uF,{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)(Ba,{danger:!0,ghost:!0,shape:"circle",icon:(0,s.jsx)(SF,{}),disabled:(null==I?void 0:I.length)>0,title:u("delete")||"Delete",onClick:()=>T(e.knownFactID)}),(0,s.jsx)(Yc,{className:"memori-known-facts-modal",open:M===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)(Ba,{ghost:!0,onClick:()=>{T(void 0)},children:u("cancel")}),(0,s.jsx)(Ba,{primary:!0,danger:!0,onClick:async()=>{try{const r=await h(n,e.knownFactID);0===r.resultCode?(t(ws).success(u("knownFacts.deleteSuccess")),R([]),A(),T(void 0)):(console.error(r),t(ws).error(u(bF(r.resultCode),{ns:"common"})))}catch(e){let n=e;t(ws).error(u("Error")+n.message)}},children:u("confirm")})]})})]})})]},e.knownFactID)))})]})]})]})};var AF=({open:e=!1,baseUrl:t,apiUrl:n,tenant:r,experts:i,onClose:o})=>{const{t:a}=be();return(0,s.jsx)(cF,{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=Ad({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)))})})};c=o("85Hg2");const EF=/^\w+([.-]?[+]?\w+)*@\w+([.-]?\w+)*(\.\w{2,})+$/;var _F=({open:e=!1,onClose:n,onLogin:r,onLogout:i,user:o,loginToken:a,tenant:l,apiUrl:u,__TEST__needMissingData:d=!1})=>{var p;const{t:h,i18n:f}=be(),m="it"===f.language?"it":"en",g=J(u),{userLogin:v,updateUser:y}=g.backend,[b,S]=(0,c.useState)(!1),[x,w]=(0,c.useState)(d?{token:"token",birthDate:!0,tnCAndPPAccepted:!0}:{}),[C,A]=(0,c.useState)(null),[E,_]=(0,c.useState)(null);(0,c.useEffect)((()=>{_(window.location.href)}),[]);const M=(null==o?void 0:o.userID)&&a;return(0,s.jsx)(cF,{open:e,onClose:n,className:t(Ss)("memori--login-drawer",{"memori--login-drawer--logged":M}),title:(0,s.jsx)("h2",{className:"memori--login-drawer--title",children:M?h("login.loggedDrawerTitle",{name:o.userName}):h("login.loginDrawerTitle")}),children:M?(0,s.jsx)("div",{className:"memori--login-drawer--logged",children:(0,s.jsx)(Ba,{primary:!0,onClick:()=>{i()},children:h("login.logout")})}):(null===(p=null==x?void 0:x.token)||void 0===p?void 0:p.length)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{children:h("login.missingData")}),(0,s.jsx)("p",{children:h("login.missingDataHelper")}),(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:async e=>{var n,i,s;e.preventDefault();const a=e.currentTarget,l=null===(n=a.birthDate)||void 0===n?void 0:n.value,c=null===(i=a.tnCAndPPAccepted)||void 0===i?void 0:i.checked,u=null===(s=a.pAndCUAccepted)||void 0===s?void 0:s.checked;if(!(null==o?void 0:o.userID)||!(null==x?void 0:x.token))return;if(!l||!c)return void A(h("missingData"));let d={userID:o.userID,birthDate:(null==o?void 0:o.birthDate)||!x.birthDate?void 0:l,tnCAndPPAccepted:c||(null==o?void 0:o.tnCAndPPAccepted),tnCAndPPAcceptanceDate:c?(new Date).toISOString():void 0,pAndCUAccepted:u||(null==o?void 0:o.pAndCUAccepted),pAndCUAcceptanceDate:u?(new Date).toISOString():void 0};const{user:p,...f}=await y(x.token,o.userID,d);0!==f.resultCode?(console.error(f),t(ws).error(h(bF(f.resultCode),{ns:"common"})),A(f.resultMessage)):(t(ws).success(h("success")),r(p||d,x.token))},children:[x.birthDate&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{htmlFor:"#birthDate",children:[h("login.birthDate"),(0,s.jsx)("input",{id:"birthDate",name:"birthDate",type:"date",required:!0,autoComplete:"bday"})]}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:h("login.birthDateHelper")})})]}),(null==x?void 0:x.tnCAndPPAccepted)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"tnCAndPPAccepted",className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[h("login.privacyLabel")," ",(0,s.jsx)("a",{href:`https://memori.ai/${m}/privacy_and_cookie`,target:"_blank",rel:"noopener noreferrer",children:h("login.privacyAndCookiePolicy")})," ",h("login.and")," ",(0,s.jsx)("a",{href:`https://memori.ai/${m}/tos`,target:"_blank",rel:"noopener noreferrer",children:h("login.termsOfService")})]})]}),(0,s.jsxs)("label",{className:"memori-checkbox",children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{type:"checkbox",name:"pAndCUAccepted",defaultChecked:null==o?void 0:o.pAndCUAccepted,className:"memori-checkbox--input"}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),(0,s.jsxs)("span",{className:"memori-checkbox--text",children:[h("login.pAndCUAccepted")," ",(0,s.jsx)("small",{children:(0,s.jsxs)("em",{children:["(",h("login.optional"),")"]})})]})]}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:h("login.goToAccountToChangeYourPreferences")})}),(0,s.jsx)("p",{children:(0,s.jsx)("small",{children:h("login.deepThoughtExplaination")})})]}),(0,s.jsx)(Ba,{htmlType:"submit",primary:!0,loading:b,children:h("login.save")})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("form",{className:"memori--login-drawer--form",onSubmit:e=>{e.preventDefault();const n=e.currentTarget,i=n.userNameOrEmail.value,o=n.password.value,s=EF.test(i)?{tenant:null==l?void 0:l.id,eMail:i,password:o}:{tenant:null==l?void 0:l.id,userName:i,password:o};S(!0),A(null),v(s).then((e=>{var n,i,o,s;0!==e.resultCode?(console.error(e),t(ws).error(h(bF(e.resultCode),{ns:"common"})),A(e.resultMessage)):e.user&&e.token&&(r(e.user,e.token),(null===(n=e.user)||void 0===n?void 0:n.tnCAndPPAccepted)&&(null===(i=e.user)||void 0===i?void 0:i.birthDate)||w({token:e.token,birthDate:!(null===(o=e.user)||void 0===o?void 0:o.birthDate),tnCAndPPAccepted:!(null===(s=e.user)||void 0===s?void 0:s.tnCAndPPAccepted)}))})).catch((e=>{console.error("[LOGIN]",e),t(ws).error(e),e.message&&A(e.message)})).finally((()=>{S(!1)}))},children:[(0,s.jsxs)("label",{htmlFor:"#userNameOrEmail",children:[h("login.userNameOrEmail"),(0,s.jsx)("input",{id:"userNameOrEmail",name:"userNameOrEmail",required:!0,autoComplete:"email",placeholder:"Username/email"})]}),(0,s.jsxs)("label",{htmlFor:"#password",children:["Password",(0,s.jsx)("input",{id:"password",name:"password",type:"password",required:!0,autoComplete:"password",placeholder:"Password"})]}),(0,s.jsx)(Ba,{htmlType:"submit",primary:!0,loading:b,children:h("login.login")}),(null==l?void 0:l.disableRegistration)?l.adminEmail?(0,s.jsxs)("div",{className:"memori--login-drawer--signup",children:[(0,s.jsx)("p",{children:h("login.registrationDisabled")}),(0,s.jsxs)("p",{children:[h("login.contactAdmin"),":"," ",(0,s.jsx)("a",{href:`mailto:${l.adminEmail}`,children:l.adminEmail})]})]}):null:(0,s.jsxs)("p",{className:"memori--login-drawer--signup",children:[h("login.newUserSignUp")," ",(0,s.jsx)("a",{href:`https://${l.name||"www.aisuru.com"}/${m}/auth?signup=1&redirectTo=${E}`,children:h("login.signUp")})]})]}),C&&(0,s.jsx)("p",{role:"alert",className:"memori--login-drawer--error",children:C})]})})};var MF=({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)(Jc,{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 TF=({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)(Jc,{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 IF=({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)(Jc,{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 RF=({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}=be(),[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]),_=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)(Ba,{className:"memori-website_assistant--trigger-button",ghost:!0,shape:"circle",onClick:()=>_(!1),title:S("expand")||"Expand",children:(0,s.jsx)(iN,{avatar:null==r?void 0:r.memori.avatarURL})})}):(0,s.jsxs)(s.Fragment,{children:[u,(0,s.jsxs)(Jc,{spinning:g,className:"memori-website_assistant-layout",children:[v,(0,s.jsx)("div",{className:"memori-website_assistant--close-button-wrapper",children:(0,s.jsx)(Ba,{className:"memori-website_assistant--close-button",primary:!0,shape:"circle",onClick:()=>_(!0),icon:(0,s.jsx)(Qc,{}),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:PF,getStatistics:kF,initSession:OF}=J(),NF=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,"🧠"]]),DF=e=>{const t=Array.from(NF.keys()).filter((t=>t<=e));if(t.length>0){const e=t[t.length-1];return NF.get(e)}return""},LF=e=>{if("🆕"===e)return{points:10,badge:"🐹"};let t,n,r=!1;for(const[i,o]of NF){if(r){t=i,n=o;break}o===e&&(r=!0)}return n&&t?{points:t,badge:n}:void 0},BF=e=>{let t=0;for(const[n,r]of NF)if(r===e){t=n;break}return t},zF=e=>{const t=Math.round(e),n=DF(t);return{points:t,badge:n,pointsForCurrentBadge:BF(n),nextBadge:LF(n)}},UF=(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 FF,jF,HF,GF,VF,WF;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=UF,window.typeMessageHidden=(e,t=!0,n,r=!1,i=!1)=>UF(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),UF(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 qF,KF=!1,JF=!1;var QF=({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,showLogin:S=!1,showOnlyLastMessages:x,height:w="100vh",secret:C,baseUrl:A="https://aisuru.com",apiUrl:E="https://backend.memori.ai",initialContextVars:_,initialQuestion:M,ogImage:T,sessionID:I,tenant:R,personification:P,authToken:k,AZURE_COGNITIVE_SERVICES_TTS_KEY:O,defaultSpeakerActive:N=!0,onStateChange:D,additionalInfo:L,additionalSettings:B,customMediaRenderer:z,userAvatar:U})=>{var F,j,H,G,V,W,q,K,Q,Y,X,$,Z,ee,te,ne,re,ie,oe,se,ae,le,ce,ue;const{t:de,i18n:pe}=be(),[he,fe]=(0,c.useState)(!1);(0,c.useEffect)((()=>{fe(!0)}),[]);const me=J(E),{initSession:ge,postTextEnteredEvent:ve,postPlaceChangedEvent:ye,postTimeoutEvent:Se,postTagChangedEvent:xe,getSession:we,getContentQualityIndexes:Ce,getExpertReferences:Ae}=me,[Ee,_e]=(0,c.useState)(!1),[Me,Te]=(0,c.useState)(null!==(F=null==L?void 0:L.loginToken)&&void 0!==F?F:k),[Ie,Re]=(0,c.useState)({avatarURL:"string"==typeof U?U:void 0});(0,c.useEffect)((()=>{Me&&!(null==Ie?void 0:Ie.userID)&&S&&me.backend.getCurrentUser(Me).then((({user:e,resultCode:t})=>{e&&0===t?(Re(e),fF("loginToken",Me)):mF("loginToken")}))}),[Me,null==Ie?void 0:Ie.userID]);const[Pe,ke]=(0,c.useState)(!1),[Oe,Ne]=(0,c.useState)(!1),[De,Le]=(0,c.useState)(!1),Be=(null===(G=null===(H=null===(j=e.culture)||void 0===j?void 0:j.split("-"))||void 0===H?void 0:H[0])||void 0===G?void 0:G.toUpperCase())||(null===(K=null===(q=null===(W=null===(V=null==n?void 0:n.find((t=>t.memoriConfigID===e.memoriConfigurationID)))||void 0===V?void 0:V.culture)||void 0===W?void 0:W.split("-"))||void 0===q?void 0:q[0])||void 0===K?void 0:K.toUpperCase()),ze=(null==o?void 0:o.customData)?JSON.parse(o.customData):null,Ue=void 0!==i?i:!!(null==ze?void 0:ze.multilanguage),[Fe,je]=(0,c.useState)(null!==($=null!==(X=null!==(Y=null!==(Q=null!=r?r:null==ze?void 0:ze.lang)&&void 0!==Q?Q:Be)&&void 0!==Y?Y:null==ze?void 0:ze.uiLang)&&void 0!==X?X:pe.language)&&void 0!==$?$:"IT"),[He,Ge]=(0,c.useState)(!1),[Ve,We]=(0,c.useState)(!1),[qe,Ke]=(0,c.useState)(),Je=a||(null==ze?void 0:ze.layout)||"DEFAULT",[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)(!1),[at,lt]=(0,c.useState)(!N),[ct,ut]=(0,c.useState)(!1),[dt,pt]=(0,c.useState)(2),[ht,ft]=(0,c.useState)(!1),[mt,gt]=(0,c.useState)("center"),[vt,yt]=(0,c.useState)(!1);(0,c.useEffect)((()=>{ft(!!HF),JF=!!HF}),[HF]),(0,c.useEffect)((()=>{let e="bottom",t=hF("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",lt(hF("muteSpeaker",!N)),KF=hF("muteSpeaker",!N),ut("CONTINUOUS"===t),pt(hF("continuousSpeechTimeout",2)),gt(hF("controlsPosition",e)),yt(hF("hideEmissions",!1)),(null==L?void 0:L.loginToken)||k||(Te(hF("loginToken",void 0)),qF=hF("loginToken",void 0))}),[]);const[bt,St]=(0,c.useState)(C),[xt,wt]=(0,c.useState)(),[Ct,At]=(0,c.useState)(null),[Et,_t]=(0,c.useState)(),Mt=async(e,t)=>{var n;const r=null!=t?t:Ht;if(e&&r){const{currentState:t,...i}=await ye({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&&qt({...Vt,...t})}},[Tt,It]=(0,c.useState)(""),[Rt,Pt]=(0,c.useState)(!1),[kt,Ot]=(0,c.useState)([]),Nt=e=>{Ot((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:[]}]}))},Dt=async(n,r,i,o=!0,s,a=!1,l,c=!1,u=!1)=>{var d,p,h,f;const m=i||Ht||(null===(d=window.getMemoriState())||void 0===d?void 0:d.sessionID);if(!m||!(null==n?void 0:n.length))return;a||Nt({text:n,translatedText:s,fromUser:!0,media:null!=r?r:[],initial:Ht?!!i&&i!==Ht:!!i}),We(!0),Ke(l);let g=n,v=!1;if(o&&!Ee&&Ue&&Fe.toUpperCase()!==Be.toUpperCase()){g=(await up(n,Be,Fe,A)).text}const{currentState:y,...b}=await ve({sessionId:m,text:g});if(0===b.resultCode&&y){const n=c&&l?l:null!==(p=y.emission)&&void 0!==p?p:null==Vt?void 0:Vt.emission;if("X4"===y.state&&e.giverTag){const{currentState:r,...i}=await xe(m,e.giverTag);0===i.resultCode?(qt(r),n&&(Nt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),cn(n))):(console.error(b,i),t(ws).error(de(bF(i.resultCode))),v=!0)}else if("X2d"===y.state&&e.giverTag){const{currentState:r,...i}=await ve({sessionId:m,text:Math.random().toString().substring(2,8)});if(0===i.resultCode){const{currentState:r,...i}=await xe(m,e.giverTag);0===i.resultCode?(qt(r),n&&(Nt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),cn(n))):(console.error(b,i),t(ws).error(de(bF(i.resultCode))),v=!0)}else console.error(b,i),t(ws).error(de(bF(i.resultCode))),v=!0}else Fe.toLowerCase()!==Be.toLowerCase()&&n&&!Ee&&Ue?Lt(y,Fe).then((e=>{e.emission&&cn(e.emission)})):(qt({...y,emission:n}),n&&(Nt({text:n,emitter:y.emitter,media:y.media,fromUser:!1,generatedByAI:!!y.completion}),cn(n)))}else 404===b.resultCode&&(Ot((e=>[...e.slice(0,e.length-1)])),Jt(!1,bt||e.secretToken,xt,Ee&&e.giverTag?e.giverTag:void 0,Ee&&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())||"",..._||{}},M).then((e=>{console.info("session timeout"),(null==e?void 0:e.sessionID)&&setTimeout((()=>{Dt(n,r,null==e?void 0:e.sessionID)}),500)})));u||(Ke(void 0),We(!1))},Lt=async(e,t)=>{var n,r,i;const o=null!==(n=e.emission)&&void 0!==n?n:null==Vt?void 0:Vt.emission;let s={...e},a=null;if(o&&!Ee&&Be.toUpperCase()!==t.toUpperCase()&&Ue){const n=await up(o,t,Be,A);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 up(e,t,Be,A);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==Vt?void 0:Vt.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 qt(s),a&&Nt(a),s},Bt=void 0!==e.ageRestriction?e.ageRestriction:e.nsfw?18:e.enableCompletions?14:0,[zt,Ut]=(0,c.useState)(),[Ft,jt]=(0,c.useState)(!1),[Ht,Gt]=(0,c.useState)(I),[Vt,Wt]=(0,c.useState)(),qt=e=>{var t;Wt(e),D&&D(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)}}))},Kt=async n=>{var r,i,o,s,a;let l=hF("birthDate",void 0);if(zt||l||!Bt)if("PUBLIC"===e.privacyType||e.secretToken||bt||xt){Ge(!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 ge({...n,tag:null!==(i=n.tag)&&void 0!==i?i:null==P?void 0:P.tag,pin:null!==(o=n.pin)&&void 0!==o?o:null==P?void 0:P.pin,additionalInfo:{...L||{},loginToken:null!==(a=null!==(s=null!=qF?qF:Me)&&void 0!==s?s:null==L?void 0:L.loginToken)&&void 0!==a?a:k,language:on(Fe),referral:l}});if((null==c?void 0:c.sessionID)&&(null==c?void 0:c.currentState)&&0===c.resultCode)return Gt(c.sessionID),Et&&Mt(Et,c.sessionID),Ge(!1),{dialogState:c.currentState,sessionID:c.sessionID};(null==c?void 0:c.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(c),t(ws).error(de("underageTwinSession",{age:Bt})),Le(!0)):403===(null==c?void 0:c.resultCode)?(St(void 0),At("password")):(console.error(c),t(ws).error(de(bF(null==c?void 0:c.resultCode))),Le(!0))}catch(e){console.error(e),new Error("Error fetching session")}}else At("password");else jt(!0)},Jt=async(n=!1,r,i,o,s,a,l,c)=>{var u,d,p,h,f;Ge(!0);try{let m,g=hF("birthDate",void 0);if(!c&&!g&&Bt)return void jt(!0);if(!("PUBLIC"===e.privacyType||r||e.secretToken||bt||i||xt))return void At("password");try{m=window.location.href}catch(e){console.error(e)}const{sessionID:v,currentState:y,...b}=await ge({memoriID:null!==(u=e.engineMemoriID)&&void 0!==u?u:"",password:r||bt||e.secretToken,recoveryTokens:i||xt,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:{...L||{},loginToken:null!==(f=null!==(h=null!=qF?qF:Me)&&void 0!==h?h:null==L?void 0:L.loginToken)&&void 0!==f?f:k,language:on(Fe),referral:m}});if(v&&y&&0===b.resultCode)return Gt(v),n&&(qt(y),y.emission&&(kt.length<=1?Ot([{text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}]):Nt({text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}))),Et&&Mt(Et,v),Ge(!1),{dialogState:y,sessionID:v};(null==b?void 0:b.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(b),t(ws).error(de("underageTwinSession",{age:Bt})),Le(!0)):403===(null==b?void 0:b.resultCode)?(St(void 0),At("password")):(console.error(b),t(ws).error(de(bF(b.resultCode))),Le(!0))}catch(e){console.error(e)}return Ge(!1),null},Qt=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 xe(n,null!=r?r:pp);if(0===u){let d=0;if(r!==pp&&i&&("X1a"===t.state||"X1b"===t.state)){const{resultCode:e}=await ve({sessionId:n,text:null!=i?i:""});d=e}if(0===d){const{currentState:e,...t}=await we(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=hF("birthDate",void 0);try{t=window.location.href}catch(e){console.error(e)}Kt({memoriID:null!==(o=e.engineMemoriID)&&void 0!==o?o:"",password:C||bt||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())||"",..._||{}},initialQuestion:M,birthDate:zt||n||void 0,additionalInfo:{...L||{},loginToken:null!==(c=null!==(l=null!=qF?qF:Me)&&void 0!==l?l:null==L?void 0:L.loginToken)&&void 0!==c?c:k,language:on(Fe),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)((()=>()=>{Vt&&(null==Vt?void 0:Vt.currentTag)===e.giverTag||(async()=>{Ht&&e.giverTag&&e.giverPIN&&(Ot([]),await Qt(e.engineMemoriID,Ht,e.giverTag,e.giverPIN))})()}),[]);const[Yt,Xt]=(0,c.useState)(),$t=(0,c.useRef)(),Zt=()=>{Yt&&(clearTimeout(Yt),Xt(void 0)),(null==$t?void 0:$t.current)&&(clearTimeout($t.current),$t.current=void 0)},en=()=>{Zt(),!(null==Vt?void 0:Vt.acceptsTimeout)||HF||ht||Tt.length||Ve||Rt||nn()},tn=async()=>{var e;if(HF||ht||Tt.length||Ve||Rt)en();else if(Ht&&Qe&&(null==Vt?void 0:Vt.acceptsTimeout)){const{currentState:t,...n}=await Se(Ht);if(0===n.resultCode&&t){const n=t.emission;!Ee&&Ue&&Fe!==(null==pe?void 0:pe.language)&&n&&n.length>0?Lt({...t,emission:n},Fe).then((e=>{e.emission&&cn(e.emission)})):n&&n.length>0&&(Nt({text:n,emitter:t.emitter,media:t.media,fromUser:!1,generatedByAI:!!t.completion}),cn(n),qt({...t,hints:null!==(e=t.hints)&&void 0!==e?e:"G1"===t.state?null==Vt?void 0:Vt.hints:[]}))}}},nn=()=>{let e=null==Vt?void 0:Vt.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==Vt?void 0:Vt.emission){e+=Vt.emission.length/26.5}}let t=setTimeout(tn,1e3*e);Xt(t),$t.current=t};(0,c.useEffect)((()=>{(Tt.length||ht||Ve)&&Zt(),Ht&&!Tt.length&&en()}),[null==Vt?void 0:Vt.acceptsTimeout,null==Vt?void 0:Vt.timeout,null==Vt?void 0:Vt.state,ht,Ht,kt,Tt,Ve]),(0,c.useEffect)((()=>()=>{Ye(!1),Ne(!1),Zt(),$t.current=void 0}),[]);const rn=(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:pe.language)&&void 0!==o?o:"IT").toUpperCase(),l=e.voiceType;if(e.enableBoardOfExperts&&(null==Vt?void 0:Vt.emitter)){null==Fn||Fn.find((e=>e.name===(null==Vt?void 0:Vt.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==Vt?void 0:Vt.emitter,pe.language,e.culture]),on=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])||pe.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},[sn,an]=(0,c.useState)();(0,c.useEffect)((()=>{(async()=>{try{const e=await fetch(`${A||"https://aisuru.com"}/api/lexiconmap`);return await e.json()}catch(e){console.error(e)}})().then((e=>{an(e)}))}),[]);const ln=()=>{const e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e)},cn=e=>{if(!O||p)return void ln();if(bn(),p)return;if(at||KF)return JF=!1,We(!1),ln(),void(ct&&gn());GF&&GF.pause();let t=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),n=/iPad|iPhone|iPod/.test(navigator.userAgent);if("interrupted"===VF.state)return void VF.resume().then((()=>cn(e)));if("closed"===VF.state){VF=new Ko;let e=VF.createBuffer(1,1e4,22050),t=VF.createBufferSource();t.buffer=e,t.connect(VF.destination)}else if("suspended"===VF.state){un(),VF=new Ko;let e=VF.createBuffer(1,1e4,22050),t=VF.createBufferSource();t.buffer=e,t.connect(VF.destination)}if(!HF){n||(GF=new vs.SpeakerAudioDestination);let e=vs.AudioConfig.fromSpeakerOutput(GF);HF=new vs.SpeechSynthesizer(jF,e)}const r=VF.createBufferSource();r.addEventListener("ended",(()=>{ft(!1),JF=!1})),GF.onAudioEnd=()=>{ft(!1),JF=!1,r.disconnect(),ln(),An()},HF.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="${on(Fe)}"><voice name="${rn(Fe)}"><s>${((e,t)=>{var n;if(!sn)return e;const r={...null!==(n=sn.common)&&void 0!==n?n:{},...(null==R?void 0:R.id)&&sn[R.id]?sn[R.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})(wd(e)),Fe.toLowerCase())}</s></voice></speak>`,(i=>{if(i){ft(!0),JF=!0;try{VF.decodeAudioData(i.audioData,(function(e){r.buffer=e,r.connect(VF.destination),(kt.length<1||t&&n)&&r.start(0)})),VF.onstatechange=()=>{"suspended"===VF.state||"closed"===VF.state?(r.disconnect(),ft(!1),JF=!1):"interrupted"===VF.state&&VF.resume()},VF.resume(),HF&&(HF.close(),HF=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),ft(!1),JF=!1,HF&&(HF.close(),HF=null),ln()}}else VF.resume(),ft(!1),JF=!1,ln()}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),ft(!1),JF=!1,ln()})),We(!1)},un=()=>{ft(!1),JF=!1;try{HF&&(HF.close(),HF=null),"closed"!==VF.state&&VF.close(),GF&&(GF.pause(),GF.close())}catch(e){console.error("stopAudio error: ",e)}};(0,c.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==Vt?void 0:Vt.emission]);const[dn,pn]=(0,c.useState)(""),hn=()=>pn(""),[fn,mn]=(0,c.useState)(null),gn=()=>{let e=setTimeout((async()=>{Sn();const e=xd(dn);e.length>0&&Rt?(Dt(e),hn(),It("")):Rt&&en()}),1e3*dt);mn(e)},vn=()=>{fn&&(clearTimeout(fn),mn(null))};(0,c.useEffect)((()=>{vn(),ct&&gn(),en()}),[dn]);const yn=()=>{if(O){Sn(),pn(""),hn();try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){$e(!0),jF||(jF=vs.SpeechConfig.fromSubscription(O,"eastus"),jF.speechRecognitionLanguage=on(Fe),jF.speechSynthesisLanguage=on(Fe),jF.speechSynthesisVoiceName=rn(Fe));const t=vs.AudioConfig.fromDefaultMicrophoneInput();FF=new vs.SpeechRecognizer(jF,t),Pt(!0),FF.recognized=(e,t)=>{if(t.result.text)if(t.result.reason===vs.ResultReason.RecognizedSpeech){let e=t.result.text;if(pn(e||""),(null==e?void 0:e.length)>0){const t=xd(e);t.length>0&&It((e=>`${e} ${t}`))}}else t.result.reason===vs.ResultReason.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},FF.canceled=(e,t)=>{t.reason===vs.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?")),bn()},FF.sessionStopped=(e,t)=>{bn()},hn(),FF.startContinuousRecognitionAsync()})).catch(console.error)}catch(e){console.error(e)}}},bn=()=>{FF&&(FF.stopContinuousRecognitionAsync(),FF.close(),FF=null),Pt(!1)},Sn=()=>{$e(!1),bn(),vn()},xn=()=>{try{Sn(),Zt(),Ne(!1),$t.current=void 0,un()}catch(e){console.log("Error: resetUIEffects",e)}};(0,c.useEffect)((()=>()=>{xn()}),[]),(0,c.useEffect)((()=>(document.addEventListener("MemoriResetUIEffects",xn),()=>{document.removeEventListener("MemoriResetUIEffects",xn)})),[]),(0,c.useEffect)((()=>{"Z0"===(null==Vt?void 0:Vt.state)&&Sn()}),[null==Vt?void 0:Vt.state]);const[wn,Cn]=(0,c.useState)(!1),An=(0,c.useCallback)((e=>{ht&&HF&&(HF.close(),HF=null),!ct||!Xe&&wn||(Cn(!0),yn())}),[ct,Xe]);(0,c.useEffect)((()=>{kt.length>1&&!ht&&ct&&(Xe||!wn)?yn():ht&&Rt&&bn()}),[ht]),(0,c.useEffect)((()=>{Rt&&(Sn(),hn(),It(""),yn())}),[Be]);const[En,_n]=(0,c.useState)("keypress");(0,c.useEffect)((()=>{const e=hF("sendOnEnter","keypress");window.innerWidth<=768?_n("click"):_n(e)}),[]),(0,c.useEffect)((()=>{fF("sendOnEnter",En)}),[En]);const[Mn,Tn]=(0,c.useState)(),In=null==ze?void 0:ze.globalBackground,Rn=In?`url(${In})`:null,Pn=o?{"--memori-chat-bubble-bg":"#fff",...ze&&!u?{"--memori-text-color":null!==(Z=ze.textColor)&&void 0!==Z?Z:"#000"}:{},...(null==ze?void 0:ze.buttonBgColor)?{"--memori-button-bg":ze.buttonBgColor,"--memori-primary":ze.buttonBgColor}:{},...(null==ze?void 0:ze.buttonTextColor)?{"--memori-button-text":ze.buttonTextColor}:{},...(null==ze?void 0:ze.blurBackground)?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...(null==ze?void 0:ze.innerBgColor)?{"--memori-inner-bg":`rgba(${"dark"===ze.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(ee=ze.innerBgAlpha)&&void 0!==ee?ee:.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===ze.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(te=null==ze?void 0:ze.innerBgAlpha)&&void 0!==te?te:.4})`}:{"--memori-inner-content-pad":"0px"}}:{},kn=`\n ${p?"#preview,":"WEBSITE_ASSISTANT"===Je?"":":root,"} .memori-widget, .memori-drawer, .memori-modal {\n ${Object.entries(Pn).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,On=void 0===(null==ze?void 0:ze.showAIicon)||(null==ze?void 0:ze.showAIicon),[Nn,Dn]=(0,c.useState)(!1);(0,c.useEffect)((()=>{(window.innerWidth>=768&&"FULLPAGE"===Je||"FULLPAGE"!==Je)&&Dn(!0)}),[]);const[Ln,Bn]=(0,c.useState)();(0,c.useEffect)((()=>{e.engineMemoriID&&(async e=>{let t,n;try{const{contentQualityIndex:r,answerQualityIndex:i,unansweredQuestions:o,...s}=await Ce(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=>{Bn(zF(e.points))})).catch(console.error)}),[e.engineMemoriID]),(0,c.useEffect)((()=>{if(null==ze?void 0:ze.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",ze.seoTitle),document.head.append(e)}if(null==ze?void 0:ze.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",ze.seoDescription),document.head.append(e)}if(null==ze?void 0:ze.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",ze.seoUrl),document.head.append(e)}let t=T||e.avatarURL;if((null==ze?void 0:ze.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}}),[ze,e.avatarURL,T]);const zn=(0,c.useCallback)((e=>{const{text:t,waitForPrevious:n,hidden:r,typingText:i,useLoaderTextAsMsg:o,hasBatchQueued:s}=e.detail;t&&(n&&!KF&&(JF||Ve)?setTimeout((()=>{zn(e)}),1e3):(bn(),un(),Dt(t,void 0,void 0,void 0,void 0,r,i,o,s)))}),[Ht,ht,Ve,Fe]);(0,c.useEffect)((()=>(document.addEventListener("MemoriTextEntered",zn),()=>{document.removeEventListener("MemoriTextEntered",zn)})),[Ht,Fe]);const Un=(0,c.useCallback)((async t=>{var n,r,i,o,s,a,l,c,u,d;const p=(null==t?void 0:t.sessionID)||Ht,h=(null==t?void 0:t.dialogState)||Vt;Ne(!0);let f=document.getElementById("memori-audio"),m=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome");f&&m&&(f.muted=!1,f.play().catch((e=>{console.error("error playing intro audio",e)})));let g=hF("birthDate",void 0),v=zt||g||void 0;if(p||!Bt||v){if(!p&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!bt&&!xt||!p&&De)return At("password"),void Ne(!1);if(!p){Ne(!1),Le(!1);const t=await Kt({memoriID:e.engineMemoriID,password:C||bt||e.secretToken,tag:null==P?void 0:P.tag,pin:null==P?void 0:P.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())||"",..._||{}},initialQuestion:M,birthDate:v,additionalInfo:{...L||{},loginToken:null!==(o=null!==(i=null!=qF?qF:Me)&&void 0!==i?i:null==L?void 0:L.loginToken)&&void 0!==o?o:k,language:on(Fe)}});return void((null==t?void 0:t.dialogState)?(Ot([]),Lt(t.dialogState,Fe).then((e=>{e.emission&&cn(e.emission)})).finally((()=>{Ye(!0)}))):await Un(t||void 0))}if(I){const{currentState:t,...n}=await we(p);if(0!==n.resultCode||!t)return console.debug("session expired, opening new session"),Le(!0),Gt(void 0),Ne(!1),void await Un();if(Ot([]),Ee&&e.giverTag&&(null==Vt?void 0:Vt.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await Qt(e.engineMemoriID,p,"-");const t=await Qt(e.engineMemoriID,p,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");Lt(t.currentState,Fe).then((e=>{e.emission&&cn(e.emission)})).finally((()=>{Ye(!0)}))}catch(t){console.error("session #2",t),Jt(!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===(a=null===(s=window.location.pathname)||void 0===s?void 0:s.split("/"))||void 0===a?void 0:a.pop())||"",..._||{}},M,v).then((()=>{Ye(!0)}))}else if(!Ee&&P&&(null==Vt?void 0:Vt.currentTag)!==P.tag)try{console.debug("change tag #3"),await Qt(e.engineMemoriID,p,"-");const t=await Qt(e.engineMemoriID,p,P.tag,P.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");Lt(t.currentState,Fe).then((e=>{e.emission&&cn(e.emission)})).finally((()=>{Ye(!0)}))}catch(t){console.error("session #5",t),Jt(!0,null==e?void 0:e.secretToken,void 0,P.tag,P.pin,{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())||"",..._||{}},M,v).then((()=>{Ye(!0)}))}else if(Ee||P||(null==Vt?void 0:Vt.currentTag)===pp)Lt(t,Fe).then((e=>{e.emission&&cn(e.emission)})).finally((()=>{Ye(!0)}));else try{console.debug("change tag #6"),await Qt(e.engineMemoriID,p,"-");const t=await Qt(e.engineMemoriID,p,pp);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");Lt(t.currentState,Fe).then((e=>{e.emission&&cn(e.emission)})).finally((()=>{Ye(!0)}))}catch(t){console.error("session #8",t),Jt(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,{PATHNAME:window.location.pathname,ROUTE:(null===(d=null===(u=window.location.pathname)||void 0===u?void 0:u.split("/"))||void 0===d?void 0:d.pop())||"",..._||{}},M,v).then((()=>{Ye(!0)}))}}else Ot([]),Lt(h,Fe).then((e=>{e.emission&&cn(e.emission)})).finally((()=>{Ye(!0)}))}else jt(!0),Ne(!1)}),[bt,e,xt,zt,Ht,Fe]);(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?(Te(t.target.getAttribute("authtoken")||void 0),qF=t.target.getAttribute("authtoken")||void 0):(Te((null===(i=null===(r=t.target)||void 0===r?void 0:r.parentElement)||void 0===i?void 0:i.getAttribute("authtoken"))||void 0),qF=t.target.getAttribute("authtoken")||void 0))}));return n.observe(t,{attributes:!0,childList:!1,subtree:!1}),()=>{n.disconnect()}}),[]);const[Fn,jn]=(0,c.useState)(),Hn=(0,c.useCallback)((async()=>{if(Ht&&(null==e?void 0:e.enableBoardOfExperts))try{const{experts:e,count:t,...n}=await Ae(Ht);0===n.resultCode?jn(e):console.warn("Error fetching experts",n)}catch(e){console.warn(e)}}),[Ht,null==e?void 0:e.enableBoardOfExperts]);(0,c.useEffect)((()=>{Hn()}),[Ht,Hn]);const Gn=void 0===x?"TOTEM"!==a&&"WEBSITE_ASSISTANT"!==a:!x,Vn={memori:e,tenant:R,history:kt,showShare:null===(ne=null!=d?d:null==ze?void 0:ze.showShare)||void 0===ne||ne,position:Et,setShowPositionDrawer:et,setShowSettingsDrawer:nt,setShowKnownFactsDrawer:it,setShowExpertsDrawer:st,showSpeaker:!!O,speakerMuted:at||KF,setSpeakerMuted:e=>{if(KF=!!e,lt(e),fF("muteSpeaker",!!e),e)un();else{VF=new Ko;let e=VF.createBuffer(1,1e4,22050),t=VF.createBufferSource();t.buffer=e,t.connect(VF.destination)}},showSettings:v,hasUserActivatedSpeak:Qe,showReload:"TOTEM"===Je,showClear:b,clearHistory:()=>Ot((e=>e.slice(-1))),showLogin:S,setShowLoginDrawer:ke,loginToken:Me,user:Ie,sessionID:Ht},Wn={memori:e,integration:o,integrationConfig:ze,tenant:R,instruct:Ee,avatar3dVisible:Nn,setAvatar3dVisible:Dn,hasUserActivatedSpeak:Qe,isPlayingAudio:ht&&!at,loading:!!Ve,baseUrl:A,apiUrl:E},qn={memori:e,tenant:R,gamificationLevel:Ln,language:Be,userLang:Fe,setUserLang:je,baseUrl:A,apiUrl:E,position:Et,openPositionDrawer:()=>et(!0),integrationConfig:ze,instruct:Ee,sessionId:Ht,clickedStart:Oe,onClickStart:Un,initializeTTS:()=>{if(!O)return;jF=vs.SpeechConfig.fromSubscription(O,"eastus"),jF.speechSynthesisLanguage=on(Fe),jF.speechSynthesisVoiceName=rn(Fe),jF.speechRecognitionLanguage=on(Fe),bd()&&(jF.speechSynthesisOutputFormat=vs.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3),VF=new Ko;let e=VF.createBuffer(1,1e4,22050),t=VF.createBufferSource();t.buffer=e,t.connect(VF.destination),GF=new vs.SpeakerAudioDestination;let n=vs.AudioConfig.fromSpeakerOutput(GF);HF=new vs.SpeechSynthesizer(jF,n)},isUserLoggedIn:!!Me&&!!(null==Ie?void 0:Ie.userID),showLogin:S,setShowLoginDrawer:ke,user:Ie},Kn={memori:e,sessionID:Ht||"",tenant:R,translateTo:Ue&&Fe.toUpperCase()!==(null===(ae=null!==(se=null!==(oe=null===(ie=null===(re=e.culture)||void 0===re?void 0:re.split("-"))||void 0===ie?void 0:ie[0])&&void 0!==oe?oe:pe.language)&&void 0!==se?se:"IT")||void 0===ae?void 0:ae.toUpperCase())?Fe:void 0,baseUrl:A,apiUrl:E,layout:a,memoriTyping:Ve,typingText:qe,showTypingText:y,history:Gn?kt:kt.slice(-2),authToken:null!==(ce=null!==(le=null!=Me?Me:qF)&&void 0!==le?le:null==L?void 0:L.loginToken)&&void 0!==ce?ce:k,dialogState:Vt,setDialogState:qt,pushMessage:Nt,simulateUserPrompt:(e,t)=>{bn(),un(),Dt(e,void 0,void 0,!1,t)},showDates:m,showContextPerLine:g,showAIicon:On,client:me,selectReceiverTag:async n=>{var r;if(Ht)try{const{currentState:i,...o}=await xe(Ht,n);if(0===o.resultCode)if(Nt({text:n,fromUser:!0}),"X4"===i.state&&e.giverTag){const{currentState:n,...r}=await me.postTagChangedEvent(Ht,e.giverTag);0===r.resultCode?(qt(n),n.emission&&Nt({text:n.emission,emitter:n.emitter,media:n.media,fromUser:!1})):(console.error(r),t(ws).error(de(bF(r.resultCode))))}else qt(i),i.emission&&Nt({text:i.emission,emitter:i.emitter,media:i.media,fromUser:!1});else console.error(o,n,null===(r=null==Vt?void 0:Vt.knownTags)||void 0===r?void 0:r[n]),t(ws).error(de(bF(o.resultCode)))}catch(e){let n=e;console.error(n),t(ws).error(n.message)}},preview:p,sendOnEnter:En,setSendOnEnter:_n,microphoneMode:ct?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen:Mn,setAttachmentsMenuOpen:Tn,instruct:Ee,showInputs:f,showMicrophone:!!O,userMessage:Tt,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return It(""),void en();It(e),Zt()},sendMessage:e=>{un(),bn(),Dt(e),It(""),hn()},stopListening:Sn,startListening:yn,stopAudio:un,resetTranscript:hn,listening:Rt,isPlayingAudio:ht,customMediaRenderer:z,user:Ie,userAvatar:U,experts:Fn},Jn=o&&Rn?(0,s.jsx)("div",{className:"memori--global-background",children:(0,s.jsx)("div",{className:"memori--global-background-image",style:{backgroundImage:Rn}})}):(0,s.jsx)("div",{className:"memori--global-background no-background-image"}),Qn=o?(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:kn}}):null,Yn={canInstruct:!!e.giverTag,instruct:!!Ee,onChangeMode:e=>{_e("instruct"===e),Ye(!1),Ne(!1)}},Xn=(0,s.jsx)(mD,{tenant:R,userLang:Fe,integrationID:null==o?void 0:o.integrationID,memoriHash:`${e.ownerTenantName}-${e.ownerUserName}-${e.name}`}),$n=l||("TOTEM"===Je?TF:"CHAT"===Je?IF:"FULLPAGE"===Je?MF:"WEBSITE_ASSISTANT"===Je?RF:MF);return(0,s.jsxs)("div",{className:t(Ss)("memori","memori-widget",`memori-layout-${a.toLowerCase()}`,`memori-controls-${mt.toLowerCase()}`,`memori--avatar-${(null==ze?void 0:ze.avatar)||"default"}`,{"memori--preview":p,"memori--embed":h,"memori--with-integration":o,"memori--with-speechkey":!!O,"memori--active":Qe,"memori--hide-emissions":vt,"memori--has-active-session":!!Ht}),"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":Ht,"data-memori-integration":null==o?void 0:o.integrationID,"data-memori-engine-state":JSON.stringify({...Vt,sessionID:Ht}),style:{height:w},children:[(0,s.jsx)($n,{Header:fD,headerProps:Vn,Avatar:lN,avatarProps:Wn,Chat:pm,chatProps:Kn,StartPanel:bm,startPanelProps:qn,integrationStyle:Qn,integrationBackground:Jn,ChangeMode:cN,changeModeProps:Yn,poweredBy:Xn,sessionId:Ht,hasUserActivatedSpeak:Qe,showInstruct:u,loading:He}),(0,s.jsx)("audio",{id:"memori-audio",style:{display:"none"},src:"https://aisuru.com/intro.mp3"}),he&&(0,s.jsx)(yd,{withModal:!0,pwdOrTokens:Ct,openModal:!!Ct,setPwdOrTokens:At,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{var n,r;t.password&&St(t.password),t.password&&(WF=t.password),t.tokens&&wt(t.tokens),Jt(!Ht,t.password,t.tokens,Ee?e.giverTag:null==P?void 0:P.tag,Ee?e.giverPIN:null==P?void 0:P.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())||"",..._||{}},M,zt).then((e=>{At(null),Un(e||void 0)})).catch((()=>{At(null),Le(!0)}))},minimumNumberOfRecoveryTokens:null!==(ue=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==ue?ue:1}),he&&(0,s.jsx)(lF,{visible:Ft,minAge:Bt,onClose:t=>{var n,r;t?(Ut(t),fF("birthDate",t),Jt(!Ht,WF||bt||(null==e?void 0:e.secretToken),xt,Ee?e.giverTag:null==P?void 0:P.tag,Ee?e.giverPIN:null==P?void 0:P.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())||"",..._||{}},M,t).then((e=>{jt(!1),At(null),Un(e||void 0)})).catch((()=>{jt(!1),Le(!0)}))):(jt(!1),Ne(!1))}}),tt&&(0,s.jsx)(vF,{layout:Je,open:!!tt,onClose:()=>nt(!1),microphoneMode:ct?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout:dt,setMicrophoneMode:e=>ut("CONTINUOUS"===e),setContinuousSpeechTimeout:pt,controlsPosition:mt,setControlsPosition:gt,hideEmissions:vt,setHideEmissions:yt,additionalSettings:B}),rt&&Ht&&(0,s.jsx)(CF,{apiURL:E,memori:e,sessionID:Ht,visible:rt,closeDrawer:()=>it(!1)}),ot&&!!Fn&&(0,s.jsx)(AF,{apiUrl:E,baseUrl:A,tenant:R,experts:Fn,open:ot,onClose:()=>st(!1)}),Pe&&(null==R?void 0:R.id)&&(0,s.jsx)(_F,{tenant:R,apiUrl:E,open:!!Pe,user:Ie,loginToken:Me,onClose:()=>ke(!1),onLogin:(e,t)=>{Re(e),Te(t),qF=t,ke(!1),fF("loginToken",t)},onLogout:()=>{Me&&me.backend.userLogout(Me).then((()=>{ke(!1),Re(void 0),Te(void 0),qF=void 0,mF("loginToken")}))}})]})};const YF={id:"aisuru.com",theme:"aisuru",config:{name:"Memori",showNewUser:!1,requirePosition:!1}},XF=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||{...YF,tenantID:e}}catch(t){return{...YF,tenantID:e}}};function $F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZF(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,KO(r.key),r)}}function ej(e,t,n){return t&&ZF(e.prototype,t),n&&ZF(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tj(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nj(e,t){return nj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},nj(e,t)}function rj(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&&nj(e,t)}function ij(e,t){if(t&&("object"===WO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return tj(e)}function oj(e){return oj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oj(e)}function sj(e){if(Array.isArray(e))return e}function aj(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function lj(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 cj(e,t){if(e){if("string"==typeof e)return lj(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)?lj(e,t):void 0}}function uj(){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 dj(e){return sj(e)||aj(e)||cj(e)||uj()}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 hj(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){JO(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}var fj={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)}},mj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};$F(this,e),this.init(t,n)}return ej(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||fj,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,hj(hj({},{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}(),gj=new mj,vj=function(){function e(){$F(this,e),this.observers={}}return ej(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 yj(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function bj(e){return null==e?"":""+e}function Sj(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function xj(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 wj(e,t,n){var r=xj(e,t,Object);r.obj[r.k]=n}function Cj(e,t){var n=xj(e,t),r=n.obj,i=n.k;if(r)return r[i]}function Aj(e,t,n){var r=Cj(e,n);return void 0!==r?r:Cj(t,n)}function Ej(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]):Ej(e[r],t[r],n):e[r]=t[r]);return e}function _j(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Mj={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Tj(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return Mj[e]})):e}var Ij="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Rj=[" ",",","?","!",";"];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){JO(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=oj(e);if(t){var i=oj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ij(this,n)}}function Nj(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?Nj(l,c,n):void 0}i=i[r[o]]}return i}}var Dj=function(e){rj(n,e);var t=Oj(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return $F(this,n),r=t.call(this),Ij&&vj.call(tj(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 ej(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=Cj(this.data,s);return a||!o||"string"!=typeof n?a:Nj(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),wj(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=Cj(this.data,s)||{};r?Ej(a,n,i):a=kj(kj({},a),n),wj(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?kj(kj({},{}),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}(vj),Lj={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 Bj(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 zj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bj(Object(n),!0).forEach((function(t){JO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Uj(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=oj(e);if(t){var i=oj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ij(this,n)}}var Fj={},jj=function(e){rj(n,e);var t=Uj(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return $F(this,n),r=t.call(this),Ij&&vj.call(tj(r)),Sj(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,tj(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=gj.create("translator"),r}return ej(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=Rj.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"!==WO(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,zj(zj({},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?[]:{},_=A?v:g;for(var M in m)if(Object.prototype.hasOwnProperty.call(m,M)){var T="".concat(_).concat(s).concat(M);E[M]=this.translate(T,zj(zj({},t),{joinArrays:!1,ns:c})),E[M]===T&&(E[M]=m[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 D=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,L=D&&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,zj(zj({},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 U=[],F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&F&&F[0])for(var j=0;j<F.length;j++)U.push(F[j]);else"all"===this.options.saveMissingTo?U=this.languageUtils.toResolveHierarchy(t.lng||this.language):U.push(t.lng||this.language);var H=function(e,n,r){var o=k&&r!==m?r:L;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?U.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],l+n,t["defaultValue".concat(n)]||N)}))})):H(U,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,zj(zj({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(zj(zj({},n),{interpolation:zj(zj({},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=zj(zj({},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=Lj.handle(p,e,t,this.options&&this.options.postProcessPassResolved?zj({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,!Fj["".concat(f[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(Fj["".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}(vj);function Hj(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Gj=function(){function e(t){$F(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=gj.create("languageUtils")}return ej(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]=Hj(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]=Hj(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Hj(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}(),Vj=[{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}],Wj={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)}},qj=["v1","v2","v3"],Kj={zero:0,one:1,two:2,few:3,many:4,other:5};function Jj(){var e={};return Vj.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:Wj[t.fc]}}))})),e}var Qj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};$F(this,e),this.languageUtils=t,this.options=n,this.logger=gj.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=Jj()}return ej(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 Kj[e]-Kj[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!qj.includes(this.options.compatibilityJSON)}}]),e}();function Yj(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 Xj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yj(Object(n),!0).forEach((function(t){JO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $j=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$F(this,e),this.logger=gj.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return ej(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:Tj,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?_j(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?_j(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?_j(t.nestingPrefix):t.nestingPrefixEscaped||_j("$t("),this.nestingSuffix=t.nestingSuffix?_j(t.nestingSuffix):t.nestingSuffixEscaped||_j(")"),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=Aj(t,l,e);return a.alwaysFormat?a.format(i,void 0,n,Xj(Xj(Xj({},r),t),{},{interpolationkey:e})):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(Aj(t,l,s),c,n,Xj(Xj(Xj({},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=bj(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=Xj({},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=Xj(Xj({},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=bj(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,Xj(Xj({},o),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function Zj(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 eH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zj(Object(n),!0).forEach((function(t){JO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function tH(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 nH=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$F(this,e),this.logger=gj.create("formatter"),this.options=t,this.formats={number:tH((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:tH((function(e,t){var n=new Intl.NumberFormat(e,eH(eH({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:tH((function(e,t){var n=new Intl.DateTimeFormat(e,eH({},t));return function(e){return n.format(e)}})),relativetime:tH((function(e,t){var n=new Intl.RelativeTimeFormat(e,eH({},t));return function(e){return n.format(e,t.range||"day")}})),list:tH((function(e,t){var n=new Intl.ListFormat(e,eH({},t));return function(e){return n.format(e)}}))},this.init(t)}return ej(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()]=tH(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=dj(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,eH(eH(eH({},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 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){JO(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=oj(e);if(t){var i=oj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ij(this,n)}}var sH=function(e){rj(n,e);var t=oH(n);function n(e,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return $F(this,n),o=t.call(this),Ij&&vj.call(tj(o)),o.backend=e,o.store=r,o.services=i,o.languageUtils=i.languageUtils,o.options=s,o.logger=gj.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 ej(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=xj(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,iH(iH({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(vj);function aH(){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"===WO(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===WO(e[2])||"object"===WO(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 lH(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 cH(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 uH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cH(Object(n),!0).forEach((function(t){JO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function dH(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=oj(e);if(t){var i=oj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ij(this,n)}}function pH(){}function hH(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var fH=function(e){rj(n,e);var t=dH(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if($F(this,n),e=t.call(this),Ij&&vj.call(tj(e)),e.options=lH(r),e.services={},e.logger=gj,e.modules={external:[]},hH(tj(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),ij(e,tj(e));setTimeout((function(){e.init(r,i)}),0)}return e}return ej(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=aH();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=uH(uH(uH({},r),this.options),lH(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=uH(uH({},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?gj.init(i(this.modules.logger),this.options):gj.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=nH);var s=new Gj(this.options);this.store=new Dj(this.options.resources,this.options);var a=this.services;a.logger=gj,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new Qj(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 $j(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new sH(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 jj(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=pH),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=yj(),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]:pH,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=yj();return e||(e=this.languages),t||(t=this.options.ns),n||(n=pH),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&&Lj.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=yj();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"!==WO(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=uH({},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=yj();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=yj();"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]:pH,i=uH(uH(uH({},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=uH({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new jj(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}(vj);JO(fH,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new fH(e,t)}));var mH=fH.createInstance();mH.createInstance=fH.createInstance;var gH,vH=mH.createInstance;mH.init,mH.loadResources,mH.reloadResources,mH.use,mH.changeLanguage,mH.getFixedT,mH.t,mH.exists,mH.setDefaultNamespace,mH.hasLoadedNamespace,mH.loadNamespaces,mH.loadLanguages;gH=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"},"login":{"login":"Accedi","logout":"Esci","user":"Utente","loggedDrawerTitle":"Ciao, {{name}}!","loginDrawerTitle":"Accedi","newUserSignUp":"Sei un nuovo utente?","signUp":"Registrati!","registrationDisabled":"La registrazione è disabilitata.","contactAdmin":"Contatta l\'amministratore per richiedere l\'accesso","userNameOrEmail":"Nome utente o email","underage":"Devi avere almeno {{age}} anni per registrarti.","optional":"opzionale","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à","missingData":"Informazioni mancanti","missingDataHelper":"Sappiamo che questo è un po\' fastidioso, ma abbiamo bisogno di alcune informazioni in più per completare la tua registrazione.","goToAccountToChangeYourPreferences":"Puoi cambiare la tua scelta in qualsiasi momento dalla tua pagina Account.","deepThoughtExplaination":"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. Consenti all\'autore del twin di contattarti per offerte commerciali riguardanti prodotti su cui hai espresso interesse.","tnCAndPPAcceptedHelper":"Dall\'ultimo accesso, i T&C e l\'Informativa sulla privacy sono stati modificati. Si prega di accettarle, altrimenti non sarà possibile apportare modifiche ai propri gemelli. Puoi sempre cancellare il tuo account nella pagina del tuo profilo utente.","privacyLabel":"Ho letto e accettato l\'","privacyAndCookiePolicy":"informativa sui cookie e sulla privacy","and":"e","termsOfService":"i termini del servizio","pAndCUAccepted":"Accetto le condizioni di utilizzo relative a Pensiero Profondo","save":"Salva"},"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","TENANT_ALREADY_EXISTS":"Tenant già esistente","TENANT_MISSING_DESCRIPTION":"Tenant: descrizione mancante","TENANT_CANT_SET_COMPLETION_PROVIDER":"Tenant: non abilitato a gestire il provider di completamento","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_TOO_MANY_ATTEMPTS":"Troppi tentativi","USER_MUST_ACCEPT_TNC_AND_PP":"Devi accettare i termini e le condizioni","USER_BIRTH_DATE_CANT_BE_CHANGED":"Data di nascita non può essere cambiata","USER_CANT_SET_COMPLETION_PROVIDER":"Utente: non abilitato a gestire il provider di completamento","USER_CANT_ENABLE_DEEP_THOUGHT":"Utente: non abilitato a gestire Pensiero Profondo","USER_CANT_ENABLE_DCM_INTEGRATION":"Utente: non abilitato a gestire l\'integrazione con DCM","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"Utente: non abilitato a gestire la concatenazione o il gruppo di esperti","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"Il gruppo di esperti richiede l\'abilitazione delle completions","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","SESSION_EXPIRED":"Sessione scaduta","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_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Pensiero Profondo richiede l\'abilitazione delle completions","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","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Memori: funzionalità richiede un abbonamento","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","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifiche: Periodo di estrazione chatlog non valido","PROCESS_INVALID_TYPE":"Tipo di processo non valido","PROCESS_ALREADY_RUNNING":"Processo già in esecuzione","PROCESS_NOT_FOUND":"Processo non trovato","IMPORTCSV_MISSING_ROWS":"Importazione CSV: righe mancanti","IMPORTCSV_MISSING_CSV":"Importazione CSV: CSV mancante","IMPORTCSV_MISSING_SEPARATOR":"Importazione CSV: separatore mancante","IMPORTCSV_INVALID_SEPARATOR":"Importazione CSV: separatore non valido","IMPORTCSV_MISSING_HEADERS":"Importazione CSV: intestazioni mancanti","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Importazione CSV: separatore varianti titolo mancante","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"Importazione CSV: encoding caratteri non rilevabile","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione CSV: impossibile importare in Memori segreti","IMPORTTXT_MISSING_ROWS":"Importazione TXT: righe mancanti","IMPORTTXT_INVALID_GRANULARITY":"Importazione TXT: granularità non valida","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"Importazione TXT: encoding caratteri non rilevabile","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione TXT: impossibile importare in Memori segreti","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Importazione TXT: limite importazione superato","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Importazione TXT: importazione su GPT-4 richiede API key","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Importazione TXT: importazione richiede un piano a pagamento","EXPORTCSV_MISSING_CSV_SPECS":"Esportazione CSV: specifiche CSV mancanti","EXPORTCSV_MISSING_SEPARATOR":"Esportazione CSV: separatore mancante","EXPORTCSV_INVALID_SEPARATOR":"Esportazione CSV: separatore non valido","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Esportazione CSV: separatore varianti titolo mancante","EXPORTCSV_MISSING_NEW_LINE_CHAR":"Esportazione CSV: carattere di nuova riga mancante","EXPORTCSV_INVALID_NEW_LINE_CHAR":"Esportazione CSV: carattere di nuova riga non valido","EXPORTCSV_MISSING_PASSWORD":"Esportazione CSV: password mancante","EXPORTJSONL_MISSING_JSONL_SPECS":"Esportazione JSONL: specifiche JSONL mancanti","EXPORTJSONL_MISSING_PLATFORM":"Esportazione JSONL: piattaforma mancante","EXPORTJSONL_INVALID_PLATFORM":"Esportazione JSONL: piattaforma non valida","EXPORTJSONL_MISSING_PASSWORD":"Esportazione JSONL: password mancante","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"Esportazione JSONL: esportazione richiede un piano a pagamento","ANALYSIS_MISSING_QUERY":"Analisi: query mancante","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analisi: impossibile analizzare Memori segreti","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analisi: corrispondenza query utente richiede Pensiero Profondo","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Assegnazione badge: credenziali errate o mancanti","BADGE_ASSIGNMENT_MISSING_REF_ID":"Assegnazione badge: ID ref mancante","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Assegnazione badge: esito non trovato","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Assegnazione badge: URL di asserzione mancante","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Assegnazione badge: URL badge mancante","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Assegnazione badge: URL issuer mancante","BADGE_ASSIGNMENT_INVALID_URL":"Assegnazione badge: URL non valido","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Assegnazione badge: destinatario mancante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Assegnazione badge: tipo destinatario sconosciuto","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Assegnazione badge: identità destinatario mancante","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Assegnazione badge: tipo hash destinatario mancante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Assegnazione badge: tipo hash destinatario sconosciuto","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Assegnazione badge: identità destinatario errata","BADGE_NOT_FOUND":"Badge non trovato","OUTCOME_NO_DCM_CONFIGURED":"Esito: nessun DCM configurato","OUTCOME_USER_BADGES_DISABLED":"Esito: badge utente disabilitati"}}');const yH=vH({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"},"login":{"login":"Login","logout":"Logout","user":"User","loggedDrawerTitle":"Hi, {{name}}!","loginDrawerTitle":"Login","newUserSignUp":"New user?","signUp":"Sign up!","registrationDisabled":"Registration is disabled","contactAdmin":"Contact the administrator to request access","userNameOrEmail":"Username or email","underage":"You must be at least {{age}} years old to sign up.","optional":"Optional","birthDate":"Birth date","birthDateHelper":"We ask for your birth date only to enable or disable functionalities that have age restrictions","missingData":"Missing informations","missingDataHelper":"We know that this is a bit annoying, but we need some more informations to complete your registration.","goToAccountToChangeYourPreferences":"You can change your choice at any time from your Account page.","deepThoughtExplaination":"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.","tnCAndPPAcceptedHelper":"Since your last login, T&C and Privacy Policy have changed. Please accept them, otherwise you won\'t be able to make changes to your Twins. You can always delete your account in your user profile page.","privacyLabel":"I have read and accepted the","privacyAndCookiePolicy":"Privacy e Cookie Policy","and":"and","termsOfService":"Terms of Service","pAndCUAccepted":"I accept the terms of service about Deep Thought","save":"Save"},"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","TENANT_ALREADY_EXISTS":"Tenant already exists","TENANT_MISSING_DESCRIPTION":"Tenant: description missing","TENANT_CANT_SET_COMPLETION_PROVIDER":"Tenant: can\'t set completion provider","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_TOO_MANY_ATTEMPTS":"Too many attempts","USER_MUST_ACCEPT_TNC_AND_PP":"You must accept the terms and conditions","USER_BIRTH_DATE_CANT_BE_CHANGED":"Date of birth cannot be changed","USER_CANT_SET_COMPLETION_PROVIDER":"User: not allowed to manage completion provider","USER_CANT_ENABLE_DEEP_THOUGHT":"User: not enabled to manage Deep Thought","USER_CANT_ENABLE_DCM_INTEGRATION":"User: not enabled to manage DCM integration","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"User: not allowed to manage chaining or expert group","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"The expert group requires completions to be enabled","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","SESSION_EXPIRED":"Session expired","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_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Deep Thought requires completions to be enabled","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","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Feature requires subscription","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","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifications: Invalid chat log extraction period","PROCESS_INVALID_TYPE":"Invalid process type","PROCESS_ALREADY_RUNNING":"Process already running","PROCESS_NOT_FOUND":"Process not found","IMPORTCSV_MISSING_ROWS":"CSV import: missing rows","IMPORTCSV_MISSING_CSV":"CSV Import: Missing CSV","IMPORTCSV_MISSING_SEPARATOR":"CSV import: missing separator","IMPORTCSV_INVALID_SEPARATOR":"CSV import: invalid separator","IMPORTCSV_MISSING_HEADERS":"CSV import: missing headers","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV import: missing title variant separator","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"CSV import: undetectable character encoding","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"CSV Import: Cannot import to Secret Memories","IMPORTTXT_MISSING_ROWS":"Importing TXT: missing rows","IMPORTTXT_INVALID_GRANULARITY":"Import TXT: invalid granularity","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"TXT import: undetectable character encoding","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"TXT Import: Cannot import to Secret Memories","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Import TXT: import limit exceeded","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Import TXT: import on GPT-4 requires API key","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Import TXT: Import requires a paying plan","EXPORTCSV_MISSING_CSV_SPECS":"CSV export: missing CSV specifications","EXPORTCSV_MISSING_SEPARATOR":"CSV export: missing separator","EXPORTCSV_INVALID_SEPARATOR":"CSV export: invalid separator","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV export: missing title variant separator","EXPORTCSV_MISSING_NEW_LINE_CHAR":"CSV export: missing newline character","EXPORTCSV_INVALID_NEW_LINE_CHAR":"CSV export: invalid newline character","EXPORTCSV_MISSING_PASSWORD":"CSV export: missing password","EXPORTJSONL_MISSING_JSONL_SPECS":"JSONL export: missing JSONL specifications","EXPORTJSONL_MISSING_PLATFORM":"JSONL export: missing platform","EXPORTJSONL_INVALID_PLATFORM":"JSONL export: invalid platform","EXPORTJSONL_MISSING_PASSWORD":"JSONL export: missing password","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"JSONL Export: Export requires a paid plan","ANALYSIS_MISSING_QUERY":"Analysis: missing query","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analysis: Unable to analyze Secret Memories","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analysis: matching user query requires Deep Thinking","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Badge assignment: incorrect or missing credentials","BADGE_ASSIGNMENT_MISSING_REF_ID":"Badge assignment: ref ID missing","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Badge assignment: result not found","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Badge assignment: Missing assertion URL","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Badge Assignment: Missing Badge URL","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Badge assignment: missing issuer URL","BADGE_ASSIGNMENT_INVALID_URL":"Badge assignment: Invalid URL","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Badge assignment: missing recipient","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Badge assignment: unknown recipient type","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Badge assignment: missing recipient identity","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Badge assignment: missing recipient hash type","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Badge assignment: recipient hash type unknown","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Badge assignment: incorrect recipient identity","BADGE_NOT_FOUND":"Badge not found","OUTCOME_NO_DCM_CONFIGURED":"Result: no DCM configured","OUTCOME_USER_BADGES_DISABLED":"Result: user badges disabled"}}'))},it:{translation:t(gH)}},lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});yH.init();var bH=yH;c=o("85Hg2");function SH(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)(oe.Provider,{value:i},r)}const xH=({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,showLogin:x,height:w="100%",baseURL:C,apiURL:A="https://backend.memori.ai",tag:E,pin:_,context:M,initialQuestion:T,uiLang:I,spokenLang:R,multilingual:P,authToken:k,AZURE_COGNITIVE_SERVICES_TTS_KEY:O,defaultSpeakerActive:N=!0,onStateChange:D,additionalInfo:L,customMediaRenderer:B,additionalSettings:z,userAvatar:U})=>{var F,j,H;const[G,V]=(0,c.useState)(),[W,q]=(0,c.useState)(),[K,Q]=(0,c.useState)(O),{t:Y}=be();if(!(r&&t||n&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const X=J(A),$=(0,c.useCallback)((async()=>{const e=C||(o.startsWith("https://")?o:`https://${o}`),t=await fetch(`${e}/api/speechkey`),n=await t.json();n.AZURE_COGNITIVE_SERVICES_TTS_KEY&&Q(n.AZURE_COGNITIVE_SERVICES_TTS_KEY)}),[]);(0,c.useEffect)((()=>{O||$()}),[O]);const Z=(0,c.useCallback)((async()=>{if(r&&t){const{memori:e,...n}=await X.backend.getMemoriByUserAndId(o,t,r);0===n.resultCode&&e?V(e):console.error("[MEMORI]",n,e)}else if(n&&e){const{memori:t,...r}=await X.backend.getMemori(o,e,n);0===r.resultCode&&t?V(t):console.error("[MEMORI]",r,t)}}),[r,t,n,e,o]);(0,c.useEffect)((()=>{Z()}),[Z,o]);const ee=(0,c.useCallback)((async()=>{const e=await XF(o,C);e&&q(e)}),[o,A]);(0,c.useEffect)((()=>{ee()}),[ee]),(0,c.useEffect)((()=>{if(I)bH.changeLanguage(I.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"}})();bH.changeLanguage(e).catch((()=>{bH.changeLanguage(t)}))}}),[I]);const te=G?(0,s.jsx)(QF,{layout:u,customLayout:d,height:w,baseUrl:C||(o.startsWith("https://")?o:`https://${o}`),apiUrl:A,memori:{...G,secretToken:a},memoriLang:null!=R?R:null===(j=null===(F=G.culture)||void 0===F?void 0:F.split("-"))||void 0===j?void 0:j[0],multilingual:P,tenant:W,secret:a,sessionID:l,showShare:p,showSettings:h,showInstruct:f,showTypingText:m,showClear:g,showOnlyLastMessages:v,showInputs:y,showDates:b,showContextPerLine:S,showLogin:null!=x?x:null==G?void 0:G.enableDeepThought,integration:null===(H=null==G?void 0:G.integrations)||void 0===H?void 0:H.find((e=>i?e.integrationID===i:!!e.publish&&"LANDING_EXPERIENCE"===e.type)),initialContextVars:M,initialQuestion:T,authToken:k,AZURE_COGNITIVE_SERVICES_TTS_KEY:K||O,defaultSpeakerActive:N,onStateChange:D,additionalInfo:L,customMediaRenderer:B,additionalSettings:z,userAvatar:U,...E&&_?{personification:{tag:E,pin:_}}:{}}):(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:[Y("loading")||"Loading","..."]})});return(0,s.jsxs)(SH,{i18n:bH,children:[(0,s.jsx)(ws.Toaster,{position:"top-center",reverseOrder:!0}),te]})};xH.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,showLogin: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,defaultSpeakerActive:t(l).bool,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 wH=xH;class CH 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(wH.propTypes).reduce(((e,t)=>(this.hasAttribute(t)&&(e[t]=this.getAttribute(t),"true"!==e[t]&&"false"!==e[t]||(e[t]="true"===e[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)(wH,{...r,context:o,tenantID:i,additionalInfo:l}),n):console.error("No tenantId attribute found")}}customElements.define("memori-client",CH)})();
|