@memori.ai/memori-webcomponent 6.0.0 → 6.1.0
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 +2 -2
- package/package.json +2 -2
|
@@ -232,7 +232,7 @@ to {
|
|
|
232
232
|
pointer-events: auto;
|
|
233
233
|
}
|
|
234
234
|
`,ka=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:o,containerClassName:s})=>{let{toasts:a,handlers:l}=Ws(n);return Ia.createElement("div",{style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...o},className:s,onMouseEnter:l.startPause,onMouseLeave:l.endPause},a.map((n=>{let o=n.position||t,s=((e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:ks()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}})(o,l.calculateOffset(n,{reverseOrder:e,gutter:r,defaultPosition:t}));return Ia.createElement(Ra,{id:n.id,key:n.id,onHeightUpdate:l.updateHeight,className:n.visible?Pa:"",style:s},"custom"===n.type?Rs(n.message,n):i?i(n):Ia.createElement(_a,{toast:n,position:o}))})))},Oa=Hs;c=o("85Hg2");var Na=({className:e,title:n,loading:r=!0})=>(0,s.jsx)("svg",{...n?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:t(ys)(e,{"memori-loading-icon":r}),"aria-label":n,children:(0,s.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});var Da=({primary:e=!1,outlined:n=!1,ghost:r=!1,padded:i=!0,shape:o="rounded",danger:a=!1,loading:l=!1,disabled:c=!1,block:u=!1,icon:d,className:p,title:h,id:f,htmlType:m,onClick:g,onMouseDown:v,onMouseUp:y,onMouseLeave:b,onTouchStart:S,onTouchEnd:x,children:w})=>(0,s.jsxs)("button",{id:f,type:m,onClick:g,onMouseDown:v,onMouseUp:y,onMouseLeave:b,onTouchStart:S,onTouchEnd:x,title:h,disabled:l||c,className:t(ys)("memori-button",{"memori-button--primary":e,"memori-button--outlined":n,"memori-button--ghost":r,"memori-button--square":"square"===o,"memori-button--rounded":"rounded"===o,"memori-button--circle":"circle"===o,"memori-button--padded":i,"memori-button--block":u,"memori-button--with-icon":(d||l)&&w,"memori-button--icon-only":(d||l)&&!w,"memori-button--danger":a,"memori-button--loading":l},p),children:[d&&!l&&(0,s.jsx)("span",{className:"memori-button--icon",children:d}),l&&(0,s.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,s.jsx)(Na,{loading:!0})}),w]});c=o("85Hg2"),c=o("85Hg2");function La(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,La),r}c=o("85Hg2");var Ba,za=((Ba=za||{})[Ba.None=0]="None",Ba[Ba.RenderStrategy=1]="RenderStrategy",Ba[Ba.Static=2]="Static",Ba),Fa=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Fa||{});function Ua({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:o=!0,name:s}){let a=Ha(t,e);if(o)return ja(a,n,r,s);let l=null!=i?i:0;if(2&l){let{static:e=!1,...t}=a;if(e)return ja(t,n,r,s)}if(1&l){let{unmount:e=!0,...t}=a;return La(e?0:1,{0:()=>null,1:()=>ja({...t,hidden:!0,style:{display:"none"}},n,r,s)})}return ja(a,n,r,s)}function ja(e,t={},n,r){let{as:i=n,children:o,refName:s="ref",...a}=Wa(e,["unmount","static"]),l=void 0!==e.ref?{[s]:e.ref}:{},u="function"==typeof o?o(t):o;a.className&&"function"==typeof a.className&&(a.className=a.className(t));let d={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))"boolean"==typeof i&&(e=!0),!0===i&&n.push(r);e&&(d["data-headlessui-state"]=n.join(" "))}if(i===c.Fragment&&Object.keys(Ga(a)).length>0){if(!(0,c.isValidElement)(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(a).map((e=>` - ${e}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((e=>` - ${e}`)).join("\n")].join("\n"));return(0,c.cloneElement)(u,Object.assign({},Ha(u.props,Ga(Wa(a,["ref"]))),d,l,function(...e){return{ref:e.every((e=>null==e))?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}}(u.ref,l.ref)))}return(0,c.createElement)(i,Object.assign({},Wa(a,["ref"]),i!==c.Fragment&&l,i!==c.Fragment&&d),u)}function Ha(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map((e=>[e,void 0]))));for(let e in n)Object.assign(t,{[e](t,...r){let i=n[e];for(let e of i){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function Va(e){var t;return Object.assign((0,c.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function Ga(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function Wa(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");const qa="undefined"==typeof window||"undefined"==typeof document;let Ka=qa?c.useEffect:c.useLayoutEffect;function Ja(e){let t=(0,c.useRef)(e);return Ka((()=>{t.current=e}),[e]),t}let Qa=function(e){let n=Ja(e);return t(c).useCallback(((...e)=>n.current(...e)),[n])},Ya=Symbol();function Xa(e,t=!0){return Object.assign(e,{[Ya]:t})}function $a(...e){let t=(0,c.useRef)(e);(0,c.useEffect)((()=>{t.current=e}),[e]);let n=Qa((e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)}));return e.every((e=>null==e||(null==e?void 0:e[Ya])))?void 0:n}var Za,el=((Za=el||{}).Space=" ",Za.Enter="Enter",Za.Escape="Escape",Za.Backspace="Backspace",Za.Delete="Delete",Za.ArrowLeft="ArrowLeft",Za.ArrowUp="ArrowUp",Za.ArrowRight="ArrowRight",Za.ArrowDown="ArrowDown",Za.Home="Home",Za.End="End",Za.PageUp="PageUp",Za.PageDown="PageDown",Za.Tab="Tab",Za);function tl(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}c=o("85Hg2"),c=o("85Hg2");let nl={serverHandoffComplete:!1};function rl(){let[e,t]=(0,c.useState)(nl.serverHandoffComplete);return(0,c.useEffect)((()=>{!0!==e&&t(!0)}),[e]),(0,c.useEffect)((()=>{!1===nl.serverHandoffComplete&&(nl.serverHandoffComplete=!0)}),[]),e}var il;let ol=0;function sl(){return++ol}let al=null!=(il=t(c).useId)?il:function(){let e=rl(),[n,r]=t(c).useState(e?sl:null);return Ka((()=>{null===n&&r(sl())}),[n]),null!=n?""+n:void 0};c=o("85Hg2");var ll=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(ll||{});let cl=Va((function(e,t){let{features:n=1,...r}=e;return Ua({ourProps:{ref:t,"aria-hidden":2==(2&n)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...4==(4&n)&&2!=(2&n)&&{display:"none"}}},theirProps:r,slot:{},defaultTag:"div",name:"Hidden"})}));function ul(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}function dl(){let e=[],t=[],n={enqueue(e){t.push(e)},addEventListener:(e,t,r,i)=>(e.addEventListener(t,r,i),n.add((()=>e.removeEventListener(t,r,i)))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return n.add((()=>cancelAnimationFrame(t)))},nextFrame:(...e)=>n.requestAnimationFrame((()=>n.requestAnimationFrame(...e))),setTimeout(...e){let t=setTimeout(...e);return n.add((()=>clearTimeout(t)))},microTask(...e){let t={current:!0};return ul((()=>{t.current&&e[0]()})),n.add((()=>{t.current=!1}))},add:t=>(e.push(t),()=>{let n=e.indexOf(t);if(n>=0){let[t]=e.splice(n,1);t()}}),dispose(){for(let t of e.splice(0))t()},async workQueue(){for(let e of t.splice(0))await e()}};return n}function pl(e){return qa?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let hl=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var fl,ml,gl=((ml=gl||{})[ml.First=1]="First",ml[ml.Previous=2]="Previous",ml[ml.Next=4]="Next",ml[ml.Last=8]="Last",ml[ml.WrapAround=16]="WrapAround",ml[ml.NoScroll=32]="NoScroll",ml),vl=((fl=vl||{})[fl.Error=0]="Error",fl[fl.Overflow=1]="Overflow",fl[fl.Success=2]="Success",fl[fl.Underflow=3]="Underflow",fl),yl=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(yl||{});function bl(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(hl))}var Sl=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Sl||{});function xl(e,t=0){var n;return e!==(null==(n=pl(e))?void 0:n.body)&&La(t,{0:()=>e.matches(hl),1(){let t=e;for(;null!==t;){if(t.matches(hl))return!0;t=t.parentElement}return!1}})}function wl(e){let t=pl(e);dl().nextFrame((()=>{t&&!xl(t.activeElement,0)&&Cl(e)}))}function Cl(e){null==e||e.focus({preventScroll:!0})}let Al=["textarea","input"].join(",");function El(e,t=(e=>e)){return e.slice().sort(((e,n)=>{let r=t(e),i=t(n);if(null===r||null===i)return 0;let o=r.compareDocumentPosition(i);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function Ml(e,t){return Tl(bl(),t,!0,e)}function Tl(e,t,n=!0,r=null){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?El(e):e:bl(e);r=null!=r?r:i.activeElement;let s,a=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,o.indexOf(r))-1;if(4&t)return Math.max(0,o.indexOf(r))+1;if(8&t)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&t?{preventScroll:!0}:{},u=0,d=o.length;do{if(u>=d||u+d<=0)return 0;let e=l+u;if(16&t)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}s=o[e],null==s||s.focus(c),u+=a}while(s!==i.activeElement);return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,Al))&&n}(s)&&s.select(),s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),2}c=o("85Hg2"),c=o("85Hg2");function _l(e,t,n){let r=Ja(t);(0,c.useEffect)((()=>{function t(e){r.current(e)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)}),[e,n])}var Il=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Il||{});function Rl(){let e=(0,c.useRef)(0);return _l("keydown",(t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)}),!0),e}c=o("85Hg2");function Pl(){let e=(0,c.useRef)(!1);return Ka((()=>(e.current=!0,()=>{e.current=!1})),[]),e}c=o("85Hg2");function kl(...e){return(0,c.useMemo)((()=>pl(...e)),[...e])}c=o("85Hg2");function Ol(e,t,n,r){let i=Ja(n);(0,c.useEffect)((()=>{function n(e){i.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}),[e,t,r])}c=o("85Hg2");function Nl(e,t){let n=(0,c.useRef)([]),r=Qa(e);(0,c.useEffect)((()=>{let e=[...n.current];for(let[i,o]of t.entries())if(n.current[i]!==o){let i=r(t,e);return n.current=t,i}}),[r,...t])}var Dl=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(Dl||{});let Ll=Object.assign(Va((function(e,n){let r=(0,c.useRef)(null),i=$a(r,n),{initialFocus:o,containers:s,features:a=30,...l}=e;rl()||(a=1);let u=kl(r);!function({ownerDocument:e},t){let n=(0,c.useRef)(null);Ol(null==e?void 0:e.defaultView,"focusout",(e=>{!t||n.current||(n.current=e.target)}),!0),Nl((()=>{t||((null==e?void 0:e.activeElement)===(null==e?void 0:e.body)&&Cl(n.current),n.current=null)}),[t]);let r=(0,c.useRef)(!1);(0,c.useEffect)((()=>(r.current=!1,()=>{r.current=!0,ul((()=>{!r.current||(Cl(n.current),n.current=null)}))})),[])}({ownerDocument:u},Boolean(16&a));let d=function({ownerDocument:e,container:t,initialFocus:n},r){let i=(0,c.useRef)(null),o=Pl();return Nl((()=>{if(!r)return;let s=t.current;!s||ul((()=>{if(!o.current)return;let t=null==e?void 0:e.activeElement;if(null!=n&&n.current){if((null==n?void 0:n.current)===t)return void(i.current=t)}else if(s.contains(t))return void(i.current=t);null!=n&&n.current?Cl(n.current):Tl(s,gl.First)===vl.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=null==e?void 0:e.activeElement}))}),[r]),i}({ownerDocument:u,container:r,initialFocus:o},Boolean(2&a));!function({ownerDocument:e,container:t,containers:n,previousActiveElement:r},i){let o=Pl();Ol(null==e?void 0:e.defaultView,"focus",(e=>{if(!i||!o.current)return;let s=new Set(null==n?void 0:n.current);s.add(t);let a=r.current;if(!a)return;let l=e.target;l&&l instanceof HTMLElement?function(e,t){var n;for(let r of e)if(null!=(n=r.current)&&n.contains(t))return!0;return!1}(s,l)?(r.current=l,Cl(l)):(e.preventDefault(),e.stopPropagation(),Cl(a)):Cl(r.current)}),!0)}({ownerDocument:u,container:r,containers:s,previousActiveElement:d},Boolean(8&a));let p=Rl(),h=Qa((()=>{let e=r.current;!e||La(p.current,{[Il.Forwards]:()=>Tl(e,gl.First),[Il.Backwards]:()=>Tl(e,gl.Last)})})),f={ref:i};return t(c).createElement(t(c).Fragment,null,Boolean(4&a)&&t(c).createElement(cl,{as:"button",type:"button",onFocus:h,features:ll.Focusable}),Ua({ourProps:f,theirProps:l,defaultTag:"div",name:"FocusTrap"}),Boolean(4&a)&&t(c).createElement(cl,{as:"button",type:"button",onFocus:h,features:ll.Focusable}))})),{features:Dl});let Bl=new Set,zl=new Map;function Fl(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function Ul(e){let t=zl.get(e);!t||(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}function jl(e,t=!0){Ka((()=>{if(!t||!e.current)return;let n=e.current,r=pl(n);if(r){Bl.add(n);for(let e of zl.keys())e.contains(n)&&(Ul(e),zl.delete(e));return r.querySelectorAll("body > *").forEach((e=>{if(e instanceof HTMLElement){for(let t of Bl)if(e.contains(t))return;1===Bl.size&&(zl.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),Fl(e))}})),()=>{if(Bl.delete(n),Bl.size>0)r.querySelectorAll("body > *").forEach((e=>{if(e instanceof HTMLElement&&!zl.has(e)){for(let t of Bl)if(e.contains(t))return;zl.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),Fl(e)}}));else for(let e of zl.keys())Ul(e),zl.delete(e)}}}),[t])}c=o("85Hg2");let Hl=(0,(c=o("85Hg2")).createContext)(!1);function Vl(e){return t(c).createElement(Hl.Provider,{value:e.force},e.children)}function Gl(e){let t=(0,c.useContext)(Hl),n=(0,c.useContext)(Jl),r=kl(e),[i,o]=(0,c.useState)((()=>{if(!t&&null!==n||qa)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let i=r.createElement("div");return i.setAttribute("id","headlessui-portal-root"),r.body.appendChild(i)}));return(0,c.useEffect)((()=>{null!==i&&(null!=r&&r.body.contains(i)||null==r||r.body.appendChild(i))}),[i,r]),(0,c.useEffect)((()=>{t||null!==n&&o(n.current)}),[n,o,t]),i}let Wl=c.Fragment,ql=Va((function(e,t){let n=e,r=(0,c.useRef)(null),i=$a(Xa((e=>{r.current=e})),t),o=kl(r),s=Gl(r),[l]=(0,c.useState)((()=>{var e;return qa?null:null!=(e=null==o?void 0:o.createElement("div"))?e:null})),u=rl(),d=(0,c.useRef)(!1);return Ka((()=>{if(d.current=!1,s&&l)return s.contains(l)||(l.setAttribute("data-headlessui-portal",""),s.appendChild(l)),()=>{d.current=!0,ul((()=>{var e;!d.current||!s||!l||(s.removeChild(l),s.childNodes.length<=0&&(null==(e=s.parentElement)||e.removeChild(s)))}))}}),[s,l]),u&&s&&l?(0,a.createPortal)(Ua({ourProps:{ref:i},theirProps:n,defaultTag:Wl,name:"Portal"}),l):null})),Kl=c.Fragment,Jl=(0,c.createContext)(null),Ql=Va((function(e,n){let{target:r,...i}=e,o={ref:$a(n)};return t(c).createElement(Jl.Provider,{value:r},Ua({ourProps:o,theirProps:i,defaultTag:Kl,name:"Popover.Group"}))})),Yl=Object.assign(ql,{Group:Ql});let Xl=(0,(c=o("85Hg2")).createContext)(null);function $l(){let e=(0,c.useContext)(Xl);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,$l),e}return e}function Zl(){let[e,n]=(0,c.useState)([]);return[e.length>0?e.join(" "):void 0,(0,c.useMemo)((()=>function(e){let r=Qa((e=>(n((t=>[...t,e])),()=>n((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=(0,c.useMemo)((()=>({register:r,slot:e.slot,name:e.name,props:e.props})),[r,e.slot,e.name,e.props]);return t(c).createElement(Xl.Provider,{value:i},e.children)}),[n])]}let ec=Va((function(e,t){let n=$l(),r=`headlessui-description-${al()}`,i=$a(t);Ka((()=>n.register(r)),[r,n.register]);let o=e;return Ua({ourProps:{ref:i,...n.props,id:r},theirProps:o,slot:n.slot||{},defaultTag:"p",name:n.name||"Description"})}));let tc=(0,(c=o("85Hg2")).createContext)(null);tc.displayName="OpenClosedContext";var nc=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(nc||{});function rc(){return(0,c.useContext)(tc)}function ic({value:e,children:n}){return t(c).createElement(tc.Provider,{value:e},n)}let oc=(0,(c=o("85Hg2")).createContext)((()=>{}));oc.displayName="StackContext";var sc=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(sc||{});function ac({children:e,onUpdate:n,type:r,element:i,enabled:o}){let s=(0,c.useContext)(oc),a=Qa(((...e)=>{null==n||n(...e),s(...e)}));return Ka((()=>{let e=void 0===o||!0===o;return e&&a(0,r,i),()=>{e&&a(1,r,i)}}),[a,r,i,o]),t(c).createElement(oc.Provider,{value:a},e)}c=o("85Hg2"),c=o("85Hg2");function lc(e,t,n){let r=Ja(t);(0,c.useEffect)((()=>{function t(e){r.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)}),[e,n])}function cc(e,t,n=!0){let r=(0,c.useRef)(!1);function i(n,i){if(!r.current||n.defaultPrevented)return;let o=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e),s=i(n);if(null!==s&&s.getRootNode().contains(s)){for(let e of o){if(null===e)continue;let t=e instanceof HTMLElement?e:e.current;if(null!=t&&t.contains(s))return}return!xl(s,Sl.Loose)&&-1!==s.tabIndex&&n.preventDefault(),t(n,s)}}(0,c.useEffect)((()=>{requestAnimationFrame((()=>{r.current=n}))}),[n]);let o=(0,c.useRef)(null);lc("mousedown",(e=>{var t,n;r.current&&(o.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)}),!0),lc("click",(e=>{!o.current||(i(e,(()=>o.current)),o.current=null)}),!0),lc("blur",(e=>i(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}var uc=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(uc||{}),dc=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(dc||{});let pc={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},hc=(0,c.createContext)(null);function fc(e){let t=(0,c.useContext)(hc);if(null===t){let t=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,fc),t}return t}function mc(e,t){(0,c.useEffect)((()=>{var n;if(!t||!e)return;let r=dl();function i(e,t,n){let i=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),r.add((()=>{Object.assign(e.style,{[t]:i})}))}let o=e.documentElement,s=(null!=(n=e.defaultView)?n:window).innerWidth-o.clientWidth;if(i(o,"overflow","hidden"),s>0){i(o,"paddingRight",`${s-(o.clientWidth-o.offsetWidth)}px`)}if(/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0){let e=window.pageYOffset;i(o,"position","fixed"),i(o,"marginTop",`-${e}px`),i(o,"width","100%"),r.add((()=>window.scrollTo(0,e)))}return r.dispose}),[e,t])}function gc(e,t){return La(t.type,pc,e,t)}hc.displayName="DialogContext";let vc=za.RenderStrategy|za.Static,yc=Va((function(e,n){let{open:r,onClose:i,initialFocus:o,__demoMode:s=!1,...a}=e,[l,u]=(0,c.useState)(0),d=rc();void 0===r&&null!==d&&(r=La(d,{[nc.Open]:!0,[nc.Closed]:!1}));let p=(0,c.useRef)(new Set),h=(0,c.useRef)(null),f=$a(h,n),m=(0,c.useRef)(null),g=kl(h),v=e.hasOwnProperty("open")||null!==d,y=e.hasOwnProperty("onClose");if(!v&&!y)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!y)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof r)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${r}`);if("function"!=typeof i)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${i}`);let b=r?0:1,[S,x]=(0,c.useReducer)(gc,{titleId:null,descriptionId:null,panelRef:(0,c.createRef)()}),w=Qa((()=>i(!1))),C=Qa((e=>x({type:0,id:e}))),A=!!rl()&&(!s&&0===b),E=l>1,M=null!==(0,c.useContext)(hc),T=E?"parent":"leaf";jl(h,!!E&&A),cc((()=>{var e,t;return[...Array.from(null!=(e=null==g?void 0:g.querySelectorAll("body > *, [data-headlessui-portal]"))?e:[]).filter((e=>!(!(e instanceof HTMLElement)||e.contains(m.current)||S.panelRef.current&&e.contains(S.panelRef.current)))),null!=(t=S.panelRef.current)?t:h.current]}),w,A&&!E),Ol(null==g?void 0:g.defaultView,"keydown",(e=>{e.defaultPrevented||e.key===el.Escape&&0===b&&(E||(e.preventDefault(),e.stopPropagation(),w()))})),mc(g,0===b&&!M),(0,c.useEffect)((()=>{if(0!==b||!h.current)return;let e=new IntersectionObserver((e=>{for(let t of e)0===t.boundingClientRect.x&&0===t.boundingClientRect.y&&0===t.boundingClientRect.width&&0===t.boundingClientRect.height&&w()}));return e.observe(h.current),()=>e.disconnect()}),[b,h,w]);let[_,I]=Zl(),R=`headlessui-dialog-${al()}`,P=(0,c.useMemo)((()=>[{dialogState:b,close:w,setTitleId:C},S]),[b,S,w,C]),k=(0,c.useMemo)((()=>({open:0===b})),[b]),O={ref:f,id:R,role:"dialog","aria-modal":0===b||void 0,"aria-labelledby":S.titleId,"aria-describedby":_};return t(c).createElement(ac,{type:"Dialog",enabled:0===b,element:h,onUpdate:Qa(((e,t,n)=>{"Dialog"===t&&La(e,{[sc.Add](){p.current.add(n),u((e=>e+1))},[sc.Remove](){p.current.add(n),u((e=>e-1))}})}))},t(c).createElement(Vl,{force:!0},t(c).createElement(Yl,null,t(c).createElement(hc.Provider,{value:P},t(c).createElement(Yl.Group,{target:h},t(c).createElement(Vl,{force:!1},t(c).createElement(I,{slot:k,name:"Dialog.Description"},t(c).createElement(Ll,{initialFocus:o,containers:p,features:A?La(T,{parent:Ll.features.RestoreFocus,leaf:Ll.features.All&~Ll.features.FocusLock}):Ll.features.None},Ua({ourProps:O,theirProps:a,slot:k,defaultTag:"div",features:vc,visible:0===b,name:"Dialog"})))))))),t(c).createElement(cl,{features:ll.Hidden,ref:m}))})),bc=Va((function(e,t){let[{dialogState:n,close:r}]=fc("Dialog.Overlay");return Ua({ourProps:{ref:$a(t),id:`headlessui-dialog-overlay-${al()}`,"aria-hidden":!0,onClick:Qa((e=>{if(e.target===e.currentTarget){if(tl(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),r()}}))},theirProps:e,slot:(0,c.useMemo)((()=>({open:0===n})),[n]),defaultTag:"div",name:"Dialog.Overlay"})})),Sc=Va((function(e,n){let[{dialogState:r},i]=fc("Dialog.Backdrop"),o=$a(n),s=`headlessui-dialog-backdrop-${al()}`;(0,c.useEffect)((()=>{if(null===i.panelRef.current)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")}),[i.panelRef]);let a=(0,c.useMemo)((()=>({open:0===r})),[r]);return t(c).createElement(Vl,{force:!0},t(c).createElement(Yl,null,Ua({ourProps:{ref:o,id:s,"aria-hidden":!0},theirProps:e,slot:a,defaultTag:"div",name:"Dialog.Backdrop"})))})),xc=Va((function(e,t){let[{dialogState:n},r]=fc("Dialog.Panel"),i=$a(t,r.panelRef),o=`headlessui-dialog-panel-${al()}`,s=(0,c.useMemo)((()=>({open:0===n})),[n]);return Ua({ourProps:{ref:i,id:o,onClick:Qa((e=>{e.stopPropagation()}))},theirProps:e,slot:s,defaultTag:"div",name:"Dialog.Panel"})})),wc=Va((function(e,t){let[{dialogState:n,setTitleId:r}]=fc("Dialog.Title"),i=`headlessui-dialog-title-${al()}`,o=$a(t);(0,c.useEffect)((()=>(r(i),()=>r(null))),[i,r]);let s=(0,c.useMemo)((()=>({open:0===n})),[n]);return Ua({ourProps:{ref:o,id:i},theirProps:e,slot:s,defaultTag:"h2",name:"Dialog.Title"})})),Cc=Object.assign(yc,{Backdrop:Sc,Panel:xc,Overlay:bc,Title:wc,Description:ec});c=o("85Hg2");function Ac(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Ec(e,...t){e&&t.length>0&&e.classList.add(...t)}function Mc(e,...t){e&&t.length>0&&e.classList.remove(...t)}var Tc=(e=>(e.Ended="ended",e.Cancelled="cancelled",e))(Tc||{});function _c(e,t,n,r){let i=n?"enter":"leave",o=dl(),s=void 0!==r?Ac(r):()=>{};"enter"===i&&(e.removeAttribute("hidden"),e.style.display="");let a=La(i,{enter:()=>t.enter,leave:()=>t.leave}),l=La(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=La(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Mc(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Ec(e,...a,...c),o.nextFrame((()=>{Mc(e,...c),Ec(e,...l),function(e,t){let n=dl();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[o,s]=[r,i].map((e=>{let[t=0]=e.split(",").filter(Boolean).map((e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e))).sort(((e,t)=>t-e));return t}));if(o+s!==0){let r=[];r.push(n.addEventListener(e,"transitionrun",(i=>{i.target===i.currentTarget&&(r.splice(0).forEach((e=>e())),r.push(n.addEventListener(e,"transitionend",(e=>{e.target===e.currentTarget&&(t("ended"),r.splice(0).forEach((e=>e())))})),n.addEventListener(e,"transitioncancel",(e=>{e.target===e.currentTarget&&(t("cancelled"),r.splice(0).forEach((e=>e())))}))))})))}else t("ended");n.add((()=>t("cancelled"))),n.dispose}(e,(n=>("ended"===n&&(Mc(e,...a),Ec(e,...t.entered)),s(n))))})),o.dispose}function Ic(){let[e]=(0,c.useState)(dl);return(0,c.useEffect)((()=>()=>e.dispose()),[e]),e}function Rc({container:e,direction:t,classes:n,onStart:r,onStop:i}){let o=Pl(),s=Ic(),a=Ja(t);Ka((()=>{let t=dl();s.add(t.dispose);let l=e.current;if(l&&"idle"!==a.current&&o.current)return t.dispose(),r.current(a.current),t.add(_c(l,n.current,"enter"===a.current,(e=>{t.dispose(),La(e,{[Tc.Ended](){i.current(a.current)},[Tc.Cancelled]:()=>{}})}))),t.dispose}),[t])}function Pc(e=""){return e.split(" ").filter((e=>e.trim().length>1))}let kc=(0,(c=o("85Hg2")).createContext)(null);kc.displayName="TransitionContext";var Oc,Nc=((Oc=Nc||{}).Visible="visible",Oc.Hidden="hidden",Oc);let Dc=(0,c.createContext)(null);function Lc(e){return"children"in e?Lc(e.children):e.current.filter((({el:e})=>null!==e.current)).filter((({state:e})=>"visible"===e)).length>0}function Bc(e,t){let n=Ja(e),r=(0,c.useRef)([]),i=Pl(),o=Ic(),s=Qa(((e,t=Fa.Hidden)=>{let s=r.current.findIndex((({el:t})=>t===e));-1!==s&&(La(t,{[Fa.Unmount](){r.current.splice(s,1)},[Fa.Hidden](){r.current[s].state="hidden"}}),o.microTask((()=>{var e;!Lc(r)&&i.current&&(null==(e=n.current)||e.call(n))})))})),a=Qa((e=>{let t=r.current.find((({el:t})=>t===e));return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>s(e,Fa.Unmount)})),l=(0,c.useRef)([]),u=(0,c.useRef)(Promise.resolve()),d=(0,c.useRef)({enter:[],leave:[],idle:[]}),p=Qa(((e,n,r)=>{l.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter((([t])=>t!==e))),null==t||t.chains.current[n].push([e,new Promise((e=>{l.current.push(e)}))]),null==t||t.chains.current[n].push([e,new Promise((e=>{Promise.all(d.current[n].map((([e,t])=>t))).then((()=>e()))}))]),"enter"===n?u.current=u.current.then((()=>null==t?void 0:t.wait.current)).then((()=>r(n))):r(n)})),h=Qa(((e,t,n)=>{Promise.all(d.current[t].splice(0).map((([e,t])=>t))).then((()=>{var e;null==(e=l.current.shift())||e()})).then((()=>n(t)))}));return(0,c.useMemo)((()=>({children:r,register:a,unregister:s,onStart:p,onStop:h,wait:u,chains:d})),[a,s,r,p,h,d,u])}function zc(){}Dc.displayName="NestingContext";let Fc=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Uc(e){var t;let n={};for(let r of Fc)n[r]=null!=(t=e[r])?t:zc;return n}let jc=za.RenderStrategy,Hc=Va((function(e,n){let{beforeEnter:r,afterEnter:i,beforeLeave:o,afterLeave:s,enter:a,enterFrom:l,enterTo:u,entered:d,leave:p,leaveFrom:h,leaveTo:f,...m}=e,g=(0,c.useRef)(null),v=$a(g,n),y=m.unmount?Fa.Unmount:Fa.Hidden,{show:b,appear:S,initial:x}=function(){let e=(0,c.useContext)(kc);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[w,C]=(0,c.useState)(b?"visible":"hidden"),A=function(){let e=(0,c.useContext)(Dc);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:E,unregister:M}=A,T=(0,c.useRef)(null);(0,c.useEffect)((()=>E(g)),[E,g]),(0,c.useEffect)((()=>{if(y===Fa.Hidden&&g.current)return b&&"visible"!==w?void C("visible"):La(w,{hidden:()=>M(g),visible:()=>E(g)})}),[w,g,E,M,b,y]);let _=Ja({enter:Pc(a),enterFrom:Pc(l),enterTo:Pc(u),entered:Pc(d),leave:Pc(p),leaveFrom:Pc(h),leaveTo:Pc(f)}),I=function(e){let t=(0,c.useRef)(Uc(e));return(0,c.useEffect)((()=>{t.current=Uc(e)}),[e]),t}({beforeEnter:r,afterEnter:i,beforeLeave:o,afterLeave:s}),R=rl();(0,c.useEffect)((()=>{if(R&&"visible"===w&&null===g.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[g,w,R]);let P=x&&!S,k=!R||P||T.current===b?"idle":b?"enter":"leave",O=Qa((e=>La(e,{enter:()=>I.current.beforeEnter(),leave:()=>I.current.beforeLeave(),idle:()=>{}}))),N=Qa((e=>La(e,{enter:()=>I.current.afterEnter(),leave:()=>I.current.afterLeave(),idle:()=>{}}))),D=Bc((()=>{C("hidden"),M(g)}),A);Rc({container:g,classes:_,direction:k,onStart:Ja((e=>{D.onStart(g,e,O)})),onStop:Ja((e=>{D.onStop(g,e,N),"leave"===e&&!Lc(D)&&(C("hidden"),M(g))}))}),(0,c.useEffect)((()=>{!P||(y===Fa.Hidden?T.current=null:T.current=b)}),[b,P,w]);let L=m,B={ref:v};return t(c).createElement(Dc.Provider,{value:D},t(c).createElement(ic,{value:La(w,{visible:nc.Open,hidden:nc.Closed})},Ua({ourProps:B,theirProps:L,defaultTag:"div",features:jc,visible:"visible"===w,name:"Transition.Child"})))})),Vc=Va((function(e,n){let{show:r,appear:i=!1,unmount:o,...s}=e,a=(0,c.useRef)(null),l=$a(a,n);rl();let u=rc();if(void 0===r&&null!==u&&(r=La(u,{[nc.Open]:!0,[nc.Closed]:!1})),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,p]=(0,c.useState)(r?"visible":"hidden"),h=Bc((()=>{p("hidden")})),[f,m]=(0,c.useState)(!0),g=(0,c.useRef)([r]);Ka((()=>{!1!==f&&g.current[g.current.length-1]!==r&&(g.current.push(r),m(!1))}),[g,r]);let v=(0,c.useMemo)((()=>({show:r,appear:i,initial:f})),[r,i,f]);(0,c.useEffect)((()=>{if(r)p("visible");else if(Lc(h)){let e=a.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&p("hidden")}else p("hidden")}),[r,h]);let y={unmount:o};return t(c).createElement(Dc.Provider,{value:h},t(c).createElement(kc.Provider,{value:v},Ua({ourProps:{...y,as:c.Fragment,children:t(c).createElement(Hc,{ref:l,...y,...s})},theirProps:{},defaultTag:c.Fragment,features:jc,visible:"visible"===d,name:"Transition"})))})),Gc=Va((function(e,n){let r=null!==(0,c.useContext)(kc),i=null!==rc();return t(c).createElement(t(c).Fragment,null,!r&&i?t(c).createElement(Vc,{ref:n,...e}):t(c).createElement(Hc,{ref:n,...e}))})),Wc=Object.assign(Vc,{Child:Gc,Root:Vc});var qc=({spinning:e=!1,primary:n=!1,className:r,children:i})=>(0,s.jsxs)("div",{className:t(ys)("memori-spin",r,{"memori-spin--spinning":e,"memori-spin--primary":n}),children:[i,(0,s.jsx)("div",{className:"memori-spin--spinner",children:(0,s.jsx)(Na,{loading:!0})})]});var Kc=({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:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"})});var Jc=({open:e=!1,onClose:n,className:r,title:i,description:o,children:a,footer:l,loading:u=!1,closable:d=!0,width:p="100%",widthMd:h="100%"})=>{const{t:f}=ve();return(0,s.jsx)(Wc,{appear:!0,show:e,as:t(c).Fragment,children:(0,s.jsxs)(Cc,{open:e,onClose:n,className:t(ys)("memori-modal",r),children:[(0,s.jsx)(Wc.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)("div",{className:"memori-modal--backdrop"})}),(0,s.jsx)("div",{className:"memori-modal--container",children:(0,s.jsx)("div",{className:"memori-modal--container-scrollable",children:(0,s.jsx)(Wc.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsxs)(Cc.Panel,{className:"memori-modal--panel",children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n .memori-modal--panel {\n --memori-modal--width: ${p};\n --memori-modal--width-md: ${h};\n }\n `}}),d&&(0,s.jsx)("div",{className:"memori-modal--close",children:(0,s.jsx)(Da,{ghost:!0,padded:!0,shape:"circle",icon:(0,s.jsx)(Kc,{}),title:f("close")||"Close",onClick:()=>n(!1)})}),(0,s.jsxs)(qc,{spinning:u,children:[i&&(0,s.jsx)(Cc.Title,{className:"memori-modal--title",children:i}),o&&(0,s.jsx)(Cc.Description,{className:"memori-modal--description",children:o}),a,l&&(0,s.jsx)("div",{className:"memori-modal--footer",children:l})]})]})})})})]})})},Qc=(c=o("85Hg2"),e=>"checkbox"===e.type),Yc=e=>e instanceof Date,Xc=e=>null==e;const $c=e=>"object"==typeof e;var Zc=e=>!Xc(e)&&!Array.isArray(e)&&$c(e)&&!Yc(e),eu=e=>Zc(e)&&e.target?Qc(e.target)?e.target.checked:e.target.value:e,tu=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),nu=e=>Array.isArray(e)?e.filter(Boolean):[],ru=e=>void 0===e,iu=(e,t,n)=>{if(!t||!Zc(e))return n;const r=nu(t.split(/[,[\].]+?/)).reduce(((e,t)=>Xc(e)?e:e[t]),e);return ru(r)||r===e?ru(e[t])?n:e[t]:r};const ou="blur",su="focusout",au="onBlur",lu="onChange",cu="onSubmit",uu="onTouched",du="all",pu="max",hu="min",fu="maxLength",mu="minLength",gu="pattern",vu="required",yu="validate";t(c).createContext(null);var bu=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const i=o;return t._proxyFormState[i]!==du&&(t._proxyFormState[i]=!r||du),n&&(n[i]=!0),e[i]}});return i},Su=e=>Zc(e)&&!Object.keys(e).length,xu=(e,t,n)=>{const{name:r,...i}=e;return Su(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find((e=>t[e]===(!n||du)))},wu=e=>Array.isArray(e)?e:[e];function Cu(e){const n=t(c).useRef(e);n.current=e,t(c).useEffect((()=>{const t=!e.disabled&&n.current.subject.subscribe({next:n.current.callback});return()=>{t&&t.unsubscribe()}}),[e.disabled])}var Au=e=>"string"==typeof e,Eu=(e,t,n,r)=>Au(e)?(r&&t.watch.add(e),iu(n,e)):Array.isArray(e)?e.map((e=>(r&&t.watch.add(e),iu(n,e)))):(t.watchAll=!!r,n),Mu="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Tu(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(Mu&&(e instanceof Blob||e instanceof FileList)||!n&&!Zc(e))return e;if(t=n?[]:{},Array.isArray(e)||(e=>{const t=e.constructor&&e.constructor.prototype;return Zc(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)t[n]=Tu(e[n]);else t=e}return t}var _u=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Iu=e=>/^\w*$/.test(e),Ru=e=>nu(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Pu(e,t,n){let r=-1;const i=Iu(t)?[t]:Ru(t),o=i.length,s=o-1;for(;++r<o;){const t=i[r];let o=n;if(r!==s){const n=e[t];o=Zc(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}e[t]=o,e=e[t]}return e}const ku=(e,t,n)=>{for(const r of n||Object.keys(e)){const n=iu(e,r);if(n){const{_f:e,...r}=n;if(e&&t(e.name)){if(e.ref.focus){e.ref.focus();break}if(e.refs&&e.refs[0].focus){e.refs[0].focus();break}}else Zc(r)&&ku(r,t)}}};var Ou=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))))),Nu=(e,t,n)=>{const r=nu(iu(e,n));return Pu(r,"root",t[n]),Pu(e,n,r),e},Du=e=>"boolean"==typeof e,Lu=e=>"file"===e.type,Bu=e=>"function"==typeof e,zu=e=>Au(e)||t(c).isValidElement(e),Fu=e=>"radio"===e.type,Uu=e=>e instanceof RegExp;const ju={value:!1,isValid:!1},Hu={value:!0,isValid:!0};var Vu=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ru(e[0].attributes.value)?ru(e[0].value)||""===e[0].value?Hu:{value:e[0].value,isValid:!0}:Hu:ju}return ju};const Gu={isValid:!1,value:null};var Wu=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),Gu):Gu;function qu(e,t,n="validate"){if(zu(e)||Array.isArray(e)&&e.every(zu)||Du(e)&&!e)return{type:n,message:zu(e)?e:"",ref:t}}var Ku=e=>Zc(e)&&!Uu(e)?e:{value:e,message:""},Ju=async(e,t,n,r,i)=>{const{ref:o,refs:s,required:a,maxLength:l,minLength:c,min:u,max:d,pattern:p,validate:h,name:f,valueAsNumber:m,mount:g,disabled:v}=e._f;if(!g||v)return{};const y=s?s[0]:o,b=e=>{r&&y.reportValidity&&(y.setCustomValidity(Du(e)?"":e||""),y.reportValidity())},S={},x=Fu(o),w=Qc(o),C=x||w,A=(m||Lu(o))&&!o.value||""===t||Array.isArray(t)&&!t.length,E=_u.bind(null,f,n,S),M=(e,t,n,r=fu,i=mu)=>{const s=e?t:n;S[f]={type:e?r:i,message:s,ref:o,...E(e?r:i,s)}};if(i?!Array.isArray(t)||!t.length:a&&(!C&&(A||Xc(t))||Du(t)&&!t||w&&!Vu(s).isValid||x&&!Wu(s).isValid)){const{value:e,message:t}=zu(a)?{value:!!a,message:a}:Ku(a);if(e&&(S[f]={type:vu,message:t,ref:y,...E(vu,t)},!n))return b(t),S}if(!(A||Xc(u)&&Xc(d))){let e,r;const i=Ku(d),s=Ku(u);if(Xc(t)||isNaN(t)){const n=o.valueAsDate||new Date(t),a=e=>new Date((new Date).toDateString()+" "+e),l="time"==o.type,c="week"==o.type;Au(i.value)&&t&&(e=l?a(t)>a(i.value):c?t>i.value:n>new Date(i.value)),Au(s.value)&&t&&(r=l?a(t)<a(s.value):c?t<s.value:n<new Date(s.value))}else{const n=o.valueAsNumber||(t?+t:t);Xc(i.value)||(e=n>i.value),Xc(s.value)||(r=n<s.value)}if((e||r)&&(M(!!e,i.message,s.message,pu,hu),!n))return b(S[f].message),S}if((l||c)&&!A&&(Au(t)||i&&Array.isArray(t))){const e=Ku(l),r=Ku(c),i=!Xc(e.value)&&t.length>e.value,o=!Xc(r.value)&&t.length<r.value;if((i||o)&&(M(i,e.message,r.message),!n))return b(S[f].message),S}if(p&&!A&&Au(t)){const{value:e,message:r}=Ku(p);if(Uu(e)&&!t.match(e)&&(S[f]={type:gu,message:r,ref:o,...E(gu,r)},!n))return b(r),S}if(h)if(Bu(h)){const e=qu(await h(t),y);if(e&&(S[f]={...e,...E(yu,e.message)},!n))return b(e.message),S}else if(Zc(h)){let e={};for(const r in h){if(!Su(e)&&!n)break;const i=qu(await h[r](t),y,r);i&&(e={...i,...E(r,i.message)},b(i.message),n&&(S[f]=e))}if(!Su(e)&&(S[f]={ref:y,...e},!n))return S}return b(!0),S};var Qu=e=>({isOnSubmit:!e||e===cu,isOnBlur:e===au,isOnChange:e===lu,isOnAll:e===du,isOnTouch:e===uu});function Yu(e){for(const t in e)if(!ru(e[t]))return!1;return!0}function Xu(e,t){const n=Iu(t)?[t]:Ru(t),r=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=ru(e)?r++:e[t[r++]];return e}(e,n),i=n[n.length-1];let o;r&&delete r[i];for(let t=0;t<n.slice(0,-1).length;t++){let r,i=-1;const s=n.slice(0,-(t+1)),a=s.length-1;for(t>0&&(o=e);++i<s.length;){const t=s[i];r=r?r[t]:e[t],a===i&&(Zc(r)&&Su(r)||Array.isArray(r)&&Yu(r))&&(o?delete o[t]:delete e[t]),o=r}}return e}function $u(){let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}}var Zu=e=>Xc(e)||!$c(e);function ed(e,t){if(Zu(e)||Zu(t))return e===t;if(Yc(e)&&Yc(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const n=e[i];if(!r.includes(i))return!1;if("ref"!==i){const e=t[i];if(Yc(n)&&Yc(e)||Zc(n)&&Zc(e)||Array.isArray(n)&&Array.isArray(e)?!ed(n,e):n!==e)return!1}}return!0}var td=e=>{const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},nd=e=>"select-multiple"===e.type,rd=e=>td(e)&&e.isConnected,id=e=>{for(const t in e)if(Bu(e[t]))return!0;return!1};function od(e,t={}){const n=Array.isArray(e);if(Zc(e)||n)for(const n in e)Array.isArray(e[n])||Zc(e[n])&&!id(e[n])?(t[n]=Array.isArray(e[n])?[]:{},od(e[n],t[n])):Xc(e[n])||(t[n]=!0);return t}function sd(e,t,n){const r=Array.isArray(e);if(Zc(e)||r)for(const r in e)Array.isArray(e[r])||Zc(e[r])&&!id(e[r])?ru(t)||Zu(n[r])?n[r]=Array.isArray(e[r])?od(e[r],[]):{...od(e[r])}:sd(e[r],Xc(t)?{}:t[r],n[r]):ed(e[r],t[r])?delete n[r]:n[r]=!0;return n}var ad=(e,t)=>sd(e,t,od(t)),ld=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ru(e)?e:t?""===e?NaN:e?+e:e:n&&Au(e)?new Date(e):r?r(e):e;function cd(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return Lu(t)?t.files:Fu(t)?Wu(e.refs).value:nd(t)?[...t.selectedOptions].map((({value:e})=>e)):Qc(t)?Vu(e.refs).value:ld(ru(t.value)?e.ref.value:t.value,e)}var ud=e=>ru(e)?e:Uu(e)?e.source:Zc(e)?Uu(e.value)?e.value.source:e.value:e;function dd(e,t,n){const r=iu(e,n);if(r||Iu(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const r=i.join("."),o=iu(t,r),s=iu(e,r);if(o&&!Array.isArray(o)&&n!==r)return{name:n};if(s&&s.type)return{name:r,error:s};i.pop()}return{name:n}}const pd={mode:cu,reValidateMode:lu,shouldFocusError:!0};function hd(e={}){let t,n={...pd,...e},r={submitCount:0,isDirty:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},i={},o=Tu(n.defaultValues)||{},s=n.shouldUnregister?{}:Tu(o),a={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c=0,u={};const d={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={watch:$u(),array:$u(),state:$u()},h=Qu(n.mode),f=Qu(n.reValidateMode),m=n.criteriaMode===du,g=async()=>{let e=!1;return d.isValid&&(e=n.resolver?Su((await S()).errors):await x(i,!0),e!==r.isValid&&(r.isValid=e,p.state.next({isValid:e}))),e},v=(e,t,n,r)=>{const l=iu(i,e);if(l){const i=iu(s,e,ru(n)?iu(o,e):n);ru(i)||r&&r.defaultChecked||t?Pu(s,e,t?i:cd(l._f)):A(e,i),a.mount&&g()}},y=(e,t,n,i,s)=>{let a=!1,l=!1;const c={name:e};if(d.isDirty&&(l=r.isDirty,r.isDirty=c.isDirty=w(),a=l!==c.isDirty),d.dirtyFields&&(!n||i)){l=iu(r.dirtyFields,e);const n=ed(iu(o,e),t);n?Xu(r.dirtyFields,e):Pu(r.dirtyFields,e,!0),c.dirtyFields=r.dirtyFields,a=a||l!==!n}if(n){const t=iu(r.touchedFields,e);t||(Pu(r.touchedFields,e,n),c.touchedFields=r.touchedFields,a=a||d.touchedFields&&t!==n)}return a&&s&&p.state.next(c),a?c:{}},b=(n,i,o,s)=>{const a=iu(r.errors,n),l=d.isValid&&Du(i)&&r.isValid!==i;var h;if(e.delayError&&o?(h=()=>((e,t)=>{Pu(r.errors,e,t),p.state.next({errors:r.errors})})(n,o),t=e=>{clearTimeout(c),c=window.setTimeout(h,e)},t(e.delayError)):(clearTimeout(c),t=null,o?Pu(r.errors,n,o):Xu(r.errors,n)),(o?!ed(a,o):a)||!Su(s)||l){const e={...s,...l&&Du(i)?{isValid:i}:{},errors:r.errors,name:n};r={...r,...e},p.state.next(e)}u[n]--,d.isValidating&&!Object.values(u).some((e=>e))&&(p.state.next({isValidating:!1}),u={})},S=async e=>n.resolver?await n.resolver({...s},n.context,((e,t,n,r)=>{const i={};for(const n of e){const e=iu(t,n);e&&Pu(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}})(e||l.mount,i,n.criteriaMode,n.shouldUseNativeValidation)):{},x=async(e,t,i={valid:!0})=>{for(const o in e){const a=e[o];if(a){const{_f:e,...o}=a;if(e){const o=l.array.has(e.name),c=await Ju(a,iu(s,e.name),m,n.shouldUseNativeValidation,o);if(c[e.name]&&(i.valid=!1,t))break;!t&&(iu(c,e.name)?o?Nu(r.errors,c,e.name):Pu(r.errors,e.name,c[e.name]):Xu(r.errors,e.name))}o&&await x(o,t,i)}}return i.valid},w=(e,t)=>(e&&t&&Pu(s,e,t),!ed(I(),o)),C=(e,t,n)=>Eu(e,l,{...a.mount?s:ru(t)?o:Au(e)?{[e]:t}:t},n),A=(e,t,n={})=>{const r=iu(i,e);let o=t;if(r){const n=r._f;n&&(!n.disabled&&Pu(s,e,ld(t,n)),o=Mu&&td(n.ref)&&Xc(t)?"":t,nd(n.ref)?[...n.ref.options].forEach((e=>e.selected=o.includes(e.value))):n.refs?Qc(n.ref)?n.refs.length>1?n.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(o)?!!o.find((t=>t===e.value)):o===e.value))):n.refs[0]&&(n.refs[0].checked=!!o):n.refs.forEach((e=>e.checked=e.value===o)):Lu(n.ref)?n.ref.value="":(n.ref.value=o,n.ref.type||p.watch.next({name:e})))}(n.shouldDirty||n.shouldTouch)&&y(e,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&_(e)},E=(e,t,n)=>{for(const r in t){const o=t[r],s=`${e}.${r}`,a=iu(i,s);!l.array.has(e)&&Zu(o)&&(!a||a._f)||Yc(o)?A(s,o,n):E(s,o,n)}},M=(e,t,n={})=>{const a=iu(i,e),c=l.array.has(e),u=Tu(t);Pu(s,e,u),c?(p.array.next({name:e,values:s}),(d.isDirty||d.dirtyFields)&&n.shouldDirty&&(r.dirtyFields=ad(o,s),p.state.next({name:e,dirtyFields:r.dirtyFields,isDirty:w(e,u)}))):!a||a._f||Xc(u)?A(e,u,n):E(e,u,n),Ou(e,l)&&p.state.next({}),p.watch.next({name:e})},T=async e=>{const o=e.target;let a=o.name;const c=iu(i,a);if(c){let x,w;const C=o.type?cd(c._f):eu(e),A=e.type===ou||e.type===su,E=!((v=c._f).mount&&(v.required||v.min||v.max||v.maxLength||v.minLength||v.pattern||v.validate)||n.resolver||iu(r.errors,a)||c._f.deps)||((e,t,n,r,i)=>!i.isOnAll&&(!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e))(A,iu(r.touchedFields,a),r.isSubmitted,f,h),M=Ou(a,l,A);Pu(s,a,C),A?(c._f.onBlur&&c._f.onBlur(e),t&&t(0)):c._f.onChange&&c._f.onChange(e);const T=y(a,C,A,!1),I=!Su(T)||M;if(!A&&p.watch.next({name:a,type:e.type}),E)return d.isValid&&g(),I&&p.state.next({name:a,...M?{}:T});if(!A&&M&&p.state.next({}),u[a]=u[a]?u[a]+1:1,p.state.next({isValidating:!0}),n.resolver){const{errors:e}=await S([a]),t=dd(r.errors,i,a),n=dd(e,i,t.name||a);x=n.error,a=n.name,w=Su(e)}else x=(await Ju(c,iu(s,a),m,n.shouldUseNativeValidation))[a],g();c._f.deps&&_(c._f.deps),b(a,w,x,T)}var v},_=async(e,t={})=>{let o,s;const a=wu(e);if(p.state.next({isValidating:!0}),n.resolver){const t=await(async e=>{const{errors:t}=await S();if(e)for(const n of e){const e=iu(t,n);e?Pu(r.errors,n,e):Xu(r.errors,n)}else r.errors=t;return t})(ru(e)?e:a);o=Su(t),s=e?!a.some((e=>iu(t,e))):o}else e?(s=(await Promise.all(a.map((async e=>{const t=iu(i,e);return await x(t&&t._f?{[e]:t}:t)})))).every(Boolean),(s||r.isValid)&&g()):s=o=await x(i);return p.state.next({...!Au(e)||d.isValid&&o!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:o}:{},errors:r.errors,isValidating:!1}),t.shouldFocus&&!s&&ku(i,(e=>e&&iu(r.errors,e)),e?a:l.mount),s},I=e=>{const t={...o,...a.mount?s:{}};return ru(e)?t:Au(e)?iu(t,e):e.map((e=>iu(t,e)))},R=(e,t)=>({invalid:!!iu((t||r).errors,e),isDirty:!!iu((t||r).dirtyFields,e),isTouched:!!iu((t||r).touchedFields,e),error:iu((t||r).errors,e)}),P=(e,t={})=>{for(const a of e?wu(e):l.mount)l.mount.delete(a),l.array.delete(a),iu(i,a)&&(t.keepValue||(Xu(i,a),Xu(s,a)),!t.keepError&&Xu(r.errors,a),!t.keepDirty&&Xu(r.dirtyFields,a),!t.keepTouched&&Xu(r.touchedFields,a),!n.shouldUnregister&&!t.keepDefaultValue&&Xu(o,a));p.watch.next({}),p.state.next({...r,...t.keepDirty?{isDirty:w()}:{}}),!t.keepIsValid&&g()},k=(e,t={})=>{let r=iu(i,e);const c=Du(t.disabled);return Pu(i,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),r?c&&Pu(s,e,t.disabled?void 0:iu(s,e,cd(r._f))):v(e,!0,t.value),{...c?{disabled:t.disabled}:{},...n.shouldUseNativeValidation?{required:!!t.required,min:ud(t.min),max:ud(t.max),minLength:ud(t.minLength),maxLength:ud(t.maxLength),pattern:ud(t.pattern)}:{},name:e,onChange:T,onBlur:T,ref:s=>{if(s){k(e,t),r=iu(i,e);const n=ru(s.value)&&s.querySelectorAll&&s.querySelectorAll("input,select,textarea")[0]||s,a=(e=>Fu(e)||Qc(e))(n),l=r._f.refs||[];if(a?l.find((e=>e===n)):n===r._f.ref)return;Pu(i,e,{_f:{...r._f,...a?{refs:[...l.filter(rd),n,...Array.isArray(iu(o,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),v(e,!1,void 0,n)}else r=iu(i,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!tu(l.array,e)||!a.action)&&l.unMount.add(e)}}},O=()=>n.shouldFocusError&&ku(i,(e=>e&&iu(r.errors,e)),l.mount);return{control:{register:k,unregister:P,getFieldState:R,_executeSchema:S,_focusError:O,_getWatch:C,_getDirty:w,_updateValid:g,_removeUnmounted:()=>{for(const e of l.unMount){const t=iu(i,e);t&&(t._f.refs?t._f.refs.every((e=>!rd(e))):!rd(t._f.ref))&&P(e)}l.unMount=new Set},_updateFieldArray:(e,t=[],n,l,c=!0,u=!0)=>{if(l&&n){if(a.action=!0,u&&Array.isArray(iu(i,e))){const t=n(iu(i,e),l.argA,l.argB);c&&Pu(i,e,t)}if(u&&Array.isArray(iu(r.errors,e))){const t=n(iu(r.errors,e),l.argA,l.argB);c&&Pu(r.errors,e,t),((e,t)=>{!nu(iu(e,t)).length&&Xu(e,t)})(r.errors,e)}if(d.touchedFields&&u&&Array.isArray(iu(r.touchedFields,e))){const t=n(iu(r.touchedFields,e),l.argA,l.argB);c&&Pu(r.touchedFields,e,t)}d.dirtyFields&&(r.dirtyFields=ad(o,s)),p.state.next({isDirty:w(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Pu(s,e,t)},_getFieldArray:t=>nu(iu(a.mount?s:o,t,e.shouldUnregister?iu(o,t,[]):[])),_subjects:p,_proxyFormState:d,get _fields(){return i},get _formValues(){return s},get _stateFlags(){return a},set _stateFlags(e){a=e},get _defaultValues(){return o},get _names(){return l},set _names(e){l=e},get _formState(){return r},set _formState(e){r=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:_,register:k,handleSubmit:(e,t)=>async o=>{o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let a=!0,l=Tu(s);p.state.next({isSubmitting:!0});try{if(n.resolver){const{errors:e,values:t}=await S();r.errors=e,l=t}else await x(i);Su(r.errors)?(p.state.next({errors:{},isSubmitting:!0}),await e(l,o)):(t&&await t({...r.errors},o),O())}catch(e){throw a=!1,e}finally{r.isSubmitted=!0,p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Su(r.errors)&&a,submitCount:r.submitCount+1,errors:r.errors})}},watch:(e,t)=>Bu(e)?p.watch.subscribe({next:n=>e(C(void 0,t),n)}):C(e,t,!0),setValue:M,getValues:I,reset:(t,n)=>((t,n={})=>{const c=t||o,u=Tu(c),h=t&&!Su(t)?u:o;if(n.keepDefaultValues||(o=c),!n.keepValues){if(n.keepDirtyValues)for(const e of l.mount)iu(r.dirtyFields,e)?Pu(h,e,iu(s,e)):M(e,iu(h,e));else{if(Mu&&ru(t))for(const e of l.mount){const t=iu(i,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(td(e)){const t=e.closest("form");if(t){t.reset();break}}}}i={}}s=e.shouldUnregister?n.keepDefaultValues?Tu(o):{}:u,p.array.next({values:h}),p.watch.next({values:h})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!n.keepIsValid,a.watch=!!e.shouldUnregister,p.state.next({submitCount:n.keepSubmitCount?r.submitCount:0,isDirty:n.keepDirty||n.keepDirtyValues?r.isDirty:!(!n.keepDefaultValues||ed(t,o)),isSubmitted:!!n.keepIsSubmitted&&r.isSubmitted,dirtyFields:n.keepDirty||n.keepDirtyValues?r.dirtyFields:n.keepDefaultValues&&t?ad(o,t):{},touchedFields:n.keepTouched?r.touchedFields:{},errors:n.keepErrors?r.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(Bu(t)?t(s):t,n),resetField:(e,t={})=>{iu(i,e)&&(ru(t.defaultValue)?M(e,iu(o,e)):(M(e,t.defaultValue),Pu(o,e,t.defaultValue)),t.keepTouched||Xu(r.touchedFields,e),t.keepDirty||(Xu(r.dirtyFields,e),r.isDirty=t.defaultValue?w(e,iu(o,e)):w()),t.keepError||(Xu(r.errors,e),d.isValid&&g()),p.state.next({...r}))},clearErrors:e=>{e?wu(e).forEach((e=>Xu(r.errors,e))):r.errors={},p.state.next({errors:r.errors})},unregister:P,setError:(e,t,n)=>{const o=(iu(i,e,{_f:{}})._f||{}).ref;Pu(r.errors,e,{...t,ref:o}),p.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&o&&o.focus&&o.focus()},setFocus:(e,t={})=>{const n=iu(i,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:R}}function fd(e={}){const n=t(c).useRef(),[r,i]=t(c).useState({isDirty:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:e.defaultValues});n.current||(n.current={...hd(e),formState:r});const o=n.current.control;return o._options=e,Cu({subject:o._subjects.state,callback:t(c).useCallback((e=>{xu(e,o._proxyFormState,!0)&&(o._formState={...o._formState,...e},i({...o._formState}))}),[o])}),t(c).useEffect((()=>{o._stateFlags.mount||(o._proxyFormState.isValid&&o._updateValid(),o._stateFlags.mount=!0),o._stateFlags.watch&&(o._stateFlags.watch=!1,o._subjects.state.next({})),o._removeUnmounted()})),t(c).useEffect((()=>{r.submitCount&&o._focusError()}),[o,r.submitCount]),n.current.formState=bu(r,o),n.current}var md=({className:e,title:t})=>(0,s.jsxs)("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:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}),(0,s.jsx)("path",{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"})]});var gd=({pwdOrTokens:e,setPwdOrTokens:t,onFinish:n,minimumNumberOfRecoveryTokens:r=1,showTokens:i=!0,openModal:o=!1,withModal:a=!1})=>{var l;const{t:u}=ve(),{register:d,handleSubmit:p,formState:{errors:h},setError:f}=fd(),[m,g]=(0,c.useState)(1),[v,y]=(0,c.useState)(!!e),b=(0,s.jsxs)("form",{name:"memoriAuth",onSubmit:p((t=>{var i,o,s;"password"===e&&!(null===(i=t.password)||void 0===i?void 0:i.length)||"tokens"===e&&(((null===(o=null==t?void 0:t.tokens)||void 0===o?void 0:o.length)||0)<r||!(null===(s=null==t?void 0:t.tokens)||void 0===s?void 0:s.every((e=>e.length))))?f("tokens",{type:"minLength",message:"Tokens"}):n&&n(t).then((()=>{y(!1)}))})),className:"memori-auth-widget--form",children:[("password"===e||!i)&&(0,s.jsxs)("fieldset",{className:"memori-auth-widget--password-fieldset",children:[(0,s.jsxs)("label",{children:["Password:"," ",(0,s.jsx)("input",{className:"memori-auth-widget--input",required:!0,type:"password",placeholder:"Password",...d("password",{required:!0})})]}),i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("hr",{}),(0,s.jsx)(Da,{outlined:!0,onClick:()=>t("tokens"),children:u("auth.useRecoveryTokens")||"Recovery tokens"})]})]}),"tokens"===e&&i&&(0,s.jsxs)("fieldset",{className:"memori-auth-widget--tokens-fieldset",name:"tokens",children:[(0,s.jsxs)("legend",{children:[u("auth.tokens"),": "]}),(S=m,Array.from({length:S},((e,t)=>t))).map((e=>(0,s.jsx)("label",{className:"memori-auth-widget--token",children:(0,s.jsx)("input",{type:"password",className:"memori-auth-widget--input",placeholder:"Recovery token",required:!0,autoComplete:"off",...d(`tokens.${e}`,{required:!0})})},e))),(0,s.jsx)(Da,{onClick:()=>g((e=>e+1)),className:"memori-auth-widget--token-add",icon:(0,s.jsx)(md,{}),children:u("auth.addToken")||"Add token"}),(0,s.jsx)("hr",{}),(0,s.jsx)(Da,{outlined:!0,onClick:()=>t("password"),children:u("auth.usePassword")||"Password"})]}),"minLength"===(null===(l=h.tokens)||void 0===l?void 0:l.type)&&(0,s.jsxs)("div",{className:"memori-auth-widget--error",children:[u("auth.atLeast")||"At least"," ",r]}),(0,s.jsx)(Da,{htmlType:"submit",primary:!0,className:"memori-auth-widget--submit",children:u("confirm")||"Submit"})]});var S;return a?(0,s.jsx)(Jc,{open:o||v,title:u("auth.title")||"Authentication",onClose:()=>t(null),closable:!1,children:b}):b};c=o("85Hg2"),c=o("85Hg2");const vd=()=>{let e=!1;if("maxTouchPoints"in navigator)e=navigator.maxTouchPoints>0;else if("msMaxTouchPoints"in navigator)e=navigator.msMaxTouchPoints>0;else{const n=window&&"matchMedia"in window&&matchMedia("(pointer:coarse)");if(n&&"(pointer:coarse)"===n.media)e=!!n.matches;else if("orientation"in window)e=!0;else{var t=null===navigator||void 0===navigator?void 0:navigator.userAgent;e=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(t)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(t)}}return e},yd=()=>{var e;let t=(null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgentData)||void 0===e?void 0:e.platform)||(null===navigator||void 0===navigator?void 0:navigator.platform)||"unknown",n=(null===navigator||void 0===navigator?void 0:navigator.userAgent)||"unknown";return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(t)||n.includes("Mac")&&"ontouchend"in document};const bd=e=>e.slice(0,e.length/2).trim().toLowerCase()===e.slice(e.length/2+1).trim().toLowerCase()?e.slice(0,e.length/2):e,Sd=e=>e.replaceAll(/[^\p{L}\p{N}\p{P}\p{Z}^$\n]/gu,"").trim();function xd(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const wd=({type:e,resourceURI:t,sessionID:n,baseURL:r="",apiURL:i=""})=>{let o="cover"===e?`${r}/images/memoriCover.png`:`${r}/images/memoriAvatar.png?v=20231208`;try{return t&&0!==t.length?t.includes("memoriai/memory")&&!t.includes("memori-ai-session-id")&&n?`${t}?memori-ai-session-id=${n}`:(t.startsWith("https://")||t.startsWith("http://"))&&(new URL(t).hostname.includes("memori.ai")||new URL(t).hostname.includes("aclambda.online"))?`${t}${t.endsWith("/")||!n?"":"/"}${n||""}`:t.startsWith("cloud://")?`${(null==i?void 0:i.replace(/v2/,"v1"))||""}/CloudAsset/${t.replace("cloud://","")}`:t.startsWith("guid://")?`${(null==i?void 0:i.replace(/v2/,"v1"))||""}/GuidAsset/${t.replace("guid://","")}`:t||o:o}catch(e){return t||o}};var Cd=({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:"M858.5 763.6a374 374 0 0 0-80.6-119.5 375.63 375.63 0 0 0-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 0 0-80.6 119.5A371.7 371.7 0 0 0 136 901.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 0 0 8-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"})});var Ad=({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",className:e,"aria-label":t,children:(0,s.jsxs)("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",children:[(0,s.jsx)("path",{fillRule:"evenodd",d:"M0 4a4 4 0 014-4h16a4 4 0 014 4v16a4 4 0 01-4 4H4a4 4 0 01-4-4zm4-2.4A2.4 2.4 0 001.6 4v16A2.4 2.4 0 004 22.4h16a2.4 2.4 0 002.4-2.4V4A2.4 2.4 0 0020 1.6z",clipRule:"evenodd"}),(0,s.jsx)("path",{fillRule:"evenodd",d:"M9.715 8.442a.798.798 0 00-1.43 0l-3.2 6.4a.799.799 0 101.431.716l.579-1.158h3.811l.578 1.158a.8.8 0 001.431-.716zm.391 4.358L9 10.589 7.894 12.8z",clipRule:"evenodd"}),(0,s.jsx)("path",{fillRule:"evenodd",d:"M17 8c.552 0 1 .358 1 .8v6.4c0 .442-.448.8-1 .8s-1-.358-1-.8V8.8c0-.442.448-.8 1-.8z",clipRule:"evenodd"})]})});var Ed=({content:e,className:n,align:r="right",disabled:i=!1,visible:o=!1,children:a})=>(0,s.jsxs)("div",{className:t(ys)("memori-tooltip",`memori-tooltip--align-${r}`,n,{"memori-tooltip--disabled":i,"memori-tooltip--visible":o}),children:[(0,s.jsx)("div",{className:"memori-tooltip--content",children:e}),(0,s.jsx)("div",{className:"memori-tooltip--trigger",children:a})]});c=o("85Hg2"),c=o("85Hg2");var Md=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Md||{});function Td(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=null!=r?r:-1,o=(()=>{switch(e.focus){case 0:return n.findIndex((e=>!t.resolveDisabled(e)));case 1:{let e=n.slice().reverse().findIndex(((e,n,r)=>!(-1!==i&&r.length-n-1>=i)&&!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 2:return n.findIndex(((e,n)=>!(n<=i)&&!t.resolveDisabled(e)));case 3:{let e=n.slice().reverse().findIndex((e=>!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 4:return n.findIndex((n=>t.resolveId(n)===e.id));case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}})();return-1===o?r:o}c=o("85Hg2");function _d({container:e,accept:t,walk:n,enabled:r=!0}){let i=(0,c.useRef)(t),o=(0,c.useRef)(n);(0,c.useEffect)((()=>{i.current=t,o.current=n}),[t,n]),Ka((()=>{if(!e||!r)return;let t=pl(e);if(!t)return;let n=i.current,s=o.current,a=Object.assign((e=>n(e)),{acceptNode:n}),l=t.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,a,!1);for(;l.nextNode();)s(l.currentNode)}),[e,r,i,o])}c=o("85Hg2");function Id(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function Rd(e,t){let[n,r]=(0,c.useState)((()=>Id(e)));return Ka((()=>{r(Id(e))}),[e.type,e.as]),Ka((()=>{n||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")}),[n,t]),n}var Pd=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Pd||{}),kd=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(kd||{}),Od=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(Od||{});function Nd(e,t=(e=>e)){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=El(t(e.items.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{items:r,activeItemIndex:i}}let Dd={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,menuState:0},2:(e,t)=>{var n;let r=Nd(e),i=Td(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find((e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled})),o=i?e.items.indexOf(i):-1;return-1===o||o===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:o,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=Nd(e,(e=>[...e,{id:t.id,dataRef:t.dataRef}]));return{...e,...n}},6:(e,t)=>{let n=Nd(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},Ld=(0,c.createContext)(null);function Bd(e){let t=(0,c.useContext)(Ld);if(null===t){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Bd),t}return t}function zd(e,t){return La(t.type,Dd,e,t)}Ld.displayName="MenuContext";let Fd=c.Fragment,Ud=Va((function(e,n){let r=(0,c.useReducer)(zd,{menuState:1,buttonRef:(0,c.createRef)(),itemsRef:(0,c.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:i,itemsRef:o,buttonRef:s},a]=r,l=$a(n);cc([s,o],((e,t)=>{var n;a({type:1}),xl(t,Sl.Loose)||(e.preventDefault(),null==(n=s.current)||n.focus())}),0===i);let u=Qa((()=>{a({type:1})})),d=(0,c.useMemo)((()=>({open:0===i,close:u})),[i,u]),p=e,h={ref:l};return t(c).createElement(Ld.Provider,{value:r},t(c).createElement(ic,{value:La(i,{0:nc.Open,1:nc.Closed})},Ua({ourProps:h,theirProps:p,slot:d,defaultTag:Fd,name:"Menu"})))})),jd=Va((function(e,t){var n;let[r,i]=Bd("Menu.Button"),o=$a(r.buttonRef,t),s=`headlessui-menu-button-${al()}`,a=Ic(),l=Qa((e=>{switch(e.key){case el.Space:case el.Enter:case el.ArrowDown:e.preventDefault(),e.stopPropagation(),i({type:0}),a.nextFrame((()=>i({type:2,focus:Md.First})));break;case el.ArrowUp:e.preventDefault(),e.stopPropagation(),i({type:0}),a.nextFrame((()=>i({type:2,focus:Md.Last})))}})),u=Qa((e=>{if(e.key===el.Space)e.preventDefault()})),d=Qa((t=>{if(tl(t.currentTarget))return t.preventDefault();e.disabled||(0===r.menuState?(i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(t.preventDefault(),i({type:0})))})),p=(0,c.useMemo)((()=>({open:0===r.menuState})),[r]),h=e;return Ua({ourProps:{ref:o,id:s,type:Rd(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.itemsRef.current)?void 0:n.id,"aria-expanded":e.disabled?void 0:0===r.menuState,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:h,slot:p,defaultTag:"button",name:"Menu.Button"})})),Hd=za.RenderStrategy|za.Static,Vd=Va((function(e,t){var n,r;let[i,o]=Bd("Menu.Items"),s=$a(i.itemsRef,t),a=kl(i.itemsRef),l=`headlessui-menu-items-${al()}`,u=Ic(),d=rc(),p=null!==d?d===nc.Open:0===i.menuState;(0,c.useEffect)((()=>{let e=i.itemsRef.current;!e||0===i.menuState&&e!==(null==a?void 0:a.activeElement)&&e.focus({preventScroll:!0})}),[i.menuState,i.itemsRef,a]),_d({container:i.itemsRef.current,enabled:0===i.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let h=Qa((e=>{var t,n;switch(u.dispose(),e.key){case el.Space:if(""!==i.searchQuery)return e.preventDefault(),e.stopPropagation(),o({type:3,value:e.key});case el.Enter:if(e.preventDefault(),e.stopPropagation(),o({type:1}),null!==i.activeItemIndex){let{dataRef:e}=i.items[i.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}wl(i.buttonRef.current);break;case el.ArrowDown:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:Md.Next});case el.ArrowUp:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:Md.Previous});case el.Home:case el.PageUp:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:Md.First});case el.End:case el.PageDown:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:Md.Last});case el.Escape:e.preventDefault(),e.stopPropagation(),o({type:1}),dl().nextFrame((()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case el.Tab:e.preventDefault(),e.stopPropagation(),o({type:1}),dl().nextFrame((()=>{Ml(i.buttonRef.current,e.shiftKey?gl.Previous:gl.Next)}));break;default:1===e.key.length&&(o({type:3,value:e.key}),u.setTimeout((()=>o({type:4})),350))}})),f=Qa((e=>{if(e.key===el.Space)e.preventDefault()})),m=(0,c.useMemo)((()=>({open:0===i.menuState})),[i]),g=e;return Ua({ourProps:{"aria-activedescendant":null===i.activeItemIndex||null==(n=i.items[i.activeItemIndex])?void 0:n.id,"aria-labelledby":null==(r=i.buttonRef.current)?void 0:r.id,id:l,onKeyDown:h,onKeyUp:f,role:"menu",tabIndex:0,ref:s},theirProps:g,slot:m,defaultTag:"div",features:Hd,visible:p,name:"Menu.Items"})})),Gd=c.Fragment,Wd=Va((function(e,t){let{disabled:n=!1,...r}=e,[i,o]=Bd("Menu.Item"),s=`headlessui-menu-item-${al()}`,a=null!==i.activeItemIndex&&i.items[i.activeItemIndex].id===s,l=(0,c.useRef)(null),u=$a(t,l);Ka((()=>{if(0!==i.menuState||!a||0===i.activationTrigger)return;let e=dl();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=l.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[l,a,i.menuState,i.activationTrigger,i.activeItemIndex]);let d=(0,c.useRef)({disabled:n,domRef:l});Ka((()=>{d.current.disabled=n}),[d,n]),Ka((()=>{var e,t;d.current.textValue=null==(t=null==(e=l.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[d,l]),Ka((()=>(o({type:5,id:s,dataRef:d}),()=>o({type:6,id:s}))),[d,s]);let p=Qa((()=>{o({type:1})})),h=Qa((e=>{if(n)return e.preventDefault();o({type:1}),wl(i.buttonRef.current)})),f=Qa((()=>{if(n)return o({type:2,focus:Md.Nothing});o({type:2,focus:Md.Specific,id:s})})),m=Qa((()=>{n||a||o({type:2,focus:Md.Specific,id:s,trigger:0})})),g=Qa((()=>{n||!a||o({type:2,focus:Md.Nothing})})),v=(0,c.useMemo)((()=>({active:a,disabled:n,close:p})),[a,n,p]);return Ua({ourProps:{id:s,ref:u,role:"menuitem",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,disabled:void 0,onClick:h,onFocus:f,onPointerMove:m,onMouseMove:m,onPointerLeave:g,onMouseLeave:g},theirProps:r,slot:v,defaultTag:Gd,name:"Menu.Item"})})),qd=Object.assign(Ud,{Button:jd,Items:Vd,Item:Wd});var Kd=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:e,"aria-label":t,children:[(0,s.jsx)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),(0,s.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17l-.59.59-.58.58V4h16v12zm-9-4h2v2h-2zm0-6h2v4h-2z"})]});const Jd={"it-IT":"Non è quello che ti ho chiesto","fr-FR":"Ce n'est pas ce que je t'ai demandé","en-GB":"It's not what I asked"},Qd={"it-IT":"La risposta non era corretta","fr-FR":"La réponse n'était pas correcte","en-GB":"The answer was not correct"},Yd={"it-IT":"Non mi è piaciuta la risposta","fr-FR":"Je n'ai pas aimé la réponse","en-GB":"I didn't like the answer"};var Xd=({memori:e,className:n,onNegativeClick:r,toggle:i=!1,dropdown:o=!1})=>{const[a,l]=(0,c.useState)(),u="it-IT"===e.culture?"it-IT":"fr-FR"===e.culture?"fr-FR":"en-GB",d=Jd[u],p=Qd[u],h=Yd[u];return(0,s.jsx)("div",{className:"memori-chat--feedback"+(n?` ${n}`:""),children:o?(0,s.jsxs)(qd,{as:"div",className:"memori-chat--feedback-menu",children:[(0,s.jsx)(qd.Button,{as:t(c).Fragment,children:(0,s.jsx)(Da,{ghost:!0,shape:"circle",title:"Feedback",className:"memori-chat--feedback-menu-button",disabled:!!a,icon:(0,s.jsx)(Kd,{className:a?"memori-chat--feedback-clicked":void 0})})}),(0,s.jsx)(Wc,{as:t(c).Fragment,enter:"transition ease-out duration-200",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,s.jsx)(qd.Items,{className:"memori-chat--feedback-menu-items",children:(0,s.jsxs)("div",{className:"memori-chat--feedback-menu-items-container",children:[(0,s.jsx)(qd.Item,{children:({active:e})=>(0,s.jsx)("button",{className:"memori-chat--feedback-menu-item"+(e?" memori-chat--feedback-menu-item-active":""),onClick:()=>{l("up"===a&&i?void 0:"up")},children:h})},"ok"),(0,s.jsx)(qd.Item,{children:({active:e})=>(0,s.jsx)("button",{className:"memori-chat--feedback-menu-item"+(e?" memori-chat--feedback-menu-item-active":""),onClick:()=>{l("down"===a&&i?void 0:"down"),r(d)},children:p})},"no")]})})})]}):(0,s.jsx)(Ed,{align:"left",content:"Feedback",children:(0,s.jsx)(Da,{title:"Feedback",onClick:()=>{l("down"===a&&i?void 0:"down"),r(d)},ghost:!0,shape:"circle",icon:(0,s.jsx)(Kd,{className:a?"memori-chat--feedback-clicked":void 0})})})})},$d={};!function(e){"use strict";function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function n(t){e.defaults=t}e.defaults=t();const r=/[&<>"']/,i=new RegExp(r.source,"g"),o=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,s=new RegExp(o.source,"g"),a={"&":"&","<":"<",">":">",'"':""","'":"'"},l=e=>a[e];function c(e,t){if(t){if(r.test(e))return e.replace(i,l)}else if(o.test(e))return e.replace(s,l);return e}const u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(e){return e.replace(u,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const p=/(^|[^\[])\^/g;function h(e,t){let n="string"==typeof e?e:e.source;t=t||"";const r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(p,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function f(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const m={exec:()=>null};function g(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function v(e,t,n){const r=e.length;if(0===r)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o!==t||n){if(o===t||!n)break;i++}else i++}return e.slice(0,r-i)}function y(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function b(e,t,n,r){const i=t.href,o=t.title?c(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:i,title:o,text:c(s)}}function S(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e})).join("\n")}class x{options;rules;lexer;constructor(t){this.options=t||e.defaults}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:v(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=S(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=v(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=v(t[0].replace(/^ *>[ \t]?/gm,""),"\n"),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const o=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let s="",a="",l=!1;for(;e;){let n=!1;if(!(t=o.exec(e)))break;if(this.rules.block.hr.test(e))break;s=t[0],e=e.substring(s.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,a=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,a=r.slice(u),u+=t[1].length);let d=!1;if(!r&&/^ *$/.test(c)&&(s+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),o=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const l=e.split("\n",1)[0];if(c=l,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),i.test(c))break;if(o.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=u||!c.trim())a+="\n"+c.slice(u);else{if(d)break;if(r.search(/[^ ]/)>=4)break;if(i.test(r))break;if(o.test(r))break;if(n.test(r))break;a+="\n"+c}d||c.trim()||(d=!0),s+=l+"\n",e=e.substring(l.length+1),r=c.slice(u)}}i.loose||(l?i.loose=!0:/\n *\n *$/.test(s)&&(l=!0));let p,h=null;this.options.gfm&&(h=/^\[[ xX]\] /.exec(a),h&&(p="[ ] "!==h[0],a=a.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:s,task:!!h,checked:p,loose:!1,text:a,tokens:[]}),i.raw+=s}i.items[i.items.length-1].raw=s.trimEnd(),i.items[i.items.length-1].text=a.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){const t=i.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));i.loose=n}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=g(t[1]),r=t[2].replace(/^\||\| *$/g,"").split("|"),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)/^ *-+: *$/.test(e)?o.align.push("right"):/^ *:-+: *$/.test(e)?o.align.push("center"):/^ *:-+ *$/.test(e)?o.align.push("left"):o.align.push(null);for(const e of n)o.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of i)o.rows.push(g(e,o.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:c(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=v(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=y(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),b(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return b(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&(!r[3]||!n.match(/[\p{L}\p{N}]/u))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){const n=[...r[0]].length-1;let i,o,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=[...i].length,r[3]||r[4]){s+=o;continue}if((r[5]||r[6])&&n%3&&!((n+o)%3)){a+=o;continue}if(s-=o,s>0)continue;o=Math.min(o,o+s+a);const t=[...r[0]][0].length,l=e.slice(0,n+r.index+t+o);if(Math.min(n,o)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=c(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=c(t[1]),n="mailto:"+e):(e=c(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=c(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=c(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:c(t[0]),{type:"text",raw:t[0],text:e}}}}const w=/^(?: *(?:\n|$))+/,C=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,A=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,E=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,M=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,T=/(?:[*+-]|\d{1,9}[.)])/,_=h(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,T).getRegex(),I=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,R=/^[^\n]+/,P=/(?!\s*\])(?:\\.|[^\[\]\\])+/,k=h(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",P).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),O=h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,T).getRegex(),N="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",D=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,L=h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",D).replace("tag",N).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),B=h(I).replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",N).getRegex(),z={blockquote:h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",B).getRegex(),code:C,def:k,fences:A,heading:M,hr:E,html:L,lheading:_,list:O,newline:w,paragraph:B,table:m,text:R},F=h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",N).getRegex(),U={...z,table:F,paragraph:h(I).replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",F).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",N).getRegex()},j={...z,html:h("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",D).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:m,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:h(I).replace("hr",E).replace("heading"," *#{1,6} *[^\n]").replace("lheading",_).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},H=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,V=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,G=/^( {2,}|\\)\n(?!\s*$)/,W=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,q="\\p{P}$+<=>`^|~",K=h(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,q).getRegex(),J=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Q=h(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,q).getRegex(),Y=h("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,q).getRegex(),X=h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,q).getRegex(),$=h(/\\([punct])/,"gu").replace(/punct/g,q).getRegex(),Z=h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ee=h(D).replace("(?:--\x3e|$)","--\x3e").getRegex(),te=h("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ee).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ne=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,re=h(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",ne).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ie=h(/^!?\[(label)\]\[(ref)\]/).replace("label",ne).replace("ref",P).getRegex(),oe=h(/^!?\[(ref)\](?:\[\])?/).replace("ref",P).getRegex(),se=h("reflink|nolink(?!\\()","g").replace("reflink",ie).replace("nolink",oe).getRegex(),ae={_backpedal:m,anyPunctuation:$,autolink:Z,blockSkip:J,br:G,code:V,del:m,emStrongLDelim:Q,emStrongRDelimAst:Y,emStrongRDelimUnd:X,escape:H,link:re,nolink:oe,punctuation:K,reflink:ie,reflinkSearch:se,tag:te,text:W,url:m},le={...ae,link:h(/^!?\[(label)\]\((.*?)\)/).replace("label",ne).getRegex(),reflink:h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ne).getRegex()},ce={...ae,escape:h(H).replace("])","~|])").getRegex(),url:h(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},ue={...ce,br:h(G).replace("{2,}","*").getRegex(),text:h(ce.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},de={normal:z,gfm:U,pedantic:j},pe={normal:ae,gfm:ce,breaks:ue,pedantic:le};class he{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||e.defaults,this.options.tokenizer=this.options.tokenizer||new x,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:de.normal,inline:pe.normal};this.options.pedantic?(n.block=de.pedantic,n.inline=pe.pedantic):this.options.gfm&&(n.block=de.gfm,this.options.breaks?n.inline=pe.breaks:n.inline=pe.gfm),this.tokenizer.rules=n}static get rules(){return{block:de,inline:pe}}static lex(e,t){return new he(t).lex(e)}static lexInline(e,t){return new he(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,i,o;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i)))r=t[t.length-1],o&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),o=i.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,i,o,s,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(o=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,o.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(s||(a=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach((e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class fe{options;constructor(t){this.options=t||e.defaults}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+c(r)+'">'+(n?e:c(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:c(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e,t,n){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const r=f(e);if(null===r)return n;let i='<a href="'+(e=r)+'"';return t&&(i+=' title="'+t+'"'),i+=">"+n+"</a>",i}image(e,t,n){const r=f(e);if(null===r)return n;let i=`<img src="${e=r}" alt="${n}"`;return t&&(i+=` title="${t}"`),i+=">",i}text(e){return e}}class me{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class ge{options;renderer;textRenderer;constructor(t){this.options=t||e.defaults,this.options.renderer=this.options.renderer||new fe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new me}static parse(e,t){return new ge(t).parse(e)}static parseInline(e,t){return new ge(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(i.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=i;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,d(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=i;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=i;let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(r);let o="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];r="";for(let t=0;t<n.length;t++)r+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});o+=this.renderer.tablerow(r)}n+=this.renderer.table(t,o);continue}case"blockquote":{const e=i,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=i,t=e.ordered,r=e.start,o=e.loose;let s="";for(let t=0;t<e.items.length;t++){const n=e.items[t],r=n.checked,i=n.task;let a="";if(n.task){const e=this.renderer.checkbox(!!r);o?n.tokens.length>0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):a+=e+" "}a+=this.parse(n.tokens,o),s+=this.renderer.listitem(a,i,!!r)}n+=this.renderer.list(s,t,r);continue}case"html":{const e=i;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=i;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let o=i,s=o.tokens?this.parseInline(o.tokens):o.text;for(;r+1<e.length&&"text"===e[r+1].type;)o=e[++r],s+="\n"+(o.tokens?this.parseInline(o.tokens):o.text);n+=t?this.renderer.paragraph(s):s;continue}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=e||"";continue}}switch(i.type){case"escape":{const e=i;n+=t.text(e.text);break}case"html":{const e=i;n+=t.html(e.text);break}case"link":{const e=i;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=i;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=i;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=i;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=i;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=i;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=i;n+=t.text(e.text);break}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class ve{options;constructor(t){this.options=t||e.defaults}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}class ye{defaults=t();options=this.setOptions;parse=this.#e(he.lex,ge.parse);parseInline=this.#e(he.lexInline,ge.parseInline);Parser=ge;Renderer=fe;TextRenderer=me;Lexer=he;Tokenizer=x;Hooks=ve;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{n=n.concat(this.walkTokens(e[r],t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new fe(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const r=n,i=e.renderer[r],o=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new x(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,i=e.tokenizer[r],o=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new ve;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const r=n,i=e.hooks[r],o=t[r];ve.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then((e=>o.call(t,e)));const n=i.call(t,e);return o.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return he.lex(e,t??this.defaults)}parser(e,t){return ge.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{const i={...r},o={...this.defaults,...i};!0===this.defaults.async&&!1===i.async&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const s=this.#t(!!o.silent,!!o.async);if(null==n)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then((t=>e(t,o))).then((e=>o.hooks?o.hooks.processAllTokens(e):e)).then((e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then((()=>e)):e)).then((e=>t(e,o))).then((e=>o.hooks?o.hooks.postprocess(e):e)).catch(s);try{o.hooks&&(n=o.hooks.preprocess(n));let r=e(n,o);o.hooks&&(r=o.hooks.processAllTokens(r)),o.walkTokens&&this.walkTokens(r,o.walkTokens);let i=t(r,o);return o.hooks&&(i=o.hooks.postprocess(i)),i}catch(e){return s(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+c(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}}const be=new ye;function Se(e,t){return be.parse(e,t)}Se.options=Se.setOptions=function(e){return be.setOptions(e),Se.defaults=be.defaults,n(Se.defaults),Se},Se.getDefaults=t,Se.defaults=e.defaults,Se.use=function(...e){return be.use(...e),Se.defaults=be.defaults,n(Se.defaults),Se},Se.walkTokens=function(e,t){return be.walkTokens(e,t)},Se.parseInline=be.parseInline,Se.Parser=ge,Se.parser=ge.parse,Se.Renderer=fe,Se.TextRenderer=me,Se.Lexer=he,Se.lexer=he.lex,Se.Tokenizer=x,Se.Hooks=ve,Se.parse=Se;const xe=Se.options,we=Se.setOptions,Ce=Se.use,Ae=Se.walkTokens,Ee=Se.parseInline,Me=Se,Te=ge.parse,_e=he.lex;e.Hooks=ve,e.Lexer=he,e.Marked=ye,e.Parser=ge,e.Renderer=fe,e.TextRenderer=me,e.Tokenizer=x,e.getDefaults=t,e.lexer=_e,e.marked=Se,e.options=xe,e.parse=Me,e.parseInline=Ee,e.parser=Te,e.setOptions=we,e.use=Ce,e.walkTokens=Ae}($d);var Zd={};
|
|
235
|
-
/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */Zd=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:i}=Object;let{freeze:o,seal:s,create:a}=Object,{apply:l,construct:c}="undefined"!=typeof Reflect&&Reflect;o||(o=function(e){return e}),s||(s=function(e){return e}),l||(l=function(e,t,n){return e.apply(t,n)}),c||(c=function(e,t){return new e(...t)});const u=x(Array.prototype.forEach),d=x(Array.prototype.pop),p=x(Array.prototype.push),h=x(String.prototype.toLowerCase),f=x(String.prototype.toString),m=x(String.prototype.match),g=x(String.prototype.replace),v=x(String.prototype.indexOf),y=x(String.prototype.trim),b=x(RegExp.prototype.test),S=w(TypeError);function x(e){return 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];return l(e,t,r)}}function w(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return c(e,n)}}function C(e,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let o=r.length;for(;o--;){let t=r[o];if("string"==typeof t){const e=i(t);e!==t&&(n(r)||(r[o]=e),t=e)}e[t]=!0}return e}function A(t){const n=a(null);for(const[r,o]of e(t))void 0!==i(t,r)&&(n[r]=o);return n}function E(e,t){for(;null!==e;){const n=i(e,t);if(n){if(n.get)return x(n.get);if("function"==typeof n.value)return x(n.value)}e=r(e)}function n(e){return console.warn("fallback value for",e),null}return n}const M=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),T=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),_=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=o(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),R=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),P=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),k=o(["#text"]),O=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),N=o(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),D=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),L=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z=s(/<%[\w\W]*|[\w\W]*%>/gm),F=s(/\${[\w\W]*}/gm),U=s(/^data-[\-\w.\u00B7-\uFFFF]/),j=s(/^aria-[\-\w]+$/),H=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V=s(/^(?:\w+script|data):/i),G=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W=s(/^html$/i);var q=Object.freeze({__proto__:null,MUSTACHE_EXPR:B,ERB_EXPR:z,TMPLIT_EXPR:F,DATA_ATTR:U,ARIA_ATTR:j,IS_ALLOWED_URI:H,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:G,DOCTYPE_NAME:W});const K=function(){return"undefined"==typeof window?null:window},J=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function Q(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K();const n=e=>Q(e);if(n.version="3.0.6",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const i=r,s=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:c,Node:x,Element:w,NodeFilter:B,NamedNodeMap:z=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:F,DOMParser:U,trustedTypes:j}=t,V=w.prototype,G=E(V,"cloneNode"),Y=E(V,"nextSibling"),X=E(V,"childNodes"),$=E(V,"parentNode");if("function"==typeof c){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let Z,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:re,getElementsByTagName:ie}=r,{importNode:oe}=i;let se={};n.isSupported="function"==typeof e&&"function"==typeof $&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:ae,ERB_EXPR:le,TMPLIT_EXPR:ce,DATA_ATTR:ue,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:pe,ATTR_WHITESPACE:he}=q;let{IS_ALLOWED_URI:fe}=q,me=null;const ge=C({},[...M,...T,..._,...R,...k]);let ve=null;const ye=C({},[...O,...N,...D,...L]);let be=Object.seal(a(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,xe=null,we=!0,Ce=!0,Ae=!1,Ee=!0,Me=!1,Te=!1,_e=!1,Ie=!1,Re=!1,Pe=!1,ke=!1,Oe=!0,Ne=!1;const De="user-content-";let Le=!0,Be=!1,ze={},Fe=null;const Ue=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let je=null;const He=C({},["audio","video","img","source","image","track"]);let Ve=null;const Ge=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",Ke="http://www.w3.org/1999/xhtml";let Je=Ke,Qe=!1,Ye=null;const Xe=C({},[We,qe,Ke],f);let $e=null;const Ze=["application/xhtml+xml","text/html"],et="text/html";let tt=null,nt=null;const rt=r.createElement("form"),it=function(e){return e instanceof RegExp||e instanceof Function},ot=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!nt||nt!==e){if(e&&"object"==typeof e||(e={}),e=A(e),$e=$e=-1===Ze.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===$e?f:h,me="ALLOWED_TAGS"in e?C({},e.ALLOWED_TAGS,tt):ge,ve="ALLOWED_ATTR"in e?C({},e.ALLOWED_ATTR,tt):ye,Ye="ALLOWED_NAMESPACES"in e?C({},e.ALLOWED_NAMESPACES,f):Xe,Ve="ADD_URI_SAFE_ATTR"in e?C(A(Ge),e.ADD_URI_SAFE_ATTR,tt):Ge,je="ADD_DATA_URI_TAGS"in e?C(A(He),e.ADD_DATA_URI_TAGS,tt):He,Fe="FORBID_CONTENTS"in e?C({},e.FORBID_CONTENTS,tt):Ue,Se="FORBID_TAGS"in e?C({},e.FORBID_TAGS,tt):{},xe="FORBID_ATTR"in e?C({},e.FORBID_ATTR,tt):{},ze="USE_PROFILES"in e&&e.USE_PROFILES,we=!1!==e.ALLOW_ARIA_ATTR,Ce=!1!==e.ALLOW_DATA_ATTR,Ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ee=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Me=e.SAFE_FOR_TEMPLATES||!1,Te=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,ke=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,Oe=!1!==e.SANITIZE_DOM,Ne=e.SANITIZE_NAMED_PROPS||!1,Le=!1!==e.KEEP_CONTENT,Be=e.IN_PLACE||!1,fe=e.ALLOWED_URI_REGEXP||H,Je=e.NAMESPACE||Ke,be=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(be.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Me&&(Ce=!1),Pe&&(Re=!0),ze&&(me=C({},[...k]),ve=[],!0===ze.html&&(C(me,M),C(ve,O)),!0===ze.svg&&(C(me,T),C(ve,N),C(ve,L)),!0===ze.svgFilters&&(C(me,_),C(ve,N),C(ve,L)),!0===ze.mathMl&&(C(me,R),C(ve,D),C(ve,L))),e.ADD_TAGS&&(me===ge&&(me=A(me)),C(me,e.ADD_TAGS,tt)),e.ADD_ATTR&&(ve===ye&&(ve=A(ve)),C(ve,e.ADD_ATTR,tt)),e.ADD_URI_SAFE_ATTR&&C(Ve,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(Fe===Ue&&(Fe=A(Fe)),C(Fe,e.FORBID_CONTENTS,tt)),Le&&(me["#text"]=!0),Te&&C(me,["html","head","body"]),me.table&&(C(me,["tbody"]),delete Se.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Z=e.TRUSTED_TYPES_POLICY,ee=Z.createHTML("")}else void 0===Z&&(Z=J(j,s)),null!==Z&&"string"==typeof ee&&(ee=Z.createHTML(""));o&&o(e),nt=e}},st=C({},["mi","mo","mn","ms","mtext"]),at=C({},["foreignobject","desc","title","annotation-xml"]),lt=C({},["title","style","font","a","script"]),ct=C({},T);C(ct,_),C(ct,I);const ut=C({},R);C(ut,P);const dt=function(e){let t=$(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});const n=h(e.tagName),r=h(t.tagName);return!!Ye[e.namespaceURI]&&(e.namespaceURI===qe?t.namespaceURI===Ke?"svg"===n:t.namespaceURI===We?"svg"===n&&("annotation-xml"===r||st[r]):Boolean(ct[n]):e.namespaceURI===We?t.namespaceURI===Ke?"math"===n:t.namespaceURI===qe?"math"===n&&at[r]:Boolean(ut[n]):e.namespaceURI===Ke?!(t.namespaceURI===qe&&!at[r])&&!(t.namespaceURI===We&&!st[r])&&!ut[n]&&(lt[n]||!ct[n]):!("application/xhtml+xml"!==$e||!Ye[e.namespaceURI]))},pt=function(e){p(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},ht=function(e,t){try{p(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ve[e])if(Re||Pe)try{pt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ft=function(e){let t=null,n=null;if(Ie)e="<remove></remove>"+e;else{const t=m(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===$e&&Je===Ke&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=Z?Z.createHTML(e):e;if(Je===Ke)try{t=(new U).parseFromString(i,$e)}catch(e){}if(!t||!t.documentElement){t=te.createDocument(Je,"template",null);try{t.documentElement.innerHTML=Qe?ee:i}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),Je===Ke?ie.call(t,Te?"html":"body")[0]:Te?t.documentElement:o},mt=function(e){return ne.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT,null)},gt=function(e){return e instanceof F&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof z)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},vt=function(e){return"function"==typeof x&&e instanceof x},yt=function(e,t,r){se[e]&&u(se[e],(e=>{e.call(n,t,r,nt)}))},bt=function(e){let t=null;if(yt("beforeSanitizeElements",e,null),gt(e))return pt(e),!0;const r=tt(e.nodeName);if(yt("uponSanitizeElement",e,{tagName:r,allowedTags:me}),e.hasChildNodes()&&!vt(e.firstElementChild)&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return pt(e),!0;if(!me[r]||Se[r]){if(!Se[r]&&xt(r)){if(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,r))return!1;if(be.tagNameCheck instanceof Function&&be.tagNameCheck(r))return!1}if(Le&&!Fe[r]){const t=$(e)||e.parentNode,n=X(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(G(n[r],!0),Y(e))}return pt(e),!0}return e instanceof w&&!dt(e)?(pt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(Me&&3===e.nodeType&&(t=e.textContent,u([ae,le,ce],(e=>{t=g(t,e," ")})),e.textContent!==t&&(p(n.removed,{element:e.cloneNode()}),e.textContent=t)),yt("afterSanitizeElements",e,null),!1):(pt(e),!0)},St=function(e,t,n){if(Oe&&("id"===t||"name"===t)&&(n in r||n in rt))return!1;if(Ce&&!xe[t]&&b(ue,t));else if(we&&b(de,t));else if(!ve[t]||xe[t]){if(!(xt(e)&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,e)||be.tagNameCheck instanceof Function&&be.tagNameCheck(e))&&(be.attributeNameCheck instanceof RegExp&&b(be.attributeNameCheck,t)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(t))||"is"===t&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,n)||be.tagNameCheck instanceof Function&&be.tagNameCheck(n))))return!1}else if(Ve[t]);else if(b(fe,g(n,he,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!je[e])if(Ae&&!b(pe,g(n,he,"")));else if(n)return!1;return!0},xt=function(e){return e.indexOf("-")>0},wt=function(e){yt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ve};let i=t.length;for(;i--;){const o=t[i],{name:s,namespaceURI:a,value:l}=o,c=tt(s);let p="value"===s?l:y(l);if(r.attrName=c,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,yt("uponSanitizeAttribute",e,r),p=r.attrValue,r.forceKeepAttr)continue;if(ht(s,e),!r.keepAttr)continue;if(!Ee&&b(/\/>/i,p)){ht(s,e);continue}Me&&u([ae,le,ce],(e=>{p=g(p,e," ")}));const h=tt(e.nodeName);if(St(h,c,p)){if(!Ne||"id"!==c&&"name"!==c||(ht(s,e),p=De+p),Z&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(a);else switch(j.getAttributeType(h,c)){case"TrustedHTML":p=Z.createHTML(p);break;case"TrustedScriptURL":p=Z.createScriptURL(p)}try{a?e.setAttributeNS(a,s,p):e.setAttribute(s,p),d(n.removed)}catch(e){}}}yt("afterSanitizeAttributes",e,null)},Ct=function e(t){let n=null;const r=mt(t);for(yt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)yt("uponSanitizeShadowNode",n,null),bt(n)||(n.content instanceof l&&e(n.content),wt(n));yt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,s=null,a=null;if(Qe=!e,Qe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!vt(e)){if("function"!=typeof e.toString)throw S("toString is not a function");if("string"!=typeof(e=e.toString()))throw S("dirty is not a string, aborting")}if(!n.isSupported)return e;if(_e||ot(t),n.removed=[],"string"==typeof e&&(Be=!1),Be){if(e.nodeName){const t=tt(e.nodeName);if(!me[t]||Se[t])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof x)r=ft("\x3c!----\x3e"),o=r.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!Re&&!Me&&!Te&&-1===e.indexOf("<"))return Z&&ke?Z.createHTML(e):e;if(r=ft(e),!r)return Re?null:ke?ee:""}r&&Ie&&pt(r.firstChild);const c=mt(Be?e:r);for(;s=c.nextNode();)bt(s)||(s.content instanceof l&&Ct(s.content),wt(s));if(Be)return e;if(Re){if(Pe)for(a=re.call(r.ownerDocument);r.firstChild;)a.appendChild(r.firstChild);else a=r;return(ve.shadowroot||ve.shadowrootmode)&&(a=oe.call(i,a,!0)),a}let d=Te?r.outerHTML:r.innerHTML;return Te&&me["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&b(W,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Me&&u([ae,le,ce],(e=>{d=g(d,e," ")})),Z&&ke?Z.createHTML(d):d},n.setConfig=function(){ot(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),_e=!0},n.clearConfig=function(){nt=null,_e=!1},n.isValidAttribute=function(e,t,n){nt||ot({});const r=tt(e),i=tt(t);return St(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&(se[e]=se[e]||[],p(se[e],t))},n.removeHook=function(e){if(se[e])return d(se[e])},n.removeHooks=function(e){se[e]&&(se[e]=[])},n.removeAllHooks=function(){se={}},n}return Q()}(),$d.marked.use({async:!1,gfm:!0,pedantic:!0,renderer:{link(e,t,n){const r=xd(e);if(null===r)return n;let i='<a href="'+(e=r)+'"';return t&&(i+=' title="'+t+'"'),i+=' target="_blank" rel="noopener noreferrer">'+n+"</a>",i}}});var ep=({message:e,memori:n,tenant:r,baseUrl:i,apiUrl:o,showFeedback:a,simulateUserPrompt:l,showAIicon:c=!0,isFirst:u=!1,user:d,userAvatar:p,experts:h})=>{var f,m,g,v,y,b,S;const{t:x}=ve(),w=(0,Zd.sanitize)($d.marked.parse(null!==(f=e.translatedText)&&void 0!==f?f:e.text),{ADD_ATTR:["target"]});return(0,s.jsxs)(s.Fragment,{children:[(e.initial||u)&&(0,s.jsx)("div",{className:"memori-chat--bubble-initial"}),(0,s.jsxs)(Wc,{show:!0,appear:!0,as:"div",className:t(ys)("memori-chat--bubble-container",{"memori-chat--bubble-from-user":!!e.fromUser,"memori-chat--with-addon":e.generatedByAI&&c||a&&l}),children:[!e.fromUser&&(0,s.jsx)(Wc.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),title:(null===(m=e.emitter)||void 0===m?void 0:m.length)&&n.enableBoardOfExperts?e.emitter:n.name,children:(0,s.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:(null===(g=e.emitter)||void 0===g?void 0:g.length)&&n.enableBoardOfExperts?e.emitter:n.name,src:(null===(v=e.emitter)||void 0===v?void 0:v.length)&&n.enableBoardOfExperts&&(null==h?void 0:h.find((t=>t.name===e.emitter)))?`${o}/api/v1/memoriai/memori/avatar/${null===(y=h.find((t=>t.name===e.emitter)))||void 0===y?void 0:y.expertMemoriID}`:n.avatarURL&&n.avatarURL.length>0?wd({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:n.avatarURL,baseURL:i,apiURL:o}):wd({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i||"https://aisuru.com",apiURL:o}),onError:e=>{e.currentTarget.src=n.avatarURL&&n.avatarURL.length>0?wd({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:n.avatarURL,baseURL:i}):wd({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i}),e.currentTarget.onerror=null}})}),(0,s.jsxs)(Wc.Child,{as:"div",className:t(ys)("memori-chat--bubble",{"memori-chat--user-bubble":!!e.fromUser,"memori-chat--with-addon":e.generatedByAI&&c||a&&l,"memori-chat--ai-generated":e.generatedByAI&&c,"memori-chat--with-feedback":a}),enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),children:[(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:w}}),(e.generatedByAI&&c||a&&l)&&(0,s.jsxs)("div",{className:"memori-chat--bubble-addon",children:[a&&!!l&&(0,s.jsx)(Xd,{memori:n,className:"memori-chat--bubble-feedback",dropdown:!0,onNegativeClick:e=>{e&&l(e)}}),e.generatedByAI&&c&&(0,s.jsx)(Ed,{align:"left",content:x("generatedByAI"),className:"memori-chat--bubble-ai-icon",children:(0,s.jsx)("span",{children:(0,s.jsx)(Ad,{title:x("generatedByAI")||void 0})})})]})]}),e.fromUser&&(0,s.jsx)(s.Fragment,{children:p&&"string"==typeof p||!p&&(null===(b=null==d?void 0:d.avatarURL)||void 0===b?void 0:b.length)?(0,s.jsx)(Wc.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:(0,s.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:null!==(S=null==d?void 0:d.userName)&&void 0!==S?S:"User",src:null!=p?p:null==d?void 0:d.avatarURL})}):p?(0,s.jsx)(Wc.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:p}):(0,s.jsx)(Wc.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:(0,s.jsx)(Cd,{})})})]})]})};c=o("85Hg2"),c=o("85Hg2");var tp,np=({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:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})}),rp={};tp=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||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};function n(e,n){var r=e.el,i=e.elStyle,o=e.elHeight,s=e.rowsLimit,a=e.rowsWrapped,l=e.options,c=e.buffer,u=c;if(a===s+1)return t({},e);var d=c,p=a,h=o;return r.innerHTML=u=c.length?""+c+l.delimiter+n+l.replaceStr:""+n+l.replaceStr,parseFloat(i.height)>parseFloat(o)&&(p++,h=i.height,p===s+1)?(r.innerHTML=u="."===d[d.length-1]&&"..."===l.replaceStr?d+"..":""+d+l.replaceStr,t({},e,{elHeight:h,rowsWrapped:p})):(r.innerHTML=u=d.length?""+d+l.delimiter+n:""+n,t({},e,{buffer:u,elHeight:h,rowsWrapped:p}))}e.disableResponsive=function(e){window.removeEventListener("resize",e)},e.ellipsis=function e(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s={replaceStr:"...",responsive:!1,debounceDelay:250,delimiter:" "},a=t({},s,o),l=r&&(r instanceof NodeList?r:1===r.nodeType?[r]:document.querySelectorAll(r)),c=[],u=0;u<l.length;u++){var d=l[u];c[u]=d.innerHTML;var p=d.innerHTML.split(a.delimiter);d.innerHTML="";var h=window.getComputedStyle(d);p.reduce(n,{el:d,buffer:d.innerHTML,elStyle:h,elHeight:0,rowsLimit:i,rowsWrapped:0,options:a})}if(a.responsive){var f=!1,m=window.innerWidth,g=function(){if(window.innerWidth!==m){m=window.innerWidth;for(var n=0;n<l.length;n++)l[n].innerHTML=c[n];e(r,i,t({},o,{responsive:!1}))}},v=function(){clearTimeout(f),f=setTimeout(g,a.debounceDelay)};return window.addEventListener("resize",v),v}}},"function"==typeof define&&define.amd?define(["exports"],tp):tp(rp);var ip=({loading:e=!1,className:n,title:r,description:i,cover:o,hoverable:a=!1,children:l})=>(0,s.jsx)("div",{className:t(ys)("memori-card",n,{"memori-card--loading":e,"memori-card--with-cover":o,"memori-card--hoverable":a}),children:(0,s.jsxs)(qc,{spinning:e,children:[o&&(0,s.jsx)("div",{className:"memori-card--cover",children:o}),(0,s.jsxs)("div",{className:"memori-card--content",children:[r&&(0,s.jsx)("h3",{className:"memori-card--title",children:r}),i&&(0,s.jsx)("p",{className:"memori-card--description",children:i}),(0,s.jsx)("div",{className:"memori-card--children",children:l})]})]})});const op=({isChild:e=!1,item:n,baseUrl:r,onLinkPreviewInfo:i,descriptionOneLine:o=!1})=>{var a,l,u,d;const[p,h]=(0,c.useState)(null),f=(null===(a=n.url)||void 0===a?void 0:a.startsWith("http"))||!n.url||0===(null===(l=n.url)||void 0===l?void 0:l.length)?n.url:`https://${n.url}`;(0,c.useEffect)((()=>{var e,t;let o=(null===(e=n.url)||void 0===e?void 0:e.startsWith("http"))||!n.url||0===(null===(t=n.url)||void 0===t?void 0:t.length)?n.url:`https://${n.url}`;o&&o!==(null==p?void 0:p.urlKey)&&(async(e,t)=>{try{const n=await fetch(`${t||"https://aisuru.com"}/api/linkpreview/${encodeURIComponent(e)}`);return await n.json()}catch(e){return console.error("getSiteInfo",e),null}})(o,r).then((e=>{h(e?{...e,urlKey:o}:null),i&&e&&i(e)}))}),[null==n?void 0:n.url,r,i]);const m=n.title&&n.title.length>0?n.title:null==p?void 0:p.title,g=null==p?void 0:p.description,v=null==p?void 0:p.video,y=null!==(u=null==p?void 0:p.image)&&void 0!==u?u:null===(d=null==p?void 0:p.images)||void 0===d?void 0:d[0];return(0,c.useEffect)((()=>{setTimeout((()=>{(0,rp.ellipsis)(".memori-link-item--card .memori-card--description",3,{responsive:!0})}),300)}),[g,n.mediumID]),(0,s.jsx)("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:t(ys)("memori-link-item--link",{"memori-link-item--link--child":e}),onClick:t=>{e||(t.preventDefault(),t.stopPropagation(),window.open(f,"_blank",`toolbar=yes,top=${.1*window.innerHeight},left=${.1*window.innerWidth},width=${.8*window.innerWidth},height=${.8*window.innerHeight}`))},children:(0,s.jsx)(ip,{hoverable:!0,className:t(ys)("memori-link-item--card",{"memori-link-item--card-description-oneline":o,"memori-link-item--card-has-image":y,"memori-link-item--card-has-video":v}),cover:v?(0,s.jsx)("iframe",{width:"100%",height:"100%",src:v,title:"Video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):y?(0,s.jsx)("img",{className:"memori-link-item--card-cover-img",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==",srcSet:y.includes("data:image")?void 0:y,alt:n.title}):(0,s.jsx)("div",{className:"memori-link-item--card-cover-icon",children:(0,s.jsx)(np,{className:"memori-link-item--icon"})}),title:m,description:g})})};var sp=({items:e,baseUrl:t,descriptionOneLine:n=!1,onLinkPreviewInfo:r})=>(0,s.jsx)(Wc,{appear:!0,show:!0,as:"div",className:"memori-link-items",children:(0,s.jsx)("div",{className:"memori-link-items--grid",children:e.map(((e,i)=>(0,s.jsx)(Wc.Child,{as:"div",className:"memori-link-item",enter:"ease-out duration-500 delay-"+100*i,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsx)(op,{item:e,baseUrl:t,descriptionOneLine:n,onLinkPreviewInfo:r})},e.mediumID)))})});c=o("85Hg2");const ap=["va bene","no grazie","si","no","sì","arrivederci","non c'entrava","non mi è piaciuto"],lp=async(e,t,n,r)=>{var i;const o=ap.indexOf(e.toLowerCase())>-1?"IT":null==n?void 0:n.toUpperCase(),s=await fetch(`${r||"https://aisuru.com"}/api/translate?text=${encodeURIComponent(e)}&target_lang=${t.toUpperCase()}${o?`&source_lang=${o}`:""}`,{method:"GET",headers:{Accept:"*/*"}}),a=await s.json();return null===(i=null==a?void 0:a.translations)||void 0===i?void 0:i[0]},cp=[{value:"IT",label:"Italiano"},{value:"EN",label:"English"},{value:"DE",label:"Deutsch"},{value:"ES",label:"Español"},{value:"FR",label:"Français"},{value:"PT",label:"Português"},{value:"UK",label:"Українська"},{value:"RU",label:"Русский"},{value:"PL",label:"Polski"},{value:"FI",label:"Suomi"}],up="👤",dp=[{name:"text",lang:"text",mimeType:"text/plain",monacoLang:"plaintext",executable:!0},{name:"javascript/jsx",lang:"jsx",mimeType:"text/javascript",monacoLang:"javascript",executable:!0},{name:"typescript/tsx",lang:"tsx",mimeType:"text/ecmascript",monacoLang:"typescript",executable:!0},{name:"json",lang:"json",mimeType:"application/json",monacoLang:"json",executable:!0},{name:"css",lang:"scss",mimeType:"text/css",monacoLang:"css",executable:!0},{name:"html/xml",lang:"tsx",mimeType:"application/xml",monacoLang:"xml"},{name:"bash",lang:"bash",mimeType:"application/x-sh",monacoLang:"shell"},{name:"python",lang:"python",mimeType:"text/x-python",monacoLang:"python"},{name:"cpp/csharp",lang:"cpp",mimeType:"text/x-c++src",monacoLang:"cpp"},{name:"php",lang:"php",mimeType:"application/x-php",monacoLang:"php"},{name:"ruby",lang:"ruby",mimeType:"text/x-ruby",monacoLang:"ruby"},{name:"sql",lang:"sql",mimeType:"text/x-sql",monacoLang:"sql"}],pp={it:[{text:"",delayAfter:10},{text:"Cerco l'esperto più adatto",delayAfter:5},{text:"Contatto l'esperto",delayAfter:3},{text:"Spiego all'esperto la domanda",delayAfter:2},{text:"L'esperto sta preparando una risposta",delayAfter:6},{text:"Genero una risposta adatta",delayAfter:3}],en:[{text:"",delayAfter:10},{text:"I'm looking for the most suitable expert",delayAfter:5},{text:"I'm contacting the expert",delayAfter:3},{text:"I'm explaining the question to the expert",delayAfter:2},{text:"The expert is preparing an answer",delayAfter:6},{text:"I am generating a suitable answer",delayAfter:3}]};c=o("85Hg2");var hp=({src:e,poster:t,alt:n=""})=>((0,c.useEffect)((()=>{const e=document.createElement("script");return e.src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js",e.type="module",document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]),(0,s.jsx)("div",{className:"model-viewer",children:(0,s.jsx)("model-viewer",{src:e,"ios-src":"",poster:t,alt:n,"shadow-intensity":"1","disable-zoom":!0,"camera-controls":!0,autoplay:!0})}));var fp=({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:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"})}),mp={};function gp(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}(mp=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){gp(o,r,i,s,a,"next",e)}function a(e){gp(o,r,i,s,a,"throw",e)}s(void 0)}))}}).__esModule=!0,mp.default=mp;var vp={};function yp(){return vp=yp=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},vp.__esModule=!0,vp.default=vp,yp.apply(this,arguments)}(vp=yp).__esModule=!0,vp.default=vp;Y=o("ffgrs"),X=o("22y1y");var bp={},Sp={};function xp(e,t){return Sp=xp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Sp.__esModule=!0,Sp.default=Sp,xp(e,t)}(Sp=xp).__esModule=!0,Sp.default=Sp,(bp=function(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&&Sp(e,t)}).__esModule=!0,bp.default=bp;var wp={},Cp=o("lEJSL").default,Ap={};(Ap=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}).__esModule=!0,Ap.default=Ap,(wp=function(e,t){if(t&&("object"===Cp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ap(e)}).__esModule=!0,wp.default=wp;var Ep={};function Mp(e){return Ep=Mp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ep.__esModule=!0,Ep.default=Ep,Mp(e)}(Ep=Mp).__esModule=!0,Ep.default=Ep;var Tp,_p=o("7qcgS")();Tp=_p;try{regeneratorRuntime=_p}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=_p:Function("r","regeneratorRuntime = r")(_p)}c=o("85Hg2");var Ip={},Rp={};(Rp=function(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}).__esModule=!0,Rp.default=Rp,(Ip=function(e,t){if(null==e)return{};var n,r,i=Rp(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}).__esModule=!0,Ip.default=Ip;var Pp={},kp={},Op=o("e3mvX");(kp=function(e){if(Array.isArray(e))return Op(e)}).__esModule=!0,kp.default=kp;var Np={};(Np=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}).__esModule=!0,Np.default=Np;var Dp=o("8xD61"),Lp={};(Lp=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,Lp.default=Lp,(Pp=function(e){return kp(e)||Np(e)||Dp(e)||Lp()}).__esModule=!0,Pp.default=Pp;c=o("85Hg2"),c=o("85Hg2");function Bp(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 zp(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Bp(Object(r),!0).forEach((function(n){t(J)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Fp={};function Up(e){if(0===e.length||1===e.length)return e;var t,n,r=e.join(".");return Fp[r]||(Fp[r]=0===(n=(t=e).length)||1===n?t:2===n?[t[0],t[1],"".concat(t[0],".").concat(t[1]),"".concat(t[1],".").concat(t[0])]:3===n?[t[0],t[1],t[2],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0])]:n>=4?[t[0],t[1],t[2],t[3],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[2],".").concat(t[3]),"".concat(t[3],".").concat(t[0]),"".concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[0]),"".concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[3],".").concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[2],".").concat(t[1],".").concat(t[0])]:void 0),Fp[r]}function jp(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter((function(e){return"token"!==e})),i=Up(r);return i.reduce((function(e,t){return zp(zp({},e),n[t])}),t)}function Hp(e){return e.join(" ")}function Vp(e){var n=e.node,r=e.stylesheet,i=e.style,o=void 0===i?{}:i,s=e.useInlineStyles,a=e.key,l=n.properties,u=n.type,d=n.tagName,p=n.value;if("text"===u)return p;if(d){var h,f=function(e,t){var n=0;return function(r){return n+=1,r.map((function(r,i){return Vp({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(i)})}))}}(r,s);if(s){var m=Object.keys(r).reduce((function(e,t){return t.split(".").forEach((function(t){e.includes(t)||e.push(t)})),e}),[]),g=l.className&&l.className.includes("token")?["token"]:[],v=l.className&&g.concat(l.className.filter((function(e){return!m.includes(e)})));h=zp(zp({},l),{},{className:Hp(v)||void 0,style:jp(l.className,Object.assign({},l.style,o),r)})}else h=zp(zp({},l),{},{className:Hp(l.className)});var y=f(n.children);return t(c).createElement(d,t(vp)({key:a},h),y)}}var Gp=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function Wp(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 qp(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Wp(Object(r),!0).forEach((function(n){t(J)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Kp=/\n/g;function Jp(e){var n=e.codeString,r=e.codeStyle,i=e.containerStyle,o=void 0===i?{float:"left",paddingRight:"10px"}:i,s=e.numberStyle,a=void 0===s?{}:s,l=e.startingLineNumber;return t(c).createElement("code",{style:Object.assign({},r,o)},function(e){var n=e.lines,r=e.startingLineNumber,i=e.style;return n.map((function(e,n){var o=n+r;return t(c).createElement("span",{key:"line-".concat(n),className:"react-syntax-highlighter-line-number",style:"function"==typeof i?i(o):i},"".concat(o,"\n"))}))}({lines:n.replace(/\n$/,"").split("\n"),style:a,startingLineNumber:l}))}function Qp(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function Yp(e,t,n){var r,i={display:"inline-block",minWidth:(r=n,"".concat(r.toString().length,".25em")),paddingRight:"1em",textAlign:"right",userSelect:"none"},o="function"==typeof e?e(t):e;return qp(qp({},i),o)}function Xp(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,o=e.showInlineLineNumbers,s=e.lineProps,a=void 0===s?{}:s,l=e.className,c=void 0===l?[]:l,u=e.showLineNumbers,d=e.wrapLongLines,p="function"==typeof a?a(n):a;if(p.className=c,n&&o){var h=Yp(r,n,i);t.unshift(Qp(n,h))}return d&u&&(p.style=qp(qp({},p.style),{},{display:"flex"})),{type:"element",tagName:"span",properties:p,children:t}}function $p(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=0;i<e.length;i++){var o=e[i];if("text"===o.type)r.push(Xp({children:[o],className:t(Pp)(new Set(n))}));else if(o.children){var s=n.concat(o.properties.className);$p(o.children,s).forEach((function(e){return r.push(e)}))}}return r}function Zp(e,t,n,r,i,o,s,a,l){var c,u=$p(e.value),d=[],p=-1,h=0;function f(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Xp({children:e,lineNumber:t,lineNumberStyle:a,largestLineNumber:s,showInlineLineNumbers:i,lineProps:n,className:o,showLineNumbers:r,wrapLongLines:l})}function m(e,t){if(r&&t&&i){var n=Yp(a,t,s);e.unshift(Qp(t,n))}return e}function g(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?f(e,n,r):m(e,n)}for(var v=function(){var e=u[h],t=e.children[0].value;if(t.match(Kp)){var n=t.split("\n");n.forEach((function(t,i){var s=r&&d.length+o,a={type:"text",value:"".concat(t,"\n")};if(0===i){var l=g(u.slice(p+1,h).concat(Xp({children:[a],className:e.properties.className})),s);d.push(l)}else if(i===n.length-1){var c=u[h+1]&&u[h+1].children&&u[h+1].children[0],f={type:"text",value:"".concat(t)};if(c){var m=Xp({children:[f],className:e.properties.className});u.splice(h+1,0,m)}else{var v=g([f],s,e.properties.className);d.push(v)}}else{var y=g([a],s,e.properties.className);d.push(y)}})),p=h}h++};h<u.length;)v();if(p!==u.length-1){var y=u.slice(p+1,u.length);if(y&&y.length){var b=g(y,r&&d.length+o);d.push(b)}}return t?d:(c=[]).concat.apply(c,d)}function eh(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map((function(e,t){return Vp({node:e,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(t)})}))}function th(e){return e&&void 0!==e.highlightAuto}function nh(e,n){return function(r){var i=r.language,o=r.children,s=r.style,a=void 0===s?n:s,l=r.customStyle,u=void 0===l?{}:l,d=r.codeTagProps,p=void 0===d?{className:i?"language-".concat(i):void 0,style:qp(qp({},a['code[class*="language-"]']),a['code[class*="language-'.concat(i,'"]')])}:d,h=r.useInlineStyles,f=void 0===h||h,m=r.showLineNumbers,g=void 0!==m&&m,v=r.showInlineLineNumbers,y=void 0===v||v,b=r.startingLineNumber,S=void 0===b?1:b,x=r.lineNumberContainerStyle,w=r.lineNumberStyle,C=void 0===w?{}:w,A=r.wrapLines,E=r.wrapLongLines,M=void 0!==E&&E,T=r.lineProps,_=void 0===T?{}:T,I=r.renderer,R=r.PreTag,P=void 0===R?"pre":R,k=r.CodeTag,O=void 0===k?"code":k,N=r.code,D=void 0===N?(Array.isArray(o)?o[0]:o)||"":N,L=r.astGenerator,B=t(Ip)(r,Gp);L=L||e;var z=g?t(c).createElement(Jp,{containerStyle:x,codeStyle:p.style||{},numberStyle:C,startingLineNumber:S,codeString:D}):null,F=a.hljs||a['pre[class*="language-"]']||{backgroundColor:"#fff"},U=th(L)?"hljs":"prismjs",j=f?Object.assign({},B,{style:Object.assign({},F,u)}):Object.assign({},B,{className:B.className?"".concat(U," ").concat(B.className):U,style:Object.assign({},u)});if(p.style=qp(qp({},p.style),{},M?{whiteSpace:"pre-wrap"}:{whiteSpace:"pre"}),!L)return t(c).createElement(P,j,z,t(c).createElement(O,p,D));(void 0===A&&I||M)&&(A=!0),I=I||eh;var H=[{type:"text",value:D}],V=function(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(th(t)){var o=function(e,t){return-1!==e.listLanguages().indexOf(t)}(t,n);return"text"===n?{value:i,language:"text"}:o?t.highlight(n,r):t.highlightAuto(r)}try{return n&&"text"!==n?{value:t.highlight(r,n)}:{value:i}}catch(e){return{value:i}}}({astGenerator:L,language:i,code:D,defaultCodeValue:H});null===V.language&&(V.value=H);var G=Zp(V,A,_,g,y,S,V.value.length+S,C,M);return t(c).createElement(P,j,t(c).createElement(O,p,!y&&z,I({rows:G,stylesheet:a,useInlineStyles:f})))}}function rh(e){var n=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 r,i=t(Ep)(e);if(n){var o=t(Ep)(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return t(wp)(this,r)}}var ih,oh,sh,ah,lh,ch,uh,dh=function(e,n){return function(){var r=t(mp)(t(Tp).mark((function r(i){var o;return t(Tp).wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:o=t.sent,i(e,o.default||o);case 4:case"end":return t.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()},ph={abap:dh("abap",(function(){return o("bwHpE")})),abnf:dh("abnf",(function(){return o("daD87")})),actionscript:dh("actionscript",(function(){return o("lpEgO")})),ada:dh("ada",(function(){return o("1sGW9")})),agda:dh("agda",(function(){return o("e9VyR")})),al:dh("al",(function(){return o("kMFSe")})),antlr4:dh("antlr4",(function(){return o("8HlsP")})),apacheconf:dh("apacheconf",(function(){return o("isFCh")})),apex:dh("apex",(function(){return o("gUXVM")})),apl:dh("apl",(function(){return o("2L15v")})),applescript:dh("applescript",(function(){return o("8XyFT")})),aql:dh("aql",(function(){return o("gFWTI")})),arduino:dh("arduino",(function(){return o("jI3VB")})),arff:dh("arff",(function(){return o("6uYTH")})),asciidoc:dh("asciidoc",(function(){return o("gdYKH")})),asm6502:dh("asm6502",(function(){return o("ahFLg")})),asmatmel:dh("asmatmel",(function(){return o("4irIu")})),aspnet:dh("aspnet",(function(){return o("yDC6n")})),autohotkey:dh("autohotkey",(function(){return o("a4xpy")})),autoit:dh("autoit",(function(){return o("iNSix")})),avisynth:dh("avisynth",(function(){return o("kEBnk")})),avroIdl:dh("avroIdl",(function(){return o("lzthi")})),bash:dh("bash",(function(){return Promise.resolve(o("3aDLI"))})),basic:dh("basic",(function(){return o("cxDu6")})),batch:dh("batch",(function(){return o("6zDll")})),bbcode:dh("bbcode",(function(){return o("bPS87")})),bicep:dh("bicep",(function(){return o("8dy5f")})),birb:dh("birb",(function(){return o("3vHrY")})),bison:dh("bison",(function(){return o("bCjBS")})),bnf:dh("bnf",(function(){return o("4NqDW")})),brainfuck:dh("brainfuck",(function(){return o("4s0KX")})),brightscript:dh("brightscript",(function(){return o("jTsQ4")})),bro:dh("bro",(function(){return o("5lMc2")})),bsl:dh("bsl",(function(){return o("jBYxC")})),c:dh("c",(function(){return Promise.resolve(o("lyZgY"))})),cfscript:dh("cfscript",(function(){return o("coZDy")})),chaiscript:dh("chaiscript",(function(){return o("e1zEN")})),cil:dh("cil",(function(){return o("crKoM")})),clike:dh("clike",(function(){return o("4kO9t")})),clojure:dh("clojure",(function(){return o("01SpB")})),cmake:dh("cmake",(function(){return o("9yG4p")})),cobol:dh("cobol",(function(){return o("967Hn")})),coffeescript:dh("coffeescript",(function(){return o("7Yi6H")})),concurnas:dh("concurnas",(function(){return o("5tXmX")})),coq:dh("coq",(function(){return o("ektdr")})),cpp:dh("cpp",(function(){return Promise.resolve(o("lR39A"))})),crystal:dh("crystal",(function(){return o("8gt4L")})),csharp:dh("csharp",(function(){return o("7K6eJ")})),cshtml:dh("cshtml",(function(){return o("cVu4i")})),csp:dh("csp",(function(){return o("ecKo1")})),cssExtras:dh("cssExtras",(function(){return o("gnpv8")})),css:dh("css",(function(){return o("jx0H8")})),csv:dh("csv",(function(){return o("f9kmW")})),cypher:dh("cypher",(function(){return o("lojor")})),d:dh("d",(function(){return o("6Qa0U")})),dart:dh("dart",(function(){return o("74K1B")})),dataweave:dh("dataweave",(function(){return o("93H6c")})),dax:dh("dax",(function(){return o("cf9Y9")})),dhall:dh("dhall",(function(){return o("f6UWv")})),diff:dh("diff",(function(){return o("klPVo")})),django:dh("django",(function(){return o("jfxe9")})),dnsZoneFile:dh("dnsZoneFile",(function(){return o("5aMz5")})),docker:dh("docker",(function(){return o("kOauC")})),dot:dh("dot",(function(){return o("btE6k")})),ebnf:dh("ebnf",(function(){return o("aT88c")})),editorconfig:dh("editorconfig",(function(){return o("jWOl8")})),eiffel:dh("eiffel",(function(){return o("kHJaX")})),ejs:dh("ejs",(function(){return o("frfnA")})),elixir:dh("elixir",(function(){return o("hcrJ2")})),elm:dh("elm",(function(){return o("jd271")})),erb:dh("erb",(function(){return o("gczXL")})),erlang:dh("erlang",(function(){return o("FsabW")})),etlua:dh("etlua",(function(){return o("9DI9l")})),excelFormula:dh("excelFormula",(function(){return o("3QVue")})),factor:dh("factor",(function(){return o("ltNCT")})),falselang:dh("falselang",(function(){return o("g0Q6p")})),firestoreSecurityRules:dh("firestoreSecurityRules",(function(){return o("ukA2V")})),flow:dh("flow",(function(){return o("e5prn")})),fortran:dh("fortran",(function(){return o("gIEL6")})),fsharp:dh("fsharp",(function(){return o("3wQkt")})),ftl:dh("ftl",(function(){return o("7ZVWs")})),gap:dh("gap",(function(){return o("hOFj6")})),gcode:dh("gcode",(function(){return o("95BzQ")})),gdscript:dh("gdscript",(function(){return o("iul6t")})),gedcom:dh("gedcom",(function(){return o("e0qJM")})),gherkin:dh("gherkin",(function(){return o("2SHak")})),git:dh("git",(function(){return o("l6VFH")})),glsl:dh("glsl",(function(){return o("cEMfJ")})),gml:dh("gml",(function(){return o("8UVTr")})),gn:dh("gn",(function(){return o("kvibD")})),goModule:dh("goModule",(function(){return o("icqjF")})),go:dh("go",(function(){return o("jLkg8")})),graphql:dh("graphql",(function(){return o("aYGNi")})),groovy:dh("groovy",(function(){return o("4bTmH")})),haml:dh("haml",(function(){return o("h2A6V")})),handlebars:dh("handlebars",(function(){return o("79YVJ")})),haskell:dh("haskell",(function(){return o("bsiLW")})),haxe:dh("haxe",(function(){return o("94Kdj")})),hcl:dh("hcl",(function(){return o("9CheR")})),hlsl:dh("hlsl",(function(){return o("h3dqW")})),hoon:dh("hoon",(function(){return o("9WbsW")})),hpkp:dh("hpkp",(function(){return o("GiPN3")})),hsts:dh("hsts",(function(){return o("eaSn9")})),http:dh("http",(function(){return o("1uj7b")})),ichigojam:dh("ichigojam",(function(){return o("ge562")})),icon:dh("icon",(function(){return o("lVHUf")})),icuMessageFormat:dh("icuMessageFormat",(function(){return o("aYoUL")})),idris:dh("idris",(function(){return o("1RVAE")})),iecst:dh("iecst",(function(){return o("bi7Dr")})),ignore:dh("ignore",(function(){return o("cq0Pi")})),inform7:dh("inform7",(function(){return o("31K4E")})),ini:dh("ini",(function(){return o("l05OZ")})),io:dh("io",(function(){return o("6bY1b")})),j:dh("j",(function(){return o("1ebDS")})),java:dh("java",(function(){return o("iEZZI")})),javadoc:dh("javadoc",(function(){return o("aHy5a")})),javadoclike:dh("javadoclike",(function(){return o("5f3rE")})),javascript:dh("javascript",(function(){return o("7JDFI")})),javastacktrace:dh("javastacktrace",(function(){return o("gdCGE")})),jexl:dh("jexl",(function(){return o("cqMb9")})),jolie:dh("jolie",(function(){return o("cEDX4")})),jq:dh("jq",(function(){return o("kEWsh")})),jsExtras:dh("jsExtras",(function(){return o("74PI8")})),jsTemplates:dh("jsTemplates",(function(){return o("30TPr")})),jsdoc:dh("jsdoc",(function(){return o("9DH5c")})),json:dh("json",(function(){return Promise.resolve(o("l1Rj1"))})),json5:dh("json5",(function(){return o("920rv")})),jsonp:dh("jsonp",(function(){return o("9AwS1")})),jsstacktrace:dh("jsstacktrace",(function(){return o("bYXMr")})),jsx:dh("jsx",(function(){return Promise.resolve(o("6ho3O"))})),julia:dh("julia",(function(){return o("g0ibH")})),keepalived:dh("keepalived",(function(){return o("2hdnH")})),keyman:dh("keyman",(function(){return o("cIufI")})),kotlin:dh("kotlin",(function(){return o("c26dU")})),kumir:dh("kumir",(function(){return o("iYAha")})),kusto:dh("kusto",(function(){return o("9z1oX")})),latex:dh("latex",(function(){return o("lCPLU")})),latte:dh("latte",(function(){return o("c9oN0")})),less:dh("less",(function(){return o("hA3V9")})),lilypond:dh("lilypond",(function(){return o("hpHTA")})),liquid:dh("liquid",(function(){return o("kpZTm")})),lisp:dh("lisp",(function(){return o("chgK5")})),livescript:dh("livescript",(function(){return o("2gdiv")})),llvm:dh("llvm",(function(){return o("jUeFO")})),log:dh("log",(function(){return o("3BFSQ")})),lolcode:dh("lolcode",(function(){return o("lG9br")})),lua:dh("lua",(function(){return o("cVGpd")})),magma:dh("magma",(function(){return o("4LVzY")})),makefile:dh("makefile",(function(){return o("2NviD")})),markdown:dh("markdown",(function(){return o("jUFCF")})),markupTemplating:dh("markupTemplating",(function(){return Promise.resolve(o("t3W0d"))})),markup:dh("markup",(function(){return o("5hIXu")})),matlab:dh("matlab",(function(){return o("kPAC0")})),maxscript:dh("maxscript",(function(){return o("gHOJy")})),mel:dh("mel",(function(){return o("9mj6e")})),mermaid:dh("mermaid",(function(){return o("kozw5")})),mizar:dh("mizar",(function(){return o("2bN6W")})),mongodb:dh("mongodb",(function(){return o("eHKWX")})),monkey:dh("monkey",(function(){return o("7Fh0C")})),moonscript:dh("moonscript",(function(){return o("hDXwC")})),n1ql:dh("n1ql",(function(){return o("j9bkC")})),n4js:dh("n4js",(function(){return o("eTmBF")})),nand2tetrisHdl:dh("nand2tetrisHdl",(function(){return o("ezjCf")})),naniscript:dh("naniscript",(function(){return o("VxHk1")})),nasm:dh("nasm",(function(){return o("ly95T")})),neon:dh("neon",(function(){return o("7Fk34")})),nevod:dh("nevod",(function(){return o("3U8Qv")})),nginx:dh("nginx",(function(){return o("c6qVk")})),nim:dh("nim",(function(){return o("1JdCk")})),nix:dh("nix",(function(){return o("jcstS")})),nsis:dh("nsis",(function(){return o("kEJqW")})),objectivec:dh("objectivec",(function(){return o("lUP8A")})),ocaml:dh("ocaml",(function(){return o("lhTAD")})),opencl:dh("opencl",(function(){return o("8rxKO")})),openqasm:dh("openqasm",(function(){return o("ib0uL")})),oz:dh("oz",(function(){return o("csCUS")})),parigp:dh("parigp",(function(){return o("2DkHE")})),parser:dh("parser",(function(){return o("2cp75")})),pascal:dh("pascal",(function(){return o("fViVl")})),pascaligo:dh("pascaligo",(function(){return o("9Uuxa")})),pcaxis:dh("pcaxis",(function(){return o("jUdnN")})),peoplecode:dh("peoplecode",(function(){return o("l8w4e")})),perl:dh("perl",(function(){return o("aX7dM")})),phpExtras:dh("phpExtras",(function(){return o("3cMZl")})),php:dh("php",(function(){return Promise.resolve(o("5li5P"))})),phpdoc:dh("phpdoc",(function(){return o("bDyJN")})),plsql:dh("plsql",(function(){return o("cPuMN")})),powerquery:dh("powerquery",(function(){return o("jE1gU")})),powershell:dh("powershell",(function(){return o("k7t0j")})),processing:dh("processing",(function(){return o("jr8hV")})),prolog:dh("prolog",(function(){return o("hpuat")})),promql:dh("promql",(function(){return o("ckXC5")})),properties:dh("properties",(function(){return o("fAh6P")})),protobuf:dh("protobuf",(function(){return o("R6WqB")})),psl:dh("psl",(function(){return o("Al65w")})),pug:dh("pug",(function(){return o("dxbNS")})),puppet:dh("puppet",(function(){return o("lrSuh")})),pure:dh("pure",(function(){return o("6DKQK")})),purebasic:dh("purebasic",(function(){return o("7ZkSb")})),purescript:dh("purescript",(function(){return o("dBTYx")})),python:dh("python",(function(){return Promise.resolve(o("kiy5M"))})),q:dh("q",(function(){return o("4FXyy")})),qml:dh("qml",(function(){return o("2zZFj")})),qore:dh("qore",(function(){return o("iCK1Y")})),qsharp:dh("qsharp",(function(){return o("dvH9H")})),r:dh("r",(function(){return o("lQqRt")})),racket:dh("racket",(function(){return o("eHKmq")})),reason:dh("reason",(function(){return o("kkeLT")})),regex:dh("regex",(function(){return o("llX50")})),rego:dh("rego",(function(){return o("9hKdZ")})),renpy:dh("renpy",(function(){return o("cJgw5")})),rest:dh("rest",(function(){return o("867DK")})),rip:dh("rip",(function(){return o("3Odjx")})),roboconf:dh("roboconf",(function(){return o("gQ0Us")})),robotframework:dh("robotframework",(function(){return o("bLCgx")})),ruby:dh("ruby",(function(){return Promise.resolve(o("ch1PX"))})),rust:dh("rust",(function(){return o("cInT8")})),sas:dh("sas",(function(){return o("iz7eP")})),sass:dh("sass",(function(){return o("hrDC3")})),scala:dh("scala",(function(){return o("ub8Bf")})),scheme:dh("scheme",(function(){return o("7NAAt")})),scss:dh("scss",(function(){return Promise.resolve(o("fU6a0"))})),shellSession:dh("shellSession",(function(){return o("7kKCv")})),smali:dh("smali",(function(){return o("2lkCb")})),smalltalk:dh("smalltalk",(function(){return o("4280y")})),smarty:dh("smarty",(function(){return o("4hXYK")})),sml:dh("sml",(function(){return o("jh2E8")})),solidity:dh("solidity",(function(){return o("dTdF2")})),solutionFile:dh("solutionFile",(function(){return o("iI5tm")})),soy:dh("soy",(function(){return o("aoU5C")})),sparql:dh("sparql",(function(){return o("ggrvb")})),splunkSpl:dh("splunkSpl",(function(){return o("8LhCX")})),sqf:dh("sqf",(function(){return o("3tDsu")})),sql:dh("sql",(function(){return Promise.resolve(o("bnDV9"))})),squirrel:dh("squirrel",(function(){return o("bxaUV")})),stan:dh("stan",(function(){return o("dBqrq")})),stylus:dh("stylus",(function(){return o("JlHVK")})),swift:dh("swift",(function(){return o("c7NBs")})),systemd:dh("systemd",(function(){return o("jprZl")})),t4Cs:dh("t4Cs",(function(){return o("edsMI")})),t4Templating:dh("t4Templating",(function(){return o("bS9Wa")})),t4Vb:dh("t4Vb",(function(){return o("gYk20")})),tap:dh("tap",(function(){return o("byv7d")})),tcl:dh("tcl",(function(){return o("lUAIZ")})),textile:dh("textile",(function(){return o("7J2LO")})),toml:dh("toml",(function(){return o("eXtdM")})),tremor:dh("tremor",(function(){return o("vyajH")})),tsx:dh("tsx",(function(){return Promise.resolve(o("7cTnl"))})),tt2:dh("tt2",(function(){return o("8XOOm")})),turtle:dh("turtle",(function(){return o("1XvLQ")})),twig:dh("twig",(function(){return o("i9Fpp")})),typescript:dh("typescript",(function(){return Promise.resolve(o("fzL8k"))})),typoscript:dh("typoscript",(function(){return o("kKk69")})),unrealscript:dh("unrealscript",(function(){return o("jgq8Y")})),uorazor:dh("uorazor",(function(){return o("dsZ00")})),uri:dh("uri",(function(){return o("fqJRp")})),v:dh("v",(function(){return o("bgfyB")})),vala:dh("vala",(function(){return o("68x4q")})),vbnet:dh("vbnet",(function(){return o("eUhQs")})),velocity:dh("velocity",(function(){return o("fPNdV")})),verilog:dh("verilog",(function(){return o("2fM1V")})),vhdl:dh("vhdl",(function(){return o("hNF6q")})),vim:dh("vim",(function(){return o("75TCr")})),visualBasic:dh("visualBasic",(function(){return o("fc93z")})),warpscript:dh("warpscript",(function(){return o("jgHlG")})),wasm:dh("wasm",(function(){return o("dVZkI")})),webIdl:dh("webIdl",(function(){return o("9Jnxv")})),wiki:dh("wiki",(function(){return o("1Gimo")})),wolfram:dh("wolfram",(function(){return o("4SyRT")})),wren:dh("wren",(function(){return o("gaIVs")})),xeora:dh("xeora",(function(){return o("lagad")})),xmlDoc:dh("xmlDoc",(function(){return o("9DNYE")})),xojo:dh("xojo",(function(){return o("ksF4f")})),xquery:dh("xquery",(function(){return o("gXxHJ")})),yaml:dh("yaml",(function(){return o("6rk3j")})),yang:dh("yang",(function(){return o("kTyrQ")})),zig:dh("zig",(function(){return o("d3mFC")}))},hh=(oh=(ih={loader:function(){return o("bB2YF").then((function(e){return e.default||e}))},isLanguageRegistered:function(e,t){return e.registered(t)},languageLoaders:ph,registerLanguage:function(e,t,n){return e.register(n)}}).loader,sh=ih.isLanguageRegistered,ah=ih.registerLanguage,lh=ih.languageLoaders,ch=ih.noAsyncLoadingLanguages,uh=function(e){t(bp)(i,e);var n,r=rh(i);function i(){return t(Y)(this,i),r.apply(this,arguments)}return t(X)(i,[{key:"componentDidUpdate",value:function(){!i.isRegistered(this.props.language)&&lh&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var e=this;i.astGeneratorPromise||i.loadAstGenerator(),i.astGenerator||i.astGeneratorPromise.then((function(){e.forceUpdate()})),!i.isRegistered(this.props.language)&&lh&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var e=this,t=this.props.language;"text"!==t&&i.loadLanguage(t).then((function(){return e.forceUpdate()})).catch((function(){}))}},{key:"normalizeLanguage",value:function(e){return i.isSupportedLanguage(e)?e:"text"}},{key:"render",value:function(){return t(c).createElement(i.highlightInstance,t(vp)({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:i.astGenerator}))}}],[{key:"preload",value:function(){return i.loadAstGenerator()}},{key:"loadLanguage",value:(n=t(mp)(t(Tp).mark((function e(n){var r;return t(Tp).wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(r=lh[n])){e.next=5;break}return e.abrupt("return",r(i.registerLanguage));case 5:throw new Error("Language ".concat(n," not supported"));case 6:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"isSupportedLanguage",value:function(e){return i.isRegistered(e)||"function"==typeof lh[e]}},{key:"loadAstGenerator",value:function(){return i.astGeneratorPromise=oh().then((function(e){i.astGenerator=e,ah&&i.languages.forEach((function(t,n){return ah(e,n,t)}))})),i.astGeneratorPromise}}]),i}(t(c).PureComponent),t(J)(uh,"astGenerator",null),t(J)(uh,"highlightInstance",nh(null,{})),t(J)(uh,"astGeneratorPromise",null),t(J)(uh,"languages",new Map),t(J)(uh,"supportedLanguages",ih.supportedLanguages||Object.keys(lh||{})),t(J)(uh,"isRegistered",(function(e){if(ch)return!0;if(!ah)throw new Error("Current syntax highlighter doesn't support registration of languages");return uh.astGenerator?sh(uh.astGenerator,e):uh.languages.has(e)})),t(J)(uh,"registerLanguage",(function(e,t){if(!ah)throw new Error("Current syntax highlighter doesn't support registration of languages");if(uh.astGenerator)return ah(uh.astGenerator,e,t);uh.languages.set(e,t)})),uh),fh={},mh={};(mh=function(e){return e&&e.__esModule?e:{default:e}}).__esModule=!0,mh.default=mh,Object.defineProperty(fh,"__esModule",{value:!0}),Object.defineProperty(fh,"a11yDark",{enumerable:!0,get:function(){return Ah.default}}),Object.defineProperty(fh,"atomDark",{enumerable:!0,get:function(){return Eh.default}}),Object.defineProperty(fh,"base16AteliersulphurpoolLight",{enumerable:!0,get:function(){return Mh.default}}),Object.defineProperty(fh,"cb",{enumerable:!0,get:function(){return Th.default}}),Object.defineProperty(fh,"coldarkCold",{enumerable:!0,get:function(){return _h.default}}),Object.defineProperty(fh,"coldarkDark",{enumerable:!0,get:function(){return Ih.default}}),Object.defineProperty(fh,"coy",{enumerable:!0,get:function(){return gh.default}}),Object.defineProperty(fh,"coyWithoutShadows",{enumerable:!0,get:function(){return Rh.default}}),Object.defineProperty(fh,"darcula",{enumerable:!0,get:function(){return Ph.default}}),Object.defineProperty(fh,"dark",{enumerable:!0,get:function(){return vh.default}}),Object.defineProperty(fh,"dracula",{enumerable:!0,get:function(){return kh.default}}),Object.defineProperty(fh,"duotoneDark",{enumerable:!0,get:function(){return Oh.default}}),Object.defineProperty(fh,"duotoneEarth",{enumerable:!0,get:function(){return Nh.default}}),Object.defineProperty(fh,"duotoneForest",{enumerable:!0,get:function(){return Dh.default}}),Object.defineProperty(fh,"duotoneLight",{enumerable:!0,get:function(){return Lh.default}}),Object.defineProperty(fh,"duotoneSea",{enumerable:!0,get:function(){return Bh.default}}),Object.defineProperty(fh,"duotoneSpace",{enumerable:!0,get:function(){return zh.default}}),Object.defineProperty(fh,"funky",{enumerable:!0,get:function(){return yh.default}}),Object.defineProperty(fh,"ghcolors",{enumerable:!0,get:function(){return Fh.default}}),Object.defineProperty(fh,"gruvboxDark",{enumerable:!0,get:function(){return Uh.default}}),Object.defineProperty(fh,"gruvboxLight",{enumerable:!0,get:function(){return jh.default}}),Object.defineProperty(fh,"holiTheme",{enumerable:!0,get:function(){return Hh.default}}),Object.defineProperty(fh,"hopscotch",{enumerable:!0,get:function(){return Vh.default}}),Object.defineProperty(fh,"lucario",{enumerable:!0,get:function(){return Gh.default}}),Object.defineProperty(fh,"materialDark",{enumerable:!0,get:function(){return Wh.default}}),Object.defineProperty(fh,"materialLight",{enumerable:!0,get:function(){return qh.default}}),Object.defineProperty(fh,"materialOceanic",{enumerable:!0,get:function(){return Kh.default}}),Object.defineProperty(fh,"nightOwl",{enumerable:!0,get:function(){return Jh.default}}),Object.defineProperty(fh,"nord",{enumerable:!0,get:function(){return Qh.default}}),Object.defineProperty(fh,"okaidia",{enumerable:!0,get:function(){return bh.default}}),Object.defineProperty(fh,"oneDark",{enumerable:!0,get:function(){return Yh.default}}),Object.defineProperty(fh,"oneLight",{enumerable:!0,get:function(){return Xh.default}}),Object.defineProperty(fh,"pojoaque",{enumerable:!0,get:function(){return $h.default}}),Object.defineProperty(fh,"prism",{enumerable:!0,get:function(){return Ch.default}}),Object.defineProperty(fh,"shadesOfPurple",{enumerable:!0,get:function(){return Zh.default}}),Object.defineProperty(fh,"solarizedDarkAtom",{enumerable:!0,get:function(){return ef.default}}),Object.defineProperty(fh,"solarizedlight",{enumerable:!0,get:function(){return Sh.default}}),Object.defineProperty(fh,"synthwave84",{enumerable:!0,get:function(){return tf.default}}),Object.defineProperty(fh,"tomorrow",{enumerable:!0,get:function(){return xh.default}}),Object.defineProperty(fh,"twilight",{enumerable:!0,get:function(){return wh.default}}),Object.defineProperty(fh,"vs",{enumerable:!0,get:function(){return nf.default}}),Object.defineProperty(fh,"vscDarkPlus",{enumerable:!0,get:function(){return rf.default}}),Object.defineProperty(fh,"xonokai",{enumerable:!0,get:function(){return of.default}}),Object.defineProperty(fh,"zTouch",{enumerable:!0,get:function(){return sf.default}});var gh=mh(o("jcF8U")),vh=mh(o("3Tppx")),yh=mh(o("dBuK7")),bh=mh(o("eEjWK")),Sh=mh(o("awG2g")),xh=mh(o("2oFzQ")),wh=mh(o("4Au6Q")),Ch=mh(o("dAPqs")),Ah=mh(o("8eAql")),Eh=mh(o("cv2QE")),Mh=mh(o("h5I9g")),Th=mh(o("i4C5w")),_h=mh(o("3kFKo")),Ih=mh(o("17zK0")),Rh=mh(o("5Avqr")),Ph=mh(o("1jHMv")),kh=mh(o("7Q8CE")),Oh=mh(o("jKUos")),Nh=mh(o("Uzm4J")),Dh=mh(o("7yfkN")),Lh=mh(o("lT2l1")),Bh=mh(o("fZ9um")),zh=mh(o("1MoQL")),Fh=mh(o("4uys7")),Uh=mh(o("kaYsk")),jh=mh(o("kN6Vu")),Hh=mh(o("2Z6pG")),Vh=mh(o("4jQJK")),Gh=mh(o("bpXw0")),Wh=mh(o("i4S8s")),qh=mh(o("5bNr4")),Kh=mh(o("5ZYWT")),Jh=mh(o("ihJCU")),Qh=mh(o("8iIbg")),Yh=mh(o("424u7")),Xh=mh(o("jPiNI")),$h=mh(o("OHVOA")),Zh=mh(o("2OKTL")),ef=mh(o("2Mg8H")),tf=mh(o("9Kud0")),nf=mh(o("eCrmR")),rf=mh(o("8UhcQ")),of=mh(o("dtU9z")),sf=mh(o("4xtLO")),af={};Object.defineProperty(af,"__esModule",{value:!0}),af.default=void 0;var lf=mh(o("7cTnl")).default;af.default=lf;var cf={};Object.defineProperty(cf,"__esModule",{value:!0}),cf.default=void 0;var uf=mh(o("l1Rj1")).default;cf.default=uf;var df={};Object.defineProperty(df,"__esModule",{value:!0}),df.default=void 0;var pf=mh(o("fU6a0")).default;df.default=pf;var hf={};Object.defineProperty(hf,"__esModule",{value:!0}),hf.default=void 0;var ff=mh(o("3aDLI")).default;hf.default=ff;var mf={};Object.defineProperty(mf,"__esModule",{value:!0}),mf.default=void 0;var gf=mh(o("kiy5M")).default;mf.default=gf;var vf={};Object.defineProperty(vf,"__esModule",{value:!0}),vf.default=void 0;var yf=mh(o("lR39A")).default;vf.default=yf;var bf={};Object.defineProperty(bf,"__esModule",{value:!0}),bf.default=void 0;var Sf=mh(o("5li5P")).default;bf.default=Sf;var xf={};Object.defineProperty(xf,"__esModule",{value:!0}),xf.default=void 0;var wf=mh(o("ch1PX")).default;xf.default=wf;var Cf={};Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.default=void 0;var Af=mh(o("bnDV9")).default;Cf.default=Af,hh.registerLanguage("tsx",t(af)),hh.registerLanguage("json",t(cf)),hh.registerLanguage("scss",t(df)),hh.registerLanguage("bash",t(hf)),hh.registerLanguage("python",t(mf)),hh.registerLanguage("cpp",t(vf)),hh.registerLanguage("php",t(bf)),hh.registerLanguage("ruby",t(xf)),hh.registerLanguage("sql",t(Cf));var Ef=({medium:e,className:t,preview:n=!1})=>{var r,i,o,a;const{t:l}=ve();return(0,s.jsxs)("div",{className:"memori-snippet",children:[(0,s.jsxs)("div",{className:"memori-snippet--content",children:[(0,s.jsx)(hh,{"aria-labelledby":`#snippet-${e.mediumID}`,className:t,style:fh.atomDark,showLineNumbers:!0,language:null!==(i=null===(r=dp.find((t=>e.mimeType===t.mimeType)))||void 0===r?void 0:r.lang)&&void 0!==i?i:"text",children:(null===(o=e.content)||void 0===o?void 0:o.length)&&e.content.length>200&&n?`${e.content.slice(0,200)}\n...`:`${e.content}`}),(0,s.jsx)(Da,{padded:!1,ghost:!0,className:"memori-snippet--copy-button",title:l("copy")||"Copy",icon:(0,s.jsx)(fp,{}),onClick:()=>{var t;return navigator.clipboard.writeText(null!==(t=e.content)&&void 0!==t?t:"")}})]}),!!(null===(a=e.title)||void 0===a?void 0:a.length)&&(0,s.jsx)("p",{id:`snippet-${e.mediumID}`,className:"memori-snippet--caption",children:e.title})]})};var Mf=({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:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});var Tf=({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:"M531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7-3.8-21.3-19.5-29.6-32.9-30.2-15.8-.7-29.9 8.3-33.4 21.4-6.6 24-.7 56.8 10.1 98.6-13.6 32.4-35.3 79.5-51.2 107.5-29.6 15.3-69.3 38.9-75.2 68.7-1.2 5.5.2 12.5 3.5 18.8 3.7 7 9.6 12.4 16.5 15 3 1.1 6.6 2 10.8 2 17.6 0 46.1-14.2 84.1-79.4 5.8-1.9 11.8-3.9 17.6-5.9 27.2-9.2 55.4-18.8 80.9-23.1 28.2 15.1 60.3 24.8 82.1 24.8 21.6 0 30.1-12.8 33.3-20.5 5.6-13.5 2.9-30.5-6.2-39.6-13.2-13-45.3-16.4-95.3-10.2-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7 6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4-4.9-19.9-5.6-48.1-2.7-51.4.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2-21.6 4.9-41.3 13-58.9 20.2-4.2 1.7-8.3 3.4-12.3 5 13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6 40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});var _f=({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:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0 0 10.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 0 0-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"})});var If=({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:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 0 0-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 0 0-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"})});const Rf=({isChild:e=!1,item:t,sessionID:n,tenantID:r,preview:i=!1,baseURL:o,apiURL:a,onClick:l,customMediaRenderer:c})=>{const u=wd({resourceURI:t.url,sessionID:n,tenantID:r,baseURL:o,apiURL:a}),d=null==c?void 0:c(t.mimeType);if(d)return d;switch(t.mimeType){case"image/jpeg":case"image/png":case"image/jpg":case"image/gif":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,onClick:n=>{e&&n.preventDefault(),l&&(n.preventDefault(),l(t.mediumID))},target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(ip,{hoverable:!0,className:"memori-media-item--card memori-media-item--image",cover:(0,s.jsxs)("picture",{className:"memori-media-item--figure",children:[!i&&(0,s.jsx)("source",{srcSet:[u,t.url,t.content].join(", "),type:t.mimeType}),(0,s.jsx)("img",{alt:t.title,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}),t.title&&(0,s.jsx)("figcaption",{className:"memori-media-item--figure-caption",children:t.title})]})})});case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(ip,{hoverable:!0,cover:(0,s.jsx)(If,{className:"memori-media-item--icon"}),title:t.title})});case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(ip,{hoverable:!0,cover:(0,s.jsx)(_f,{className:"memori-media-item--icon"}),title:t.title})});case"application/pdf":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(ip,{hoverable:!0,cover:(0,s.jsx)(Tf,{className:"memori-media-item--icon"}),title:t.title})});case"video/mp4":case"video/avi":case"video/mpeg":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,onClick:n=>{e&&n.preventDefault(),l&&(n.preventDefault(),l(t.mediumID))},target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(ip,{hoverable:!0,cover:(0,s.jsx)("video",{style:{width:"100%",height:"100%"},controls:!0,src:u,title:t.title}),title:t.title})});case"audio/mpeg3":case"audio/wav":case"audio/mpeg":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(ip,{hoverable:!0,cover:(0,s.jsx)("audio",{style:{width:"100%",height:"100%"},controls:!0,src:u}),title:t.title})});case"model/gltf-binary":return(0,s.jsx)(hp,{src:u,alt:"",poster:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="});default:return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(ip,{hoverable:!0,cover:(0,s.jsx)(Mf,{className:"memori-media-item--icon"}),title:t.title})})}};var Pf=(0,c.memo)((({items:e,sessionID:t,tenantID:n,translateTo:r,baseURL:i,apiURL:o,customMediaRenderer:a})=>{const[l,u]=(0,c.useState)(e),[d,p]=(0,c.useState)(),h=(0,c.useCallback)((async()=>{if(!r)return;const t=await Promise.all((null!=e?e:[]).map((async e=>{var t;if(!e.title)return e;try{const n=await lp(e.title,r);return{...e,title:null!==(t=n.text)&&void 0!==t?t:e.title}}catch(t){return console.error(t),e}})));u(t)}),[r,e]);return(0,c.useEffect)((()=>{r&&h()}),[r,h]),(0,s.jsxs)(Wc,{appear:!0,show:!0,as:"div",className:"memori-media-items",children:[(0,s.jsx)("div",{className:"memori-media-items--grid",children:l.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&!dp.map((e=>e.mimeType)).includes(e.mimeType)})).sort(((e,t)=>e.creationTimestamp>t.creationTimestamp?1:e.creationTimestamp<t.creationTimestamp?-1:0)).map(((e,r)=>(0,s.jsx)(Wc.Child,{as:"div",className:"memori-media-item",enter:"ease-out duration-500 delay-"+100*r,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsx)(Rf,{isChild:!0,sessionID:t,tenantID:n,baseURL:i,apiURL:o,onClick:e=>{p(l.find((t=>t.mediumID===e)))},item:{...e,title:e.title,url:e.url,content:e.content},customMediaRenderer:a})},e.url+"&index="+r)))}),l.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&dp.map((e=>e.mimeType)).includes(e.mimeType)})).map((e=>(0,s.jsx)(Wc.Child,{as:"div",className:"memori-media-item--snippet",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,s.jsx)(Ef,{medium:e},e.mediumID)},e.mediumID))),l.filter((e=>{var t;return"text/css"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)})).map((e=>(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:e.content||""}},e.mediumID))),(null==d?void 0:d.mediumID)&&(0,s.jsx)(Jc,{width:"100%",widthMd:"100%",className:"memori-media-item--modal",open:!!d,onClose:()=>p(void 0),footer:null,children:(0,s.jsx)(Rf,{isChild:!0,sessionID:t,tenantID:n,baseURL:i,apiURL:o,item:{...d,title:d.title,url:d.url,content:d.content},customMediaRenderer:a})})]})}));var kf=(0,c.memo)((({hints:e=[],links:n=[],media:r=[],simulateUserPrompt:i=(()=>{}),sessionID:o,baseUrl:a,apiUrl:l,translateTo:u,customMediaRenderer:d})=>{const{t:p}=ve(),[h,f]=(0,c.useState)(!0),[m,g]=(0,c.useState)(6);return(0,c.useEffect)((()=>{f(!0)}),[e]),(0,s.jsxs)("div",{className:"memori-media-widget",children:[(null==r?void 0:r.length)>0&&(0,s.jsx)(Pf,{items:r,sessionID:o,translateTo:u,baseURL:a,apiURL:l,customMediaRenderer:d}),(null==n?void 0:n.length)>0&&(0,s.jsx)(sp,{items:n,baseUrl:a}),(null==e?void 0:e.length)>0&&h&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Wc,{appear:!0,show:!0,as:"ul",className:"memori-media--hints",children:e.slice(0,m).map(((e,n)=>(0,s.jsx)(Wc.Child,{as:"li",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,s.jsx)(Da,{className:t(ys)("memori-media--hint"),primary:!0,onClick:()=>{i(e.originalText,e.text),f(!1)},onTouchEnd:()=>{i(e.originalText,e.text),f(!1)},children:e.text},e.text+n)},e.text+n)))}),e.length>m&&(0,s.jsx)("div",{className:"memori-hints--show-more",children:(0,s.jsx)(Da,{className:"memori-hints--show-more-button",id:"showMoreHints",onClick:()=>g(m+6),children:p("expand")||"Expand"})})]})]})}));c=o("85Hg2"),c=o("85Hg2");function Of(e=0){let[t,n]=(0,c.useState)(e),r=(0,c.useCallback)((e=>n((t=>t|e))),[t]),i=(0,c.useCallback)((e=>Boolean(t&e)),[t]),o=(0,c.useCallback)((e=>n((t=>t&~e))),[n]),s=(0,c.useCallback)((e=>n((t=>t^e))),[n]);return{addFlag:r,hasFlag:i,removeFlag:o,toggleFlag:s}}let Nf=(0,(c=o("85Hg2")).createContext)(null);function Df(){let e=(0,c.useContext)(Nf);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Df),e}return e}function Lf(){let[e,n]=(0,c.useState)([]);return[e.length>0?e.join(" "):void 0,(0,c.useMemo)((()=>function(e){let r=Qa((e=>(n((t=>[...t,e])),()=>n((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=(0,c.useMemo)((()=>({register:r,slot:e.slot,name:e.name,props:e.props})),[r,e.slot,e.name,e.props]);return t(c).createElement(Nf.Provider,{value:i},e.children)}),[n])]}let Bf=Va((function(e,t){let{passive:n=!1,...r}=e,i=Df(),o=`headlessui-label-${al()}`,s=$a(t);Ka((()=>i.register(o)),[o,i.register]);let a={ref:s,...i.props,id:o};return n&&("onClick"in a&&delete a.onClick,"onClick"in r&&delete r.onClick),Ua({ourProps:a,theirProps:r,slot:i.slot||{},defaultTag:"label",name:i.name||"Label"})}));function zf(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))Uf(n,Ff(t,r),i);return n}function Ff(e,t){return e?e+"["+t+"]":t}function Uf(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())Uf(e,Ff(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):"boolean"==typeof n?e.push([t,n?"1":"0"]):"string"==typeof n?e.push([t,n]):"number"==typeof n?e.push([t,`${n}`]):null==n?e.push([t,""]):zf(n,t,e)}function jf(e){var t;let n=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(n)for(let e of n.elements)if("INPUT"===e.tagName&&"submit"===e.type||"BUTTON"===e.tagName&&"submit"===e.type||"INPUT"===e.nodeName&&"image"===e.type)return void e.click()}c=o("85Hg2");function Hf(e,t,n){let[r,i]=(0,c.useState)(n),o=void 0!==e,s=(0,c.useRef)(o),a=(0,c.useRef)(!1),l=(0,c.useRef)(!1);return!o||s.current||a.current?!o&&s.current&&!l.current&&(l.current=!0,s.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(a.current=!0,s.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[o?e:r,Qa((e=>(o||i(e),null==t?void 0:t(e))))]}var Vf,Gf=((Vf=Gf||{})[Vf.RegisterOption=0]="RegisterOption",Vf[Vf.UnregisterOption=1]="UnregisterOption",Vf);let Wf={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:El(n,(e=>e.element.current))}},1(e,t){let n=e.options.slice(),r=e.options.findIndex((e=>e.id===t.id));return-1===r?e:(n.splice(r,1),{...e,options:n})}},qf=(0,c.createContext)(null);function Kf(e){let t=(0,c.useContext)(qf);if(null===t){let t=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Kf),t}return t}function Jf(e,t){return La(t.type,Wf,e,t)}qf.displayName="RadioGroupContext";let Qf=Va((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,...u}=e,d=Qa("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a),[p,h]=(0,c.useReducer)(Jf,{options:[]}),f=p.options,[m,g]=Lf(),[v,y]=Zl(),b=`headlessui-radiogroup-${al()}`,S=(0,c.useRef)(null),x=$a(S,n),[w,C]=Hf(r,s,i),A=(0,c.useMemo)((()=>f.find((e=>!e.propsRef.current.disabled))),[f]),E=(0,c.useMemo)((()=>f.some((e=>d(e.propsRef.current.value,w)))),[f,w]),M=Qa((e=>{var t;if(l||d(e,w))return!1;let n=null==(t=f.find((t=>d(t.propsRef.current.value,e))))?void 0:t.propsRef.current;return(null==n||!n.disabled)&&(null==C||C(e),!0)}));_d({container:S.current,accept:e=>"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let T=Qa((e=>{let t=S.current;if(!t)return;let n=pl(t),r=f.filter((e=>!1===e.propsRef.current.disabled)).map((e=>e.element.current));switch(e.key){case el.Enter:jf(e.currentTarget);break;case el.ArrowLeft:case el.ArrowUp:if(e.preventDefault(),e.stopPropagation(),Tl(r,gl.Previous|gl.WrapAround)===vl.Success){let e=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&M(e.propsRef.current.value)}break;case el.ArrowRight:case el.ArrowDown:if(e.preventDefault(),e.stopPropagation(),Tl(r,gl.Next|gl.WrapAround)===vl.Success){let e=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&M(e.propsRef.current.value)}break;case el.Space:{e.preventDefault(),e.stopPropagation();let t=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));t&&M(t.propsRef.current.value)}}})),_=Qa((e=>(h({type:0,...e}),()=>h({type:1,id:e.id})))),I=(0,c.useMemo)((()=>({registerOption:_,firstOption:A,containsCheckedOption:E,change:M,disabled:l,value:w,compare:d})),[_,A,E,M,l,w,d]),R={ref:x,id:b,role:"radiogroup","aria-labelledby":m,"aria-describedby":v,onKeyDown:T},P=(0,c.useMemo)((()=>({value:w})),[w]);return t(c).createElement(y,{name:"RadioGroup.Description"},t(c).createElement(g,{name:"RadioGroup.Label"},t(c).createElement(qf.Provider,{value:I},null!=o&&null!=w&&zf({[o]:w}).map((([e,n])=>t(c).createElement(cl,{features:ll.Hidden,...Ga({key:e,as:"input",type:"radio",checked:null!=n,hidden:!0,readOnly:!0,name:e,value:n})}))),Ua({ourProps:R,theirProps:u,slot:P,defaultTag:"div",name:"RadioGroup"}))))}));var Yf=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(Yf||{});let Xf=Va((function(e,n){let r=(0,c.useRef)(null),i=$a(r,n),o=`headlessui-radiogroup-option-${al()}`,[s,a]=Lf(),[l,u]=Zl(),{addFlag:d,removeFlag:p,hasFlag:h}=Of(1),{value:f,disabled:m=!1,...g}=e,v=(0,c.useRef)({value:f,disabled:m});Ka((()=>{v.current.value=f}),[f,v]),Ka((()=>{v.current.disabled=m}),[m,v]);let{registerOption:y,disabled:b,change:S,firstOption:x,containsCheckedOption:w,value:C,compare:A}=Kf("RadioGroup.Option");Ka((()=>y({id:o,element:r,propsRef:v})),[o,y,r,e]);let E=Qa((e=>{var t;if(tl(e.currentTarget))return e.preventDefault();!S(f)||(d(2),null==(t=r.current)||t.focus())})),M=Qa((e=>{if(tl(e.currentTarget))return e.preventDefault();d(2)})),T=Qa((()=>p(2))),_=(null==x?void 0:x.id)===o,I=b||m,R=A(C,f),P={ref:i,id:o,role:"radio","aria-checked":R?"true":"false","aria-labelledby":s,"aria-describedby":l,"aria-disabled":!!I||void 0,tabIndex:I?-1:R||!w&&_?0:-1,onClick:I?void 0:E,onFocus:I?void 0:M,onBlur:I?void 0:T},k=(0,c.useMemo)((()=>({checked:R,disabled:I,active:h(2)})),[R,I,h]);return t(c).createElement(u,{name:"RadioGroup.Description"},t(c).createElement(a,{name:"RadioGroup.Label"},Ua({ourProps:P,theirProps:g,slot:k,defaultTag:"div",name:"RadioGroup.Option"})))})),$f=Object.assign(Qf,{Option:Xf,Label:Bf,Description:ec});var Zf=({sendOnEnter:e,setSendOnEnter:n})=>{const{t:r}=ve();return(0,s.jsxs)(qd,{as:"div",className:"memori-send-on-enter-menu",children:[(0,s.jsx)(qd.Button,{className:t(ys)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button"),children:(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)("span",{style:{display:"block",width:"1rem",height:"1rem"},children:"…"})})}),(0,s.jsx)(qd.Items,{className:"memori-menu--overlay",children:(0,s.jsxs)($f,{value:e,onChange:n,children:[(0,s.jsx)($f.Option,{value:"keypress",className:"memori-menu--option",children:({checked:e})=>(0,s.jsx)(qd.Item,{children:(0,s.jsx)(Da,{className:"memori-menu--button",ghost:!0,outlined:e,icon:(0,s.jsx)("span",{className:"memori-menu--icon",children:e?"✓":""}),children:r("widget.sendOnKeypress")})})}),(0,s.jsx)($f.Option,{value:"click",className:"memori-menu--option",children:({checked:e})=>(0,s.jsx)(qd.Item,{children:(0,s.jsx)(Da,{className:"memori-menu--button",ghost:!0,outlined:e,icon:(0,s.jsx)("span",{className:"memori-menu--icon",children:e?"✓":""}),children:r("widget.sendOnClick")})})})]})})]})};c=o("85Hg2");var em=({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:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 0 0 0 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0 0 13.5-4.7L863.9 169a7.9 7.9 0 0 0-8.9-8.9zM416.6 562.3a8.03 8.03 0 0 0-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 0 0-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"})});var tm=({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:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 0 0 0 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 0 0 391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 0 0-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"})});var nm=({disabled:e=!1,value:n,onChange:r,onPressEnter:i,onFocus:o,onBlur:a})=>{const{t:l}=ve(),[u,d]=(0,c.useState)(!1);return(0,s.jsx)("div",{"data-testid":"chat-textarea",className:t(ys)("memori-chat-textarea",{"memori-chat-textarea--expanded":u,"memori-chat-textarea--disabled":e}),children:(0,s.jsxs)("div",{className:"memori-chat-textarea--inner",children:[(0,s.jsx)("textarea",{className:"memori-chat-textarea--input",disabled:e,value:n,onChange:e=>{r(e.target.value)},onKeyDownCapture:e=>{"Enter"===e.key&&!e.shiftKey&&i&&i(e)},onFocus:o,onBlur:a}),(0,s.jsx)("div",{className:"memori-chat-textarea--expand",children:(0,s.jsx)(Da,{className:t(ys)("memori-chat-textarea--expand-button"),onClick:()=>d(!u),padded:!1,ghost:!0,title:u?l("collapse")||"Collapse":l("expand")||"Expand",icon:u?(0,s.jsx)(tm,{}):(0,s.jsx)(em,{})})})]})})};var rm=({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:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})});c=o("85Hg2");var im=({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:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})});var om=({listening:e,stopAudio:n,startListening:r,stopListening:i})=>{const{t:o}=ve(),[a,l]=(0,c.useState)(),u=(0,c.useRef)(null),d=e=>{e.preventDefault(),l(o("write_and_speak.holdToSpeak")||"Hold to record"),u.current||(u.current=setTimeout((()=>{n(),l(o("write_and_speak.releaseToEndListening")||"Release to end listening"),r()}),300))},p=()=>{u.current&&(clearTimeout(u.current),u.current=null),i(),l(void 0)};return(0,c.useEffect)((()=>()=>p()),[]),(0,s.jsx)(Ed,{visible:!!a,content:(0,s.jsx)("span",{children:a||o("write_and_speak.pressAndHoldToSpeak")||"Press and hold to speak"}),align:"topLeft",className:"memori-mic-btn-tooltip",children:(0,s.jsx)(Da,{primary:!0,className:t(ys)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":e}),title:e?o("write_and_speak.micButtonPopoverListening")||"Listening":o("write_and_speak.micButtonPopover")||"Start listening",onMouseDown:d,onTouchStart:d,onMouseUp:p,onMouseLeave:p,onTouchEnd:p,shape:"circle",icon:(0,s.jsx)(im,{})})})};var sm=({dialogState:e,sendOnEnter:n="click",setSendOnEnter:r,userMessage:i="",onChangeUserMessage:o,sendMessage:a,onTextareaFocus:l,onTextareaBlur:c,onTextareaPressEnter:u,showMicrophone:d=!1,microphoneMode:p="HOLD_TO_TALK",listening:h=!1,stopAudio:f,startListening:m,stopListening:g})=>{const{t:v}=ve();return(0,s.jsxs)("fieldset",{id:"chat-fieldset",className:"memori-chat-inputs",disabled:"X2a"===(null==e?void 0:e.state)||"X3"===(null==e?void 0:e.state),children:[(0,s.jsx)(Zf,{sendOnEnter:n,setSendOnEnter:r}),(0,s.jsx)(nm,{value:i,onChange:o,onPressEnter:u,onFocus:l,onBlur:c,disabled:["R2","R3","R4","R5","G3","X3"].includes((null==e?void 0:e.state)||"")}),(0,s.jsx)(Da,{shape:"circle",primary:!!(null==i?void 0:i.length),disabled:!i||0===i.length,className:"memori-chat-inputs--send",onClick:()=>{a(i),f(),speechSynthesis.speak(new SpeechSynthesisUtterance(""))},title:v("send")||"Send",icon:(0,s.jsx)(rm,{})}),d&&"HOLD_TO_TALK"===p&&(0,s.jsx)(om,{listening:h,startListening:m,stopListening:()=>{g(),(null==i?void 0:i.length)&&a(i)},stopAudio:f}),d&&"CONTINUOUS"===p&&(0,s.jsx)(Da,{primary:!0,className:t(ys)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":h}),title:h?v("write_and_speak.micButtonPopoverListening")||"Listening":v("write_and_speak.micButtonPopover")||"Start listening",onClick:()=>{h?g():(f(),m())},shape:"circle",icon:(0,s.jsx)(im,{})})]})};c=o("85Hg2");const am={en:[{delayAfter:3,text:"Generating an accurate and fancy response..."},{delayAfter:3,text:"Generating a response that will blow your mind..."},{delayAfter:3,text:"Generating a response that will make you smile..."},{delayAfter:3,text:"Thinking of a response..."},{delayAfter:3,text:"Thinking of a response that will make you smile..."},{delayAfter:3,text:"Gathering my thoughts..."},{delayAfter:3,text:"Gathering my thoughts to give you a response..."}],it:[{delayAfter:3,text:"Sto generando una risposta accurata e fantasiosa..."},{delayAfter:3,text:"Sto generando una risposta che ti farà impazzire..."},{delayAfter:3,text:"Sto generando una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto pensando ad una risposta..."},{delayAfter:3,text:"Sto pensando ad una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri per darti una risposta..."}]},lm=(e=3)=>new Array(20*e).fill(" ").join("");var cm=({useDefaultSentences:e=!1,lang:t="en",sentence:n,sentences:r})=>{var i;const[o,a]=(0,c.useState)(0),[l,u]=(0,c.useState)((null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.length)?`${r[t][0].text.endsWith("...")||!r[t][0].text.length?r[t][0].text:`${r[t][0].text}...`}${lm(r[t][0].delayAfter)}`:n?`${n.endsWith("...")||!n.length?n:`${n}...`}${lm()}`:""),[d,p]=(0,c.useState)("");return(0,c.useEffect)((()=>{const i=setInterval((()=>{var i;const s=l[d.length];if(void 0!==s&&l.length>0)p((e=>e+s));else if((null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.length)&&o<r[t].length-1){const e=o+1,n=r[t][e];u(`${n.text.endsWith("...")||!n.text.length?n.text:`${n.text}...`}${lm(n.delayAfter)}`),p(""),a(e)}else if(!r&&!n&&e){const e=am[t][Math.floor(Math.random()*am[t].length)];u(`${e.text}${lm(e.delayAfter)}`),p("")}}),50);return()=>clearInterval(i)})),(0,s.jsx)("div",{className:"memori-chat--bubble",children:(0,s.jsxs)("div",{className:"memori-chat--bubble-typing",children:[(0,s.jsxs)("div",{id:"wave",children:[(0,s.jsx)("span",{className:"dot"}),(0,s.jsx)("span",{className:"dot"}),(0,s.jsx)("span",{className:"dot"})]}),l.length>0&&(0,s.jsx)("p",{children:d})]})})};var um=(0,c.memo)((({memori:e,tenant:n,sessionID:r,baseUrl:i,apiUrl:o,translateTo:a,memoriTyping:l,typingText:u,showTypingText:d=!1,history:p=[],authToken:h,dialogState:f,simulateUserPrompt:m,showDates:g=!1,showContextPerLine:v=!1,showAIicon:y=!0,selectReceiverTag:b,preview:S=!1,instruct:x=!1,showInputs:w=!0,showMicrophone:C=!1,microphoneMode:A="HOLD_TO_TALK",sendOnEnter:E,setSendOnEnter:M,attachmentsMenuOpen:T,setAttachmentsMenuOpen:_,userMessage:I="",onChangeUserMessage:R,sendMessage:P,listening:k,isPlayingAudio:O,stopAudio:N,startListening:D,stopListening:L,resetTranscript:B,customMediaRenderer:z,user:F,userAvatar:U,experts:j})=>{var H,V,G,W,q,K,J,Q;const Y=()=>{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)}),200)};(0,c.useEffect)((()=>{!S&&Y()}),[p,S]);return(0,s.jsxs)("div",{className:t(ys)("memori-chat--wrapper",{"memori-chat-wrapper--translate":a}),id:"chat-wrapper",lang:null==a?void 0:a.toUpperCase(),"data-memori-lang":null!==(W=null===(G=null===(V=null===(H=e.culture)||void 0===H?void 0:H.split("-"))||void 0===V?void 0:V[0])||void 0===G?void 0:G.toUpperCase())&&void 0!==W?W:"EN",children:[(0,s.jsx)("div",{className:t(ys)("memori-chat--history",{"memori-chat--history-touch":vd()}),children:(0,s.jsxs)("div",{className:t(ys)("memori-chat--content",{"memori-chat--content-touch":vd()}),children:[(0,s.jsx)("div",{className:t(ys)("memori-chat--cover"),style:{backgroundImage:`url("${wd({type:"cover",tenantID:null==n?void 0:n.id,resourceURI:e.coverURL,baseURL:i,apiURL:o})}"), url("${wd({type:"cover",tenantID:null==n?void 0:n.id,baseURL:i||"https://aisuru.com",apiURL:o})}")`}}),p.map(((l,u)=>{var d,h,b,S;return(0,s.jsxs)(t(c).Fragment,{children:[(0,s.jsx)(ep,{isFirst:0===u,message:l,memori:e,tenant:n,baseUrl:i,apiUrl:o,simulateUserPrompt:m,showAIicon:y,showFeedback:u===p.length-1&&!l.fromUser&&(null==f?void 0:f.acceptsFeedback),user:F,userAvatar:U,experts:j}),g&&!!l.timestamp&&(0,s.jsx)("small",{className:"memori-chat--timestamp "+(l.fromUser?"text-right":"text-left"),children:new Intl.DateTimeFormat("it",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(l.timestamp.endsWith("Z")?l.timestamp:`${l.timestamp}Z`))}),v&&!!Object.keys(null!==(d=l.contextVars)&&void 0!==d?d:{}).length&&(0,s.jsx)("div",{className:"memori-chat--context-vars",children:Object.keys(null!==(h=l.contextVars)&&void 0!==h?h:{}).map((e=>{var t,n,r;return"-"===(null===(t=l.contextVars)||void 0===t?void 0:t[e])?(0,s.jsx)("div",{className:"memori-chat--context-tag memori-chat--context-tag-canceled",children:(0,s.jsx)("span",{className:"memori-chat--context-tag-text",children:e})},e):"✔️"===(null===(n=l.contextVars)||void 0===n?void 0:n[e])?(0,s.jsx)("div",{className:"memori-chat--context-tag",children:(0,s.jsx)("span",{className:"memori-chat--context-tag-text",children:e})},e):(0,s.jsx)("div",{className:"memori-chat--context-tag",children:(0,s.jsxs)("span",{className:"memori-chat--context-tag-text",children:[e,": ",null===(r=l.contextVars)||void 0===r?void 0:r[e]]})},e)}))}),(0,s.jsx)(kf,{simulateUserPrompt:m,media:null===(b=null==l?void 0:l.media)||void 0===b?void 0:b.filter((e=>"text/html"!==e.mimeType&&"text/plain"!==e.mimeType)),links:null===(S=null==l?void 0:l.media)||void 0===S?void 0:S.filter((e=>"text/html"===e.mimeType)),sessionID:r,baseUrl:i,apiUrl:o,translateTo:a,customMediaRenderer:z})]},u)})),(null==f?void 0:f.hints)&&f.hints.length>0&&(0,s.jsx)(kf,{simulateUserPrompt:m,hints:f.translatedHints?f.translatedHints:f.hints.map((e=>({text:e,originalText:e})))}),!!l&&(0,s.jsx)(cm,{useDefaultSentences:d,lang:a?"it"===a.toLowerCase()?"it":"en":"it"===(null===(J=null===(K=null===(q=e.culture)||void 0===q?void 0:q.split("-"))||void 0===K?void 0:K[0])||void 0===J?void 0:J.toLowerCase())?"it":"en",sentence:u,sentences:e.enableBoardOfExperts?pp:void 0},u),(0,s.jsx)("div",{id:"end-messages-ref"})]})}),"X3"===(null==f?void 0:f.state)&&r&&(0,s.jsx)("div",{className:"memori-chat--known-tags",children:Object.keys(null!==(Q=f.knownTags)&&void 0!==Q?Q:{}).filter((t=>t!==e.giverTag)).map((e=>{var t;return(0,s.jsx)(Da,{icon:(0,s.jsx)("span",{className:"memori-chat--known-tag-icon",children:e}),className:"memori-chat--known-tag",onClick:()=>b(e),children:null===(t=f.knownTags)||void 0===t?void 0:t[e]},e)}))}),w&&(0,s.jsx)(sm,{userMessage:I,onChangeUserMessage:R,dialogState:f,instruct:x,authToken:h,sendMessage:P,microphoneMode:A,sendOnEnter:E,setSendOnEnter:M,attachmentsMenuOpen:T,setAttachmentsMenuOpen:_,onTextareaPressEnter:()=>{"keypress"===E&&(null==I?void 0:I.length)>0&&(L(),P(I),R(""),B())},onTextareaFocus:()=>{var e,t,n,r;L(),vd()&&window.innerWidth<=768&&(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t||t.add("chat-focused"),null===(r=null===(n=document.querySelector(".memori.memori-widget"))||void 0===n?void 0:n.classList)||void 0===r||r.add("chat-focused"),setTimeout((()=>{Y()}),300))},onTextareaBlur:()=>{var e,t,n,r,i;(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t?void 0:t.contains("chat-focused"))&&(null===(n=document.getElementById("chat-wrapper"))||void 0===n||n.classList.remove("chat-focused"),null===(i=null===(r=document.querySelector(".memori.memori-widget"))||void 0===r?void 0:r.classList)||void 0===i||i.remove("chat-focused"),Y())},startListening:D,stopListening:L,stopAudio:N,listening:k,isPlayingAudio:O,showMicrophone:C})]})}));c=o("85Hg2");var dm=({className:e,title:t})=>(0,s.jsxs)("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:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}),(0,s.jsx)("path",{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4c-1.3-3.2-4.3-5.4-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"})]});var pm=({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:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"})});var hm=({memoriName:e,blockedUntil:t,showGiverInfo:n=!1,showTitle:r=!1,marginLeft:i=!1})=>{const{t:o}=ve(),a=new Date(t);return a>new Date?(0,s.jsx)(Ed,{className:"blocked-memori-badge--tooltip",content:(0,s.jsxs)(s.Fragment,{children:[!n&&o("memoriBlockedAnon",{name:e,date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(a)}),n&&o("memoriBlockedUntil",{date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(a)}),n&&` ${o("memoriBlockedReasonExceedChats")}`,n&&(0,s.jsx)("br",{}),n&&`\n${o("memoriBlockedGiverHelper")}`]}),children:(0,s.jsxs)("div",{className:"blocked-memori-badge--wrapper",children:[(0,s.jsx)("div",{className:"blocked-memori-badge "+(i?" margin-left":""),children:(0,s.jsx)(pm,{className:"blocked-memori-badge--icon"})}),r&&(0,s.jsx)("span",{className:"blocked-memori-badge--title",children:o("memoriBlockedTitle")})]})}):null};var fm=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",width:"20",height:"16",viewBox:"0 0 640 512",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M211.2 96a64 64 0 10-128 0 64 64 0 10128 0zM32 256c0 17.7 14.3 32 32 32h85.6c10.1-39.4 38.6-71.5 75.8-86.6-9.7-6-21.2-9.4-33.4-9.4H96c-35.3 0-64 28.7-64 64zm461.6 32H576c17.7 0 32-14.3 32-32 0-35.3-28.7-64-64-64h-96c-11.7 0-22.7 3.1-32.1 8.6 38.1 14.8 67.4 47.3 77.7 87.4zm-102.4-61.6c-6.9-1.6-14.2-2.4-21.6-2.4h-96c-8.5 0-16.7 1.1-24.5 3.1-30.8 8.1-55.6 31.1-66.1 60.9-3.5 10-5.5 20.8-5.5 32 0 17.7 14.3 32 32 32h224c17.7 0 32-14.3 32-32 0-11.2-1.9-22-5.5-32-10.8-30.7-36.8-54.2-68.9-61.6zM563.2 96a64 64 0 10-128 0 64 64 0 10128 0zm-241.6 96a80 80 0 100-160 80 80 0 100 160zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32h576c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"})});var mm=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",width:"20",height:"20",viewBox:"0 0 48 48",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M30.106 48v-2.745a2.213 2.213 0 012.213-2.212h6.11a2.392 2.392 0 002.326-2.466v-3.223a1.834 1.834 0 01.459-1.145 2.912 2.912 0 00.712-1.926l-.007-.667a1.016 1.016 0 01.651-.952h1.067a1.363 1.363 0 001.051-.456 1.304 1.304 0 00.19-1.395 67.032 67.032 0 01-3.037-7.51 4.767 4.767 0 01-.217-1.507l-.002-4.994a14.513 14.513 0 00-.552-3.963l-.006-.022a13.959 13.959 0 00-3.137-5.702q-.479-.516-1.006-1.003a17.67 17.67 0 00-.677-.623A18.303 18.303 0 0024.194 1a19.617 19.617 0 00-12.539 4.489 17.555 17.555 0 00-3.945 21.69C9.945 31.507 11.694 38.622 12.14 46v2",strokeMiterlimit:10}),(0,s.jsx)("path",{d:"M27.917 12L31.417 12"}),(0,s.jsx)("path",{d:"M27.917 26L31.417 26"}),(0,s.jsx)("path",{d:"M29.667 12L29.667 26"}),(0,s.jsx)("path",{d:"M23.992 26L19.904 12 19.226 12 15.159 26"}),(0,s.jsx)("path",{d:"M16.854 21.133L22.276 21.133"})]});c=o("85Hg2");var gm=({forceStatus:e,provider:t})=>{var n;const{t:r}=ve(),[i,o]=(0,c.useState)(null!=e?e:"none"),a=(e=>{switch(e){case"DEFAULT":case"OpenAI":return{getStatus:async()=>{var e;const t=await fetch("https://status.openai.com/api/v2/summary.json");return null!==(e=(await t.json()).status.indicator)&&void 0!==e?e:"none"},statusPage:"https://status.openai.com/"};default:return{getStatus:async()=>"none",statusPage:""}}})(t);return(0,c.useEffect)((()=>{e||a.getStatus().then((e=>o(e)))}),[e,t]),"none"!==i?(0,s.jsx)(Ed,{className:"memori--completion-provider-status--tooltip",align:"topLeft",content:(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:r("completionProviderDown",{provider:null!=t?t:r("completionProviderFallbackName")})}),!!(null===(n=a.statusPage)||void 0===n?void 0:n.length)&&(0,s.jsx)("p",{children:(0,s.jsx)("a",{href:a.statusPage,rel:"noopener noreferrer",target:"_blank",children:r("completionProviderCheckStatusPage")})})]}),children:(0,s.jsx)(pm,{className:"memori--completion-provider-status--icon"})}):null};var vm=({memori:e,tenant:t,gamificationLevel:n,language:r,userLang:i,setUserLang:o,baseUrl:a,apiUrl:l,position:u,openPositionDrawer:d,integrationConfig:p,instruct:h=!1,clickedStart:f,onClickStart:m,initializeTTS:g,_TEST_forceProviderStatus:v,isUserLoggedIn:y=!1,user:b,showLogin:S=!1,setShowLoginDrawer:x})=>{var w,C;const{t:A,i18n:E}=ve(),[M,T]=(0,c.useState)(e.description),[_,I]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{var t,n,i,o,s,l;(null!==(n=null===(t=E.language)||void 0===t?void 0:t.toUpperCase())&&void 0!==n?n:"IT")!==(null!==(i=null==r?void 0:r.toUpperCase())&&void 0!==i?i:"IT")&&(null===(o=e.description)||void 0===o?void 0:o.length)&&lp(e.description,null!==(l=null===(s=E.language)||void 0===s?void 0:s.toUpperCase())&&void 0!==l?l:"IT",r,a).then((e=>{T(e.text)})).catch(console.error)}),[E.language,r,e.description,a]),(0,s.jsxs)("div",{className:"memori--start-panel",children:[(0,s.jsxs)("div",{className:"memori--cover",style:{backgroundImage:`url("${wd({type:"cover",tenantID:null==t?void 0:t.id,resourceURI:e.coverURL,baseURL:a,apiURL:l})}"), url("${wd({type:"cover",tenantID:null==t?void 0:t.id,baseURL:a,apiURL:l})}")`},children:[!!(null===(w=null==n?void 0:n.badge)||void 0===w?void 0:w.length)&&!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--gamification-badge",children:(0,s.jsx)(Ed,{align:"left",content:`${A("gamification.level")} ${n.badge}, ${n.points} ${A("gamification.points")}`,children:(0,s.jsx)("span",{"aria-label":`${A("gamification.level")} ${n.badge}, ${n.points} ${A("gamification.points")}`,children:n.badge})})}),!!e.enableCompletions&&!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--completions-enabled",children:(0,s.jsx)(Ed,{align:"left",content:A("completionsEnabled"),children:(0,s.jsx)("span",{"aria-label":A("completionsEnabled")||"Completions",children:(0,s.jsx)(Ad,{})})})}),!!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--board-of-experts",children:(0,s.jsx)(Ed,{align:"left",content:A("boardOfExperts"),children:(0,s.jsx)("span",{"aria-label":A("boardOfExperts")||"Board of Experts",children:(0,s.jsx)(fm,{})})})}),!!e.nsfw&&(0,s.jsx)("div",{className:"memori--nsfw",children:(0,s.jsx)(Ed,{align:"left",content:A("nsfw"),children:(0,s.jsx)("span",{title:A("nsfw")||"NSFW",children:"🔞"})})})]}),(0,s.jsxs)("picture",{className:"memori--avatar",children:[(0,s.jsx)("source",{src:null!==(C=e.avatarURL)&&void 0!==C?C:wd({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:a,apiURL:l})}),(0,s.jsx)("img",{alt:e.name,src:e.avatarURL&&e.avatarURL.length>0?wd({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:a,apiURL:l}):wd({type:"avatar",tenantID:null==t?void 0:t.id,baseURL:a,apiURL:l})})]}),(0,s.jsx)("h2",{className:"memori--title",children:e.name}),e.needsPosition&&!u&&(0,s.jsxs)("div",{className:"memori--needsPosition",children:[(0,s.jsx)("p",{children:A("write_and_speak.requirePosition")}),(0,s.jsx)(Da,{primary:!0,onClick:()=>d(),className:"memori--start-button",children:A("widget.position")})]}),(e.needsPosition&&u||!e.needsPosition)&&(0,s.jsxs)("div",{className:"memori--description",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"memori--description-text",children:M&&_?M:e.description}),M!==e.description&&(0,s.jsx)(Da,{ghost:!0,className:"memori--translation-toggle",icon:(0,s.jsx)(dm,{}),onClick:()=>{I((e=>!e))},children:A(_?"showOriginalText":"showTranslatedText")})]}),(null==p?void 0:p.multilanguage)&&!h&&(0,s.jsxs)("div",{className:"memori--language-chooser",children:[(0,s.jsx)("label",{id:"user-lang-pref-label",htmlFor:"user-lang-pref",children:A("write_and_speak.iWantToTalkToIn",{name:e.name})}),(0,s.jsx)("select",{id:"user-lang-pref",className:"memori-select--button",value:(null!=i?i:E.language).toUpperCase(),"aria-labelledby":"user-lang-pref-label",onChange:e=>{o(e.target.value)},children:cp.map((e=>(0,s.jsx)("option",{value:e.value,"aria-label":e.label,children:e.label},e.value)))})]}),(0,s.jsx)(Da,{primary:!0,disabled:!!e.blockedUntil&&!e.isGiver,loading:f,onClick:e=>{try{window.speechSynthesis.speak(new SpeechSynthesisUtterance(""))}catch(e){console.error(e)}g&&g(),m&&m()},className:"memori--start-button",children:A("write_and_speak."+(h?"instructButton":"tryMeButton"))}),(0,s.jsx)(gm,{provider:e.completionProvider,forceStatus:v}),(0,s.jsx)("p",{className:"memori--start-description",children:A(h?"write_and_speak.pageInstructExplanation":"write_and_speak.pageTryMeExplanation")}),!!e.blockedUntil&&(0,s.jsx)(hm,{memoriName:e.name,blockedUntil:e.blockedUntil,showGiverInfo:e.isGiver,showTitle:!0,marginLeft:!0}),!!e.enableDeepThought&&!h&&(0,s.jsxs)("div",{className:"memori--deep-thought-disclaimer",children:[(0,s.jsx)(Ed,{align:"left",content:A("deepThoughtHelper"),children:(0,s.jsx)(mm,{})}),(0,s.jsx)("h2",{children:y&&(null==b?void 0:b.pAndCUAccepted)?A("deepThoughtDisclaimerTitle"):A("deepThought")}),y&&!(null==b?void 0:b.pAndCUAccepted)&&(0,s.jsx)("p",{children:A("deepThoughtPreDisclaimerNotAllowed")}),!y&&(0,s.jsx)("p",{children:A("deepThoughtPreDisclaimerUnlogged")}),!y&&S&&(0,s.jsx)("p",{children:(0,s.jsx)(Da,{outlined:!0,padded:!1,onClick:()=>x(!0),children:"Login"})}),(0,s.jsx)("p",{className:"memori--deep-thought-disclaimer-text",children:A("deepThoughtDisclaimer")})]})]})]})},ym=(c=o("85Hg2"),c=o("85Hg2"),K=o("hcaHr"),c=o("85Hg2"),["forwardedRef"]);function bm(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 Sm(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?bm(Object(r),!0).forEach((function(n){t(J)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}class xm extends c.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,s.jsxs)("div",{style:{background:"rgba(255, 255, 255, 0.4)",color:"#000",padding:"2rem",borderRadius:"10px"},children:[(0,s.jsx)("h2",{children:this.props.t("error.generic")}),(0,s.jsx)(Da,{primary:!0,onClick:()=>this.setState({hasError:!1}),children:this.props.t("error.tryAgain")||"Try again"})]}):this.props.children}}var wm=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r){function i(i){var o=i.forwardedRef,s=t(Ip)(i,ym),a=ve(e,Sm(Sm({},s),{},{keyPrefix:n.keyPrefix})),l=t(K)(a,3),u=l[0],d=l[1],p=l[2],h=Sm(Sm({},s),{},{t:u,i18n:d,tReady:p});return n.withRef&&o?h.ref=o:!n.withRef&&o&&(h.forwardedRef=o),(0,c.createElement)(r,h)}i.displayName="withI18nextTranslation(".concat(he(r),")"),i.WrappedComponent=r;return n.withRef?(0,c.forwardRef)((function(e,t){return(0,c.createElement)(i,Object.assign({},e,{forwardedRef:t}))})):i}}(["common"])(xm),Cm=(c=o("85Hg2"),c=o("85Hg2"),{});e(Cm,"REVISION",(()=>Am)),e(Cm,"MOUSE",(()=>Em)),e(Cm,"TOUCH",(()=>Mm)),e(Cm,"CullFaceNone",(()=>Tm)),e(Cm,"CullFaceBack",(()=>_m)),e(Cm,"CullFaceFront",(()=>Im)),e(Cm,"CullFaceFrontBack",(()=>Rm)),e(Cm,"BasicShadowMap",(()=>Pm)),e(Cm,"PCFShadowMap",(()=>km)),e(Cm,"PCFSoftShadowMap",(()=>Om)),e(Cm,"VSMShadowMap",(()=>Nm)),e(Cm,"FrontSide",(()=>Dm)),e(Cm,"BackSide",(()=>Lm)),e(Cm,"DoubleSide",(()=>Bm)),e(Cm,"NoBlending",(()=>zm)),e(Cm,"NormalBlending",(()=>Fm)),e(Cm,"AdditiveBlending",(()=>Um)),e(Cm,"SubtractiveBlending",(()=>jm)),e(Cm,"MultiplyBlending",(()=>Hm)),e(Cm,"CustomBlending",(()=>Vm)),e(Cm,"AddEquation",(()=>Gm)),e(Cm,"SubtractEquation",(()=>Wm)),e(Cm,"ReverseSubtractEquation",(()=>qm)),e(Cm,"MinEquation",(()=>Km)),e(Cm,"MaxEquation",(()=>Jm)),e(Cm,"ZeroFactor",(()=>Qm)),e(Cm,"OneFactor",(()=>Ym)),e(Cm,"SrcColorFactor",(()=>Xm)),e(Cm,"OneMinusSrcColorFactor",(()=>$m)),e(Cm,"SrcAlphaFactor",(()=>Zm)),e(Cm,"OneMinusSrcAlphaFactor",(()=>eg)),e(Cm,"DstAlphaFactor",(()=>tg)),e(Cm,"OneMinusDstAlphaFactor",(()=>ng)),e(Cm,"DstColorFactor",(()=>rg)),e(Cm,"OneMinusDstColorFactor",(()=>ig)),e(Cm,"SrcAlphaSaturateFactor",(()=>og)),e(Cm,"NeverDepth",(()=>sg)),e(Cm,"AlwaysDepth",(()=>ag)),e(Cm,"LessDepth",(()=>lg)),e(Cm,"LessEqualDepth",(()=>cg)),e(Cm,"EqualDepth",(()=>ug)),e(Cm,"GreaterEqualDepth",(()=>dg)),e(Cm,"GreaterDepth",(()=>pg)),e(Cm,"NotEqualDepth",(()=>hg)),e(Cm,"MultiplyOperation",(()=>fg)),e(Cm,"MixOperation",(()=>mg)),e(Cm,"AddOperation",(()=>gg)),e(Cm,"NoToneMapping",(()=>vg)),e(Cm,"LinearToneMapping",(()=>yg)),e(Cm,"ReinhardToneMapping",(()=>bg)),e(Cm,"CineonToneMapping",(()=>Sg)),e(Cm,"ACESFilmicToneMapping",(()=>xg)),e(Cm,"CustomToneMapping",(()=>wg)),e(Cm,"UVMapping",(()=>Cg)),e(Cm,"CubeReflectionMapping",(()=>Ag)),e(Cm,"CubeRefractionMapping",(()=>Eg)),e(Cm,"EquirectangularReflectionMapping",(()=>Mg)),e(Cm,"EquirectangularRefractionMapping",(()=>Tg)),e(Cm,"CubeUVReflectionMapping",(()=>_g)),e(Cm,"RepeatWrapping",(()=>Ig)),e(Cm,"ClampToEdgeWrapping",(()=>Rg)),e(Cm,"MirroredRepeatWrapping",(()=>Pg)),e(Cm,"NearestFilter",(()=>kg)),e(Cm,"NearestMipmapNearestFilter",(()=>Og)),e(Cm,"NearestMipMapNearestFilter",(()=>Ng)),e(Cm,"NearestMipmapLinearFilter",(()=>Dg)),e(Cm,"NearestMipMapLinearFilter",(()=>Lg)),e(Cm,"LinearFilter",(()=>Bg)),e(Cm,"LinearMipmapNearestFilter",(()=>zg)),e(Cm,"LinearMipMapNearestFilter",(()=>Fg)),e(Cm,"LinearMipmapLinearFilter",(()=>Ug)),e(Cm,"LinearMipMapLinearFilter",(()=>jg)),e(Cm,"UnsignedByteType",(()=>Hg)),e(Cm,"ByteType",(()=>Vg)),e(Cm,"ShortType",(()=>Gg)),e(Cm,"UnsignedShortType",(()=>Wg)),e(Cm,"IntType",(()=>qg)),e(Cm,"UnsignedIntType",(()=>Kg)),e(Cm,"FloatType",(()=>Jg)),e(Cm,"HalfFloatType",(()=>Qg)),e(Cm,"UnsignedShort4444Type",(()=>Yg)),e(Cm,"UnsignedShort5551Type",(()=>Xg)),e(Cm,"UnsignedInt248Type",(()=>$g)),e(Cm,"AlphaFormat",(()=>Zg)),e(Cm,"RGBFormat",(()=>ev)),e(Cm,"RGBAFormat",(()=>tv)),e(Cm,"LuminanceFormat",(()=>nv)),e(Cm,"LuminanceAlphaFormat",(()=>rv)),e(Cm,"DepthFormat",(()=>iv)),e(Cm,"DepthStencilFormat",(()=>ov)),e(Cm,"RedFormat",(()=>sv)),e(Cm,"RedIntegerFormat",(()=>av)),e(Cm,"RGFormat",(()=>lv)),e(Cm,"RGIntegerFormat",(()=>cv)),e(Cm,"RGBAIntegerFormat",(()=>uv)),e(Cm,"RGB_S3TC_DXT1_Format",(()=>dv)),e(Cm,"RGBA_S3TC_DXT1_Format",(()=>pv)),e(Cm,"RGBA_S3TC_DXT3_Format",(()=>hv)),e(Cm,"RGBA_S3TC_DXT5_Format",(()=>fv)),e(Cm,"RGB_PVRTC_4BPPV1_Format",(()=>mv)),e(Cm,"RGB_PVRTC_2BPPV1_Format",(()=>gv)),e(Cm,"RGBA_PVRTC_4BPPV1_Format",(()=>vv)),e(Cm,"RGBA_PVRTC_2BPPV1_Format",(()=>yv)),e(Cm,"RGB_ETC1_Format",(()=>bv)),e(Cm,"RGB_ETC2_Format",(()=>Sv)),e(Cm,"RGBA_ETC2_EAC_Format",(()=>xv)),e(Cm,"RGBA_ASTC_4x4_Format",(()=>wv)),e(Cm,"RGBA_ASTC_5x4_Format",(()=>Cv)),e(Cm,"RGBA_ASTC_5x5_Format",(()=>Av)),e(Cm,"RGBA_ASTC_6x5_Format",(()=>Ev)),e(Cm,"RGBA_ASTC_6x6_Format",(()=>Mv)),e(Cm,"RGBA_ASTC_8x5_Format",(()=>Tv)),e(Cm,"RGBA_ASTC_8x6_Format",(()=>_v)),e(Cm,"RGBA_ASTC_8x8_Format",(()=>Iv)),e(Cm,"RGBA_ASTC_10x5_Format",(()=>Rv)),e(Cm,"RGBA_ASTC_10x6_Format",(()=>Pv)),e(Cm,"RGBA_ASTC_10x8_Format",(()=>kv)),e(Cm,"RGBA_ASTC_10x10_Format",(()=>Ov)),e(Cm,"RGBA_ASTC_12x10_Format",(()=>Nv)),e(Cm,"RGBA_ASTC_12x12_Format",(()=>Dv)),e(Cm,"RGBA_BPTC_Format",(()=>Lv)),e(Cm,"LoopOnce",(()=>Bv)),e(Cm,"LoopRepeat",(()=>zv)),e(Cm,"LoopPingPong",(()=>Fv)),e(Cm,"InterpolateDiscrete",(()=>Uv)),e(Cm,"InterpolateLinear",(()=>jv)),e(Cm,"InterpolateSmooth",(()=>Hv)),e(Cm,"ZeroCurvatureEnding",(()=>Vv)),e(Cm,"ZeroSlopeEnding",(()=>Gv)),e(Cm,"WrapAroundEnding",(()=>Wv)),e(Cm,"NormalAnimationBlendMode",(()=>qv)),e(Cm,"AdditiveAnimationBlendMode",(()=>Kv)),e(Cm,"TrianglesDrawMode",(()=>Jv)),e(Cm,"TriangleStripDrawMode",(()=>Qv)),e(Cm,"TriangleFanDrawMode",(()=>Yv)),e(Cm,"LinearEncoding",(()=>Xv)),e(Cm,"sRGBEncoding",(()=>$v)),e(Cm,"BasicDepthPacking",(()=>Zv)),e(Cm,"RGBADepthPacking",(()=>ey)),e(Cm,"TangentSpaceNormalMap",(()=>ty)),e(Cm,"ObjectSpaceNormalMap",(()=>ny)),e(Cm,"NoColorSpace",(()=>ry)),e(Cm,"SRGBColorSpace",(()=>iy)),e(Cm,"LinearSRGBColorSpace",(()=>oy)),e(Cm,"ZeroStencilOp",(()=>sy)),e(Cm,"KeepStencilOp",(()=>ay)),e(Cm,"ReplaceStencilOp",(()=>ly)),e(Cm,"IncrementStencilOp",(()=>cy)),e(Cm,"DecrementStencilOp",(()=>uy)),e(Cm,"IncrementWrapStencilOp",(()=>dy)),e(Cm,"DecrementWrapStencilOp",(()=>py)),e(Cm,"InvertStencilOp",(()=>hy)),e(Cm,"NeverStencilFunc",(()=>fy)),e(Cm,"LessStencilFunc",(()=>my)),e(Cm,"EqualStencilFunc",(()=>gy)),e(Cm,"LessEqualStencilFunc",(()=>vy)),e(Cm,"GreaterStencilFunc",(()=>yy)),e(Cm,"NotEqualStencilFunc",(()=>by)),e(Cm,"GreaterEqualStencilFunc",(()=>Sy)),e(Cm,"AlwaysStencilFunc",(()=>xy)),e(Cm,"StaticDrawUsage",(()=>wy)),e(Cm,"DynamicDrawUsage",(()=>Cy)),e(Cm,"StreamDrawUsage",(()=>Ay)),e(Cm,"StaticReadUsage",(()=>Ey)),e(Cm,"DynamicReadUsage",(()=>My)),e(Cm,"StreamReadUsage",(()=>Ty)),e(Cm,"StaticCopyUsage",(()=>_y)),e(Cm,"DynamicCopyUsage",(()=>Iy)),e(Cm,"StreamCopyUsage",(()=>Ry)),e(Cm,"GLSL1",(()=>Py)),e(Cm,"GLSL3",(()=>ky)),e(Cm,"_SRGBAFormat",(()=>Oy)),e(Cm,"EventDispatcher",(()=>Ny)),e(Cm,"MathUtils",(()=>Jy)),e(Cm,"Vector2",(()=>Qy)),e(Cm,"Matrix3",(()=>Yy)),e(Cm,"ColorManagement",(()=>ib)),e(Cm,"Color",(()=>db)),e(Cm,"ImageUtils",(()=>hb)),e(Cm,"Source",(()=>fb)),e(Cm,"Texture",(()=>vb)),e(Cm,"Vector4",(()=>yb)),e(Cm,"WebGLRenderTarget",(()=>bb)),e(Cm,"DataArrayTexture",(()=>Sb)),e(Cm,"WebGLArrayRenderTarget",(()=>xb)),e(Cm,"Data3DTexture",(()=>wb)),e(Cm,"WebGL3DRenderTarget",(()=>Cb)),e(Cm,"WebGLMultipleRenderTargets",(()=>Ab)),e(Cm,"Quaternion",(()=>Eb)),e(Cm,"Vector3",(()=>Mb)),e(Cm,"Box3",(()=>Ib)),e(Cm,"Sphere",(()=>Jb)),e(Cm,"Ray",(()=>nS)),e(Cm,"Matrix4",(()=>rS)),e(Cm,"Euler",(()=>hS)),e(Cm,"Layers",(()=>fS)),e(Cm,"Object3D",(()=>_S)),e(Cm,"Triangle",(()=>FS)),e(Cm,"Material",(()=>jS)),e(Cm,"MeshBasicMaterial",(()=>HS)),e(Cm,"BufferAttribute",(()=>WS)),e(Cm,"Int8BufferAttribute",(()=>qS)),e(Cm,"Uint8BufferAttribute",(()=>KS)),e(Cm,"Uint8ClampedBufferAttribute",(()=>JS)),e(Cm,"Int16BufferAttribute",(()=>QS)),e(Cm,"Uint16BufferAttribute",(()=>YS)),e(Cm,"Int32BufferAttribute",(()=>XS)),e(Cm,"Uint32BufferAttribute",(()=>$S)),e(Cm,"Float16BufferAttribute",(()=>ZS)),e(Cm,"Float32BufferAttribute",(()=>ex)),e(Cm,"Float64BufferAttribute",(()=>tx)),e(Cm,"BufferGeometry",(()=>cx)),e(Cm,"Mesh",(()=>Tx)),e(Cm,"BoxGeometry",(()=>Ix)),e(Cm,"UniformsUtils",(()=>kx)),e(Cm,"ShaderMaterial",(()=>Ox)),e(Cm,"Camera",(()=>Nx)),e(Cm,"PerspectiveCamera",(()=>Dx)),e(Cm,"CubeCamera",(()=>Bx)),e(Cm,"CubeTexture",(()=>zx)),e(Cm,"WebGLCubeRenderTarget",(()=>Fx)),e(Cm,"Plane",(()=>Vx)),e(Cm,"Frustum",(()=>qx)),e(Cm,"PlaneGeometry",(()=>Qx)),e(Cm,"ShaderChunk",(()=>Yx)),e(Cm,"UniformsLib",(()=>Xx)),e(Cm,"ShaderLib",(()=>$x)),e(Cm,"OrthographicCamera",(()=>ow)),e(Cm,"PMREMGenerator",(()=>fw)),e(Cm,"MeshDepthMaterial",(()=>uA)),e(Cm,"MeshDistanceMaterial",(()=>dA)),e(Cm,"WebGLUtils",(()=>mA)),e(Cm,"ArrayCamera",(()=>gA)),e(Cm,"Group",(()=>vA)),e(Cm,"DepthTexture",(()=>SA)),e(Cm,"WebGLRenderer",(()=>AA)),e(Cm,"WebGL1Renderer",(()=>EA)),e(Cm,"FogExp2",(()=>MA)),e(Cm,"Fog",(()=>TA)),e(Cm,"Scene",(()=>_A)),e(Cm,"InterleavedBuffer",(()=>IA)),e(Cm,"InterleavedBufferAttribute",(()=>PA)),e(Cm,"SpriteMaterial",(()=>kA)),e(Cm,"Sprite",(()=>qA)),e(Cm,"LOD",(()=>YA)),e(Cm,"SkinnedMesh",(()=>nE)),e(Cm,"Bone",(()=>rE)),e(Cm,"DataTexture",(()=>iE)),e(Cm,"Skeleton",(()=>aE)),e(Cm,"InstancedBufferAttribute",(()=>lE)),e(Cm,"InstancedMesh",(()=>hE)),e(Cm,"LineBasicMaterial",(()=>fE)),e(Cm,"Line",(()=>SE)),e(Cm,"LineSegments",(()=>CE)),e(Cm,"LineLoop",(()=>AE)),e(Cm,"PointsMaterial",(()=>EE)),e(Cm,"Points",(()=>RE)),e(Cm,"VideoTexture",(()=>kE)),e(Cm,"FramebufferTexture",(()=>OE)),e(Cm,"CompressedTexture",(()=>NE)),e(Cm,"CanvasTexture",(()=>DE)),e(Cm,"Curve",(()=>LE)),e(Cm,"EllipseCurve",(()=>BE)),e(Cm,"ArcCurve",(()=>zE)),e(Cm,"CatmullRomCurve3",(()=>GE)),e(Cm,"CubicBezierCurve",(()=>JE)),e(Cm,"CubicBezierCurve3",(()=>QE)),e(Cm,"LineCurve",(()=>YE)),e(Cm,"LineCurve3",(()=>XE)),e(Cm,"QuadraticBezierCurve",(()=>$E)),e(Cm,"QuadraticBezierCurve3",(()=>ZE)),e(Cm,"SplineCurve",(()=>eM)),e(Cm,"CurvePath",(()=>nM)),e(Cm,"Path",(()=>rM)),e(Cm,"LatheGeometry",(()=>iM)),e(Cm,"CapsuleGeometry",(()=>oM)),e(Cm,"CircleGeometry",(()=>sM)),e(Cm,"CylinderGeometry",(()=>aM)),e(Cm,"ConeGeometry",(()=>lM)),e(Cm,"PolyhedronGeometry",(()=>cM)),e(Cm,"DodecahedronGeometry",(()=>uM)),e(Cm,"EdgesGeometry",(()=>mM)),e(Cm,"Shape",(()=>gM)),e(Cm,"ShapeUtils",(()=>HM)),e(Cm,"ExtrudeGeometry",(()=>WM)),e(Cm,"IcosahedronGeometry",(()=>KM)),e(Cm,"OctahedronGeometry",(()=>JM)),e(Cm,"RingGeometry",(()=>QM)),e(Cm,"ShapeGeometry",(()=>YM)),e(Cm,"SphereGeometry",(()=>XM)),e(Cm,"TetrahedronGeometry",(()=>$M)),e(Cm,"TorusGeometry",(()=>ZM)),e(Cm,"TorusKnotGeometry",(()=>eT)),e(Cm,"TubeGeometry",(()=>tT)),e(Cm,"WireframeGeometry",(()=>nT)),e(Cm,"ShadowMaterial",(()=>oT)),e(Cm,"RawShaderMaterial",(()=>sT)),e(Cm,"MeshStandardMaterial",(()=>aT)),e(Cm,"MeshPhysicalMaterial",(()=>lT)),e(Cm,"MeshPhongMaterial",(()=>cT)),e(Cm,"MeshToonMaterial",(()=>uT)),e(Cm,"MeshNormalMaterial",(()=>dT)),e(Cm,"MeshLambertMaterial",(()=>pT)),e(Cm,"MeshMatcapMaterial",(()=>hT)),e(Cm,"LineDashedMaterial",(()=>fT)),e(Cm,"AnimationUtils",(()=>xT)),e(Cm,"Interpolant",(()=>wT)),e(Cm,"CubicInterpolant",(()=>CT)),e(Cm,"LinearInterpolant",(()=>AT)),e(Cm,"DiscreteInterpolant",(()=>ET)),e(Cm,"KeyframeTrack",(()=>MT)),e(Cm,"BooleanKeyframeTrack",(()=>TT)),e(Cm,"ColorKeyframeTrack",(()=>_T)),e(Cm,"NumberKeyframeTrack",(()=>IT)),e(Cm,"QuaternionLinearInterpolant",(()=>RT)),e(Cm,"QuaternionKeyframeTrack",(()=>PT)),e(Cm,"StringKeyframeTrack",(()=>kT)),e(Cm,"VectorKeyframeTrack",(()=>OT)),e(Cm,"AnimationClip",(()=>NT)),e(Cm,"Cache",(()=>LT)),e(Cm,"LoadingManager",(()=>BT)),e(Cm,"DefaultLoadingManager",(()=>zT)),e(Cm,"Loader",(()=>FT)),e(Cm,"FileLoader",(()=>HT)),e(Cm,"AnimationLoader",(()=>VT)),e(Cm,"CompressedTextureLoader",(()=>GT)),e(Cm,"ImageLoader",(()=>WT)),e(Cm,"CubeTextureLoader",(()=>qT)),e(Cm,"DataTextureLoader",(()=>KT)),e(Cm,"TextureLoader",(()=>JT)),e(Cm,"Light",(()=>QT)),e(Cm,"HemisphereLight",(()=>YT)),e(Cm,"SpotLight",(()=>n_)),e(Cm,"PointLight",(()=>a_)),e(Cm,"DirectionalLight",(()=>c_)),e(Cm,"AmbientLight",(()=>u_)),e(Cm,"RectAreaLight",(()=>d_)),e(Cm,"SphericalHarmonics3",(()=>p_)),e(Cm,"LightProbe",(()=>h_)),e(Cm,"MaterialLoader",(()=>f_)),e(Cm,"LoaderUtils",(()=>m_)),e(Cm,"InstancedBufferGeometry",(()=>g_)),e(Cm,"BufferGeometryLoader",(()=>v_)),e(Cm,"ObjectLoader",(()=>y_)),e(Cm,"ImageBitmapLoader",(()=>w_)),e(Cm,"AudioContext",(()=>A_)),e(Cm,"AudioLoader",(()=>E_)),e(Cm,"HemisphereLightProbe",(()=>M_)),e(Cm,"AmbientLightProbe",(()=>T_)),e(Cm,"StereoCamera",(()=>P_)),e(Cm,"Clock",(()=>k_)),e(Cm,"AudioListener",(()=>z_)),e(Cm,"Audio",(()=>F_)),e(Cm,"PositionalAudio",(()=>G_)),e(Cm,"AudioAnalyser",(()=>W_)),e(Cm,"PropertyMixer",(()=>q_)),e(Cm,"PropertyBinding",(()=>Z_)),e(Cm,"AnimationObjectGroup",(()=>eI)),e(Cm,"AnimationMixer",(()=>rI)),e(Cm,"Uniform",(()=>iI)),e(Cm,"UniformsGroup",(()=>sI)),e(Cm,"InstancedInterleavedBuffer",(()=>aI)),e(Cm,"GLBufferAttribute",(()=>lI)),e(Cm,"Raycaster",(()=>cI)),e(Cm,"Spherical",(()=>pI)),e(Cm,"Cylindrical",(()=>hI)),e(Cm,"Box2",(()=>mI)),e(Cm,"Line3",(()=>yI)),e(Cm,"SpotLightHelper",(()=>SI)),e(Cm,"SkeletonHelper",(()=>AI)),e(Cm,"PointLightHelper",(()=>MI)),e(Cm,"HemisphereLightHelper",(()=>RI)),e(Cm,"GridHelper",(()=>PI)),e(Cm,"PolarGridHelper",(()=>kI)),e(Cm,"DirectionalLightHelper",(()=>LI)),e(Cm,"CameraHelper",(()=>FI)),e(Cm,"BoxHelper",(()=>HI)),e(Cm,"Box3Helper",(()=>VI)),e(Cm,"PlaneHelper",(()=>GI)),e(Cm,"ArrowHelper",(()=>JI)),e(Cm,"AxesHelper",(()=>QI)),e(Cm,"ShapePath",(()=>YI)),e(Cm,"DataUtils",(()=>ZI)),e(Cm,"ImmediateRenderObject",(()=>eR)),e(Cm,"WebGLMultisampleRenderTarget",(()=>tR)),e(Cm,"DataTexture2DArray",(()=>nR)),e(Cm,"DataTexture3D",(()=>rR)),e(Cm,"BoxBufferGeometry",(()=>iR)),e(Cm,"CapsuleBufferGeometry",(()=>oR)),e(Cm,"CircleBufferGeometry",(()=>sR)),e(Cm,"ConeBufferGeometry",(()=>aR)),e(Cm,"CylinderBufferGeometry",(()=>lR)),e(Cm,"DodecahedronBufferGeometry",(()=>cR)),e(Cm,"ExtrudeBufferGeometry",(()=>uR)),e(Cm,"IcosahedronBufferGeometry",(()=>dR)),e(Cm,"LatheBufferGeometry",(()=>pR)),e(Cm,"OctahedronBufferGeometry",(()=>hR)),e(Cm,"PlaneBufferGeometry",(()=>fR)),e(Cm,"PolyhedronBufferGeometry",(()=>mR)),e(Cm,"RingBufferGeometry",(()=>gR)),e(Cm,"ShapeBufferGeometry",(()=>vR)),e(Cm,"SphereBufferGeometry",(()=>yR)),e(Cm,"TetrahedronBufferGeometry",(()=>bR)),e(Cm,"TorusBufferGeometry",(()=>SR)),e(Cm,"TorusKnotBufferGeometry",(()=>xR)),e(Cm,"TubeBufferGeometry",(()=>wR));
|
|
235
|
+
/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */Zd=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:i}=Object;let{freeze:o,seal:s,create:a}=Object,{apply:l,construct:c}="undefined"!=typeof Reflect&&Reflect;o||(o=function(e){return e}),s||(s=function(e){return e}),l||(l=function(e,t,n){return e.apply(t,n)}),c||(c=function(e,t){return new e(...t)});const u=x(Array.prototype.forEach),d=x(Array.prototype.pop),p=x(Array.prototype.push),h=x(String.prototype.toLowerCase),f=x(String.prototype.toString),m=x(String.prototype.match),g=x(String.prototype.replace),v=x(String.prototype.indexOf),y=x(String.prototype.trim),b=x(RegExp.prototype.test),S=w(TypeError);function x(e){return 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];return l(e,t,r)}}function w(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return c(e,n)}}function C(e,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let o=r.length;for(;o--;){let t=r[o];if("string"==typeof t){const e=i(t);e!==t&&(n(r)||(r[o]=e),t=e)}e[t]=!0}return e}function A(t){const n=a(null);for(const[r,o]of e(t))void 0!==i(t,r)&&(n[r]=o);return n}function E(e,t){for(;null!==e;){const n=i(e,t);if(n){if(n.get)return x(n.get);if("function"==typeof n.value)return x(n.value)}e=r(e)}function n(e){return console.warn("fallback value for",e),null}return n}const M=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),T=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),_=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=o(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),R=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),P=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),k=o(["#text"]),O=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),N=o(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),D=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),L=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),B=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z=s(/<%[\w\W]*|[\w\W]*%>/gm),F=s(/\${[\w\W]*}/gm),U=s(/^data-[\-\w.\u00B7-\uFFFF]/),j=s(/^aria-[\-\w]+$/),H=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V=s(/^(?:\w+script|data):/i),G=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W=s(/^html$/i);var q=Object.freeze({__proto__:null,MUSTACHE_EXPR:B,ERB_EXPR:z,TMPLIT_EXPR:F,DATA_ATTR:U,ARIA_ATTR:j,IS_ALLOWED_URI:H,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:G,DOCTYPE_NAME:W});const K=function(){return"undefined"==typeof window?null:window},J=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function Q(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:K();const n=e=>Q(e);if(n.version="3.0.6",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const i=r,s=i.currentScript,{DocumentFragment:l,HTMLTemplateElement:c,Node:x,Element:w,NodeFilter:B,NamedNodeMap:z=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:F,DOMParser:U,trustedTypes:j}=t,V=w.prototype,G=E(V,"cloneNode"),Y=E(V,"nextSibling"),X=E(V,"childNodes"),$=E(V,"parentNode");if("function"==typeof c){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let Z,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:re,getElementsByTagName:ie}=r,{importNode:oe}=i;let se={};n.isSupported="function"==typeof e&&"function"==typeof $&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:ae,ERB_EXPR:le,TMPLIT_EXPR:ce,DATA_ATTR:ue,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:pe,ATTR_WHITESPACE:he}=q;let{IS_ALLOWED_URI:fe}=q,me=null;const ge=C({},[...M,...T,..._,...R,...k]);let ve=null;const ye=C({},[...O,...N,...D,...L]);let be=Object.seal(a(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,xe=null,we=!0,Ce=!0,Ae=!1,Ee=!0,Me=!1,Te=!1,_e=!1,Ie=!1,Re=!1,Pe=!1,ke=!1,Oe=!0,Ne=!1;const De="user-content-";let Le=!0,Be=!1,ze={},Fe=null;const Ue=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let je=null;const He=C({},["audio","video","img","source","image","track"]);let Ve=null;const Ge=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",Ke="http://www.w3.org/1999/xhtml";let Je=Ke,Qe=!1,Ye=null;const Xe=C({},[We,qe,Ke],f);let $e=null;const Ze=["application/xhtml+xml","text/html"],et="text/html";let tt=null,nt=null;const rt=r.createElement("form"),it=function(e){return e instanceof RegExp||e instanceof Function},ot=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!nt||nt!==e){if(e&&"object"==typeof e||(e={}),e=A(e),$e=$e=-1===Ze.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===$e?f:h,me="ALLOWED_TAGS"in e?C({},e.ALLOWED_TAGS,tt):ge,ve="ALLOWED_ATTR"in e?C({},e.ALLOWED_ATTR,tt):ye,Ye="ALLOWED_NAMESPACES"in e?C({},e.ALLOWED_NAMESPACES,f):Xe,Ve="ADD_URI_SAFE_ATTR"in e?C(A(Ge),e.ADD_URI_SAFE_ATTR,tt):Ge,je="ADD_DATA_URI_TAGS"in e?C(A(He),e.ADD_DATA_URI_TAGS,tt):He,Fe="FORBID_CONTENTS"in e?C({},e.FORBID_CONTENTS,tt):Ue,Se="FORBID_TAGS"in e?C({},e.FORBID_TAGS,tt):{},xe="FORBID_ATTR"in e?C({},e.FORBID_ATTR,tt):{},ze="USE_PROFILES"in e&&e.USE_PROFILES,we=!1!==e.ALLOW_ARIA_ATTR,Ce=!1!==e.ALLOW_DATA_ATTR,Ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ee=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Me=e.SAFE_FOR_TEMPLATES||!1,Te=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,ke=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,Oe=!1!==e.SANITIZE_DOM,Ne=e.SANITIZE_NAMED_PROPS||!1,Le=!1!==e.KEEP_CONTENT,Be=e.IN_PLACE||!1,fe=e.ALLOWED_URI_REGEXP||H,Je=e.NAMESPACE||Ke,be=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(be.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Me&&(Ce=!1),Pe&&(Re=!0),ze&&(me=C({},[...k]),ve=[],!0===ze.html&&(C(me,M),C(ve,O)),!0===ze.svg&&(C(me,T),C(ve,N),C(ve,L)),!0===ze.svgFilters&&(C(me,_),C(ve,N),C(ve,L)),!0===ze.mathMl&&(C(me,R),C(ve,D),C(ve,L))),e.ADD_TAGS&&(me===ge&&(me=A(me)),C(me,e.ADD_TAGS,tt)),e.ADD_ATTR&&(ve===ye&&(ve=A(ve)),C(ve,e.ADD_ATTR,tt)),e.ADD_URI_SAFE_ATTR&&C(Ve,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(Fe===Ue&&(Fe=A(Fe)),C(Fe,e.FORBID_CONTENTS,tt)),Le&&(me["#text"]=!0),Te&&C(me,["html","head","body"]),me.table&&(C(me,["tbody"]),delete Se.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Z=e.TRUSTED_TYPES_POLICY,ee=Z.createHTML("")}else void 0===Z&&(Z=J(j,s)),null!==Z&&"string"==typeof ee&&(ee=Z.createHTML(""));o&&o(e),nt=e}},st=C({},["mi","mo","mn","ms","mtext"]),at=C({},["foreignobject","desc","title","annotation-xml"]),lt=C({},["title","style","font","a","script"]),ct=C({},T);C(ct,_),C(ct,I);const ut=C({},R);C(ut,P);const dt=function(e){let t=$(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});const n=h(e.tagName),r=h(t.tagName);return!!Ye[e.namespaceURI]&&(e.namespaceURI===qe?t.namespaceURI===Ke?"svg"===n:t.namespaceURI===We?"svg"===n&&("annotation-xml"===r||st[r]):Boolean(ct[n]):e.namespaceURI===We?t.namespaceURI===Ke?"math"===n:t.namespaceURI===qe?"math"===n&&at[r]:Boolean(ut[n]):e.namespaceURI===Ke?!(t.namespaceURI===qe&&!at[r])&&!(t.namespaceURI===We&&!st[r])&&!ut[n]&&(lt[n]||!ct[n]):!("application/xhtml+xml"!==$e||!Ye[e.namespaceURI]))},pt=function(e){p(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},ht=function(e,t){try{p(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ve[e])if(Re||Pe)try{pt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ft=function(e){let t=null,n=null;if(Ie)e="<remove></remove>"+e;else{const t=m(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===$e&&Je===Ke&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=Z?Z.createHTML(e):e;if(Je===Ke)try{t=(new U).parseFromString(i,$e)}catch(e){}if(!t||!t.documentElement){t=te.createDocument(Je,"template",null);try{t.documentElement.innerHTML=Qe?ee:i}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),Je===Ke?ie.call(t,Te?"html":"body")[0]:Te?t.documentElement:o},mt=function(e){return ne.call(e.ownerDocument||e,e,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT,null)},gt=function(e){return e instanceof F&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof z)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},vt=function(e){return"function"==typeof x&&e instanceof x},yt=function(e,t,r){se[e]&&u(se[e],(e=>{e.call(n,t,r,nt)}))},bt=function(e){let t=null;if(yt("beforeSanitizeElements",e,null),gt(e))return pt(e),!0;const r=tt(e.nodeName);if(yt("uponSanitizeElement",e,{tagName:r,allowedTags:me}),e.hasChildNodes()&&!vt(e.firstElementChild)&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return pt(e),!0;if(!me[r]||Se[r]){if(!Se[r]&&xt(r)){if(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,r))return!1;if(be.tagNameCheck instanceof Function&&be.tagNameCheck(r))return!1}if(Le&&!Fe[r]){const t=$(e)||e.parentNode,n=X(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(G(n[r],!0),Y(e))}return pt(e),!0}return e instanceof w&&!dt(e)?(pt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(Me&&3===e.nodeType&&(t=e.textContent,u([ae,le,ce],(e=>{t=g(t,e," ")})),e.textContent!==t&&(p(n.removed,{element:e.cloneNode()}),e.textContent=t)),yt("afterSanitizeElements",e,null),!1):(pt(e),!0)},St=function(e,t,n){if(Oe&&("id"===t||"name"===t)&&(n in r||n in rt))return!1;if(Ce&&!xe[t]&&b(ue,t));else if(we&&b(de,t));else if(!ve[t]||xe[t]){if(!(xt(e)&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,e)||be.tagNameCheck instanceof Function&&be.tagNameCheck(e))&&(be.attributeNameCheck instanceof RegExp&&b(be.attributeNameCheck,t)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(t))||"is"===t&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,n)||be.tagNameCheck instanceof Function&&be.tagNameCheck(n))))return!1}else if(Ve[t]);else if(b(fe,g(n,he,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!je[e])if(Ae&&!b(pe,g(n,he,"")));else if(n)return!1;return!0},xt=function(e){return e.indexOf("-")>0},wt=function(e){yt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ve};let i=t.length;for(;i--;){const o=t[i],{name:s,namespaceURI:a,value:l}=o,c=tt(s);let p="value"===s?l:y(l);if(r.attrName=c,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,yt("uponSanitizeAttribute",e,r),p=r.attrValue,r.forceKeepAttr)continue;if(ht(s,e),!r.keepAttr)continue;if(!Ee&&b(/\/>/i,p)){ht(s,e);continue}Me&&u([ae,le,ce],(e=>{p=g(p,e," ")}));const h=tt(e.nodeName);if(St(h,c,p)){if(!Ne||"id"!==c&&"name"!==c||(ht(s,e),p=De+p),Z&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(a);else switch(j.getAttributeType(h,c)){case"TrustedHTML":p=Z.createHTML(p);break;case"TrustedScriptURL":p=Z.createScriptURL(p)}try{a?e.setAttributeNS(a,s,p):e.setAttribute(s,p),d(n.removed)}catch(e){}}}yt("afterSanitizeAttributes",e,null)},Ct=function e(t){let n=null;const r=mt(t);for(yt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)yt("uponSanitizeShadowNode",n,null),bt(n)||(n.content instanceof l&&e(n.content),wt(n));yt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,s=null,a=null;if(Qe=!e,Qe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!vt(e)){if("function"!=typeof e.toString)throw S("toString is not a function");if("string"!=typeof(e=e.toString()))throw S("dirty is not a string, aborting")}if(!n.isSupported)return e;if(_e||ot(t),n.removed=[],"string"==typeof e&&(Be=!1),Be){if(e.nodeName){const t=tt(e.nodeName);if(!me[t]||Se[t])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof x)r=ft("\x3c!----\x3e"),o=r.ownerDocument.importNode(e,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o);else{if(!Re&&!Me&&!Te&&-1===e.indexOf("<"))return Z&&ke?Z.createHTML(e):e;if(r=ft(e),!r)return Re?null:ke?ee:""}r&&Ie&&pt(r.firstChild);const c=mt(Be?e:r);for(;s=c.nextNode();)bt(s)||(s.content instanceof l&&Ct(s.content),wt(s));if(Be)return e;if(Re){if(Pe)for(a=re.call(r.ownerDocument);r.firstChild;)a.appendChild(r.firstChild);else a=r;return(ve.shadowroot||ve.shadowrootmode)&&(a=oe.call(i,a,!0)),a}let d=Te?r.outerHTML:r.innerHTML;return Te&&me["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&b(W,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Me&&u([ae,le,ce],(e=>{d=g(d,e," ")})),Z&&ke?Z.createHTML(d):d},n.setConfig=function(){ot(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),_e=!0},n.clearConfig=function(){nt=null,_e=!1},n.isValidAttribute=function(e,t,n){nt||ot({});const r=tt(e),i=tt(t);return St(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&(se[e]=se[e]||[],p(se[e],t))},n.removeHook=function(e){if(se[e])return d(se[e])},n.removeHooks=function(e){se[e]&&(se[e]=[])},n.removeAllHooks=function(){se={}},n}return Q()}(),$d.marked.use({async:!1,gfm:!0,pedantic:!0,renderer:{link(e,t,n){const r=xd(e);if(null===r)return n;let i='<a href="'+(e=r)+'"';return t&&(i+=' title="'+t+'"'),i+=' target="_blank" rel="noopener noreferrer">'+n+"</a>",i}}});var ep=({message:e,memori:n,tenant:r,baseUrl:i,apiUrl:o,showFeedback:a,simulateUserPrompt:l,showAIicon:c=!0,isFirst:u=!1,user:d,userAvatar:p,experts:h})=>{var f,m,g,v,y,b,S;const{t:x}=ve(),w=(0,Zd.sanitize)($d.marked.parse(null!==(f=e.translatedText)&&void 0!==f?f:e.text),{ADD_ATTR:["target"]});return(0,s.jsxs)(s.Fragment,{children:[(e.initial||u)&&(0,s.jsx)("div",{className:"memori-chat--bubble-initial"}),(0,s.jsxs)(Wc,{show:!0,appear:!0,as:"div",className:t(ys)("memori-chat--bubble-container",{"memori-chat--bubble-from-user":!!e.fromUser,"memori-chat--with-addon":e.generatedByAI&&c||a&&l}),children:[!e.fromUser&&(0,s.jsx)(Wc.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),title:(null===(m=e.emitter)||void 0===m?void 0:m.length)&&n.enableBoardOfExperts?e.emitter:n.name,children:(0,s.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:(null===(g=e.emitter)||void 0===g?void 0:g.length)&&n.enableBoardOfExperts?e.emitter:n.name,src:(null===(v=e.emitter)||void 0===v?void 0:v.length)&&n.enableBoardOfExperts&&(null==h?void 0:h.find((t=>t.name===e.emitter)))?`${o}/api/v1/memoriai/memori/avatar/${null===(y=h.find((t=>t.name===e.emitter)))||void 0===y?void 0:y.expertMemoriID}`:n.avatarURL&&n.avatarURL.length>0?wd({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:n.avatarURL,baseURL:i,apiURL:o}):wd({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i||"https://www.aisuru.com",apiURL:o}),onError:e=>{e.currentTarget.src=n.avatarURL&&n.avatarURL.length>0?wd({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:n.avatarURL,baseURL:i}):wd({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i}),e.currentTarget.onerror=null}})}),(0,s.jsxs)(Wc.Child,{as:"div",className:t(ys)("memori-chat--bubble",{"memori-chat--user-bubble":!!e.fromUser,"memori-chat--with-addon":e.generatedByAI&&c||a&&l,"memori-chat--ai-generated":e.generatedByAI&&c,"memori-chat--with-feedback":a}),enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),children:[(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:w}}),(e.generatedByAI&&c||a&&l)&&(0,s.jsxs)("div",{className:"memori-chat--bubble-addon",children:[a&&!!l&&(0,s.jsx)(Xd,{memori:n,className:"memori-chat--bubble-feedback",dropdown:!0,onNegativeClick:e=>{e&&l(e)}}),e.generatedByAI&&c&&(0,s.jsx)(Ed,{align:"left",content:x("generatedByAI"),className:"memori-chat--bubble-ai-icon",children:(0,s.jsx)("span",{children:(0,s.jsx)(Ad,{title:x("generatedByAI")||void 0})})})]})]}),e.fromUser&&(0,s.jsx)(s.Fragment,{children:p&&"string"==typeof p||!p&&(null===(b=null==d?void 0:d.avatarURL)||void 0===b?void 0:b.length)?(0,s.jsx)(Wc.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:(0,s.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:null!==(S=null==d?void 0:d.userName)&&void 0!==S?S:"User",src:null!=p?p:null==d?void 0:d.avatarURL})}):p?(0,s.jsx)(Wc.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:p}):(0,s.jsx)(Wc.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),children:(0,s.jsx)(Cd,{})})})]})]})};c=o("85Hg2"),c=o("85Hg2");var tp,np=({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:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})}),rp={};tp=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||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};function n(e,n){var r=e.el,i=e.elStyle,o=e.elHeight,s=e.rowsLimit,a=e.rowsWrapped,l=e.options,c=e.buffer,u=c;if(a===s+1)return t({},e);var d=c,p=a,h=o;return r.innerHTML=u=c.length?""+c+l.delimiter+n+l.replaceStr:""+n+l.replaceStr,parseFloat(i.height)>parseFloat(o)&&(p++,h=i.height,p===s+1)?(r.innerHTML=u="."===d[d.length-1]&&"..."===l.replaceStr?d+"..":""+d+l.replaceStr,t({},e,{elHeight:h,rowsWrapped:p})):(r.innerHTML=u=d.length?""+d+l.delimiter+n:""+n,t({},e,{buffer:u,elHeight:h,rowsWrapped:p}))}e.disableResponsive=function(e){window.removeEventListener("resize",e)},e.ellipsis=function e(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s={replaceStr:"...",responsive:!1,debounceDelay:250,delimiter:" "},a=t({},s,o),l=r&&(r instanceof NodeList?r:1===r.nodeType?[r]:document.querySelectorAll(r)),c=[],u=0;u<l.length;u++){var d=l[u];c[u]=d.innerHTML;var p=d.innerHTML.split(a.delimiter);d.innerHTML="";var h=window.getComputedStyle(d);p.reduce(n,{el:d,buffer:d.innerHTML,elStyle:h,elHeight:0,rowsLimit:i,rowsWrapped:0,options:a})}if(a.responsive){var f=!1,m=window.innerWidth,g=function(){if(window.innerWidth!==m){m=window.innerWidth;for(var n=0;n<l.length;n++)l[n].innerHTML=c[n];e(r,i,t({},o,{responsive:!1}))}},v=function(){clearTimeout(f),f=setTimeout(g,a.debounceDelay)};return window.addEventListener("resize",v),v}}},"function"==typeof define&&define.amd?define(["exports"],tp):tp(rp);var ip=({loading:e=!1,className:n,title:r,description:i,cover:o,hoverable:a=!1,children:l})=>(0,s.jsx)("div",{className:t(ys)("memori-card",n,{"memori-card--loading":e,"memori-card--with-cover":o,"memori-card--hoverable":a}),children:(0,s.jsxs)(qc,{spinning:e,children:[o&&(0,s.jsx)("div",{className:"memori-card--cover",children:o}),(0,s.jsxs)("div",{className:"memori-card--content",children:[r&&(0,s.jsx)("h3",{className:"memori-card--title",children:r}),i&&(0,s.jsx)("p",{className:"memori-card--description",children:i}),(0,s.jsx)("div",{className:"memori-card--children",children:l})]})]})});const op=({isChild:e=!1,item:n,baseUrl:r,onLinkPreviewInfo:i,descriptionOneLine:o=!1})=>{var a,l,u,d;const[p,h]=(0,c.useState)(null),f=(null===(a=n.url)||void 0===a?void 0:a.startsWith("http"))||!n.url||0===(null===(l=n.url)||void 0===l?void 0:l.length)?n.url:`https://${n.url}`;(0,c.useEffect)((()=>{var e,t;let o=(null===(e=n.url)||void 0===e?void 0:e.startsWith("http"))||!n.url||0===(null===(t=n.url)||void 0===t?void 0:t.length)?n.url:`https://${n.url}`;o&&o!==(null==p?void 0:p.urlKey)&&(async(e,t)=>{try{const n=await fetch(`${t||"https://aisuru.com"}/api/linkpreview/${encodeURIComponent(e)}`);return await n.json()}catch(e){return console.error("getSiteInfo",e),null}})(o,r).then((e=>{h(e?{...e,urlKey:o}:null),i&&e&&i(e)}))}),[null==n?void 0:n.url,r,i]);const m=n.title&&n.title.length>0?n.title:null==p?void 0:p.title,g=null==p?void 0:p.description,v=null==p?void 0:p.video,y=null!==(u=null==p?void 0:p.image)&&void 0!==u?u:null===(d=null==p?void 0:p.images)||void 0===d?void 0:d[0];return(0,c.useEffect)((()=>{setTimeout((()=>{(0,rp.ellipsis)(".memori-link-item--card .memori-card--description",3,{responsive:!0})}),300)}),[g,n.mediumID]),(0,s.jsx)("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:t(ys)("memori-link-item--link",{"memori-link-item--link--child":e}),onClick:t=>{e||(t.preventDefault(),t.stopPropagation(),window.open(f,"_blank",`toolbar=yes,top=${.1*window.innerHeight},left=${.1*window.innerWidth},width=${.8*window.innerWidth},height=${.8*window.innerHeight}`))},children:(0,s.jsx)(ip,{hoverable:!0,className:t(ys)("memori-link-item--card",{"memori-link-item--card-description-oneline":o,"memori-link-item--card-has-image":y,"memori-link-item--card-has-video":v}),cover:v?(0,s.jsx)("iframe",{width:"100%",height:"100%",src:v,title:"Video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):y?(0,s.jsx)("img",{className:"memori-link-item--card-cover-img",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==",srcSet:y.includes("data:image")?void 0:y,alt:n.title}):(0,s.jsx)("div",{className:"memori-link-item--card-cover-icon",children:(0,s.jsx)(np,{className:"memori-link-item--icon"})}),title:m,description:g})})};var sp=({items:e,baseUrl:t,descriptionOneLine:n=!1,onLinkPreviewInfo:r})=>(0,s.jsx)(Wc,{appear:!0,show:!0,as:"div",className:"memori-link-items",children:(0,s.jsx)("div",{className:"memori-link-items--grid",children:e.map(((e,i)=>(0,s.jsx)(Wc.Child,{as:"div",className:"memori-link-item",enter:"ease-out duration-500 delay-"+100*i,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsx)(op,{item:e,baseUrl:t,descriptionOneLine:n,onLinkPreviewInfo:r})},e.mediumID)))})});c=o("85Hg2");const ap=["va bene","no grazie","si","no","sì","arrivederci","non c'entrava","non mi è piaciuto"],lp=async(e,t,n,r)=>{var i;const o=ap.indexOf(e.toLowerCase())>-1?"IT":null==n?void 0:n.toUpperCase(),s=await fetch(`${r||"https://aisuru.com"}/api/translate?text=${encodeURIComponent(e)}&target_lang=${t.toUpperCase()}${o?`&source_lang=${o}`:""}`,{method:"GET",headers:{Accept:"*/*"}}),a=await s.json();return null===(i=null==a?void 0:a.translations)||void 0===i?void 0:i[0]},cp=[{value:"IT",label:"Italiano"},{value:"EN",label:"English"},{value:"DE",label:"Deutsch"},{value:"ES",label:"Español"},{value:"FR",label:"Français"},{value:"PT",label:"Português"},{value:"UK",label:"Українська"},{value:"RU",label:"Русский"},{value:"PL",label:"Polski"},{value:"FI",label:"Suomi"}],up="👤",dp=[{name:"text",lang:"text",mimeType:"text/plain",monacoLang:"plaintext",executable:!0},{name:"javascript/jsx",lang:"jsx",mimeType:"text/javascript",monacoLang:"javascript",executable:!0},{name:"typescript/tsx",lang:"tsx",mimeType:"text/ecmascript",monacoLang:"typescript",executable:!0},{name:"json",lang:"json",mimeType:"application/json",monacoLang:"json",executable:!0},{name:"css",lang:"scss",mimeType:"text/css",monacoLang:"css",executable:!0},{name:"html/xml",lang:"tsx",mimeType:"application/xml",monacoLang:"xml"},{name:"bash",lang:"bash",mimeType:"application/x-sh",monacoLang:"shell"},{name:"python",lang:"python",mimeType:"text/x-python",monacoLang:"python"},{name:"cpp/csharp",lang:"cpp",mimeType:"text/x-c++src",monacoLang:"cpp"},{name:"php",lang:"php",mimeType:"application/x-php",monacoLang:"php"},{name:"ruby",lang:"ruby",mimeType:"text/x-ruby",monacoLang:"ruby"},{name:"sql",lang:"sql",mimeType:"text/x-sql",monacoLang:"sql"}],pp={it:[{text:"",delayAfter:10},{text:"Cerco l'esperto più adatto",delayAfter:5},{text:"Contatto l'esperto",delayAfter:3},{text:"Spiego all'esperto la domanda",delayAfter:2},{text:"L'esperto sta preparando una risposta",delayAfter:6},{text:"Genero una risposta adatta",delayAfter:3}],en:[{text:"",delayAfter:10},{text:"I'm looking for the most suitable expert",delayAfter:5},{text:"I'm contacting the expert",delayAfter:3},{text:"I'm explaining the question to the expert",delayAfter:2},{text:"The expert is preparing an answer",delayAfter:6},{text:"I am generating a suitable answer",delayAfter:3}]};c=o("85Hg2");var hp=({src:e,poster:t,alt:n=""})=>((0,c.useEffect)((()=>{const e=document.createElement("script");return e.src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js",e.type="module",document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]),(0,s.jsx)("div",{className:"model-viewer",children:(0,s.jsx)("model-viewer",{src:e,"ios-src":"",poster:t,alt:n,"shadow-intensity":"1","disable-zoom":!0,"camera-controls":!0,autoplay:!0})}));var fp=({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:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"})}),mp={};function gp(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}(mp=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){gp(o,r,i,s,a,"next",e)}function a(e){gp(o,r,i,s,a,"throw",e)}s(void 0)}))}}).__esModule=!0,mp.default=mp;var vp={};function yp(){return vp=yp=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},vp.__esModule=!0,vp.default=vp,yp.apply(this,arguments)}(vp=yp).__esModule=!0,vp.default=vp;Y=o("ffgrs"),X=o("22y1y");var bp={},Sp={};function xp(e,t){return Sp=xp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Sp.__esModule=!0,Sp.default=Sp,xp(e,t)}(Sp=xp).__esModule=!0,Sp.default=Sp,(bp=function(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&&Sp(e,t)}).__esModule=!0,bp.default=bp;var wp={},Cp=o("lEJSL").default,Ap={};(Ap=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}).__esModule=!0,Ap.default=Ap,(wp=function(e,t){if(t&&("object"===Cp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ap(e)}).__esModule=!0,wp.default=wp;var Ep={};function Mp(e){return Ep=Mp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ep.__esModule=!0,Ep.default=Ep,Mp(e)}(Ep=Mp).__esModule=!0,Ep.default=Ep;var Tp,_p=o("7qcgS")();Tp=_p;try{regeneratorRuntime=_p}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=_p:Function("r","regeneratorRuntime = r")(_p)}c=o("85Hg2");var Ip={},Rp={};(Rp=function(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}).__esModule=!0,Rp.default=Rp,(Ip=function(e,t){if(null==e)return{};var n,r,i=Rp(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}).__esModule=!0,Ip.default=Ip;var Pp={},kp={},Op=o("e3mvX");(kp=function(e){if(Array.isArray(e))return Op(e)}).__esModule=!0,kp.default=kp;var Np={};(Np=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}).__esModule=!0,Np.default=Np;var Dp=o("8xD61"),Lp={};(Lp=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,Lp.default=Lp,(Pp=function(e){return kp(e)||Np(e)||Dp(e)||Lp()}).__esModule=!0,Pp.default=Pp;c=o("85Hg2"),c=o("85Hg2");function Bp(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 zp(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Bp(Object(r),!0).forEach((function(n){t(J)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Fp={};function Up(e){if(0===e.length||1===e.length)return e;var t,n,r=e.join(".");return Fp[r]||(Fp[r]=0===(n=(t=e).length)||1===n?t:2===n?[t[0],t[1],"".concat(t[0],".").concat(t[1]),"".concat(t[1],".").concat(t[0])]:3===n?[t[0],t[1],t[2],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0])]:n>=4?[t[0],t[1],t[2],t[3],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[2],".").concat(t[3]),"".concat(t[3],".").concat(t[0]),"".concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[0]),"".concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[3],".").concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[2],".").concat(t[1],".").concat(t[0])]:void 0),Fp[r]}function jp(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter((function(e){return"token"!==e})),i=Up(r);return i.reduce((function(e,t){return zp(zp({},e),n[t])}),t)}function Hp(e){return e.join(" ")}function Vp(e){var n=e.node,r=e.stylesheet,i=e.style,o=void 0===i?{}:i,s=e.useInlineStyles,a=e.key,l=n.properties,u=n.type,d=n.tagName,p=n.value;if("text"===u)return p;if(d){var h,f=function(e,t){var n=0;return function(r){return n+=1,r.map((function(r,i){return Vp({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(i)})}))}}(r,s);if(s){var m=Object.keys(r).reduce((function(e,t){return t.split(".").forEach((function(t){e.includes(t)||e.push(t)})),e}),[]),g=l.className&&l.className.includes("token")?["token"]:[],v=l.className&&g.concat(l.className.filter((function(e){return!m.includes(e)})));h=zp(zp({},l),{},{className:Hp(v)||void 0,style:jp(l.className,Object.assign({},l.style,o),r)})}else h=zp(zp({},l),{},{className:Hp(l.className)});var y=f(n.children);return t(c).createElement(d,t(vp)({key:a},h),y)}}var Gp=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function Wp(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 qp(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?Wp(Object(r),!0).forEach((function(n){t(J)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wp(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Kp=/\n/g;function Jp(e){var n=e.codeString,r=e.codeStyle,i=e.containerStyle,o=void 0===i?{float:"left",paddingRight:"10px"}:i,s=e.numberStyle,a=void 0===s?{}:s,l=e.startingLineNumber;return t(c).createElement("code",{style:Object.assign({},r,o)},function(e){var n=e.lines,r=e.startingLineNumber,i=e.style;return n.map((function(e,n){var o=n+r;return t(c).createElement("span",{key:"line-".concat(n),className:"react-syntax-highlighter-line-number",style:"function"==typeof i?i(o):i},"".concat(o,"\n"))}))}({lines:n.replace(/\n$/,"").split("\n"),style:a,startingLineNumber:l}))}function Qp(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function Yp(e,t,n){var r,i={display:"inline-block",minWidth:(r=n,"".concat(r.toString().length,".25em")),paddingRight:"1em",textAlign:"right",userSelect:"none"},o="function"==typeof e?e(t):e;return qp(qp({},i),o)}function Xp(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,o=e.showInlineLineNumbers,s=e.lineProps,a=void 0===s?{}:s,l=e.className,c=void 0===l?[]:l,u=e.showLineNumbers,d=e.wrapLongLines,p="function"==typeof a?a(n):a;if(p.className=c,n&&o){var h=Yp(r,n,i);t.unshift(Qp(n,h))}return d&u&&(p.style=qp(qp({},p.style),{},{display:"flex"})),{type:"element",tagName:"span",properties:p,children:t}}function $p(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=0;i<e.length;i++){var o=e[i];if("text"===o.type)r.push(Xp({children:[o],className:t(Pp)(new Set(n))}));else if(o.children){var s=n.concat(o.properties.className);$p(o.children,s).forEach((function(e){return r.push(e)}))}}return r}function Zp(e,t,n,r,i,o,s,a,l){var c,u=$p(e.value),d=[],p=-1,h=0;function f(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Xp({children:e,lineNumber:t,lineNumberStyle:a,largestLineNumber:s,showInlineLineNumbers:i,lineProps:n,className:o,showLineNumbers:r,wrapLongLines:l})}function m(e,t){if(r&&t&&i){var n=Yp(a,t,s);e.unshift(Qp(t,n))}return e}function g(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?f(e,n,r):m(e,n)}for(var v=function(){var e=u[h],t=e.children[0].value;if(t.match(Kp)){var n=t.split("\n");n.forEach((function(t,i){var s=r&&d.length+o,a={type:"text",value:"".concat(t,"\n")};if(0===i){var l=g(u.slice(p+1,h).concat(Xp({children:[a],className:e.properties.className})),s);d.push(l)}else if(i===n.length-1){var c=u[h+1]&&u[h+1].children&&u[h+1].children[0],f={type:"text",value:"".concat(t)};if(c){var m=Xp({children:[f],className:e.properties.className});u.splice(h+1,0,m)}else{var v=g([f],s,e.properties.className);d.push(v)}}else{var y=g([a],s,e.properties.className);d.push(y)}})),p=h}h++};h<u.length;)v();if(p!==u.length-1){var y=u.slice(p+1,u.length);if(y&&y.length){var b=g(y,r&&d.length+o);d.push(b)}}return t?d:(c=[]).concat.apply(c,d)}function eh(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map((function(e,t){return Vp({node:e,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(t)})}))}function th(e){return e&&void 0!==e.highlightAuto}function nh(e,n){return function(r){var i=r.language,o=r.children,s=r.style,a=void 0===s?n:s,l=r.customStyle,u=void 0===l?{}:l,d=r.codeTagProps,p=void 0===d?{className:i?"language-".concat(i):void 0,style:qp(qp({},a['code[class*="language-"]']),a['code[class*="language-'.concat(i,'"]')])}:d,h=r.useInlineStyles,f=void 0===h||h,m=r.showLineNumbers,g=void 0!==m&&m,v=r.showInlineLineNumbers,y=void 0===v||v,b=r.startingLineNumber,S=void 0===b?1:b,x=r.lineNumberContainerStyle,w=r.lineNumberStyle,C=void 0===w?{}:w,A=r.wrapLines,E=r.wrapLongLines,M=void 0!==E&&E,T=r.lineProps,_=void 0===T?{}:T,I=r.renderer,R=r.PreTag,P=void 0===R?"pre":R,k=r.CodeTag,O=void 0===k?"code":k,N=r.code,D=void 0===N?(Array.isArray(o)?o[0]:o)||"":N,L=r.astGenerator,B=t(Ip)(r,Gp);L=L||e;var z=g?t(c).createElement(Jp,{containerStyle:x,codeStyle:p.style||{},numberStyle:C,startingLineNumber:S,codeString:D}):null,F=a.hljs||a['pre[class*="language-"]']||{backgroundColor:"#fff"},U=th(L)?"hljs":"prismjs",j=f?Object.assign({},B,{style:Object.assign({},F,u)}):Object.assign({},B,{className:B.className?"".concat(U," ").concat(B.className):U,style:Object.assign({},u)});if(p.style=qp(qp({},p.style),{},M?{whiteSpace:"pre-wrap"}:{whiteSpace:"pre"}),!L)return t(c).createElement(P,j,z,t(c).createElement(O,p,D));(void 0===A&&I||M)&&(A=!0),I=I||eh;var H=[{type:"text",value:D}],V=function(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(th(t)){var o=function(e,t){return-1!==e.listLanguages().indexOf(t)}(t,n);return"text"===n?{value:i,language:"text"}:o?t.highlight(n,r):t.highlightAuto(r)}try{return n&&"text"!==n?{value:t.highlight(r,n)}:{value:i}}catch(e){return{value:i}}}({astGenerator:L,language:i,code:D,defaultCodeValue:H});null===V.language&&(V.value=H);var G=Zp(V,A,_,g,y,S,V.value.length+S,C,M);return t(c).createElement(P,j,t(c).createElement(O,p,!y&&z,I({rows:G,stylesheet:a,useInlineStyles:f})))}}function rh(e){var n=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 r,i=t(Ep)(e);if(n){var o=t(Ep)(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return t(wp)(this,r)}}var ih,oh,sh,ah,lh,ch,uh,dh=function(e,n){return function(){var r=t(mp)(t(Tp).mark((function r(i){var o;return t(Tp).wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:o=t.sent,i(e,o.default||o);case 4:case"end":return t.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()},ph={abap:dh("abap",(function(){return o("bwHpE")})),abnf:dh("abnf",(function(){return o("daD87")})),actionscript:dh("actionscript",(function(){return o("lpEgO")})),ada:dh("ada",(function(){return o("1sGW9")})),agda:dh("agda",(function(){return o("e9VyR")})),al:dh("al",(function(){return o("kMFSe")})),antlr4:dh("antlr4",(function(){return o("8HlsP")})),apacheconf:dh("apacheconf",(function(){return o("isFCh")})),apex:dh("apex",(function(){return o("gUXVM")})),apl:dh("apl",(function(){return o("2L15v")})),applescript:dh("applescript",(function(){return o("8XyFT")})),aql:dh("aql",(function(){return o("gFWTI")})),arduino:dh("arduino",(function(){return o("jI3VB")})),arff:dh("arff",(function(){return o("6uYTH")})),asciidoc:dh("asciidoc",(function(){return o("gdYKH")})),asm6502:dh("asm6502",(function(){return o("ahFLg")})),asmatmel:dh("asmatmel",(function(){return o("4irIu")})),aspnet:dh("aspnet",(function(){return o("yDC6n")})),autohotkey:dh("autohotkey",(function(){return o("a4xpy")})),autoit:dh("autoit",(function(){return o("iNSix")})),avisynth:dh("avisynth",(function(){return o("kEBnk")})),avroIdl:dh("avroIdl",(function(){return o("lzthi")})),bash:dh("bash",(function(){return Promise.resolve(o("3aDLI"))})),basic:dh("basic",(function(){return o("cxDu6")})),batch:dh("batch",(function(){return o("6zDll")})),bbcode:dh("bbcode",(function(){return o("bPS87")})),bicep:dh("bicep",(function(){return o("8dy5f")})),birb:dh("birb",(function(){return o("3vHrY")})),bison:dh("bison",(function(){return o("bCjBS")})),bnf:dh("bnf",(function(){return o("4NqDW")})),brainfuck:dh("brainfuck",(function(){return o("4s0KX")})),brightscript:dh("brightscript",(function(){return o("jTsQ4")})),bro:dh("bro",(function(){return o("5lMc2")})),bsl:dh("bsl",(function(){return o("jBYxC")})),c:dh("c",(function(){return Promise.resolve(o("lyZgY"))})),cfscript:dh("cfscript",(function(){return o("coZDy")})),chaiscript:dh("chaiscript",(function(){return o("e1zEN")})),cil:dh("cil",(function(){return o("crKoM")})),clike:dh("clike",(function(){return o("4kO9t")})),clojure:dh("clojure",(function(){return o("01SpB")})),cmake:dh("cmake",(function(){return o("9yG4p")})),cobol:dh("cobol",(function(){return o("967Hn")})),coffeescript:dh("coffeescript",(function(){return o("7Yi6H")})),concurnas:dh("concurnas",(function(){return o("5tXmX")})),coq:dh("coq",(function(){return o("ektdr")})),cpp:dh("cpp",(function(){return Promise.resolve(o("lR39A"))})),crystal:dh("crystal",(function(){return o("8gt4L")})),csharp:dh("csharp",(function(){return o("7K6eJ")})),cshtml:dh("cshtml",(function(){return o("cVu4i")})),csp:dh("csp",(function(){return o("ecKo1")})),cssExtras:dh("cssExtras",(function(){return o("gnpv8")})),css:dh("css",(function(){return o("jx0H8")})),csv:dh("csv",(function(){return o("f9kmW")})),cypher:dh("cypher",(function(){return o("lojor")})),d:dh("d",(function(){return o("6Qa0U")})),dart:dh("dart",(function(){return o("74K1B")})),dataweave:dh("dataweave",(function(){return o("93H6c")})),dax:dh("dax",(function(){return o("cf9Y9")})),dhall:dh("dhall",(function(){return o("f6UWv")})),diff:dh("diff",(function(){return o("klPVo")})),django:dh("django",(function(){return o("jfxe9")})),dnsZoneFile:dh("dnsZoneFile",(function(){return o("5aMz5")})),docker:dh("docker",(function(){return o("kOauC")})),dot:dh("dot",(function(){return o("btE6k")})),ebnf:dh("ebnf",(function(){return o("aT88c")})),editorconfig:dh("editorconfig",(function(){return o("jWOl8")})),eiffel:dh("eiffel",(function(){return o("kHJaX")})),ejs:dh("ejs",(function(){return o("frfnA")})),elixir:dh("elixir",(function(){return o("hcrJ2")})),elm:dh("elm",(function(){return o("jd271")})),erb:dh("erb",(function(){return o("gczXL")})),erlang:dh("erlang",(function(){return o("FsabW")})),etlua:dh("etlua",(function(){return o("9DI9l")})),excelFormula:dh("excelFormula",(function(){return o("3QVue")})),factor:dh("factor",(function(){return o("ltNCT")})),falselang:dh("falselang",(function(){return o("g0Q6p")})),firestoreSecurityRules:dh("firestoreSecurityRules",(function(){return o("ukA2V")})),flow:dh("flow",(function(){return o("e5prn")})),fortran:dh("fortran",(function(){return o("gIEL6")})),fsharp:dh("fsharp",(function(){return o("3wQkt")})),ftl:dh("ftl",(function(){return o("7ZVWs")})),gap:dh("gap",(function(){return o("hOFj6")})),gcode:dh("gcode",(function(){return o("95BzQ")})),gdscript:dh("gdscript",(function(){return o("iul6t")})),gedcom:dh("gedcom",(function(){return o("e0qJM")})),gherkin:dh("gherkin",(function(){return o("2SHak")})),git:dh("git",(function(){return o("l6VFH")})),glsl:dh("glsl",(function(){return o("cEMfJ")})),gml:dh("gml",(function(){return o("8UVTr")})),gn:dh("gn",(function(){return o("kvibD")})),goModule:dh("goModule",(function(){return o("icqjF")})),go:dh("go",(function(){return o("jLkg8")})),graphql:dh("graphql",(function(){return o("aYGNi")})),groovy:dh("groovy",(function(){return o("4bTmH")})),haml:dh("haml",(function(){return o("h2A6V")})),handlebars:dh("handlebars",(function(){return o("79YVJ")})),haskell:dh("haskell",(function(){return o("bsiLW")})),haxe:dh("haxe",(function(){return o("94Kdj")})),hcl:dh("hcl",(function(){return o("9CheR")})),hlsl:dh("hlsl",(function(){return o("h3dqW")})),hoon:dh("hoon",(function(){return o("9WbsW")})),hpkp:dh("hpkp",(function(){return o("GiPN3")})),hsts:dh("hsts",(function(){return o("eaSn9")})),http:dh("http",(function(){return o("1uj7b")})),ichigojam:dh("ichigojam",(function(){return o("ge562")})),icon:dh("icon",(function(){return o("lVHUf")})),icuMessageFormat:dh("icuMessageFormat",(function(){return o("aYoUL")})),idris:dh("idris",(function(){return o("1RVAE")})),iecst:dh("iecst",(function(){return o("bi7Dr")})),ignore:dh("ignore",(function(){return o("cq0Pi")})),inform7:dh("inform7",(function(){return o("31K4E")})),ini:dh("ini",(function(){return o("l05OZ")})),io:dh("io",(function(){return o("6bY1b")})),j:dh("j",(function(){return o("1ebDS")})),java:dh("java",(function(){return o("iEZZI")})),javadoc:dh("javadoc",(function(){return o("aHy5a")})),javadoclike:dh("javadoclike",(function(){return o("5f3rE")})),javascript:dh("javascript",(function(){return o("7JDFI")})),javastacktrace:dh("javastacktrace",(function(){return o("gdCGE")})),jexl:dh("jexl",(function(){return o("cqMb9")})),jolie:dh("jolie",(function(){return o("cEDX4")})),jq:dh("jq",(function(){return o("kEWsh")})),jsExtras:dh("jsExtras",(function(){return o("74PI8")})),jsTemplates:dh("jsTemplates",(function(){return o("30TPr")})),jsdoc:dh("jsdoc",(function(){return o("9DH5c")})),json:dh("json",(function(){return Promise.resolve(o("l1Rj1"))})),json5:dh("json5",(function(){return o("920rv")})),jsonp:dh("jsonp",(function(){return o("9AwS1")})),jsstacktrace:dh("jsstacktrace",(function(){return o("bYXMr")})),jsx:dh("jsx",(function(){return Promise.resolve(o("6ho3O"))})),julia:dh("julia",(function(){return o("g0ibH")})),keepalived:dh("keepalived",(function(){return o("2hdnH")})),keyman:dh("keyman",(function(){return o("cIufI")})),kotlin:dh("kotlin",(function(){return o("c26dU")})),kumir:dh("kumir",(function(){return o("iYAha")})),kusto:dh("kusto",(function(){return o("9z1oX")})),latex:dh("latex",(function(){return o("lCPLU")})),latte:dh("latte",(function(){return o("c9oN0")})),less:dh("less",(function(){return o("hA3V9")})),lilypond:dh("lilypond",(function(){return o("hpHTA")})),liquid:dh("liquid",(function(){return o("kpZTm")})),lisp:dh("lisp",(function(){return o("chgK5")})),livescript:dh("livescript",(function(){return o("2gdiv")})),llvm:dh("llvm",(function(){return o("jUeFO")})),log:dh("log",(function(){return o("3BFSQ")})),lolcode:dh("lolcode",(function(){return o("lG9br")})),lua:dh("lua",(function(){return o("cVGpd")})),magma:dh("magma",(function(){return o("4LVzY")})),makefile:dh("makefile",(function(){return o("2NviD")})),markdown:dh("markdown",(function(){return o("jUFCF")})),markupTemplating:dh("markupTemplating",(function(){return Promise.resolve(o("t3W0d"))})),markup:dh("markup",(function(){return o("5hIXu")})),matlab:dh("matlab",(function(){return o("kPAC0")})),maxscript:dh("maxscript",(function(){return o("gHOJy")})),mel:dh("mel",(function(){return o("9mj6e")})),mermaid:dh("mermaid",(function(){return o("kozw5")})),mizar:dh("mizar",(function(){return o("2bN6W")})),mongodb:dh("mongodb",(function(){return o("eHKWX")})),monkey:dh("monkey",(function(){return o("7Fh0C")})),moonscript:dh("moonscript",(function(){return o("hDXwC")})),n1ql:dh("n1ql",(function(){return o("j9bkC")})),n4js:dh("n4js",(function(){return o("eTmBF")})),nand2tetrisHdl:dh("nand2tetrisHdl",(function(){return o("ezjCf")})),naniscript:dh("naniscript",(function(){return o("VxHk1")})),nasm:dh("nasm",(function(){return o("ly95T")})),neon:dh("neon",(function(){return o("7Fk34")})),nevod:dh("nevod",(function(){return o("3U8Qv")})),nginx:dh("nginx",(function(){return o("c6qVk")})),nim:dh("nim",(function(){return o("1JdCk")})),nix:dh("nix",(function(){return o("jcstS")})),nsis:dh("nsis",(function(){return o("kEJqW")})),objectivec:dh("objectivec",(function(){return o("lUP8A")})),ocaml:dh("ocaml",(function(){return o("lhTAD")})),opencl:dh("opencl",(function(){return o("8rxKO")})),openqasm:dh("openqasm",(function(){return o("ib0uL")})),oz:dh("oz",(function(){return o("csCUS")})),parigp:dh("parigp",(function(){return o("2DkHE")})),parser:dh("parser",(function(){return o("2cp75")})),pascal:dh("pascal",(function(){return o("fViVl")})),pascaligo:dh("pascaligo",(function(){return o("9Uuxa")})),pcaxis:dh("pcaxis",(function(){return o("jUdnN")})),peoplecode:dh("peoplecode",(function(){return o("l8w4e")})),perl:dh("perl",(function(){return o("aX7dM")})),phpExtras:dh("phpExtras",(function(){return o("3cMZl")})),php:dh("php",(function(){return Promise.resolve(o("5li5P"))})),phpdoc:dh("phpdoc",(function(){return o("bDyJN")})),plsql:dh("plsql",(function(){return o("cPuMN")})),powerquery:dh("powerquery",(function(){return o("jE1gU")})),powershell:dh("powershell",(function(){return o("k7t0j")})),processing:dh("processing",(function(){return o("jr8hV")})),prolog:dh("prolog",(function(){return o("hpuat")})),promql:dh("promql",(function(){return o("ckXC5")})),properties:dh("properties",(function(){return o("fAh6P")})),protobuf:dh("protobuf",(function(){return o("R6WqB")})),psl:dh("psl",(function(){return o("Al65w")})),pug:dh("pug",(function(){return o("dxbNS")})),puppet:dh("puppet",(function(){return o("lrSuh")})),pure:dh("pure",(function(){return o("6DKQK")})),purebasic:dh("purebasic",(function(){return o("7ZkSb")})),purescript:dh("purescript",(function(){return o("dBTYx")})),python:dh("python",(function(){return Promise.resolve(o("kiy5M"))})),q:dh("q",(function(){return o("4FXyy")})),qml:dh("qml",(function(){return o("2zZFj")})),qore:dh("qore",(function(){return o("iCK1Y")})),qsharp:dh("qsharp",(function(){return o("dvH9H")})),r:dh("r",(function(){return o("lQqRt")})),racket:dh("racket",(function(){return o("eHKmq")})),reason:dh("reason",(function(){return o("kkeLT")})),regex:dh("regex",(function(){return o("llX50")})),rego:dh("rego",(function(){return o("9hKdZ")})),renpy:dh("renpy",(function(){return o("cJgw5")})),rest:dh("rest",(function(){return o("867DK")})),rip:dh("rip",(function(){return o("3Odjx")})),roboconf:dh("roboconf",(function(){return o("gQ0Us")})),robotframework:dh("robotframework",(function(){return o("bLCgx")})),ruby:dh("ruby",(function(){return Promise.resolve(o("ch1PX"))})),rust:dh("rust",(function(){return o("cInT8")})),sas:dh("sas",(function(){return o("iz7eP")})),sass:dh("sass",(function(){return o("hrDC3")})),scala:dh("scala",(function(){return o("ub8Bf")})),scheme:dh("scheme",(function(){return o("7NAAt")})),scss:dh("scss",(function(){return Promise.resolve(o("fU6a0"))})),shellSession:dh("shellSession",(function(){return o("7kKCv")})),smali:dh("smali",(function(){return o("2lkCb")})),smalltalk:dh("smalltalk",(function(){return o("4280y")})),smarty:dh("smarty",(function(){return o("4hXYK")})),sml:dh("sml",(function(){return o("jh2E8")})),solidity:dh("solidity",(function(){return o("dTdF2")})),solutionFile:dh("solutionFile",(function(){return o("iI5tm")})),soy:dh("soy",(function(){return o("aoU5C")})),sparql:dh("sparql",(function(){return o("ggrvb")})),splunkSpl:dh("splunkSpl",(function(){return o("8LhCX")})),sqf:dh("sqf",(function(){return o("3tDsu")})),sql:dh("sql",(function(){return Promise.resolve(o("bnDV9"))})),squirrel:dh("squirrel",(function(){return o("bxaUV")})),stan:dh("stan",(function(){return o("dBqrq")})),stylus:dh("stylus",(function(){return o("JlHVK")})),swift:dh("swift",(function(){return o("c7NBs")})),systemd:dh("systemd",(function(){return o("jprZl")})),t4Cs:dh("t4Cs",(function(){return o("edsMI")})),t4Templating:dh("t4Templating",(function(){return o("bS9Wa")})),t4Vb:dh("t4Vb",(function(){return o("gYk20")})),tap:dh("tap",(function(){return o("byv7d")})),tcl:dh("tcl",(function(){return o("lUAIZ")})),textile:dh("textile",(function(){return o("7J2LO")})),toml:dh("toml",(function(){return o("eXtdM")})),tremor:dh("tremor",(function(){return o("vyajH")})),tsx:dh("tsx",(function(){return Promise.resolve(o("7cTnl"))})),tt2:dh("tt2",(function(){return o("8XOOm")})),turtle:dh("turtle",(function(){return o("1XvLQ")})),twig:dh("twig",(function(){return o("i9Fpp")})),typescript:dh("typescript",(function(){return Promise.resolve(o("fzL8k"))})),typoscript:dh("typoscript",(function(){return o("kKk69")})),unrealscript:dh("unrealscript",(function(){return o("jgq8Y")})),uorazor:dh("uorazor",(function(){return o("dsZ00")})),uri:dh("uri",(function(){return o("fqJRp")})),v:dh("v",(function(){return o("bgfyB")})),vala:dh("vala",(function(){return o("68x4q")})),vbnet:dh("vbnet",(function(){return o("eUhQs")})),velocity:dh("velocity",(function(){return o("fPNdV")})),verilog:dh("verilog",(function(){return o("2fM1V")})),vhdl:dh("vhdl",(function(){return o("hNF6q")})),vim:dh("vim",(function(){return o("75TCr")})),visualBasic:dh("visualBasic",(function(){return o("fc93z")})),warpscript:dh("warpscript",(function(){return o("jgHlG")})),wasm:dh("wasm",(function(){return o("dVZkI")})),webIdl:dh("webIdl",(function(){return o("9Jnxv")})),wiki:dh("wiki",(function(){return o("1Gimo")})),wolfram:dh("wolfram",(function(){return o("4SyRT")})),wren:dh("wren",(function(){return o("gaIVs")})),xeora:dh("xeora",(function(){return o("lagad")})),xmlDoc:dh("xmlDoc",(function(){return o("9DNYE")})),xojo:dh("xojo",(function(){return o("ksF4f")})),xquery:dh("xquery",(function(){return o("gXxHJ")})),yaml:dh("yaml",(function(){return o("6rk3j")})),yang:dh("yang",(function(){return o("kTyrQ")})),zig:dh("zig",(function(){return o("d3mFC")}))},hh=(oh=(ih={loader:function(){return o("bB2YF").then((function(e){return e.default||e}))},isLanguageRegistered:function(e,t){return e.registered(t)},languageLoaders:ph,registerLanguage:function(e,t,n){return e.register(n)}}).loader,sh=ih.isLanguageRegistered,ah=ih.registerLanguage,lh=ih.languageLoaders,ch=ih.noAsyncLoadingLanguages,uh=function(e){t(bp)(i,e);var n,r=rh(i);function i(){return t(Y)(this,i),r.apply(this,arguments)}return t(X)(i,[{key:"componentDidUpdate",value:function(){!i.isRegistered(this.props.language)&&lh&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var e=this;i.astGeneratorPromise||i.loadAstGenerator(),i.astGenerator||i.astGeneratorPromise.then((function(){e.forceUpdate()})),!i.isRegistered(this.props.language)&&lh&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var e=this,t=this.props.language;"text"!==t&&i.loadLanguage(t).then((function(){return e.forceUpdate()})).catch((function(){}))}},{key:"normalizeLanguage",value:function(e){return i.isSupportedLanguage(e)?e:"text"}},{key:"render",value:function(){return t(c).createElement(i.highlightInstance,t(vp)({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:i.astGenerator}))}}],[{key:"preload",value:function(){return i.loadAstGenerator()}},{key:"loadLanguage",value:(n=t(mp)(t(Tp).mark((function e(n){var r;return t(Tp).wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(r=lh[n])){e.next=5;break}return e.abrupt("return",r(i.registerLanguage));case 5:throw new Error("Language ".concat(n," not supported"));case 6:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"isSupportedLanguage",value:function(e){return i.isRegistered(e)||"function"==typeof lh[e]}},{key:"loadAstGenerator",value:function(){return i.astGeneratorPromise=oh().then((function(e){i.astGenerator=e,ah&&i.languages.forEach((function(t,n){return ah(e,n,t)}))})),i.astGeneratorPromise}}]),i}(t(c).PureComponent),t(J)(uh,"astGenerator",null),t(J)(uh,"highlightInstance",nh(null,{})),t(J)(uh,"astGeneratorPromise",null),t(J)(uh,"languages",new Map),t(J)(uh,"supportedLanguages",ih.supportedLanguages||Object.keys(lh||{})),t(J)(uh,"isRegistered",(function(e){if(ch)return!0;if(!ah)throw new Error("Current syntax highlighter doesn't support registration of languages");return uh.astGenerator?sh(uh.astGenerator,e):uh.languages.has(e)})),t(J)(uh,"registerLanguage",(function(e,t){if(!ah)throw new Error("Current syntax highlighter doesn't support registration of languages");if(uh.astGenerator)return ah(uh.astGenerator,e,t);uh.languages.set(e,t)})),uh),fh={},mh={};(mh=function(e){return e&&e.__esModule?e:{default:e}}).__esModule=!0,mh.default=mh,Object.defineProperty(fh,"__esModule",{value:!0}),Object.defineProperty(fh,"a11yDark",{enumerable:!0,get:function(){return Ah.default}}),Object.defineProperty(fh,"atomDark",{enumerable:!0,get:function(){return Eh.default}}),Object.defineProperty(fh,"base16AteliersulphurpoolLight",{enumerable:!0,get:function(){return Mh.default}}),Object.defineProperty(fh,"cb",{enumerable:!0,get:function(){return Th.default}}),Object.defineProperty(fh,"coldarkCold",{enumerable:!0,get:function(){return _h.default}}),Object.defineProperty(fh,"coldarkDark",{enumerable:!0,get:function(){return Ih.default}}),Object.defineProperty(fh,"coy",{enumerable:!0,get:function(){return gh.default}}),Object.defineProperty(fh,"coyWithoutShadows",{enumerable:!0,get:function(){return Rh.default}}),Object.defineProperty(fh,"darcula",{enumerable:!0,get:function(){return Ph.default}}),Object.defineProperty(fh,"dark",{enumerable:!0,get:function(){return vh.default}}),Object.defineProperty(fh,"dracula",{enumerable:!0,get:function(){return kh.default}}),Object.defineProperty(fh,"duotoneDark",{enumerable:!0,get:function(){return Oh.default}}),Object.defineProperty(fh,"duotoneEarth",{enumerable:!0,get:function(){return Nh.default}}),Object.defineProperty(fh,"duotoneForest",{enumerable:!0,get:function(){return Dh.default}}),Object.defineProperty(fh,"duotoneLight",{enumerable:!0,get:function(){return Lh.default}}),Object.defineProperty(fh,"duotoneSea",{enumerable:!0,get:function(){return Bh.default}}),Object.defineProperty(fh,"duotoneSpace",{enumerable:!0,get:function(){return zh.default}}),Object.defineProperty(fh,"funky",{enumerable:!0,get:function(){return yh.default}}),Object.defineProperty(fh,"ghcolors",{enumerable:!0,get:function(){return Fh.default}}),Object.defineProperty(fh,"gruvboxDark",{enumerable:!0,get:function(){return Uh.default}}),Object.defineProperty(fh,"gruvboxLight",{enumerable:!0,get:function(){return jh.default}}),Object.defineProperty(fh,"holiTheme",{enumerable:!0,get:function(){return Hh.default}}),Object.defineProperty(fh,"hopscotch",{enumerable:!0,get:function(){return Vh.default}}),Object.defineProperty(fh,"lucario",{enumerable:!0,get:function(){return Gh.default}}),Object.defineProperty(fh,"materialDark",{enumerable:!0,get:function(){return Wh.default}}),Object.defineProperty(fh,"materialLight",{enumerable:!0,get:function(){return qh.default}}),Object.defineProperty(fh,"materialOceanic",{enumerable:!0,get:function(){return Kh.default}}),Object.defineProperty(fh,"nightOwl",{enumerable:!0,get:function(){return Jh.default}}),Object.defineProperty(fh,"nord",{enumerable:!0,get:function(){return Qh.default}}),Object.defineProperty(fh,"okaidia",{enumerable:!0,get:function(){return bh.default}}),Object.defineProperty(fh,"oneDark",{enumerable:!0,get:function(){return Yh.default}}),Object.defineProperty(fh,"oneLight",{enumerable:!0,get:function(){return Xh.default}}),Object.defineProperty(fh,"pojoaque",{enumerable:!0,get:function(){return $h.default}}),Object.defineProperty(fh,"prism",{enumerable:!0,get:function(){return Ch.default}}),Object.defineProperty(fh,"shadesOfPurple",{enumerable:!0,get:function(){return Zh.default}}),Object.defineProperty(fh,"solarizedDarkAtom",{enumerable:!0,get:function(){return ef.default}}),Object.defineProperty(fh,"solarizedlight",{enumerable:!0,get:function(){return Sh.default}}),Object.defineProperty(fh,"synthwave84",{enumerable:!0,get:function(){return tf.default}}),Object.defineProperty(fh,"tomorrow",{enumerable:!0,get:function(){return xh.default}}),Object.defineProperty(fh,"twilight",{enumerable:!0,get:function(){return wh.default}}),Object.defineProperty(fh,"vs",{enumerable:!0,get:function(){return nf.default}}),Object.defineProperty(fh,"vscDarkPlus",{enumerable:!0,get:function(){return rf.default}}),Object.defineProperty(fh,"xonokai",{enumerable:!0,get:function(){return of.default}}),Object.defineProperty(fh,"zTouch",{enumerable:!0,get:function(){return sf.default}});var gh=mh(o("jcF8U")),vh=mh(o("3Tppx")),yh=mh(o("dBuK7")),bh=mh(o("eEjWK")),Sh=mh(o("awG2g")),xh=mh(o("2oFzQ")),wh=mh(o("4Au6Q")),Ch=mh(o("dAPqs")),Ah=mh(o("8eAql")),Eh=mh(o("cv2QE")),Mh=mh(o("h5I9g")),Th=mh(o("i4C5w")),_h=mh(o("3kFKo")),Ih=mh(o("17zK0")),Rh=mh(o("5Avqr")),Ph=mh(o("1jHMv")),kh=mh(o("7Q8CE")),Oh=mh(o("jKUos")),Nh=mh(o("Uzm4J")),Dh=mh(o("7yfkN")),Lh=mh(o("lT2l1")),Bh=mh(o("fZ9um")),zh=mh(o("1MoQL")),Fh=mh(o("4uys7")),Uh=mh(o("kaYsk")),jh=mh(o("kN6Vu")),Hh=mh(o("2Z6pG")),Vh=mh(o("4jQJK")),Gh=mh(o("bpXw0")),Wh=mh(o("i4S8s")),qh=mh(o("5bNr4")),Kh=mh(o("5ZYWT")),Jh=mh(o("ihJCU")),Qh=mh(o("8iIbg")),Yh=mh(o("424u7")),Xh=mh(o("jPiNI")),$h=mh(o("OHVOA")),Zh=mh(o("2OKTL")),ef=mh(o("2Mg8H")),tf=mh(o("9Kud0")),nf=mh(o("eCrmR")),rf=mh(o("8UhcQ")),of=mh(o("dtU9z")),sf=mh(o("4xtLO")),af={};Object.defineProperty(af,"__esModule",{value:!0}),af.default=void 0;var lf=mh(o("7cTnl")).default;af.default=lf;var cf={};Object.defineProperty(cf,"__esModule",{value:!0}),cf.default=void 0;var uf=mh(o("l1Rj1")).default;cf.default=uf;var df={};Object.defineProperty(df,"__esModule",{value:!0}),df.default=void 0;var pf=mh(o("fU6a0")).default;df.default=pf;var hf={};Object.defineProperty(hf,"__esModule",{value:!0}),hf.default=void 0;var ff=mh(o("3aDLI")).default;hf.default=ff;var mf={};Object.defineProperty(mf,"__esModule",{value:!0}),mf.default=void 0;var gf=mh(o("kiy5M")).default;mf.default=gf;var vf={};Object.defineProperty(vf,"__esModule",{value:!0}),vf.default=void 0;var yf=mh(o("lR39A")).default;vf.default=yf;var bf={};Object.defineProperty(bf,"__esModule",{value:!0}),bf.default=void 0;var Sf=mh(o("5li5P")).default;bf.default=Sf;var xf={};Object.defineProperty(xf,"__esModule",{value:!0}),xf.default=void 0;var wf=mh(o("ch1PX")).default;xf.default=wf;var Cf={};Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.default=void 0;var Af=mh(o("bnDV9")).default;Cf.default=Af,hh.registerLanguage("tsx",t(af)),hh.registerLanguage("json",t(cf)),hh.registerLanguage("scss",t(df)),hh.registerLanguage("bash",t(hf)),hh.registerLanguage("python",t(mf)),hh.registerLanguage("cpp",t(vf)),hh.registerLanguage("php",t(bf)),hh.registerLanguage("ruby",t(xf)),hh.registerLanguage("sql",t(Cf));var Ef=({medium:e,className:t,preview:n=!1})=>{var r,i,o,a;const{t:l}=ve();return(0,s.jsxs)("div",{className:"memori-snippet",children:[(0,s.jsxs)("div",{className:"memori-snippet--content",children:[(0,s.jsx)(hh,{"aria-labelledby":`#snippet-${e.mediumID}`,className:t,style:fh.atomDark,showLineNumbers:!0,language:null!==(i=null===(r=dp.find((t=>e.mimeType===t.mimeType)))||void 0===r?void 0:r.lang)&&void 0!==i?i:"text",children:(null===(o=e.content)||void 0===o?void 0:o.length)&&e.content.length>200&&n?`${e.content.slice(0,200)}\n...`:`${e.content}`}),(0,s.jsx)(Da,{padded:!1,ghost:!0,className:"memori-snippet--copy-button",title:l("copy")||"Copy",icon:(0,s.jsx)(fp,{}),onClick:()=>{var t;return navigator.clipboard.writeText(null!==(t=e.content)&&void 0!==t?t:"")}})]}),!!(null===(a=e.title)||void 0===a?void 0:a.length)&&(0,s.jsx)("p",{id:`snippet-${e.mediumID}`,className:"memori-snippet--caption",children:e.title})]})};var Mf=({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:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});var Tf=({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:"M531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7-3.8-21.3-19.5-29.6-32.9-30.2-15.8-.7-29.9 8.3-33.4 21.4-6.6 24-.7 56.8 10.1 98.6-13.6 32.4-35.3 79.5-51.2 107.5-29.6 15.3-69.3 38.9-75.2 68.7-1.2 5.5.2 12.5 3.5 18.8 3.7 7 9.6 12.4 16.5 15 3 1.1 6.6 2 10.8 2 17.6 0 46.1-14.2 84.1-79.4 5.8-1.9 11.8-3.9 17.6-5.9 27.2-9.2 55.4-18.8 80.9-23.1 28.2 15.1 60.3 24.8 82.1 24.8 21.6 0 30.1-12.8 33.3-20.5 5.6-13.5 2.9-30.5-6.2-39.6-13.2-13-45.3-16.4-95.3-10.2-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7 6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4-4.9-19.9-5.6-48.1-2.7-51.4.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2-21.6 4.9-41.3 13-58.9 20.2-4.2 1.7-8.3 3.4-12.3 5 13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6 40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});var _f=({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:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0 0 10.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 0 0-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"})});var If=({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:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 0 0-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 0 0-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"})});const Rf=({isChild:e=!1,item:t,sessionID:n,tenantID:r,preview:i=!1,baseURL:o,apiURL:a,onClick:l,customMediaRenderer:c})=>{const u=wd({resourceURI:t.url,sessionID:n,tenantID:r,baseURL:o,apiURL:a}),d=null==c?void 0:c(t.mimeType);if(d)return d;switch(t.mimeType){case"image/jpeg":case"image/png":case"image/jpg":case"image/gif":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,onClick:n=>{e&&n.preventDefault(),l&&(n.preventDefault(),l(t.mediumID))},target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(ip,{hoverable:!0,className:"memori-media-item--card memori-media-item--image",cover:(0,s.jsxs)("picture",{className:"memori-media-item--figure",children:[!i&&(0,s.jsx)("source",{srcSet:[u,t.url,t.content].join(", "),type:t.mimeType}),(0,s.jsx)("img",{alt:t.title,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}),t.title&&(0,s.jsx)("figcaption",{className:"memori-media-item--figure-caption",children:t.title})]})})});case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(ip,{hoverable:!0,cover:(0,s.jsx)(If,{className:"memori-media-item--icon"}),title:t.title})});case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(ip,{hoverable:!0,cover:(0,s.jsx)(_f,{className:"memori-media-item--icon"}),title:t.title})});case"application/pdf":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(ip,{hoverable:!0,cover:(0,s.jsx)(Tf,{className:"memori-media-item--icon"}),title:t.title})});case"video/mp4":case"video/avi":case"video/mpeg":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,onClick:n=>{e&&n.preventDefault(),l&&(n.preventDefault(),l(t.mediumID))},target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(ip,{hoverable:!0,cover:(0,s.jsx)("video",{style:{width:"100%",height:"100%"},controls:!0,src:u,title:t.title}),title:t.title})});case"audio/mpeg3":case"audio/wav":case"audio/mpeg":return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(ip,{hoverable:!0,cover:(0,s.jsx)("audio",{style:{width:"100%",height:"100%"},controls:!0,src:u}),title:t.title})});case"model/gltf-binary":return(0,s.jsx)(hp,{src:u,alt:"",poster:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="});default:return(0,s.jsx)("a",{className:"memori-media-item--link",href:u,target:"_blank",rel:"noopener noreferrer",title:t.title,children:(0,s.jsx)(ip,{hoverable:!0,cover:(0,s.jsx)(Mf,{className:"memori-media-item--icon"}),title:t.title})})}};var Pf=(0,c.memo)((({items:e,sessionID:t,tenantID:n,translateTo:r,baseURL:i,apiURL:o,customMediaRenderer:a})=>{const[l,u]=(0,c.useState)(e),[d,p]=(0,c.useState)(),h=(0,c.useCallback)((async()=>{if(!r)return;const t=await Promise.all((null!=e?e:[]).map((async e=>{var t;if(!e.title)return e;try{const n=await lp(e.title,r);return{...e,title:null!==(t=n.text)&&void 0!==t?t:e.title}}catch(t){return console.error(t),e}})));u(t)}),[r,e]);return(0,c.useEffect)((()=>{r&&h()}),[r,h]),(0,s.jsxs)(Wc,{appear:!0,show:!0,as:"div",className:"memori-media-items",children:[(0,s.jsx)("div",{className:"memori-media-items--grid",children:l.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&!dp.map((e=>e.mimeType)).includes(e.mimeType)})).sort(((e,t)=>e.creationTimestamp>t.creationTimestamp?1:e.creationTimestamp<t.creationTimestamp?-1:0)).map(((e,r)=>(0,s.jsx)(Wc.Child,{as:"div",className:"memori-media-item",enter:"ease-out duration-500 delay-"+100*r,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,s.jsx)(Rf,{isChild:!0,sessionID:t,tenantID:n,baseURL:i,apiURL:o,onClick:e=>{p(l.find((t=>t.mediumID===e)))},item:{...e,title:e.title,url:e.url,content:e.content},customMediaRenderer:a})},e.url+"&index="+r)))}),l.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&dp.map((e=>e.mimeType)).includes(e.mimeType)})).map((e=>(0,s.jsx)(Wc.Child,{as:"div",className:"memori-media-item--snippet",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,s.jsx)(Ef,{medium:e},e.mediumID)},e.mediumID))),l.filter((e=>{var t;return"text/css"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)})).map((e=>(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:e.content||""}},e.mediumID))),(null==d?void 0:d.mediumID)&&(0,s.jsx)(Jc,{width:"100%",widthMd:"100%",className:"memori-media-item--modal",open:!!d,onClose:()=>p(void 0),footer:null,children:(0,s.jsx)(Rf,{isChild:!0,sessionID:t,tenantID:n,baseURL:i,apiURL:o,item:{...d,title:d.title,url:d.url,content:d.content},customMediaRenderer:a})})]})}));var kf=(0,c.memo)((({hints:e=[],links:n=[],media:r=[],simulateUserPrompt:i=(()=>{}),sessionID:o,baseUrl:a,apiUrl:l,translateTo:u,customMediaRenderer:d})=>{const{t:p}=ve(),[h,f]=(0,c.useState)(!0),[m,g]=(0,c.useState)(6);return(0,c.useEffect)((()=>{f(!0)}),[e]),(0,s.jsxs)("div",{className:"memori-media-widget",children:[(null==r?void 0:r.length)>0&&(0,s.jsx)(Pf,{items:r,sessionID:o,translateTo:u,baseURL:a,apiURL:l,customMediaRenderer:d}),(null==n?void 0:n.length)>0&&(0,s.jsx)(sp,{items:n,baseUrl:a}),(null==e?void 0:e.length)>0&&h&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Wc,{appear:!0,show:!0,as:"ul",className:"memori-media--hints",children:e.slice(0,m).map(((e,n)=>(0,s.jsx)(Wc.Child,{as:"li",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,s.jsx)(Da,{className:t(ys)("memori-media--hint"),primary:!0,onClick:()=>{i(e.originalText,e.text),f(!1)},onTouchEnd:()=>{i(e.originalText,e.text),f(!1)},children:e.text},e.text+n)},e.text+n)))}),e.length>m&&(0,s.jsx)("div",{className:"memori-hints--show-more",children:(0,s.jsx)(Da,{className:"memori-hints--show-more-button",id:"showMoreHints",onClick:()=>g(m+6),children:p("expand")||"Expand"})})]})]})}));c=o("85Hg2"),c=o("85Hg2");function Of(e=0){let[t,n]=(0,c.useState)(e),r=(0,c.useCallback)((e=>n((t=>t|e))),[t]),i=(0,c.useCallback)((e=>Boolean(t&e)),[t]),o=(0,c.useCallback)((e=>n((t=>t&~e))),[n]),s=(0,c.useCallback)((e=>n((t=>t^e))),[n]);return{addFlag:r,hasFlag:i,removeFlag:o,toggleFlag:s}}let Nf=(0,(c=o("85Hg2")).createContext)(null);function Df(){let e=(0,c.useContext)(Nf);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Df),e}return e}function Lf(){let[e,n]=(0,c.useState)([]);return[e.length>0?e.join(" "):void 0,(0,c.useMemo)((()=>function(e){let r=Qa((e=>(n((t=>[...t,e])),()=>n((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=(0,c.useMemo)((()=>({register:r,slot:e.slot,name:e.name,props:e.props})),[r,e.slot,e.name,e.props]);return t(c).createElement(Nf.Provider,{value:i},e.children)}),[n])]}let Bf=Va((function(e,t){let{passive:n=!1,...r}=e,i=Df(),o=`headlessui-label-${al()}`,s=$a(t);Ka((()=>i.register(o)),[o,i.register]);let a={ref:s,...i.props,id:o};return n&&("onClick"in a&&delete a.onClick,"onClick"in r&&delete r.onClick),Ua({ourProps:a,theirProps:r,slot:i.slot||{},defaultTag:"label",name:i.name||"Label"})}));function zf(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))Uf(n,Ff(t,r),i);return n}function Ff(e,t){return e?e+"["+t+"]":t}function Uf(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())Uf(e,Ff(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):"boolean"==typeof n?e.push([t,n?"1":"0"]):"string"==typeof n?e.push([t,n]):"number"==typeof n?e.push([t,`${n}`]):null==n?e.push([t,""]):zf(n,t,e)}function jf(e){var t;let n=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(n)for(let e of n.elements)if("INPUT"===e.tagName&&"submit"===e.type||"BUTTON"===e.tagName&&"submit"===e.type||"INPUT"===e.nodeName&&"image"===e.type)return void e.click()}c=o("85Hg2");function Hf(e,t,n){let[r,i]=(0,c.useState)(n),o=void 0!==e,s=(0,c.useRef)(o),a=(0,c.useRef)(!1),l=(0,c.useRef)(!1);return!o||s.current||a.current?!o&&s.current&&!l.current&&(l.current=!0,s.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(a.current=!0,s.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[o?e:r,Qa((e=>(o||i(e),null==t?void 0:t(e))))]}var Vf,Gf=((Vf=Gf||{})[Vf.RegisterOption=0]="RegisterOption",Vf[Vf.UnregisterOption=1]="UnregisterOption",Vf);let Wf={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:El(n,(e=>e.element.current))}},1(e,t){let n=e.options.slice(),r=e.options.findIndex((e=>e.id===t.id));return-1===r?e:(n.splice(r,1),{...e,options:n})}},qf=(0,c.createContext)(null);function Kf(e){let t=(0,c.useContext)(qf);if(null===t){let t=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Kf),t}return t}function Jf(e,t){return La(t.type,Wf,e,t)}qf.displayName="RadioGroupContext";let Qf=Va((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,...u}=e,d=Qa("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a),[p,h]=(0,c.useReducer)(Jf,{options:[]}),f=p.options,[m,g]=Lf(),[v,y]=Zl(),b=`headlessui-radiogroup-${al()}`,S=(0,c.useRef)(null),x=$a(S,n),[w,C]=Hf(r,s,i),A=(0,c.useMemo)((()=>f.find((e=>!e.propsRef.current.disabled))),[f]),E=(0,c.useMemo)((()=>f.some((e=>d(e.propsRef.current.value,w)))),[f,w]),M=Qa((e=>{var t;if(l||d(e,w))return!1;let n=null==(t=f.find((t=>d(t.propsRef.current.value,e))))?void 0:t.propsRef.current;return(null==n||!n.disabled)&&(null==C||C(e),!0)}));_d({container:S.current,accept:e=>"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let T=Qa((e=>{let t=S.current;if(!t)return;let n=pl(t),r=f.filter((e=>!1===e.propsRef.current.disabled)).map((e=>e.element.current));switch(e.key){case el.Enter:jf(e.currentTarget);break;case el.ArrowLeft:case el.ArrowUp:if(e.preventDefault(),e.stopPropagation(),Tl(r,gl.Previous|gl.WrapAround)===vl.Success){let e=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&M(e.propsRef.current.value)}break;case el.ArrowRight:case el.ArrowDown:if(e.preventDefault(),e.stopPropagation(),Tl(r,gl.Next|gl.WrapAround)===vl.Success){let e=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&M(e.propsRef.current.value)}break;case el.Space:{e.preventDefault(),e.stopPropagation();let t=f.find((e=>e.element.current===(null==n?void 0:n.activeElement)));t&&M(t.propsRef.current.value)}}})),_=Qa((e=>(h({type:0,...e}),()=>h({type:1,id:e.id})))),I=(0,c.useMemo)((()=>({registerOption:_,firstOption:A,containsCheckedOption:E,change:M,disabled:l,value:w,compare:d})),[_,A,E,M,l,w,d]),R={ref:x,id:b,role:"radiogroup","aria-labelledby":m,"aria-describedby":v,onKeyDown:T},P=(0,c.useMemo)((()=>({value:w})),[w]);return t(c).createElement(y,{name:"RadioGroup.Description"},t(c).createElement(g,{name:"RadioGroup.Label"},t(c).createElement(qf.Provider,{value:I},null!=o&&null!=w&&zf({[o]:w}).map((([e,n])=>t(c).createElement(cl,{features:ll.Hidden,...Ga({key:e,as:"input",type:"radio",checked:null!=n,hidden:!0,readOnly:!0,name:e,value:n})}))),Ua({ourProps:R,theirProps:u,slot:P,defaultTag:"div",name:"RadioGroup"}))))}));var Yf=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(Yf||{});let Xf=Va((function(e,n){let r=(0,c.useRef)(null),i=$a(r,n),o=`headlessui-radiogroup-option-${al()}`,[s,a]=Lf(),[l,u]=Zl(),{addFlag:d,removeFlag:p,hasFlag:h}=Of(1),{value:f,disabled:m=!1,...g}=e,v=(0,c.useRef)({value:f,disabled:m});Ka((()=>{v.current.value=f}),[f,v]),Ka((()=>{v.current.disabled=m}),[m,v]);let{registerOption:y,disabled:b,change:S,firstOption:x,containsCheckedOption:w,value:C,compare:A}=Kf("RadioGroup.Option");Ka((()=>y({id:o,element:r,propsRef:v})),[o,y,r,e]);let E=Qa((e=>{var t;if(tl(e.currentTarget))return e.preventDefault();!S(f)||(d(2),null==(t=r.current)||t.focus())})),M=Qa((e=>{if(tl(e.currentTarget))return e.preventDefault();d(2)})),T=Qa((()=>p(2))),_=(null==x?void 0:x.id)===o,I=b||m,R=A(C,f),P={ref:i,id:o,role:"radio","aria-checked":R?"true":"false","aria-labelledby":s,"aria-describedby":l,"aria-disabled":!!I||void 0,tabIndex:I?-1:R||!w&&_?0:-1,onClick:I?void 0:E,onFocus:I?void 0:M,onBlur:I?void 0:T},k=(0,c.useMemo)((()=>({checked:R,disabled:I,active:h(2)})),[R,I,h]);return t(c).createElement(u,{name:"RadioGroup.Description"},t(c).createElement(a,{name:"RadioGroup.Label"},Ua({ourProps:P,theirProps:g,slot:k,defaultTag:"div",name:"RadioGroup.Option"})))})),$f=Object.assign(Qf,{Option:Xf,Label:Bf,Description:ec});var Zf=({sendOnEnter:e,setSendOnEnter:n})=>{const{t:r}=ve();return(0,s.jsxs)(qd,{as:"div",className:"memori-send-on-enter-menu",children:[(0,s.jsx)(qd.Button,{className:t(ys)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button"),children:(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)("span",{style:{display:"block",width:"1rem",height:"1rem"},children:"…"})})}),(0,s.jsx)(qd.Items,{className:"memori-menu--overlay",children:(0,s.jsxs)($f,{value:e,onChange:n,children:[(0,s.jsx)($f.Option,{value:"keypress",className:"memori-menu--option",children:({checked:e})=>(0,s.jsx)(qd.Item,{children:(0,s.jsx)(Da,{className:"memori-menu--button",ghost:!0,outlined:e,icon:(0,s.jsx)("span",{className:"memori-menu--icon",children:e?"✓":""}),children:r("widget.sendOnKeypress")})})}),(0,s.jsx)($f.Option,{value:"click",className:"memori-menu--option",children:({checked:e})=>(0,s.jsx)(qd.Item,{children:(0,s.jsx)(Da,{className:"memori-menu--button",ghost:!0,outlined:e,icon:(0,s.jsx)("span",{className:"memori-menu--icon",children:e?"✓":""}),children:r("widget.sendOnClick")})})})]})})]})};c=o("85Hg2");var em=({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:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 0 0 0 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0 0 13.5-4.7L863.9 169a7.9 7.9 0 0 0-8.9-8.9zM416.6 562.3a8.03 8.03 0 0 0-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 0 0-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"})});var tm=({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:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 0 0 0 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 0 0 391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 0 0-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"})});var nm=({disabled:e=!1,value:n,onChange:r,onPressEnter:i,onFocus:o,onBlur:a})=>{const{t:l}=ve(),[u,d]=(0,c.useState)(!1);return(0,s.jsx)("div",{"data-testid":"chat-textarea",className:t(ys)("memori-chat-textarea",{"memori-chat-textarea--expanded":u,"memori-chat-textarea--disabled":e}),children:(0,s.jsxs)("div",{className:"memori-chat-textarea--inner",children:[(0,s.jsx)("textarea",{className:"memori-chat-textarea--input",disabled:e,value:n,onChange:e=>{r(e.target.value)},onKeyDownCapture:e=>{"Enter"===e.key&&!e.shiftKey&&i&&i(e)},onFocus:o,onBlur:a}),(0,s.jsx)("div",{className:"memori-chat-textarea--expand",children:(0,s.jsx)(Da,{className:t(ys)("memori-chat-textarea--expand-button"),onClick:()=>d(!u),padded:!1,ghost:!0,title:u?l("collapse")||"Collapse":l("expand")||"Expand",icon:u?(0,s.jsx)(tm,{}):(0,s.jsx)(em,{})})})]})})};var rm=({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:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})});c=o("85Hg2");var im=({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:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})});var om=({listening:e,stopAudio:n,startListening:r,stopListening:i})=>{const{t:o}=ve(),[a,l]=(0,c.useState)(),u=(0,c.useRef)(null),d=e=>{e.preventDefault(),l(o("write_and_speak.holdToSpeak")||"Hold to record"),u.current||(u.current=setTimeout((()=>{n(),l(o("write_and_speak.releaseToEndListening")||"Release to end listening"),r()}),300))},p=()=>{u.current&&(clearTimeout(u.current),u.current=null),i(),l(void 0)};return(0,c.useEffect)((()=>()=>p()),[]),(0,s.jsx)(Ed,{visible:!!a,content:(0,s.jsx)("span",{children:a||o("write_and_speak.pressAndHoldToSpeak")||"Press and hold to speak"}),align:"topLeft",className:"memori-mic-btn-tooltip",children:(0,s.jsx)(Da,{primary:!0,className:t(ys)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":e}),title:e?o("write_and_speak.micButtonPopoverListening")||"Listening":o("write_and_speak.micButtonPopover")||"Start listening",onMouseDown:d,onTouchStart:d,onMouseUp:p,onMouseLeave:p,onTouchEnd:p,shape:"circle",icon:(0,s.jsx)(im,{})})})};var sm=({dialogState:e,sendOnEnter:n="click",setSendOnEnter:r,userMessage:i="",onChangeUserMessage:o,sendMessage:a,onTextareaFocus:l,onTextareaBlur:c,onTextareaPressEnter:u,showMicrophone:d=!1,microphoneMode:p="HOLD_TO_TALK",listening:h=!1,stopAudio:f,startListening:m,stopListening:g})=>{const{t:v}=ve();return(0,s.jsxs)("fieldset",{id:"chat-fieldset",className:"memori-chat-inputs",disabled:"X2a"===(null==e?void 0:e.state)||"X3"===(null==e?void 0:e.state),children:[(0,s.jsx)(Zf,{sendOnEnter:n,setSendOnEnter:r}),(0,s.jsx)(nm,{value:i,onChange:o,onPressEnter:u,onFocus:l,onBlur:c,disabled:["R2","R3","R4","R5","G3","X3"].includes((null==e?void 0:e.state)||"")}),(0,s.jsx)(Da,{shape:"circle",primary:!!(null==i?void 0:i.length),disabled:!i||0===i.length,className:"memori-chat-inputs--send",onClick:()=>{a(i),f(),speechSynthesis.speak(new SpeechSynthesisUtterance(""))},title:v("send")||"Send",icon:(0,s.jsx)(rm,{})}),d&&"HOLD_TO_TALK"===p&&(0,s.jsx)(om,{listening:h,startListening:m,stopListening:()=>{g(),(null==i?void 0:i.length)&&a(i)},stopAudio:f}),d&&"CONTINUOUS"===p&&(0,s.jsx)(Da,{primary:!0,className:t(ys)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":h}),title:h?v("write_and_speak.micButtonPopoverListening")||"Listening":v("write_and_speak.micButtonPopover")||"Start listening",onClick:()=>{h?g():(f(),m())},shape:"circle",icon:(0,s.jsx)(im,{})})]})};c=o("85Hg2");const am={en:[{delayAfter:3,text:"Generating an accurate and fancy response..."},{delayAfter:3,text:"Generating a response that will blow your mind..."},{delayAfter:3,text:"Generating a response that will make you smile..."},{delayAfter:3,text:"Thinking of a response..."},{delayAfter:3,text:"Thinking of a response that will make you smile..."},{delayAfter:3,text:"Gathering my thoughts..."},{delayAfter:3,text:"Gathering my thoughts to give you a response..."}],it:[{delayAfter:3,text:"Sto generando una risposta accurata e fantasiosa..."},{delayAfter:3,text:"Sto generando una risposta che ti farà impazzire..."},{delayAfter:3,text:"Sto generando una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto pensando ad una risposta..."},{delayAfter:3,text:"Sto pensando ad una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri per darti una risposta..."}]},lm=(e=3)=>new Array(20*e).fill(" ").join("");var cm=({useDefaultSentences:e=!1,lang:t="en",sentence:n,sentences:r})=>{var i;const[o,a]=(0,c.useState)(0),[l,u]=(0,c.useState)((null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.length)?`${r[t][0].text.endsWith("...")||!r[t][0].text.length?r[t][0].text:`${r[t][0].text}...`}${lm(r[t][0].delayAfter)}`:n?`${n.endsWith("...")||!n.length?n:`${n}...`}${lm()}`:""),[d,p]=(0,c.useState)("");return(0,c.useEffect)((()=>{const i=setInterval((()=>{var i;const s=l[d.length];if(void 0!==s&&l.length>0)p((e=>e+s));else if((null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.length)&&o<r[t].length-1){const e=o+1,n=r[t][e];u(`${n.text.endsWith("...")||!n.text.length?n.text:`${n.text}...`}${lm(n.delayAfter)}`),p(""),a(e)}else if(!r&&!n&&e){const e=am[t][Math.floor(Math.random()*am[t].length)];u(`${e.text}${lm(e.delayAfter)}`),p("")}}),50);return()=>clearInterval(i)})),(0,s.jsx)("div",{className:"memori-chat--bubble",children:(0,s.jsxs)("div",{className:"memori-chat--bubble-typing",children:[(0,s.jsxs)("div",{id:"wave",children:[(0,s.jsx)("span",{className:"dot"}),(0,s.jsx)("span",{className:"dot"}),(0,s.jsx)("span",{className:"dot"})]}),l.length>0&&(0,s.jsx)("p",{children:d})]})})};var um=(0,c.memo)((({memori:e,tenant:n,sessionID:r,baseUrl:i,apiUrl:o,translateTo:a,memoriTyping:l,typingText:u,showTypingText:d=!1,history:p=[],authToken:h,dialogState:f,simulateUserPrompt:m,showDates:g=!1,showContextPerLine:v=!1,showAIicon:y=!0,selectReceiverTag:b,preview:S=!1,instruct:x=!1,showInputs:w=!0,showMicrophone:C=!1,microphoneMode:A="HOLD_TO_TALK",sendOnEnter:E,setSendOnEnter:M,attachmentsMenuOpen:T,setAttachmentsMenuOpen:_,userMessage:I="",onChangeUserMessage:R,sendMessage:P,listening:k,isPlayingAudio:O,stopAudio:N,startListening:D,stopListening:L,resetTranscript:B,customMediaRenderer:z,user:F,userAvatar:U,experts:j})=>{var H,V,G,W,q,K,J,Q;const Y=()=>{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)}),200)};(0,c.useEffect)((()=>{!S&&Y()}),[p,S]);return(0,s.jsxs)("div",{className:t(ys)("memori-chat--wrapper",{"memori-chat-wrapper--translate":a}),id:"chat-wrapper",lang:null==a?void 0:a.toUpperCase(),"data-memori-lang":null!==(W=null===(G=null===(V=null===(H=e.culture)||void 0===H?void 0:H.split("-"))||void 0===V?void 0:V[0])||void 0===G?void 0:G.toUpperCase())&&void 0!==W?W:"EN",children:[(0,s.jsx)("div",{className:t(ys)("memori-chat--history",{"memori-chat--history-touch":vd()}),children:(0,s.jsxs)("div",{className:t(ys)("memori-chat--content",{"memori-chat--content-touch":vd()}),children:[(0,s.jsx)("div",{className:t(ys)("memori-chat--cover"),style:{backgroundImage:`url("${wd({type:"cover",tenantID:null==n?void 0:n.id,resourceURI:e.coverURL,baseURL:i,apiURL:o})}"), url("${wd({type:"cover",tenantID:null==n?void 0:n.id,baseURL:i||"https://www.aisuru.com",apiURL:o})}")`}}),p.map(((l,u)=>{var d,h,b,S;return(0,s.jsxs)(t(c).Fragment,{children:[(0,s.jsx)(ep,{isFirst:0===u,message:l,memori:e,tenant:n,baseUrl:i,apiUrl:o,simulateUserPrompt:m,showAIicon:y,showFeedback:u===p.length-1&&!l.fromUser&&(null==f?void 0:f.acceptsFeedback),user:F,userAvatar:U,experts:j}),g&&!!l.timestamp&&(0,s.jsx)("small",{className:"memori-chat--timestamp "+(l.fromUser?"text-right":"text-left"),children:new Intl.DateTimeFormat("it",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(l.timestamp.endsWith("Z")?l.timestamp:`${l.timestamp}Z`))}),v&&!!Object.keys(null!==(d=l.contextVars)&&void 0!==d?d:{}).length&&(0,s.jsx)("div",{className:"memori-chat--context-vars",children:Object.keys(null!==(h=l.contextVars)&&void 0!==h?h:{}).map((e=>{var t,n,r;return"-"===(null===(t=l.contextVars)||void 0===t?void 0:t[e])?(0,s.jsx)("div",{className:"memori-chat--context-tag memori-chat--context-tag-canceled",children:(0,s.jsx)("span",{className:"memori-chat--context-tag-text",children:e})},e):"✔️"===(null===(n=l.contextVars)||void 0===n?void 0:n[e])?(0,s.jsx)("div",{className:"memori-chat--context-tag",children:(0,s.jsx)("span",{className:"memori-chat--context-tag-text",children:e})},e):(0,s.jsx)("div",{className:"memori-chat--context-tag",children:(0,s.jsxs)("span",{className:"memori-chat--context-tag-text",children:[e,": ",null===(r=l.contextVars)||void 0===r?void 0:r[e]]})},e)}))}),(0,s.jsx)(kf,{simulateUserPrompt:m,media:null===(b=null==l?void 0:l.media)||void 0===b?void 0:b.filter((e=>"text/html"!==e.mimeType&&"text/plain"!==e.mimeType)),links:null===(S=null==l?void 0:l.media)||void 0===S?void 0:S.filter((e=>"text/html"===e.mimeType)),sessionID:r,baseUrl:i,apiUrl:o,translateTo:a,customMediaRenderer:z})]},u)})),(null==f?void 0:f.hints)&&f.hints.length>0&&(0,s.jsx)(kf,{simulateUserPrompt:m,hints:f.translatedHints?f.translatedHints:f.hints.map((e=>({text:e,originalText:e})))}),!!l&&(0,s.jsx)(cm,{useDefaultSentences:d,lang:a?"it"===a.toLowerCase()?"it":"en":"it"===(null===(J=null===(K=null===(q=e.culture)||void 0===q?void 0:q.split("-"))||void 0===K?void 0:K[0])||void 0===J?void 0:J.toLowerCase())?"it":"en",sentence:u,sentences:e.enableBoardOfExperts?pp:void 0},u),(0,s.jsx)("div",{id:"end-messages-ref"})]})}),"X3"===(null==f?void 0:f.state)&&r&&(0,s.jsx)("div",{className:"memori-chat--known-tags",children:Object.keys(null!==(Q=f.knownTags)&&void 0!==Q?Q:{}).filter((t=>t!==e.giverTag)).map((e=>{var t;return(0,s.jsx)(Da,{icon:(0,s.jsx)("span",{className:"memori-chat--known-tag-icon",children:e}),className:"memori-chat--known-tag",onClick:()=>b(e),children:null===(t=f.knownTags)||void 0===t?void 0:t[e]},e)}))}),w&&(0,s.jsx)(sm,{userMessage:I,onChangeUserMessage:R,dialogState:f,instruct:x,authToken:h,sendMessage:P,microphoneMode:A,sendOnEnter:E,setSendOnEnter:M,attachmentsMenuOpen:T,setAttachmentsMenuOpen:_,onTextareaPressEnter:()=>{"keypress"===E&&(null==I?void 0:I.length)>0&&(L(),P(I),R(""),B())},onTextareaFocus:()=>{var e,t,n,r;L(),vd()&&window.innerWidth<=768&&(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t||t.add("chat-focused"),null===(r=null===(n=document.querySelector(".memori.memori-widget"))||void 0===n?void 0:n.classList)||void 0===r||r.add("chat-focused"),setTimeout((()=>{Y()}),300))},onTextareaBlur:()=>{var e,t,n,r,i;(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t?void 0:t.contains("chat-focused"))&&(null===(n=document.getElementById("chat-wrapper"))||void 0===n||n.classList.remove("chat-focused"),null===(i=null===(r=document.querySelector(".memori.memori-widget"))||void 0===r?void 0:r.classList)||void 0===i||i.remove("chat-focused"),Y())},startListening:D,stopListening:L,stopAudio:N,listening:k,isPlayingAudio:O,showMicrophone:C})]})}));c=o("85Hg2");var dm=({className:e,title:t})=>(0,s.jsxs)("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:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}),(0,s.jsx)("path",{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4c-1.3-3.2-4.3-5.4-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"})]});var pm=({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:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"})});var hm=({memoriName:e,blockedUntil:t,showGiverInfo:n=!1,showTitle:r=!1,marginLeft:i=!1})=>{const{t:o}=ve(),a=new Date(t);return a>new Date?(0,s.jsx)(Ed,{className:"blocked-memori-badge--tooltip",content:(0,s.jsxs)(s.Fragment,{children:[!n&&o("memoriBlockedAnon",{name:e,date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(a)}),n&&o("memoriBlockedUntil",{date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(a)}),n&&` ${o("memoriBlockedReasonExceedChats")}`,n&&(0,s.jsx)("br",{}),n&&`\n${o("memoriBlockedGiverHelper")}`]}),children:(0,s.jsxs)("div",{className:"blocked-memori-badge--wrapper",children:[(0,s.jsx)("div",{className:"blocked-memori-badge "+(i?" margin-left":""),children:(0,s.jsx)(pm,{className:"blocked-memori-badge--icon"})}),r&&(0,s.jsx)("span",{className:"blocked-memori-badge--title",children:o("memoriBlockedTitle")})]})}):null};var fm=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",width:"20",height:"16",viewBox:"0 0 640 512",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M211.2 96a64 64 0 10-128 0 64 64 0 10128 0zM32 256c0 17.7 14.3 32 32 32h85.6c10.1-39.4 38.6-71.5 75.8-86.6-9.7-6-21.2-9.4-33.4-9.4H96c-35.3 0-64 28.7-64 64zm461.6 32H576c17.7 0 32-14.3 32-32 0-35.3-28.7-64-64-64h-96c-11.7 0-22.7 3.1-32.1 8.6 38.1 14.8 67.4 47.3 77.7 87.4zm-102.4-61.6c-6.9-1.6-14.2-2.4-21.6-2.4h-96c-8.5 0-16.7 1.1-24.5 3.1-30.8 8.1-55.6 31.1-66.1 60.9-3.5 10-5.5 20.8-5.5 32 0 17.7 14.3 32 32 32h224c17.7 0 32-14.3 32-32 0-11.2-1.9-22-5.5-32-10.8-30.7-36.8-54.2-68.9-61.6zM563.2 96a64 64 0 10-128 0 64 64 0 10128 0zm-241.6 96a80 80 0 100-160 80 80 0 100 160zM32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32h576c17.7 0 32-14.3 32-32s-14.3-32-32-32H32z"})});var mm=({className:e,title:t})=>(0,s.jsxs)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",width:"20",height:"20",viewBox:"0 0 48 48",className:e,"aria-label":t,children:[(0,s.jsx)("path",{d:"M30.106 48v-2.745a2.213 2.213 0 012.213-2.212h6.11a2.392 2.392 0 002.326-2.466v-3.223a1.834 1.834 0 01.459-1.145 2.912 2.912 0 00.712-1.926l-.007-.667a1.016 1.016 0 01.651-.952h1.067a1.363 1.363 0 001.051-.456 1.304 1.304 0 00.19-1.395 67.032 67.032 0 01-3.037-7.51 4.767 4.767 0 01-.217-1.507l-.002-4.994a14.513 14.513 0 00-.552-3.963l-.006-.022a13.959 13.959 0 00-3.137-5.702q-.479-.516-1.006-1.003a17.67 17.67 0 00-.677-.623A18.303 18.303 0 0024.194 1a19.617 19.617 0 00-12.539 4.489 17.555 17.555 0 00-3.945 21.69C9.945 31.507 11.694 38.622 12.14 46v2",strokeMiterlimit:10}),(0,s.jsx)("path",{d:"M27.917 12L31.417 12"}),(0,s.jsx)("path",{d:"M27.917 26L31.417 26"}),(0,s.jsx)("path",{d:"M29.667 12L29.667 26"}),(0,s.jsx)("path",{d:"M23.992 26L19.904 12 19.226 12 15.159 26"}),(0,s.jsx)("path",{d:"M16.854 21.133L22.276 21.133"})]});c=o("85Hg2");var gm=({forceStatus:e,provider:t})=>{var n;const{t:r}=ve(),[i,o]=(0,c.useState)(null!=e?e:"none"),a=(e=>{switch(e){case"DEFAULT":case"OpenAI":return{getStatus:async()=>{var e;const t=await fetch("https://status.openai.com/api/v2/summary.json");return null!==(e=(await t.json()).status.indicator)&&void 0!==e?e:"none"},statusPage:"https://status.openai.com/"};default:return{getStatus:async()=>"none",statusPage:""}}})(t);return(0,c.useEffect)((()=>{e||a.getStatus().then((e=>o(e)))}),[e,t]),"none"!==i?(0,s.jsx)(Ed,{className:"memori--completion-provider-status--tooltip",align:"topLeft",content:(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:r("completionProviderDown",{provider:null!=t?t:r("completionProviderFallbackName")})}),!!(null===(n=a.statusPage)||void 0===n?void 0:n.length)&&(0,s.jsx)("p",{children:(0,s.jsx)("a",{href:a.statusPage,rel:"noopener noreferrer",target:"_blank",children:r("completionProviderCheckStatusPage")})})]}),children:(0,s.jsx)(pm,{className:"memori--completion-provider-status--icon"})}):null};var vm=({memori:e,tenant:t,gamificationLevel:n,language:r,userLang:i,setUserLang:o,baseUrl:a,apiUrl:l,position:u,openPositionDrawer:d,integrationConfig:p,instruct:h=!1,clickedStart:f,onClickStart:m,initializeTTS:g,_TEST_forceProviderStatus:v,isUserLoggedIn:y=!1,user:b,showLogin:S=!1,setShowLoginDrawer:x})=>{var w,C;const{t:A,i18n:E}=ve(),[M,T]=(0,c.useState)(e.description),[_,I]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{var t,n,i,o,s,l;(null!==(n=null===(t=E.language)||void 0===t?void 0:t.toUpperCase())&&void 0!==n?n:"IT")!==(null!==(i=null==r?void 0:r.toUpperCase())&&void 0!==i?i:"IT")&&(null===(o=e.description)||void 0===o?void 0:o.length)&&lp(e.description,null!==(l=null===(s=E.language)||void 0===s?void 0:s.toUpperCase())&&void 0!==l?l:"IT",r,a).then((e=>{T(e.text)})).catch(console.error)}),[E.language,r,e.description,a]),(0,s.jsxs)("div",{className:"memori--start-panel",children:[(0,s.jsxs)("div",{className:"memori--cover",style:{backgroundImage:`url("${wd({type:"cover",tenantID:null==t?void 0:t.id,resourceURI:e.coverURL,baseURL:a,apiURL:l})}"), url("${wd({type:"cover",tenantID:null==t?void 0:t.id,baseURL:a,apiURL:l})}")`},children:[!!(null===(w=null==n?void 0:n.badge)||void 0===w?void 0:w.length)&&!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--gamification-badge",children:(0,s.jsx)(Ed,{align:"left",content:`${A("gamification.level")} ${n.badge}, ${n.points} ${A("gamification.points")}`,children:(0,s.jsx)("span",{"aria-label":`${A("gamification.level")} ${n.badge}, ${n.points} ${A("gamification.points")}`,children:n.badge})})}),!!e.enableCompletions&&!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--completions-enabled",children:(0,s.jsx)(Ed,{align:"left",content:A("completionsEnabled"),children:(0,s.jsx)("span",{"aria-label":A("completionsEnabled")||"Completions",children:(0,s.jsx)(Ad,{})})})}),!!e.enableBoardOfExperts&&(0,s.jsx)("div",{className:"memori--board-of-experts",children:(0,s.jsx)(Ed,{align:"left",content:A("boardOfExperts"),children:(0,s.jsx)("span",{"aria-label":A("boardOfExperts")||"Board of Experts",children:(0,s.jsx)(fm,{})})})}),!!e.nsfw&&(0,s.jsx)("div",{className:"memori--nsfw",children:(0,s.jsx)(Ed,{align:"left",content:A("nsfw"),children:(0,s.jsx)("span",{title:A("nsfw")||"NSFW",children:"🔞"})})})]}),(0,s.jsxs)("picture",{className:"memori--avatar",children:[(0,s.jsx)("source",{src:null!==(C=e.avatarURL)&&void 0!==C?C:wd({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:a,apiURL:l})}),(0,s.jsx)("img",{alt:e.name,src:e.avatarURL&&e.avatarURL.length>0?wd({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:a,apiURL:l}):wd({type:"avatar",tenantID:null==t?void 0:t.id,baseURL:a,apiURL:l})})]}),(0,s.jsx)("h2",{className:"memori--title",children:e.name}),e.needsPosition&&!u&&(0,s.jsxs)("div",{className:"memori--needsPosition",children:[(0,s.jsx)("p",{children:A("write_and_speak.requirePosition")}),(0,s.jsx)(Da,{primary:!0,onClick:()=>d(),className:"memori--start-button",children:A("widget.position")})]}),(e.needsPosition&&u||!e.needsPosition)&&(0,s.jsxs)("div",{className:"memori--description",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"memori--description-text",children:M&&_?M:e.description}),M!==e.description&&(0,s.jsx)(Da,{ghost:!0,className:"memori--translation-toggle",icon:(0,s.jsx)(dm,{}),onClick:()=>{I((e=>!e))},children:A(_?"showOriginalText":"showTranslatedText")})]}),(null==p?void 0:p.multilanguage)&&!h&&(0,s.jsxs)("div",{className:"memori--language-chooser",children:[(0,s.jsx)("label",{id:"user-lang-pref-label",htmlFor:"user-lang-pref",children:A("write_and_speak.iWantToTalkToIn",{name:e.name})}),(0,s.jsx)("select",{id:"user-lang-pref",className:"memori-select--button",value:(null!=i?i:E.language).toUpperCase(),"aria-labelledby":"user-lang-pref-label",onChange:e=>{o(e.target.value)},children:cp.map((e=>(0,s.jsx)("option",{value:e.value,"aria-label":e.label,children:e.label},e.value)))})]}),(0,s.jsx)(Da,{primary:!0,disabled:!!e.blockedUntil&&!e.isGiver,loading:f,onClick:e=>{try{window.speechSynthesis.speak(new SpeechSynthesisUtterance(""))}catch(e){console.error(e)}g&&g(),m&&m()},className:"memori--start-button",children:A("write_and_speak."+(h?"instructButton":"tryMeButton"))}),(0,s.jsx)(gm,{provider:e.completionProvider,forceStatus:v}),(0,s.jsx)("p",{className:"memori--start-description",children:A(h?"write_and_speak.pageInstructExplanation":"write_and_speak.pageTryMeExplanation")}),!!e.blockedUntil&&(0,s.jsx)(hm,{memoriName:e.name,blockedUntil:e.blockedUntil,showGiverInfo:e.isGiver,showTitle:!0,marginLeft:!0}),!!e.enableDeepThought&&!h&&(0,s.jsxs)("div",{className:"memori--deep-thought-disclaimer",children:[(0,s.jsx)(Ed,{align:"left",content:A("deepThoughtHelper"),children:(0,s.jsx)(mm,{})}),(0,s.jsx)("h2",{children:y&&(null==b?void 0:b.pAndCUAccepted)?A("deepThoughtDisclaimerTitle"):A("deepThought")}),y&&!(null==b?void 0:b.pAndCUAccepted)&&(0,s.jsx)("p",{children:A("deepThoughtPreDisclaimerNotAllowed")}),!y&&(0,s.jsx)("p",{children:A("deepThoughtPreDisclaimerUnlogged")}),!y&&S&&(0,s.jsx)("p",{children:(0,s.jsx)(Da,{outlined:!0,padded:!1,onClick:()=>x(!0),children:"Login"})}),(0,s.jsx)("p",{className:"memori--deep-thought-disclaimer-text",children:A("deepThoughtDisclaimer")})]})]})]})},ym=(c=o("85Hg2"),c=o("85Hg2"),K=o("hcaHr"),c=o("85Hg2"),["forwardedRef"]);function bm(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 Sm(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?bm(Object(r),!0).forEach((function(n){t(J)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}class xm extends c.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,s.jsxs)("div",{style:{background:"rgba(255, 255, 255, 0.4)",color:"#000",padding:"2rem",borderRadius:"10px"},children:[(0,s.jsx)("h2",{children:this.props.t("error.generic")}),(0,s.jsx)(Da,{primary:!0,onClick:()=>this.setState({hasError:!1}),children:this.props.t("error.tryAgain")||"Try again"})]}):this.props.children}}var wm=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r){function i(i){var o=i.forwardedRef,s=t(Ip)(i,ym),a=ve(e,Sm(Sm({},s),{},{keyPrefix:n.keyPrefix})),l=t(K)(a,3),u=l[0],d=l[1],p=l[2],h=Sm(Sm({},s),{},{t:u,i18n:d,tReady:p});return n.withRef&&o?h.ref=o:!n.withRef&&o&&(h.forwardedRef=o),(0,c.createElement)(r,h)}i.displayName="withI18nextTranslation(".concat(he(r),")"),i.WrappedComponent=r;return n.withRef?(0,c.forwardRef)((function(e,t){return(0,c.createElement)(i,Object.assign({},e,{forwardedRef:t}))})):i}}(["common"])(xm),Cm=(c=o("85Hg2"),c=o("85Hg2"),{});e(Cm,"REVISION",(()=>Am)),e(Cm,"MOUSE",(()=>Em)),e(Cm,"TOUCH",(()=>Mm)),e(Cm,"CullFaceNone",(()=>Tm)),e(Cm,"CullFaceBack",(()=>_m)),e(Cm,"CullFaceFront",(()=>Im)),e(Cm,"CullFaceFrontBack",(()=>Rm)),e(Cm,"BasicShadowMap",(()=>Pm)),e(Cm,"PCFShadowMap",(()=>km)),e(Cm,"PCFSoftShadowMap",(()=>Om)),e(Cm,"VSMShadowMap",(()=>Nm)),e(Cm,"FrontSide",(()=>Dm)),e(Cm,"BackSide",(()=>Lm)),e(Cm,"DoubleSide",(()=>Bm)),e(Cm,"NoBlending",(()=>zm)),e(Cm,"NormalBlending",(()=>Fm)),e(Cm,"AdditiveBlending",(()=>Um)),e(Cm,"SubtractiveBlending",(()=>jm)),e(Cm,"MultiplyBlending",(()=>Hm)),e(Cm,"CustomBlending",(()=>Vm)),e(Cm,"AddEquation",(()=>Gm)),e(Cm,"SubtractEquation",(()=>Wm)),e(Cm,"ReverseSubtractEquation",(()=>qm)),e(Cm,"MinEquation",(()=>Km)),e(Cm,"MaxEquation",(()=>Jm)),e(Cm,"ZeroFactor",(()=>Qm)),e(Cm,"OneFactor",(()=>Ym)),e(Cm,"SrcColorFactor",(()=>Xm)),e(Cm,"OneMinusSrcColorFactor",(()=>$m)),e(Cm,"SrcAlphaFactor",(()=>Zm)),e(Cm,"OneMinusSrcAlphaFactor",(()=>eg)),e(Cm,"DstAlphaFactor",(()=>tg)),e(Cm,"OneMinusDstAlphaFactor",(()=>ng)),e(Cm,"DstColorFactor",(()=>rg)),e(Cm,"OneMinusDstColorFactor",(()=>ig)),e(Cm,"SrcAlphaSaturateFactor",(()=>og)),e(Cm,"NeverDepth",(()=>sg)),e(Cm,"AlwaysDepth",(()=>ag)),e(Cm,"LessDepth",(()=>lg)),e(Cm,"LessEqualDepth",(()=>cg)),e(Cm,"EqualDepth",(()=>ug)),e(Cm,"GreaterEqualDepth",(()=>dg)),e(Cm,"GreaterDepth",(()=>pg)),e(Cm,"NotEqualDepth",(()=>hg)),e(Cm,"MultiplyOperation",(()=>fg)),e(Cm,"MixOperation",(()=>mg)),e(Cm,"AddOperation",(()=>gg)),e(Cm,"NoToneMapping",(()=>vg)),e(Cm,"LinearToneMapping",(()=>yg)),e(Cm,"ReinhardToneMapping",(()=>bg)),e(Cm,"CineonToneMapping",(()=>Sg)),e(Cm,"ACESFilmicToneMapping",(()=>xg)),e(Cm,"CustomToneMapping",(()=>wg)),e(Cm,"UVMapping",(()=>Cg)),e(Cm,"CubeReflectionMapping",(()=>Ag)),e(Cm,"CubeRefractionMapping",(()=>Eg)),e(Cm,"EquirectangularReflectionMapping",(()=>Mg)),e(Cm,"EquirectangularRefractionMapping",(()=>Tg)),e(Cm,"CubeUVReflectionMapping",(()=>_g)),e(Cm,"RepeatWrapping",(()=>Ig)),e(Cm,"ClampToEdgeWrapping",(()=>Rg)),e(Cm,"MirroredRepeatWrapping",(()=>Pg)),e(Cm,"NearestFilter",(()=>kg)),e(Cm,"NearestMipmapNearestFilter",(()=>Og)),e(Cm,"NearestMipMapNearestFilter",(()=>Ng)),e(Cm,"NearestMipmapLinearFilter",(()=>Dg)),e(Cm,"NearestMipMapLinearFilter",(()=>Lg)),e(Cm,"LinearFilter",(()=>Bg)),e(Cm,"LinearMipmapNearestFilter",(()=>zg)),e(Cm,"LinearMipMapNearestFilter",(()=>Fg)),e(Cm,"LinearMipmapLinearFilter",(()=>Ug)),e(Cm,"LinearMipMapLinearFilter",(()=>jg)),e(Cm,"UnsignedByteType",(()=>Hg)),e(Cm,"ByteType",(()=>Vg)),e(Cm,"ShortType",(()=>Gg)),e(Cm,"UnsignedShortType",(()=>Wg)),e(Cm,"IntType",(()=>qg)),e(Cm,"UnsignedIntType",(()=>Kg)),e(Cm,"FloatType",(()=>Jg)),e(Cm,"HalfFloatType",(()=>Qg)),e(Cm,"UnsignedShort4444Type",(()=>Yg)),e(Cm,"UnsignedShort5551Type",(()=>Xg)),e(Cm,"UnsignedInt248Type",(()=>$g)),e(Cm,"AlphaFormat",(()=>Zg)),e(Cm,"RGBFormat",(()=>ev)),e(Cm,"RGBAFormat",(()=>tv)),e(Cm,"LuminanceFormat",(()=>nv)),e(Cm,"LuminanceAlphaFormat",(()=>rv)),e(Cm,"DepthFormat",(()=>iv)),e(Cm,"DepthStencilFormat",(()=>ov)),e(Cm,"RedFormat",(()=>sv)),e(Cm,"RedIntegerFormat",(()=>av)),e(Cm,"RGFormat",(()=>lv)),e(Cm,"RGIntegerFormat",(()=>cv)),e(Cm,"RGBAIntegerFormat",(()=>uv)),e(Cm,"RGB_S3TC_DXT1_Format",(()=>dv)),e(Cm,"RGBA_S3TC_DXT1_Format",(()=>pv)),e(Cm,"RGBA_S3TC_DXT3_Format",(()=>hv)),e(Cm,"RGBA_S3TC_DXT5_Format",(()=>fv)),e(Cm,"RGB_PVRTC_4BPPV1_Format",(()=>mv)),e(Cm,"RGB_PVRTC_2BPPV1_Format",(()=>gv)),e(Cm,"RGBA_PVRTC_4BPPV1_Format",(()=>vv)),e(Cm,"RGBA_PVRTC_2BPPV1_Format",(()=>yv)),e(Cm,"RGB_ETC1_Format",(()=>bv)),e(Cm,"RGB_ETC2_Format",(()=>Sv)),e(Cm,"RGBA_ETC2_EAC_Format",(()=>xv)),e(Cm,"RGBA_ASTC_4x4_Format",(()=>wv)),e(Cm,"RGBA_ASTC_5x4_Format",(()=>Cv)),e(Cm,"RGBA_ASTC_5x5_Format",(()=>Av)),e(Cm,"RGBA_ASTC_6x5_Format",(()=>Ev)),e(Cm,"RGBA_ASTC_6x6_Format",(()=>Mv)),e(Cm,"RGBA_ASTC_8x5_Format",(()=>Tv)),e(Cm,"RGBA_ASTC_8x6_Format",(()=>_v)),e(Cm,"RGBA_ASTC_8x8_Format",(()=>Iv)),e(Cm,"RGBA_ASTC_10x5_Format",(()=>Rv)),e(Cm,"RGBA_ASTC_10x6_Format",(()=>Pv)),e(Cm,"RGBA_ASTC_10x8_Format",(()=>kv)),e(Cm,"RGBA_ASTC_10x10_Format",(()=>Ov)),e(Cm,"RGBA_ASTC_12x10_Format",(()=>Nv)),e(Cm,"RGBA_ASTC_12x12_Format",(()=>Dv)),e(Cm,"RGBA_BPTC_Format",(()=>Lv)),e(Cm,"LoopOnce",(()=>Bv)),e(Cm,"LoopRepeat",(()=>zv)),e(Cm,"LoopPingPong",(()=>Fv)),e(Cm,"InterpolateDiscrete",(()=>Uv)),e(Cm,"InterpolateLinear",(()=>jv)),e(Cm,"InterpolateSmooth",(()=>Hv)),e(Cm,"ZeroCurvatureEnding",(()=>Vv)),e(Cm,"ZeroSlopeEnding",(()=>Gv)),e(Cm,"WrapAroundEnding",(()=>Wv)),e(Cm,"NormalAnimationBlendMode",(()=>qv)),e(Cm,"AdditiveAnimationBlendMode",(()=>Kv)),e(Cm,"TrianglesDrawMode",(()=>Jv)),e(Cm,"TriangleStripDrawMode",(()=>Qv)),e(Cm,"TriangleFanDrawMode",(()=>Yv)),e(Cm,"LinearEncoding",(()=>Xv)),e(Cm,"sRGBEncoding",(()=>$v)),e(Cm,"BasicDepthPacking",(()=>Zv)),e(Cm,"RGBADepthPacking",(()=>ey)),e(Cm,"TangentSpaceNormalMap",(()=>ty)),e(Cm,"ObjectSpaceNormalMap",(()=>ny)),e(Cm,"NoColorSpace",(()=>ry)),e(Cm,"SRGBColorSpace",(()=>iy)),e(Cm,"LinearSRGBColorSpace",(()=>oy)),e(Cm,"ZeroStencilOp",(()=>sy)),e(Cm,"KeepStencilOp",(()=>ay)),e(Cm,"ReplaceStencilOp",(()=>ly)),e(Cm,"IncrementStencilOp",(()=>cy)),e(Cm,"DecrementStencilOp",(()=>uy)),e(Cm,"IncrementWrapStencilOp",(()=>dy)),e(Cm,"DecrementWrapStencilOp",(()=>py)),e(Cm,"InvertStencilOp",(()=>hy)),e(Cm,"NeverStencilFunc",(()=>fy)),e(Cm,"LessStencilFunc",(()=>my)),e(Cm,"EqualStencilFunc",(()=>gy)),e(Cm,"LessEqualStencilFunc",(()=>vy)),e(Cm,"GreaterStencilFunc",(()=>yy)),e(Cm,"NotEqualStencilFunc",(()=>by)),e(Cm,"GreaterEqualStencilFunc",(()=>Sy)),e(Cm,"AlwaysStencilFunc",(()=>xy)),e(Cm,"StaticDrawUsage",(()=>wy)),e(Cm,"DynamicDrawUsage",(()=>Cy)),e(Cm,"StreamDrawUsage",(()=>Ay)),e(Cm,"StaticReadUsage",(()=>Ey)),e(Cm,"DynamicReadUsage",(()=>My)),e(Cm,"StreamReadUsage",(()=>Ty)),e(Cm,"StaticCopyUsage",(()=>_y)),e(Cm,"DynamicCopyUsage",(()=>Iy)),e(Cm,"StreamCopyUsage",(()=>Ry)),e(Cm,"GLSL1",(()=>Py)),e(Cm,"GLSL3",(()=>ky)),e(Cm,"_SRGBAFormat",(()=>Oy)),e(Cm,"EventDispatcher",(()=>Ny)),e(Cm,"MathUtils",(()=>Jy)),e(Cm,"Vector2",(()=>Qy)),e(Cm,"Matrix3",(()=>Yy)),e(Cm,"ColorManagement",(()=>ib)),e(Cm,"Color",(()=>db)),e(Cm,"ImageUtils",(()=>hb)),e(Cm,"Source",(()=>fb)),e(Cm,"Texture",(()=>vb)),e(Cm,"Vector4",(()=>yb)),e(Cm,"WebGLRenderTarget",(()=>bb)),e(Cm,"DataArrayTexture",(()=>Sb)),e(Cm,"WebGLArrayRenderTarget",(()=>xb)),e(Cm,"Data3DTexture",(()=>wb)),e(Cm,"WebGL3DRenderTarget",(()=>Cb)),e(Cm,"WebGLMultipleRenderTargets",(()=>Ab)),e(Cm,"Quaternion",(()=>Eb)),e(Cm,"Vector3",(()=>Mb)),e(Cm,"Box3",(()=>Ib)),e(Cm,"Sphere",(()=>Jb)),e(Cm,"Ray",(()=>nS)),e(Cm,"Matrix4",(()=>rS)),e(Cm,"Euler",(()=>hS)),e(Cm,"Layers",(()=>fS)),e(Cm,"Object3D",(()=>_S)),e(Cm,"Triangle",(()=>FS)),e(Cm,"Material",(()=>jS)),e(Cm,"MeshBasicMaterial",(()=>HS)),e(Cm,"BufferAttribute",(()=>WS)),e(Cm,"Int8BufferAttribute",(()=>qS)),e(Cm,"Uint8BufferAttribute",(()=>KS)),e(Cm,"Uint8ClampedBufferAttribute",(()=>JS)),e(Cm,"Int16BufferAttribute",(()=>QS)),e(Cm,"Uint16BufferAttribute",(()=>YS)),e(Cm,"Int32BufferAttribute",(()=>XS)),e(Cm,"Uint32BufferAttribute",(()=>$S)),e(Cm,"Float16BufferAttribute",(()=>ZS)),e(Cm,"Float32BufferAttribute",(()=>ex)),e(Cm,"Float64BufferAttribute",(()=>tx)),e(Cm,"BufferGeometry",(()=>cx)),e(Cm,"Mesh",(()=>Tx)),e(Cm,"BoxGeometry",(()=>Ix)),e(Cm,"UniformsUtils",(()=>kx)),e(Cm,"ShaderMaterial",(()=>Ox)),e(Cm,"Camera",(()=>Nx)),e(Cm,"PerspectiveCamera",(()=>Dx)),e(Cm,"CubeCamera",(()=>Bx)),e(Cm,"CubeTexture",(()=>zx)),e(Cm,"WebGLCubeRenderTarget",(()=>Fx)),e(Cm,"Plane",(()=>Vx)),e(Cm,"Frustum",(()=>qx)),e(Cm,"PlaneGeometry",(()=>Qx)),e(Cm,"ShaderChunk",(()=>Yx)),e(Cm,"UniformsLib",(()=>Xx)),e(Cm,"ShaderLib",(()=>$x)),e(Cm,"OrthographicCamera",(()=>ow)),e(Cm,"PMREMGenerator",(()=>fw)),e(Cm,"MeshDepthMaterial",(()=>uA)),e(Cm,"MeshDistanceMaterial",(()=>dA)),e(Cm,"WebGLUtils",(()=>mA)),e(Cm,"ArrayCamera",(()=>gA)),e(Cm,"Group",(()=>vA)),e(Cm,"DepthTexture",(()=>SA)),e(Cm,"WebGLRenderer",(()=>AA)),e(Cm,"WebGL1Renderer",(()=>EA)),e(Cm,"FogExp2",(()=>MA)),e(Cm,"Fog",(()=>TA)),e(Cm,"Scene",(()=>_A)),e(Cm,"InterleavedBuffer",(()=>IA)),e(Cm,"InterleavedBufferAttribute",(()=>PA)),e(Cm,"SpriteMaterial",(()=>kA)),e(Cm,"Sprite",(()=>qA)),e(Cm,"LOD",(()=>YA)),e(Cm,"SkinnedMesh",(()=>nE)),e(Cm,"Bone",(()=>rE)),e(Cm,"DataTexture",(()=>iE)),e(Cm,"Skeleton",(()=>aE)),e(Cm,"InstancedBufferAttribute",(()=>lE)),e(Cm,"InstancedMesh",(()=>hE)),e(Cm,"LineBasicMaterial",(()=>fE)),e(Cm,"Line",(()=>SE)),e(Cm,"LineSegments",(()=>CE)),e(Cm,"LineLoop",(()=>AE)),e(Cm,"PointsMaterial",(()=>EE)),e(Cm,"Points",(()=>RE)),e(Cm,"VideoTexture",(()=>kE)),e(Cm,"FramebufferTexture",(()=>OE)),e(Cm,"CompressedTexture",(()=>NE)),e(Cm,"CanvasTexture",(()=>DE)),e(Cm,"Curve",(()=>LE)),e(Cm,"EllipseCurve",(()=>BE)),e(Cm,"ArcCurve",(()=>zE)),e(Cm,"CatmullRomCurve3",(()=>GE)),e(Cm,"CubicBezierCurve",(()=>JE)),e(Cm,"CubicBezierCurve3",(()=>QE)),e(Cm,"LineCurve",(()=>YE)),e(Cm,"LineCurve3",(()=>XE)),e(Cm,"QuadraticBezierCurve",(()=>$E)),e(Cm,"QuadraticBezierCurve3",(()=>ZE)),e(Cm,"SplineCurve",(()=>eM)),e(Cm,"CurvePath",(()=>nM)),e(Cm,"Path",(()=>rM)),e(Cm,"LatheGeometry",(()=>iM)),e(Cm,"CapsuleGeometry",(()=>oM)),e(Cm,"CircleGeometry",(()=>sM)),e(Cm,"CylinderGeometry",(()=>aM)),e(Cm,"ConeGeometry",(()=>lM)),e(Cm,"PolyhedronGeometry",(()=>cM)),e(Cm,"DodecahedronGeometry",(()=>uM)),e(Cm,"EdgesGeometry",(()=>mM)),e(Cm,"Shape",(()=>gM)),e(Cm,"ShapeUtils",(()=>HM)),e(Cm,"ExtrudeGeometry",(()=>WM)),e(Cm,"IcosahedronGeometry",(()=>KM)),e(Cm,"OctahedronGeometry",(()=>JM)),e(Cm,"RingGeometry",(()=>QM)),e(Cm,"ShapeGeometry",(()=>YM)),e(Cm,"SphereGeometry",(()=>XM)),e(Cm,"TetrahedronGeometry",(()=>$M)),e(Cm,"TorusGeometry",(()=>ZM)),e(Cm,"TorusKnotGeometry",(()=>eT)),e(Cm,"TubeGeometry",(()=>tT)),e(Cm,"WireframeGeometry",(()=>nT)),e(Cm,"ShadowMaterial",(()=>oT)),e(Cm,"RawShaderMaterial",(()=>sT)),e(Cm,"MeshStandardMaterial",(()=>aT)),e(Cm,"MeshPhysicalMaterial",(()=>lT)),e(Cm,"MeshPhongMaterial",(()=>cT)),e(Cm,"MeshToonMaterial",(()=>uT)),e(Cm,"MeshNormalMaterial",(()=>dT)),e(Cm,"MeshLambertMaterial",(()=>pT)),e(Cm,"MeshMatcapMaterial",(()=>hT)),e(Cm,"LineDashedMaterial",(()=>fT)),e(Cm,"AnimationUtils",(()=>xT)),e(Cm,"Interpolant",(()=>wT)),e(Cm,"CubicInterpolant",(()=>CT)),e(Cm,"LinearInterpolant",(()=>AT)),e(Cm,"DiscreteInterpolant",(()=>ET)),e(Cm,"KeyframeTrack",(()=>MT)),e(Cm,"BooleanKeyframeTrack",(()=>TT)),e(Cm,"ColorKeyframeTrack",(()=>_T)),e(Cm,"NumberKeyframeTrack",(()=>IT)),e(Cm,"QuaternionLinearInterpolant",(()=>RT)),e(Cm,"QuaternionKeyframeTrack",(()=>PT)),e(Cm,"StringKeyframeTrack",(()=>kT)),e(Cm,"VectorKeyframeTrack",(()=>OT)),e(Cm,"AnimationClip",(()=>NT)),e(Cm,"Cache",(()=>LT)),e(Cm,"LoadingManager",(()=>BT)),e(Cm,"DefaultLoadingManager",(()=>zT)),e(Cm,"Loader",(()=>FT)),e(Cm,"FileLoader",(()=>HT)),e(Cm,"AnimationLoader",(()=>VT)),e(Cm,"CompressedTextureLoader",(()=>GT)),e(Cm,"ImageLoader",(()=>WT)),e(Cm,"CubeTextureLoader",(()=>qT)),e(Cm,"DataTextureLoader",(()=>KT)),e(Cm,"TextureLoader",(()=>JT)),e(Cm,"Light",(()=>QT)),e(Cm,"HemisphereLight",(()=>YT)),e(Cm,"SpotLight",(()=>n_)),e(Cm,"PointLight",(()=>a_)),e(Cm,"DirectionalLight",(()=>c_)),e(Cm,"AmbientLight",(()=>u_)),e(Cm,"RectAreaLight",(()=>d_)),e(Cm,"SphericalHarmonics3",(()=>p_)),e(Cm,"LightProbe",(()=>h_)),e(Cm,"MaterialLoader",(()=>f_)),e(Cm,"LoaderUtils",(()=>m_)),e(Cm,"InstancedBufferGeometry",(()=>g_)),e(Cm,"BufferGeometryLoader",(()=>v_)),e(Cm,"ObjectLoader",(()=>y_)),e(Cm,"ImageBitmapLoader",(()=>w_)),e(Cm,"AudioContext",(()=>A_)),e(Cm,"AudioLoader",(()=>E_)),e(Cm,"HemisphereLightProbe",(()=>M_)),e(Cm,"AmbientLightProbe",(()=>T_)),e(Cm,"StereoCamera",(()=>P_)),e(Cm,"Clock",(()=>k_)),e(Cm,"AudioListener",(()=>z_)),e(Cm,"Audio",(()=>F_)),e(Cm,"PositionalAudio",(()=>G_)),e(Cm,"AudioAnalyser",(()=>W_)),e(Cm,"PropertyMixer",(()=>q_)),e(Cm,"PropertyBinding",(()=>Z_)),e(Cm,"AnimationObjectGroup",(()=>eI)),e(Cm,"AnimationMixer",(()=>rI)),e(Cm,"Uniform",(()=>iI)),e(Cm,"UniformsGroup",(()=>sI)),e(Cm,"InstancedInterleavedBuffer",(()=>aI)),e(Cm,"GLBufferAttribute",(()=>lI)),e(Cm,"Raycaster",(()=>cI)),e(Cm,"Spherical",(()=>pI)),e(Cm,"Cylindrical",(()=>hI)),e(Cm,"Box2",(()=>mI)),e(Cm,"Line3",(()=>yI)),e(Cm,"SpotLightHelper",(()=>SI)),e(Cm,"SkeletonHelper",(()=>AI)),e(Cm,"PointLightHelper",(()=>MI)),e(Cm,"HemisphereLightHelper",(()=>RI)),e(Cm,"GridHelper",(()=>PI)),e(Cm,"PolarGridHelper",(()=>kI)),e(Cm,"DirectionalLightHelper",(()=>LI)),e(Cm,"CameraHelper",(()=>FI)),e(Cm,"BoxHelper",(()=>HI)),e(Cm,"Box3Helper",(()=>VI)),e(Cm,"PlaneHelper",(()=>GI)),e(Cm,"ArrowHelper",(()=>JI)),e(Cm,"AxesHelper",(()=>QI)),e(Cm,"ShapePath",(()=>YI)),e(Cm,"DataUtils",(()=>ZI)),e(Cm,"ImmediateRenderObject",(()=>eR)),e(Cm,"WebGLMultisampleRenderTarget",(()=>tR)),e(Cm,"DataTexture2DArray",(()=>nR)),e(Cm,"DataTexture3D",(()=>rR)),e(Cm,"BoxBufferGeometry",(()=>iR)),e(Cm,"CapsuleBufferGeometry",(()=>oR)),e(Cm,"CircleBufferGeometry",(()=>sR)),e(Cm,"ConeBufferGeometry",(()=>aR)),e(Cm,"CylinderBufferGeometry",(()=>lR)),e(Cm,"DodecahedronBufferGeometry",(()=>cR)),e(Cm,"ExtrudeBufferGeometry",(()=>uR)),e(Cm,"IcosahedronBufferGeometry",(()=>dR)),e(Cm,"LatheBufferGeometry",(()=>pR)),e(Cm,"OctahedronBufferGeometry",(()=>hR)),e(Cm,"PlaneBufferGeometry",(()=>fR)),e(Cm,"PolyhedronBufferGeometry",(()=>mR)),e(Cm,"RingBufferGeometry",(()=>gR)),e(Cm,"ShapeBufferGeometry",(()=>vR)),e(Cm,"SphereBufferGeometry",(()=>yR)),e(Cm,"TetrahedronBufferGeometry",(()=>bR)),e(Cm,"TorusBufferGeometry",(()=>SR)),e(Cm,"TorusKnotBufferGeometry",(()=>xR)),e(Cm,"TubeBufferGeometry",(()=>wR));
|
|
236
236
|
/**
|
|
237
237
|
* @license
|
|
238
238
|
* Copyright 2010-2022 Three.js Authors
|
|
@@ -243,4 +243,4 @@ const Am="144",Em={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Mm={ROTATE:0,
|
|
|
243
243
|
* @license qrcode.react
|
|
244
244
|
* Copyright (c) Paul O'Shannessy
|
|
245
245
|
* SPDX-License-Identifier: ISC
|
|
246
|
-
*/function rD(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 iD(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 oD(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 sD=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function aD(e){const n=e,{value:r,size:i=$N,level:o=ZN,bgColor:s=eD,fgColor:a=tD,includeMargin:l=nD,style:u,imageSettings:d}=n,p=QN(n,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=null==d?void 0:d.src,f=(0,c.useRef)(null),m=(0,c.useRef)(null),[g,v]=(0,c.useState)(!1);(0,c.useEffect)((()=>{if(null!=f.current){const e=f.current,t=e.getContext("2d");if(!t)return;let n=YN.QrCode.encodeText(r,XN[o]).getModules();const c=l?4:0,u=n.length+2*c,p=oD(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=iD(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,sD?t.fill(new Path2D(rD(n,c))):n.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+c,n+c,1,1)}))})),g&&t.drawImage(h,p.x+c,p.y+c,p.w,p.h)}})),(0,c.useEffect)((()=>{v(!1)}),[h]);const y=JN({height:i,width:i},u);let b=null;return null!=h&&(b=t(c).createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),t(c).createElement(t(c).Fragment,null,t(c).createElement("canvas",JN({style:y,height:i,width:i,ref:f},p)),b)}var lD=({tenant:e,url:n,title:r="",className:i,baseUrl:o,primary:a=!0,showQrCode:l=!0,align:u="right"})=>{const{t:d}=ve(),[p,h]=(0,c.useState)(n),f=(0,c.useMemo)((()=>(null==e?void 0:e.theme)?`${null!=o?o:"https://aisuru.com"}/images/${e.theme}/square_logo.png`:`${null!=o?o:"https://aisuru.com"}/images/memori_logo.png`),[e,o]);(0,c.useEffect)((()=>{n||h(window.location.href)}),[n]);const m=[{id:"facebook",title:"Facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${p}`,icon:NN},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${p}`,icon:DN},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${r}&url=${p}`,icon:LN},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${p}`,icon:BN},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${r}&url=${p}`,icon:HN},{id:"email",title:"Email",url:`mailto:?subject=${(null==r?void 0:r.length)>0?r:n}&body=${p}`,icon:zN}];return(0,s.jsxs)(qd,{as:"div",className:t(ys)("memori-share-button",{"memori-share-button--align-left":"left"===u}),children:[(0,s.jsx)(qd.Button,{className:t(ys)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button",i,{"memori-button--primary":a}),title:d("widget.share")||void 0,children:(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(FN,{})})}),(0,s.jsxs)(qd.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,s.jsx)(qd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsx)(Da,{className:"memori-share-button--link",ghost:!0,icon:(0,s.jsx)(np,{}),onClick:()=>{p&&navigator.clipboard.writeText(p)},children:d("copyToClipboard")||void 0})},"copy"),m.map((e=>{var n;return(0,s.jsx)(qd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsxs)("a",{className:t(ys)("memori-button","memori-button--with-icon","memori-button--ghost","memori-button--padded","memori-share-button--link"),href:null!==(n=e.url)&&void 0!==n?n:"",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(e.icon,{})}),e.title]})},e.id)})),l&&(0,s.jsxs)(qd.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,s.jsx)(aD,{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)(Da,{onClick:()=>{const e=document.getElementById("qr-canvas");if(!e)return;const t=document.createElement("a");t.href=e.toDataURL(),t.download=`memori-${r}-share.png`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},icon:(0,s.jsx)(UN,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};var cD=({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 uD=({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 dD=({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 pD=({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:M}=ve(),[T,_]=(0,c.useState)(!1),[I,R]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{document.fullscreenEnabled&&_(!0)}),[]),(0,s.jsxs)("div",{className:t(ys)("memori-header",e),children:[y&&(0,s.jsx)(Da,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--reload",title:M("reload")||"Reload",icon:(0,s.jsx)(uD,{}),onClick:()=>{window.location.reload()}}),b&&(0,s.jsx)(Da,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--clear",title:M("clearHistory")||"Clear chat",icon:(0,s.jsx)(dD,{}),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)(Da,{icon:(0,s.jsx)(lN,{}),shape:"circle",className:"memori-header--button memori-header--button--position",onClick:()=>a(!0)})]}),T&&(0,s.jsx)(Da,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--fullscreen",title:I?M("fullscreenExit")||"Exit fullscreen":M("fullscreenEnter")||"Enter fullscreen",icon:I?(0,s.jsx)(tm,{}):(0,s.jsx)(cD,{}),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)(Da,{primary:!!E&&!!f,shape:"circle",icon:(0,s.jsx)(mm,{}),className:"memori-header--button memori-header--button--knownfacts",disabled:!f||!E,onClick:()=>u(!0),title:M("knownFacts.title")||"Known facts"}),n.enableBoardOfExperts&&(0,s.jsx)(Da,{primary:!0,shape:"circle",icon:(0,s.jsx)(fm,{}),className:"memori-header--button memori-header--button--experts",disabled:!f||!E,onClick:()=>d(!0),title:M("widget.showExpertsInTheBoard")||"Experts in this board"}),v&&(0,s.jsx)(Da,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--speaker",icon:p?(0,s.jsx)(cN,{}):(0,s.jsx)(dN,{}),onClick:()=>h(!p),title:M("widget.sound")||"Sound"}),(0,s.jsx)(kN,{history:i,memori:n,className:"memori-header--button memori-header--button--export",disabled:!f||0===i.length}),g&&(0,s.jsx)(Da,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-settings",icon:(0,s.jsx)(ON,{}),onClick:()=>l(!0),title:M("widget.settings")||"Settings"}),m&&(0,s.jsx)(lD,{className:"memori-header--button memori-header--button-share",title:n.name,tenant:r,showQrCode:!0,align:"left"}),S&&(0,s.jsx)(Da,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-login",icon:(0,s.jsx)(Cd,{}),onClick:()=>x(!0),title:C?M("login.user")||"User":M("login.login")||"Login"})]})};var hD=({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"})]})]})},fD={};function mD(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 gD(e,t,n){return t&&mD(e.prototype,t),n&&mD(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function vD(){return vD=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},vD.apply(this,arguments)}function yD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,SD(e,t)}function bD(e){return bD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bD(e)}function SD(e,t){return SD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},SD(e,t)}function xD(){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 wD(e,t,n){return wD=xD()?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&&SD(i,n.prototype),i},wD.apply(null,arguments)}function CD(e){var t="function"==typeof Map?new Map:void 0;return CD=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 wD(e,arguments,bD(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),SD(r,e)},CD(e)}function AD(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 ED(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 MD(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 ED(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)?ED(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(fD,"__esModule",{value:!0});var TD=function(e){function t(){return e.apply(this,arguments)||this}return yD(t,e),t}(CD(Error)),_D=function(e){function t(t){return e.call(this,"Invalid DateTime: "+t.toMessage())||this}return yD(t,e),t}(TD),ID=function(e){function t(t){return e.call(this,"Invalid Interval: "+t.toMessage())||this}return yD(t,e),t}(TD),RD=function(e){function t(t){return e.call(this,"Invalid Duration: "+t.toMessage())||this}return yD(t,e),t}(TD),PD=function(e){function t(){return e.apply(this,arguments)||this}return yD(t,e),t}(TD),kD=function(e){function t(t){return e.call(this,"Invalid unit "+t)||this}return yD(t,e),t}(TD),OD=function(e){function t(){return e.apply(this,arguments)||this}return yD(t,e),t}(TD),ND=function(e){function t(){return e.call(this,"Zone is an abstract class")||this}return yD(t,e),t}(TD),DD="numeric",LD="short",BD="long",zD={year:DD,month:DD,day:DD},FD={year:DD,month:LD,day:DD},UD={year:DD,month:LD,day:DD,weekday:LD},jD={year:DD,month:BD,day:DD},HD={year:DD,month:BD,day:DD,weekday:BD},VD={hour:DD,minute:DD},GD={hour:DD,minute:DD,second:DD},WD={hour:DD,minute:DD,second:DD,timeZoneName:LD},qD={hour:DD,minute:DD,second:DD,timeZoneName:BD},KD={hour:DD,minute:DD,hourCycle:"h23"},JD={hour:DD,minute:DD,second:DD,hourCycle:"h23"},QD={hour:DD,minute:DD,second:DD,hourCycle:"h23",timeZoneName:LD},YD={hour:DD,minute:DD,second:DD,hourCycle:"h23",timeZoneName:BD},XD={year:DD,month:DD,day:DD,hour:DD,minute:DD},$D={year:DD,month:DD,day:DD,hour:DD,minute:DD,second:DD},ZD={year:DD,month:LD,day:DD,hour:DD,minute:DD},eL={year:DD,month:LD,day:DD,hour:DD,minute:DD,second:DD},tL={year:DD,month:LD,day:DD,weekday:LD,hour:DD,minute:DD},nL={year:DD,month:BD,day:DD,hour:DD,minute:DD,timeZoneName:LD},rL={year:DD,month:BD,day:DD,hour:DD,minute:DD,second:DD,timeZoneName:LD},iL={year:DD,month:BD,day:DD,weekday:BD,hour:DD,minute:DD,timeZoneName:BD},oL={year:DD,month:BD,day:DD,weekday:BD,hour:DD,minute:DD,second:DD,timeZoneName:BD},sL=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new ND},t.formatOffset=function(e,t){throw new ND},t.offset=function(e){throw new ND},t.equals=function(e){throw new ND},gD(e,[{key:"type",get:function(){throw new ND}},{key:"name",get:function(){throw new ND}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new ND}},{key:"isValid",get:function(){throw new ND}}]),e}(),aL=null,lL=function(e){function t(){return e.apply(this,arguments)||this}yD(t,e);var n=t.prototype;return n.offsetName=function(e,t){return CB(e,t.format,t.locale)},n.formatOffset=function(e,t){return TB(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return"system"===e.type},gD(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===aL&&(aL=new t),aL}}]),t}(sL),cL={};var uL={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};var dL={},pL=function(e){function t(n){var r;return(r=e.call(this)||this).zoneName=n,r.valid=t.isValidZone(n),r}yD(t,e),t.create=function(e){return dL[e]||(dL[e]=new t(e)),dL[e]},t.resetCache=function(){dL={},cL={}},t.isValidSpecifier=function(e){return this.isValidZone(e)},t.isValidZone=function(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}};var n=t.prototype;return n.offsetName=function(e,t){return CB(e,t.format,t.locale,this.name)},n.formatOffset=function(e,t){return TB(this.offset(e),t)},n.offset=function(e){var t=new Date(e);if(isNaN(t))return NaN;var n,r=(n=this.name,cL[n]||(cL[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"})),cL[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=uL[s];"era"===s?r[l]=a:nB(l)||(r[l]=parseInt(a,10))}return r}(r,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),i=r[1],o=r[2];return[r[3],i,o,r[4],r[5],r[6],r[7]]}(r,t),o=i[0],s=i[1],a=i[2],l=i[3],c=i[4],u=i[5],d=i[6];"BC"===l&&(o=1-Math.abs(o));var p=+t,h=p%1e3;return(bB({year:o,month:s,day:a,hour:24===c?0:c,minute:u,second:d,millisecond:0})-(p-=h>=0?h:1e3+h))/6e4},n.equals=function(e){return"iana"===e.type&&e.name===this.name},gD(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}(sL),hL=["base"],fL=["padTo","floor"],mL={};var gL={};function vL(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=gL[n];return r||(r=new Intl.DateTimeFormat(e,t),gL[n]=r),r}var yL={};var bL={};var SL=null;var xL={};function wL(e,t,n,r){var i=e.listingMode();return"error"===i?null:"en"===i?n(t):r(t)}var CL=function(){function e(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1,n.padTo,n.floor;var r=AD(n,fL);if(!t||Object.keys(r).length>0){var i=vD({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=yL[n];return r||(r=new Intl.NumberFormat(e,t),yL[n]=r),r}(e,i)}}return e.prototype.format=function(e){if(this.inf){var t=this.floor?Math.floor(e):e;return this.inf.format(t)}return dB(this.floor?Math.floor(e):mB(e,3),this.padTo)},e}(),AL=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&&pL.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=vD({},this.opts);s.timeZone=s.timeZone||r,this.dtf=vL(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?vD({},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}(),EL=function(){function e(e,t,n){this.opts=vD({style:"long"},n),!t&&oB()&&(this.rtf=function(e,t){void 0===t&&(t={});var n=t;n.base;var r=AD(n,hL),i=JSON.stringify([e,r]),o=bL[i];return o||(o=new Intl.RelativeTimeFormat(e,t),bL[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}(),ML={firstDay:1,minimalDays:4,weekend:[6,7]},TL=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=vL(e).resolvedOptions(),r=e}catch(t){var o=e.substring(0,i);n=vL(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||UL.defaultLocale;return new e(s||(o?"en-US":SL||(SL=(new Intl.DateTimeFormat).resolvedOptions().locale)),n||UL.defaultNumberingSystem,r||UL.defaultOutputCalendar,cB(i)||UL.defaultWeekSettings,s)},e.resetCache=function(){SL=null,gL={},yL={},bL={}},e.fromObject=function(t){var n=void 0===t?{}:t,r=n.locale,i=n.numberingSystem,o=n.outputCalendar,s=n.weekSettings;return e.create(r,i,o,s)};var t=e.prototype;return t.listingMode=function(){var e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"},t.clone=function(t){return t&&0!==Object.getOwnPropertyNames(t).length?e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,cB(t.weekSettings)||this.weekSettings,t.defaultToEN||!1):this},t.redefaultToEN=function(e){return void 0===e&&(e={}),this.clone(vD({},e,{defaultToEN:!0}))},t.redefaultToSystem=function(e){return void 0===e&&(e={}),this.clone(vD({},e,{defaultToEN:!1}))},t.months=function(e,t){var n=this;return void 0===t&&(t=!1),wL(this,e,kB,(function(){var r=t?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";return n.monthsCache[i][e]||(n.monthsCache[i][e]=function(e){for(var t=[],n=1;n<=12;n++){var r=LF.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),wL(this,e,LB,(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=LF.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 wL(this,void 0,(function(){return BB}),(function(){if(!e.meridiemCache){var t={hour:"numeric",hourCycle:"h12"};e.meridiemCache=[LF.utc(2016,11,13,9),LF.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 wL(this,e,jB,(function(){var n={era:e};return t.eraCache[e]||(t.eraCache[e]=[LF.utc(-40,1,1),LF.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 CL(this.intl,e.forceSimple||this.fastNumbers,e)},t.dtFormatter=function(e,t){return void 0===t&&(t={}),new AL(e,this.intl,t)},t.relFormatter=function(e){return void 0===e&&(e={}),new EL(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=mL[n];return r||(r=new Intl.ListFormat(e,t),mL[n]=r),r}(this.intl,e)},t.isEnglish=function(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")},t.getWeekSettings=function(){return this.weekSettings?this.weekSettings:sB()?function(e){var t=xL[e];if(!t){var n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,xL[e]=t}return t}(this.locale):ML},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},gD(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}(),_L=null,IL=function(e){function t(t){var n;return(n=e.call(this)||this).fixed=t,n}yD(t,e),t.instance=function(e){return 0===e?t.utcInstance:new t(e)},t.parseSpecifier=function(e){if(e){var n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new t(AB(n[1],n[2]))}return null};var n=t.prototype;return n.offsetName=function(){return this.name},n.formatOffset=function(e,t){return TB(this.fixed,t)},n.offset=function(){return this.fixed},n.equals=function(e){return"fixed"===e.type&&e.fixed===this.fixed},gD(t,[{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC"+TB(this.fixed,"narrow")}},{key:"ianaName",get:function(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+TB(-this.fixed,"narrow")}},{key:"isUniversal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}],[{key:"utcInstance",get:function(){return null===_L&&(_L=new t(0)),_L}}]),t}(sL),RL=function(e){function t(t){var n;return(n=e.call(this)||this).zoneName=t,n}yD(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},gD(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}(sL);function PL(e,t){if(nB(e)||null===e)return t;if(e instanceof sL)return e;if(function(e){return"string"==typeof e}(e)){var n=e.toLowerCase();return"default"===n?t:"local"===n||"system"===n?lL.instance:"utc"===n||"gmt"===n?IL.utcInstance:IL.parseSpecifier(n)||pL.create(e)}return rB(e)?IL.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new RL(e)}var kL,OL=function(){return Date.now()},NL="system",DL=null,LL=null,BL=null,zL=60,FL=null,UL=function(){function e(){}return e.resetCaches=function(){TL.resetCache(),pL.resetCache()},gD(e,null,[{key:"now",get:function(){return OL},set:function(e){OL=e}},{key:"defaultZone",get:function(){return PL(NL,lL.instance)},set:function(e){NL=e}},{key:"defaultLocale",get:function(){return DL},set:function(e){DL=e}},{key:"defaultNumberingSystem",get:function(){return LL},set:function(e){LL=e}},{key:"defaultOutputCalendar",get:function(){return BL},set:function(e){BL=e}},{key:"defaultWeekSettings",get:function(){return FL},set:function(e){FL=cB(e)}},{key:"twoDigitCutoffYear",get:function(){return zL},set:function(e){zL=e%100}},{key:"throwOnInvalid",get:function(){return kL},set:function(e){kL=e}}]),e}(),jL=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}(),HL=[0,31,59,90,120,151,181,212,243,273,304,334],VL=[0,31,60,91,121,152,182,213,244,274,305,335];function GL(e,t){return new jL("unit out of range","you specified "+t+" (of type "+typeof t+") as a "+e+", which is invalid")}function WL(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 qL(e,t,n){return n+(gB(e)?VL:HL)[t-1]}function KL(e,t){var n=gB(e)?VL:HL,r=n.findIndex((function(e){return e<t}));return{month:r+1,day:t-n[r]}}function JL(e,t){return(e-t+7)%7+1}function QL(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=qL(i,o,s),l=JL(WL(i,o,s),n),c=Math.floor((a-l+14-t)/7);return c<1?c=xB(r=i-1,t,n):c>xB(i,t,n)?(r=i+1,c=1):r=i,vD({weekYear:r,weekNumber:c,weekday:l},_B(e))}function YL(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=JL(WL(i,1,t),n),l=vB(i),c=7*o+s-a-7+t;c<1?c+=vB(r=i-1):c>l?(r=i+1,c-=vB(i)):r=i;var u=KL(r,c);return vD({year:r,month:u.month,day:u.day},_B(e))}function XL(e){var t=e.year;return vD({year:t,ordinal:qL(t,e.month,e.day)},_B(e))}function $L(e){var t=e.year,n=KL(t,e.ordinal);return vD({year:t,month:n.month,day:n.day},_B(e))}function ZL(e,t){if(!nB(e.localWeekday)||!nB(e.localWeekNumber)||!nB(e.localWeekYear)){if(!nB(e.weekday)||!nB(e.weekNumber)||!nB(e.weekYear))throw new PD("Cannot mix locale-based week fields with ISO-based week fields");return nB(e.localWeekday)||(e.weekday=e.localWeekday),nB(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),nB(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function eB(e){var t=iB(e.year),n=uB(e.month,1,12),r=uB(e.day,1,yB(e.year,e.month));return t?n?!r&&GL("day",e.day):GL("month",e.month):GL("year",e.year)}function tB(e){var t=e.hour,n=e.minute,r=e.second,i=e.millisecond,o=uB(t,0,23)||24===t&&0===n&&0===r&&0===i,s=uB(n,0,59),a=uB(r,0,59),l=uB(i,0,999);return o?s?a?!l&&GL("millisecond",i):GL("second",r):GL("minute",n):GL("hour",t)}function nB(e){return void 0===e}function rB(e){return"number"==typeof e}function iB(e){return"number"==typeof e&&e%1==0}function oB(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function sB(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function aB(e,t,n){if(0!==e.length)return e.reduce((function(e,r){var i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i}),null)[1]}function lB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function cB(e){if(null==e)return null;if("object"!=typeof e)throw new OD("Week settings must be an object");if(!uB(e.firstDay,1,7)||!uB(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some((function(e){return!uB(e,1,7)})))throw new OD("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function uB(e,t,n){return iB(e)&&e>=t&&e<=n}function dB(e,t){return void 0===t&&(t=2),e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0")}function pB(e){return nB(e)||null===e||""===e?void 0:parseInt(e,10)}function hB(e){return nB(e)||null===e||""===e?void 0:parseFloat(e)}function fB(e){if(!nB(e)&&null!==e&&""!==e){var t=1e3*parseFloat("0."+e);return Math.floor(t)}}function mB(e,t,n){void 0===n&&(n=!1);var r=Math.pow(10,t);return(n?Math.trunc:Math.round)(e*r)/r}function gB(e){return e%4==0&&(e%100!=0||e%400==0)}function vB(e){return gB(e)?366:365}function yB(e,t){var n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?gB(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function bB(e){var t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t)).setUTCFullYear(e.year,e.month-1,e.day),+t}function SB(e,t,n){return-JL(WL(e,1,t),n)+t-1}function xB(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r=SB(e,t,n),i=SB(e+1,t,n);return(vB(e)-r+i)/7}function wB(e){return e>99?e:e>UL.twoDigitCutoffYear?1900+e:2e3+e}function CB(e,t,n,r){void 0===r&&(r=null);var i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);var s=vD({timeZoneName:t},o),a=new Intl.DateTimeFormat(n,s).formatToParts(i).find((function(e){return"timezonename"===e.type.toLowerCase()}));return a?a.value:null}function AB(e,t){var n=parseInt(e,10);Number.isNaN(n)&&(n=0);var r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function EB(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new OD("Invalid unit value "+e);return t}function MB(e,t){var n={};for(var r in e)if(lB(e,r)){var i=e[r];if(null==i)continue;n[t(r)]=EB(i)}return n}function TB(e,t){var n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return""+i+dB(n,2)+":"+dB(r,2);case"narrow":return""+i+n+(r>0?":"+r:"");case"techie":return""+i+dB(n,2)+dB(r,2);default:throw new RangeError("Value format "+t+" is out of range for property format")}}function _B(e){return function(e,t){return t.reduce((function(t,n){return t[n]=e[n],t}),{})}(e,["hour","minute","second","millisecond"])}var IB=["January","February","March","April","May","June","July","August","September","October","November","December"],RB=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],PB=["J","F","M","A","M","J","J","A","S","O","N","D"];function kB(e){switch(e){case"narrow":return[].concat(PB);case"short":return[].concat(RB);case"long":return[].concat(IB);case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var OB=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],NB=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],DB=["M","T","W","T","F","S","S"];function LB(e){switch(e){case"narrow":return[].concat(DB);case"short":return[].concat(NB);case"long":return[].concat(OB);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var BB=["AM","PM"],zB=["Before Christ","Anno Domini"],FB=["BC","AD"],UB=["B","A"];function jB(e){switch(e){case"narrow":return[].concat(UB);case"short":return[].concat(FB);case"long":return[].concat(zB);default:return null}}function HB(e,t){for(var n,r="",i=MD(e);!(n=i()).done;){var o=n.value;o.literal?r+=o.val:r+=t(o.val)}return r}var VB={D:zD,DD:FD,DDD:jD,DDDD:HD,t:VD,tt:GD,ttt:WD,tttt:qD,T:KD,TT:JD,TTT:QD,TTTT:YD,f:XD,ff:ZD,fff:nL,ffff:iL,F:$D,FF:eL,FFF:rL,FFFF:oL},GB=function(){function e(e,t){this.opts=t,this.loc=e,this.systemLoc=null}e.create=function(t,n){return void 0===n&&(n={}),new e(t,n)},e.parseFormat=function(e){for(var t=null,n="",r=!1,i=[],o=0;o<e.length;o++){var s=e.charAt(o);"'"===s?(n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),t=null,n="",r=!r):r||s===t?n+=s:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=s,t=s)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i},e.macroTokenToFormatOpts=function(e){return VB[e]};var t=e.prototype;return t.formatWithSystemDefault=function(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,vD({},this.opts,t)).format()},t.dtFormatter=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,vD({},this.opts,t))},t.formatDateTime=function(e,t){return this.dtFormatter(e,t).format()},t.formatDateTimeParts=function(e,t){return this.dtFormatter(e,t).formatToParts()},t.formatInterval=function(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())},t.resolvedOptions=function(e,t){return this.dtFormatter(e,t).resolvedOptions()},t.num=function(e,t){if(void 0===t&&(t=0),this.opts.forceSimple)return dB(e,t);var n=vD({},this.opts);return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)},t.formatDateTimeFromString=function(t,n){var r=this,i="en"===this.loc.listingMode(),o=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,s=function(e,n){return r.loc.extract(t,e,n)},a=function(e){return t.isOffsetFixed&&0===t.offset&&e.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,e.format):""},l=function(){return i?function(e){return BB[e.hour<12?0:1]}(t):s({hour:"numeric",hourCycle:"h12"},"dayperiod")},c=function(e,n){return i?function(e,t){return kB(t)[e.month-1]}(t,e):s(n?{month:e}:{month:e,day:"numeric"},"month")},u=function(e,n){return i?function(e,t){return LB(t)[e.weekday-1]}(t,e):s(n?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday")},d=function(e){return i?function(e,t){return jB(t)[e.year<0?0:1]}(t,e):s({era:e},"era")};return HB(e.parseFormat(n),(function(n){switch(n){case"S":return r.num(t.millisecond);case"u":case"SSS":return r.num(t.millisecond,3);case"s":return r.num(t.second);case"ss":return r.num(t.second,2);case"uu":return r.num(Math.floor(t.millisecond/10),2);case"uuu":return r.num(Math.floor(t.millisecond/100));case"m":return r.num(t.minute);case"mm":return r.num(t.minute,2);case"h":return r.num(t.hour%12==0?12:t.hour%12);case"hh":return r.num(t.hour%12==0?12:t.hour%12,2);case"H":return r.num(t.hour);case"HH":return r.num(t.hour,2);case"Z":return a({format:"narrow",allowZ:r.opts.allowZ});case"ZZ":return a({format:"short",allowZ:r.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:r.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:r.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:r.loc.locale});case"z":return t.zoneName;case"a":return l();case"d":return o?s({day:"numeric"},"day"):r.num(t.day);case"dd":return o?s({day:"2-digit"},"day"):r.num(t.day,2);case"c":case"E":return r.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return o?s({month:"numeric",day:"numeric"},"month"):r.num(t.month);case"LL":return o?s({month:"2-digit",day:"numeric"},"month"):r.num(t.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return o?s({month:"numeric"},"month"):r.num(t.month);case"MM":return o?s({month:"2-digit"},"month"):r.num(t.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return o?s({year:"numeric"},"year"):r.num(t.year);case"yy":return o?s({year:"2-digit"},"year"):r.num(t.year.toString().slice(-2),2);case"yyyy":return o?s({year:"numeric"},"year"):r.num(t.year,4);case"yyyyyy":return o?s({year:"numeric"},"year"):r.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return r.num(t.weekYear.toString().slice(-2),2);case"kkkk":return r.num(t.weekYear,4);case"W":return r.num(t.weekNumber);case"WW":return r.num(t.weekNumber,2);case"n":return r.num(t.localWeekNumber);case"nn":return r.num(t.localWeekNumber,2);case"ii":return r.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return r.num(t.localWeekYear,4);case"o":return r.num(t.ordinal);case"ooo":return r.num(t.ordinal,3);case"q":return r.num(t.quarter);case"qq":return r.num(t.quarter,2);case"X":return r.num(Math.floor(t.ts/1e3));case"x":return r.num(t.ts);default:return function(n){var i=e.macroTokenToFormatOpts(n);return i?r.formatWithSystemDefault(t,i):n}(n)}}))},t.formatDurationFromString=function(t,n){var r,i=this,o=function(e){switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=e.parseFormat(n),a=s.reduce((function(e,t){var n=t.literal,r=t.val;return n?e:e.concat(r)}),[]),l=t.shiftTo.apply(t,a.map(o).filter((function(e){return e})));return HB(s,(r=l,function(e){var t=o(e);return t?i.num(r.get(t),e.length):e}))},e}(),WB=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function qB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.reduce((function(e,t){return e+t.source}),"");return RegExp("^"+r+"$")}function KB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduce((function(t,n){var r=t[0],i=t[1],o=t[2],s=n(e,o),a=s[0],l=s[1],c=s[2];return[vD({},r,a),l||i,c]}),[{},null,1]).slice(0,2)}}function JB(e){if(null==e)return[null,null];for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=0,o=n;i<o.length;i++){var s=o[i],a=s[0],l=s[1],c=a.exec(e);if(c)return l(c)}return[null,null]}function QB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n){var r,i={};for(r=0;r<t.length;r++)i[t[r]]=pB(e[n+r]);return[i,null,n+r]}}var YB=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,XB=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,$B=RegExp(""+XB.source+("(?:"+YB.source+"?(?:\\[("+WB.source+")\\])?)?")),ZB=RegExp("(?:T"+$B.source+")?"),ez=QB("weekYear","weekNumber","weekDay"),tz=QB("year","ordinal"),nz=RegExp(XB.source+" ?(?:"+YB.source+"|("+WB.source+"))?"),rz=RegExp("(?: "+nz.source+")?");function iz(e,t,n){var r=e[t];return nB(r)?n:pB(r)}function oz(e,t){return[{hours:iz(e,t,0),minutes:iz(e,t+1,0),seconds:iz(e,t+2,0),milliseconds:fB(e[t+3])},null,t+4]}function sz(e,t){var n=!e[t]&&!e[t+1],r=AB(e[t+1],e[t+2]);return[{},n?null:IL.instance(r),t+3]}function az(e,t){return[{},e[t]?pL.create(e[t]):null,t+1]}var lz=RegExp("^T?"+XB.source+"$"),cz=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function uz(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u="-"===t[0],d=l&&"-"===l[0],p=function(e,t){return void 0===t&&(t=!1),void 0!==e&&(t||e&&u)?-e:e};return[{years:p(hB(n)),months:p(hB(r)),weeks:p(hB(i)),days:p(hB(o)),hours:p(hB(s)),minutes:p(hB(a)),seconds:p(hB(l),"-0"===l),milliseconds:p(fB(c),d)}]}var dz={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function pz(e,t,n,r,i,o,s){var a={year:2===t.length?wB(pB(t)):pB(t),month:RB.indexOf(n)+1,day:pB(r),hour:pB(i),minute:pB(o)};return s&&(a.second=pB(s)),e&&(a.weekday=e.length>3?OB.indexOf(e)+1:NB.indexOf(e)+1),a}var hz=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function fz(e){var t,n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],d=e[10],p=e[11],h=pz(n,o,i,r,s,a,l);return t=c?dz[c]:u?0:AB(d,p),[h,new IL(t)]}var mz=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,gz=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,vz=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function yz(e){var t=e[1],n=e[2],r=e[3];return[pz(t,e[4],r,n,e[5],e[6],e[7]),IL.utcInstance]}function bz(e){var t=e[1],n=e[2],r=e[3],i=e[4],o=e[5],s=e[6];return[pz(t,e[7],n,r,i,o,s),IL.utcInstance]}var Sz=qB(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,ZB),xz=qB(/(\d{4})-?W(\d\d)(?:-?(\d))?/,ZB),wz=qB(/(\d{4})-?(\d{3})/,ZB),Cz=qB($B),Az=KB((function(e,t){return[{year:iz(e,t),month:iz(e,t+1,1),day:iz(e,t+2,1)},null,t+3]}),oz,sz,az),Ez=KB(ez,oz,sz,az),Mz=KB(tz,oz,sz,az),Tz=KB(oz,sz,az);var _z=KB(oz);var Iz=qB(/(\d{4})-(\d\d)-(\d\d)/,rz),Rz=qB(nz),Pz=KB(oz,sz,az);var kz="Invalid Duration",Oz={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Nz=vD({years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},Oz),Dz=365.2425,Lz=30.436875,Bz=vD({years:{quarters:4,months:12,weeks:52.1775,days:Dz,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:Lz,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},Oz),zz=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Fz=zz.slice(0).reverse();function Uz(e,t,n){void 0===n&&(n=!1);var r={values:n?t.values:vD({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Vz(r)}function jz(e,t){for(var n,r,i=null!=(n=t.milliseconds)?n:0,o=MD(Fz.slice(1));!(r=o()).done;){var s=r.value;t[s]&&(i+=t[s]*e[s].milliseconds)}return i}function Hz(e,t){var n=jz(e,t)<0?-1:1;zz.reduceRight((function(r,i){if(nB(t[i]))return r;if(r){var o=t[r]*n,s=e[i][r],a=Math.floor(o/s);t[i]+=a*n,t[r]-=a*s*n}return i}),null),zz.reduce((function(n,r){if(nB(t[r]))return n;if(n){var i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r}),null)}var Vz=function(e){function t(e){var t="longterm"===e.conversionAccuracy||!1,n=t?Bz:Nz;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||TL.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 OD("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new t({values:MB(e,t.normalizeUnit),loc:TL.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})},t.fromDurationLike=function(e){if(rB(e))return t.fromMillis(e);if(t.isDuration(e))return e;if("object"==typeof e)return t.fromObject(e);throw new OD("Unknown duration argument "+e+" of type "+typeof e)},t.fromISO=function(e,n){var r=function(e){return JB(e,[cz,uz])}(e),i=r[0];return i?t.fromObject(i,n):t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.fromISOTime=function(e,n){var r=function(e){return JB(e,[lz,_z])}(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 OD("need to specify a reason the Duration is invalid");var r=e instanceof jL?e:new jL(e,n);if(UL.throwOnInvalid)throw new RD(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 kD(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=vD({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?GB.create(this.loc,n).formatDurationFromString(this,e):kz},n.toHuman=function(e){var t=this;if(void 0===e&&(e={}),!this.isValid)return kz;var n=zz.map((function(n){var r=t.values[n];return nB(r)?null:t.loc.numberFormatter(vD({style:"unit",unitDisplay:"long"},e,{unit:n.slice(0,-1)})).format(r)})).filter((function(e){return e}));return this.loc.listFormatter(vD({type:"conjunction",style:e.listStyle||"narrow"},e)).format(n)},n.toObject=function(){return this.isValid?vD({},this.values):{}},n.toISO=function(){if(!this.isValid)return null;var e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=mB(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e},n.toISOTime=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var t=this.toMillis();return t<0||t>=864e5?null:(e=vD({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e,{includeOffset:!1}),LF.fromMillis(t,{zone:"UTC"}).toISOTime(e))},n.toJSON=function(){return this.toISO()},n.toString=function(){return this.toISO()},n[e]=function(){return this.isValid?"Duration { values: "+JSON.stringify(this.values)+" }":"Duration { Invalid, reason: "+this.invalidReason+" }"},n.toMillis=function(){return this.isValid?jz(this.matrix,this.values):NaN},n.valueOf=function(){return this.toMillis()},n.plus=function(e){if(!this.isValid)return this;for(var n=t.fromDurationLike(e),r={},i=0,o=zz;i<o.length;i++){var s=o[i];(lB(n.values,s)||lB(this.values,s))&&(r[s]=n.get(s)+this.get(s))}return Uz(this,{values:r},!0)},n.minus=function(e){if(!this.isValid)return this;var n=t.fromDurationLike(e);return this.plus(n.negate())},n.mapUnits=function(e){if(!this.isValid)return this;for(var t={},n=0,r=Object.keys(this.values);n<r.length;n++){var i=r[n];t[i]=EB(e(this.values[i],i))}return Uz(this,{values:t},!0)},n.get=function(e){return this[t.normalizeUnit(e)]},n.set=function(e){return this.isValid?Uz(this,{values:vD({},this.values,MB(e,t.normalizeUnit))}):this},n.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.conversionAccuracy,o=t.matrix;return Uz(this,{loc:this.loc.clone({locale:n,numberingSystem:r}),matrix:o,conversionAccuracy:i})},n.as=function(e){return this.isValid?this.shiftTo(e).get(e):NaN},n.normalize=function(){if(!this.isValid)return this;var e=this.toObject();return Hz(this.matrix,e),Uz(this,{values:e},!0)},n.rescale=function(){return this.isValid?Uz(this,{values:function(e){for(var t={},n=0,r=Object.entries(e);n<r.length;n++){var i=r[n],o=i[0],s=i[1];0!==s&&(t[o]=s)}return t}(this.normalize().shiftToAll().toObject())},!0):this},n.shiftTo=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!this.isValid)return this;if(0===n.length)return this;n=n.map((function(e){return t.normalizeUnit(e)}));for(var i,o={},s={},a=this.toObject(),l=0,c=zz;l<c.length;l++){var u=c[l];if(n.indexOf(u)>=0){i=u;var d=0;for(var p in s)d+=this.matrix[p][u]*s[p],s[p]=0;rB(a[u])&&(d+=a[u]);var h=Math.trunc(d);o[u]=h,s[u]=(1e3*d-1e3*h)/1e3}else rB(a[u])&&(s[u]=a[u])}for(var f in s)0!==s[f]&&(o[i]+=f===i?s[f]:s[f]/this.matrix[i][f]);return Hz(this.matrix,o),Uz(this,{values:o},!0)},n.shiftToAll=function(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this},n.negate=function(){if(!this.isValid)return this;for(var e={},t=0,n=Object.keys(this.values);t<n.length;t++){var r=n[t];e[r]=0===this.values[r]?0:-this.values[r]}return Uz(this,{values:e},!0)},n.equals=function(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(var t=0,n=zz;t<n.length;t++){var r=n[t];if(i=this.values[r],o=e.values[r],!(void 0===i||0===i?void 0===o||0===o:i===o))return!1}var i,o;return!0},gD(t,[{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"years",get:function(){return this.isValid?this.values.years||0:NaN}},{key:"quarters",get:function(){return this.isValid?this.values.quarters||0:NaN}},{key:"months",get:function(){return this.isValid?this.values.months||0:NaN}},{key:"weeks",get:function(){return this.isValid?this.values.weeks||0:NaN}},{key:"days",get:function(){return this.isValid?this.values.days||0:NaN}},{key:"hours",get:function(){return this.isValid?this.values.hours||0:NaN}},{key:"minutes",get:function(){return this.isValid?this.values.minutes||0:NaN}},{key:"seconds",get:function(){return this.isValid?this.values.seconds||0:NaN}},{key:"milliseconds",get:function(){return this.isValid?this.values.milliseconds||0:NaN}},{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),t}(Symbol.for("nodejs.util.inspect.custom")),Gz="Invalid Interval";var Wz=function(e){function t(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new OD("need to specify a reason the Interval is invalid");var r=e instanceof jL?e:new jL(e,n);if(UL.throwOnInvalid)throw new ID(r);return new t({invalid:r})},t.fromDateTimes=function(e,n){var r=BF(e),i=BF(n),o=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?Wz.invalid("end before start","The end of an interval must be after its start, but you had start="+e.toISO()+" and end="+t.toISO()):null:Wz.invalid("missing or invalid end"):Wz.invalid("missing or invalid start")}(r,i);return null==o?new t({start:r,end:i}):o},t.after=function(e,n){var r=Vz.fromDurationLike(n),i=BF(e);return t.fromDateTimes(i,i.plus(r))},t.before=function(e,n){var r=Vz.fromDurationLike(n),i=BF(e);return t.fromDateTimes(i.minus(r),i)},t.fromISO=function(e,n){var r=(e||"").split("/",2),i=r[0],o=r[1];if(i&&o){var s,a,l,c;try{a=(s=LF.fromISO(i,n)).isValid}catch(e){a=!1}try{c=(l=LF.fromISO(o,n)).isValid}catch(e){c=!1}if(a&&c)return t.fromDateTimes(s,l);if(a){var u=Vz.fromISO(o,n);if(u.isValid)return t.after(s,u)}else if(c){var d=Vz.fromISO(i,n);if(d.isValid)return t.before(l,d)}}return t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.isInterval=function(e){return e&&e.isLuxonInterval||!1};var n=t.prototype;return n.length=function(e){return void 0===e&&(e="milliseconds"),this.isValid?this.toDuration.apply(this,[e]).get(e):NaN},n.count=function(e,t){if(void 0===e&&(e="milliseconds"),!this.isValid)return NaN;var n,r=this.start.startOf(e,t);return n=(n=null!=t&&t.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end).startOf(e,t),Math.floor(n.diff(r,e).get(e))+(n.valueOf()!==this.end.valueOf())},n.hasSame=function(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))},n.isEmpty=function(){return this.s.valueOf()===this.e.valueOf()},n.isAfter=function(e){return!!this.isValid&&this.s>e},n.isBefore=function(e){return!!this.isValid&&this.e<=e},n.contains=function(e){return!!this.isValid&&(this.s<=e&&this.e>e)},n.set=function(e){var n=void 0===e?{}:e,r=n.start,i=n.end;return this.isValid?t.fromDateTimes(r||this.s,i||this.e):this},n.splitAt=function(){var e=this;if(!this.isValid)return[];for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=r.map(BF).filter((function(t){return e.contains(t)})).sort((function(e,t){return e.toMillis()-t.toMillis()})),s=[],a=this.s,l=0;a<this.e;){var c=o[l]||this.e,u=+c>+this.e?this.e:c;s.push(t.fromDateTimes(a,u)),a=u,l+=1}return s},n.splitBy=function(e){var n=Vz.fromDurationLike(e);if(!this.isValid||!n.isValid||0===n.as("milliseconds"))return[];for(var r,i=this.s,o=1,s=[];i<this.e;){var a=this.start.plus(n.mapUnits((function(e){return e*o})));r=+a>+this.e?this.e:a,s.push(t.fromDateTimes(i,r)),i=r,o+=1}return s},n.divideEqually=function(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},n.overlaps=function(e){return this.e>e.s&&this.s<e.e},n.abutsStart=function(e){return!!this.isValid&&+this.e==+e.s},n.abutsEnd=function(e){return!!this.isValid&&+e.e==+this.s},n.engulfs=function(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)},n.equals=function(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))},n.intersection=function(e){if(!this.isValid)return this;var n=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return n>=r?null:t.fromDateTimes(n,r)},n.union=function(e){if(!this.isValid)return this;var n=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return t.fromDateTimes(n,r)},t.merge=function(e){var t=e.sort((function(e,t){return e.s-t.s})).reduce((function(e,t){var n=e[0],r=e[1];return r?r.overlaps(t)||r.abutsStart(t)?[n,r.union(t)]:[n.concat([r]),t]:[n,t]}),[[],null]),n=t[0],r=t[1];return r&&n.push(r),n},t.xor=function(e){for(var n,r,i=null,o=0,s=[],a=e.map((function(e){return[{time:e.s,type:"s"},{time:e.e,type:"e"}]})),l=(n=Array.prototype).concat.apply(n,a).sort((function(e,t){return e.time-t.time})),c=MD(l);!(r=c()).done;){var u=r.value;1===(o+="s"===u.type?1:-1)?i=u.time:(i&&+i!=+u.time&&s.push(t.fromDateTimes(i,u.time)),i=null)}return t.merge(s)},n.difference=function(){for(var e=this,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.xor([this].concat(r)).map((function(t){return e.intersection(t)})).filter((function(e){return e&&!e.isEmpty()}))},n.toString=function(){return this.isValid?"["+this.s.toISO()+" – "+this.e.toISO()+")":Gz},n[e]=function(){return this.isValid?"Interval { start: "+this.s.toISO()+", end: "+this.e.toISO()+" }":"Interval { Invalid, reason: "+this.invalidReason+" }"},n.toLocaleString=function(e,t){return void 0===e&&(e=zD),void 0===t&&(t={}),this.isValid?GB.create(this.s.loc.clone(t),e).formatInterval(this):Gz},n.toISO=function(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):Gz},n.toISODate=function(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():Gz},n.toISOTime=function(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):Gz},n.toFormat=function(e,t){var n=(void 0===t?{}:t).separator,r=void 0===n?" – ":n;return this.isValid?""+this.s.toFormat(e)+r+this.e.toFormat(e):Gz},n.toDuration=function(e,t){return this.isValid?this.e.diff(this.s,e,t):Vz.invalid(this.invalidReason)},n.mapEndpoints=function(e){return t.fromDateTimes(e(this.s),e(this.e))},gD(t,[{key:"start",get:function(){return this.isValid?this.s:null}},{key:"end",get:function(){return this.isValid?this.e:null}},{key:"isValid",get:function(){return null===this.invalidReason}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),t}(Symbol.for("nodejs.util.inspect.custom")),qz=function(){function e(){}return e.hasDST=function(e){void 0===e&&(e=UL.defaultZone);var t=LF.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset},e.isValidIANAZone=function(e){return pL.isValidZone(e)},e.normalizeZone=function(e){return PL(e,UL.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)||TL.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)||TL.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)||TL.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||TL.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||TL.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)||TL.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)||TL.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 TL.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 TL.create(r,null,"gregory").eras(e)},e.features=function(){return{relative:oB(),localeWeek:sB()}},e}();function Kz(e,t){var n=function(e){return e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf()},r=n(t)-n(e);return Math.floor(Vz.fromMillis(r).as("days"))}function Jz(e,t,n,r){var i=function(e,t,n){for(var r,i,o=[["years",function(e,t){return t.year-e.year}],["quarters",function(e,t){return t.quarter-e.quarter+4*(t.year-e.year)}],["months",function(e,t){return t.month-e.month+12*(t.year-e.year)}],["weeks",function(e,t){var n=Kz(e,t);return(n-n%7)/7}],["days",Kz]],s={},a=e,l=0,c=o;l<c.length;l++){var u=c[l],d=u[0],p=u[1];n.indexOf(d)>=0&&(r=d,s[d]=p(e,t),(i=a.plus(s))>t?(s[d]--,(e=a.plus(s))>t&&(i=e,s[d]--,e=a.plus(s))):e=i)}return[e,s,i,r]}(e,t,n),o=i[0],s=i[1],a=i[2],l=i[3],c=t-o,u=n.filter((function(e){return["hours","minutes","seconds","milliseconds"].indexOf(e)>=0}));if(0===u.length){var d;if(a<t)a=o.plus(((d={})[l]=1,d));a!==o&&(s[l]=(s[l]||0)+c/(a-o))}var p,h=Vz.fromObject(s,r);return u.length>0?(p=Vz.fromMillis(c,r)).shiftTo.apply(p,u).plus(h):h}var Qz={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Yz={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Xz=Qz.hanidec.replace(/[\[|\]]/g,"").split("");function $z(e,t){var n=e.numberingSystem;return void 0===t&&(t=""),new RegExp(""+Qz[n||"latn"]+t)}function Zz(e,t){return void 0===t&&(t=function(e){return e}),{regex:e,deser:function(e){var n=e[0];return t(function(e){var t=parseInt(e,10);if(isNaN(t)){t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(-1!==e[n].search(Qz.hanidec))t+=Xz.indexOf(e[n]);else for(var i in Yz){var o=Yz[i],s=o[0],a=o[1];r>=s&&r<=a&&(t+=r-s)}}return parseInt(t,10)}return t}(n))}}}var eF="[ "+String.fromCharCode(160)+"]",tF=new RegExp(eF,"g");function nF(e){return e.replace(/\./g,"\\.?").replace(tF,eF)}function rF(e){return e.replace(/\./g,"").replace(tF," ").toLowerCase()}function iF(e,t){return null===e?null:{regex:RegExp(e.map(nF).join("|")),deser:function(n){var r=n[0];return e.findIndex((function(e){return rF(r)===rF(e)}))+t}}}function oF(e,t){return{regex:e,deser:function(e){return AB(e[1],e[2])},groups:t}}function sF(e){return{regex:e,deser:function(e){return e[0]}}}var aF={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};var lF=null;function cF(e,t){var n;return(n=Array.prototype).concat.apply(n,e.map((function(e){return function(e,t){if(e.literal)return e;var n=dF(GB.macroTokenToFormatOpts(e.val),t);return null==n||n.includes(void 0)?e:n}(e,t)})))}function uF(e,t,n){var r=cF(GB.parseFormat(n),e),i=r.map((function(t){return n=t,i=$z(r=e),o=$z(r,"{2}"),s=$z(r,"{3}"),a=$z(r,"{4}"),l=$z(r,"{6}"),c=$z(r,"{1,2}"),u=$z(r,"{1,3}"),d=$z(r,"{1,6}"),p=$z(r,"{1,9}"),h=$z(r,"{2,4}"),f=$z(r,"{4,6}"),m=function(e){return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:function(e){return e[0]},literal:!0};var t},g=function(e){if(n.literal)return m(e);switch(e.val){case"G":return iF(r.eras("short"),0);case"GG":return iF(r.eras("long"),0);case"y":return Zz(d);case"yy":case"kk":return Zz(h,wB);case"yyyy":case"kkkk":return Zz(a);case"yyyyy":return Zz(f);case"yyyyyy":return Zz(l);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Zz(c);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Zz(o);case"MMM":return iF(r.months("short",!0),1);case"MMMM":return iF(r.months("long",!0),1);case"LLL":return iF(r.months("short",!1),1);case"LLLL":return iF(r.months("long",!1),1);case"o":case"S":return Zz(u);case"ooo":case"SSS":return Zz(s);case"u":return sF(p);case"uu":return sF(c);case"uuu":case"E":case"c":return Zz(i);case"a":return iF(r.meridiems(),0);case"EEE":return iF(r.weekdays("short",!1),1);case"EEEE":return iF(r.weekdays("long",!1),1);case"ccc":return iF(r.weekdays("short",!0),1);case"cccc":return iF(r.weekdays("long",!0),1);case"Z":case"ZZ":return oF(new RegExp("([+-]"+c.source+")(?::("+o.source+"))?"),2);case"ZZZ":return oF(new RegExp("([+-]"+c.source+")("+o.source+")?"),2);case"z":return sF(/[a-z_+-/]{1,256}?/i);case" ":return sF(/[^\S\n\r]/);default:return m(e)}}(n)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"},g.token=n,g;var n,r,i,o,s,a,l,c,u,d,p,h,f,m,g})),o=i.find((function(e){return e.invalidReason}));if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};var s=function(e){var t=e.map((function(e){return e.regex})).reduce((function(e,t){return e+"("+t.source+")"}),"");return["^"+t+"$",e]}(i),a=s[0],l=s[1],c=RegExp(a,"i"),u=function(e,t,n){var r=e.match(t);if(r){var i={},o=1;for(var s in n)if(lB(n,s)){var a=n[s],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+l))),o+=l}return[r,i]}return[r,{}]}(t,c,l),d=u[0],p=u[1],h=p?function(e){var t,n=null;nB(e.z)||(n=pL.create(e.z)),nB(e.Z)||(n||(n=new IL(e.Z)),t=e.Z),nB(e.q)||(e.M=3*(e.q-1)+1),nB(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),nB(e.u)||(e.S=fB(e.u));var r=Object.keys(e).reduce((function(t,n){var r=function(e){switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}}(n);return r&&(t[r]=e[n]),t}),{});return[r,n,t]}(p):[null,null,void 0],f=h[0],m=h[1],g=h[2];if(lB(p,"a")&&lB(p,"H"))throw new PD("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:c,rawMatches:d,matches:p,result:f,zone:m,specificOffset:g}}function dF(e,t){if(!e)return null;var n=GB.create(t,e).dtFormatter((lF||(lF=LF.fromMillis(1555555555555)),lF)),r=n.formatToParts(),i=n.resolvedOptions();return r.map((function(t){return function(e,t,n){var r=e.type,i=e.value;if("literal"===r){var o=/^\s+$/.test(i);return{literal:!o,val:o?" ":i}}var s=t[r],a=r;"hour"===r&&(a=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":n.hour12?"hour12":"hour24");var l=aF[a];if("object"==typeof l&&(l=l[s]),l)return{literal:!1,val:l}}(t,e,i)}))}var pF="Invalid DateTime",hF=864e13;function fF(e){return new jL("unsupported zone",'the zone "'+e.name+'" is not supported')}function mF(e){return null===e.weekData&&(e.weekData=QL(e.c)),e.weekData}function gF(e){return null===e.localWeekData&&(e.localWeekData=QL(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function vF(e,t){var n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new LF(vD({},n,t,{old:n}))}function yF(e,t,n){var r=e-6e4*t,i=n.offset(r);if(t===i)return[r,t];r-=6e4*(i-t);var o=n.offset(r);return i===o?[r,i]:[e-6e4*Math.min(i,o),Math.max(i,o)]}function bF(e,t){var n=new Date(e+=6e4*t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function SF(e,t,n){return yF(bB(e),t,n)}function xF(e,t){var n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),o=vD({},e.c,{year:r,month:i,day:Math.min(e.c.day,yB(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)}),s=Vz.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=yF(bB(o),n,e.zone),l=a[0],c=a[1];return 0!==s&&(l+=s,c=e.zone.offset(l)),{ts:l,o:c}}function wF(e,t,n,r,i,o){var s=n.setZone,a=n.zone;if(e&&0!==Object.keys(e).length||t){var l=t||a,c=LF.fromObject(e,vD({},n,{zone:l,specificOffset:o}));return s?c:c.setZone(a)}return LF.invalid(new jL("unparsable",'the input "'+i+"\" can't be parsed as "+r))}function CF(e,t,n){return void 0===n&&(n=!0),e.isValid?GB.create(TL.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function AF(e,t){var n=e.c.year>9999||e.c.year<0,r="";return n&&e.c.year>=0&&(r+="+"),r+=dB(e.c.year,n?6:4),t?(r+="-",r+=dB(e.c.month),r+="-",r+=dB(e.c.day)):(r+=dB(e.c.month),r+=dB(e.c.day)),r}function EF(e,t,n,r,i,o){var s=dB(e.c.hour);return t?(s+=":",s+=dB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=":")):s+=dB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=dB(e.c.second),0===e.c.millisecond&&r||(s+=".",s+=dB(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!o?s+="Z":e.o<0?(s+="-",s+=dB(Math.trunc(-e.o/60)),s+=":",s+=dB(Math.trunc(-e.o%60))):(s+="+",s+=dB(Math.trunc(e.o/60)),s+=":",s+=dB(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}var MF={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},TF={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},_F={ordinal:1,hour:0,minute:0,second:0,millisecond:0},IF=["year","month","day","hour","minute","second","millisecond"],RF=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],PF=["year","ordinal","hour","minute","second","millisecond"];function kF(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function(e){var t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new kD(e);return t}(e)}}function OF(e,t){var n,r,i=PL(t.zone,UL.defaultZone),o=TL.fromObject(t),s=UL.now();if(nB(e.year))n=s;else{for(var a=0,l=IF;a<l.length;a++){var c=l[a];nB(e[c])&&(e[c]=MF[c])}var u=eB(e)||tB(e);if(u)return LF.invalid(u);var d=SF(e,i.offset(s),i);n=d[0],r=d[1]}return new LF({ts:n,zone:i,loc:o,o:r})}function NF(e,t,n){var r=!!nB(n.round)||n.round,i=function(e,i){return e=mB(e,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(e,i)},o=function(r){return n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r)};if(n.unit)return i(o(n.unit),n.unit);for(var s,a=MD(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 DF(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 LF=function(e){function t(e){var t=e.zone||UL.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new jL("invalid input"):null)||(t.isValid?null:fF(t));this.ts=nB(e.ts)?UL.now():e.ts;var r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t)){var o=[e.old.c,e.old.o];r=o[0],i=o[1]}else{var s=t.offset(this.ts);r=bF(this.ts,s),r=(n=Number.isNaN(r.year)?new jL("invalid input"):null)?null:r,i=n?null:s}this._zone=t,this.loc=e.loc||TL.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=DF(arguments),t=e[0],n=e[1],r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],c=n[6];return OF({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:c},t)},t.utc=function(){var e=DF(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=IL.utcInstance,OF({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:c},t)},t.fromJSDate=function(e,n){void 0===n&&(n={});var r=function(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?e.valueOf():NaN;if(Number.isNaN(r))return t.invalid("invalid input");var i=PL(n.zone,UL.defaultZone);return i.isValid?new t({ts:r,zone:i,loc:TL.fromObject(n)}):t.invalid(fF(i))},t.fromMillis=function(e,n){if(void 0===n&&(n={}),rB(e))return e<-864e13||e>hF?t.invalid("Timestamp out of range"):new t({ts:e,zone:PL(n.zone,UL.defaultZone),loc:TL.fromObject(n)});throw new OD("fromMillis requires a numerical input, but received a "+typeof e+" with value "+e)},t.fromSeconds=function(e,n){if(void 0===n&&(n={}),rB(e))return new t({ts:1e3*e,zone:PL(n.zone,UL.defaultZone),loc:TL.fromObject(n)});throw new OD("fromSeconds requires a numerical input")},t.fromObject=function(e,n){void 0===n&&(n={}),e=e||{};var r=PL(n.zone,UL.defaultZone);if(!r.isValid)return t.invalid(fF(r));var i=TL.fromObject(n),o=MB(e,kF),s=ZL(o,i),a=s.minDaysInFirstWeek,l=s.startOfWeek,c=UL.now(),u=nB(n.specificOffset)?r.offset(c):n.specificOffset,d=!nB(o.ordinal),p=!nB(o.year),h=!nB(o.month)||!nB(o.day),f=p||h,m=o.weekYear||o.weekNumber;if((f||d)&&m)throw new PD("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&d)throw new PD("Can't mix ordinal dates with month/day");var g,v,y=m||o.weekday&&!f,b=bF(c,u);y?(g=RF,v=TF,b=QL(b,a,l)):d?(g=PF,v=_F,b=XL(b)):(g=IF,v=MF);for(var S,x=!1,w=MD(g);!(S=w()).done;){var C=S.value;nB(o[C])?o[C]=x?v[C]:b[C]:x=!0}var A=y?function(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r=iB(e.weekYear),i=uB(e.weekNumber,1,xB(e.weekYear,t,n)),o=uB(e.weekday,1,7);return r?i?!o&&GL("weekday",e.weekday):GL("week",e.weekNumber):GL("weekYear",e.weekYear)}(o,a,l):d?function(e){var t=iB(e.year),n=uB(e.ordinal,1,vB(e.year));return t?!n&&GL("ordinal",e.ordinal):GL("year",e.year)}(o):eB(o),E=A||tB(o);if(E)return t.invalid(E);var M=SF(y?YL(o,a,l):d?$L(o):o,u,r),T=new t({ts:M[0],zone:r,o:M[1],loc:i});return o.weekday&&f&&e.weekday!==T.weekday?t.invalid("mismatched weekday","you can't specify both a weekday of "+o.weekday+" and a date of "+T.toISO()):T},t.fromISO=function(e,t){void 0===t&&(t={});var n=function(e){return JB(e,[Sz,Az],[xz,Ez],[wz,Mz],[Cz,Tz])}(e);return wF(n[0],n[1],t,"ISO 8601",e)},t.fromRFC2822=function(e,t){void 0===t&&(t={});var n=function(e){return JB(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[hz,fz])}(e);return wF(n[0],n[1],t,"RFC 2822",e)},t.fromHTTP=function(e,t){void 0===t&&(t={});var n=function(e){return JB(e,[mz,yz],[gz,yz],[vz,bz])}(e);return wF(n[0],n[1],t,"HTTP",t)},t.fromFormat=function(e,n,r){if(void 0===r&&(r={}),nB(e)||nB(n))throw new OD("fromFormat requires an input string and a format");var i=r,o=i.locale,s=void 0===o?null:o,a=i.numberingSystem,l=void 0===a?null:a,c=function(e,t,n){var r=uF(e,t,n);return[r.result,r.zone,r.specificOffset,r.invalidReason]}(TL.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),e,n),u=c[0],d=c[1],p=c[2],h=c[3];return h?t.invalid(h):wF(u,d,r,"format "+n,e,p)},t.fromString=function(e,n,r){return void 0===r&&(r={}),t.fromFormat(e,n,r)},t.fromSQL=function(e,t){void 0===t&&(t={});var n=function(e){return JB(e,[Iz,Az],[Rz,Pz])}(e);return wF(n[0],n[1],t,"SQL",e)},t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new OD("need to specify a reason the DateTime is invalid");var r=e instanceof jL?e:new jL(e,n);if(UL.throwOnInvalid)throw new _D(r);return new t({invalid:r})},t.isDateTime=function(e){return e&&e.isLuxonDateTime||!1},t.parseFormatForOpts=function(e,t){void 0===t&&(t={});var n=dF(e,TL.fromObject(t));return n?n.map((function(e){return e?e.val:null})).join(""):null},t.expandFormat=function(e,t){return void 0===t&&(t={}),cF(GB.parseFormat(e),TL.fromObject(t)).map((function(e){return e.val})).join("")};var n=t.prototype;return n.get=function(e){return this[e]},n.getPossibleOffsets=function(){if(!this.isValid||this.isOffsetFixed)return[this];var e=864e5,t=6e4,n=bB(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),o=this.zone.offset(n-r*t),s=this.zone.offset(n-i*t);if(o===s)return[this];var a=n-o*t,l=n-s*t,c=bF(a,o),u=bF(l,s);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[vF(this,{ts:a}),vF(this,{ts:l})]:[this]},n.resolvedLocaleOptions=function(e){void 0===e&&(e={});var t=GB.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t.locale,numberingSystem:t.numberingSystem,outputCalendar:t.calendar}},n.toUTC=function(e,t){return void 0===e&&(e=0),void 0===t&&(t={}),this.setZone(IL.instance(e),t)},n.toLocal=function(){return this.setZone(UL.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=PL(e,UL.defaultZone)).equals(this.zone))return this;if(e.isValid){var l=this.ts;if(o||a){var c=e.offset(this.ts);l=SF(this.toObject(),c,e)[0]}return vF(this,{ts:l,zone:e})}return t.invalid(fF(e))},n.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.outputCalendar;return vF(this,{loc:this.loc.clone({locale:n,numberingSystem:r,outputCalendar:i})})},n.setLocale=function(e){return this.reconfigure({locale:e})},n.set=function(e){if(!this.isValid)return this;var t,n=MB(e,kF),r=ZL(n,this.loc),i=r.minDaysInFirstWeek,o=r.startOfWeek,s=!nB(n.weekYear)||!nB(n.weekNumber)||!nB(n.weekday),a=!nB(n.ordinal),l=!nB(n.year),c=!nB(n.month)||!nB(n.day),u=l||c,d=n.weekYear||n.weekNumber;if((u||a)&&d)throw new PD("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new PD("Can't mix ordinal dates with month/day");s?t=YL(vD({},QL(this.c,i,o),n),i,o):nB(n.ordinal)?(t=vD({},this.toObject(),n),nB(n.day)&&(t.day=Math.min(yB(t.year,t.month),t.day))):t=$L(vD({},XL(this.c),n));var p=SF(t,this.o,this.zone);return vF(this,{ts:p[0],o:p[1]})},n.plus=function(e){return this.isValid?vF(this,xF(this,Vz.fromDurationLike(e))):this},n.minus=function(e){return this.isValid?vF(this,xF(this,Vz.fromDurationLike(e).negate())):this},n.startOf=function(e,t){var n=(void 0===t?{}:t).useLocaleWeeks,r=void 0!==n&&n;if(!this.isValid)return this;var i={},o=Vz.normalizeUnit(e);switch(o){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0}if("weeks"===o)if(r){var s=this.loc.getStartOfWeek();this.weekday<s&&(i.weekNumber=this.weekNumber-1),i.weekday=s}else i.weekday=1;if("quarters"===o){var a=Math.ceil(this.month/3);i.month=3*(a-1)+1}return this.set(i)},n.endOf=function(e,t){var n;return this.isValid?this.plus((n={},n[e]=1,n)).startOf(e,t).minus(1):this},n.toFormat=function(e,t){return void 0===t&&(t={}),this.isValid?GB.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):pF},n.toLocaleString=function(e,t){return void 0===e&&(e=zD),void 0===t&&(t={}),this.isValid?GB.create(this.loc.clone(t),e).formatDateTime(this):pF},n.toLocaleParts=function(e){return void 0===e&&(e={}),this.isValid?GB.create(this.loc.clone(e),e).formatDateTimeParts(this):[]},n.toISO=function(e){var t=void 0===e?{}:e,n=t.format,r=void 0===n?"extended":n,i=t.suppressSeconds,o=void 0!==i&&i,s=t.suppressMilliseconds,a=void 0!==s&&s,l=t.includeOffset,c=void 0===l||l,u=t.extendedZone,d=void 0!==u&&u;if(!this.isValid)return null;var p="extended"===r,h=AF(this,p);return h+="T",h+=EF(this,p,o,a,c,d)},n.toISODate=function(e){var t=(void 0===e?{}:e).format,n=void 0===t?"extended":t;return this.isValid?AF(this,"extended"===n):null},n.toISOWeekDate=function(){return CF(this,"kkkk-'W'WW-c")},n.toISOTime=function(e){var t=void 0===e?{}:e,n=t.suppressMilliseconds,r=void 0!==n&&n,i=t.suppressSeconds,o=void 0!==i&&i,s=t.includeOffset,a=void 0===s||s,l=t.includePrefix,c=void 0!==l&&l,u=t.extendedZone,d=void 0!==u&&u,p=t.format,h=void 0===p?"extended":p;return this.isValid?(c?"T":"")+EF(this,"extended"===h,o,r,a,d):null},n.toRFC2822=function(){return CF(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},n.toHTTP=function(){return CF(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},n.toSQLDate=function(){return this.isValid?AF(this,!0):null},n.toSQLTime=function(e){var t=void 0===e?{}:e,n=t.includeOffset,r=void 0===n||n,i=t.includeZone,o=void 0!==i&&i,s=t.includeOffsetSpace,a="HH:mm:ss.SSS";return(o||r)&&((void 0===s||s)&&(a+=" "),o?a+="z":r&&(a+="ZZ")),CF(this,a,!0)},n.toSQL=function(e){return void 0===e&&(e={}),this.isValid?this.toSQLDate()+" "+this.toSQLTime(e):null},n.toString=function(){return this.isValid?this.toISO():pF},n[e]=function(){return this.isValid?"DateTime { ts: "+this.toISO()+", zone: "+this.zone.name+", locale: "+this.locale+" }":"DateTime { Invalid, reason: "+this.invalidReason+" }"},n.valueOf=function(){return this.toMillis()},n.toMillis=function(){return this.isValid?this.ts:NaN},n.toSeconds=function(){return this.isValid?this.ts/1e3:NaN},n.toUnixInteger=function(){return this.isValid?Math.floor(this.ts/1e3):NaN},n.toJSON=function(){return this.toISO()},n.toBSON=function(){return this.toJSDate()},n.toObject=function(e){if(void 0===e&&(e={}),!this.isValid)return{};var t=vD({},this.c);return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t},n.toJSDate=function(){return new Date(this.isValid?this.ts:NaN)},n.diff=function(e,t,n){if(void 0===t&&(t="milliseconds"),void 0===n&&(n={}),!this.isValid||!e.isValid)return Vz.invalid("created by diffing an invalid DateTime");var r,i=vD({locale:this.locale,numberingSystem:this.numberingSystem},n),o=(r=t,Array.isArray(r)?r:[r]).map(Vz.normalizeUnit),s=e.valueOf()>this.valueOf(),a=Jz(s?this:e,s?e:this,o,i);return s?a.negate():a},n.diffNow=function(e,n){return void 0===e&&(e="milliseconds"),void 0===n&&(n={}),this.diff(t.now(),e,n)},n.until=function(e){return this.isValid?Wz.fromDateTimes(this,e):this},n.hasSame=function(e,t,n){if(!this.isValid)return!1;var r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)},n.equals=function(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},n.toRelative=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var n=e.base||t.fromObject({},{zone:this.zone}),r=e.padding?this<n?-e.padding:e.padding:0,i=["years","months","days","hours","minutes","seconds"],o=e.unit;return Array.isArray(e.unit)&&(i=e.unit,o=void 0),NF(n,this.plus(r),vD({},e,{numeric:"always",units:i,unit:o}))},n.toRelativeCalendar=function(e){return void 0===e&&(e={}),this.isValid?NF(e.base||t.fromObject({},{zone:this.zone}),this,vD({},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 OD("min requires all arguments be DateTimes");return aB(n,(function(e){return e.valueOf()}),Math.min)},t.max=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!n.every(t.isDateTime))throw new OD("max requires all arguments be DateTimes");return aB(n,(function(e){return e.valueOf()}),Math.max)},t.fromFormatExplain=function(e,t,n){void 0===n&&(n={});var r=n,i=r.locale,o=void 0===i?null:i,s=r.numberingSystem,a=void 0===s?null:s;return uF(TL.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)},gD(t,[{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}},{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"outputCalendar",get:function(){return this.isValid?this.loc.outputCalendar:null}},{key:"zone",get:function(){return this._zone}},{key:"zoneName",get:function(){return this.isValid?this.zone.name:null}},{key:"year",get:function(){return this.isValid?this.c.year:NaN}},{key:"quarter",get:function(){return this.isValid?Math.ceil(this.c.month/3):NaN}},{key:"month",get:function(){return this.isValid?this.c.month:NaN}},{key:"day",get:function(){return this.isValid?this.c.day:NaN}},{key:"hour",get:function(){return this.isValid?this.c.hour:NaN}},{key:"minute",get:function(){return this.isValid?this.c.minute:NaN}},{key:"second",get:function(){return this.isValid?this.c.second:NaN}},{key:"millisecond",get:function(){return this.isValid?this.c.millisecond:NaN}},{key:"weekYear",get:function(){return this.isValid?mF(this).weekYear:NaN}},{key:"weekNumber",get:function(){return this.isValid?mF(this).weekNumber:NaN}},{key:"weekday",get:function(){return this.isValid?mF(this).weekday:NaN}},{key:"isWeekend",get:function(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}},{key:"localWeekday",get:function(){return this.isValid?gF(this).weekday:NaN}},{key:"localWeekNumber",get:function(){return this.isValid?gF(this).weekNumber:NaN}},{key:"localWeekYear",get:function(){return this.isValid?gF(this).weekYear:NaN}},{key:"ordinal",get:function(){return this.isValid?XL(this.c).ordinal:NaN}},{key:"monthShort",get:function(){return this.isValid?qz.months("short",{locObj:this.loc})[this.month-1]:null}},{key:"monthLong",get:function(){return this.isValid?qz.months("long",{locObj:this.loc})[this.month-1]:null}},{key:"weekdayShort",get:function(){return this.isValid?qz.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}},{key:"weekdayLong",get:function(){return this.isValid?qz.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}},{key:"offset",get:function(){return this.isValid?+this.o:NaN}},{key:"offsetNameShort",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}},{key:"offsetNameLong",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}},{key:"isOffsetFixed",get:function(){return this.isValid?this.zone.isUniversal:null}},{key:"isInDST",get:function(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function(){return gB(this.year)}},{key:"daysInMonth",get:function(){return yB(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?vB(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?xB(this.weekYear):NaN}},{key:"weeksInLocalWeekYear",get:function(){return this.isValid?xB(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}}],[{key:"DATE_SHORT",get:function(){return zD}},{key:"DATE_MED",get:function(){return FD}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return UD}},{key:"DATE_FULL",get:function(){return jD}},{key:"DATE_HUGE",get:function(){return HD}},{key:"TIME_SIMPLE",get:function(){return VD}},{key:"TIME_WITH_SECONDS",get:function(){return GD}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return WD}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return qD}},{key:"TIME_24_SIMPLE",get:function(){return KD}},{key:"TIME_24_WITH_SECONDS",get:function(){return JD}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return QD}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return YD}},{key:"DATETIME_SHORT",get:function(){return XD}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return $D}},{key:"DATETIME_MED",get:function(){return ZD}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return eL}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return tL}},{key:"DATETIME_FULL",get:function(){return nL}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return rL}},{key:"DATETIME_HUGE",get:function(){return iL}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return oL}}]),t}(Symbol.for("nodejs.util.inspect.custom"));function BF(e){if(LF.isDateTime(e))return e;if(e&&e.valueOf&&rB(e.valueOf()))return LF.fromJSDate(e);if(e&&"object"==typeof e)return LF.fromObject(e);throw new OD("Unknown datetime argument: "+e+", of type "+typeof e)}fD.DateTime=LF,fD.Duration=Vz,fD.FixedOffsetZone=IL,fD.IANAZone=pL,fD.Info=qz,fD.Interval=Wz,fD.InvalidZone=RL,fD.Settings=UL,fD.SystemZone=lL,fD.VERSION="3.4.4",fD.Zone=sL;c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");function zF(e,t){let[n,r]=(0,c.useState)(e),i=Ja(e);return Ka((()=>r(i.current)),[i,r,...t]),n}var FF=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(FF||{}),UF=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(UF||{}),jF=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(jF||{}),HF=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.SetOrientation=3]="SetOrientation",e[e.GoToOption=4]="GoToOption",e[e.Search=5]="Search",e[e.ClearSearch=6]="ClearSearch",e[e.RegisterOption=7]="RegisterOption",e[e.UnregisterOption=8]="UnregisterOption",e))(HF||{});function VF(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=El(t(e.options.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{options:r,activeOptionIndex:i}}let GF={1:e=>e.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1},0(e){if(e.disabled||0===e.listboxState)return e;let t=e.activeOptionIndex,{value:n,mode:r,compare:i}=e.propsRef.current,o=e.options.findIndex((e=>{let t=e.dataRef.current.value;return La(r,{1:()=>n.some((e=>i(e,t))),0:()=>i(n,t)})}));return-1!==o&&(t=o),{...e,listboxState:0,activeOptionIndex:t}},2:(e,t)=>e.disabled===t.disabled?e:{...e,disabled:t.disabled},3:(e,t)=>e.orientation===t.orientation?e:{...e,orientation:t.orientation},4(e,t){var n;if(e.disabled||1===e.listboxState)return e;let r=VF(e),i=Td(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},5:(e,t)=>{if(e.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find((e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))})),o=i?e.options.indexOf(i):-1;return-1===o||o===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:o,activationTrigger:1}},6:e=>e.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},7:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=VF(e,(e=>[...e,n]));if(null===e.activeOptionIndex){let{value:i,mode:o,compare:s}=e.propsRef.current,a=t.dataRef.current.value;La(o,{1:()=>i.some((e=>s(e,a))),0:()=>s(i,a)})&&(r.activeOptionIndex=r.options.indexOf(n))}return{...e,...r}},8:(e,t)=>{let n=VF(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},WF=(0,c.createContext)(null);function qF(e){let t=(0,c.useContext)(WF);if(null===t){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,qF),t}return t}function KF(e,t){return La(t.type,GF,e,t)}WF.displayName="ListboxContext";let JF=c.Fragment,QF=Va((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,horizontal:u=!1,multiple:d=!1,...p}=e;const h=u?"horizontal":"vertical";let f=$a(n),[m,g]=Hf(r,s,i),v=(0,c.useReducer)(KF,{listboxState:1,propsRef:{current:{value:m,onChange:g,mode:d?1:0,compare:Qa("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a)}},labelRef:(0,c.createRef)(),buttonRef:(0,c.createRef)(),optionsRef:(0,c.createRef)(),disabled:l,orientation:h,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1}),[{listboxState:y,propsRef:b,optionsRef:S,buttonRef:x},w]=v;b.current.value=m,b.current.mode=d?1:0,Ka((()=>{b.current.onChange=e=>La(b.current.mode,{0:()=>g(e),1(){let t=b.current.value.slice(),{compare:n}=b.current,r=t.findIndex((t=>n(t,e)));return-1===r?t.push(e):t.splice(r,1),g(t)}})}),[g,b]),Ka((()=>w({type:2,disabled:l})),[l]),Ka((()=>w({type:3,orientation:h})),[h]),cc([x,S],((e,t)=>{var n;w({type:1}),xl(t,Sl.Loose)||(e.preventDefault(),null==(n=x.current)||n.focus())}),0===y);let C=(0,c.useMemo)((()=>({open:0===y,disabled:l,value:m})),[y,l,m]),A={ref:f};return t(c).createElement(WF.Provider,{value:v},t(c).createElement(ic,{value:La(y,{0:nc.Open,1:nc.Closed})},null!=o&&null!=m&&zf({[o]:m}).map((([e,n])=>t(c).createElement(cl,{features:ll.Hidden,...Ga({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:n})}))),Ua({ourProps:A,theirProps:p,slot:C,defaultTag:JF,name:"Listbox"})))})),YF=Va((function(e,t){var n;let[r,i]=qF("Listbox.Button"),o=$a(r.buttonRef,t),s=`headlessui-listbox-button-${al()}`,a=Ic(),l=Qa((e=>{switch(e.key){case el.Space:case el.Enter:case el.ArrowDown:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Md.First})}));break;case el.ArrowUp:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Md.Last})}))}})),u=Qa((e=>{if(e.key===el.Space)e.preventDefault()})),d=Qa((e=>{if(tl(e.currentTarget))return e.preventDefault();0===r.listboxState?(i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),i({type:0}))})),p=zF((()=>{if(r.labelRef.current)return[r.labelRef.current.id,s].join(" ")}),[r.labelRef.current,s]),h=(0,c.useMemo)((()=>({open:0===r.listboxState,disabled:r.disabled,value:r.propsRef.current.value})),[r]),f=e;return Ua({ourProps:{ref:o,id:s,type:Rd(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.optionsRef.current)?void 0:n.id,"aria-expanded":r.disabled?void 0:0===r.listboxState,"aria-labelledby":p,disabled:r.disabled,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:f,slot:h,defaultTag:"button",name:"Listbox.Button"})})),XF=Va((function(e,t){let[n]=qF("Listbox.Label"),r=`headlessui-listbox-label-${al()}`;return Ua({ourProps:{ref:$a(n.labelRef,t),id:r,onClick:Qa((()=>{var e;return null==(e=n.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))},theirProps:e,slot:(0,c.useMemo)((()=>({open:0===n.listboxState,disabled:n.disabled})),[n]),defaultTag:"label",name:"Listbox.Label"})})),$F=za.RenderStrategy|za.Static,ZF=Va((function(e,t){var n;let[r,i]=qF("Listbox.Options"),o=$a(r.optionsRef,t),s=`headlessui-listbox-options-${al()}`,a=Ic(),l=Ic(),u=rc(),d=null!==u?u===nc.Open:0===r.listboxState;(0,c.useEffect)((()=>{var e;let t=r.optionsRef.current;!t||0===r.listboxState&&t!==(null==(e=pl(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})}),[r.listboxState,r.optionsRef]);let p=Qa((e=>{switch(l.dispose(),e.key){case el.Space:if(""!==r.searchQuery)return e.preventDefault(),e.stopPropagation(),i({type:5,value:e.key});case el.Enter:if(e.preventDefault(),e.stopPropagation(),null!==r.activeOptionIndex){let{dataRef:e}=r.options[r.activeOptionIndex];r.propsRef.current.onChange(e.current.value)}0===r.propsRef.current.mode&&(i({type:1}),dl().nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})})));break;case La(r.orientation,{vertical:el.ArrowDown,horizontal:el.ArrowRight}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Md.Next});case La(r.orientation,{vertical:el.ArrowUp,horizontal:el.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Md.Previous});case el.Home:case el.PageUp:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Md.First});case el.End:case el.PageDown:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Md.Last});case el.Escape:return e.preventDefault(),e.stopPropagation(),i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case el.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(i({type:5,value:e.key}),l.setTimeout((()=>i({type:6})),350))}})),h=zF((()=>{var e,t,n;return null!=(n=null==(e=r.labelRef.current)?void 0:e.id)?n:null==(t=r.buttonRef.current)?void 0:t.id}),[r.labelRef.current,r.buttonRef.current]),f=(0,c.useMemo)((()=>({open:0===r.listboxState})),[r]),m=e;return Ua({ourProps:{"aria-activedescendant":null===r.activeOptionIndex||null==(n=r.options[r.activeOptionIndex])?void 0:n.id,"aria-multiselectable":1===r.propsRef.current.mode||void 0,"aria-labelledby":h,"aria-orientation":r.orientation,id:s,onKeyDown:p,role:"listbox",tabIndex:0,ref:o},theirProps:m,slot:f,defaultTag:"ul",features:$F,visible:d,name:"Listbox.Options"})})),eU=Va((function(e,t){let{disabled:n=!1,value:r,...i}=e,[o,s]=qF("Listbox.Option"),a=`headlessui-listbox-option-${al()}`,l=null!==o.activeOptionIndex&&o.options[o.activeOptionIndex].id===a,{value:u,compare:d}=o.propsRef.current,p=La(o.propsRef.current.mode,{1:()=>u.some((e=>d(e,r))),0:()=>d(u,r)}),h=(0,c.useRef)(null),f=$a(t,h);Ka((()=>{if(0!==o.listboxState||!l||0===o.activationTrigger)return;let e=dl();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=h.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[h,l,o.listboxState,o.activationTrigger,o.activeOptionIndex]);let m=(0,c.useRef)({disabled:n,value:r,domRef:h});Ka((()=>{m.current.disabled=n}),[m,n]),Ka((()=>{m.current.value=r}),[m,r]),Ka((()=>{var e,t;m.current.textValue=null==(t=null==(e=h.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[m,h]);let g=Qa((()=>o.propsRef.current.onChange(r)));Ka((()=>(s({type:7,id:a,dataRef:m}),()=>s({type:8,id:a}))),[m,a]);let v=Qa((e=>{if(n)return e.preventDefault();g(),0===o.propsRef.current.mode&&(s({type:1}),dl().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})})))})),y=Qa((()=>{if(n)return s({type:4,focus:Md.Nothing});s({type:4,focus:Md.Specific,id:a})})),b=Qa((()=>{n||l||s({type:4,focus:Md.Specific,id:a,trigger:0})})),S=Qa((()=>{n||!l||s({type:4,focus:Md.Nothing})})),x=(0,c.useMemo)((()=>({active:l,selected:p,disabled:n})),[l,p,n]);return Ua({ourProps:{id:a,ref:f,role:"option",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,"aria-selected":p,disabled:void 0,onClick:v,onFocus:y,onPointerMove:b,onMouseMove:b,onPointerLeave:S,onMouseLeave:S},theirProps:i,slot:x,defaultTag:"li",name:"Listbox.Option"})})),tU=Object.assign(QF,{Button:YF,Label:XF,Options:ZF,Option:eU});var nU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",focusable:"false",role:"img",className:e,fill:"currentColor","aria-label":t,children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z",clipRule:"evenodd"})});const rU={en:["January","February","March","April","May","June","July","August","September","October","November","December"],it:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"]},iU=(0,c.memo)((({defaultDate:e,onChange:t,disabled:n=!1})=>{const{t:r,i18n:i}=ve(),[o,a]=(0,c.useState)(e?"string"==typeof e?fD.DateTime.fromISO(e):fD.DateTime.fromJSDate(e):fD.DateTime.now());return(0,c.useEffect)((()=>{t(o)}),[o,t]),(0,s.jsxs)("div",{className:"memori--date-selector",children:[(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(tU,{value:o,onChange:e=>{a(e)},disabled:n,name:"day",children:[(0,s.jsxs)(tU.Label,{className:"memori--date-selector__select-label",children:[r("day"),":"]}),(0,s.jsxs)(tU.Button,{"aria-label":r("day"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.day}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(nU,{})})]}),(0,s.jsx)(Wc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(tU.Options,{className:"memori--date-selector__select-options",children:[...Array(31).keys()].map((e=>(0,s.jsx)(tU.Option,{value:o.set({day:e+1}),className:"memori--date-selector__select-option",children:e+1},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(tU,{value:o,onChange:e=>{a(e)},disabled:n,name:"month",children:[(0,s.jsxs)(tU.Label,{className:"memori--date-selector__select-label",children:[r("month"),":"]}),(0,s.jsxs)(tU.Button,{"aria-label":r("month"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:rU["it"===i.language?"it":"en"][o.month-1]}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(nU,{})})]}),(0,s.jsx)(Wc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(tU.Options,{className:"memori--date-selector__select-options",children:rU["it"===i.language?"it":"en"].map((e=>(0,s.jsx)(tU.Option,{className:"memori--date-selector__select-option",value:o.set({month:rU["it"===i.language?"it":"en"].findIndex((t=>t===e))+1}),children:e},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(tU,{value:o,onChange:e=>{a(e)},disabled:n,name:"year",children:[(0,s.jsxs)(tU.Label,{className:"memori--date-selector__select-label",children:[r("year"),":"]}),(0,s.jsxs)(tU.Button,{"aria-label":r("year"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.year}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(nU,{})})]}),(0,s.jsx)(Wc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(tU.Options,{className:"memori--date-selector__select-options",children:[...Array(fD.DateTime.now().year-1899).keys()].sort(((e,t)=>t-e)).map((e=>(0,s.jsx)(tU.Option,{value:o.set({year:e+1900}),className:"memori--date-selector__select-option",children:e+1900},e)))})})]})})]})}));iU.displayName="DateSelector";var oU=iU;c=o("85Hg2");var sU=({visible:e=!1,onClose:n,minAge:r})=>{const{t:i}=ve(),[o,a]=(0,c.useState)(),[l,u]=(0,c.useState)(),[d,p]=(0,c.useState)(!1),h=(0,c.useCallback)((()=>{if(p(!0),!o)return t(Ss).error(i("requiredField")),u(i("requiredField")||"Required field"),void p(!1);if(fD.DateTime.now().diff(o,"years").years<r)return t(Ss).error(i("underageTwinSession",{age:r})),u(i("underageTwinSession",{age:r})||`You must be at least ${r} years old to interact with this Twin`),void p(!1);n(o.toJSDate().toISOString())}),[o,r,n,i]);return(0,s.jsxs)(Jc,{open:e,title:i("ageVerification"),className:"age-verification-modal",closable:!0,onClose:()=>n(),children:[(0,s.jsx)("p",{children:i("ageVerificationText",{minAge:r})}),(0,s.jsxs)("form",{className:"age-verification-form",onSubmit:e=>{e.preventDefault(),h()},children:[(0,s.jsx)("div",{className:"form-item",children:(0,s.jsxs)("fieldset",{name:"birthDate",children:[(0,s.jsx)("legend",{className:"sr-only",children:i("birthDate")}),(0,s.jsx)(oU,{defaultDate:new Date(Date.now()),onChange:e=>{a(e)}}),(0,s.jsx)("p",{className:"form-item-help",children:i("birthDateHelper")}),l&&(0,s.jsx)("p",{className:"form-item-error",children:l})]})}),(0,s.jsx)("div",{className:"form-item form-submit",children:(0,s.jsx)(Da,{primary:!0,htmlType:"submit",className:"age-verification-submit",loading:d,disabled:!o,children:i("confirm")})})]})]})};c=o("85Hg2");var aU=({open:e=!1,onClose:n,className:r,title:i,description:o,children:a,footer:l,loading:u=!1,side:d="right",closable:p=!0,width:h="100%",widthMd:f="80%",widthLg:m="60%"})=>(0,s.jsx)(Wc,{appear:!0,show:e,as:t(c).Fragment,children:(0,s.jsxs)(Cc,{open:e,onClose:n,className:t(ys)("memori-drawer",r),children:[(0,s.jsx)(Wc.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)("div",{className:"memori-drawer--backdrop"})}),(0,s.jsx)("div",{className:"memori-drawer--container",children:(0,s.jsx)("div",{className:"memori-drawer--container-scrollable",children:(0,s.jsx)(Wc.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"max-w-0 opacity-0",enterTo:"max-w-100 opacity-100",leave:"ease-in duration-200",leaveFrom:"max-w-100 opacity-100",leaveTo:"max-w-0 opacity-0",children:(0,s.jsxs)(Cc.Panel,{className:t(ys)("memori-drawer--panel",{"memori-drawer--panel-left":"left"===d,"memori-drawer--with-footer":!!l}),children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n .memori-drawer--panel {\n --memori-drawer--width: ${h};\n --memori-drawer--width-lg: ${m};\n --memori-drawer--width-md: ${f};\n }\n `}}),p&&(0,s.jsx)("div",{className:"memori-drawer--close",children:(0,s.jsx)(Da,{shape:"circle",outlined:!0,icon:(0,s.jsx)(Kc,{}),onClick:()=>n(!1)})}),(0,s.jsxs)(qc,{spinning:u,children:[i&&(0,s.jsx)(Cc.Title,{className:"memori-drawer--title",children:i}),o&&(0,s.jsx)(Cc.Description,{className:"memori-drawer--description",children:o}),a,l&&(0,s.jsx)("div",{className:"memori-drawer--footer",children:l})]})]})})})})]})});c=o("85Hg2");var lU=({label:e,className:n,disabled:r=!1,indeterminate:i=!1,checked:o,children:a,onChange:l,name:u,...d})=>{const p=(0,c.useRef)(null);return(0,c.useEffect)((()=>{p.current&&(p.current.indeterminate=i)}),[p,i]),(0,s.jsxs)("label",{className:t(ys)("memori-checkbox",n,{"memori-checkbox--disabled":r,"memori-checkbox--indeterminate":i}),children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{ref:p,type:"checkbox",...d,name:u,disabled:r,checked:o||i,className:"memori-checkbox--input",onChange:l}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),!!(null==e?void 0:e.length)&&(0,s.jsx)("span",{className:"memori-checkbox--text",children:e})]})};c=o("85Hg2");var cU=({className:e,value:n,displayValue:r,options:i,onChange:o,disabled:a=!1,label:l,placeholder:u})=>(0,s.jsx)("div",{className:t(ys)("memori-select",e),children:(0,s.jsxs)(tU,{value:n,onChange:e=>{o(e)},disabled:a,name:"day",children:[l&&(0,s.jsxs)(tU.Label,{className:"memori-select--label",children:[l,":"]}),(0,s.jsxs)(tU.Button,{"aria-label":l,className:"memori-select--button",children:[(0,s.jsx)("span",{className:t(ys)("memori-select--value",{"memori-select--value-placeholder":!n}),children:n?r||n:u}),(0,s.jsx)("span",{className:"memori-select--icon",children:(0,s.jsx)(nU,{})})]}),(0,s.jsx)(Wc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(tU.Options,{className:"memori-select--options",children:i.map((e=>(0,s.jsx)(tU.Option,{value:e.value,className:"memori-select--option",children:e.label},e.value)))})})]})});const uU={muteSpeaker:"@memori:muteSpeaker",microphoneMode:"@memori:microphoneMode",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",sendOnEnter:"@memori:sendOnEnter",birthDate:"@memori:birthDate",controlsPosition:"@memori:controlsPosition",hideEmissions:"@memori:hideEmissions"},dU=(e,t)=>{var n;const r=window.localStorage.getItem(null!==(n=uU[e])&&void 0!==n?n:e);if(!r)return t;try{return JSON.parse(r)}catch(e){return r}},pU=(e,t)=>{var n;window.localStorage.setItem(null!==(n=uU[e])&&void 0!==n?n:e,t.toString())},hU=e=>{var t;window.localStorage.removeItem(null!==(t=uU[e])&&void 0!==t?t:e)},fU=[2,3,5,10,15,20,30,60];var mU=({open:e,layout:t="DEFAULT",onClose:n,microphoneMode:r="HOLD_TO_TALK",continuousSpeechTimeout:i,setMicrophoneMode:o,setContinuousSpeechTimeout:a,controlsPosition:l,setControlsPosition:c,hideEmissions:u,setHideEmissions:d,additionalSettings:p})=>{const{t:h}=ve();return(0,s.jsxs)(aU,{className:"memori-settings-drawer",open:e,onClose:n,title:h("widget.settings")||"Settings",description:h("write_and_speak.settingsHeaderLabel"),children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#microphoneMode",children:[h("write_and_speak.microphoneMode")||"Microphone mode",":"]}),(0,s.jsxs)($f,{id:"microphoneMode",name:"microphoneMode",value:r,defaultValue:r,className:"memori-settings-drawer--microphoneMode-radio",onChange:e=>{let t="CONTINUOUS"===e?"CONTINUOUS":"HOLD_TO_TALK";o(t),pU("microphoneMode",t)},children:[(0,s.jsx)($f.Option,{value:"HOLD_TO_TALK",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Da,{primary:e,children:h("write_and_speak.holdToSpeak")||"Hold to speak"})}),(0,s.jsx)($f.Option,{value:"CONTINUOUS",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Da,{primary:e,children:h("write_and_speak.continuousSpeechLabel")||"Continuous speech"})})]})]}),"CONTINUOUS"===r&&(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(cU,{label:h("write_and_speak.secondsLabel")||"Seconds",placeholder:h("write_and_speak.secondsLabel")||"Seconds",options:fU.map((e=>({value:e,label:e}))),value:i,onChange:e=>{a(e),pU("continuousSpeechTimeout",e)}})}),"TOTEM"===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#controlsPosition",children:[h("write_and_speak.controlsPosition")||"Controls",":"]}),(0,s.jsxs)($f,{id:"controlsPosition",name:"controlsPosition",value:l,defaultValue:l,className:"memori-settings-drawer--controlsposition-radio",onChange:e=>{c(e),pU("controlsPosition",e)},children:[(0,s.jsx)($f.Option,{value:"center",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Da,{primary:e,children:h("center")||"Center"})}),(0,s.jsx)($f.Option,{value:"bottom",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Da,{primary:e,children:h("bottom")||"Bottom"})})]})]}),(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(lU,{label:h("write_and_speak.hideEmissionsLabel")||"Hide emissions",name:"hideControls",checked:u,onChange:e=>{d(e.target.checked),pU("hideEmissions",e.target.checked)}})})]}),p&&(0,s.jsx)("div",{className:"memori-settings-drawer--field controls",children:p})]})};c=o("85Hg2");const gU=new Map(Object.entries({TENANT_NOT_FOUND:-1,TENANT_REGISTRATION_DISABLED:-2,TENANT_MISSING_NAME:-3,TENANT_MAX_USERS_REACHED:-4,TENANT_MAX_ADMINS_REACHED:-5,USER_NOT_CONFIRMED:-11,USER_NOT_FOUND:-12,USER_OR_PASSWORD_INVALID:-13,USER_MUST_CHANGE_PASSWORD:-14,USER_MUST_ENTER_VERIFICATION_CODE:-15,USER_MISSING_TENANT:-21,USER_MISSING_NAME:-22,USER_MISSING_PASSWORD:-23,USER_MISSING_EMAIL:-24,USER_MISSING_VERIFICATION_CODE:-25,USER_NAME_ALREADY_USED:-26,USER_PASSWORD_NOT_CONFORMING_TO_POLICY:-27,USER_EMAIL_ALREADY_USED:-28,USER_EMAIL_INVALID:-29,USER_VERIFICATION_CODE_INVALID:-30,USER_MISSING_NAME_OR_EMAIL:-31,USER_NAME_INVALID:-32,USER_HAS_ONE_OR_MORE_MEMORI:-33,USER_MISSING_NEW_PASSWORD:-34,USER_CANT_CREATE_MEMORI:-35,USER_MAX_MEMORI_REACHED:-36,USER_CANT_EDIT_INTEGRATIONS:-37,MEMORI_NOT_FOUND:-51,MEMORI_NOT_ACCESSIBLE:-52,MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN:-53,SESSION_NOT_FOUND:-101,SESSION_IS_NOT_ADMINISTRATIVE:-102,MEMORI_MISSING_CONFIGURATION:-201,MEMORI_CONFIGURATION_NOT_FOUND:-202,MEMORI_INVALID_PRIVACY_TYPE:-203,MEMORI_MISSING_PASSWORD:-204,MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS:-205,MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS:-206,MEMORI_INVALID_VOICE_TYPE:-207,MEMORI_MISSING_NAME:-208,MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS:-209,MEMORI_INVALID_ID:-210,MEMORI_NAME_ALREADY_USED:-211,MEMORI_INVALID_PIN:-212,MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION:-213,MEMORI_NO_PASSWORD_WHEN_PUBLIC:-214,MEMORI_TRANSFER_MISSING_DESTINATION_USER:-231,MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID:-232,MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT:-233,MEMORI_TRANSFER_NOTHING_TO_DO:-234,MEMORI_CONFIGURATION_CANT_BE_CHANGED:-251,MEMORI_MISSING_NEW_PASSWORD:-252,MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT:-261,MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT:-262,INTEGRATION_NOT_FOUND:-301,INTEGRATION_INVALID_TYPE:-401,INTEGRATION_ALREADY_EXISTS:-402,INTEGRATION_MEMORI_IS_NOT_PUBLIC:-403,INTEGRATION_MISSING_INVOCATION_TEXT:-404,INTEGRATION_MISSING_DEVICE_EMAILS:-405,INTEGRATION_MEMORI_IS_EMPTY:-406,INTEGRATION_MISSING_PRIVACY_POLICY:-407,INTEGRATION_MISSING_CATEGORY:-408,INTEGRATION_MISSING_DESCRIPTION:-409,INTEGRATION_INVALID_INVOCATION_TEXT:-410,INTEGRATION_GOOGLE_NO_MORE_AVAILABLE:-411,UPLOAD_REQUIRES_MULTIPART_ENCODING:-501,UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY:-502,UPLOAD_MAX_LENGTH_EXCEEDED:-503,UPLOAD_FILE_IS_EMPTY:-504,UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE:-505,UPLOAD_MISSING_FILE_NAME:-506,UPLOAD_INVALID_MEMORY_ID:-507,UPLOAD_MISSING_FILE_CONTENT:-508,ASSET_NOT_FOUND:-601,ASSET_NOT_ACCESSIBLE:-602,ASSET_MISSING_SESSION_ID:-603,ASSET_INVALID_FILE_NAME:-604,INVITATION_NOT_FOUND:-701,INVITATION_NOT_ACCESSIBLE:-702,INVITATION_ALREADY_ACCEPTED:-703,INVITATION_ALREADY_REJECTED:-704,INVITATION_MISSING_DESTINATION_EMAIL:-705,INVITATION_DESTINATION_EMAIL_INVALID:-706,INVITATION_MISSING_TAG:-707,INVITATION_MISSING_PIN:-708,INVITATION_INVALID_PIN:-709,INVITATION_INVALID_TYPE:-710,INVITATION_MISSING_DESTINATION_NAME:-711,INVITATION_TAG_PIN_CANT_BE_CHANGED:-712,INVITATION_CANT_BE_CHANGED:-713,ACTIONLOG_INVALID_USER_ID:-801,ACTIONLOG_INVALID_DATE_FROM_FORMAT:-802,ACTIONLOG_INVALID_DATE_TO_FORMAT:-803,ACTIONLOG_INVALID_MEMORI_ID:-804,CONSUMPTIONLOG_INVALID_TYPE:-901,CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT:-902,CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT:-903,CONSUMPTIONLOG_INVALID_USER_ID:-904,CONSUMPTIONLOG_INVALID_MEMORI_ID:-905}).map((([e,t])=>[t,e]))),vU=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=gU.get(e);return t?`errors.${t}`:"error.generic"};var yU=({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 bU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M15 18L9 12 15 6"})});var SU=({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 xU=({apiURL:e,sessionID:n,memori:r,visible:i=!0,initialKnownFacts:o=[],closeDrawer:a})=>{var l;const{t:u}=ve(),d=q(e),{getKnownFactsPaginated:p,deleteKnownFact:h}=d.knownFacts,[f,m]=(0,c.useState)(o),[g,v]=(0,c.useState)(25),[y,b]=(0,c.useState)(0),[S,x]=(0,c.useState)(null!==(l=null==o?void 0:o.length)&&void 0!==l?l:0),[w,C]=(0,c.useState)(!1),A=async(e,r,i)=>{if(n||e){C(!0);try{const{knownFacts:o,count:s,...a}=await p(null!=e?e:n,null!=r?r:y,null!=i?i:g);m(null!=o?o:[]),x(null!=s?s:0),0!==a.resultCode&&(console.error(a),t(Ss).error(u(vU(a.resultCode))))}catch(e){console.error("KNOWN_FACTS/FETCH",e),m(null!=o?o:[])}C(!1)}};(0,c.useEffect)((()=>{A()}),[]);const[E,M]=(0,c.useState)(!1),[T,_]=(0,c.useState)(),[I,R]=(0,c.useState)([]);return(0,s.jsxs)(aU,{open:i,width:"80%",className:"memori-known-facts-drawer",onClose:()=>a(),title:u("knownFacts.title"),children:[(0,s.jsx)("p",{children:u("knownFacts.description",{memoriName:r.name})}),(0,s.jsxs)(qc,{spinning:w,children:[(0,s.jsxs)("div",{className:"memori-known-facts-actions",children:[(0,s.jsxs)(Da,{primary:!0,danger:!0,onClick:()=>{M(!0)},className:"memori-known-facts-delete-selected",disabled:0===(null==I?void 0:I.length),icon:(0,s.jsx)(yU,{}),loading:w,children:[u("selected")," (",null==I?void 0:I.length,")"]}),(0,s.jsx)(Jc,{className:"memori-known-facts-modal",open:E,closable:!0,title:I.length>1?u("knownFacts.deleteSelectedConfirmTitle"):u("knownFacts.deleteConfirmTitle"),description:I.length>1?u("knownFacts.deleteSelectedConfirmMessage",{number:I.length}):u("knownFacts.deleteConfirmMessage"),onClose:()=>{M(!1)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Da,{ghost:!0,onClick:()=>{M(!1)},children:u("cancel")}),(0,s.jsx)(Da,{primary:!0,danger:!0,onClick:async()=>{try{const e=I.map((e=>h(n,e)));Promise.all(e).then((e=>{if(e.every((e=>0===e.resultCode)))t(Ss).success(u("knownFacts.deleteSuccess")),R([]),A(),M(!1);else{let n=e.find((e=>0!==e.resultCode));console.error(n),void 0!==(null==n?void 0:n.resultCode)&&t(Ss).error(u(vU(null==n?void 0:n.resultCode)))}}))}catch(e){let n=e;t(Ss).error(u("Error")+n.message)}},children:u("confirm")})]})})]}),S>25&&(0,s.jsxs)("nav",{className:"memori--table--pagination",children:[S>g&&(0,s.jsxs)("div",{className:"memori--table--pagination--pages",children:[(0,s.jsx)(Da,{shape:"circle",disabled:0===y||y<g,padded:!1,title:u("previous")||"Previous",icon:(0,s.jsx)(bU,{}),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)(Da,{shape:"circle",padded:!1,title:u("next")||"Next",icon:(0,s.jsx)(SU,{}),disabled:(y/g+1)*g>=S,onClick:()=>{let e=(y/g+1)*g;b(e),A(void 0,e,g)}})]}),(0,s.jsx)(cU,{options:[{label:`25 / ${u("page")||"page"}`,value:25},{label:`50 / ${u("page")||"page"}`,value:50},{label:`100 / ${u("page")||"page"}`,value:100}],value:g,displayValue:`${g} / ${u("page")||"page"}`,onChange:e=>{v(e),b(0),A(void 0,0,e)}})]}),(0,s.jsxs)("table",{className:"memori--table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(lU,{checked:!!(null==f?void 0:f.length)&&(null==I?void 0:I.length)===f.length,indeterminate:!!(null==f?void 0:f.length)&&!!(null==I?void 0:I.length)&&(null==I?void 0:I.length)!==(null==f?void 0:f.length),onChange:e=>{e.target.checked?R(f.map((e=>e.knownFactID))):R([])}})}),(0,s.jsx)("th",{children:u("knownFacts.text")}),(0,s.jsx)("th",{className:"mobile-hidden",children:u("createdAt")}),(0,s.jsx)("th",{className:"memori--table--column-right",children:u("actions")})]})}),(0,s.jsx)("tbody",{children:f.map((e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(lU,{checked:null==I?void 0:I.includes(e.knownFactID),onChange:t=>{t.target.checked?R((t=>[...new Set([...t,e.knownFactID])])):R((t=>t.filter((t=>t!==e.knownFactID))))}})}),(0,s.jsx)("td",{children:e.text}),(0,s.jsx)("td",{className:"mobile-hidden",children:(0,s.jsx)("span",{className:"memori--table--date",children:e.creationTimestamp?new Intl.DateTimeFormat("it",{dateStyle:"short",timeStyle:"short"}).format(new Date(e.creationTimestamp)):"-"})}),(0,s.jsx)("td",{className:"memori--table--column-right",children:(0,s.jsxs)("div",{className:"memori--table--action-column",children:[(0,s.jsx)(Da,{danger:!0,ghost:!0,shape:"circle",icon:(0,s.jsx)(yU,{}),disabled:(null==I?void 0:I.length)>0,title:u("delete")||"Delete",onClick:()=>_(e.knownFactID)}),(0,s.jsx)(Jc,{className:"memori-known-facts-modal",open:T===e.knownFactID,closable:!0,title:u("knownFacts.deleteConfirmTitle"),description:u("knownFacts.deleteConfirmMessage"),onClose:()=>{_(void 0)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Da,{ghost:!0,onClick:()=>{_(void 0)},children:u("cancel")}),(0,s.jsx)(Da,{primary:!0,danger:!0,onClick:async()=>{try{const r=await h(n,e.knownFactID);0===r.resultCode?(t(Ss).success(u("knownFacts.deleteSuccess")),R([]),A(),_(void 0)):(console.error(r),t(Ss).error(u(vU(r.resultCode),{ns:"common"})))}catch(e){let n=e;t(Ss).error(u("Error")+n.message)}},children:u("confirm")})]})})]})})]},e.knownFactID)))})]})]})]})};var wU=({open:e=!1,baseUrl:t,apiUrl:n,tenant:r,experts:i,onClose:o})=>{const{t:a}=ve();return(0,s.jsx)(aU,{open:e,onClose:o,className:"memori--experts-drawer",title:(0,s.jsx)("h2",{className:"memori--experts-drawer--title",children:a("widget.expertsInTheBoard")}),children:(0,s.jsx)("ul",{className:"memori--experts-drawer--list",children:i.map((e=>(0,s.jsxs)("li",{className:"memori--experts-drawer--item",children:[(0,s.jsx)("figure",{className:"memori--experts-drawer--avatar",children:(0,s.jsx)("img",{src:`${n}/api/v1/memoriai/memori/avatar/${e.expertMemoriID}`,alt:e.name,onError:e=>{e.currentTarget.src=wd({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:t}),e.currentTarget.onerror=null}})}),(0,s.jsxs)("div",{className:"memori--experts-drawer--content",children:[(0,s.jsx)("h3",{className:"memori--experts-drawer--name",children:e.name}),(0,s.jsx)("p",{className:"memori--experts-drawer--description",children:e.description})]})]},e.expertID)))})})};c=o("85Hg2");const CU=/^\w+([.-]?[+]?\w+)*@\w+([.-]?\w+)*(\.\w{2,})+$/;var AU=({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}=ve(),m="it"===f.language?"it":"en",g=q(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,M]=(0,c.useState)(null);(0,c.useEffect)((()=>{M(window.location.href)}),[]);const T=(null==o?void 0:o.userID)&&a;return(0,s.jsx)(aU,{open:e,onClose:n,className:t(ys)("memori--login-drawer",{"memori--login-drawer--logged":T}),title:(0,s.jsx)("h2",{className:"memori--login-drawer--title",children:T?h("login.loggedDrawerTitle",{name:o.userName}):h("login.loginDrawerTitle")}),children:T?(0,s.jsx)("div",{className:"memori--login-drawer--logged",children:(0,s.jsx)(Da,{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(Ss).error(h(vU(f.resultCode),{ns:"common"})),A(f.resultMessage)):(t(Ss).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)(Da,{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=CU.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(Ss).error(h(vU(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(Ss).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)(Da,{htmlType:"submit",primary:!0,loading:b,children:h("login.login")}),!(null==l?void 0:l.disableRegistration)&&(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 EU=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(qc,{spinning:g,children:[m&&d&&p&&(0,s.jsx)(d,{...p}),e&&t&&(0,s.jsx)(e,{...t}),(0,s.jsxs)("div",{className:"memori--grid",children:[(0,s.jsxs)("div",{className:"memori--grid-column memori--grid-column-left",children:[n&&r&&(0,s.jsx)(n,{...r}),(0,s.jsx)("div",{id:"extension"})]}),(0,s.jsx)("div",{className:"memori--grid-column memori--grid-column-right",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null}),v]})]})]});var MU=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(qc,{spinning:g,className:"memori-totem-layout",children:[v,m&&d&&p&&(0,s.jsx)(d,{...p}),(0,s.jsx)("div",{className:"memori-totem-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{className:"memori-totem-layout--avatar",children:n&&r&&(0,s.jsx)(n,{...r})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-totem-layout--controls",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]});var TU=({Header:e,headerProps:t,Chat:n,chatProps:r,StartPanel:i,startPanelProps:o,integrationStyle:a,integrationBackground:l,ChangeMode:c,changeModeProps:u,sessionId:d,hasUserActivatedSpeak:p,showInstruct:h=!1,loading:f=!1,poweredBy:m})=>(0,s.jsxs)(s.Fragment,{children:[a,l,(0,s.jsxs)(qc,{spinning:f,className:"memori-chat-layout",children:[m,h&&c&&u&&(0,s.jsx)(c,{...u}),(0,s.jsx)("div",{className:"memori-chat-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-chat-layout--controls",children:d&&p&&n&&r?(0,s.jsx)(n,{...r}):o?(0,s.jsx)(i,{...o}):null})]})]});c=o("85Hg2"),c=o("85Hg2");var _U=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>{var y,b;const{t:S}=ve(),[x,w]=(0,c.useState)(!0),[C,A]=(0,c.useState)(),E=(0,c.useMemo)((()=>null==o?void 0:o.stopAudio),[null==o?void 0:o.stopAudio]),M=e=>{w(e),A(e?void 0:(new Date).toISOString());try{null==E||E()}catch(e){console.log(e)}};return(0,s.jsx)("div",{className:"memori-website_assistant--"+(x?"collapsed":"expanded"),children:x?(0,s.jsx)("div",{className:"memori-website_assistant--trigger",children:(0,s.jsx)(Da,{className:"memori-website_assistant--trigger-button",ghost:!0,shape:"circle",onClick:()=>M(!1),title:S("expand")||"Expand",children:(0,s.jsx)(nN,{avatar:null==r?void 0:r.memori.avatarURL})})}):(0,s.jsxs)(s.Fragment,{children:[u,(0,s.jsxs)(qc,{spinning:g,className:"memori-website_assistant-layout",children:[v,(0,s.jsx)("div",{className:"memori-website_assistant--close-button-wrapper",children:(0,s.jsx)(Da,{className:"memori-website_assistant--close-button",primary:!0,shape:"circle",onClick:()=>M(!0),icon:(0,s.jsx)(Kc,{}),title:S("close")||"Close"})}),m&&d&&p&&(0,s.jsx)(d,{...p}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--header",children:e&&t&&(0,s.jsx)(e,{...t,showSettings:!1,showReload:!1})}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--avatar",children:n&&r&&(0,c.createElement)(n,{...r,integrationConfig:r.integrationConfig?{...r.integrationConfig,avatarURL:(null===(y=r.integrationConfig)||void 0===y?void 0:y.avatarURL)?`${null===(b=r.integrationConfig)||void 0===b?void 0:b.avatarURL.split("#")[0]}#${C}`:void 0}:{},key:C})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--controls",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]})})};const{deleteSession:IU,getStatistics:RU,initSession:PU}=q(),kU=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,"🧠"]]),OU=e=>{const t=Array.from(kU.keys()).filter((t=>t<=e));if(t.length>0){const e=t[t.length-1];return kU.get(e)}return""},NU=e=>{if("🆕"===e)return{points:10,badge:"🐹"};let t,n,r=!1;for(const[i,o]of kU){if(r){t=i,n=o;break}o===e&&(r=!0)}return n&&t?{points:t,badge:n}:void 0},DU=e=>{let t=0;for(const[n,r]of kU)if(r===e){t=n;break}return t},LU=e=>{const t=Math.round(e),n=OU(t);return{points:t,badge:n,pointsForCurrentBadge:DU(n),nextBadge:NU(n)}},BU=(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 zU,FU,UU,jU,HU,VU;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=BU,window.typeMessageHidden=(e,t=!0,n,r=!1,i=!1)=>BU(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),BU(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 GU=!1,WU=!1;var qU=({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=!0,showOnlyLastMessages:x,height:w="100vh",secret:C,baseUrl:A="https://aisuru.com",apiUrl:E="https://backend.memori.ai",initialContextVars:M,initialQuestion:T,ogImage:_,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:F})=>{var U,j,H,V,G,W,K,J,Q,Y,X,$,Z,ee,te,ne,re,ie,oe,se,ae,le;const{t:ce,i18n:ue}=ve(),[de,pe]=(0,c.useState)(!1);(0,c.useEffect)((()=>{pe(!0)}),[]);const he=q(E),{initSession:fe,postTextEnteredEvent:me,postPlaceChangedEvent:ge,postTimeoutEvent:ye,postTagChangedEvent:be,getSession:Se,getContentQualityIndexes:xe,getExpertReferences:we}=he,[Ce,Ae]=(0,c.useState)(!1),[Ee,Me]=(0,c.useState)(null!==(U=null==L?void 0:L.loginToken)&&void 0!==U?U:k),[Te,_e]=(0,c.useState)({avatarURL:"string"==typeof F?F:void 0});(0,c.useEffect)((()=>{Ee&&!(null==Te?void 0:Te.userID)&&S&&he.backend.getCurrentUser(Ee).then((({user:e,resultCode:t})=>{e&&0===t?(_e(e),pU("loginToken",Ee)):hU("loginToken")}))}),[Ee,null==Te?void 0:Te.userID]);const[Ie,Re]=(0,c.useState)(!1),[Pe,ke]=(0,c.useState)(!1),[Oe,Ne]=(0,c.useState)(!1),De=(null===(V=null===(H=null===(j=e.culture)||void 0===j?void 0:j.split("-"))||void 0===H?void 0:H[0])||void 0===V?void 0:V.toUpperCase())||(null===(J=null===(K=null===(W=null===(G=null==n?void 0:n.find((t=>t.memoriConfigID===e.memoriConfigurationID)))||void 0===G?void 0:G.culture)||void 0===W?void 0:W.split("-"))||void 0===K?void 0:K[0])||void 0===J?void 0:J.toUpperCase()),Le=(null==o?void 0:o.customData)?JSON.parse(o.customData):null,Be=void 0!==i?i:!!(null==Le?void 0:Le.multilanguage),[ze,Fe]=(0,c.useState)(null!==($=null!==(X=null!==(Y=null!==(Q=null!=r?r:null==Le?void 0:Le.lang)&&void 0!==Q?Q:De)&&void 0!==Y?Y:null==Le?void 0:Le.uiLang)&&void 0!==X?X:ue.language)&&void 0!==$?$:"IT"),[Ue,je]=(0,c.useState)(!1),[He,Ve]=(0,c.useState)(!1),[Ge,We]=(0,c.useState)(),qe=a||(null==Le?void 0:Le.layout)||"DEFAULT",[Ke,Je]=(0,c.useState)(!1),[Qe,Ye]=(0,c.useState)(!1),[Xe,$e]=(0,c.useState)(!1),[Ze,et]=(0,c.useState)(!1),[tt,nt]=(0,c.useState)(!1),[rt,it]=(0,c.useState)(!1),[ot,st]=(0,c.useState)(!N),[at,lt]=(0,c.useState)(!1),[ct,ut]=(0,c.useState)(2),[dt,pt]=(0,c.useState)(!1),[ht,ft]=(0,c.useState)("center"),[mt,gt]=(0,c.useState)(!1);(0,c.useEffect)((()=>{pt(!!UU),WU=!!UU}),[UU]),(0,c.useEffect)((()=>{let e="bottom",t=dU("microphoneMode","HOLD_TO_TALK");window.innerWidth<=768?(e="bottom",t="HOLD_TO_TALK"):e=window.matchMedia("(orientation: portrait)").matches||window.innerHeight>window.innerWidth?"center":"bottom",st(dU("muteSpeaker",!N)),GU=dU("muteSpeaker",!N),lt("CONTINUOUS"===t),ut(dU("continuousSpeechTimeout",2)),ft(dU("controlsPosition",e)),gt(dU("hideEmissions",!1)),(null==L?void 0:L.loginToken)||k||Me(dU("loginToken",void 0))}),[]);const[vt,yt]=(0,c.useState)(C),[bt,St]=(0,c.useState)(),[xt,wt]=(0,c.useState)(null),[Ct,At]=(0,c.useState)(),Et=async(e,t)=>{var n;const r=null!=t?t:Ut;if(e&&r){const{currentState:t,...i}=await ge({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&&Gt({...Ht,...t})}},[Mt,Tt]=(0,c.useState)(""),[_t,It]=(0,c.useState)(!1),[Rt,Pt]=(0,c.useState)([]),kt=e=>{Pt((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:[]}]}))},Ot=async(n,r,i,o=!0,s,a=!1,l,c=!1,u=!1)=>{var d,p,h,f;const m=i||Ut||(null===(d=window.getMemoriState())||void 0===d?void 0:d.sessionID);if(!m||!(null==n?void 0:n.length))return;a||kt({text:n,translatedText:s,fromUser:!0,media:null!=r?r:[],initial:Ut?!!i&&i!==Ut:!!i}),Ve(!0),We(l);let g=n,v=!1;if(o&&!Ce&&Be&&ze.toUpperCase()!==De.toUpperCase()){g=(await lp(n,De,ze,A)).text}const{currentState:y,...b}=await me({sessionId:m,text:g});if(0===b.resultCode&&y){const n=c&&l?l:null!==(p=y.emission)&&void 0!==p?p:null==Ht?void 0:Ht.emission;if("X4"===y.state&&e.giverTag){const{currentState:r,...i}=await be(m,e.giverTag);0===i.resultCode?(Gt(r),n&&(kt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),an(n))):(console.error(b,i),t(Ss).error(ce(vU(i.resultCode))),v=!0)}else if("X2d"===y.state&&e.giverTag){const{currentState:r,...i}=await me({sessionId:m,text:Math.random().toString().substring(2,8)});if(0===i.resultCode){const{currentState:r,...i}=await be(m,e.giverTag);0===i.resultCode?(Gt(r),n&&(kt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),an(n))):(console.error(b,i),t(Ss).error(ce(vU(i.resultCode))),v=!0)}else console.error(b,i),t(Ss).error(ce(vU(i.resultCode))),v=!0}else ze.toLowerCase()!==De.toLowerCase()&&n&&!Ce&&Be?Nt(y,ze).then((e=>{e.emission&&an(e.emission)})):(Gt({...y,emission:n}),n&&(kt({text:n,emitter:y.emitter,media:y.media,fromUser:!1,generatedByAI:!!y.completion}),an(n)))}else 404===b.resultCode&&(Pt((e=>[...e.slice(0,e.length-1)])),qt(!1,vt||e.secretToken,bt,Ce&&e.giverTag?e.giverTag:void 0,Ce&&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||{}},T).then((e=>{console.info("session timeout"),(null==e?void 0:e.sessionID)&&setTimeout((()=>{Ot(n,r,null==e?void 0:e.sessionID)}),500)})));u||(We(void 0),Ve(!1))},Nt=async(e,t)=>{var n,r,i;const o=null!==(n=e.emission)&&void 0!==n?n:null==Ht?void 0:Ht.emission;let s={...e},a=null;if(o&&!Ce&&De.toUpperCase()!==t.toUpperCase()&&Be){const n=await lp(o,t,De,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 lp(e,t,De,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==Ht?void 0:Ht.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 Gt(s),a&&kt(a),s},Dt=void 0!==e.ageRestriction?e.ageRestriction:e.nsfw?18:e.enableCompletions?14:0,[Lt,Bt]=(0,c.useState)(),[zt,Ft]=(0,c.useState)(!1),[Ut,jt]=(0,c.useState)(I),[Ht,Vt]=(0,c.useState)(),Gt=e=>{var t;Vt(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)}}))},Wt=async n=>{var r,i,o,s,a;let l=dU("birthDate",void 0);if(Lt||l||!Dt)if("PUBLIC"===e.privacyType||e.secretToken||vt||bt){je(!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 fe({...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==L?void 0:L.loginToken)&&void 0!==s?s:Ee)&&void 0!==a?a:k,language:nn(ze),referral:l}});if((null==c?void 0:c.sessionID)&&(null==c?void 0:c.currentState)&&0===c.resultCode)return jt(c.sessionID),Ct&&Et(Ct,c.sessionID),je(!1),{dialogState:c.currentState,sessionID:c.sessionID};(null==c?void 0:c.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(c),t(Ss).error(ce("underageTwinSession",{age:Dt})),Ne(!0)):403===(null==c?void 0:c.resultCode)?(yt(void 0),wt("password")):(console.error(c),t(Ss).error(ce(vU(null==c?void 0:c.resultCode))),Ne(!0))}catch(e){console.error(e),new Error("Error fetching session")}}else wt("password");else Ft(!0)},qt=async(n=!1,r,i,o,s,a,l,c)=>{var u,d,p,h,f;je(!0);try{let m,g=dU("birthDate",void 0);if(!c&&!g&&Dt)return void Ft(!0);if(!("PUBLIC"===e.privacyType||r||e.secretToken||vt||i||bt))return void wt("password");try{m=window.location.href}catch(e){console.error(e)}const{sessionID:v,currentState:y,...b}=await fe({memoriID:null!==(u=e.engineMemoriID)&&void 0!==u?u:"",password:r||vt||e.secretToken,recoveryTokens:i||bt,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==L?void 0:L.loginToken)&&void 0!==h?h:Ee)&&void 0!==f?f:k,language:nn(ze),referral:m}});if(v&&y&&0===b.resultCode)return jt(v),n&&(Gt(y),y.emission&&(Rt.length<=1?Pt([{text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}]):kt({text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}))),Ct&&Et(Ct,v),je(!1),{dialogState:y,sessionID:v};(null==b?void 0:b.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(b),t(Ss).error(ce("underageTwinSession",{age:Dt})),Ne(!0)):403===(null==b?void 0:b.resultCode)?(yt(void 0),wt("password")):(console.error(b),t(Ss).error(ce(vU(b.resultCode))),Ne(!0))}catch(e){console.error(e)}return je(!1),null},Kt=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 be(n,null!=r?r:up);if(0===u){let d=0;if(r!==up&&i&&("X1a"===t.state||"X1b"===t.state)){const{resultCode:e}=await me({sessionId:n,text:null!=i?i:""});d=e}if(0===d){const{currentState:e,...t}=await Se(n);if(0===t.resultCode&&e)return{currentState:e,sessionId:n,...t}}else if([400,401,403,404,500].includes(u)){console.warn("[APPCONTEXT/CHANGETAG]",u);let t,n=dU("birthDate",void 0);try{t=window.location.href}catch(e){console.error(e)}Wt({memoriID:null!==(o=e.engineMemoriID)&&void 0!==o?o:"",password:C||vt||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())||"",...M||{}},initialQuestion:T,birthDate:Lt||n||void 0,additionalInfo:{...L||{},loginToken:null!==(c=null!==(l=null==L?void 0:L.loginToken)&&void 0!==l?l:Ee)&&void 0!==c?c:k,language:nn(ze),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)((()=>()=>{Ht&&(null==Ht?void 0:Ht.currentTag)===e.giverTag||(async()=>{Ut&&e.giverTag&&e.giverPIN&&(Pt([]),await Kt(e.engineMemoriID,Ut,e.giverTag,e.giverPIN))})()}),[]);const[Jt,Qt]=(0,c.useState)(),Yt=(0,c.useRef)(),Xt=()=>{Jt&&(clearTimeout(Jt),Qt(void 0)),(null==Yt?void 0:Yt.current)&&(clearTimeout(Yt.current),Yt.current=void 0)},$t=()=>{Xt(),!(null==Ht?void 0:Ht.acceptsTimeout)||UU||dt||Mt.length||He||_t||en()},Zt=async()=>{var e;if(UU||dt||Mt.length||He||_t)$t();else if(Ut&&Ke&&(null==Ht?void 0:Ht.acceptsTimeout)){const{currentState:t,...n}=await ye(Ut);if(0===n.resultCode&&t){const n=t.emission;!Ce&&Be&&ze!==(null==ue?void 0:ue.language)&&n&&n.length>0?Nt({...t,emission:n},ze).then((e=>{e.emission&&an(e.emission)})):n&&n.length>0&&(kt({text:n,emitter:t.emitter,media:t.media,fromUser:!1,generatedByAI:!!t.completion}),an(n),Gt({...t,hints:null!==(e=t.hints)&&void 0!==e?e:"G1"===t.state?null==Ht?void 0:Ht.hints:[]}))}}},en=()=>{let e=null==Ht?void 0:Ht.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==Ht?void 0:Ht.emission){e+=Ht.emission.length/26.5}}let t=setTimeout(Zt,1e3*e);Qt(t),Yt.current=t};(0,c.useEffect)((()=>{(Mt.length||dt||He)&&Xt(),Ut&&!Mt.length&&$t()}),[null==Ht?void 0:Ht.acceptsTimeout,null==Ht?void 0:Ht.timeout,null==Ht?void 0:Ht.state,dt,Ut,Rt,Mt,He]),(0,c.useEffect)((()=>()=>{Je(!1),ke(!1),Xt(),Yt.current=void 0}),[]);const tn=(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:ue.language)&&void 0!==o?o:"IT").toUpperCase(),l=e.voiceType;if(e.enableBoardOfExperts&&(null==Ht?void 0:Ht.emitter)){null==zn||zn.find((e=>e.name===(null==Ht?void 0:Ht.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==Ht?void 0:Ht.emitter,ue.language,e.culture]),nn=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])||ue.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},[rn,on]=(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=>{on(e)}))}),[]);const sn=()=>{const e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e)},an=e=>{if(!O||p)return void sn();if(vn(),p)return;if(ot||GU)return WU=!1,Ve(!1),sn(),void(at&&fn());jU&&jU.pause();let t=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),n=/iPad|iPhone|iPod/.test(navigator.userAgent);if("interrupted"===HU.state)return void HU.resume().then((()=>an(e)));if("closed"===HU.state){HU=new Wo;let e=HU.createBuffer(1,1e4,22050),t=HU.createBufferSource();t.buffer=e,t.connect(HU.destination)}else if("suspended"===HU.state){ln(),HU=new Wo;let e=HU.createBuffer(1,1e4,22050),t=HU.createBufferSource();t.buffer=e,t.connect(HU.destination)}if(!UU){n||(jU=new ms.SpeakerAudioDestination);let e=ms.AudioConfig.fromSpeakerOutput(jU);UU=new ms.SpeechSynthesizer(FU,e)}const r=HU.createBufferSource();r.addEventListener("ended",(()=>{pt(!1),WU=!1})),jU.onAudioEnd=()=>{pt(!1),WU=!1,r.disconnect(),sn(),wn()},UU.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="${nn(ze)}"><voice name="${tn(ze)}"><s>${((e,t)=>{var n;if(!rn)return e;const r={...null!==(n=rn.common)&&void 0!==n?n:{},...(null==R?void 0:R.id)&&rn[R.id]?rn[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})(Sd(e)),ze.toLowerCase())}</s></voice></speak>`,(i=>{if(i){pt(!0),WU=!0;try{HU.decodeAudioData(i.audioData,(function(e){r.buffer=e,r.connect(HU.destination),(Rt.length<1||t&&n)&&r.start(0)})),HU.onstatechange=()=>{"suspended"===HU.state||"closed"===HU.state?(r.disconnect(),pt(!1),WU=!1):"interrupted"===HU.state&&HU.resume()},HU.resume(),UU&&(UU.close(),UU=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),pt(!1),WU=!1,UU&&(UU.close(),UU=null),sn()}}else HU.resume(),pt(!1),WU=!1,sn()}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),pt(!1),WU=!1,sn()})),Ve(!1)},ln=()=>{pt(!1),WU=!1;try{UU&&(UU.close(),UU=null),"closed"!==HU.state&&HU.close(),jU&&(jU.pause(),jU.close())}catch(e){console.error("stopAudio error: ",e)}};(0,c.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==Ht?void 0:Ht.emission]);const[cn,un]=(0,c.useState)(""),dn=()=>un(""),[pn,hn]=(0,c.useState)(null),fn=()=>{let e=setTimeout((async()=>{yn();const e=bd(cn);e.length>0&&_t?(Ot(e),dn(),Tt("")):_t&&$t()}),1e3*ct);hn(e)},mn=()=>{pn&&(clearTimeout(pn),hn(null))};(0,c.useEffect)((()=>{mn(),at&&fn(),$t()}),[cn]);const gn=()=>{if(O){yn(),un(""),dn();try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){Ye(!0),FU||(FU=ms.SpeechConfig.fromSubscription(O,"eastus"),FU.speechRecognitionLanguage=nn(ze),FU.speechSynthesisLanguage=nn(ze),FU.speechSynthesisVoiceName=tn(ze));const t=ms.AudioConfig.fromDefaultMicrophoneInput();zU=new ms.SpeechRecognizer(FU,t),It(!0),zU.recognized=(e,t)=>{if(t.result.text)if(t.result.reason===ms.ResultReason.RecognizedSpeech){let e=t.result.text;if(un(e||""),(null==e?void 0:e.length)>0){const t=bd(e);t.length>0&&Tt((e=>`${e} ${t}`))}}else t.result.reason===ms.ResultReason.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},zU.canceled=(e,t)=>{t.reason===ms.CancellationReason.Error&&(console.debug(`"CANCELED: ErrorCode=${t.errorCode}`),console.debug(`"CANCELED: ErrorDetails=${t.errorDetails}`),console.debug("CANCELED: Did you set the speech resource key and region values?")),vn()},zU.sessionStopped=(e,t)=>{vn()},dn(),zU.startContinuousRecognitionAsync()})).catch(console.error)}catch(e){console.error(e)}}},vn=()=>{zU&&(zU.stopContinuousRecognitionAsync(),zU.close(),zU=null),It(!1)},yn=()=>{Ye(!1),vn(),mn()},bn=()=>{try{yn(),Xt(),ke(!1),Yt.current=void 0,ln()}catch(e){console.log("Error: resetUIEffects",e)}};(0,c.useEffect)((()=>()=>{bn()}),[]),(0,c.useEffect)((()=>(document.addEventListener("MemoriResetUIEffects",bn),()=>{document.removeEventListener("MemoriResetUIEffects",bn)})),[]),(0,c.useEffect)((()=>{"Z0"===(null==Ht?void 0:Ht.state)&&yn()}),[null==Ht?void 0:Ht.state]);const[Sn,xn]=(0,c.useState)(!1),wn=(0,c.useCallback)((e=>{dt&&UU&&(UU.close(),UU=null),!at||!Qe&&Sn||(xn(!0),gn())}),[at,Qe]);(0,c.useEffect)((()=>{Rt.length>1&&!dt&&at&&(Qe||!Sn)?gn():dt&&_t&&vn()}),[dt]),(0,c.useEffect)((()=>{_t&&(yn(),dn(),Tt(""),gn())}),[De]);const[Cn,An]=(0,c.useState)("keypress");(0,c.useEffect)((()=>{const e=dU("sendOnEnter","keypress");window.innerWidth<=768?An("click"):An(e)}),[]),(0,c.useEffect)((()=>{pU("sendOnEnter",Cn)}),[Cn]);const[En,Mn]=(0,c.useState)(),Tn=null==Le?void 0:Le.globalBackground,_n=Tn?`url(${Tn})`:null,In=o?{"--memori-chat-bubble-bg":"#fff",...Le&&!u?{"--memori-text-color":null!==(Z=Le.textColor)&&void 0!==Z?Z:"#000"}:{},...(null==Le?void 0:Le.buttonBgColor)?{"--memori-button-bg":Le.buttonBgColor,"--memori-primary":Le.buttonBgColor}:{},...(null==Le?void 0:Le.buttonTextColor)?{"--memori-button-text":Le.buttonTextColor}:{},...(null==Le?void 0:Le.blurBackground)?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...(null==Le?void 0:Le.innerBgColor)?{"--memori-inner-bg":`rgba(${"dark"===Le.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(ee=Le.innerBgAlpha)&&void 0!==ee?ee:.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===Le.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(te=null==Le?void 0:Le.innerBgAlpha)&&void 0!==te?te:.4})`}:{"--memori-inner-content-pad":"0px"}}:{},Rn=`\n ${p?"#preview,":"WEBSITE_ASSISTANT"===qe?"":":root,"} .memori-widget {\n ${Object.entries(In).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,Pn=void 0===(null==Le?void 0:Le.showAIicon)||(null==Le?void 0:Le.showAIicon),[kn,On]=(0,c.useState)(!1);(0,c.useEffect)((()=>{(window.innerWidth>=768&&"FULLPAGE"===qe||"FULLPAGE"!==qe)&&On(!0)}),[]);const[Nn,Dn]=(0,c.useState)();(0,c.useEffect)((()=>{e.engineMemoriID&&(async e=>{let t,n;try{const{contentQualityIndex:r,answerQualityIndex:i,unansweredQuestions:o,...s}=await xe(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=>{Dn(LU(e.points))})).catch(console.error)}),[e.engineMemoriID]),(0,c.useEffect)((()=>{if(null==Le?void 0:Le.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",Le.seoTitle),document.head.append(e)}if(null==Le?void 0:Le.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",Le.seoDescription),document.head.append(e)}if(null==Le?void 0:Le.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",Le.seoUrl),document.head.append(e)}let t=_||e.avatarURL;if((null==Le?void 0:Le.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}}),[Le,e.avatarURL,_]);const Ln=(0,c.useCallback)((e=>{const{text:t,waitForPrevious:n,hidden:r,typingText:i,useLoaderTextAsMsg:o,hasBatchQueued:s}=e.detail;t&&(n&&!GU&&(WU||He)?setTimeout((()=>{Ln(e)}),1e3):(vn(),ln(),Ot(t,void 0,void 0,void 0,void 0,r,i,o,s)))}),[Ut,dt,He,ze]);(0,c.useEffect)((()=>(document.addEventListener("MemoriTextEntered",Ln),()=>{document.removeEventListener("MemoriTextEntered",Ln)})),[Ut,ze]);const Bn=(0,c.useCallback)((async t=>{var n,r,i,o,s,a,l,c;const u=(null==t?void 0:t.sessionID)||Ut,d=(null==t?void 0:t.dialogState)||Ht;ke(!0);let p=document.getElementById("memori-audio"),h=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome");p&&h&&(p.muted=!1,p.play().catch((e=>{console.error("error playing intro audio",e)})));let f=dU("birthDate",void 0),m=Lt||f||void 0;if(u||!Dt||m){if(!u&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!vt&&!bt||!u&&Oe)return wt("password"),void ke(!1);if(!u){ke(!1),Ne(!1);const t=await Wt({memoriID:e.engineMemoriID,password:C||vt||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())||"",...M||{}},initialQuestion:T,birthDate:m});return void((null==t?void 0:t.dialogState)?(Pt([]),Nt(t.dialogState,ze).then((e=>{e.emission&&an(e.emission)})).finally((()=>{Je(!0)}))):await Bn(t||void 0))}if(I){const{currentState:t,...n}=await Se(u);if(0!==n.resultCode||!t)return console.debug("session expired, opening new session"),Ne(!0),jt(void 0),ke(!1),void await Bn();if(Pt([]),Ce&&e.giverTag&&(null==Ht?void 0:Ht.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await Kt(e.engineMemoriID,u,"-");const t=await Kt(e.engineMemoriID,u,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");Nt(t.currentState,ze).then((e=>{e.emission&&an(e.emission)})).finally((()=>{Je(!0)}))}catch(t){console.error("session #2",t),qt(!0,null==e?void 0:e.secretToken,void 0,null==e?void 0:e.giverTag,null==e?void 0:e.giverPIN,{PATHNAME:window.location.pathname,ROUTE:(null===(o=null===(i=window.location.pathname)||void 0===i?void 0:i.split("/"))||void 0===o?void 0:o.pop())||"",...M||{}},T,m).then((()=>{Je(!0)}))}else if(!Ce&&P&&(null==Ht?void 0:Ht.currentTag)!==P.tag)try{console.debug("change tag #3"),await Kt(e.engineMemoriID,u,"-");const t=await Kt(e.engineMemoriID,u,P.tag,P.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");Nt(t.currentState,ze).then((e=>{e.emission&&an(e.emission)})).finally((()=>{Je(!0)}))}catch(t){console.error("session #5",t),qt(!0,null==e?void 0:e.secretToken,void 0,P.tag,P.pin,{PATHNAME:window.location.pathname,ROUTE:(null===(a=null===(s=window.location.pathname)||void 0===s?void 0:s.split("/"))||void 0===a?void 0:a.pop())||"",...M||{}},T,m).then((()=>{Je(!0)}))}else if(Ce||P||(null==Ht?void 0:Ht.currentTag)===up)Nt(t,ze).then((e=>{e.emission&&an(e.emission)})).finally((()=>{Je(!0)}));else try{console.debug("change tag #6"),await Kt(e.engineMemoriID,u,"-");const t=await Kt(e.engineMemoriID,u,up);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");Nt(t.currentState,ze).then((e=>{e.emission&&an(e.emission)})).finally((()=>{Je(!0)}))}catch(t){console.error("session #8",t),qt(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,{PATHNAME:window.location.pathname,ROUTE:(null===(c=null===(l=window.location.pathname)||void 0===l?void 0:l.split("/"))||void 0===c?void 0:c.pop())||"",...M||{}},T,m).then((()=>{Je(!0)}))}}else Pt([]),Nt(d,ze).then((e=>{e.emission&&an(e.emission)})).finally((()=>{Je(!0)}))}else Ft(!0),ke(!1)}),[vt,e,bt,Lt,Ut,ze]);(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?Me(t.target.getAttribute("authtoken")||void 0):Me((null===(i=null===(r=t.target)||void 0===r?void 0:r.parentElement)||void 0===i?void 0:i.getAttribute("authtoken"))||void 0))}));return n.observe(t,{attributes:!0,childList:!1,subtree:!1}),()=>{n.disconnect()}}),[]);const[zn,Fn]=(0,c.useState)(),Un=(0,c.useCallback)((async()=>{if(Ut&&(null==e?void 0:e.enableBoardOfExperts))try{const{experts:e,count:t,...n}=await we(Ut);0===n.resultCode?Fn(e):console.warn("Error fetching experts",n)}catch(e){console.warn(e)}}),[Ut,null==e?void 0:e.enableBoardOfExperts]);(0,c.useEffect)((()=>{Un()}),[Ut,Un]);const jn=void 0===x?"TOTEM"!==a&&"WEBSITE_ASSISTANT"!==a:!x,Hn={memori:e,tenant:R,history:Rt,showShare:null===(ne=null!=d?d:null==Le?void 0:Le.showShare)||void 0===ne||ne,position:Ct,setShowPositionDrawer:$e,setShowSettingsDrawer:et,setShowKnownFactsDrawer:nt,setShowExpertsDrawer:it,showSpeaker:!!O,speakerMuted:ot||GU,setSpeakerMuted:e=>{if(GU=!!e,st(e),pU("muteSpeaker",!!e),e)ln();else{HU=new Wo;let e=HU.createBuffer(1,1e4,22050),t=HU.createBufferSource();t.buffer=e,t.connect(HU.destination)}},showSettings:v,hasUserActivatedSpeak:Ke,showReload:"TOTEM"===qe,showClear:b,clearHistory:()=>Pt((e=>e.slice(-1))),showLogin:S,setShowLoginDrawer:Re,loginToken:Ee,user:Te,sessionID:Ut},Vn={memori:e,integration:o,integrationConfig:Le,tenant:R,instruct:Ce,avatar3dVisible:kn,setAvatar3dVisible:On,hasUserActivatedSpeak:Ke,isPlayingAudio:dt&&!ot,loading:!!He,baseUrl:A,apiUrl:E},Gn={memori:e,tenant:R,gamificationLevel:Nn,language:De,userLang:ze,setUserLang:Fe,baseUrl:A,apiUrl:E,position:Ct,openPositionDrawer:()=>$e(!0),integrationConfig:Le,instruct:Ce,sessionId:Ut,clickedStart:Pe,onClickStart:Bn,initializeTTS:()=>{if(!O)return;FU=ms.SpeechConfig.fromSubscription(O,"eastus"),FU.speechSynthesisLanguage=nn(ze),FU.speechSynthesisVoiceName=tn(ze),FU.speechRecognitionLanguage=nn(ze),vd()&&(FU.speechSynthesisOutputFormat=ms.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3),HU=new Wo;let e=HU.createBuffer(1,1e4,22050),t=HU.createBufferSource();t.buffer=e,t.connect(HU.destination),jU=new ms.SpeakerAudioDestination;let n=ms.AudioConfig.fromSpeakerOutput(jU);UU=new ms.SpeechSynthesizer(FU,n)},isUserLoggedIn:!!Ee&&!!(null==Te?void 0:Te.userID),showLogin:S,setShowLoginDrawer:Re,user:Te},Wn={memori:e,sessionID:Ut||"",tenant:R,translateTo:Be&&ze.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:ue.language)&&void 0!==se?se:"IT")||void 0===ae?void 0:ae.toUpperCase())?ze:void 0,baseUrl:A,apiUrl:E,layout:a,memoriTyping:He,typingText:Ge,showTypingText:y,history:jn?Rt:Rt.slice(-2),authToken:Ee,dialogState:Ht,setDialogState:Gt,pushMessage:kt,simulateUserPrompt:(e,t)=>{vn(),ln(),Ot(e,void 0,void 0,!1,t)},showDates:m,showContextPerLine:g,showAIicon:Pn,client:he,selectReceiverTag:async n=>{var r;if(Ut)try{const{currentState:i,...o}=await be(Ut,n);if(0===o.resultCode)if(kt({text:n,fromUser:!0}),"X4"===i.state&&e.giverTag){const{currentState:n,...r}=await he.postTagChangedEvent(Ut,e.giverTag);0===r.resultCode?(Gt(n),n.emission&&kt({text:n.emission,emitter:n.emitter,media:n.media,fromUser:!1})):(console.error(r),t(Ss).error(ce(vU(r.resultCode))))}else Gt(i),i.emission&&kt({text:i.emission,emitter:i.emitter,media:i.media,fromUser:!1});else console.error(o,n,null===(r=null==Ht?void 0:Ht.knownTags)||void 0===r?void 0:r[n]),t(Ss).error(ce(vU(o.resultCode)))}catch(e){let n=e;console.error(n),t(Ss).error(n.message)}},preview:p,sendOnEnter:Cn,setSendOnEnter:An,microphoneMode:at?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen:En,setAttachmentsMenuOpen:Mn,instruct:Ce,showInputs:f,showMicrophone:!!O,userMessage:Mt,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return Tt(""),void $t();Tt(e),Xt()},sendMessage:e=>{ln(),vn(),Ot(e),Tt(""),dn()},stopListening:yn,startListening:gn,stopAudio:ln,resetTranscript:dn,listening:_t,isPlayingAudio:dt,customMediaRenderer:z,user:Te,userAvatar:F,experts:zn},qn=o&&_n?(0,s.jsx)("div",{className:"memori--global-background",children:(0,s.jsx)("div",{className:"memori--global-background-image",style:{backgroundImage:_n}})}):(0,s.jsx)("div",{className:"memori--global-background no-background-image"}),Kn=o?(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:Rn}}):null,Jn={canInstruct:!!e.giverTag,instruct:!!Ce,onChangeMode:e=>{Ae("instruct"===e),Je(!1),ke(!1)}},Qn=(0,s.jsx)(hD,{tenant:R,userLang:ze,integrationID:null==o?void 0:o.integrationID,memoriHash:`${e.ownerTenantName}-${e.ownerUserName}-${e.name}`}),Yn=l||("TOTEM"===qe?MU:"CHAT"===qe?TU:"FULLPAGE"===qe?EU:"WEBSITE_ASSISTANT"===qe?_U:EU);return(0,s.jsxs)("div",{className:t(ys)("memori","memori-widget",`memori-layout-${a.toLowerCase()}`,`memori-controls-${ht.toLowerCase()}`,`memori--avatar-${(null==Le?void 0:Le.avatar)||"default"}`,{"memori--preview":p,"memori--embed":h,"memori--with-integration":o,"memori--with-speechkey":!!O,"memori--active":Ke,"memori--hide-emissions":mt,"memori--has-active-session":!!Ut}),"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":Ut,"data-memori-integration":null==o?void 0:o.integrationID,"data-memori-engine-state":JSON.stringify({...Ht,sessionID:Ut}),style:{height:w},children:[(0,s.jsx)(Yn,{Header:pD,headerProps:Hn,Avatar:sN,avatarProps:Vn,Chat:um,chatProps:Wn,StartPanel:vm,startPanelProps:Gn,integrationStyle:Kn,integrationBackground:qn,ChangeMode:aN,changeModeProps:Jn,poweredBy:Qn,sessionId:Ut,hasUserActivatedSpeak:Ke,showInstruct:u,loading:Ue}),(0,s.jsx)("audio",{id:"memori-audio",style:{display:"none"},src:"https://aisuru.com/intro.mp3"}),de&&(0,s.jsx)(gd,{withModal:!0,pwdOrTokens:xt,openModal:!!xt,setPwdOrTokens:wt,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{var n,r;t.password&&yt(t.password),t.password&&(VU=t.password),t.tokens&&St(t.tokens),qt(!Ut,t.password,t.tokens,Ce?e.giverTag:null==P?void 0:P.tag,Ce?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,Lt).then((e=>{wt(null),Bn(e||void 0)})).catch((()=>{wt(null),Ne(!0)}))},minimumNumberOfRecoveryTokens:null!==(le=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==le?le:1}),de&&(0,s.jsx)(sU,{visible:zt,minAge:Dt,onClose:t=>{var n,r;t?(Bt(t),pU("birthDate",t),qt(!Ut,VU||vt||(null==e?void 0:e.secretToken),bt,Ce?e.giverTag:null==P?void 0:P.tag,Ce?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,t).then((e=>{Ft(!1),wt(null),Bn(e||void 0)})).catch((()=>{Ft(!1),Ne(!0)}))):(Ft(!1),ke(!1))}}),Ze&&(0,s.jsx)(mU,{layout:qe,open:!!Ze,onClose:()=>et(!1),microphoneMode:at?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout:ct,setMicrophoneMode:e=>lt("CONTINUOUS"===e),setContinuousSpeechTimeout:ut,controlsPosition:ht,setControlsPosition:ft,hideEmissions:mt,setHideEmissions:gt,additionalSettings:B}),tt&&Ut&&(0,s.jsx)(xU,{apiURL:E,memori:e,sessionID:Ut,visible:tt,closeDrawer:()=>nt(!1)}),rt&&!!zn&&(0,s.jsx)(wU,{apiUrl:E,baseUrl:A,tenant:R,experts:zn,open:rt,onClose:()=>it(!1)}),Ie&&(null==R?void 0:R.id)&&(0,s.jsx)(AU,{tenant:R,apiUrl:E,open:!!Ie,user:Te,loginToken:Ee,onClose:()=>Re(!1),onLogin:(e,t)=>{_e(e),Me(t),Re(!1),pU("loginToken",t)},onLogout:()=>{Ee&&he.backend.userLogout(Ee).then((()=>{Re(!1),_e(void 0),Me(void 0),hU("loginToken")}))}})]})};const KU={id:"aisuru.com",theme:"aisuru",config:{name:"Memori",showNewUser:!1,requirePosition:!1}},JU=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||{...KU,tenantID:e}}catch(t){return{...KU,tenantID:e}}};function QU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YU(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,WO(r.key),r)}}function XU(e,t,n){return t&&YU(e.prototype,t),n&&YU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $U(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZU(e,t){return ZU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ZU(e,t)}function ej(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&&ZU(e,t)}function tj(e,t){if(t&&("object"===VO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $U(e)}function nj(e){return nj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},nj(e)}function rj(e){if(Array.isArray(e))return e}function ij(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function oj(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 sj(e,t){if(e){if("string"==typeof e)return oj(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)?oj(e,t):void 0}}function aj(){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 lj(e){return rj(e)||ij(e)||sj(e)||aj()}function cj(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 uj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var dj={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)}},pj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};QU(this,e),this.init(t,n)}return XU(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||dj,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,uj(uj({},{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}(),hj=new pj,fj=function(){function e(){QU(this,e),this.observers={}}return XU(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 mj(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function gj(e){return null==e?"":""+e}function vj(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function yj(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 bj(e,t,n){var r=yj(e,t,Object);r.obj[r.k]=n}function Sj(e,t){var n=yj(e,t),r=n.obj,i=n.k;if(r)return r[i]}function xj(e,t,n){var r=Sj(e,n);return void 0!==r?r:Sj(t,n)}function wj(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]):wj(e[r],t[r],n):e[r]=t[r]);return e}function Cj(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Aj={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Ej(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return Aj[e]})):e}var Mj="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Tj=[" ",",","?","!",";"];function _j(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 Ij(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_j(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rj(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=nj(e);if(t){var i=nj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return tj(this,n)}}function Pj(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?Pj(l,c,n):void 0}i=i[r[o]]}return i}}var kj=function(e){ej(n,e);var t=Rj(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return QU(this,n),r=t.call(this),Mj&&fj.call($U(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 XU(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=Sj(this.data,s);return a||!o||"string"!=typeof n?a:Pj(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),bj(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=Sj(this.data,s)||{};r?wj(a,n,i):a=Ij(Ij({},a),n),bj(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?Ij(Ij({},{}),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}(fj),Oj={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 Nj(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 Dj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Lj(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=nj(e);if(t){var i=nj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return tj(this,n)}}var Bj={},zj=function(e){ej(n,e);var t=Lj(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return QU(this,n),r=t.call(this),Mj&&fj.call($U(r)),vj(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,$U(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=hj.create("translator"),r}return XU(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=Tj.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var i=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),o=!i.test(e);if(!o){var s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o}(e,n,r));if(o&&!s){var a=e.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:e,namespaces:i};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(i=l.shift()),e=l.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,r){var i=this;if("object"!==VO(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],t),l=a.key,c=a.namespaces,u=c[c.length-1],d=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(p){var h=t.nsSeparator||this.options.nsSeparator;return o?(f.res="".concat(u).concat(h).concat(l),f):"".concat(u).concat(h).concat(l)}return o?(f.res=l,f):l}var f=this.resolve(e,t),m=f&&f.res,g=f&&f.usedKey||l,v=f&&f.exactUsedKey||l,y=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],S=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,w="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(x&&m&&w&&b.indexOf(y)<0&&("string"!=typeof S||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,Dj(Dj({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return o?(f.res=C,f):C}if(s){var A="[object Array]"===y,E=A?[]:{},M=A?v:g;for(var T in m)if(Object.prototype.hasOwnProperty.call(m,T)){var _="".concat(M).concat(s).concat(T);E[T]=this.translate(_,Dj(Dj({},t),{joinArrays:!1,ns:c})),E[T]===_&&(E[T]=m[T])}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,Dj(Dj({},t),{},{keySeparator:!1}));z&&z.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var F=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&U&&U[0])for(var j=0;j<U.length;j++)F.push(U[j]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var H=function(e,n,r){var o=k&&r!==m?r: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?F.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],l+n,t["defaultValue".concat(n)]||N)}))})):H(F,l,N))}m=this.extendTranslation(m,e,t,f,r),R&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(u,":").concat(l)),(R||I)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(l):l,I?m:void 0):this.options.parseMissingKeyHandler(m))}return o?(f.res=m,f):m}},{key:"extendTranslation",value:function(e,t,n,r,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,Dj(Dj({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(Dj(Dj({},n),{interpolation:Dj(Dj({},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=Dj(Dj({},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=Oj.handle(p,e,t,this.options&&this.options.postProcessPassResolved?Dj({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,!Bj["".concat(f[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(Bj["".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}(fj);function Fj(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Uj=function(){function e(t){QU(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=hj.create("languageUtils")}return XU(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]=Fj(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]=Fj(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Fj(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}(),jj=[{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}],Hj={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)}},Vj=["v1","v2","v3"],Gj={zero:0,one:1,two:2,few:3,many:4,other:5};function Wj(){var e={};return jj.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:Hj[t.fc]}}))})),e}var qj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};QU(this,e),this.languageUtils=t,this.options=n,this.logger=hj.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=Wj()}return XU(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 Gj[e]-Gj[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!Vj.includes(this.options.compatibilityJSON)}}]),e}();function Kj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Jj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};QU(this,e),this.logger=hj.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return XU(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:Ej,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?Cj(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?Cj(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?Cj(t.nestingPrefix):t.nestingPrefixEscaped||Cj("$t("),this.nestingSuffix=t.nestingSuffix?Cj(t.nestingSuffix):t.nestingSuffixEscaped||Cj(")"),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=xj(t,l,e);return a.alwaysFormat?a.format(i,void 0,n,Jj(Jj(Jj({},r),t),{},{interpolationkey:e})):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(xj(t,l,s),c,n,Jj(Jj(Jj({},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=gj(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=Jj({},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=Jj(Jj({},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=gj(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,Jj(Jj({},o),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),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){qO(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}function $j(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 Zj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};QU(this,e),this.logger=hj.create("formatter"),this.options=t,this.formats={number:$j((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:$j((function(e,t){var n=new Intl.NumberFormat(e,Xj(Xj({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:$j((function(e,t){var n=new Intl.DateTimeFormat(e,Xj({},t));return function(e){return n.format(e)}})),relativetime:$j((function(e,t){var n=new Intl.RelativeTimeFormat(e,Xj({},t));return function(e){return n.format(e,t.range||"day")}})),list:$j((function(e,t){var n=new Intl.ListFormat(e,Xj({},t));return function(e){return n.format(e)}}))},this.init(t)}return XU(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()]=$j(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=lj(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,Xj(Xj(Xj({},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 eH(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 tH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eH(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nH(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=nj(e);if(t){var i=nj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return tj(this,n)}}var rH=function(e){ej(n,e);var t=nH(n);function n(e,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return QU(this,n),o=t.call(this),Mj&&fj.call($U(o)),o.backend=e,o.store=r,o.services=i,o.languageUtils=i.languageUtils,o.options=s,o.logger=hj.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 XU(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=yj(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,tH(tH({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(fj);function iH(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===VO(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===VO(e[2])||"object"===VO(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function oH(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 sH(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 aH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sH(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function lH(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=nj(e);if(t){var i=nj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return tj(this,n)}}function cH(){}function uH(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var dH=function(e){ej(n,e);var t=lH(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(QU(this,n),e=t.call(this),Mj&&fj.call($U(e)),e.options=oH(r),e.services={},e.logger=hj,e.modules={external:[]},uH($U(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),tj(e,$U(e));setTimeout((function(){e.init(r,i)}),0)}return e}return XU(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=iH();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=aH(aH(aH({},r),this.options),oH(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=aH(aH({},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?hj.init(i(this.modules.logger),this.options):hj.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=Zj);var s=new Uj(this.options);this.store=new kj(this.options.resources,this.options);var a=this.services;a.logger=hj,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 Qj(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new rH(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 zj(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=cH),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=mj(),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]:cH,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=mj();return e||(e=this.languages),t||(t=this.options.ns),n||(n=cH),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&&Oj.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=mj();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},o=function(o){e||o||!n.services.languageDetector||(o=[]);var s="string"==typeof o?o:n.services.languageUtils.getBestMatchFromCodes(o);s&&(n.language||i(s),n.translator.language||n.translator.changeLanguage(s),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(s)),n.loadResources(s,(function(e){!function(e,o){o?(i(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,s)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,i=function e(t,i){var o;if("object"!==VO(i)){for(var s=arguments.length,a=new Array(s>2?s-2:0),l=2;l<s;l++)a[l-2]=arguments[l];o=r.options.overloadTranslationOptionHandler([t,i].concat(a))}else o=aH({},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=mj();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=mj();"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]:cH,i=aH(aH(aH({},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=aH({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new zj(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}(fj);qO(dH,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new dH(e,t)}));var pH=dH.createInstance();pH.createInstance=dH.createInstance;var hH,fH=pH.createInstance;pH.init,pH.loadResources,pH.reloadResources,pH.use,pH.changeLanguage,pH.getFixedT,pH.t,pH.exists,pH.setDefaultNamespace,pH.hasLoadedNamespace,pH.loadNamespaces,pH.loadLanguages;hH=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!","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","USER_NOT_CONFIRMED":"Utente ancora non confermato","USER_NOT_FOUND":"Utente non trovato","USER_OR_PASSWORD_INVALID":"Utente o password non validi","USER_MUST_CHANGE_PASSWORD":"Devi cambiare la password","USER_MUST_ENTER_VERIFICATION_CODE":"Devi inserire il codice di verifica","USER_MISSING_TENANT":"Utente: tenant mancante","USER_MISSING_NAME":"Utente: nome mancante","USER_MISSING_PASSWORD":"Utente: password mancante","USER_MISSING_EMAIL":"Utente: email mancante","USER_MISSING_VERIFICATION_CODE":"Utente: codice di verifica mancante","USER_NAME_ALREADY_USED":"Nome utente già in uso","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"La password non rispetta le regole di sicurezza","USER_EMAIL_ALREADY_USED":"Email già in uso","USER_EMAIL_INVALID":"Email non valida","USER_VERIFICATION_CODE_INVALID":"Codice di verifica non valido","USER_MISSING_NAME_OR_EMAIL":"Nome utente o email mancante","USER_NAME_INVALID":"Nome utente non valido","USER_HAS_ONE_OR_MORE_MEMORI":"L\'utente ha uno o più memori","USER_MISSING_NEW_PASSWORD":"Utente: nuova password mancante","USER_NOTHING_TO_DO":"Niente da fare","USER_CANT_CREATE_MEMORI":"Utente non abilitato a creare Memori","USER_MAX_MEMORI_REACHED":"Massimo numero di Memori raggiunto","USER_CANT_EDIT_INTEGRATIONS":"Utente non abilitato a gestire integrazioni","MEMORI_NOT_FOUND":"Memori non trovato","MEMORI_NOT_ACCESSIBLE":"Memori non accessibile","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Solo il proprietario può cambiare il tag e il pin","SESSION_NOT_FOUND":"Sessione non trovata","SESSION_IS_NOT_ADMINISTRATIVE":"Sessione non amministrativa","MEMORI_MISSING_CONFIGURATION":"Memori: configurazione mancante","MEMORI_CONFIGURATION_NOT_FOUND":"Memori: configurazione non trovata","MEMORI_INVALID_PRIVACY_TYPE":"Memori: tipo di privacy non valido","MEMORI_MISSING_PASSWORD":"Memori: password mancante","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero totale di token di recupero non valido","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero minimo di token di recupero non valido","MEMORI_INVALID_VOICE_TYPE":"Memori: tipo di voce non valido","MEMORI_MISSING_NAME":"Memori: nome mancante","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memori: password o token di recupero mancanti","MEMORI_INVALID_ID":"Memori: ID non valido","MEMORI_NAME_ALREADY_USED":"Nome memori già in uso","MEMORI_INVALID_PIN":"Memori: PIN non valido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memori: cambio TAG e PIN richiedono operazioni separate","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memori: password non richiesta su Memori pubblico","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Trasferimento: utente di destinazione mancante","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Trasferimento: ID utente di destinazione non valido","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Trasferimento: dati utente di destinazione non validi","MEMORI_TRANSFER_NOTHING_TO_DO":"Trasferimento: alcuna operazione da fare","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memori: la configurazione non può essere modificata","MEMORI_MISSING_NEW_PASSWORD":"Memori: nuova password mancante","INTEGRATION_NOT_FOUND":"Integrazione non trovata","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Formato non valido data a partire da","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Formato non valido data fino a","INTEGRATION_INVALID_TYPE":"Tipo integrazione non valido","INTEGRATION_ALREADY_EXISTS":"Integrazione già esistente","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Memori non pubblici non possono essere integrati","INTEGRATION_MISSING_INVOCATION_TEXT":"Integrazione: testo di invocazione mancante","INTEGRATION_MISSING_DEVICE_EMAILS":"Integrazione: email del dispositivo mancante","INTEGRATION_MEMORI_IS_EMPTY":"Memori vuoti non possono essere integrati","INTEGRATION_MISSING_PRIVACY_POLICY":"Integrazione: privacy policy mancante","INTEGRATION_MISSING_CATEGORY":"Categoria integrazione mancante","INTEGRATION_MISSING_DESCRIPTION":"Descrizione integrazione mancante","INTEGRATION_INVALID_INVOCATION_TEXT":"Testo di invocazione non valido","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home non più disponibile","UPLOAD_REQUIRES_MULTIPART_ENCODING":"L\'upload richiede l\'encoding multipart","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: manca il content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: dimensione massima superata","UPLOAD_FILE_IS_EMPTY":"Upload: file vuoto","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: tipo di file o firma non validi","UPLOAD_MISSING_FILE_NAME":"Upload: nome file mancante","UPLOAD_INVALID_MEMORY_ID":"Upload: ID contenuto non valido","UPLOAD_MISSING_FILE_CONTENT":"Upload: contenuto file mancante","ASSET_NOT_FOUND":"Asset non trovato","ASSET_NOT_ACCESSIBLE":"Asset non accessibile","ASSET_MISSING_SESSION_ID":"Asset: ID sessione mancante","ASSET_INVALID_FILE_NAME":"Asset: nome file non valido","INVITATION_NOT_FOUND":"Invito non trovato","INVITATION_NOT_ACCESSIBLE":"Invito non accessibile","INVITATION_ALREADY_ACCEPTED":"Invito già accettato","INVITATION_ALREADY_REJECTED":"Invito già rifiutato","INVITATION_MISSING_DESTINATION_EMAIL":"Invito: email di destinazione mancante","INVITATION_DESTINATION_EMAIL_INVALID":"Invito: email di destinazione non valida","INVITATION_MISSING_TAG":"Invito: tag mancante","INVITATION_MISSING_PIN":"Invito: PIN mancante","INVITATION_INVALID_PIN":"Invito: PIN non valido","INVITATION_INVALID_TYPE":"Invito: tipo non valido","INVITATION_MISSING_DESTINATION_NAME":"Invito: nome destinatario mancante","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invito: tag e pin non possono essere cambiati","INVITATION_CANT_BE_CHANGED":"Invito: non può essere modificato","ACTIONLOG_INVALID_USER_ID":"ID utente non valido","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","ACTIONLOG_INVALID_MEMORI_ID":"ID Memori non valido","CONSUMPTIONLOG_INVALID_TYPE":"Tipo di log non valido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","CONSUMPTIONLOG_INVALID_USER_ID":"ID utente non valido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Memori ID non valido"}}');const mH=fH({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!","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","USER_NOT_CONFIRMED":"User still not confirmed","USER_NOT_FOUND":"User not found","USER_OR_PASSWORD_INVALID":"Invalid user or password","USER_MUST_CHANGE_PASSWORD":"You must change your password","USER_MUST_ENTER_VERIFICATION_CODE":"You must enter the verification code","USER_MISSING_TENANT":"User: missing tenant","USER_MISSING_NAME":"User: name is missing","USER_MISSING_PASSWORD":"User: password missing","USER_MISSING_EMAIL":"User: Missing email","USER_MISSING_VERIFICATION_CODE":"User: Missing verification code","USER_NAME_ALREADY_USED":"User name already in use","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"The password does not meet the security rules","USER_EMAIL_ALREADY_USED":"Email already in use","USER_EMAIL_INVALID":"Invalid email","USER_VERIFICATION_CODE_INVALID":"Invalid verification code","USER_MISSING_NAME_OR_EMAIL":"Missing username or email","USER_NAME_INVALID":"Invalid user name","USER_HAS_ONE_OR_MORE_MEMORI":"The user has one or more memories","USER_MISSING_NEW_PASSWORD":"User: new password missing","USER_NOTHING_TO_DO":"Nothing to do","USER_CANT_CREATE_MEMORI":"User not allowed to create Memori","USER_MAX_MEMORI_REACHED":"Maximum number of Memori reached","USER_CANT_EDIT_INTEGRATIONS":"User not allowed to manage integrations","MEMORI_NOT_FOUND":"Memori not found","MEMORI_NOT_ACCESSIBLE":"Memori not accessible","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Only owner can change tag or pin","SESSION_NOT_FOUND":"Session not found","SESSION_IS_NOT_ADMINISTRATIVE":"Non-administrative session","MEMORI_MISSING_CONFIGURATION":"Memori: missing configuration","MEMORI_CONFIGURATION_NOT_FOUND":"Memories: configuration not found","MEMORI_INVALID_PRIVACY_TYPE":"Memories: invalid privacy type","MEMORI_MISSING_PASSWORD":"Memori: missing password","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memories: total number of invalid recovery tokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memories: minimum number of invalid recovery tokens","MEMORI_INVALID_VOICE_TYPE":"Memories: invalid voice type","MEMORI_MISSING_NAME":"Memories: missing name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memories: missing password or recovery token","MEMORI_INVALID_ID":"Memories: invalid ID","MEMORI_NAME_ALREADY_USED":"Memory name already in use","MEMORI_INVALID_PIN":"Memories: Invalid PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memories: TAG and PIN change require separate operations","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memories: no password required when public","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transfer: missing destination user","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transfer: invalid destination user ID","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transfer: invalid destination user data","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfer: nothing to do","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memories: configuration cannot be changed","MEMORI_MISSING_NEW_PASSWORD":"Memories: new password missing","INTEGRATION_NOT_FOUND":"Integration not found","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Invalid date from format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Invalid date to format","INTEGRATION_INVALID_TYPE":"Invalid integration type","INTEGRATION_ALREADY_EXISTS":"Integration already exists","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Non-public memories cannot be integrated","INTEGRATION_MISSING_INVOCATION_TEXT":"Integration: missing invocation text","INTEGRATION_MISSING_DEVICE_EMAILS":"Integration: missing device email","INTEGRATION_MEMORI_IS_EMPTY":"Empty memories cannot be integrated","INTEGRATION_MISSING_PRIVACY_POLICY":"Integration: privacy policy missing","INTEGRATION_MISSING_CATEGORY":"Integration category missing","INTEGRATION_MISSING_DESCRIPTION":"Missing integration description","INTEGRATION_INVALID_INVOCATION_TEXT":"Invalid invocation text","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home no more available","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Upload requires multipart encoding","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: missing content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: maximum size exceeded","UPLOAD_FILE_IS_EMPTY":"Upload: empty file","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: invalid file type or signature","UPLOAD_MISSING_FILE_NAME":"Upload: missing file name","UPLOAD_INVALID_MEMORY_ID":"Upload: Invalid content ID","UPLOAD_MISSING_FILE_CONTENT":"Upload: Missing file content","ASSET_NOT_FOUND":"Asset not found","ASSET_NOT_ACCESSIBLE":"Asset not accessible","ASSET_MISSING_SESSION_ID":"Asset: missing session ID","ASSET_INVALID_FILE_NAME":"Asset: invalid file name","INVITATION_NOT_FOUND":"Invitation not found","INVITATION_NOT_ACCESSIBLE":"Invitation not accessible","INVITATION_ALREADY_ACCEPTED":"Invitation already accepted","INVITATION_ALREADY_REJECTED":"Invitation already rejected","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation: missing destination email","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation: destination email invalid","INVITATION_MISSING_TAG":"Invitation: missing tag","INVITATION_MISSING_PIN":"Invitation: PIN missing","INVITATION_INVALID_PIN":"Invitation: invalid PIN","INVITATION_INVALID_TYPE":"Invitation: invalid type","INVITATION_MISSING_DESTINATION_NAME":"Invitation: destination name missing","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation: tag and pin can\'t be changed","INVITATION_CANT_BE_CHANGED":"Intation: can\'t be changed","ACTIONLOG_INVALID_USER_ID":"Invalid user ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","ACTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","CONSUMPTIONLOG_INVALID_TYPE":"Invalid log type","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","CONSUMPTIONLOG_INVALID_USER_ID":"Invalid user ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID"}}'))},it:{translation:t(hH)}},lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});mH.init();var gH=mH;c=o("85Hg2");function vH(e){var t=e.i18n,n=e.defaultNS,r=e.children,i=(0,c.useMemo)((function(){return{i18n:t,defaultNS:n}}),[t,n]);return(0,c.createElement)(re.Provider,{value:i},r)}const yH=({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=!0,height:w="100%",baseURL:C,apiURL:A="https://backend.memori.ai",tag:E,pin:M,context:T,initialQuestion:_,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:F})=>{var U,j,H;const[V,G]=(0,c.useState)(),[W,K]=(0,c.useState)(),[J,Q]=(0,c.useState)(O),{t:Y}=ve();if(!(r&&t||n&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const X=q(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?G(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?G(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 JU(o,C);e&&K(e)}),[o,A]);(0,c.useEffect)((()=>{ee()}),[ee]),(0,c.useEffect)((()=>{if(I)gH.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"}})();gH.changeLanguage(e).catch((()=>{gH.changeLanguage(t)}))}}),[I]);const te=V?(0,s.jsx)(qU,{layout:u,customLayout:d,height:w,baseUrl:C||(o.startsWith("https://")?o:`https://${o}`),apiUrl:A,memori:{...V,secretToken:a},memoriLang:null!=R?R:null===(j=null===(U=V.culture)||void 0===U?void 0:U.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:x,integration:null===(H=null==V?void 0:V.integrations)||void 0===H?void 0:H.find((e=>i?e.integrationID===i:!!e.publish&&"LANDING_EXPERIENCE"===e.type)),initialContextVars:T,initialQuestion:_,authToken:k,AZURE_COGNITIVE_SERVICES_TTS_KEY:J||O,defaultSpeakerActive:N,onStateChange:D,additionalInfo:L,customMediaRenderer:B,additionalSettings:z,userAvatar:F,...E&&M?{personification:{tag:E,pin:M}}:{}}):(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)(vH,{i18n:gH,children:[(0,s.jsx)(Ss.Toaster,{position:"top-center",reverseOrder:!0}),te]})};yH.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 bH=yH;class SH 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(bH.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)(bH,{...r,context:o,tenantID:i,additionalInfo:l}),n):console.error("No tenantId attribute found")}}customElements.define("memori-client",SH)})();
|
|
246
|
+
*/function rD(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 iD(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 oD(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 sD=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function aD(e){const n=e,{value:r,size:i=$N,level:o=ZN,bgColor:s=eD,fgColor:a=tD,includeMargin:l=nD,style:u,imageSettings:d}=n,p=QN(n,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=null==d?void 0:d.src,f=(0,c.useRef)(null),m=(0,c.useRef)(null),[g,v]=(0,c.useState)(!1);(0,c.useEffect)((()=>{if(null!=f.current){const e=f.current,t=e.getContext("2d");if(!t)return;let n=YN.QrCode.encodeText(r,XN[o]).getModules();const c=l?4:0,u=n.length+2*c,p=oD(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=iD(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,sD?t.fill(new Path2D(rD(n,c))):n.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+c,n+c,1,1)}))})),g&&t.drawImage(h,p.x+c,p.y+c,p.w,p.h)}})),(0,c.useEffect)((()=>{v(!1)}),[h]);const y=JN({height:i,width:i},u);let b=null;return null!=h&&(b=t(c).createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),t(c).createElement(t(c).Fragment,null,t(c).createElement("canvas",JN({style:y,height:i,width:i,ref:f},p)),b)}var lD=({tenant:e,url:n,title:r="",className:i,baseUrl:o,primary:a=!0,showQrCode:l=!0,align:u="right"})=>{const{t:d}=ve(),[p,h]=(0,c.useState)(n),f=(0,c.useMemo)((()=>(null==e?void 0:e.theme)?`${null!=o?o:"https://aisuru.com"}/images/${e.theme}/square_logo.png`:`${null!=o?o:"https://aisuru.com"}/images/memori_logo.png`),[e,o]);(0,c.useEffect)((()=>{n||h(window.location.href)}),[n]);const m=[{id:"facebook",title:"Facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${p}`,icon:NN},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${p}`,icon:DN},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${r}&url=${p}`,icon:LN},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${p}`,icon:BN},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${r}&url=${p}`,icon:HN},{id:"email",title:"Email",url:`mailto:?subject=${(null==r?void 0:r.length)>0?r:n}&body=${p}`,icon:zN}];return(0,s.jsxs)(qd,{as:"div",className:t(ys)("memori-share-button",{"memori-share-button--align-left":"left"===u}),children:[(0,s.jsx)(qd.Button,{className:t(ys)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button",i,{"memori-button--primary":a}),title:d("widget.share")||void 0,children:(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(FN,{})})}),(0,s.jsxs)(qd.Items,{className:"memori-share-button--overlay",as:"ul",children:[(0,s.jsx)(qd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsx)(Da,{className:"memori-share-button--link",ghost:!0,icon:(0,s.jsx)(np,{}),onClick:()=>{p&&navigator.clipboard.writeText(p)},children:d("copyToClipboard")||void 0})},"copy"),m.map((e=>{var n;return(0,s.jsx)(qd.Item,{as:"li",className:"memori-share-button--li",children:(0,s.jsxs)("a",{className:t(ys)("memori-button","memori-button--with-icon","memori-button--ghost","memori-button--padded","memori-share-button--link"),href:null!==(n=e.url)&&void 0!==n?n:"",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)("div",{className:"memori-button--icon",children:(0,s.jsx)(e.icon,{})}),e.title]})},e.id)})),l&&(0,s.jsxs)(qd.Item,{as:"li",className:"memori-share-button--li-qr-code",children:[(0,s.jsx)(aD,{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)(Da,{onClick:()=>{const e=document.getElementById("qr-canvas");if(!e)return;const t=document.createElement("a");t.href=e.toDataURL(),t.download=`memori-${r}-share.png`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},icon:(0,s.jsx)(UN,{}),title:"Download QR",children:"Download"})})]},"qrcode")]})]})};var cD=({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 uD=({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 dD=({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 pD=({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:M}=ve(),[T,_]=(0,c.useState)(!1),[I,R]=(0,c.useState)(!1);return(0,c.useEffect)((()=>{document.fullscreenEnabled&&_(!0)}),[]),(0,s.jsxs)("div",{className:t(ys)("memori-header",e),children:[y&&(0,s.jsx)(Da,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--reload",title:M("reload")||"Reload",icon:(0,s.jsx)(uD,{}),onClick:()=>{window.location.reload()}}),b&&(0,s.jsx)(Da,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--clear",title:M("clearHistory")||"Clear chat",icon:(0,s.jsx)(dD,{}),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)(Da,{icon:(0,s.jsx)(lN,{}),shape:"circle",className:"memori-header--button memori-header--button--position",onClick:()=>a(!0)})]}),T&&(0,s.jsx)(Da,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--fullscreen",title:I?M("fullscreenExit")||"Exit fullscreen":M("fullscreenEnter")||"Enter fullscreen",icon:I?(0,s.jsx)(tm,{}):(0,s.jsx)(cD,{}),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)(Da,{primary:!!E&&!!f,shape:"circle",icon:(0,s.jsx)(mm,{}),className:"memori-header--button memori-header--button--knownfacts",disabled:!f||!E,onClick:()=>u(!0),title:M("knownFacts.title")||"Known facts"}),n.enableBoardOfExperts&&(0,s.jsx)(Da,{primary:!0,shape:"circle",icon:(0,s.jsx)(fm,{}),className:"memori-header--button memori-header--button--experts",disabled:!f||!E,onClick:()=>d(!0),title:M("widget.showExpertsInTheBoard")||"Experts in this board"}),v&&(0,s.jsx)(Da,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button--speaker",icon:p?(0,s.jsx)(cN,{}):(0,s.jsx)(dN,{}),onClick:()=>h(!p),title:M("widget.sound")||"Sound"}),(0,s.jsx)(kN,{history:i,memori:n,className:"memori-header--button memori-header--button--export",disabled:!f||0===i.length}),g&&(0,s.jsx)(Da,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-settings",icon:(0,s.jsx)(ON,{}),onClick:()=>l(!0),title:M("widget.settings")||"Settings"}),m&&(0,s.jsx)(lD,{className:"memori-header--button memori-header--button-share",title:n.name,tenant:r,showQrCode:!0,align:"left"}),S&&(0,s.jsx)(Da,{primary:!0,shape:"circle",className:"memori-header--button memori-header--button-login",icon:(0,s.jsx)(Cd,{}),onClick:()=>x(!0),title:C?M("login.user")||"User":M("login.login")||"Login"})]})};var hD=({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"})]})]})},fD={};function mD(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 gD(e,t,n){return t&&mD(e.prototype,t),n&&mD(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function vD(){return vD=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},vD.apply(this,arguments)}function yD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,SD(e,t)}function bD(e){return bD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bD(e)}function SD(e,t){return SD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},SD(e,t)}function xD(){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 wD(e,t,n){return wD=xD()?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&&SD(i,n.prototype),i},wD.apply(null,arguments)}function CD(e){var t="function"==typeof Map?new Map:void 0;return CD=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 wD(e,arguments,bD(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),SD(r,e)},CD(e)}function AD(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 ED(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 MD(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 ED(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)?ED(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(fD,"__esModule",{value:!0});var TD=function(e){function t(){return e.apply(this,arguments)||this}return yD(t,e),t}(CD(Error)),_D=function(e){function t(t){return e.call(this,"Invalid DateTime: "+t.toMessage())||this}return yD(t,e),t}(TD),ID=function(e){function t(t){return e.call(this,"Invalid Interval: "+t.toMessage())||this}return yD(t,e),t}(TD),RD=function(e){function t(t){return e.call(this,"Invalid Duration: "+t.toMessage())||this}return yD(t,e),t}(TD),PD=function(e){function t(){return e.apply(this,arguments)||this}return yD(t,e),t}(TD),kD=function(e){function t(t){return e.call(this,"Invalid unit "+t)||this}return yD(t,e),t}(TD),OD=function(e){function t(){return e.apply(this,arguments)||this}return yD(t,e),t}(TD),ND=function(e){function t(){return e.call(this,"Zone is an abstract class")||this}return yD(t,e),t}(TD),DD="numeric",LD="short",BD="long",zD={year:DD,month:DD,day:DD},FD={year:DD,month:LD,day:DD},UD={year:DD,month:LD,day:DD,weekday:LD},jD={year:DD,month:BD,day:DD},HD={year:DD,month:BD,day:DD,weekday:BD},VD={hour:DD,minute:DD},GD={hour:DD,minute:DD,second:DD},WD={hour:DD,minute:DD,second:DD,timeZoneName:LD},qD={hour:DD,minute:DD,second:DD,timeZoneName:BD},KD={hour:DD,minute:DD,hourCycle:"h23"},JD={hour:DD,minute:DD,second:DD,hourCycle:"h23"},QD={hour:DD,minute:DD,second:DD,hourCycle:"h23",timeZoneName:LD},YD={hour:DD,minute:DD,second:DD,hourCycle:"h23",timeZoneName:BD},XD={year:DD,month:DD,day:DD,hour:DD,minute:DD},$D={year:DD,month:DD,day:DD,hour:DD,minute:DD,second:DD},ZD={year:DD,month:LD,day:DD,hour:DD,minute:DD},eL={year:DD,month:LD,day:DD,hour:DD,minute:DD,second:DD},tL={year:DD,month:LD,day:DD,weekday:LD,hour:DD,minute:DD},nL={year:DD,month:BD,day:DD,hour:DD,minute:DD,timeZoneName:LD},rL={year:DD,month:BD,day:DD,hour:DD,minute:DD,second:DD,timeZoneName:LD},iL={year:DD,month:BD,day:DD,weekday:BD,hour:DD,minute:DD,timeZoneName:BD},oL={year:DD,month:BD,day:DD,weekday:BD,hour:DD,minute:DD,second:DD,timeZoneName:BD},sL=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new ND},t.formatOffset=function(e,t){throw new ND},t.offset=function(e){throw new ND},t.equals=function(e){throw new ND},gD(e,[{key:"type",get:function(){throw new ND}},{key:"name",get:function(){throw new ND}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new ND}},{key:"isValid",get:function(){throw new ND}}]),e}(),aL=null,lL=function(e){function t(){return e.apply(this,arguments)||this}yD(t,e);var n=t.prototype;return n.offsetName=function(e,t){return CB(e,t.format,t.locale)},n.formatOffset=function(e,t){return TB(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return"system"===e.type},gD(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===aL&&(aL=new t),aL}}]),t}(sL),cL={};var uL={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};var dL={},pL=function(e){function t(n){var r;return(r=e.call(this)||this).zoneName=n,r.valid=t.isValidZone(n),r}yD(t,e),t.create=function(e){return dL[e]||(dL[e]=new t(e)),dL[e]},t.resetCache=function(){dL={},cL={}},t.isValidSpecifier=function(e){return this.isValidZone(e)},t.isValidZone=function(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}};var n=t.prototype;return n.offsetName=function(e,t){return CB(e,t.format,t.locale,this.name)},n.formatOffset=function(e,t){return TB(this.offset(e),t)},n.offset=function(e){var t=new Date(e);if(isNaN(t))return NaN;var n,r=(n=this.name,cL[n]||(cL[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"})),cL[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=uL[s];"era"===s?r[l]=a:nB(l)||(r[l]=parseInt(a,10))}return r}(r,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),i=r[1],o=r[2];return[r[3],i,o,r[4],r[5],r[6],r[7]]}(r,t),o=i[0],s=i[1],a=i[2],l=i[3],c=i[4],u=i[5],d=i[6];"BC"===l&&(o=1-Math.abs(o));var p=+t,h=p%1e3;return(bB({year:o,month:s,day:a,hour:24===c?0:c,minute:u,second:d,millisecond:0})-(p-=h>=0?h:1e3+h))/6e4},n.equals=function(e){return"iana"===e.type&&e.name===this.name},gD(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}(sL),hL=["base"],fL=["padTo","floor"],mL={};var gL={};function vL(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=gL[n];return r||(r=new Intl.DateTimeFormat(e,t),gL[n]=r),r}var yL={};var bL={};var SL=null;var xL={};function wL(e,t,n,r){var i=e.listingMode();return"error"===i?null:"en"===i?n(t):r(t)}var CL=function(){function e(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1,n.padTo,n.floor;var r=AD(n,fL);if(!t||Object.keys(r).length>0){var i=vD({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=yL[n];return r||(r=new Intl.NumberFormat(e,t),yL[n]=r),r}(e,i)}}return e.prototype.format=function(e){if(this.inf){var t=this.floor?Math.floor(e):e;return this.inf.format(t)}return dB(this.floor?Math.floor(e):mB(e,3),this.padTo)},e}(),AL=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&&pL.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=vD({},this.opts);s.timeZone=s.timeZone||r,this.dtf=vL(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?vD({},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}(),EL=function(){function e(e,t,n){this.opts=vD({style:"long"},n),!t&&oB()&&(this.rtf=function(e,t){void 0===t&&(t={});var n=t;n.base;var r=AD(n,hL),i=JSON.stringify([e,r]),o=bL[i];return o||(o=new Intl.RelativeTimeFormat(e,t),bL[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}(),ML={firstDay:1,minimalDays:4,weekend:[6,7]},TL=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=vL(e).resolvedOptions(),r=e}catch(t){var o=e.substring(0,i);n=vL(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||UL.defaultLocale;return new e(s||(o?"en-US":SL||(SL=(new Intl.DateTimeFormat).resolvedOptions().locale)),n||UL.defaultNumberingSystem,r||UL.defaultOutputCalendar,cB(i)||UL.defaultWeekSettings,s)},e.resetCache=function(){SL=null,gL={},yL={},bL={}},e.fromObject=function(t){var n=void 0===t?{}:t,r=n.locale,i=n.numberingSystem,o=n.outputCalendar,s=n.weekSettings;return e.create(r,i,o,s)};var t=e.prototype;return t.listingMode=function(){var e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"},t.clone=function(t){return t&&0!==Object.getOwnPropertyNames(t).length?e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,cB(t.weekSettings)||this.weekSettings,t.defaultToEN||!1):this},t.redefaultToEN=function(e){return void 0===e&&(e={}),this.clone(vD({},e,{defaultToEN:!0}))},t.redefaultToSystem=function(e){return void 0===e&&(e={}),this.clone(vD({},e,{defaultToEN:!1}))},t.months=function(e,t){var n=this;return void 0===t&&(t=!1),wL(this,e,kB,(function(){var r=t?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";return n.monthsCache[i][e]||(n.monthsCache[i][e]=function(e){for(var t=[],n=1;n<=12;n++){var r=LF.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),wL(this,e,LB,(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=LF.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 wL(this,void 0,(function(){return BB}),(function(){if(!e.meridiemCache){var t={hour:"numeric",hourCycle:"h12"};e.meridiemCache=[LF.utc(2016,11,13,9),LF.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 wL(this,e,jB,(function(){var n={era:e};return t.eraCache[e]||(t.eraCache[e]=[LF.utc(-40,1,1),LF.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 CL(this.intl,e.forceSimple||this.fastNumbers,e)},t.dtFormatter=function(e,t){return void 0===t&&(t={}),new AL(e,this.intl,t)},t.relFormatter=function(e){return void 0===e&&(e={}),new EL(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=mL[n];return r||(r=new Intl.ListFormat(e,t),mL[n]=r),r}(this.intl,e)},t.isEnglish=function(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")},t.getWeekSettings=function(){return this.weekSettings?this.weekSettings:sB()?function(e){var t=xL[e];if(!t){var n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,xL[e]=t}return t}(this.locale):ML},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},gD(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}(),_L=null,IL=function(e){function t(t){var n;return(n=e.call(this)||this).fixed=t,n}yD(t,e),t.instance=function(e){return 0===e?t.utcInstance:new t(e)},t.parseSpecifier=function(e){if(e){var n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new t(AB(n[1],n[2]))}return null};var n=t.prototype;return n.offsetName=function(){return this.name},n.formatOffset=function(e,t){return TB(this.fixed,t)},n.offset=function(){return this.fixed},n.equals=function(e){return"fixed"===e.type&&e.fixed===this.fixed},gD(t,[{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC"+TB(this.fixed,"narrow")}},{key:"ianaName",get:function(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+TB(-this.fixed,"narrow")}},{key:"isUniversal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}],[{key:"utcInstance",get:function(){return null===_L&&(_L=new t(0)),_L}}]),t}(sL),RL=function(e){function t(t){var n;return(n=e.call(this)||this).zoneName=t,n}yD(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},gD(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}(sL);function PL(e,t){if(nB(e)||null===e)return t;if(e instanceof sL)return e;if(function(e){return"string"==typeof e}(e)){var n=e.toLowerCase();return"default"===n?t:"local"===n||"system"===n?lL.instance:"utc"===n||"gmt"===n?IL.utcInstance:IL.parseSpecifier(n)||pL.create(e)}return rB(e)?IL.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new RL(e)}var kL,OL=function(){return Date.now()},NL="system",DL=null,LL=null,BL=null,zL=60,FL=null,UL=function(){function e(){}return e.resetCaches=function(){TL.resetCache(),pL.resetCache()},gD(e,null,[{key:"now",get:function(){return OL},set:function(e){OL=e}},{key:"defaultZone",get:function(){return PL(NL,lL.instance)},set:function(e){NL=e}},{key:"defaultLocale",get:function(){return DL},set:function(e){DL=e}},{key:"defaultNumberingSystem",get:function(){return LL},set:function(e){LL=e}},{key:"defaultOutputCalendar",get:function(){return BL},set:function(e){BL=e}},{key:"defaultWeekSettings",get:function(){return FL},set:function(e){FL=cB(e)}},{key:"twoDigitCutoffYear",get:function(){return zL},set:function(e){zL=e%100}},{key:"throwOnInvalid",get:function(){return kL},set:function(e){kL=e}}]),e}(),jL=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}(),HL=[0,31,59,90,120,151,181,212,243,273,304,334],VL=[0,31,60,91,121,152,182,213,244,274,305,335];function GL(e,t){return new jL("unit out of range","you specified "+t+" (of type "+typeof t+") as a "+e+", which is invalid")}function WL(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 qL(e,t,n){return n+(gB(e)?VL:HL)[t-1]}function KL(e,t){var n=gB(e)?VL:HL,r=n.findIndex((function(e){return e<t}));return{month:r+1,day:t-n[r]}}function JL(e,t){return(e-t+7)%7+1}function QL(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=qL(i,o,s),l=JL(WL(i,o,s),n),c=Math.floor((a-l+14-t)/7);return c<1?c=xB(r=i-1,t,n):c>xB(i,t,n)?(r=i+1,c=1):r=i,vD({weekYear:r,weekNumber:c,weekday:l},_B(e))}function YL(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=JL(WL(i,1,t),n),l=vB(i),c=7*o+s-a-7+t;c<1?c+=vB(r=i-1):c>l?(r=i+1,c-=vB(i)):r=i;var u=KL(r,c);return vD({year:r,month:u.month,day:u.day},_B(e))}function XL(e){var t=e.year;return vD({year:t,ordinal:qL(t,e.month,e.day)},_B(e))}function $L(e){var t=e.year,n=KL(t,e.ordinal);return vD({year:t,month:n.month,day:n.day},_B(e))}function ZL(e,t){if(!nB(e.localWeekday)||!nB(e.localWeekNumber)||!nB(e.localWeekYear)){if(!nB(e.weekday)||!nB(e.weekNumber)||!nB(e.weekYear))throw new PD("Cannot mix locale-based week fields with ISO-based week fields");return nB(e.localWeekday)||(e.weekday=e.localWeekday),nB(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),nB(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function eB(e){var t=iB(e.year),n=uB(e.month,1,12),r=uB(e.day,1,yB(e.year,e.month));return t?n?!r&&GL("day",e.day):GL("month",e.month):GL("year",e.year)}function tB(e){var t=e.hour,n=e.minute,r=e.second,i=e.millisecond,o=uB(t,0,23)||24===t&&0===n&&0===r&&0===i,s=uB(n,0,59),a=uB(r,0,59),l=uB(i,0,999);return o?s?a?!l&&GL("millisecond",i):GL("second",r):GL("minute",n):GL("hour",t)}function nB(e){return void 0===e}function rB(e){return"number"==typeof e}function iB(e){return"number"==typeof e&&e%1==0}function oB(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function sB(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function aB(e,t,n){if(0!==e.length)return e.reduce((function(e,r){var i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i}),null)[1]}function lB(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function cB(e){if(null==e)return null;if("object"!=typeof e)throw new OD("Week settings must be an object");if(!uB(e.firstDay,1,7)||!uB(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some((function(e){return!uB(e,1,7)})))throw new OD("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function uB(e,t,n){return iB(e)&&e>=t&&e<=n}function dB(e,t){return void 0===t&&(t=2),e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0")}function pB(e){return nB(e)||null===e||""===e?void 0:parseInt(e,10)}function hB(e){return nB(e)||null===e||""===e?void 0:parseFloat(e)}function fB(e){if(!nB(e)&&null!==e&&""!==e){var t=1e3*parseFloat("0."+e);return Math.floor(t)}}function mB(e,t,n){void 0===n&&(n=!1);var r=Math.pow(10,t);return(n?Math.trunc:Math.round)(e*r)/r}function gB(e){return e%4==0&&(e%100!=0||e%400==0)}function vB(e){return gB(e)?366:365}function yB(e,t){var n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?gB(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function bB(e){var t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t)).setUTCFullYear(e.year,e.month-1,e.day),+t}function SB(e,t,n){return-JL(WL(e,1,t),n)+t-1}function xB(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r=SB(e,t,n),i=SB(e+1,t,n);return(vB(e)-r+i)/7}function wB(e){return e>99?e:e>UL.twoDigitCutoffYear?1900+e:2e3+e}function CB(e,t,n,r){void 0===r&&(r=null);var i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);var s=vD({timeZoneName:t},o),a=new Intl.DateTimeFormat(n,s).formatToParts(i).find((function(e){return"timezonename"===e.type.toLowerCase()}));return a?a.value:null}function AB(e,t){var n=parseInt(e,10);Number.isNaN(n)&&(n=0);var r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function EB(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new OD("Invalid unit value "+e);return t}function MB(e,t){var n={};for(var r in e)if(lB(e,r)){var i=e[r];if(null==i)continue;n[t(r)]=EB(i)}return n}function TB(e,t){var n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return""+i+dB(n,2)+":"+dB(r,2);case"narrow":return""+i+n+(r>0?":"+r:"");case"techie":return""+i+dB(n,2)+dB(r,2);default:throw new RangeError("Value format "+t+" is out of range for property format")}}function _B(e){return function(e,t){return t.reduce((function(t,n){return t[n]=e[n],t}),{})}(e,["hour","minute","second","millisecond"])}var IB=["January","February","March","April","May","June","July","August","September","October","November","December"],RB=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],PB=["J","F","M","A","M","J","J","A","S","O","N","D"];function kB(e){switch(e){case"narrow":return[].concat(PB);case"short":return[].concat(RB);case"long":return[].concat(IB);case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var OB=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],NB=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],DB=["M","T","W","T","F","S","S"];function LB(e){switch(e){case"narrow":return[].concat(DB);case"short":return[].concat(NB);case"long":return[].concat(OB);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var BB=["AM","PM"],zB=["Before Christ","Anno Domini"],FB=["BC","AD"],UB=["B","A"];function jB(e){switch(e){case"narrow":return[].concat(UB);case"short":return[].concat(FB);case"long":return[].concat(zB);default:return null}}function HB(e,t){for(var n,r="",i=MD(e);!(n=i()).done;){var o=n.value;o.literal?r+=o.val:r+=t(o.val)}return r}var VB={D:zD,DD:FD,DDD:jD,DDDD:HD,t:VD,tt:GD,ttt:WD,tttt:qD,T:KD,TT:JD,TTT:QD,TTTT:YD,f:XD,ff:ZD,fff:nL,ffff:iL,F:$D,FF:eL,FFF:rL,FFFF:oL},GB=function(){function e(e,t){this.opts=t,this.loc=e,this.systemLoc=null}e.create=function(t,n){return void 0===n&&(n={}),new e(t,n)},e.parseFormat=function(e){for(var t=null,n="",r=!1,i=[],o=0;o<e.length;o++){var s=e.charAt(o);"'"===s?(n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),t=null,n="",r=!r):r||s===t?n+=s:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=s,t=s)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i},e.macroTokenToFormatOpts=function(e){return VB[e]};var t=e.prototype;return t.formatWithSystemDefault=function(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,vD({},this.opts,t)).format()},t.dtFormatter=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,vD({},this.opts,t))},t.formatDateTime=function(e,t){return this.dtFormatter(e,t).format()},t.formatDateTimeParts=function(e,t){return this.dtFormatter(e,t).formatToParts()},t.formatInterval=function(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())},t.resolvedOptions=function(e,t){return this.dtFormatter(e,t).resolvedOptions()},t.num=function(e,t){if(void 0===t&&(t=0),this.opts.forceSimple)return dB(e,t);var n=vD({},this.opts);return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)},t.formatDateTimeFromString=function(t,n){var r=this,i="en"===this.loc.listingMode(),o=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,s=function(e,n){return r.loc.extract(t,e,n)},a=function(e){return t.isOffsetFixed&&0===t.offset&&e.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,e.format):""},l=function(){return i?function(e){return BB[e.hour<12?0:1]}(t):s({hour:"numeric",hourCycle:"h12"},"dayperiod")},c=function(e,n){return i?function(e,t){return kB(t)[e.month-1]}(t,e):s(n?{month:e}:{month:e,day:"numeric"},"month")},u=function(e,n){return i?function(e,t){return LB(t)[e.weekday-1]}(t,e):s(n?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday")},d=function(e){return i?function(e,t){return jB(t)[e.year<0?0:1]}(t,e):s({era:e},"era")};return HB(e.parseFormat(n),(function(n){switch(n){case"S":return r.num(t.millisecond);case"u":case"SSS":return r.num(t.millisecond,3);case"s":return r.num(t.second);case"ss":return r.num(t.second,2);case"uu":return r.num(Math.floor(t.millisecond/10),2);case"uuu":return r.num(Math.floor(t.millisecond/100));case"m":return r.num(t.minute);case"mm":return r.num(t.minute,2);case"h":return r.num(t.hour%12==0?12:t.hour%12);case"hh":return r.num(t.hour%12==0?12:t.hour%12,2);case"H":return r.num(t.hour);case"HH":return r.num(t.hour,2);case"Z":return a({format:"narrow",allowZ:r.opts.allowZ});case"ZZ":return a({format:"short",allowZ:r.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:r.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:r.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:r.loc.locale});case"z":return t.zoneName;case"a":return l();case"d":return o?s({day:"numeric"},"day"):r.num(t.day);case"dd":return o?s({day:"2-digit"},"day"):r.num(t.day,2);case"c":case"E":return r.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return o?s({month:"numeric",day:"numeric"},"month"):r.num(t.month);case"LL":return o?s({month:"2-digit",day:"numeric"},"month"):r.num(t.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return o?s({month:"numeric"},"month"):r.num(t.month);case"MM":return o?s({month:"2-digit"},"month"):r.num(t.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return o?s({year:"numeric"},"year"):r.num(t.year);case"yy":return o?s({year:"2-digit"},"year"):r.num(t.year.toString().slice(-2),2);case"yyyy":return o?s({year:"numeric"},"year"):r.num(t.year,4);case"yyyyyy":return o?s({year:"numeric"},"year"):r.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return r.num(t.weekYear.toString().slice(-2),2);case"kkkk":return r.num(t.weekYear,4);case"W":return r.num(t.weekNumber);case"WW":return r.num(t.weekNumber,2);case"n":return r.num(t.localWeekNumber);case"nn":return r.num(t.localWeekNumber,2);case"ii":return r.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return r.num(t.localWeekYear,4);case"o":return r.num(t.ordinal);case"ooo":return r.num(t.ordinal,3);case"q":return r.num(t.quarter);case"qq":return r.num(t.quarter,2);case"X":return r.num(Math.floor(t.ts/1e3));case"x":return r.num(t.ts);default:return function(n){var i=e.macroTokenToFormatOpts(n);return i?r.formatWithSystemDefault(t,i):n}(n)}}))},t.formatDurationFromString=function(t,n){var r,i=this,o=function(e){switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=e.parseFormat(n),a=s.reduce((function(e,t){var n=t.literal,r=t.val;return n?e:e.concat(r)}),[]),l=t.shiftTo.apply(t,a.map(o).filter((function(e){return e})));return HB(s,(r=l,function(e){var t=o(e);return t?i.num(r.get(t),e.length):e}))},e}(),WB=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function qB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.reduce((function(e,t){return e+t.source}),"");return RegExp("^"+r+"$")}function KB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduce((function(t,n){var r=t[0],i=t[1],o=t[2],s=n(e,o),a=s[0],l=s[1],c=s[2];return[vD({},r,a),l||i,c]}),[{},null,1]).slice(0,2)}}function JB(e){if(null==e)return[null,null];for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=0,o=n;i<o.length;i++){var s=o[i],a=s[0],l=s[1],c=a.exec(e);if(c)return l(c)}return[null,null]}function QB(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n){var r,i={};for(r=0;r<t.length;r++)i[t[r]]=pB(e[n+r]);return[i,null,n+r]}}var YB=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,XB=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,$B=RegExp(""+XB.source+("(?:"+YB.source+"?(?:\\[("+WB.source+")\\])?)?")),ZB=RegExp("(?:T"+$B.source+")?"),ez=QB("weekYear","weekNumber","weekDay"),tz=QB("year","ordinal"),nz=RegExp(XB.source+" ?(?:"+YB.source+"|("+WB.source+"))?"),rz=RegExp("(?: "+nz.source+")?");function iz(e,t,n){var r=e[t];return nB(r)?n:pB(r)}function oz(e,t){return[{hours:iz(e,t,0),minutes:iz(e,t+1,0),seconds:iz(e,t+2,0),milliseconds:fB(e[t+3])},null,t+4]}function sz(e,t){var n=!e[t]&&!e[t+1],r=AB(e[t+1],e[t+2]);return[{},n?null:IL.instance(r),t+3]}function az(e,t){return[{},e[t]?pL.create(e[t]):null,t+1]}var lz=RegExp("^T?"+XB.source+"$"),cz=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function uz(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u="-"===t[0],d=l&&"-"===l[0],p=function(e,t){return void 0===t&&(t=!1),void 0!==e&&(t||e&&u)?-e:e};return[{years:p(hB(n)),months:p(hB(r)),weeks:p(hB(i)),days:p(hB(o)),hours:p(hB(s)),minutes:p(hB(a)),seconds:p(hB(l),"-0"===l),milliseconds:p(fB(c),d)}]}var dz={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function pz(e,t,n,r,i,o,s){var a={year:2===t.length?wB(pB(t)):pB(t),month:RB.indexOf(n)+1,day:pB(r),hour:pB(i),minute:pB(o)};return s&&(a.second=pB(s)),e&&(a.weekday=e.length>3?OB.indexOf(e)+1:NB.indexOf(e)+1),a}var hz=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function fz(e){var t,n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],d=e[10],p=e[11],h=pz(n,o,i,r,s,a,l);return t=c?dz[c]:u?0:AB(d,p),[h,new IL(t)]}var mz=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,gz=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,vz=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function yz(e){var t=e[1],n=e[2],r=e[3];return[pz(t,e[4],r,n,e[5],e[6],e[7]),IL.utcInstance]}function bz(e){var t=e[1],n=e[2],r=e[3],i=e[4],o=e[5],s=e[6];return[pz(t,e[7],n,r,i,o,s),IL.utcInstance]}var Sz=qB(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,ZB),xz=qB(/(\d{4})-?W(\d\d)(?:-?(\d))?/,ZB),wz=qB(/(\d{4})-?(\d{3})/,ZB),Cz=qB($B),Az=KB((function(e,t){return[{year:iz(e,t),month:iz(e,t+1,1),day:iz(e,t+2,1)},null,t+3]}),oz,sz,az),Ez=KB(ez,oz,sz,az),Mz=KB(tz,oz,sz,az),Tz=KB(oz,sz,az);var _z=KB(oz);var Iz=qB(/(\d{4})-(\d\d)-(\d\d)/,rz),Rz=qB(nz),Pz=KB(oz,sz,az);var kz="Invalid Duration",Oz={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Nz=vD({years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},Oz),Dz=365.2425,Lz=30.436875,Bz=vD({years:{quarters:4,months:12,weeks:52.1775,days:Dz,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:Lz,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},Oz),zz=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Fz=zz.slice(0).reverse();function Uz(e,t,n){void 0===n&&(n=!1);var r={values:n?t.values:vD({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Vz(r)}function jz(e,t){for(var n,r,i=null!=(n=t.milliseconds)?n:0,o=MD(Fz.slice(1));!(r=o()).done;){var s=r.value;t[s]&&(i+=t[s]*e[s].milliseconds)}return i}function Hz(e,t){var n=jz(e,t)<0?-1:1;zz.reduceRight((function(r,i){if(nB(t[i]))return r;if(r){var o=t[r]*n,s=e[i][r],a=Math.floor(o/s);t[i]+=a*n,t[r]-=a*s*n}return i}),null),zz.reduce((function(n,r){if(nB(t[r]))return n;if(n){var i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r}),null)}var Vz=function(e){function t(e){var t="longterm"===e.conversionAccuracy||!1,n=t?Bz:Nz;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||TL.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 OD("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new t({values:MB(e,t.normalizeUnit),loc:TL.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})},t.fromDurationLike=function(e){if(rB(e))return t.fromMillis(e);if(t.isDuration(e))return e;if("object"==typeof e)return t.fromObject(e);throw new OD("Unknown duration argument "+e+" of type "+typeof e)},t.fromISO=function(e,n){var r=function(e){return JB(e,[cz,uz])}(e),i=r[0];return i?t.fromObject(i,n):t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.fromISOTime=function(e,n){var r=function(e){return JB(e,[lz,_z])}(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 OD("need to specify a reason the Duration is invalid");var r=e instanceof jL?e:new jL(e,n);if(UL.throwOnInvalid)throw new RD(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 kD(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=vD({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?GB.create(this.loc,n).formatDurationFromString(this,e):kz},n.toHuman=function(e){var t=this;if(void 0===e&&(e={}),!this.isValid)return kz;var n=zz.map((function(n){var r=t.values[n];return nB(r)?null:t.loc.numberFormatter(vD({style:"unit",unitDisplay:"long"},e,{unit:n.slice(0,-1)})).format(r)})).filter((function(e){return e}));return this.loc.listFormatter(vD({type:"conjunction",style:e.listStyle||"narrow"},e)).format(n)},n.toObject=function(){return this.isValid?vD({},this.values):{}},n.toISO=function(){if(!this.isValid)return null;var e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=mB(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e},n.toISOTime=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var t=this.toMillis();return t<0||t>=864e5?null:(e=vD({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e,{includeOffset:!1}),LF.fromMillis(t,{zone:"UTC"}).toISOTime(e))},n.toJSON=function(){return this.toISO()},n.toString=function(){return this.toISO()},n[e]=function(){return this.isValid?"Duration { values: "+JSON.stringify(this.values)+" }":"Duration { Invalid, reason: "+this.invalidReason+" }"},n.toMillis=function(){return this.isValid?jz(this.matrix,this.values):NaN},n.valueOf=function(){return this.toMillis()},n.plus=function(e){if(!this.isValid)return this;for(var n=t.fromDurationLike(e),r={},i=0,o=zz;i<o.length;i++){var s=o[i];(lB(n.values,s)||lB(this.values,s))&&(r[s]=n.get(s)+this.get(s))}return Uz(this,{values:r},!0)},n.minus=function(e){if(!this.isValid)return this;var n=t.fromDurationLike(e);return this.plus(n.negate())},n.mapUnits=function(e){if(!this.isValid)return this;for(var t={},n=0,r=Object.keys(this.values);n<r.length;n++){var i=r[n];t[i]=EB(e(this.values[i],i))}return Uz(this,{values:t},!0)},n.get=function(e){return this[t.normalizeUnit(e)]},n.set=function(e){return this.isValid?Uz(this,{values:vD({},this.values,MB(e,t.normalizeUnit))}):this},n.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.conversionAccuracy,o=t.matrix;return Uz(this,{loc:this.loc.clone({locale:n,numberingSystem:r}),matrix:o,conversionAccuracy:i})},n.as=function(e){return this.isValid?this.shiftTo(e).get(e):NaN},n.normalize=function(){if(!this.isValid)return this;var e=this.toObject();return Hz(this.matrix,e),Uz(this,{values:e},!0)},n.rescale=function(){return this.isValid?Uz(this,{values:function(e){for(var t={},n=0,r=Object.entries(e);n<r.length;n++){var i=r[n],o=i[0],s=i[1];0!==s&&(t[o]=s)}return t}(this.normalize().shiftToAll().toObject())},!0):this},n.shiftTo=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!this.isValid)return this;if(0===n.length)return this;n=n.map((function(e){return t.normalizeUnit(e)}));for(var i,o={},s={},a=this.toObject(),l=0,c=zz;l<c.length;l++){var u=c[l];if(n.indexOf(u)>=0){i=u;var d=0;for(var p in s)d+=this.matrix[p][u]*s[p],s[p]=0;rB(a[u])&&(d+=a[u]);var h=Math.trunc(d);o[u]=h,s[u]=(1e3*d-1e3*h)/1e3}else rB(a[u])&&(s[u]=a[u])}for(var f in s)0!==s[f]&&(o[i]+=f===i?s[f]:s[f]/this.matrix[i][f]);return Hz(this.matrix,o),Uz(this,{values:o},!0)},n.shiftToAll=function(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this},n.negate=function(){if(!this.isValid)return this;for(var e={},t=0,n=Object.keys(this.values);t<n.length;t++){var r=n[t];e[r]=0===this.values[r]?0:-this.values[r]}return Uz(this,{values:e},!0)},n.equals=function(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(var t=0,n=zz;t<n.length;t++){var r=n[t];if(i=this.values[r],o=e.values[r],!(void 0===i||0===i?void 0===o||0===o:i===o))return!1}var i,o;return!0},gD(t,[{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"years",get:function(){return this.isValid?this.values.years||0:NaN}},{key:"quarters",get:function(){return this.isValid?this.values.quarters||0:NaN}},{key:"months",get:function(){return this.isValid?this.values.months||0:NaN}},{key:"weeks",get:function(){return this.isValid?this.values.weeks||0:NaN}},{key:"days",get:function(){return this.isValid?this.values.days||0:NaN}},{key:"hours",get:function(){return this.isValid?this.values.hours||0:NaN}},{key:"minutes",get:function(){return this.isValid?this.values.minutes||0:NaN}},{key:"seconds",get:function(){return this.isValid?this.values.seconds||0:NaN}},{key:"milliseconds",get:function(){return this.isValid?this.values.milliseconds||0:NaN}},{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),t}(Symbol.for("nodejs.util.inspect.custom")),Gz="Invalid Interval";var Wz=function(e){function t(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new OD("need to specify a reason the Interval is invalid");var r=e instanceof jL?e:new jL(e,n);if(UL.throwOnInvalid)throw new ID(r);return new t({invalid:r})},t.fromDateTimes=function(e,n){var r=BF(e),i=BF(n),o=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?Wz.invalid("end before start","The end of an interval must be after its start, but you had start="+e.toISO()+" and end="+t.toISO()):null:Wz.invalid("missing or invalid end"):Wz.invalid("missing or invalid start")}(r,i);return null==o?new t({start:r,end:i}):o},t.after=function(e,n){var r=Vz.fromDurationLike(n),i=BF(e);return t.fromDateTimes(i,i.plus(r))},t.before=function(e,n){var r=Vz.fromDurationLike(n),i=BF(e);return t.fromDateTimes(i.minus(r),i)},t.fromISO=function(e,n){var r=(e||"").split("/",2),i=r[0],o=r[1];if(i&&o){var s,a,l,c;try{a=(s=LF.fromISO(i,n)).isValid}catch(e){a=!1}try{c=(l=LF.fromISO(o,n)).isValid}catch(e){c=!1}if(a&&c)return t.fromDateTimes(s,l);if(a){var u=Vz.fromISO(o,n);if(u.isValid)return t.after(s,u)}else if(c){var d=Vz.fromISO(i,n);if(d.isValid)return t.before(l,d)}}return t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.isInterval=function(e){return e&&e.isLuxonInterval||!1};var n=t.prototype;return n.length=function(e){return void 0===e&&(e="milliseconds"),this.isValid?this.toDuration.apply(this,[e]).get(e):NaN},n.count=function(e,t){if(void 0===e&&(e="milliseconds"),!this.isValid)return NaN;var n,r=this.start.startOf(e,t);return n=(n=null!=t&&t.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end).startOf(e,t),Math.floor(n.diff(r,e).get(e))+(n.valueOf()!==this.end.valueOf())},n.hasSame=function(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))},n.isEmpty=function(){return this.s.valueOf()===this.e.valueOf()},n.isAfter=function(e){return!!this.isValid&&this.s>e},n.isBefore=function(e){return!!this.isValid&&this.e<=e},n.contains=function(e){return!!this.isValid&&(this.s<=e&&this.e>e)},n.set=function(e){var n=void 0===e?{}:e,r=n.start,i=n.end;return this.isValid?t.fromDateTimes(r||this.s,i||this.e):this},n.splitAt=function(){var e=this;if(!this.isValid)return[];for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=r.map(BF).filter((function(t){return e.contains(t)})).sort((function(e,t){return e.toMillis()-t.toMillis()})),s=[],a=this.s,l=0;a<this.e;){var c=o[l]||this.e,u=+c>+this.e?this.e:c;s.push(t.fromDateTimes(a,u)),a=u,l+=1}return s},n.splitBy=function(e){var n=Vz.fromDurationLike(e);if(!this.isValid||!n.isValid||0===n.as("milliseconds"))return[];for(var r,i=this.s,o=1,s=[];i<this.e;){var a=this.start.plus(n.mapUnits((function(e){return e*o})));r=+a>+this.e?this.e:a,s.push(t.fromDateTimes(i,r)),i=r,o+=1}return s},n.divideEqually=function(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},n.overlaps=function(e){return this.e>e.s&&this.s<e.e},n.abutsStart=function(e){return!!this.isValid&&+this.e==+e.s},n.abutsEnd=function(e){return!!this.isValid&&+e.e==+this.s},n.engulfs=function(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)},n.equals=function(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))},n.intersection=function(e){if(!this.isValid)return this;var n=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return n>=r?null:t.fromDateTimes(n,r)},n.union=function(e){if(!this.isValid)return this;var n=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return t.fromDateTimes(n,r)},t.merge=function(e){var t=e.sort((function(e,t){return e.s-t.s})).reduce((function(e,t){var n=e[0],r=e[1];return r?r.overlaps(t)||r.abutsStart(t)?[n,r.union(t)]:[n.concat([r]),t]:[n,t]}),[[],null]),n=t[0],r=t[1];return r&&n.push(r),n},t.xor=function(e){for(var n,r,i=null,o=0,s=[],a=e.map((function(e){return[{time:e.s,type:"s"},{time:e.e,type:"e"}]})),l=(n=Array.prototype).concat.apply(n,a).sort((function(e,t){return e.time-t.time})),c=MD(l);!(r=c()).done;){var u=r.value;1===(o+="s"===u.type?1:-1)?i=u.time:(i&&+i!=+u.time&&s.push(t.fromDateTimes(i,u.time)),i=null)}return t.merge(s)},n.difference=function(){for(var e=this,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.xor([this].concat(r)).map((function(t){return e.intersection(t)})).filter((function(e){return e&&!e.isEmpty()}))},n.toString=function(){return this.isValid?"["+this.s.toISO()+" – "+this.e.toISO()+")":Gz},n[e]=function(){return this.isValid?"Interval { start: "+this.s.toISO()+", end: "+this.e.toISO()+" }":"Interval { Invalid, reason: "+this.invalidReason+" }"},n.toLocaleString=function(e,t){return void 0===e&&(e=zD),void 0===t&&(t={}),this.isValid?GB.create(this.s.loc.clone(t),e).formatInterval(this):Gz},n.toISO=function(e){return this.isValid?this.s.toISO(e)+"/"+this.e.toISO(e):Gz},n.toISODate=function(){return this.isValid?this.s.toISODate()+"/"+this.e.toISODate():Gz},n.toISOTime=function(e){return this.isValid?this.s.toISOTime(e)+"/"+this.e.toISOTime(e):Gz},n.toFormat=function(e,t){var n=(void 0===t?{}:t).separator,r=void 0===n?" – ":n;return this.isValid?""+this.s.toFormat(e)+r+this.e.toFormat(e):Gz},n.toDuration=function(e,t){return this.isValid?this.e.diff(this.s,e,t):Vz.invalid(this.invalidReason)},n.mapEndpoints=function(e){return t.fromDateTimes(e(this.s),e(this.e))},gD(t,[{key:"start",get:function(){return this.isValid?this.s:null}},{key:"end",get:function(){return this.isValid?this.e:null}},{key:"isValid",get:function(){return null===this.invalidReason}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}}]),t}(Symbol.for("nodejs.util.inspect.custom")),qz=function(){function e(){}return e.hasDST=function(e){void 0===e&&(e=UL.defaultZone);var t=LF.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset},e.isValidIANAZone=function(e){return pL.isValidZone(e)},e.normalizeZone=function(e){return PL(e,UL.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)||TL.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)||TL.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)||TL.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||TL.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||TL.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)||TL.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)||TL.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 TL.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 TL.create(r,null,"gregory").eras(e)},e.features=function(){return{relative:oB(),localeWeek:sB()}},e}();function Kz(e,t){var n=function(e){return e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf()},r=n(t)-n(e);return Math.floor(Vz.fromMillis(r).as("days"))}function Jz(e,t,n,r){var i=function(e,t,n){for(var r,i,o=[["years",function(e,t){return t.year-e.year}],["quarters",function(e,t){return t.quarter-e.quarter+4*(t.year-e.year)}],["months",function(e,t){return t.month-e.month+12*(t.year-e.year)}],["weeks",function(e,t){var n=Kz(e,t);return(n-n%7)/7}],["days",Kz]],s={},a=e,l=0,c=o;l<c.length;l++){var u=c[l],d=u[0],p=u[1];n.indexOf(d)>=0&&(r=d,s[d]=p(e,t),(i=a.plus(s))>t?(s[d]--,(e=a.plus(s))>t&&(i=e,s[d]--,e=a.plus(s))):e=i)}return[e,s,i,r]}(e,t,n),o=i[0],s=i[1],a=i[2],l=i[3],c=t-o,u=n.filter((function(e){return["hours","minutes","seconds","milliseconds"].indexOf(e)>=0}));if(0===u.length){var d;if(a<t)a=o.plus(((d={})[l]=1,d));a!==o&&(s[l]=(s[l]||0)+c/(a-o))}var p,h=Vz.fromObject(s,r);return u.length>0?(p=Vz.fromMillis(c,r)).shiftTo.apply(p,u).plus(h):h}var Qz={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Yz={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Xz=Qz.hanidec.replace(/[\[|\]]/g,"").split("");function $z(e,t){var n=e.numberingSystem;return void 0===t&&(t=""),new RegExp(""+Qz[n||"latn"]+t)}function Zz(e,t){return void 0===t&&(t=function(e){return e}),{regex:e,deser:function(e){var n=e[0];return t(function(e){var t=parseInt(e,10);if(isNaN(t)){t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(-1!==e[n].search(Qz.hanidec))t+=Xz.indexOf(e[n]);else for(var i in Yz){var o=Yz[i],s=o[0],a=o[1];r>=s&&r<=a&&(t+=r-s)}}return parseInt(t,10)}return t}(n))}}}var eF="[ "+String.fromCharCode(160)+"]",tF=new RegExp(eF,"g");function nF(e){return e.replace(/\./g,"\\.?").replace(tF,eF)}function rF(e){return e.replace(/\./g,"").replace(tF," ").toLowerCase()}function iF(e,t){return null===e?null:{regex:RegExp(e.map(nF).join("|")),deser:function(n){var r=n[0];return e.findIndex((function(e){return rF(r)===rF(e)}))+t}}}function oF(e,t){return{regex:e,deser:function(e){return AB(e[1],e[2])},groups:t}}function sF(e){return{regex:e,deser:function(e){return e[0]}}}var aF={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};var lF=null;function cF(e,t){var n;return(n=Array.prototype).concat.apply(n,e.map((function(e){return function(e,t){if(e.literal)return e;var n=dF(GB.macroTokenToFormatOpts(e.val),t);return null==n||n.includes(void 0)?e:n}(e,t)})))}function uF(e,t,n){var r=cF(GB.parseFormat(n),e),i=r.map((function(t){return n=t,i=$z(r=e),o=$z(r,"{2}"),s=$z(r,"{3}"),a=$z(r,"{4}"),l=$z(r,"{6}"),c=$z(r,"{1,2}"),u=$z(r,"{1,3}"),d=$z(r,"{1,6}"),p=$z(r,"{1,9}"),h=$z(r,"{2,4}"),f=$z(r,"{4,6}"),m=function(e){return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:function(e){return e[0]},literal:!0};var t},g=function(e){if(n.literal)return m(e);switch(e.val){case"G":return iF(r.eras("short"),0);case"GG":return iF(r.eras("long"),0);case"y":return Zz(d);case"yy":case"kk":return Zz(h,wB);case"yyyy":case"kkkk":return Zz(a);case"yyyyy":return Zz(f);case"yyyyyy":return Zz(l);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Zz(c);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Zz(o);case"MMM":return iF(r.months("short",!0),1);case"MMMM":return iF(r.months("long",!0),1);case"LLL":return iF(r.months("short",!1),1);case"LLLL":return iF(r.months("long",!1),1);case"o":case"S":return Zz(u);case"ooo":case"SSS":return Zz(s);case"u":return sF(p);case"uu":return sF(c);case"uuu":case"E":case"c":return Zz(i);case"a":return iF(r.meridiems(),0);case"EEE":return iF(r.weekdays("short",!1),1);case"EEEE":return iF(r.weekdays("long",!1),1);case"ccc":return iF(r.weekdays("short",!0),1);case"cccc":return iF(r.weekdays("long",!0),1);case"Z":case"ZZ":return oF(new RegExp("([+-]"+c.source+")(?::("+o.source+"))?"),2);case"ZZZ":return oF(new RegExp("([+-]"+c.source+")("+o.source+")?"),2);case"z":return sF(/[a-z_+-/]{1,256}?/i);case" ":return sF(/[^\S\n\r]/);default:return m(e)}}(n)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"},g.token=n,g;var n,r,i,o,s,a,l,c,u,d,p,h,f,m,g})),o=i.find((function(e){return e.invalidReason}));if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};var s=function(e){var t=e.map((function(e){return e.regex})).reduce((function(e,t){return e+"("+t.source+")"}),"");return["^"+t+"$",e]}(i),a=s[0],l=s[1],c=RegExp(a,"i"),u=function(e,t,n){var r=e.match(t);if(r){var i={},o=1;for(var s in n)if(lB(n,s)){var a=n[s],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+l))),o+=l}return[r,i]}return[r,{}]}(t,c,l),d=u[0],p=u[1],h=p?function(e){var t,n=null;nB(e.z)||(n=pL.create(e.z)),nB(e.Z)||(n||(n=new IL(e.Z)),t=e.Z),nB(e.q)||(e.M=3*(e.q-1)+1),nB(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),nB(e.u)||(e.S=fB(e.u));var r=Object.keys(e).reduce((function(t,n){var r=function(e){switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}}(n);return r&&(t[r]=e[n]),t}),{});return[r,n,t]}(p):[null,null,void 0],f=h[0],m=h[1],g=h[2];if(lB(p,"a")&&lB(p,"H"))throw new PD("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:c,rawMatches:d,matches:p,result:f,zone:m,specificOffset:g}}function dF(e,t){if(!e)return null;var n=GB.create(t,e).dtFormatter((lF||(lF=LF.fromMillis(1555555555555)),lF)),r=n.formatToParts(),i=n.resolvedOptions();return r.map((function(t){return function(e,t,n){var r=e.type,i=e.value;if("literal"===r){var o=/^\s+$/.test(i);return{literal:!o,val:o?" ":i}}var s=t[r],a=r;"hour"===r&&(a=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":n.hour12?"hour12":"hour24");var l=aF[a];if("object"==typeof l&&(l=l[s]),l)return{literal:!1,val:l}}(t,e,i)}))}var pF="Invalid DateTime",hF=864e13;function fF(e){return new jL("unsupported zone",'the zone "'+e.name+'" is not supported')}function mF(e){return null===e.weekData&&(e.weekData=QL(e.c)),e.weekData}function gF(e){return null===e.localWeekData&&(e.localWeekData=QL(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function vF(e,t){var n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new LF(vD({},n,t,{old:n}))}function yF(e,t,n){var r=e-6e4*t,i=n.offset(r);if(t===i)return[r,t];r-=6e4*(i-t);var o=n.offset(r);return i===o?[r,i]:[e-6e4*Math.min(i,o),Math.max(i,o)]}function bF(e,t){var n=new Date(e+=6e4*t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function SF(e,t,n){return yF(bB(e),t,n)}function xF(e,t){var n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),o=vD({},e.c,{year:r,month:i,day:Math.min(e.c.day,yB(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)}),s=Vz.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=yF(bB(o),n,e.zone),l=a[0],c=a[1];return 0!==s&&(l+=s,c=e.zone.offset(l)),{ts:l,o:c}}function wF(e,t,n,r,i,o){var s=n.setZone,a=n.zone;if(e&&0!==Object.keys(e).length||t){var l=t||a,c=LF.fromObject(e,vD({},n,{zone:l,specificOffset:o}));return s?c:c.setZone(a)}return LF.invalid(new jL("unparsable",'the input "'+i+"\" can't be parsed as "+r))}function CF(e,t,n){return void 0===n&&(n=!0),e.isValid?GB.create(TL.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function AF(e,t){var n=e.c.year>9999||e.c.year<0,r="";return n&&e.c.year>=0&&(r+="+"),r+=dB(e.c.year,n?6:4),t?(r+="-",r+=dB(e.c.month),r+="-",r+=dB(e.c.day)):(r+=dB(e.c.month),r+=dB(e.c.day)),r}function EF(e,t,n,r,i,o){var s=dB(e.c.hour);return t?(s+=":",s+=dB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=":")):s+=dB(e.c.minute),0===e.c.millisecond&&0===e.c.second&&n||(s+=dB(e.c.second),0===e.c.millisecond&&r||(s+=".",s+=dB(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!o?s+="Z":e.o<0?(s+="-",s+=dB(Math.trunc(-e.o/60)),s+=":",s+=dB(Math.trunc(-e.o%60))):(s+="+",s+=dB(Math.trunc(e.o/60)),s+=":",s+=dB(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}var MF={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},TF={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},_F={ordinal:1,hour:0,minute:0,second:0,millisecond:0},IF=["year","month","day","hour","minute","second","millisecond"],RF=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],PF=["year","ordinal","hour","minute","second","millisecond"];function kF(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function(e){var t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new kD(e);return t}(e)}}function OF(e,t){var n,r,i=PL(t.zone,UL.defaultZone),o=TL.fromObject(t),s=UL.now();if(nB(e.year))n=s;else{for(var a=0,l=IF;a<l.length;a++){var c=l[a];nB(e[c])&&(e[c]=MF[c])}var u=eB(e)||tB(e);if(u)return LF.invalid(u);var d=SF(e,i.offset(s),i);n=d[0],r=d[1]}return new LF({ts:n,zone:i,loc:o,o:r})}function NF(e,t,n){var r=!!nB(n.round)||n.round,i=function(e,i){return e=mB(e,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(e,i)},o=function(r){return n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r)};if(n.unit)return i(o(n.unit),n.unit);for(var s,a=MD(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 DF(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 LF=function(e){function t(e){var t=e.zone||UL.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new jL("invalid input"):null)||(t.isValid?null:fF(t));this.ts=nB(e.ts)?UL.now():e.ts;var r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t)){var o=[e.old.c,e.old.o];r=o[0],i=o[1]}else{var s=t.offset(this.ts);r=bF(this.ts,s),r=(n=Number.isNaN(r.year)?new jL("invalid input"):null)?null:r,i=n?null:s}this._zone=t,this.loc=e.loc||TL.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=DF(arguments),t=e[0],n=e[1],r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],c=n[6];return OF({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:c},t)},t.utc=function(){var e=DF(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=IL.utcInstance,OF({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:c},t)},t.fromJSDate=function(e,n){void 0===n&&(n={});var r=function(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?e.valueOf():NaN;if(Number.isNaN(r))return t.invalid("invalid input");var i=PL(n.zone,UL.defaultZone);return i.isValid?new t({ts:r,zone:i,loc:TL.fromObject(n)}):t.invalid(fF(i))},t.fromMillis=function(e,n){if(void 0===n&&(n={}),rB(e))return e<-864e13||e>hF?t.invalid("Timestamp out of range"):new t({ts:e,zone:PL(n.zone,UL.defaultZone),loc:TL.fromObject(n)});throw new OD("fromMillis requires a numerical input, but received a "+typeof e+" with value "+e)},t.fromSeconds=function(e,n){if(void 0===n&&(n={}),rB(e))return new t({ts:1e3*e,zone:PL(n.zone,UL.defaultZone),loc:TL.fromObject(n)});throw new OD("fromSeconds requires a numerical input")},t.fromObject=function(e,n){void 0===n&&(n={}),e=e||{};var r=PL(n.zone,UL.defaultZone);if(!r.isValid)return t.invalid(fF(r));var i=TL.fromObject(n),o=MB(e,kF),s=ZL(o,i),a=s.minDaysInFirstWeek,l=s.startOfWeek,c=UL.now(),u=nB(n.specificOffset)?r.offset(c):n.specificOffset,d=!nB(o.ordinal),p=!nB(o.year),h=!nB(o.month)||!nB(o.day),f=p||h,m=o.weekYear||o.weekNumber;if((f||d)&&m)throw new PD("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&d)throw new PD("Can't mix ordinal dates with month/day");var g,v,y=m||o.weekday&&!f,b=bF(c,u);y?(g=RF,v=TF,b=QL(b,a,l)):d?(g=PF,v=_F,b=XL(b)):(g=IF,v=MF);for(var S,x=!1,w=MD(g);!(S=w()).done;){var C=S.value;nB(o[C])?o[C]=x?v[C]:b[C]:x=!0}var A=y?function(e,t,n){void 0===t&&(t=4),void 0===n&&(n=1);var r=iB(e.weekYear),i=uB(e.weekNumber,1,xB(e.weekYear,t,n)),o=uB(e.weekday,1,7);return r?i?!o&&GL("weekday",e.weekday):GL("week",e.weekNumber):GL("weekYear",e.weekYear)}(o,a,l):d?function(e){var t=iB(e.year),n=uB(e.ordinal,1,vB(e.year));return t?!n&&GL("ordinal",e.ordinal):GL("year",e.year)}(o):eB(o),E=A||tB(o);if(E)return t.invalid(E);var M=SF(y?YL(o,a,l):d?$L(o):o,u,r),T=new t({ts:M[0],zone:r,o:M[1],loc:i});return o.weekday&&f&&e.weekday!==T.weekday?t.invalid("mismatched weekday","you can't specify both a weekday of "+o.weekday+" and a date of "+T.toISO()):T},t.fromISO=function(e,t){void 0===t&&(t={});var n=function(e){return JB(e,[Sz,Az],[xz,Ez],[wz,Mz],[Cz,Tz])}(e);return wF(n[0],n[1],t,"ISO 8601",e)},t.fromRFC2822=function(e,t){void 0===t&&(t={});var n=function(e){return JB(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[hz,fz])}(e);return wF(n[0],n[1],t,"RFC 2822",e)},t.fromHTTP=function(e,t){void 0===t&&(t={});var n=function(e){return JB(e,[mz,yz],[gz,yz],[vz,bz])}(e);return wF(n[0],n[1],t,"HTTP",t)},t.fromFormat=function(e,n,r){if(void 0===r&&(r={}),nB(e)||nB(n))throw new OD("fromFormat requires an input string and a format");var i=r,o=i.locale,s=void 0===o?null:o,a=i.numberingSystem,l=void 0===a?null:a,c=function(e,t,n){var r=uF(e,t,n);return[r.result,r.zone,r.specificOffset,r.invalidReason]}(TL.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),e,n),u=c[0],d=c[1],p=c[2],h=c[3];return h?t.invalid(h):wF(u,d,r,"format "+n,e,p)},t.fromString=function(e,n,r){return void 0===r&&(r={}),t.fromFormat(e,n,r)},t.fromSQL=function(e,t){void 0===t&&(t={});var n=function(e){return JB(e,[Iz,Az],[Rz,Pz])}(e);return wF(n[0],n[1],t,"SQL",e)},t.invalid=function(e,n){if(void 0===n&&(n=null),!e)throw new OD("need to specify a reason the DateTime is invalid");var r=e instanceof jL?e:new jL(e,n);if(UL.throwOnInvalid)throw new _D(r);return new t({invalid:r})},t.isDateTime=function(e){return e&&e.isLuxonDateTime||!1},t.parseFormatForOpts=function(e,t){void 0===t&&(t={});var n=dF(e,TL.fromObject(t));return n?n.map((function(e){return e?e.val:null})).join(""):null},t.expandFormat=function(e,t){return void 0===t&&(t={}),cF(GB.parseFormat(e),TL.fromObject(t)).map((function(e){return e.val})).join("")};var n=t.prototype;return n.get=function(e){return this[e]},n.getPossibleOffsets=function(){if(!this.isValid||this.isOffsetFixed)return[this];var e=864e5,t=6e4,n=bB(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),o=this.zone.offset(n-r*t),s=this.zone.offset(n-i*t);if(o===s)return[this];var a=n-o*t,l=n-s*t,c=bF(a,o),u=bF(l,s);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[vF(this,{ts:a}),vF(this,{ts:l})]:[this]},n.resolvedLocaleOptions=function(e){void 0===e&&(e={});var t=GB.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t.locale,numberingSystem:t.numberingSystem,outputCalendar:t.calendar}},n.toUTC=function(e,t){return void 0===e&&(e=0),void 0===t&&(t={}),this.setZone(IL.instance(e),t)},n.toLocal=function(){return this.setZone(UL.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=PL(e,UL.defaultZone)).equals(this.zone))return this;if(e.isValid){var l=this.ts;if(o||a){var c=e.offset(this.ts);l=SF(this.toObject(),c,e)[0]}return vF(this,{ts:l,zone:e})}return t.invalid(fF(e))},n.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.outputCalendar;return vF(this,{loc:this.loc.clone({locale:n,numberingSystem:r,outputCalendar:i})})},n.setLocale=function(e){return this.reconfigure({locale:e})},n.set=function(e){if(!this.isValid)return this;var t,n=MB(e,kF),r=ZL(n,this.loc),i=r.minDaysInFirstWeek,o=r.startOfWeek,s=!nB(n.weekYear)||!nB(n.weekNumber)||!nB(n.weekday),a=!nB(n.ordinal),l=!nB(n.year),c=!nB(n.month)||!nB(n.day),u=l||c,d=n.weekYear||n.weekNumber;if((u||a)&&d)throw new PD("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&a)throw new PD("Can't mix ordinal dates with month/day");s?t=YL(vD({},QL(this.c,i,o),n),i,o):nB(n.ordinal)?(t=vD({},this.toObject(),n),nB(n.day)&&(t.day=Math.min(yB(t.year,t.month),t.day))):t=$L(vD({},XL(this.c),n));var p=SF(t,this.o,this.zone);return vF(this,{ts:p[0],o:p[1]})},n.plus=function(e){return this.isValid?vF(this,xF(this,Vz.fromDurationLike(e))):this},n.minus=function(e){return this.isValid?vF(this,xF(this,Vz.fromDurationLike(e).negate())):this},n.startOf=function(e,t){var n=(void 0===t?{}:t).useLocaleWeeks,r=void 0!==n&&n;if(!this.isValid)return this;var i={},o=Vz.normalizeUnit(e);switch(o){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0}if("weeks"===o)if(r){var s=this.loc.getStartOfWeek();this.weekday<s&&(i.weekNumber=this.weekNumber-1),i.weekday=s}else i.weekday=1;if("quarters"===o){var a=Math.ceil(this.month/3);i.month=3*(a-1)+1}return this.set(i)},n.endOf=function(e,t){var n;return this.isValid?this.plus((n={},n[e]=1,n)).startOf(e,t).minus(1):this},n.toFormat=function(e,t){return void 0===t&&(t={}),this.isValid?GB.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):pF},n.toLocaleString=function(e,t){return void 0===e&&(e=zD),void 0===t&&(t={}),this.isValid?GB.create(this.loc.clone(t),e).formatDateTime(this):pF},n.toLocaleParts=function(e){return void 0===e&&(e={}),this.isValid?GB.create(this.loc.clone(e),e).formatDateTimeParts(this):[]},n.toISO=function(e){var t=void 0===e?{}:e,n=t.format,r=void 0===n?"extended":n,i=t.suppressSeconds,o=void 0!==i&&i,s=t.suppressMilliseconds,a=void 0!==s&&s,l=t.includeOffset,c=void 0===l||l,u=t.extendedZone,d=void 0!==u&&u;if(!this.isValid)return null;var p="extended"===r,h=AF(this,p);return h+="T",h+=EF(this,p,o,a,c,d)},n.toISODate=function(e){var t=(void 0===e?{}:e).format,n=void 0===t?"extended":t;return this.isValid?AF(this,"extended"===n):null},n.toISOWeekDate=function(){return CF(this,"kkkk-'W'WW-c")},n.toISOTime=function(e){var t=void 0===e?{}:e,n=t.suppressMilliseconds,r=void 0!==n&&n,i=t.suppressSeconds,o=void 0!==i&&i,s=t.includeOffset,a=void 0===s||s,l=t.includePrefix,c=void 0!==l&&l,u=t.extendedZone,d=void 0!==u&&u,p=t.format,h=void 0===p?"extended":p;return this.isValid?(c?"T":"")+EF(this,"extended"===h,o,r,a,d):null},n.toRFC2822=function(){return CF(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},n.toHTTP=function(){return CF(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},n.toSQLDate=function(){return this.isValid?AF(this,!0):null},n.toSQLTime=function(e){var t=void 0===e?{}:e,n=t.includeOffset,r=void 0===n||n,i=t.includeZone,o=void 0!==i&&i,s=t.includeOffsetSpace,a="HH:mm:ss.SSS";return(o||r)&&((void 0===s||s)&&(a+=" "),o?a+="z":r&&(a+="ZZ")),CF(this,a,!0)},n.toSQL=function(e){return void 0===e&&(e={}),this.isValid?this.toSQLDate()+" "+this.toSQLTime(e):null},n.toString=function(){return this.isValid?this.toISO():pF},n[e]=function(){return this.isValid?"DateTime { ts: "+this.toISO()+", zone: "+this.zone.name+", locale: "+this.locale+" }":"DateTime { Invalid, reason: "+this.invalidReason+" }"},n.valueOf=function(){return this.toMillis()},n.toMillis=function(){return this.isValid?this.ts:NaN},n.toSeconds=function(){return this.isValid?this.ts/1e3:NaN},n.toUnixInteger=function(){return this.isValid?Math.floor(this.ts/1e3):NaN},n.toJSON=function(){return this.toISO()},n.toBSON=function(){return this.toJSDate()},n.toObject=function(e){if(void 0===e&&(e={}),!this.isValid)return{};var t=vD({},this.c);return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t},n.toJSDate=function(){return new Date(this.isValid?this.ts:NaN)},n.diff=function(e,t,n){if(void 0===t&&(t="milliseconds"),void 0===n&&(n={}),!this.isValid||!e.isValid)return Vz.invalid("created by diffing an invalid DateTime");var r,i=vD({locale:this.locale,numberingSystem:this.numberingSystem},n),o=(r=t,Array.isArray(r)?r:[r]).map(Vz.normalizeUnit),s=e.valueOf()>this.valueOf(),a=Jz(s?this:e,s?e:this,o,i);return s?a.negate():a},n.diffNow=function(e,n){return void 0===e&&(e="milliseconds"),void 0===n&&(n={}),this.diff(t.now(),e,n)},n.until=function(e){return this.isValid?Wz.fromDateTimes(this,e):this},n.hasSame=function(e,t,n){if(!this.isValid)return!1;var r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)},n.equals=function(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},n.toRelative=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var n=e.base||t.fromObject({},{zone:this.zone}),r=e.padding?this<n?-e.padding:e.padding:0,i=["years","months","days","hours","minutes","seconds"],o=e.unit;return Array.isArray(e.unit)&&(i=e.unit,o=void 0),NF(n,this.plus(r),vD({},e,{numeric:"always",units:i,unit:o}))},n.toRelativeCalendar=function(e){return void 0===e&&(e={}),this.isValid?NF(e.base||t.fromObject({},{zone:this.zone}),this,vD({},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 OD("min requires all arguments be DateTimes");return aB(n,(function(e){return e.valueOf()}),Math.min)},t.max=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];if(!n.every(t.isDateTime))throw new OD("max requires all arguments be DateTimes");return aB(n,(function(e){return e.valueOf()}),Math.max)},t.fromFormatExplain=function(e,t,n){void 0===n&&(n={});var r=n,i=r.locale,o=void 0===i?null:i,s=r.numberingSystem,a=void 0===s?null:s;return uF(TL.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)},gD(t,[{key:"isValid",get:function(){return null===this.invalid}},{key:"invalidReason",get:function(){return this.invalid?this.invalid.reason:null}},{key:"invalidExplanation",get:function(){return this.invalid?this.invalid.explanation:null}},{key:"locale",get:function(){return this.isValid?this.loc.locale:null}},{key:"numberingSystem",get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:"outputCalendar",get:function(){return this.isValid?this.loc.outputCalendar:null}},{key:"zone",get:function(){return this._zone}},{key:"zoneName",get:function(){return this.isValid?this.zone.name:null}},{key:"year",get:function(){return this.isValid?this.c.year:NaN}},{key:"quarter",get:function(){return this.isValid?Math.ceil(this.c.month/3):NaN}},{key:"month",get:function(){return this.isValid?this.c.month:NaN}},{key:"day",get:function(){return this.isValid?this.c.day:NaN}},{key:"hour",get:function(){return this.isValid?this.c.hour:NaN}},{key:"minute",get:function(){return this.isValid?this.c.minute:NaN}},{key:"second",get:function(){return this.isValid?this.c.second:NaN}},{key:"millisecond",get:function(){return this.isValid?this.c.millisecond:NaN}},{key:"weekYear",get:function(){return this.isValid?mF(this).weekYear:NaN}},{key:"weekNumber",get:function(){return this.isValid?mF(this).weekNumber:NaN}},{key:"weekday",get:function(){return this.isValid?mF(this).weekday:NaN}},{key:"isWeekend",get:function(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}},{key:"localWeekday",get:function(){return this.isValid?gF(this).weekday:NaN}},{key:"localWeekNumber",get:function(){return this.isValid?gF(this).weekNumber:NaN}},{key:"localWeekYear",get:function(){return this.isValid?gF(this).weekYear:NaN}},{key:"ordinal",get:function(){return this.isValid?XL(this.c).ordinal:NaN}},{key:"monthShort",get:function(){return this.isValid?qz.months("short",{locObj:this.loc})[this.month-1]:null}},{key:"monthLong",get:function(){return this.isValid?qz.months("long",{locObj:this.loc})[this.month-1]:null}},{key:"weekdayShort",get:function(){return this.isValid?qz.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}},{key:"weekdayLong",get:function(){return this.isValid?qz.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}},{key:"offset",get:function(){return this.isValid?+this.o:NaN}},{key:"offsetNameShort",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}},{key:"offsetNameLong",get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}},{key:"isOffsetFixed",get:function(){return this.isValid?this.zone.isUniversal:null}},{key:"isInDST",get:function(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function(){return gB(this.year)}},{key:"daysInMonth",get:function(){return yB(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?vB(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?xB(this.weekYear):NaN}},{key:"weeksInLocalWeekYear",get:function(){return this.isValid?xB(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}}],[{key:"DATE_SHORT",get:function(){return zD}},{key:"DATE_MED",get:function(){return FD}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return UD}},{key:"DATE_FULL",get:function(){return jD}},{key:"DATE_HUGE",get:function(){return HD}},{key:"TIME_SIMPLE",get:function(){return VD}},{key:"TIME_WITH_SECONDS",get:function(){return GD}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return WD}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return qD}},{key:"TIME_24_SIMPLE",get:function(){return KD}},{key:"TIME_24_WITH_SECONDS",get:function(){return JD}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return QD}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return YD}},{key:"DATETIME_SHORT",get:function(){return XD}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return $D}},{key:"DATETIME_MED",get:function(){return ZD}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return eL}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return tL}},{key:"DATETIME_FULL",get:function(){return nL}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return rL}},{key:"DATETIME_HUGE",get:function(){return iL}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return oL}}]),t}(Symbol.for("nodejs.util.inspect.custom"));function BF(e){if(LF.isDateTime(e))return e;if(e&&e.valueOf&&rB(e.valueOf()))return LF.fromJSDate(e);if(e&&"object"==typeof e)return LF.fromObject(e);throw new OD("Unknown datetime argument: "+e+", of type "+typeof e)}fD.DateTime=LF,fD.Duration=Vz,fD.FixedOffsetZone=IL,fD.IANAZone=pL,fD.Info=qz,fD.Interval=Wz,fD.InvalidZone=RL,fD.Settings=UL,fD.SystemZone=lL,fD.VERSION="3.4.4",fD.Zone=sL;c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");function zF(e,t){let[n,r]=(0,c.useState)(e),i=Ja(e);return Ka((()=>r(i.current)),[i,r,...t]),n}var FF=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(FF||{}),UF=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(UF||{}),jF=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(jF||{}),HF=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.SetDisabled=2]="SetDisabled",e[e.SetOrientation=3]="SetOrientation",e[e.GoToOption=4]="GoToOption",e[e.Search=5]="Search",e[e.ClearSearch=6]="ClearSearch",e[e.RegisterOption=7]="RegisterOption",e[e.UnregisterOption=8]="UnregisterOption",e))(HF||{});function VF(e,t=(e=>e)){let n=null!==e.activeOptionIndex?e.options[e.activeOptionIndex]:null,r=El(t(e.options.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{options:r,activeOptionIndex:i}}let GF={1:e=>e.disabled||1===e.listboxState?e:{...e,activeOptionIndex:null,listboxState:1},0(e){if(e.disabled||0===e.listboxState)return e;let t=e.activeOptionIndex,{value:n,mode:r,compare:i}=e.propsRef.current,o=e.options.findIndex((e=>{let t=e.dataRef.current.value;return La(r,{1:()=>n.some((e=>i(e,t))),0:()=>i(n,t)})}));return-1!==o&&(t=o),{...e,listboxState:0,activeOptionIndex:t}},2:(e,t)=>e.disabled===t.disabled?e:{...e,disabled:t.disabled},3:(e,t)=>e.orientation===t.orientation?e:{...e,orientation:t.orientation},4(e,t){var n;if(e.disabled||1===e.listboxState)return e;let r=VF(e),i=Td(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},5:(e,t)=>{if(e.disabled||1===e.listboxState)return e;let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeOptionIndex?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find((e=>{var t;return!e.dataRef.current.disabled&&(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))})),o=i?e.options.indexOf(i):-1;return-1===o||o===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:o,activationTrigger:1}},6:e=>e.disabled||1===e.listboxState||""===e.searchQuery?e:{...e,searchQuery:""},7:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=VF(e,(e=>[...e,n]));if(null===e.activeOptionIndex){let{value:i,mode:o,compare:s}=e.propsRef.current,a=t.dataRef.current.value;La(o,{1:()=>i.some((e=>s(e,a))),0:()=>s(i,a)})&&(r.activeOptionIndex=r.options.indexOf(n))}return{...e,...r}},8:(e,t)=>{let n=VF(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},WF=(0,c.createContext)(null);function qF(e){let t=(0,c.useContext)(WF);if(null===t){let t=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,qF),t}return t}function KF(e,t){return La(t.type,GF,e,t)}WF.displayName="ListboxContext";let JF=c.Fragment,QF=Va((function(e,n){let{value:r,defaultValue:i,name:o,onChange:s,by:a=((e,t)=>e===t),disabled:l=!1,horizontal:u=!1,multiple:d=!1,...p}=e;const h=u?"horizontal":"vertical";let f=$a(n),[m,g]=Hf(r,s,i),v=(0,c.useReducer)(KF,{listboxState:1,propsRef:{current:{value:m,onChange:g,mode:d?1:0,compare:Qa("string"==typeof a?(e,t)=>{let n=a;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:a)}},labelRef:(0,c.createRef)(),buttonRef:(0,c.createRef)(),optionsRef:(0,c.createRef)(),disabled:l,orientation:h,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1}),[{listboxState:y,propsRef:b,optionsRef:S,buttonRef:x},w]=v;b.current.value=m,b.current.mode=d?1:0,Ka((()=>{b.current.onChange=e=>La(b.current.mode,{0:()=>g(e),1(){let t=b.current.value.slice(),{compare:n}=b.current,r=t.findIndex((t=>n(t,e)));return-1===r?t.push(e):t.splice(r,1),g(t)}})}),[g,b]),Ka((()=>w({type:2,disabled:l})),[l]),Ka((()=>w({type:3,orientation:h})),[h]),cc([x,S],((e,t)=>{var n;w({type:1}),xl(t,Sl.Loose)||(e.preventDefault(),null==(n=x.current)||n.focus())}),0===y);let C=(0,c.useMemo)((()=>({open:0===y,disabled:l,value:m})),[y,l,m]),A={ref:f};return t(c).createElement(WF.Provider,{value:v},t(c).createElement(ic,{value:La(y,{0:nc.Open,1:nc.Closed})},null!=o&&null!=m&&zf({[o]:m}).map((([e,n])=>t(c).createElement(cl,{features:ll.Hidden,...Ga({key:e,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:e,value:n})}))),Ua({ourProps:A,theirProps:p,slot:C,defaultTag:JF,name:"Listbox"})))})),YF=Va((function(e,t){var n;let[r,i]=qF("Listbox.Button"),o=$a(r.buttonRef,t),s=`headlessui-listbox-button-${al()}`,a=Ic(),l=Qa((e=>{switch(e.key){case el.Space:case el.Enter:case el.ArrowDown:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Md.First})}));break;case el.ArrowUp:e.preventDefault(),i({type:0}),a.nextFrame((()=>{r.propsRef.current.value||i({type:4,focus:Md.Last})}))}})),u=Qa((e=>{if(e.key===el.Space)e.preventDefault()})),d=Qa((e=>{if(tl(e.currentTarget))return e.preventDefault();0===r.listboxState?(i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(e.preventDefault(),i({type:0}))})),p=zF((()=>{if(r.labelRef.current)return[r.labelRef.current.id,s].join(" ")}),[r.labelRef.current,s]),h=(0,c.useMemo)((()=>({open:0===r.listboxState,disabled:r.disabled,value:r.propsRef.current.value})),[r]),f=e;return Ua({ourProps:{ref:o,id:s,type:Rd(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.optionsRef.current)?void 0:n.id,"aria-expanded":r.disabled?void 0:0===r.listboxState,"aria-labelledby":p,disabled:r.disabled,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:f,slot:h,defaultTag:"button",name:"Listbox.Button"})})),XF=Va((function(e,t){let[n]=qF("Listbox.Label"),r=`headlessui-listbox-label-${al()}`;return Ua({ourProps:{ref:$a(n.labelRef,t),id:r,onClick:Qa((()=>{var e;return null==(e=n.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))},theirProps:e,slot:(0,c.useMemo)((()=>({open:0===n.listboxState,disabled:n.disabled})),[n]),defaultTag:"label",name:"Listbox.Label"})})),$F=za.RenderStrategy|za.Static,ZF=Va((function(e,t){var n;let[r,i]=qF("Listbox.Options"),o=$a(r.optionsRef,t),s=`headlessui-listbox-options-${al()}`,a=Ic(),l=Ic(),u=rc(),d=null!==u?u===nc.Open:0===r.listboxState;(0,c.useEffect)((()=>{var e;let t=r.optionsRef.current;!t||0===r.listboxState&&t!==(null==(e=pl(t))?void 0:e.activeElement)&&t.focus({preventScroll:!0})}),[r.listboxState,r.optionsRef]);let p=Qa((e=>{switch(l.dispose(),e.key){case el.Space:if(""!==r.searchQuery)return e.preventDefault(),e.stopPropagation(),i({type:5,value:e.key});case el.Enter:if(e.preventDefault(),e.stopPropagation(),null!==r.activeOptionIndex){let{dataRef:e}=r.options[r.activeOptionIndex];r.propsRef.current.onChange(e.current.value)}0===r.propsRef.current.mode&&(i({type:1}),dl().nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})})));break;case La(r.orientation,{vertical:el.ArrowDown,horizontal:el.ArrowRight}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Md.Next});case La(r.orientation,{vertical:el.ArrowUp,horizontal:el.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Md.Previous});case el.Home:case el.PageUp:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Md.First});case el.End:case el.PageDown:return e.preventDefault(),e.stopPropagation(),i({type:4,focus:Md.Last});case el.Escape:return e.preventDefault(),e.stopPropagation(),i({type:1}),a.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));case el.Tab:e.preventDefault(),e.stopPropagation();break;default:1===e.key.length&&(i({type:5,value:e.key}),l.setTimeout((()=>i({type:6})),350))}})),h=zF((()=>{var e,t,n;return null!=(n=null==(e=r.labelRef.current)?void 0:e.id)?n:null==(t=r.buttonRef.current)?void 0:t.id}),[r.labelRef.current,r.buttonRef.current]),f=(0,c.useMemo)((()=>({open:0===r.listboxState})),[r]),m=e;return Ua({ourProps:{"aria-activedescendant":null===r.activeOptionIndex||null==(n=r.options[r.activeOptionIndex])?void 0:n.id,"aria-multiselectable":1===r.propsRef.current.mode||void 0,"aria-labelledby":h,"aria-orientation":r.orientation,id:s,onKeyDown:p,role:"listbox",tabIndex:0,ref:o},theirProps:m,slot:f,defaultTag:"ul",features:$F,visible:d,name:"Listbox.Options"})})),eU=Va((function(e,t){let{disabled:n=!1,value:r,...i}=e,[o,s]=qF("Listbox.Option"),a=`headlessui-listbox-option-${al()}`,l=null!==o.activeOptionIndex&&o.options[o.activeOptionIndex].id===a,{value:u,compare:d}=o.propsRef.current,p=La(o.propsRef.current.mode,{1:()=>u.some((e=>d(e,r))),0:()=>d(u,r)}),h=(0,c.useRef)(null),f=$a(t,h);Ka((()=>{if(0!==o.listboxState||!l||0===o.activationTrigger)return;let e=dl();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=h.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[h,l,o.listboxState,o.activationTrigger,o.activeOptionIndex]);let m=(0,c.useRef)({disabled:n,value:r,domRef:h});Ka((()=>{m.current.disabled=n}),[m,n]),Ka((()=>{m.current.value=r}),[m,r]),Ka((()=>{var e,t;m.current.textValue=null==(t=null==(e=h.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[m,h]);let g=Qa((()=>o.propsRef.current.onChange(r)));Ka((()=>(s({type:7,id:a,dataRef:m}),()=>s({type:8,id:a}))),[m,a]);let v=Qa((e=>{if(n)return e.preventDefault();g(),0===o.propsRef.current.mode&&(s({type:1}),dl().nextFrame((()=>{var e;return null==(e=o.buttonRef.current)?void 0:e.focus({preventScroll:!0})})))})),y=Qa((()=>{if(n)return s({type:4,focus:Md.Nothing});s({type:4,focus:Md.Specific,id:a})})),b=Qa((()=>{n||l||s({type:4,focus:Md.Specific,id:a,trigger:0})})),S=Qa((()=>{n||!l||s({type:4,focus:Md.Nothing})})),x=(0,c.useMemo)((()=>({active:l,selected:p,disabled:n})),[l,p,n]);return Ua({ourProps:{id:a,ref:f,role:"option",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,"aria-selected":p,disabled:void 0,onClick:v,onFocus:y,onPointerMove:b,onMouseMove:b,onPointerLeave:S,onMouseLeave:S},theirProps:i,slot:x,defaultTag:"li",name:"Listbox.Option"})})),tU=Object.assign(QF,{Button:YF,Label:XF,Options:ZF,Option:eU});var nU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",focusable:"false",role:"img",className:e,fill:"currentColor","aria-label":t,children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z",clipRule:"evenodd"})});const rU={en:["January","February","March","April","May","June","July","August","September","October","November","December"],it:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"]},iU=(0,c.memo)((({defaultDate:e,onChange:t,disabled:n=!1})=>{const{t:r,i18n:i}=ve(),[o,a]=(0,c.useState)(e?"string"==typeof e?fD.DateTime.fromISO(e):fD.DateTime.fromJSDate(e):fD.DateTime.now());return(0,c.useEffect)((()=>{t(o)}),[o,t]),(0,s.jsxs)("div",{className:"memori--date-selector",children:[(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(tU,{value:o,onChange:e=>{a(e)},disabled:n,name:"day",children:[(0,s.jsxs)(tU.Label,{className:"memori--date-selector__select-label",children:[r("day"),":"]}),(0,s.jsxs)(tU.Button,{"aria-label":r("day"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.day}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(nU,{})})]}),(0,s.jsx)(Wc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(tU.Options,{className:"memori--date-selector__select-options",children:[...Array(31).keys()].map((e=>(0,s.jsx)(tU.Option,{value:o.set({day:e+1}),className:"memori--date-selector__select-option",children:e+1},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(tU,{value:o,onChange:e=>{a(e)},disabled:n,name:"month",children:[(0,s.jsxs)(tU.Label,{className:"memori--date-selector__select-label",children:[r("month"),":"]}),(0,s.jsxs)(tU.Button,{"aria-label":r("month"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:rU["it"===i.language?"it":"en"][o.month-1]}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(nU,{})})]}),(0,s.jsx)(Wc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(tU.Options,{className:"memori--date-selector__select-options",children:rU["it"===i.language?"it":"en"].map((e=>(0,s.jsx)(tU.Option,{className:"memori--date-selector__select-option",value:o.set({month:rU["it"===i.language?"it":"en"].findIndex((t=>t===e))+1}),children:e},e)))})})]})}),(0,s.jsx)("div",{className:"memori--date-selector__select",children:(0,s.jsxs)(tU,{value:o,onChange:e=>{a(e)},disabled:n,name:"year",children:[(0,s.jsxs)(tU.Label,{className:"memori--date-selector__select-label",children:[r("year"),":"]}),(0,s.jsxs)(tU.Button,{"aria-label":r("year"),className:"memori--date-selector__select-button",children:[(0,s.jsx)("span",{className:"memori--date-selector__select--value",children:o.year}),(0,s.jsx)("span",{className:"memori--date-selector__select--icon",children:(0,s.jsx)(nU,{})})]}),(0,s.jsx)(Wc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(tU.Options,{className:"memori--date-selector__select-options",children:[...Array(fD.DateTime.now().year-1899).keys()].sort(((e,t)=>t-e)).map((e=>(0,s.jsx)(tU.Option,{value:o.set({year:e+1900}),className:"memori--date-selector__select-option",children:e+1900},e)))})})]})})]})}));iU.displayName="DateSelector";var oU=iU;c=o("85Hg2");var sU=({visible:e=!1,onClose:n,minAge:r})=>{const{t:i}=ve(),[o,a]=(0,c.useState)(),[l,u]=(0,c.useState)(),[d,p]=(0,c.useState)(!1),h=(0,c.useCallback)((()=>{if(p(!0),!o)return t(Ss).error(i("requiredField")),u(i("requiredField")||"Required field"),void p(!1);if(fD.DateTime.now().diff(o,"years").years<r)return t(Ss).error(i("underageTwinSession",{age:r})),u(i("underageTwinSession",{age:r})||`You must be at least ${r} years old to interact with this Twin`),void p(!1);n(o.toJSDate().toISOString())}),[o,r,n,i]);return(0,s.jsxs)(Jc,{open:e,title:i("ageVerification"),className:"age-verification-modal",closable:!0,onClose:()=>n(),children:[(0,s.jsx)("p",{children:i("ageVerificationText",{minAge:r})}),(0,s.jsxs)("form",{className:"age-verification-form",onSubmit:e=>{e.preventDefault(),h()},children:[(0,s.jsx)("div",{className:"form-item",children:(0,s.jsxs)("fieldset",{name:"birthDate",children:[(0,s.jsx)("legend",{className:"sr-only",children:i("birthDate")}),(0,s.jsx)(oU,{defaultDate:new Date(Date.now()),onChange:e=>{a(e)}}),(0,s.jsx)("p",{className:"form-item-help",children:i("birthDateHelper")}),l&&(0,s.jsx)("p",{className:"form-item-error",children:l})]})}),(0,s.jsx)("div",{className:"form-item form-submit",children:(0,s.jsx)(Da,{primary:!0,htmlType:"submit",className:"age-verification-submit",loading:d,disabled:!o,children:i("confirm")})})]})]})};c=o("85Hg2");var aU=({open:e=!1,onClose:n,className:r,title:i,description:o,children:a,footer:l,loading:u=!1,side:d="right",closable:p=!0,width:h="100%",widthMd:f="80%",widthLg:m="60%"})=>(0,s.jsx)(Wc,{appear:!0,show:e,as:t(c).Fragment,children:(0,s.jsxs)(Cc,{open:e,onClose:n,className:t(ys)("memori-drawer",r),children:[(0,s.jsx)(Wc.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)("div",{className:"memori-drawer--backdrop"})}),(0,s.jsx)("div",{className:"memori-drawer--container",children:(0,s.jsx)("div",{className:"memori-drawer--container-scrollable",children:(0,s.jsx)(Wc.Child,{as:t(c).Fragment,enter:"ease-out duration-300",enterFrom:"max-w-0 opacity-0",enterTo:"max-w-100 opacity-100",leave:"ease-in duration-200",leaveFrom:"max-w-100 opacity-100",leaveTo:"max-w-0 opacity-0",children:(0,s.jsxs)(Cc.Panel,{className:t(ys)("memori-drawer--panel",{"memori-drawer--panel-left":"left"===d,"memori-drawer--with-footer":!!l}),children:[(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n .memori-drawer--panel {\n --memori-drawer--width: ${h};\n --memori-drawer--width-lg: ${m};\n --memori-drawer--width-md: ${f};\n }\n `}}),p&&(0,s.jsx)("div",{className:"memori-drawer--close",children:(0,s.jsx)(Da,{shape:"circle",outlined:!0,icon:(0,s.jsx)(Kc,{}),onClick:()=>n(!1)})}),(0,s.jsxs)(qc,{spinning:u,children:[i&&(0,s.jsx)(Cc.Title,{className:"memori-drawer--title",children:i}),o&&(0,s.jsx)(Cc.Description,{className:"memori-drawer--description",children:o}),a,l&&(0,s.jsx)("div",{className:"memori-drawer--footer",children:l})]})]})})})})]})});c=o("85Hg2");var lU=({label:e,className:n,disabled:r=!1,indeterminate:i=!1,checked:o,children:a,onChange:l,name:u,...d})=>{const p=(0,c.useRef)(null);return(0,c.useEffect)((()=>{p.current&&(p.current.indeterminate=i)}),[p,i]),(0,s.jsxs)("label",{className:t(ys)("memori-checkbox",n,{"memori-checkbox--disabled":r,"memori-checkbox--indeterminate":i}),children:[(0,s.jsxs)("span",{className:"memori-checkbox--input-wrapper",children:[(0,s.jsx)("input",{ref:p,type:"checkbox",...d,name:u,disabled:r,checked:o||i,className:"memori-checkbox--input",onChange:l}),(0,s.jsx)("span",{className:"memori-checkbox--inner"})]}),!!(null==e?void 0:e.length)&&(0,s.jsx)("span",{className:"memori-checkbox--text",children:e})]})};c=o("85Hg2");var cU=({className:e,value:n,displayValue:r,options:i,onChange:o,disabled:a=!1,label:l,placeholder:u})=>(0,s.jsx)("div",{className:t(ys)("memori-select",e),children:(0,s.jsxs)(tU,{value:n,onChange:e=>{o(e)},disabled:a,name:"day",children:[l&&(0,s.jsxs)(tU.Label,{className:"memori-select--label",children:[l,":"]}),(0,s.jsxs)(tU.Button,{"aria-label":l,className:"memori-select--button",children:[(0,s.jsx)("span",{className:t(ys)("memori-select--value",{"memori-select--value-placeholder":!n}),children:n?r||n:u}),(0,s.jsx)("span",{className:"memori-select--icon",children:(0,s.jsx)(nU,{})})]}),(0,s.jsx)(Wc,{as:c.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,s.jsx)(tU.Options,{className:"memori-select--options",children:i.map((e=>(0,s.jsx)(tU.Option,{value:e.value,className:"memori-select--option",children:e.label},e.value)))})})]})});const uU={muteSpeaker:"@memori:muteSpeaker",microphoneMode:"@memori:microphoneMode",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",sendOnEnter:"@memori:sendOnEnter",birthDate:"@memori:birthDate",controlsPosition:"@memori:controlsPosition",hideEmissions:"@memori:hideEmissions",loginToken:"@memori:loginToken"},dU=(e,t)=>{var n;try{const r=window.localStorage.getItem(null!==(n=uU[e])&&void 0!==n?n:e);if(!r)return t;try{return JSON.parse(r)}catch(e){return r}}catch(e){return console.error("error",e),t}},pU=(e,t)=>{var n;try{window.localStorage.setItem(null!==(n=uU[e])&&void 0!==n?n:e,t.toString())}catch(e){console.error("error",e)}},hU=e=>{var t;try{window.localStorage.removeItem(null!==(t=uU[e])&&void 0!==t?t:e)}catch(e){console.error("error",e)}},fU=[2,3,5,10,15,20,30,60];var mU=({open:e,layout:t="DEFAULT",onClose:n,microphoneMode:r="HOLD_TO_TALK",continuousSpeechTimeout:i,setMicrophoneMode:o,setContinuousSpeechTimeout:a,controlsPosition:l,setControlsPosition:c,hideEmissions:u,setHideEmissions:d,additionalSettings:p})=>{const{t:h}=ve();return(0,s.jsxs)(aU,{className:"memori-settings-drawer",open:e,onClose:n,title:h("widget.settings")||"Settings",description:h("write_and_speak.settingsHeaderLabel"),children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#microphoneMode",children:[h("write_and_speak.microphoneMode")||"Microphone mode",":"]}),(0,s.jsxs)($f,{id:"microphoneMode",name:"microphoneMode",value:r,defaultValue:r,className:"memori-settings-drawer--microphoneMode-radio",onChange:e=>{let t="CONTINUOUS"===e?"CONTINUOUS":"HOLD_TO_TALK";o(t),pU("microphoneMode",t)},children:[(0,s.jsx)($f.Option,{value:"HOLD_TO_TALK",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Da,{primary:e,children:h("write_and_speak.holdToSpeak")||"Hold to speak"})}),(0,s.jsx)($f.Option,{value:"CONTINUOUS",className:"memori-settings-drawer--microphoneMode-radio-button",children:({checked:e})=>(0,s.jsx)(Da,{primary:e,children:h("write_and_speak.continuousSpeechLabel")||"Continuous speech"})})]})]}),"CONTINUOUS"===r&&(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(cU,{label:h("write_and_speak.secondsLabel")||"Seconds",placeholder:h("write_and_speak.secondsLabel")||"Seconds",options:fU.map((e=>({value:e,label:e}))),value:i,onChange:e=>{a(e),pU("continuousSpeechTimeout",e)}})}),"TOTEM"===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,s.jsxs)("label",{htmlFor:"#controlsPosition",children:[h("write_and_speak.controlsPosition")||"Controls",":"]}),(0,s.jsxs)($f,{id:"controlsPosition",name:"controlsPosition",value:l,defaultValue:l,className:"memori-settings-drawer--controlsposition-radio",onChange:e=>{c(e),pU("controlsPosition",e)},children:[(0,s.jsx)($f.Option,{value:"center",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Da,{primary:e,children:h("center")||"Center"})}),(0,s.jsx)($f.Option,{value:"bottom",className:"memori-settings-drawer--controlsposition-radio-button",children:({checked:e})=>(0,s.jsx)(Da,{primary:e,children:h("bottom")||"Bottom"})})]})]}),(0,s.jsx)("div",{className:"memori-settings-drawer--field",children:(0,s.jsx)(lU,{label:h("write_and_speak.hideEmissionsLabel")||"Hide emissions",name:"hideControls",checked:u,onChange:e=>{d(e.target.checked),pU("hideEmissions",e.target.checked)}})})]}),p&&(0,s.jsx)("div",{className:"memori-settings-drawer--field controls",children:p})]})};c=o("85Hg2");const gU=new Map(Object.entries({TENANT_NOT_FOUND:-1,TENANT_REGISTRATION_DISABLED:-2,TENANT_MISSING_NAME:-3,TENANT_MAX_USERS_REACHED:-4,TENANT_MAX_ADMINS_REACHED:-5,USER_NOT_CONFIRMED:-11,USER_NOT_FOUND:-12,USER_OR_PASSWORD_INVALID:-13,USER_MUST_CHANGE_PASSWORD:-14,USER_MUST_ENTER_VERIFICATION_CODE:-15,USER_MISSING_TENANT:-21,USER_MISSING_NAME:-22,USER_MISSING_PASSWORD:-23,USER_MISSING_EMAIL:-24,USER_MISSING_VERIFICATION_CODE:-25,USER_NAME_ALREADY_USED:-26,USER_PASSWORD_NOT_CONFORMING_TO_POLICY:-27,USER_EMAIL_ALREADY_USED:-28,USER_EMAIL_INVALID:-29,USER_VERIFICATION_CODE_INVALID:-30,USER_MISSING_NAME_OR_EMAIL:-31,USER_NAME_INVALID:-32,USER_HAS_ONE_OR_MORE_MEMORI:-33,USER_MISSING_NEW_PASSWORD:-34,USER_CANT_CREATE_MEMORI:-35,USER_MAX_MEMORI_REACHED:-36,USER_CANT_EDIT_INTEGRATIONS:-37,MEMORI_NOT_FOUND:-51,MEMORI_NOT_ACCESSIBLE:-52,MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN:-53,SESSION_NOT_FOUND:-101,SESSION_IS_NOT_ADMINISTRATIVE:-102,MEMORI_MISSING_CONFIGURATION:-201,MEMORI_CONFIGURATION_NOT_FOUND:-202,MEMORI_INVALID_PRIVACY_TYPE:-203,MEMORI_MISSING_PASSWORD:-204,MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS:-205,MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS:-206,MEMORI_INVALID_VOICE_TYPE:-207,MEMORI_MISSING_NAME:-208,MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS:-209,MEMORI_INVALID_ID:-210,MEMORI_NAME_ALREADY_USED:-211,MEMORI_INVALID_PIN:-212,MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION:-213,MEMORI_NO_PASSWORD_WHEN_PUBLIC:-214,MEMORI_TRANSFER_MISSING_DESTINATION_USER:-231,MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID:-232,MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT:-233,MEMORI_TRANSFER_NOTHING_TO_DO:-234,MEMORI_CONFIGURATION_CANT_BE_CHANGED:-251,MEMORI_MISSING_NEW_PASSWORD:-252,MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT:-261,MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT:-262,INTEGRATION_NOT_FOUND:-301,INTEGRATION_INVALID_TYPE:-401,INTEGRATION_ALREADY_EXISTS:-402,INTEGRATION_MEMORI_IS_NOT_PUBLIC:-403,INTEGRATION_MISSING_INVOCATION_TEXT:-404,INTEGRATION_MISSING_DEVICE_EMAILS:-405,INTEGRATION_MEMORI_IS_EMPTY:-406,INTEGRATION_MISSING_PRIVACY_POLICY:-407,INTEGRATION_MISSING_CATEGORY:-408,INTEGRATION_MISSING_DESCRIPTION:-409,INTEGRATION_INVALID_INVOCATION_TEXT:-410,INTEGRATION_GOOGLE_NO_MORE_AVAILABLE:-411,UPLOAD_REQUIRES_MULTIPART_ENCODING:-501,UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY:-502,UPLOAD_MAX_LENGTH_EXCEEDED:-503,UPLOAD_FILE_IS_EMPTY:-504,UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE:-505,UPLOAD_MISSING_FILE_NAME:-506,UPLOAD_INVALID_MEMORY_ID:-507,UPLOAD_MISSING_FILE_CONTENT:-508,ASSET_NOT_FOUND:-601,ASSET_NOT_ACCESSIBLE:-602,ASSET_MISSING_SESSION_ID:-603,ASSET_INVALID_FILE_NAME:-604,INVITATION_NOT_FOUND:-701,INVITATION_NOT_ACCESSIBLE:-702,INVITATION_ALREADY_ACCEPTED:-703,INVITATION_ALREADY_REJECTED:-704,INVITATION_MISSING_DESTINATION_EMAIL:-705,INVITATION_DESTINATION_EMAIL_INVALID:-706,INVITATION_MISSING_TAG:-707,INVITATION_MISSING_PIN:-708,INVITATION_INVALID_PIN:-709,INVITATION_INVALID_TYPE:-710,INVITATION_MISSING_DESTINATION_NAME:-711,INVITATION_TAG_PIN_CANT_BE_CHANGED:-712,INVITATION_CANT_BE_CHANGED:-713,ACTIONLOG_INVALID_USER_ID:-801,ACTIONLOG_INVALID_DATE_FROM_FORMAT:-802,ACTIONLOG_INVALID_DATE_TO_FORMAT:-803,ACTIONLOG_INVALID_MEMORI_ID:-804,CONSUMPTIONLOG_INVALID_TYPE:-901,CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT:-902,CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT:-903,CONSUMPTIONLOG_INVALID_USER_ID:-904,CONSUMPTIONLOG_INVALID_MEMORI_ID:-905}).map((([e,t])=>[t,e]))),vU=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=gU.get(e);return t?`errors.${t}`:"error.generic"};var yU=({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 bU=({className:e,title:t})=>(0,s.jsx)("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:e,"aria-label":t,children:(0,s.jsx)("path",{d:"M15 18L9 12 15 6"})});var SU=({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 xU=({apiURL:e,sessionID:n,memori:r,visible:i=!0,initialKnownFacts:o=[],closeDrawer:a})=>{var l;const{t:u}=ve(),d=q(e),{getKnownFactsPaginated:p,deleteKnownFact:h}=d.knownFacts,[f,m]=(0,c.useState)(o),[g,v]=(0,c.useState)(25),[y,b]=(0,c.useState)(0),[S,x]=(0,c.useState)(null!==(l=null==o?void 0:o.length)&&void 0!==l?l:0),[w,C]=(0,c.useState)(!1),A=async(e,r,i)=>{if(n||e){C(!0);try{const{knownFacts:o,count:s,...a}=await p(null!=e?e:n,null!=r?r:y,null!=i?i:g);m(null!=o?o:[]),x(null!=s?s:0),0!==a.resultCode&&(console.error(a),t(Ss).error(u(vU(a.resultCode))))}catch(e){console.error("KNOWN_FACTS/FETCH",e),m(null!=o?o:[])}C(!1)}};(0,c.useEffect)((()=>{A()}),[]);const[E,M]=(0,c.useState)(!1),[T,_]=(0,c.useState)(),[I,R]=(0,c.useState)([]);return(0,s.jsxs)(aU,{open:i,width:"80%",className:"memori-known-facts-drawer",onClose:()=>a(),title:u("knownFacts.title"),children:[(0,s.jsx)("p",{children:u("knownFacts.description",{memoriName:r.name})}),(0,s.jsxs)(qc,{spinning:w,children:[(0,s.jsxs)("div",{className:"memori-known-facts-actions",children:[(0,s.jsxs)(Da,{primary:!0,danger:!0,onClick:()=>{M(!0)},className:"memori-known-facts-delete-selected",disabled:0===(null==I?void 0:I.length),icon:(0,s.jsx)(yU,{}),loading:w,children:[u("selected")," (",null==I?void 0:I.length,")"]}),(0,s.jsx)(Jc,{className:"memori-known-facts-modal",open:E,closable:!0,title:I.length>1?u("knownFacts.deleteSelectedConfirmTitle"):u("knownFacts.deleteConfirmTitle"),description:I.length>1?u("knownFacts.deleteSelectedConfirmMessage",{number:I.length}):u("knownFacts.deleteConfirmMessage"),onClose:()=>{M(!1)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Da,{ghost:!0,onClick:()=>{M(!1)},children:u("cancel")}),(0,s.jsx)(Da,{primary:!0,danger:!0,onClick:async()=>{try{const e=I.map((e=>h(n,e)));Promise.all(e).then((e=>{if(e.every((e=>0===e.resultCode)))t(Ss).success(u("knownFacts.deleteSuccess")),R([]),A(),M(!1);else{let n=e.find((e=>0!==e.resultCode));console.error(n),void 0!==(null==n?void 0:n.resultCode)&&t(Ss).error(u(vU(null==n?void 0:n.resultCode)))}}))}catch(e){let n=e;t(Ss).error(u("Error")+n.message)}},children:u("confirm")})]})})]}),S>25&&(0,s.jsxs)("nav",{className:"memori--table--pagination",children:[S>g&&(0,s.jsxs)("div",{className:"memori--table--pagination--pages",children:[(0,s.jsx)(Da,{shape:"circle",disabled:0===y||y<g,padded:!1,title:u("previous")||"Previous",icon:(0,s.jsx)(bU,{}),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)(Da,{shape:"circle",padded:!1,title:u("next")||"Next",icon:(0,s.jsx)(SU,{}),disabled:(y/g+1)*g>=S,onClick:()=>{let e=(y/g+1)*g;b(e),A(void 0,e,g)}})]}),(0,s.jsx)(cU,{options:[{label:`25 / ${u("page")||"page"}`,value:25},{label:`50 / ${u("page")||"page"}`,value:50},{label:`100 / ${u("page")||"page"}`,value:100}],value:g,displayValue:`${g} / ${u("page")||"page"}`,onChange:e=>{v(e),b(0),A(void 0,0,e)}})]}),(0,s.jsxs)("table",{className:"memori--table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(lU,{checked:!!(null==f?void 0:f.length)&&(null==I?void 0:I.length)===f.length,indeterminate:!!(null==f?void 0:f.length)&&!!(null==I?void 0:I.length)&&(null==I?void 0:I.length)!==(null==f?void 0:f.length),onChange:e=>{e.target.checked?R(f.map((e=>e.knownFactID))):R([])}})}),(0,s.jsx)("th",{children:u("knownFacts.text")}),(0,s.jsx)("th",{className:"mobile-hidden",children:u("createdAt")}),(0,s.jsx)("th",{className:"memori--table--column-right",children:u("actions")})]})}),(0,s.jsx)("tbody",{children:f.map((e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"memori--table--column-centered",children:(0,s.jsx)(lU,{checked:null==I?void 0:I.includes(e.knownFactID),onChange:t=>{t.target.checked?R((t=>[...new Set([...t,e.knownFactID])])):R((t=>t.filter((t=>t!==e.knownFactID))))}})}),(0,s.jsx)("td",{children:e.text}),(0,s.jsx)("td",{className:"mobile-hidden",children:(0,s.jsx)("span",{className:"memori--table--date",children:e.creationTimestamp?new Intl.DateTimeFormat("it",{dateStyle:"short",timeStyle:"short"}).format(new Date(e.creationTimestamp)):"-"})}),(0,s.jsx)("td",{className:"memori--table--column-right",children:(0,s.jsxs)("div",{className:"memori--table--action-column",children:[(0,s.jsx)(Da,{danger:!0,ghost:!0,shape:"circle",icon:(0,s.jsx)(yU,{}),disabled:(null==I?void 0:I.length)>0,title:u("delete")||"Delete",onClick:()=>_(e.knownFactID)}),(0,s.jsx)(Jc,{className:"memori-known-facts-modal",open:T===e.knownFactID,closable:!0,title:u("knownFacts.deleteConfirmTitle"),description:u("knownFacts.deleteConfirmMessage"),onClose:()=>{_(void 0)},footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Da,{ghost:!0,onClick:()=>{_(void 0)},children:u("cancel")}),(0,s.jsx)(Da,{primary:!0,danger:!0,onClick:async()=>{try{const r=await h(n,e.knownFactID);0===r.resultCode?(t(Ss).success(u("knownFacts.deleteSuccess")),R([]),A(),_(void 0)):(console.error(r),t(Ss).error(u(vU(r.resultCode),{ns:"common"})))}catch(e){let n=e;t(Ss).error(u("Error")+n.message)}},children:u("confirm")})]})})]})})]},e.knownFactID)))})]})]})]})};var wU=({open:e=!1,baseUrl:t,apiUrl:n,tenant:r,experts:i,onClose:o})=>{const{t:a}=ve();return(0,s.jsx)(aU,{open:e,onClose:o,className:"memori--experts-drawer",title:(0,s.jsx)("h2",{className:"memori--experts-drawer--title",children:a("widget.expertsInTheBoard")}),children:(0,s.jsx)("ul",{className:"memori--experts-drawer--list",children:i.map((e=>(0,s.jsxs)("li",{className:"memori--experts-drawer--item",children:[(0,s.jsx)("figure",{className:"memori--experts-drawer--avatar",children:(0,s.jsx)("img",{src:`${n}/api/v1/memoriai/memori/avatar/${e.expertMemoriID}`,alt:e.name,onError:e=>{e.currentTarget.src=wd({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:t}),e.currentTarget.onerror=null}})}),(0,s.jsxs)("div",{className:"memori--experts-drawer--content",children:[(0,s.jsx)("h3",{className:"memori--experts-drawer--name",children:e.name}),(0,s.jsx)("p",{className:"memori--experts-drawer--description",children:e.description})]})]},e.expertID)))})})};c=o("85Hg2");const CU=/^\w+([.-]?[+]?\w+)*@\w+([.-]?\w+)*(\.\w{2,})+$/;var AU=({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}=ve(),m="it"===f.language?"it":"en",g=q(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,M]=(0,c.useState)(null);(0,c.useEffect)((()=>{M(window.location.href)}),[]);const T=(null==o?void 0:o.userID)&&a;return(0,s.jsx)(aU,{open:e,onClose:n,className:t(ys)("memori--login-drawer",{"memori--login-drawer--logged":T}),title:(0,s.jsx)("h2",{className:"memori--login-drawer--title",children:T?h("login.loggedDrawerTitle",{name:o.userName}):h("login.loginDrawerTitle")}),children:T?(0,s.jsx)("div",{className:"memori--login-drawer--logged",children:(0,s.jsx)(Da,{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(Ss).error(h(vU(f.resultCode),{ns:"common"})),A(f.resultMessage)):(t(Ss).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)(Da,{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=CU.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(Ss).error(h(vU(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(Ss).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)(Da,{htmlType:"submit",primary:!0,loading:b,children:h("login.login")}),!(null==l?void 0:l.disableRegistration)&&(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 EU=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(qc,{spinning:g,children:[m&&d&&p&&(0,s.jsx)(d,{...p}),e&&t&&(0,s.jsx)(e,{...t}),(0,s.jsxs)("div",{className:"memori--grid",children:[(0,s.jsxs)("div",{className:"memori--grid-column memori--grid-column-left",children:[n&&r&&(0,s.jsx)(n,{...r}),(0,s.jsx)("div",{id:"extension"})]}),(0,s.jsx)("div",{className:"memori--grid-column memori--grid-column-right",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null}),v]})]})]});var MU=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:c,integrationBackground:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>(0,s.jsxs)(s.Fragment,{children:[c,u,(0,s.jsxs)(qc,{spinning:g,className:"memori-totem-layout",children:[v,m&&d&&p&&(0,s.jsx)(d,{...p}),(0,s.jsx)("div",{className:"memori-totem-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{className:"memori-totem-layout--avatar",children:n&&r&&(0,s.jsx)(n,{...r})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-totem-layout--controls",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]});var TU=({Header:e,headerProps:t,Chat:n,chatProps:r,StartPanel:i,startPanelProps:o,integrationStyle:a,integrationBackground:l,ChangeMode:c,changeModeProps:u,sessionId:d,hasUserActivatedSpeak:p,showInstruct:h=!1,loading:f=!1,poweredBy:m})=>(0,s.jsxs)(s.Fragment,{children:[a,l,(0,s.jsxs)(qc,{spinning:f,className:"memori-chat-layout",children:[m,h&&c&&u&&(0,s.jsx)(c,{...u}),(0,s.jsx)("div",{className:"memori-chat-layout--header",children:e&&t&&(0,s.jsx)(e,{...t})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-chat-layout--controls",children:d&&p&&n&&r?(0,s.jsx)(n,{...r}):o?(0,s.jsx)(i,{...o}):null})]})]});c=o("85Hg2"),c=o("85Hg2");var _U=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:o,StartPanel:a,startPanelProps:l,integrationStyle:u,ChangeMode:d,changeModeProps:p,sessionId:h,hasUserActivatedSpeak:f,showInstruct:m=!1,loading:g=!1,poweredBy:v})=>{var y,b;const{t:S}=ve(),[x,w]=(0,c.useState)(!0),[C,A]=(0,c.useState)(),E=(0,c.useMemo)((()=>null==o?void 0:o.stopAudio),[null==o?void 0:o.stopAudio]),M=e=>{w(e),A(e?void 0:(new Date).toISOString());try{null==E||E()}catch(e){console.log(e)}};return(0,s.jsx)("div",{className:"memori-website_assistant--"+(x?"collapsed":"expanded"),children:x?(0,s.jsx)("div",{className:"memori-website_assistant--trigger",children:(0,s.jsx)(Da,{className:"memori-website_assistant--trigger-button",ghost:!0,shape:"circle",onClick:()=>M(!1),title:S("expand")||"Expand",children:(0,s.jsx)(nN,{avatar:null==r?void 0:r.memori.avatarURL})})}):(0,s.jsxs)(s.Fragment,{children:[u,(0,s.jsxs)(qc,{spinning:g,className:"memori-website_assistant-layout",children:[v,(0,s.jsx)("div",{className:"memori-website_assistant--close-button-wrapper",children:(0,s.jsx)(Da,{className:"memori-website_assistant--close-button",primary:!0,shape:"circle",onClick:()=>M(!0),icon:(0,s.jsx)(Kc,{}),title:S("close")||"Close"})}),m&&d&&p&&(0,s.jsx)(d,{...p}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--header",children:e&&t&&(0,s.jsx)(e,{...t,showSettings:!1,showReload:!1})}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--avatar",children:n&&r&&(0,c.createElement)(n,{...r,integrationConfig:r.integrationConfig?{...r.integrationConfig,avatarURL:(null===(y=r.integrationConfig)||void 0===y?void 0:y.avatarURL)?`${null===(b=r.integrationConfig)||void 0===b?void 0:b.avatarURL.split("#")[0]}#${C}`:void 0}:{},key:C})}),(0,s.jsx)("div",{id:"extension"}),(0,s.jsx)("div",{className:"memori-website_assistant-layout--controls",children:h&&f&&i&&o?(0,s.jsx)(i,{...o}):l?(0,s.jsx)(a,{...l}):null})]})]})})};const{deleteSession:IU,getStatistics:RU,initSession:PU}=q(),kU=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,"🧠"]]),OU=e=>{const t=Array.from(kU.keys()).filter((t=>t<=e));if(t.length>0){const e=t[t.length-1];return kU.get(e)}return""},NU=e=>{if("🆕"===e)return{points:10,badge:"🐹"};let t,n,r=!1;for(const[i,o]of kU){if(r){t=i,n=o;break}o===e&&(r=!0)}return n&&t?{points:t,badge:n}:void 0},DU=e=>{let t=0;for(const[n,r]of kU)if(r===e){t=n;break}return t},LU=e=>{const t=Math.round(e),n=OU(t);return{points:t,badge:n,pointsForCurrentBadge:DU(n),nextBadge:NU(n)}},BU=(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 zU,FU,UU,jU,HU,VU;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=BU,window.typeMessageHidden=(e,t=!0,n,r=!1,i=!1)=>BU(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),BU(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 GU=!1,WU=!1;var qU=({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=!0,showOnlyLastMessages:x,height:w="100vh",secret:C,baseUrl:A="https://aisuru.com",apiUrl:E="https://backend.memori.ai",initialContextVars:M,initialQuestion:T,ogImage:_,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:F})=>{var U,j,H,V,G,W,K,J,Q,Y,X,$,Z,ee,te,ne,re,ie,oe,se,ae,le;const{t:ce,i18n:ue}=ve(),[de,pe]=(0,c.useState)(!1);(0,c.useEffect)((()=>{pe(!0)}),[]);const he=q(E),{initSession:fe,postTextEnteredEvent:me,postPlaceChangedEvent:ge,postTimeoutEvent:ye,postTagChangedEvent:be,getSession:Se,getContentQualityIndexes:xe,getExpertReferences:we}=he,[Ce,Ae]=(0,c.useState)(!1),[Ee,Me]=(0,c.useState)(null!==(U=null==L?void 0:L.loginToken)&&void 0!==U?U:k),[Te,_e]=(0,c.useState)({avatarURL:"string"==typeof F?F:void 0});(0,c.useEffect)((()=>{Ee&&!(null==Te?void 0:Te.userID)&&S&&he.backend.getCurrentUser(Ee).then((({user:e,resultCode:t})=>{e&&0===t?(_e(e),pU("loginToken",Ee)):hU("loginToken")}))}),[Ee,null==Te?void 0:Te.userID]);const[Ie,Re]=(0,c.useState)(!1),[Pe,ke]=(0,c.useState)(!1),[Oe,Ne]=(0,c.useState)(!1),De=(null===(V=null===(H=null===(j=e.culture)||void 0===j?void 0:j.split("-"))||void 0===H?void 0:H[0])||void 0===V?void 0:V.toUpperCase())||(null===(J=null===(K=null===(W=null===(G=null==n?void 0:n.find((t=>t.memoriConfigID===e.memoriConfigurationID)))||void 0===G?void 0:G.culture)||void 0===W?void 0:W.split("-"))||void 0===K?void 0:K[0])||void 0===J?void 0:J.toUpperCase()),Le=(null==o?void 0:o.customData)?JSON.parse(o.customData):null,Be=void 0!==i?i:!!(null==Le?void 0:Le.multilanguage),[ze,Fe]=(0,c.useState)(null!==($=null!==(X=null!==(Y=null!==(Q=null!=r?r:null==Le?void 0:Le.lang)&&void 0!==Q?Q:De)&&void 0!==Y?Y:null==Le?void 0:Le.uiLang)&&void 0!==X?X:ue.language)&&void 0!==$?$:"IT"),[Ue,je]=(0,c.useState)(!1),[He,Ve]=(0,c.useState)(!1),[Ge,We]=(0,c.useState)(),qe=a||(null==Le?void 0:Le.layout)||"DEFAULT",[Ke,Je]=(0,c.useState)(!1),[Qe,Ye]=(0,c.useState)(!1),[Xe,$e]=(0,c.useState)(!1),[Ze,et]=(0,c.useState)(!1),[tt,nt]=(0,c.useState)(!1),[rt,it]=(0,c.useState)(!1),[ot,st]=(0,c.useState)(!N),[at,lt]=(0,c.useState)(!1),[ct,ut]=(0,c.useState)(2),[dt,pt]=(0,c.useState)(!1),[ht,ft]=(0,c.useState)("center"),[mt,gt]=(0,c.useState)(!1);(0,c.useEffect)((()=>{pt(!!UU),WU=!!UU}),[UU]),(0,c.useEffect)((()=>{let e="bottom",t=dU("microphoneMode","HOLD_TO_TALK");window.innerWidth<=768?(e="bottom",t="HOLD_TO_TALK"):e=window.matchMedia("(orientation: portrait)").matches||window.innerHeight>window.innerWidth?"center":"bottom",st(dU("muteSpeaker",!N)),GU=dU("muteSpeaker",!N),lt("CONTINUOUS"===t),ut(dU("continuousSpeechTimeout",2)),ft(dU("controlsPosition",e)),gt(dU("hideEmissions",!1)),(null==L?void 0:L.loginToken)||k||Me(dU("loginToken",void 0))}),[]);const[vt,yt]=(0,c.useState)(C),[bt,St]=(0,c.useState)(),[xt,wt]=(0,c.useState)(null),[Ct,At]=(0,c.useState)(),Et=async(e,t)=>{var n;const r=null!=t?t:Ut;if(e&&r){const{currentState:t,...i}=await ge({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&&Gt({...Ht,...t})}},[Mt,Tt]=(0,c.useState)(""),[_t,It]=(0,c.useState)(!1),[Rt,Pt]=(0,c.useState)([]),kt=e=>{Pt((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:[]}]}))},Ot=async(n,r,i,o=!0,s,a=!1,l,c=!1,u=!1)=>{var d,p,h,f;const m=i||Ut||(null===(d=window.getMemoriState())||void 0===d?void 0:d.sessionID);if(!m||!(null==n?void 0:n.length))return;a||kt({text:n,translatedText:s,fromUser:!0,media:null!=r?r:[],initial:Ut?!!i&&i!==Ut:!!i}),Ve(!0),We(l);let g=n,v=!1;if(o&&!Ce&&Be&&ze.toUpperCase()!==De.toUpperCase()){g=(await lp(n,De,ze,A)).text}const{currentState:y,...b}=await me({sessionId:m,text:g});if(0===b.resultCode&&y){const n=c&&l?l:null!==(p=y.emission)&&void 0!==p?p:null==Ht?void 0:Ht.emission;if("X4"===y.state&&e.giverTag){const{currentState:r,...i}=await be(m,e.giverTag);0===i.resultCode?(Gt(r),n&&(kt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),an(n))):(console.error(b,i),t(Ss).error(ce(vU(i.resultCode))),v=!0)}else if("X2d"===y.state&&e.giverTag){const{currentState:r,...i}=await me({sessionId:m,text:Math.random().toString().substring(2,8)});if(0===i.resultCode){const{currentState:r,...i}=await be(m,e.giverTag);0===i.resultCode?(Gt(r),n&&(kt({text:n,emitter:r.emitter,media:r.media,fromUser:!1}),an(n))):(console.error(b,i),t(Ss).error(ce(vU(i.resultCode))),v=!0)}else console.error(b,i),t(Ss).error(ce(vU(i.resultCode))),v=!0}else ze.toLowerCase()!==De.toLowerCase()&&n&&!Ce&&Be?Nt(y,ze).then((e=>{e.emission&&an(e.emission)})):(Gt({...y,emission:n}),n&&(kt({text:n,emitter:y.emitter,media:y.media,fromUser:!1,generatedByAI:!!y.completion}),an(n)))}else 404===b.resultCode&&(Pt((e=>[...e.slice(0,e.length-1)])),qt(!1,vt||e.secretToken,bt,Ce&&e.giverTag?e.giverTag:void 0,Ce&&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||{}},T).then((e=>{console.info("session timeout"),(null==e?void 0:e.sessionID)&&setTimeout((()=>{Ot(n,r,null==e?void 0:e.sessionID)}),500)})));u||(We(void 0),Ve(!1))},Nt=async(e,t)=>{var n,r,i;const o=null!==(n=e.emission)&&void 0!==n?n:null==Ht?void 0:Ht.emission;let s={...e},a=null;if(o&&!Ce&&De.toUpperCase()!==t.toUpperCase()&&Be){const n=await lp(o,t,De,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 lp(e,t,De,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==Ht?void 0:Ht.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 Gt(s),a&&kt(a),s},Dt=void 0!==e.ageRestriction?e.ageRestriction:e.nsfw?18:e.enableCompletions?14:0,[Lt,Bt]=(0,c.useState)(),[zt,Ft]=(0,c.useState)(!1),[Ut,jt]=(0,c.useState)(I),[Ht,Vt]=(0,c.useState)(),Gt=e=>{var t;Vt(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)}}))},Wt=async n=>{var r,i,o,s,a;let l=dU("birthDate",void 0);if(Lt||l||!Dt)if("PUBLIC"===e.privacyType||e.secretToken||vt||bt){je(!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 fe({...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==L?void 0:L.loginToken)&&void 0!==s?s:Ee)&&void 0!==a?a:k,language:nn(ze),referral:l}});if((null==c?void 0:c.sessionID)&&(null==c?void 0:c.currentState)&&0===c.resultCode)return jt(c.sessionID),Ct&&Et(Ct,c.sessionID),je(!1),{dialogState:c.currentState,sessionID:c.sessionID};(null==c?void 0:c.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(c),t(Ss).error(ce("underageTwinSession",{age:Dt})),Ne(!0)):403===(null==c?void 0:c.resultCode)?(yt(void 0),wt("password")):(console.error(c),t(Ss).error(ce(vU(null==c?void 0:c.resultCode))),Ne(!0))}catch(e){console.error(e),new Error("Error fetching session")}}else wt("password");else Ft(!0)},qt=async(n=!1,r,i,o,s,a,l,c)=>{var u,d,p,h,f;je(!0);try{let m,g=dU("birthDate",void 0);if(!c&&!g&&Dt)return void Ft(!0);if(!("PUBLIC"===e.privacyType||r||e.secretToken||vt||i||bt))return void wt("password");try{m=window.location.href}catch(e){console.error(e)}const{sessionID:v,currentState:y,...b}=await fe({memoriID:null!==(u=e.engineMemoriID)&&void 0!==u?u:"",password:r||vt||e.secretToken,recoveryTokens:i||bt,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==L?void 0:L.loginToken)&&void 0!==h?h:Ee)&&void 0!==f?f:k,language:nn(ze),referral:m}});if(v&&y&&0===b.resultCode)return jt(v),n&&(Gt(y),y.emission&&(Rt.length<=1?Pt([{text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}]):kt({text:y.emission,emitter:y.emitter,media:y.media,fromUser:!1,initial:!0}))),Ct&&Et(Ct,v),je(!1),{dialogState:y,sessionID:v};(null==b?void 0:b.resultMessage.startsWith("This Memori is aged restricted"))?(console.error(b),t(Ss).error(ce("underageTwinSession",{age:Dt})),Ne(!0)):403===(null==b?void 0:b.resultCode)?(yt(void 0),wt("password")):(console.error(b),t(Ss).error(ce(vU(b.resultCode))),Ne(!0))}catch(e){console.error(e)}return je(!1),null},Kt=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 be(n,null!=r?r:up);if(0===u){let d=0;if(r!==up&&i&&("X1a"===t.state||"X1b"===t.state)){const{resultCode:e}=await me({sessionId:n,text:null!=i?i:""});d=e}if(0===d){const{currentState:e,...t}=await Se(n);if(0===t.resultCode&&e)return{currentState:e,sessionId:n,...t}}else if([400,401,403,404,500].includes(u)){console.warn("[APPCONTEXT/CHANGETAG]",u);let t,n=dU("birthDate",void 0);try{t=window.location.href}catch(e){console.error(e)}Wt({memoriID:null!==(o=e.engineMemoriID)&&void 0!==o?o:"",password:C||vt||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())||"",...M||{}},initialQuestion:T,birthDate:Lt||n||void 0,additionalInfo:{...L||{},loginToken:null!==(c=null!==(l=null==L?void 0:L.loginToken)&&void 0!==l?l:Ee)&&void 0!==c?c:k,language:nn(ze),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)((()=>()=>{Ht&&(null==Ht?void 0:Ht.currentTag)===e.giverTag||(async()=>{Ut&&e.giverTag&&e.giverPIN&&(Pt([]),await Kt(e.engineMemoriID,Ut,e.giverTag,e.giverPIN))})()}),[]);const[Jt,Qt]=(0,c.useState)(),Yt=(0,c.useRef)(),Xt=()=>{Jt&&(clearTimeout(Jt),Qt(void 0)),(null==Yt?void 0:Yt.current)&&(clearTimeout(Yt.current),Yt.current=void 0)},$t=()=>{Xt(),!(null==Ht?void 0:Ht.acceptsTimeout)||UU||dt||Mt.length||He||_t||en()},Zt=async()=>{var e;if(UU||dt||Mt.length||He||_t)$t();else if(Ut&&Ke&&(null==Ht?void 0:Ht.acceptsTimeout)){const{currentState:t,...n}=await ye(Ut);if(0===n.resultCode&&t){const n=t.emission;!Ce&&Be&&ze!==(null==ue?void 0:ue.language)&&n&&n.length>0?Nt({...t,emission:n},ze).then((e=>{e.emission&&an(e.emission)})):n&&n.length>0&&(kt({text:n,emitter:t.emitter,media:t.media,fromUser:!1,generatedByAI:!!t.completion}),an(n),Gt({...t,hints:null!==(e=t.hints)&&void 0!==e?e:"G1"===t.state?null==Ht?void 0:Ht.hints:[]}))}}},en=()=>{let e=null==Ht?void 0:Ht.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==Ht?void 0:Ht.emission){e+=Ht.emission.length/26.5}}let t=setTimeout(Zt,1e3*e);Qt(t),Yt.current=t};(0,c.useEffect)((()=>{(Mt.length||dt||He)&&Xt(),Ut&&!Mt.length&&$t()}),[null==Ht?void 0:Ht.acceptsTimeout,null==Ht?void 0:Ht.timeout,null==Ht?void 0:Ht.state,dt,Ut,Rt,Mt,He]),(0,c.useEffect)((()=>()=>{Je(!1),ke(!1),Xt(),Yt.current=void 0}),[]);const tn=(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:ue.language)&&void 0!==o?o:"IT").toUpperCase(),l=e.voiceType;if(e.enableBoardOfExperts&&(null==Ht?void 0:Ht.emitter)){null==zn||zn.find((e=>e.name===(null==Ht?void 0:Ht.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==Ht?void 0:Ht.emitter,ue.language,e.culture]),nn=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])||ue.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},[rn,on]=(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=>{on(e)}))}),[]);const sn=()=>{const e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e)},an=e=>{if(!O||p)return void sn();if(vn(),p)return;if(ot||GU)return WU=!1,Ve(!1),sn(),void(at&&fn());jU&&jU.pause();let t=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome"),n=/iPad|iPhone|iPod/.test(navigator.userAgent);if("interrupted"===HU.state)return void HU.resume().then((()=>an(e)));if("closed"===HU.state){HU=new Wo;let e=HU.createBuffer(1,1e4,22050),t=HU.createBufferSource();t.buffer=e,t.connect(HU.destination)}else if("suspended"===HU.state){ln(),HU=new Wo;let e=HU.createBuffer(1,1e4,22050),t=HU.createBufferSource();t.buffer=e,t.connect(HU.destination)}if(!UU){n||(jU=new ms.SpeakerAudioDestination);let e=ms.AudioConfig.fromSpeakerOutput(jU);UU=new ms.SpeechSynthesizer(FU,e)}const r=HU.createBufferSource();r.addEventListener("ended",(()=>{pt(!1),WU=!1})),jU.onAudioEnd=()=>{pt(!1),WU=!1,r.disconnect(),sn(),wn()},UU.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="${nn(ze)}"><voice name="${tn(ze)}"><s>${((e,t)=>{var n;if(!rn)return e;const r={...null!==(n=rn.common)&&void 0!==n?n:{},...(null==R?void 0:R.id)&&rn[R.id]?rn[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})(Sd(e)),ze.toLowerCase())}</s></voice></speak>`,(i=>{if(i){pt(!0),WU=!0;try{HU.decodeAudioData(i.audioData,(function(e){r.buffer=e,r.connect(HU.destination),(Rt.length<1||t&&n)&&r.start(0)})),HU.onstatechange=()=>{"suspended"===HU.state||"closed"===HU.state?(r.disconnect(),pt(!1),WU=!1):"interrupted"===HU.state&&HU.resume()},HU.resume(),UU&&(UU.close(),UU=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),pt(!1),WU=!1,UU&&(UU.close(),UU=null),sn()}}else HU.resume(),pt(!1),WU=!1,sn()}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),pt(!1),WU=!1,sn()})),Ve(!1)},ln=()=>{pt(!1),WU=!1;try{UU&&(UU.close(),UU=null),"closed"!==HU.state&&HU.close(),jU&&(jU.pause(),jU.close())}catch(e){console.error("stopAudio error: ",e)}};(0,c.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==Ht?void 0:Ht.emission]);const[cn,un]=(0,c.useState)(""),dn=()=>un(""),[pn,hn]=(0,c.useState)(null),fn=()=>{let e=setTimeout((async()=>{yn();const e=bd(cn);e.length>0&&_t?(Ot(e),dn(),Tt("")):_t&&$t()}),1e3*ct);hn(e)},mn=()=>{pn&&(clearTimeout(pn),hn(null))};(0,c.useEffect)((()=>{mn(),at&&fn(),$t()}),[cn]);const gn=()=>{if(O){yn(),un(""),dn();try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){Ye(!0),FU||(FU=ms.SpeechConfig.fromSubscription(O,"eastus"),FU.speechRecognitionLanguage=nn(ze),FU.speechSynthesisLanguage=nn(ze),FU.speechSynthesisVoiceName=tn(ze));const t=ms.AudioConfig.fromDefaultMicrophoneInput();zU=new ms.SpeechRecognizer(FU,t),It(!0),zU.recognized=(e,t)=>{if(t.result.text)if(t.result.reason===ms.ResultReason.RecognizedSpeech){let e=t.result.text;if(un(e||""),(null==e?void 0:e.length)>0){const t=bd(e);t.length>0&&Tt((e=>`${e} ${t}`))}}else t.result.reason===ms.ResultReason.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},zU.canceled=(e,t)=>{t.reason===ms.CancellationReason.Error&&(console.debug(`"CANCELED: ErrorCode=${t.errorCode}`),console.debug(`"CANCELED: ErrorDetails=${t.errorDetails}`),console.debug("CANCELED: Did you set the speech resource key and region values?")),vn()},zU.sessionStopped=(e,t)=>{vn()},dn(),zU.startContinuousRecognitionAsync()})).catch(console.error)}catch(e){console.error(e)}}},vn=()=>{zU&&(zU.stopContinuousRecognitionAsync(),zU.close(),zU=null),It(!1)},yn=()=>{Ye(!1),vn(),mn()},bn=()=>{try{yn(),Xt(),ke(!1),Yt.current=void 0,ln()}catch(e){console.log("Error: resetUIEffects",e)}};(0,c.useEffect)((()=>()=>{bn()}),[]),(0,c.useEffect)((()=>(document.addEventListener("MemoriResetUIEffects",bn),()=>{document.removeEventListener("MemoriResetUIEffects",bn)})),[]),(0,c.useEffect)((()=>{"Z0"===(null==Ht?void 0:Ht.state)&&yn()}),[null==Ht?void 0:Ht.state]);const[Sn,xn]=(0,c.useState)(!1),wn=(0,c.useCallback)((e=>{dt&&UU&&(UU.close(),UU=null),!at||!Qe&&Sn||(xn(!0),gn())}),[at,Qe]);(0,c.useEffect)((()=>{Rt.length>1&&!dt&&at&&(Qe||!Sn)?gn():dt&&_t&&vn()}),[dt]),(0,c.useEffect)((()=>{_t&&(yn(),dn(),Tt(""),gn())}),[De]);const[Cn,An]=(0,c.useState)("keypress");(0,c.useEffect)((()=>{const e=dU("sendOnEnter","keypress");window.innerWidth<=768?An("click"):An(e)}),[]),(0,c.useEffect)((()=>{pU("sendOnEnter",Cn)}),[Cn]);const[En,Mn]=(0,c.useState)(),Tn=null==Le?void 0:Le.globalBackground,_n=Tn?`url(${Tn})`:null,In=o?{"--memori-chat-bubble-bg":"#fff",...Le&&!u?{"--memori-text-color":null!==(Z=Le.textColor)&&void 0!==Z?Z:"#000"}:{},...(null==Le?void 0:Le.buttonBgColor)?{"--memori-button-bg":Le.buttonBgColor,"--memori-primary":Le.buttonBgColor}:{},...(null==Le?void 0:Le.buttonTextColor)?{"--memori-button-text":Le.buttonTextColor}:{},...(null==Le?void 0:Le.blurBackground)?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...(null==Le?void 0:Le.innerBgColor)?{"--memori-inner-bg":`rgba(${"dark"===Le.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(ee=Le.innerBgAlpha)&&void 0!==ee?ee:.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===Le.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(te=null==Le?void 0:Le.innerBgAlpha)&&void 0!==te?te:.4})`}:{"--memori-inner-content-pad":"0px"}}:{},Rn=`\n ${p?"#preview,":"WEBSITE_ASSISTANT"===qe?"":":root,"} .memori-widget {\n ${Object.entries(In).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,Pn=void 0===(null==Le?void 0:Le.showAIicon)||(null==Le?void 0:Le.showAIicon),[kn,On]=(0,c.useState)(!1);(0,c.useEffect)((()=>{(window.innerWidth>=768&&"FULLPAGE"===qe||"FULLPAGE"!==qe)&&On(!0)}),[]);const[Nn,Dn]=(0,c.useState)();(0,c.useEffect)((()=>{e.engineMemoriID&&(async e=>{let t,n;try{const{contentQualityIndex:r,answerQualityIndex:i,unansweredQuestions:o,...s}=await xe(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=>{Dn(LU(e.points))})).catch(console.error)}),[e.engineMemoriID]),(0,c.useEffect)((()=>{if(null==Le?void 0:Le.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",Le.seoTitle),document.head.append(e)}if(null==Le?void 0:Le.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",Le.seoDescription),document.head.append(e)}if(null==Le?void 0:Le.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",Le.seoUrl),document.head.append(e)}let t=_||e.avatarURL;if((null==Le?void 0:Le.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}}),[Le,e.avatarURL,_]);const Ln=(0,c.useCallback)((e=>{const{text:t,waitForPrevious:n,hidden:r,typingText:i,useLoaderTextAsMsg:o,hasBatchQueued:s}=e.detail;t&&(n&&!GU&&(WU||He)?setTimeout((()=>{Ln(e)}),1e3):(vn(),ln(),Ot(t,void 0,void 0,void 0,void 0,r,i,o,s)))}),[Ut,dt,He,ze]);(0,c.useEffect)((()=>(document.addEventListener("MemoriTextEntered",Ln),()=>{document.removeEventListener("MemoriTextEntered",Ln)})),[Ut,ze]);const Bn=(0,c.useCallback)((async t=>{var n,r,i,o,s,a,l,c;const u=(null==t?void 0:t.sessionID)||Ut,d=(null==t?void 0:t.dialogState)||Ht;ke(!0);let p=document.getElementById("memori-audio"),h=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome");p&&h&&(p.muted=!1,p.play().catch((e=>{console.error("error playing intro audio",e)})));let f=dU("birthDate",void 0),m=Lt||f||void 0;if(u||!Dt||m){if(!u&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!vt&&!bt||!u&&Oe)return wt("password"),void ke(!1);if(!u){ke(!1),Ne(!1);const t=await Wt({memoriID:e.engineMemoriID,password:C||vt||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())||"",...M||{}},initialQuestion:T,birthDate:m});return void((null==t?void 0:t.dialogState)?(Pt([]),Nt(t.dialogState,ze).then((e=>{e.emission&&an(e.emission)})).finally((()=>{Je(!0)}))):await Bn(t||void 0))}if(I){const{currentState:t,...n}=await Se(u);if(0!==n.resultCode||!t)return console.debug("session expired, opening new session"),Ne(!0),jt(void 0),ke(!1),void await Bn();if(Pt([]),Ce&&e.giverTag&&(null==Ht?void 0:Ht.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await Kt(e.engineMemoriID,u,"-");const t=await Kt(e.engineMemoriID,u,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");Nt(t.currentState,ze).then((e=>{e.emission&&an(e.emission)})).finally((()=>{Je(!0)}))}catch(t){console.error("session #2",t),qt(!0,null==e?void 0:e.secretToken,void 0,null==e?void 0:e.giverTag,null==e?void 0:e.giverPIN,{PATHNAME:window.location.pathname,ROUTE:(null===(o=null===(i=window.location.pathname)||void 0===i?void 0:i.split("/"))||void 0===o?void 0:o.pop())||"",...M||{}},T,m).then((()=>{Je(!0)}))}else if(!Ce&&P&&(null==Ht?void 0:Ht.currentTag)!==P.tag)try{console.debug("change tag #3"),await Kt(e.engineMemoriID,u,"-");const t=await Kt(e.engineMemoriID,u,P.tag,P.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");Nt(t.currentState,ze).then((e=>{e.emission&&an(e.emission)})).finally((()=>{Je(!0)}))}catch(t){console.error("session #5",t),qt(!0,null==e?void 0:e.secretToken,void 0,P.tag,P.pin,{PATHNAME:window.location.pathname,ROUTE:(null===(a=null===(s=window.location.pathname)||void 0===s?void 0:s.split("/"))||void 0===a?void 0:a.pop())||"",...M||{}},T,m).then((()=>{Je(!0)}))}else if(Ce||P||(null==Ht?void 0:Ht.currentTag)===up)Nt(t,ze).then((e=>{e.emission&&an(e.emission)})).finally((()=>{Je(!0)}));else try{console.debug("change tag #6"),await Kt(e.engineMemoriID,u,"-");const t=await Kt(e.engineMemoriID,u,up);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");Nt(t.currentState,ze).then((e=>{e.emission&&an(e.emission)})).finally((()=>{Je(!0)}))}catch(t){console.error("session #8",t),qt(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,{PATHNAME:window.location.pathname,ROUTE:(null===(c=null===(l=window.location.pathname)||void 0===l?void 0:l.split("/"))||void 0===c?void 0:c.pop())||"",...M||{}},T,m).then((()=>{Je(!0)}))}}else Pt([]),Nt(d,ze).then((e=>{e.emission&&an(e.emission)})).finally((()=>{Je(!0)}))}else Ft(!0),ke(!1)}),[vt,e,bt,Lt,Ut,ze]);(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?Me(t.target.getAttribute("authtoken")||void 0):Me((null===(i=null===(r=t.target)||void 0===r?void 0:r.parentElement)||void 0===i?void 0:i.getAttribute("authtoken"))||void 0))}));return n.observe(t,{attributes:!0,childList:!1,subtree:!1}),()=>{n.disconnect()}}),[]);const[zn,Fn]=(0,c.useState)(),Un=(0,c.useCallback)((async()=>{if(Ut&&(null==e?void 0:e.enableBoardOfExperts))try{const{experts:e,count:t,...n}=await we(Ut);0===n.resultCode?Fn(e):console.warn("Error fetching experts",n)}catch(e){console.warn(e)}}),[Ut,null==e?void 0:e.enableBoardOfExperts]);(0,c.useEffect)((()=>{Un()}),[Ut,Un]);const jn=void 0===x?"TOTEM"!==a&&"WEBSITE_ASSISTANT"!==a:!x,Hn={memori:e,tenant:R,history:Rt,showShare:null===(ne=null!=d?d:null==Le?void 0:Le.showShare)||void 0===ne||ne,position:Ct,setShowPositionDrawer:$e,setShowSettingsDrawer:et,setShowKnownFactsDrawer:nt,setShowExpertsDrawer:it,showSpeaker:!!O,speakerMuted:ot||GU,setSpeakerMuted:e=>{if(GU=!!e,st(e),pU("muteSpeaker",!!e),e)ln();else{HU=new Wo;let e=HU.createBuffer(1,1e4,22050),t=HU.createBufferSource();t.buffer=e,t.connect(HU.destination)}},showSettings:v,hasUserActivatedSpeak:Ke,showReload:"TOTEM"===qe,showClear:b,clearHistory:()=>Pt((e=>e.slice(-1))),showLogin:S,setShowLoginDrawer:Re,loginToken:Ee,user:Te,sessionID:Ut},Vn={memori:e,integration:o,integrationConfig:Le,tenant:R,instruct:Ce,avatar3dVisible:kn,setAvatar3dVisible:On,hasUserActivatedSpeak:Ke,isPlayingAudio:dt&&!ot,loading:!!He,baseUrl:A,apiUrl:E},Gn={memori:e,tenant:R,gamificationLevel:Nn,language:De,userLang:ze,setUserLang:Fe,baseUrl:A,apiUrl:E,position:Ct,openPositionDrawer:()=>$e(!0),integrationConfig:Le,instruct:Ce,sessionId:Ut,clickedStart:Pe,onClickStart:Bn,initializeTTS:()=>{if(!O)return;FU=ms.SpeechConfig.fromSubscription(O,"eastus"),FU.speechSynthesisLanguage=nn(ze),FU.speechSynthesisVoiceName=tn(ze),FU.speechRecognitionLanguage=nn(ze),vd()&&(FU.speechSynthesisOutputFormat=ms.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3),HU=new Wo;let e=HU.createBuffer(1,1e4,22050),t=HU.createBufferSource();t.buffer=e,t.connect(HU.destination),jU=new ms.SpeakerAudioDestination;let n=ms.AudioConfig.fromSpeakerOutput(jU);UU=new ms.SpeechSynthesizer(FU,n)},isUserLoggedIn:!!Ee&&!!(null==Te?void 0:Te.userID),showLogin:S,setShowLoginDrawer:Re,user:Te},Wn={memori:e,sessionID:Ut||"",tenant:R,translateTo:Be&&ze.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:ue.language)&&void 0!==se?se:"IT")||void 0===ae?void 0:ae.toUpperCase())?ze:void 0,baseUrl:A,apiUrl:E,layout:a,memoriTyping:He,typingText:Ge,showTypingText:y,history:jn?Rt:Rt.slice(-2),authToken:Ee,dialogState:Ht,setDialogState:Gt,pushMessage:kt,simulateUserPrompt:(e,t)=>{vn(),ln(),Ot(e,void 0,void 0,!1,t)},showDates:m,showContextPerLine:g,showAIicon:Pn,client:he,selectReceiverTag:async n=>{var r;if(Ut)try{const{currentState:i,...o}=await be(Ut,n);if(0===o.resultCode)if(kt({text:n,fromUser:!0}),"X4"===i.state&&e.giverTag){const{currentState:n,...r}=await he.postTagChangedEvent(Ut,e.giverTag);0===r.resultCode?(Gt(n),n.emission&&kt({text:n.emission,emitter:n.emitter,media:n.media,fromUser:!1})):(console.error(r),t(Ss).error(ce(vU(r.resultCode))))}else Gt(i),i.emission&&kt({text:i.emission,emitter:i.emitter,media:i.media,fromUser:!1});else console.error(o,n,null===(r=null==Ht?void 0:Ht.knownTags)||void 0===r?void 0:r[n]),t(Ss).error(ce(vU(o.resultCode)))}catch(e){let n=e;console.error(n),t(Ss).error(n.message)}},preview:p,sendOnEnter:Cn,setSendOnEnter:An,microphoneMode:at?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen:En,setAttachmentsMenuOpen:Mn,instruct:Ce,showInputs:f,showMicrophone:!!O,userMessage:Mt,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return Tt(""),void $t();Tt(e),Xt()},sendMessage:e=>{ln(),vn(),Ot(e),Tt(""),dn()},stopListening:yn,startListening:gn,stopAudio:ln,resetTranscript:dn,listening:_t,isPlayingAudio:dt,customMediaRenderer:z,user:Te,userAvatar:F,experts:zn},qn=o&&_n?(0,s.jsx)("div",{className:"memori--global-background",children:(0,s.jsx)("div",{className:"memori--global-background-image",style:{backgroundImage:_n}})}):(0,s.jsx)("div",{className:"memori--global-background no-background-image"}),Kn=o?(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:Rn}}):null,Jn={canInstruct:!!e.giverTag,instruct:!!Ce,onChangeMode:e=>{Ae("instruct"===e),Je(!1),ke(!1)}},Qn=(0,s.jsx)(hD,{tenant:R,userLang:ze,integrationID:null==o?void 0:o.integrationID,memoriHash:`${e.ownerTenantName}-${e.ownerUserName}-${e.name}`}),Yn=l||("TOTEM"===qe?MU:"CHAT"===qe?TU:"FULLPAGE"===qe?EU:"WEBSITE_ASSISTANT"===qe?_U:EU);return(0,s.jsxs)("div",{className:t(ys)("memori","memori-widget",`memori-layout-${a.toLowerCase()}`,`memori-controls-${ht.toLowerCase()}`,`memori--avatar-${(null==Le?void 0:Le.avatar)||"default"}`,{"memori--preview":p,"memori--embed":h,"memori--with-integration":o,"memori--with-speechkey":!!O,"memori--active":Ke,"memori--hide-emissions":mt,"memori--has-active-session":!!Ut}),"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":Ut,"data-memori-integration":null==o?void 0:o.integrationID,"data-memori-engine-state":JSON.stringify({...Ht,sessionID:Ut}),style:{height:w},children:[(0,s.jsx)(Yn,{Header:pD,headerProps:Hn,Avatar:sN,avatarProps:Vn,Chat:um,chatProps:Wn,StartPanel:vm,startPanelProps:Gn,integrationStyle:Kn,integrationBackground:qn,ChangeMode:aN,changeModeProps:Jn,poweredBy:Qn,sessionId:Ut,hasUserActivatedSpeak:Ke,showInstruct:u,loading:Ue}),(0,s.jsx)("audio",{id:"memori-audio",style:{display:"none"},src:"https://aisuru.com/intro.mp3"}),de&&(0,s.jsx)(gd,{withModal:!0,pwdOrTokens:xt,openModal:!!xt,setPwdOrTokens:wt,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{var n,r;t.password&&yt(t.password),t.password&&(VU=t.password),t.tokens&&St(t.tokens),qt(!Ut,t.password,t.tokens,Ce?e.giverTag:null==P?void 0:P.tag,Ce?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,Lt).then((e=>{wt(null),Bn(e||void 0)})).catch((()=>{wt(null),Ne(!0)}))},minimumNumberOfRecoveryTokens:null!==(le=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==le?le:1}),de&&(0,s.jsx)(sU,{visible:zt,minAge:Dt,onClose:t=>{var n,r;t?(Bt(t),pU("birthDate",t),qt(!Ut,VU||vt||(null==e?void 0:e.secretToken),bt,Ce?e.giverTag:null==P?void 0:P.tag,Ce?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,t).then((e=>{Ft(!1),wt(null),Bn(e||void 0)})).catch((()=>{Ft(!1),Ne(!0)}))):(Ft(!1),ke(!1))}}),Ze&&(0,s.jsx)(mU,{layout:qe,open:!!Ze,onClose:()=>et(!1),microphoneMode:at?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout:ct,setMicrophoneMode:e=>lt("CONTINUOUS"===e),setContinuousSpeechTimeout:ut,controlsPosition:ht,setControlsPosition:ft,hideEmissions:mt,setHideEmissions:gt,additionalSettings:B}),tt&&Ut&&(0,s.jsx)(xU,{apiURL:E,memori:e,sessionID:Ut,visible:tt,closeDrawer:()=>nt(!1)}),rt&&!!zn&&(0,s.jsx)(wU,{apiUrl:E,baseUrl:A,tenant:R,experts:zn,open:rt,onClose:()=>it(!1)}),Ie&&(null==R?void 0:R.id)&&(0,s.jsx)(AU,{tenant:R,apiUrl:E,open:!!Ie,user:Te,loginToken:Ee,onClose:()=>Re(!1),onLogin:(e,t)=>{_e(e),Me(t),Re(!1),pU("loginToken",t)},onLogout:()=>{Ee&&he.backend.userLogout(Ee).then((()=>{Re(!1),_e(void 0),Me(void 0),hU("loginToken")}))}})]})};const KU={id:"aisuru.com",theme:"aisuru",config:{name:"Memori",showNewUser:!1,requirePosition:!1}},JU=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||{...KU,tenantID:e}}catch(t){return{...KU,tenantID:e}}};function QU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YU(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,WO(r.key),r)}}function XU(e,t,n){return t&&YU(e.prototype,t),n&&YU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $U(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZU(e,t){return ZU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ZU(e,t)}function ej(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&&ZU(e,t)}function tj(e,t){if(t&&("object"===VO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $U(e)}function nj(e){return nj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},nj(e)}function rj(e){if(Array.isArray(e))return e}function ij(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function oj(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 sj(e,t){if(e){if("string"==typeof e)return oj(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)?oj(e,t):void 0}}function aj(){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 lj(e){return rj(e)||ij(e)||sj(e)||aj()}function cj(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 uj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var dj={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)}},pj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};QU(this,e),this.init(t,n)}return XU(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||dj,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,uj(uj({},{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}(),hj=new pj,fj=function(){function e(){QU(this,e),this.observers={}}return XU(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 mj(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function gj(e){return null==e?"":""+e}function vj(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function yj(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 bj(e,t,n){var r=yj(e,t,Object);r.obj[r.k]=n}function Sj(e,t){var n=yj(e,t),r=n.obj,i=n.k;if(r)return r[i]}function xj(e,t,n){var r=Sj(e,n);return void 0!==r?r:Sj(t,n)}function wj(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]):wj(e[r],t[r],n):e[r]=t[r]);return e}function Cj(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Aj={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Ej(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return Aj[e]})):e}var Mj="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Tj=[" ",",","?","!",";"];function _j(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 Ij(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_j(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Rj(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=nj(e);if(t){var i=nj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return tj(this,n)}}function Pj(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?Pj(l,c,n):void 0}i=i[r[o]]}return i}}var kj=function(e){ej(n,e);var t=Rj(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return QU(this,n),r=t.call(this),Mj&&fj.call($U(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 XU(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=Sj(this.data,s);return a||!o||"string"!=typeof n?a:Pj(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),bj(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=Sj(this.data,s)||{};r?wj(a,n,i):a=Ij(Ij({},a),n),bj(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?Ij(Ij({},{}),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}(fj),Oj={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 Nj(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 Dj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Lj(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=nj(e);if(t){var i=nj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return tj(this,n)}}var Bj={},zj=function(e){ej(n,e);var t=Lj(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return QU(this,n),r=t.call(this),Mj&&fj.call($U(r)),vj(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,$U(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=hj.create("translator"),r}return XU(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=Tj.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var i=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),o=!i.test(e);if(!o){var s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o}(e,n,r));if(o&&!s){var a=e.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:e,namespaces:i};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(i=l.shift()),e=l.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,r){var i=this;if("object"!==VO(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],t),l=a.key,c=a.namespaces,u=c[c.length-1],d=t.lng||this.language,p=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(p){var h=t.nsSeparator||this.options.nsSeparator;return o?(f.res="".concat(u).concat(h).concat(l),f):"".concat(u).concat(h).concat(l)}return o?(f.res=l,f):l}var f=this.resolve(e,t),m=f&&f.res,g=f&&f.usedKey||l,v=f&&f.exactUsedKey||l,y=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],S=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,w="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(x&&m&&w&&b.indexOf(y)<0&&("string"!=typeof S||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,Dj(Dj({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return o?(f.res=C,f):C}if(s){var A="[object Array]"===y,E=A?[]:{},M=A?v:g;for(var T in m)if(Object.prototype.hasOwnProperty.call(m,T)){var _="".concat(M).concat(s).concat(T);E[T]=this.translate(_,Dj(Dj({},t),{joinArrays:!1,ns:c})),E[T]===_&&(E[T]=m[T])}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,Dj(Dj({},t),{},{keySeparator:!1}));z&&z.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var F=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&U&&U[0])for(var j=0;j<U.length;j++)F.push(U[j]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var H=function(e,n,r){var o=k&&r!==m?r: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?F.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],l+n,t["defaultValue".concat(n)]||N)}))})):H(F,l,N))}m=this.extendTranslation(m,e,t,f,r),R&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(u,":").concat(l)),(R||I)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(l):l,I?m:void 0):this.options.parseMissingKeyHandler(m))}return o?(f.res=m,f):m}},{key:"extendTranslation",value:function(e,t,n,r,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,Dj(Dj({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(Dj(Dj({},n),{interpolation:Dj(Dj({},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=Dj(Dj({},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=Oj.handle(p,e,t,this.options&&this.options.postProcessPassResolved?Dj({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,!Bj["".concat(f[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(Bj["".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}(fj);function Fj(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Uj=function(){function e(t){QU(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=hj.create("languageUtils")}return XU(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]=Fj(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]=Fj(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Fj(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}(),jj=[{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}],Hj={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)}},Vj=["v1","v2","v3"],Gj={zero:0,one:1,two:2,few:3,many:4,other:5};function Wj(){var e={};return jj.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:Hj[t.fc]}}))})),e}var qj=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};QU(this,e),this.languageUtils=t,this.options=n,this.logger=hj.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=Wj()}return XU(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 Gj[e]-Gj[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!Vj.includes(this.options.compatibilityJSON)}}]),e}();function Kj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Jj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kj(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};QU(this,e),this.logger=hj.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return XU(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:Ej,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?Cj(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?Cj(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?Cj(t.nestingPrefix):t.nestingPrefixEscaped||Cj("$t("),this.nestingSuffix=t.nestingSuffix?Cj(t.nestingSuffix):t.nestingSuffixEscaped||Cj(")"),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=xj(t,l,e);return a.alwaysFormat?a.format(i,void 0,n,Jj(Jj(Jj({},r),t),{},{interpolationkey:e})):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(xj(t,l,s),c,n,Jj(Jj(Jj({},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=gj(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=Jj({},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=Jj(Jj({},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=gj(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,Jj(Jj({},o),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),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){qO(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}function $j(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 Zj=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};QU(this,e),this.logger=hj.create("formatter"),this.options=t,this.formats={number:$j((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:$j((function(e,t){var n=new Intl.NumberFormat(e,Xj(Xj({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:$j((function(e,t){var n=new Intl.DateTimeFormat(e,Xj({},t));return function(e){return n.format(e)}})),relativetime:$j((function(e,t){var n=new Intl.RelativeTimeFormat(e,Xj({},t));return function(e){return n.format(e,t.range||"day")}})),list:$j((function(e,t){var n=new Intl.ListFormat(e,Xj({},t));return function(e){return n.format(e)}}))},this.init(t)}return XU(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()]=$j(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=lj(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,Xj(Xj(Xj({},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 eH(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 tH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eH(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nH(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=nj(e);if(t){var i=nj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return tj(this,n)}}var rH=function(e){ej(n,e);var t=nH(n);function n(e,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return QU(this,n),o=t.call(this),Mj&&fj.call($U(o)),o.backend=e,o.store=r,o.services=i,o.languageUtils=i.languageUtils,o.options=s,o.logger=hj.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 XU(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=yj(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,tH(tH({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(fj);function iH(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===VO(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===VO(e[2])||"object"===VO(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function oH(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 sH(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 aH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sH(Object(n),!0).forEach((function(t){qO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sH(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function lH(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=nj(e);if(t){var i=nj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return tj(this,n)}}function cH(){}function uH(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var dH=function(e){ej(n,e);var t=lH(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(QU(this,n),e=t.call(this),Mj&&fj.call($U(e)),e.options=oH(r),e.services={},e.logger=hj,e.modules={external:[]},uH($U(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),tj(e,$U(e));setTimeout((function(){e.init(r,i)}),0)}return e}return XU(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=iH();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=aH(aH(aH({},r),this.options),oH(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=aH(aH({},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?hj.init(i(this.modules.logger),this.options):hj.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=Zj);var s=new Uj(this.options);this.store=new kj(this.options.resources,this.options);var a=this.services;a.logger=hj,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 Qj(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new rH(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 zj(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=cH),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=mj(),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]:cH,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=mj();return e||(e=this.languages),t||(t=this.options.ns),n||(n=cH),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&&Oj.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=mj();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},o=function(o){e||o||!n.services.languageDetector||(o=[]);var s="string"==typeof o?o:n.services.languageUtils.getBestMatchFromCodes(o);s&&(n.language||i(s),n.translator.language||n.translator.changeLanguage(s),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(s)),n.loadResources(s,(function(e){!function(e,o){o?(i(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,s)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,i=function e(t,i){var o;if("object"!==VO(i)){for(var s=arguments.length,a=new Array(s>2?s-2:0),l=2;l<s;l++)a[l-2]=arguments[l];o=r.options.overloadTranslationOptionHandler([t,i].concat(a))}else o=aH({},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=mj();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=mj();"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]:cH,i=aH(aH(aH({},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=aH({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new zj(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}(fj);qO(dH,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new dH(e,t)}));var pH=dH.createInstance();pH.createInstance=dH.createInstance;var hH,fH=pH.createInstance;pH.init,pH.loadResources,pH.reloadResources,pH.use,pH.changeLanguage,pH.getFixedT,pH.t,pH.exists,pH.setDefaultNamespace,pH.hasLoadedNamespace,pH.loadNamespaces,pH.loadLanguages;hH=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!","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","USER_NOT_CONFIRMED":"Utente ancora non confermato","USER_NOT_FOUND":"Utente non trovato","USER_OR_PASSWORD_INVALID":"Utente o password non validi","USER_MUST_CHANGE_PASSWORD":"Devi cambiare la password","USER_MUST_ENTER_VERIFICATION_CODE":"Devi inserire il codice di verifica","USER_MISSING_TENANT":"Utente: tenant mancante","USER_MISSING_NAME":"Utente: nome mancante","USER_MISSING_PASSWORD":"Utente: password mancante","USER_MISSING_EMAIL":"Utente: email mancante","USER_MISSING_VERIFICATION_CODE":"Utente: codice di verifica mancante","USER_NAME_ALREADY_USED":"Nome utente già in uso","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"La password non rispetta le regole di sicurezza","USER_EMAIL_ALREADY_USED":"Email già in uso","USER_EMAIL_INVALID":"Email non valida","USER_VERIFICATION_CODE_INVALID":"Codice di verifica non valido","USER_MISSING_NAME_OR_EMAIL":"Nome utente o email mancante","USER_NAME_INVALID":"Nome utente non valido","USER_HAS_ONE_OR_MORE_MEMORI":"L\'utente ha uno o più memori","USER_MISSING_NEW_PASSWORD":"Utente: nuova password mancante","USER_NOTHING_TO_DO":"Niente da fare","USER_CANT_CREATE_MEMORI":"Utente non abilitato a creare Memori","USER_MAX_MEMORI_REACHED":"Massimo numero di Memori raggiunto","USER_CANT_EDIT_INTEGRATIONS":"Utente non abilitato a gestire integrazioni","MEMORI_NOT_FOUND":"Memori non trovato","MEMORI_NOT_ACCESSIBLE":"Memori non accessibile","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Solo il proprietario può cambiare il tag e il pin","SESSION_NOT_FOUND":"Sessione non trovata","SESSION_IS_NOT_ADMINISTRATIVE":"Sessione non amministrativa","MEMORI_MISSING_CONFIGURATION":"Memori: configurazione mancante","MEMORI_CONFIGURATION_NOT_FOUND":"Memori: configurazione non trovata","MEMORI_INVALID_PRIVACY_TYPE":"Memori: tipo di privacy non valido","MEMORI_MISSING_PASSWORD":"Memori: password mancante","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero totale di token di recupero non valido","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero minimo di token di recupero non valido","MEMORI_INVALID_VOICE_TYPE":"Memori: tipo di voce non valido","MEMORI_MISSING_NAME":"Memori: nome mancante","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memori: password o token di recupero mancanti","MEMORI_INVALID_ID":"Memori: ID non valido","MEMORI_NAME_ALREADY_USED":"Nome memori già in uso","MEMORI_INVALID_PIN":"Memori: PIN non valido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memori: cambio TAG e PIN richiedono operazioni separate","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memori: password non richiesta su Memori pubblico","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Trasferimento: utente di destinazione mancante","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Trasferimento: ID utente di destinazione non valido","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Trasferimento: dati utente di destinazione non validi","MEMORI_TRANSFER_NOTHING_TO_DO":"Trasferimento: alcuna operazione da fare","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memori: la configurazione non può essere modificata","MEMORI_MISSING_NEW_PASSWORD":"Memori: nuova password mancante","INTEGRATION_NOT_FOUND":"Integrazione non trovata","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Formato non valido data a partire da","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Formato non valido data fino a","INTEGRATION_INVALID_TYPE":"Tipo integrazione non valido","INTEGRATION_ALREADY_EXISTS":"Integrazione già esistente","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Memori non pubblici non possono essere integrati","INTEGRATION_MISSING_INVOCATION_TEXT":"Integrazione: testo di invocazione mancante","INTEGRATION_MISSING_DEVICE_EMAILS":"Integrazione: email del dispositivo mancante","INTEGRATION_MEMORI_IS_EMPTY":"Memori vuoti non possono essere integrati","INTEGRATION_MISSING_PRIVACY_POLICY":"Integrazione: privacy policy mancante","INTEGRATION_MISSING_CATEGORY":"Categoria integrazione mancante","INTEGRATION_MISSING_DESCRIPTION":"Descrizione integrazione mancante","INTEGRATION_INVALID_INVOCATION_TEXT":"Testo di invocazione non valido","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home non più disponibile","UPLOAD_REQUIRES_MULTIPART_ENCODING":"L\'upload richiede l\'encoding multipart","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: manca il content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: dimensione massima superata","UPLOAD_FILE_IS_EMPTY":"Upload: file vuoto","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: tipo di file o firma non validi","UPLOAD_MISSING_FILE_NAME":"Upload: nome file mancante","UPLOAD_INVALID_MEMORY_ID":"Upload: ID contenuto non valido","UPLOAD_MISSING_FILE_CONTENT":"Upload: contenuto file mancante","ASSET_NOT_FOUND":"Asset non trovato","ASSET_NOT_ACCESSIBLE":"Asset non accessibile","ASSET_MISSING_SESSION_ID":"Asset: ID sessione mancante","ASSET_INVALID_FILE_NAME":"Asset: nome file non valido","INVITATION_NOT_FOUND":"Invito non trovato","INVITATION_NOT_ACCESSIBLE":"Invito non accessibile","INVITATION_ALREADY_ACCEPTED":"Invito già accettato","INVITATION_ALREADY_REJECTED":"Invito già rifiutato","INVITATION_MISSING_DESTINATION_EMAIL":"Invito: email di destinazione mancante","INVITATION_DESTINATION_EMAIL_INVALID":"Invito: email di destinazione non valida","INVITATION_MISSING_TAG":"Invito: tag mancante","INVITATION_MISSING_PIN":"Invito: PIN mancante","INVITATION_INVALID_PIN":"Invito: PIN non valido","INVITATION_INVALID_TYPE":"Invito: tipo non valido","INVITATION_MISSING_DESTINATION_NAME":"Invito: nome destinatario mancante","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invito: tag e pin non possono essere cambiati","INVITATION_CANT_BE_CHANGED":"Invito: non può essere modificato","ACTIONLOG_INVALID_USER_ID":"ID utente non valido","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","ACTIONLOG_INVALID_MEMORI_ID":"ID Memori non valido","CONSUMPTIONLOG_INVALID_TYPE":"Tipo di log non valido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","CONSUMPTIONLOG_INVALID_USER_ID":"ID utente non valido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Memori ID non valido"}}');const mH=fH({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!","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","USER_NOT_CONFIRMED":"User still not confirmed","USER_NOT_FOUND":"User not found","USER_OR_PASSWORD_INVALID":"Invalid user or password","USER_MUST_CHANGE_PASSWORD":"You must change your password","USER_MUST_ENTER_VERIFICATION_CODE":"You must enter the verification code","USER_MISSING_TENANT":"User: missing tenant","USER_MISSING_NAME":"User: name is missing","USER_MISSING_PASSWORD":"User: password missing","USER_MISSING_EMAIL":"User: Missing email","USER_MISSING_VERIFICATION_CODE":"User: Missing verification code","USER_NAME_ALREADY_USED":"User name already in use","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"The password does not meet the security rules","USER_EMAIL_ALREADY_USED":"Email already in use","USER_EMAIL_INVALID":"Invalid email","USER_VERIFICATION_CODE_INVALID":"Invalid verification code","USER_MISSING_NAME_OR_EMAIL":"Missing username or email","USER_NAME_INVALID":"Invalid user name","USER_HAS_ONE_OR_MORE_MEMORI":"The user has one or more memories","USER_MISSING_NEW_PASSWORD":"User: new password missing","USER_NOTHING_TO_DO":"Nothing to do","USER_CANT_CREATE_MEMORI":"User not allowed to create Memori","USER_MAX_MEMORI_REACHED":"Maximum number of Memori reached","USER_CANT_EDIT_INTEGRATIONS":"User not allowed to manage integrations","MEMORI_NOT_FOUND":"Memori not found","MEMORI_NOT_ACCESSIBLE":"Memori not accessible","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Only owner can change tag or pin","SESSION_NOT_FOUND":"Session not found","SESSION_IS_NOT_ADMINISTRATIVE":"Non-administrative session","MEMORI_MISSING_CONFIGURATION":"Memori: missing configuration","MEMORI_CONFIGURATION_NOT_FOUND":"Memories: configuration not found","MEMORI_INVALID_PRIVACY_TYPE":"Memories: invalid privacy type","MEMORI_MISSING_PASSWORD":"Memori: missing password","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memories: total number of invalid recovery tokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memories: minimum number of invalid recovery tokens","MEMORI_INVALID_VOICE_TYPE":"Memories: invalid voice type","MEMORI_MISSING_NAME":"Memories: missing name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memories: missing password or recovery token","MEMORI_INVALID_ID":"Memories: invalid ID","MEMORI_NAME_ALREADY_USED":"Memory name already in use","MEMORI_INVALID_PIN":"Memories: Invalid PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memories: TAG and PIN change require separate operations","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memories: no password required when public","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transfer: missing destination user","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transfer: invalid destination user ID","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transfer: invalid destination user data","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfer: nothing to do","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memories: configuration cannot be changed","MEMORI_MISSING_NEW_PASSWORD":"Memories: new password missing","INTEGRATION_NOT_FOUND":"Integration not found","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Invalid date from format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Invalid date to format","INTEGRATION_INVALID_TYPE":"Invalid integration type","INTEGRATION_ALREADY_EXISTS":"Integration already exists","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Non-public memories cannot be integrated","INTEGRATION_MISSING_INVOCATION_TEXT":"Integration: missing invocation text","INTEGRATION_MISSING_DEVICE_EMAILS":"Integration: missing device email","INTEGRATION_MEMORI_IS_EMPTY":"Empty memories cannot be integrated","INTEGRATION_MISSING_PRIVACY_POLICY":"Integration: privacy policy missing","INTEGRATION_MISSING_CATEGORY":"Integration category missing","INTEGRATION_MISSING_DESCRIPTION":"Missing integration description","INTEGRATION_INVALID_INVOCATION_TEXT":"Invalid invocation text","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home no more available","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Upload requires multipart encoding","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: missing content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: maximum size exceeded","UPLOAD_FILE_IS_EMPTY":"Upload: empty file","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: invalid file type or signature","UPLOAD_MISSING_FILE_NAME":"Upload: missing file name","UPLOAD_INVALID_MEMORY_ID":"Upload: Invalid content ID","UPLOAD_MISSING_FILE_CONTENT":"Upload: Missing file content","ASSET_NOT_FOUND":"Asset not found","ASSET_NOT_ACCESSIBLE":"Asset not accessible","ASSET_MISSING_SESSION_ID":"Asset: missing session ID","ASSET_INVALID_FILE_NAME":"Asset: invalid file name","INVITATION_NOT_FOUND":"Invitation not found","INVITATION_NOT_ACCESSIBLE":"Invitation not accessible","INVITATION_ALREADY_ACCEPTED":"Invitation already accepted","INVITATION_ALREADY_REJECTED":"Invitation already rejected","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation: missing destination email","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation: destination email invalid","INVITATION_MISSING_TAG":"Invitation: missing tag","INVITATION_MISSING_PIN":"Invitation: PIN missing","INVITATION_INVALID_PIN":"Invitation: invalid PIN","INVITATION_INVALID_TYPE":"Invitation: invalid type","INVITATION_MISSING_DESTINATION_NAME":"Invitation: destination name missing","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation: tag and pin can\'t be changed","INVITATION_CANT_BE_CHANGED":"Intation: can\'t be changed","ACTIONLOG_INVALID_USER_ID":"Invalid user ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","ACTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","CONSUMPTIONLOG_INVALID_TYPE":"Invalid log type","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","CONSUMPTIONLOG_INVALID_USER_ID":"Invalid user ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID"}}'))},it:{translation:t(hH)}},lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});mH.init();var gH=mH;c=o("85Hg2");function vH(e){var t=e.i18n,n=e.defaultNS,r=e.children,i=(0,c.useMemo)((function(){return{i18n:t,defaultNS:n}}),[t,n]);return(0,c.createElement)(re.Provider,{value:i},r)}const yH=({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=!0,height:w="100%",baseURL:C,apiURL:A="https://backend.memori.ai",tag:E,pin:M,context:T,initialQuestion:_,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:F})=>{var U,j,H;const[V,G]=(0,c.useState)(),[W,K]=(0,c.useState)(),[J,Q]=(0,c.useState)(O),{t:Y}=ve();if(!(r&&t||n&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const X=q(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?G(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?G(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 JU(o,C);e&&K(e)}),[o,A]);(0,c.useEffect)((()=>{ee()}),[ee]),(0,c.useEffect)((()=>{if(I)gH.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"}})();gH.changeLanguage(e).catch((()=>{gH.changeLanguage(t)}))}}),[I]);const te=V?(0,s.jsx)(qU,{layout:u,customLayout:d,height:w,baseUrl:C||(o.startsWith("https://")?o:`https://${o}`),apiUrl:A,memori:{...V,secretToken:a},memoriLang:null!=R?R:null===(j=null===(U=V.culture)||void 0===U?void 0:U.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:x,integration:null===(H=null==V?void 0:V.integrations)||void 0===H?void 0:H.find((e=>i?e.integrationID===i:!!e.publish&&"LANDING_EXPERIENCE"===e.type)),initialContextVars:T,initialQuestion:_,authToken:k,AZURE_COGNITIVE_SERVICES_TTS_KEY:J||O,defaultSpeakerActive:N,onStateChange:D,additionalInfo:L,customMediaRenderer:B,additionalSettings:z,userAvatar:F,...E&&M?{personification:{tag:E,pin:M}}:{}}):(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)(vH,{i18n:gH,children:[(0,s.jsx)(Ss.Toaster,{position:"top-center",reverseOrder:!0}),te]})};yH.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 bH=yH;class SH 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(bH.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)(bH,{...r,context:o,tenantID:i,additionalInfo:l}),n):console.error("No tenantId attribute found")}}customElements.define("memori-client",SH)})();
|