@memori.ai/memori-webcomponent 9.0.5 → 9.0.6

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.
@@ -626,7 +626,7 @@ ${e.textAssetUrl||""}
626
626
 
627
627
  <attachment_link>
628
628
  ${e.textAssetUrl||""}
629
- </attachment_link>`;return{name:e.name,id:e.id,content:t,type:"document",mimeType:e.mimeType,url:e.textAssetUrl}});a(e=>[...e,...t])},authToken:e,client:t,sessionID:n,baseUrl:r,memoriID:s,maxDocuments:u,documentPreviewFiles:o,onLoadingChange:q,onDocumentError:e=>{U(e)},onValidateFile:e=>{var t;let n=`.${null==(t=e.name.split(".").pop())?void 0:t.toLowerCase()}`,r=[...kW,...kV,...kG];return r.includes(n)?!(e.size>0x1900000)||(U({message:`File "${e.name}" exceeds 25MB limit`,severity:"warning"}),!1):(U({message:`File type "${n}" is not supported. Please use: ${r.join(", ")}`,severity:"warning"}),!1)},onValidatePayloadSize:e=>({valid:!0})})}),(0,eh.jsx)("div",{className:"memori--hidden-uploader",ref:P,"aria-hidden":!0,children:(0,eh.jsx)(Vr,{authToken:e,client:t,setDocumentPreviewFiles:a,sessionID:n,documentPreviewFiles:o,isMediaAccepted:i,onLoadingChange:$,maxImages:u,memoriID:s,onImageError:e=>{U(e)},onValidateImageFile:e=>{var t;let n=`.${null==(t=e.name.split(".").pop())?void 0:t.toLowerCase()}`,r=[".jpg",".jpeg",".png"];return r.includes(n)||e.type.startsWith("image/")?!(e.size>0xf00000)||(U({message:`File "${e.name}" exceeds 15MB limit`,severity:"warning"}),!1):(U({message:`File type "${n}" is not supported. Please use: ${r.join(", ")}`,severity:"warning"}),!1)},onMediumSelectedState:p})})]})},em=ec("85Hg2"),Va=({previewFiles:e,removeFile:t,allowRemove:n=!0,showAnonymousRetentionNotice:r=!1,uploadingCount:i=0,maxDocumentsPerMessage:a=kZ})=>{var o;let{t:s}=tA(),[l,u]=(0,em.useState)(null),c=e=>{var t,n;if(!e)return!1;let r=null==(n=null==(t=e.name)?void 0:t.split(".").pop())?void 0:n.toLowerCase();return"document"===e.type&&("html"===r||"text/html"===e.mimeType)||"html"===r||"text/html"===e.mimeType},d=(e,t)=>{if("image"===t)return!0;let n=/\.(jpg|jpeg|png|gif|webp|svg)$/i.test(e);return e.startsWith("http")&&(e.includes("/image/")||e.includes("/img/")||n)||n},h=e=>e.mimeType?HG(e.mimeType,e.name):HG("application/octet-stream",e.name);return(0,eh.jsxs)(eh.Fragment,{children:[(e.length>0||i>0)&&(0,eh.jsxs)("div",{className:"memori--preview-container",children:[e.length>0&&(0,eh.jsxs)("div",{className:(b(tT))("memori--document-count",{"memori--document-count-full":e.length>=a}),children:[e.length,"/",a]}),r&&(0,eh.jsx)("small",{className:"memori--preview-retention-notice",children:s("upload.anonymousRetentionNotice",{defaultValue:"Note: uploaded files are retained for a maximum of 24 hours."})}),(0,eh.jsxs)("div",{className:"memori--preview-list",children:[e.map(e=>{let r=d(e.content,e.type);return(0,eh.jsxs)("div",{className:(b(tT))("memori--preview-item",{"memori--preview-item--image":r,"memori--preview-item--document":!r}),children:[(0,eh.jsx)("button",{type:"button",className:"memori--preview-item-trigger",onClick:()=>{if(k3(e.name||"")){let t=k8(e);t&&window.open(t,"_blank","noopener,noreferrer")}else u(e)},"aria-label":e.name,children:r?(0,eh.jsx)("div",{className:"memori--preview-thumbnail memori-media-item--image",children:(0,eh.jsx)("img",{src:e.content,alt:""})}):(0,eh.jsx)(GF,{title:e.name||"File",badge:h(e),icon:(0,eh.jsx)(GD,{className:"memori-media-item--document-icon-svg"})})}),n&&(0,eh.jsx)(yt,{shape:"circle",variant:"ghost",size:"sm",icon:(0,eh.jsx)(H2,{"aria-hidden":!0}),className:"memori--remove-button","aria-label":String(s("upload.removeFile",{defaultValue:"Remove {{name}}",name:e.name})),onClick:()=>t(e.id,null==e?void 0:e.mediumID)})]},e.id)}),i>0&&Array.from({length:i},(e,t)=>(0,eh.jsx)("div",{className:"memori--preview-item memori--preview-item--document memori--preview-item--skeleton",children:(0,eh.jsx)("div",{className:"memori-media-item--document",children:(0,eh.jsxs)("div",{className:"memori-media-item--document-header",children:[(0,eh.jsx)("div",{className:"memori--skeleton-icon"}),(0,eh.jsxs)("div",{className:"memori--preview-file-info",children:[(0,eh.jsx)("div",{className:"memori--skeleton-line memori--skeleton-line--name"}),(0,eh.jsx)("div",{className:"memori--skeleton-line memori--skeleton-line--type"})]})]})})},`skeleton-${t}`))]})]}),(0,eh.jsx)(Hv,{open:!!l,onClose:()=>u(null),title:null==l?void 0:l.name,description:l?h(l):void 0,headerIcon:l&&!d(l.content,l.type)?(0,eh.jsx)(GD,{"aria-hidden":!0}):void 0,className:"memori-file-preview-modal",contentKind:!l||d(l.content,l.type)||c(l)?"snippet":"document",isImage:!!l&&d(l.content,l.type),imageSrc:l&&d(l.content,l.type)?l.content:void 0,imageAlt:null!=(o=null==l?void 0:l.name)?o:"",children:l&&!d(l.content,l.type)&&(c(l)?(0,eh.jsx)(Go,{preview:!1,medium:{mediumID:l.id,mimeType:"application/xml",content:(e=>{if(!(null==e?void 0:e.content))return"";let t=e.content;if(c(e)){let e=t;return(e.includes("&lt;")||e.includes("&quot;"))&&(e=Le(e)||e),e=k6(e)}return Le(k6(t))})(l),title:l.name}}):(0,eh.jsx)(GU,{content:l.content}))})]})},Vo=({dialogState:e,userMessage:t="",sendOnEnter:n,onChangeUserMessage:r,sendMessage:i,onMediumSelectedState:a,onTextareaFocus:o,onTextareaBlur:s,showMicrophone:l=!1,listening:u=!1,stopAudio:c,startListening:d,stopListening:h,audioStream:p,transcribing:m=!1,showUpload:f=!1,isTyping:g=!1,sessionID:v,authToken:y,memoriID:_,baseUrl:x,client:w,onTextareaExpanded:S,maxTotalMessagePayload:E,maxTextareaCharacters:A,maxDocumentsPerMessage:T,maxDocumentContentLength:I,pasteAsCardLineThreshold:C,pasteAsCardCharThreshold:M,showAiGeneratedNote:N=!0,footerBrand:R})=>{let{t:O}=tA(),P=vZ(),[k,D]=(0,em.useState)(!1),[B,F]=(0,em.useState)(0),U=(0,em.useCallback)((e,t)=>{F(e?null!=t?t:1:0)},[]),[j,z]=(0,em.useState)([]),{dialog:H}=w||{dialog:{postMediumDeselectedEvent:null}},G=(e,n=t)=>{g||(i(n,e.map((e,t)=>({mediumID:e.mediumID||`file_${Date.now()}_${t}_${Math.random().toString(36).substr(2,9)}`,mimeType:e.mimeType,content:e.content,title:e.name,properties:{isAttachedFile:!0},type:e.type,url:e.url}))),z([]),c(),speechSynthesis.speak(new SpeechSynthesisUtterance("")))},V=async(e,t)=>{H.postMediumDeselectedEvent&&v&&t&&await H.postMediumDeselectedEvent(v,t),z(t=>t.filter(t=>t.id!==e))},W=(0,em.useCallback)(e=>{var n,r;if(null==(n=e.clipboardData.files)?void 0:n.length)return;let i=e.clipboardData.getData("text/plain");if(!(null==i?void 0:i.trim()))return;let a=e.target,o=a.selectionEnd-a.selectionStart,s=t.length-o+i.length;if(null!=A&&s>A){e.preventDefault(),P.add({id:`paste-content-exceeds-limit-${Date.now()}`,title:O("upload.pasteContentExceedsLimit",{defaultValue:"Pasted content exceeds the size limit. Try shortening the text or splitting it into smaller parts."}),data:{severity:"error",closable:!0}});return}let l=i.split(/\r?\n/).length;if(!(i.length>(null!=M?M:4200))&&!(l>(null!=C?C:100)))return;let u=null!=T?T:10;if(j.length>=u){e.preventDefault(),P.add({id:`paste-max-attachments-reached-${Date.now()}`,title:O("upload.pasteMaxAttachmentsReached",{max:u,defaultValue:`Maximum ${u} attachments. Remove one to add this as a file.`}),data:{severity:"error",closable:!0}});return}let c=null!=(r=null!=E?E:I)?r:3e5;if(i.length>c){e.preventDefault(),P.add({id:`paste-content-exceeds-per-document-limit-${Date.now()}`,title:O("upload.pasteContentExceedsLimit",{defaultValue:"Pasted content exceeds the size limit. Try shortening the text or splitting it into smaller parts."}),data:{severity:"error",closable:!0}});return}e.preventDefault();let d=O("upload.pastedText")||"pasted-text",h=`<document_attachment filename="pasted-text.txt" type="text/plain">
629
+ </attachment_link>`;return{name:e.name,id:e.id,content:t,type:"document",mimeType:e.mimeType,url:e.textAssetUrl}});a(e=>[...e,...t])},authToken:e,client:t,sessionID:n,baseUrl:r,memoriID:s,maxDocuments:u,documentPreviewFiles:o,onLoadingChange:q,onDocumentError:e=>{U(e)},onValidateFile:e=>{var t;let n=`.${null==(t=e.name.split(".").pop())?void 0:t.toLowerCase()}`,r=[...kW,...kV,...kG];return r.includes(n)?!(e.size>0x1900000)||(U({message:`File "${e.name}" exceeds 25MB limit`,severity:"warning"}),!1):(U({message:`File type "${n}" is not supported. Please use: ${r.join(", ")}`,severity:"warning"}),!1)},onValidatePayloadSize:e=>({valid:!0})})}),(0,eh.jsx)("div",{className:"memori--hidden-uploader",ref:P,"aria-hidden":!0,children:(0,eh.jsx)(Vr,{authToken:e,client:t,setDocumentPreviewFiles:a,sessionID:n,documentPreviewFiles:o,isMediaAccepted:i,onLoadingChange:$,maxImages:u,memoriID:s,onImageError:e=>{U(e)},onValidateImageFile:e=>{var t;let n=`.${null==(t=e.name.split(".").pop())?void 0:t.toLowerCase()}`,r=[".jpg",".jpeg",".png"];return r.includes(n)||e.type.startsWith("image/")?!(e.size>0xf00000)||(U({message:`File "${e.name}" exceeds 15MB limit`,severity:"warning"}),!1):(U({message:`File type "${n}" is not supported. Please use: ${r.join(", ")}`,severity:"warning"}),!1)},onMediumSelectedState:p})})]})},em=ec("85Hg2"),Va=({previewFiles:e,removeFile:t,allowRemove:n=!0,showAnonymousRetentionNotice:r=!1,uploadingCount:i=0,maxDocumentsPerMessage:a=kZ})=>{var o;let{t:s}=tA(),[l,u]=(0,em.useState)(null),c=e=>{var t,n;if(!e)return!1;let r=null==(n=null==(t=e.name)?void 0:t.split(".").pop())?void 0:n.toLowerCase();return"document"===e.type&&("html"===r||"text/html"===e.mimeType)||"html"===r||"text/html"===e.mimeType},d=(e,t)=>{if("image"===t)return!0;let n=/\.(jpg|jpeg|png|gif|webp|svg)$/i.test(e);return e.startsWith("http")&&(e.includes("/image/")||e.includes("/img/")||n)||n},h=e=>e.mimeType?HG(e.mimeType,e.name):HG("application/octet-stream",e.name);return(0,eh.jsxs)(eh.Fragment,{children:[(e.length>0||i>0)&&(0,eh.jsxs)("div",{className:"memori--preview-container",children:[e.length>0&&(0,eh.jsxs)("div",{className:(b(tT))("memori--document-count",{"memori--document-count-full":e.length>=a}),children:[e.length,"/",a]}),r&&(0,eh.jsx)("small",{className:"memori--preview-retention-notice",children:s("upload.anonymousRetentionNotice",{defaultValue:"Note: uploaded files are retained for a maximum of 24 hours."})}),(0,eh.jsxs)("div",{className:"memori--preview-list",children:[e.map(e=>{let r=d(e.content,e.type);return(0,eh.jsxs)("div",{className:(b(tT))("memori--preview-item",{"memori--preview-item--image":r,"memori--preview-item--document":!r}),children:[(0,eh.jsx)("button",{type:"button",className:"memori--preview-item-trigger",onClick:()=>{if(k3(e.name||"")){let t=k8(e);t&&window.open(t,"_blank","noopener,noreferrer")}else u(e)},"aria-label":e.name,children:r?(0,eh.jsx)("div",{className:"memori--preview-thumbnail memori-media-item--image",children:(0,eh.jsx)("img",{src:e.content,alt:""})}):(0,eh.jsx)(GF,{title:e.name||"File",badge:h(e),icon:(0,eh.jsx)(GD,{className:"memori-media-item--document-icon-svg"})})}),n&&(0,eh.jsx)(yt,{shape:"circle",variant:"ghost",size:"sm",icon:(0,eh.jsx)(H2,{"aria-hidden":!0}),className:"memori--remove-button","aria-label":String(s("upload.removeFile",{defaultValue:"Remove {{name}}",name:e.name})),onClick:()=>t(e.id,null==e?void 0:e.mediumID)})]},e.id)}),i>0&&Array.from({length:i},(e,t)=>(0,eh.jsx)("div",{className:"memori--preview-item memori--preview-item--document memori--preview-item--skeleton",children:(0,eh.jsx)("div",{className:"memori-media-item--document",children:(0,eh.jsxs)("div",{className:"memori-media-item--document-header",children:[(0,eh.jsx)("div",{className:"memori--skeleton-icon"}),(0,eh.jsxs)("div",{className:"memori--preview-file-info",children:[(0,eh.jsx)("div",{className:"memori--skeleton-line memori--skeleton-line--name"}),(0,eh.jsx)("div",{className:"memori--skeleton-line memori--skeleton-line--type"})]})]})})},`skeleton-${t}`))]})]}),(0,eh.jsx)(Hv,{open:!!l,onClose:()=>u(null),title:null==l?void 0:l.name,description:l?h(l):void 0,headerIcon:l&&!d(l.content,l.type)?(0,eh.jsx)(GD,{"aria-hidden":!0}):void 0,className:"memori-file-preview-modal",contentKind:!l||d(l.content,l.type)||c(l)?"snippet":"document",isImage:!!l&&d(l.content,l.type),imageSrc:l&&d(l.content,l.type)?l.content:void 0,imageAlt:null!=(o=null==l?void 0:l.name)?o:"",children:l&&!d(l.content,l.type)&&(c(l)?(0,eh.jsx)(Go,{preview:!1,medium:{mediumID:l.id,mimeType:"application/xml",content:(e=>{if(!(null==e?void 0:e.content))return"";let t=e.content;if(c(e)){let e=t;return(e.includes("&lt;")||e.includes("&quot;"))&&(e=Le(e)||e),e=k6(e)}return Le(k6(t))})(l),title:l.name}}):(0,eh.jsx)(GU,{content:l.content}))})]})},Vo=({dialogState:e,userMessage:t="",sendOnEnter:n,onChangeUserMessage:r,sendMessage:i,onMediumSelectedState:a,onTextareaFocus:o,onTextareaBlur:s,showMicrophone:l=!1,listening:u=!1,stopAudio:c,startListening:d,stopListening:h,audioStream:p,transcribing:m=!1,showUpload:f=!1,isTyping:g=!1,sessionID:v,authToken:y,memoriID:_,baseUrl:x,client:w,onTextareaExpanded:S,maxTotalMessagePayload:E,maxTextareaCharacters:A,maxDocumentsPerMessage:T,maxDocumentContentLength:I,pasteAsCardLineThreshold:C,pasteAsCardCharThreshold:M,showAiGeneratedNote:N=!0,footerBrand:R})=>{let{t:O}=tA(),P=vZ(),[k,D]=(0,em.useState)(!1),[B,F]=(0,em.useState)(0),U=(0,em.useCallback)((e,t)=>{F(e?null!=t?t:1:0)},[]),[j,z]=(0,em.useState)([]),{dialog:H}=w||{dialog:{postMediumDeselectedEvent:null}},G=(e,n=t)=>{g||(i(n,e.map((e,t)=>({mediumID:e.mediumID||`file_${Date.now()}_${t}_${Math.random().toString(36).substr(2,9)}`,mimeType:e.mimeType,content:e.content,title:e.name,properties:{isAttachedFile:!0},type:e.type,url:e.url}))),z([]),c(),speechSynthesis.speak(new SpeechSynthesisUtterance("")))},V=async(e,t)=>{if(H.postMediumDeselectedEvent&&v&&t){let e=await H.postMediumDeselectedEvent(v,t);(null==e?void 0:e.currentState)&&(null==a||a(e.currentState))}z(t=>t.filter(t=>t.id!==e))},W=(0,em.useCallback)(e=>{var n,r;if(null==(n=e.clipboardData.files)?void 0:n.length)return;let i=e.clipboardData.getData("text/plain");if(!(null==i?void 0:i.trim()))return;let a=e.target,o=a.selectionEnd-a.selectionStart,s=t.length-o+i.length;if(null!=A&&s>A){e.preventDefault(),P.add({id:`paste-content-exceeds-limit-${Date.now()}`,title:O("upload.pasteContentExceedsLimit",{defaultValue:"Pasted content exceeds the size limit. Try shortening the text or splitting it into smaller parts."}),data:{severity:"error",closable:!0}});return}let l=i.split(/\r?\n/).length;if(!(i.length>(null!=M?M:4200))&&!(l>(null!=C?C:100)))return;let u=null!=T?T:10;if(j.length>=u){e.preventDefault(),P.add({id:`paste-max-attachments-reached-${Date.now()}`,title:O("upload.pasteMaxAttachmentsReached",{max:u,defaultValue:`Maximum ${u} attachments. Remove one to add this as a file.`}),data:{severity:"error",closable:!0}});return}let c=null!=(r=null!=E?E:I)?r:3e5;if(i.length>c){e.preventDefault(),P.add({id:`paste-content-exceeds-per-document-limit-${Date.now()}`,title:O("upload.pasteContentExceedsLimit",{defaultValue:"Pasted content exceeds the size limit. Try shortening the text or splitting it into smaller parts."}),data:{severity:"error",closable:!0}});return}e.preventDefault();let d=O("upload.pastedText")||"pasted-text",h=`<document_attachment filename="pasted-text.txt" type="text/plain">
630
630
 
631
631
  ${i}
632
632
 
@@ -1065,37 +1065,37 @@ ${o("memoriBlockedGiverHelper")}`]}),children:(0,eh.jsxs)("div",{className:"bloc
1065
1065
  </div>
1066
1066
  </body>
1067
1067
  </html>
1068
- `})(i,r,a),s=window.open("","_blank","width=800,height=600,scrollbars=yes,resizable=yes");if(!s)throw Error("Popup blocked! Please enable popups to export PDF.");s.document.write(o),s.document.close(),s.document.title=r,setTimeout(()=>{s&&!s.closed&&(s.focus(),s.print(),setTimeout(()=>{s&&!s.closed&&s.close()},1e3))},500),P("export-pdf")}catch(e){console.error("PDF export error:",e),g(v9({description:m("exportChatHistory.error")||"Failed to export chat to PDF. Please try again.",severity:"error"}))}finally{x(!1)}},H=(0,em.useMemo)(()=>{if(t&&n){if(t.ownerUserID)return`${null!=a?a:"https://www.aisuru.com"}/${"it"===f.language?"it":"en"}/shared/${t.ownerUserID}/${t.memoriID}/${n}`;if(t.exposed)return`${null!=a?a:"https://www.aisuru.com"}/${"it"===f.language?"it":"en"}/shared/${t.ownerUserName}/${t.name}/${n}`}},[t,n,a,f.language]),G=(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsxs)("div",{className:"memori-share-button--dropdown-section memori-share-button--dropdown-section-primary",children:[t&&n&&H&&(0,eh.jsxs)("button",{type:"button",className:(b(tT))("memori-share-button--inline-item",{"memori-share-button--menu-item--flash":"share-chat"===T}),onClick:()=>{window.open(H,"_blank"),P("share-chat")},children:[(0,eh.jsx)($h,{}),(0,eh.jsx)("span",{children:m("widget.shareChat")||"Share chat"})]}),l&&l.length>0&&(0,eh.jsxs)("button",{type:"button",className:(b(tT))("memori-share-button--inline-item",{"memori-share-button--menu-item--flash":"export-pdf"===T}),onClick:z,disabled:_,children:[(0,eh.jsx)(Hy,{}),(0,eh.jsx)("span",{children:_?m("exportChatHistory.exporting")||"Exporting...":m("exportChatHistory.exportPDF")||"Export chat as PDF"})]}),(0,eh.jsxs)("button",{type:"button",className:(b(tT))("memori-share-button--inline-item",{"memori-share-button--copy-item--success":"success"===E,"memori-share-button--copy-item--error":"error"===E}),onClick:D,children:["success"===E?(0,eh.jsx)(Ll,{strokeWidth:2.5}):(0,eh.jsx)(H4,{}),(0,eh.jsx)("span",{children:"success"===E?m("copied"):"error"===E?m("copyFailed",{defaultValue:"Could not copy"}):m("copyToClipboard")||void 0})]})]}),(0,eh.jsx)("div",{className:"memori-share-button--dropdown-divider"}),(0,eh.jsx)("div",{className:"memori-share-button--dropdown-section memori-share-button--dropdown-section-social",children:F.map(e=>{let t=e.icon;return(0,eh.jsxs)("button",{type:"button",className:(b(tT))("memori-share-button--inline-item",{"memori-share-button--menu-item--flash":T===e.id}),onClick:()=>{j(e),P(e.id)},children:[(0,eh.jsx)(t,{"aria-hidden":!0}),(0,eh.jsx)("span",{children:e.title})]},e.id)})}),o&&(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("div",{className:"memori-share-button--dropdown-divider"}),(0,eh.jsxs)("div",{className:"memori-share-button--qr-content",children:[(0,eh.jsx)($w,{id:"qr-canvas",value:null!=v?v:"",size:96,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:B,x:void 0,y:void 0,height:24,width:24,excavate:!0}}),(0,eh.jsxs)("button",{type:"button",className:"memori-share-button--qr-download",onClick:U,children:[(0,eh.jsx)(H5,{"aria-hidden":!0}),(0,eh.jsx)("span",{children:m("widget.downloadQrCode")||m("download",{defaultValue:"Download"})})]})]})]})]});return"inline"===p?(0,eh.jsx)("div",{className:(b(tT))("memori-share-button--inline-list",u),children:G}):(0,eh.jsxs)(xm,{onOpenChange:e=>{S(e),e||(R(),O(),A("idle"))},className:(b(tT))("memori-share-button",{"memori-share-button--align-left":"left"===s},u),children:[(0,eh.jsx)(_H,{content:m("widget.share")||void 0,placement:"bottom",children:(0,eh.jsx)(xm.Trigger,{showChevron:!1,className:"memori-share-button--trigger",render:e=>(0,eh.jsx)(Gc,{...e,variant:h,active:w,title:String(d||m("widget.share")||"Share"),"aria-label":String(d||m("widget.share")||"Share"),icon:(0,eh.jsx)($h,{"aria-hidden":!0}),className:(b(tT))({"memori-share-button--trigger-menu-item":"menu-item"===c}),children:"menu-item"===c||d?(0,eh.jsx)("span",{className:"memori-header--action-label",children:d||m("widget.share")}):void 0})})}),(0,eh.jsx)(xm.Menu,{className:"memori-share-button--dropdown-menu",children:(0,eh.jsxs)("div",{ref:N,className:"memori-share-button--dropdown-content",onMouseLeave:()=>{var e;let t=document.activeElement;t instanceof HTMLElement&&(null==(e=N.current)?void 0:e.contains(t))&&t.blur()},children:[(0,eh.jsxs)("div",{className:"memori-share-button--dropdown-section",children:[t&&n&&H&&(0,eh.jsx)(xm.Item,{closeOnClick:!1,className:(b(tT))("memori-share-button--menu-item",{"memori-share-button--menu-item--flash":"share-chat"===T}),onClick:()=>{window.open(H,"_blank"),P("share-chat")},icon:(0,eh.jsx)($h,{}),children:(0,eh.jsx)("span",{className:"memori-share-button--dropdown-item-content",children:m("widget.shareChat")||"Share chat"})},"shared"),l&&l.length>0&&(0,eh.jsx)(xm.Item,{closeOnClick:!1,className:(b(tT))("memori-share-button--menu-item",{"memori-share-button--menu-item--flash":"export-pdf"===T}),onClick:z,disabled:_,icon:(0,eh.jsx)(Hy,{}),children:(0,eh.jsx)("span",{className:"memori-share-button--dropdown-item-content",children:_?m("exportChatHistory.exporting")||"Exporting...":m("exportChatHistory.exportPDF")||"Export chat as PDF"})},"export-pdf"),(0,eh.jsx)(xm.Item,{closeOnClick:!1,className:(b(tT))("memori-share-button--menu-item","memori-share-button--copy-item",{"memori-share-button--copy-item--success":"success"===E,"memori-share-button--copy-item--error":"error"===E}),onClick:D,icon:"success"===E?(0,eh.jsx)(Ll,{className:"memori-share-button--copy-icon","aria-hidden":!0,strokeWidth:2.5}):(0,eh.jsx)(H4,{className:"memori-share-button--copy-icon","aria-hidden":!0}),children:(0,eh.jsx)("span",{className:"memori-share-button--dropdown-item-content memori-share-button--copy-label","aria-live":"polite",children:"success"===E?m("copied"):"error"===E?m("copyFailed",{defaultValue:"Could not copy"}):m("copyToClipboard")||void 0})})]}),(0,eh.jsx)("div",{className:"memori-share-button--dropdown-divider"}),(0,eh.jsx)("div",{className:"memori-share-button--dropdown-section",children:F.map(e=>{let t=e.icon;return(0,eh.jsx)(xm.Item,{closeOnClick:!1,className:(b(tT))("memori-share-button--menu-item",{"memori-share-button--menu-item--flash":T===e.id}),onClick:()=>{j(e),P(e.id)},icon:(0,eh.jsx)(t,{}),children:(0,eh.jsx)("span",{className:"memori-share-button--dropdown-item-content",children:e.title})},e.id)})}),o&&(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("div",{className:"memori-share-button--dropdown-divider"}),(0,eh.jsx)(xm.Item,{closeOnClick:!1,className:(b(tT))("memori-share-button--menu-item","memori-share-button--qr-item",{"memori-share-button--menu-item--flash":"qr-download"===T}),onClick:U,children:(0,eh.jsxs)("div",{className:"memori-share-button--qr-content",children:[(0,eh.jsx)($w,{id:"qr-canvas",value:null!=v?v:"",size:128,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:B,x:void 0,y:void 0,height:32,width:32,excavate:!0}}),(0,eh.jsxs)("button",{type:"button",className:"memori-share-button--qr-download",onClick:e=>{e.stopPropagation(),U()},children:[(0,eh.jsx)(H5,{"aria-hidden":!0}),(0,eh.jsx)("span",{children:String(m("widget.downloadQrCode")||m("download",{defaultValue:"Download"}))})]})]})})]})]})})]})},em=ec("85Hg2");let $M=Math.PI/180;var em=(ec("85Hg2"),ec("85Hg2"));let $N=(0,em.createContext)(null),$R=$N.Provider;function $O(){let e=(0,em.useContext)($N);if(null==e)throw Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return e}var em=ec("85Hg2"),$P={};!function(e){"use strict";function t(e){var t,n,r,i;for(n=1,r=arguments.length;n<r;n++)for(t in i=arguments[n])e[t]=i[t];return e}var n,r,i,a,o,s,l,u,c,d,h=Object.create||function(){function e(){}return function(t){return e.prototype=t,new e}}();function p(e,t){var n=Array.prototype.slice;if(e.bind)return e.bind.apply(e,n.call(arguments,1));var r=n.call(arguments,2);return function(){return e.apply(t,r.length?r.concat(n.call(arguments)):arguments)}}var m=0;function f(e){return"_leaflet_id"in e||(e._leaflet_id=++m),e._leaflet_id}function g(e,t,n){var r,i,a,o;return o=function(){r=!1,i&&(a.apply(n,i),i=!1)},a=function(){r?i=arguments:(e.apply(n,arguments),setTimeout(o,t),r=!0)}}function v(e,t,n){var r=t[1],i=t[0],a=r-i;return e===r&&n?e:((e-i)%a+a)%a+i}function y(){return!1}function b(e,t){if(!1===t)return e;var n=Math.pow(10,void 0===t?6:t);return Math.round(e*n)/n}function _(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function x(e){return _(e).split(/\s+/)}function w(e,t){for(var n in Object.prototype.hasOwnProperty.call(e,"options")||(e.options=e.options?h(e.options):{}),t)e.options[n]=t[n];return e.options}function S(e,t,n){var r=[];for(var i in e)r.push(encodeURIComponent(n?i.toUpperCase():i)+"="+encodeURIComponent(e[i]));return(t&&-1!==t.indexOf("?")?"&":"?")+r.join("&")}var E=/\{ *([\w_ -]+) *\}/g;function A(e,t){return e.replace(E,function(e,n){var r=t[n];if(void 0===r)throw Error("No value provided for variable "+e);return"function"==typeof r&&(r=r(t)),r})}var T=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function I(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return -1}var C="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function M(e){return window["webkit"+e]||window["moz"+e]||window["ms"+e]}var N=0;function R(e){var t=+new Date,n=Math.max(0,16-(t-N));return N=t+n,window.setTimeout(e,n)}var O=window.requestAnimationFrame||M("RequestAnimationFrame")||R,P=window.cancelAnimationFrame||M("CancelAnimationFrame")||M("CancelRequestAnimationFrame")||function(e){window.clearTimeout(e)};function k(e,t,n){if(!n||O!==R)return O.call(window,p(e,t));e.call(t)}function D(e){e&&P.call(window,e)}function B(){}B.extend=function(e){var n=function(){w(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},r=n.__super__=this.prototype,i=h(r);for(var a in i.constructor=n,n.prototype=i,this)Object.prototype.hasOwnProperty.call(this,a)&&"prototype"!==a&&"__super__"!==a&&(n[a]=this[a]);return e.statics&&t(n,e.statics),e.includes&&(function(e){if("u">typeof L&&L&&L.Mixin){e=T(e)?e:[e];for(var t=0;t<e.length;t++)e[t]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",Error().stack)}}(e.includes),t.apply(null,[i].concat(e.includes))),t(i,e),delete i.statics,delete i.includes,i.options&&(i.options=r.options?h(r.options):{},t(i.options,e.options)),i._initHooks=[],i.callInitHooks=function(){if(!this._initHooksCalled){r.callInitHooks&&r.callInitHooks.call(this),this._initHooksCalled=!0;for(var e=0,t=i._initHooks.length;e<t;e++)i._initHooks[e].call(this)}},n},B.include=function(e){var n=this.prototype.options;return t(this.prototype,e),e.options&&(this.prototype.options=n,this.mergeOptions(e.options)),this},B.mergeOptions=function(e){return t(this.prototype.options,e),this},B.addInitHook=function(e){var t=Array.prototype.slice.call(arguments,1),n="function"==typeof e?e:function(){this[e].apply(this,t)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n),this};var F={on:function(e,t,n){if("object"==typeof e)for(var r in e)this._on(r,e[r],t);else{e=x(e);for(var i=0,a=e.length;i<a;i++)this._on(e[i],t,n)}return this},off:function(e,t,n){if(arguments.length)if("object"==typeof e)for(var r in e)this._off(r,e[r],t);else{e=x(e);for(var i=1==arguments.length,a=0,o=e.length;a<o;a++)i?this._off(e[a]):this._off(e[a],t,n)}else delete this._events;return this},_on:function(e,t,n,r){if("function"!=typeof t)return void console.warn("wrong listener type: "+typeof t);if(!1===this._listens(e,t,n)){n===this&&(n=void 0);var i={fn:t,ctx:n};r&&(i.once=!0),this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(i)}},_off:function(e,t,n){if(this._events&&(r=this._events[e])){if(1==arguments.length){if(this._firingCount)for(i=0,a=r.length;i<a;i++)r[i].fn=y;delete this._events[e];return}if("function"!=typeof t)return void console.warn("wrong listener type: "+typeof t);var r,i,a,o=this._listens(e,t,n);if(!1!==o){var s=r[o];this._firingCount&&(s.fn=y,this._events[e]=r=r.slice()),r.splice(o,1)}}},fire:function(e,n,r){if(!this.listens(e,r))return this;var i=t({},n,{type:e,target:this,sourceTarget:n&&n.sourceTarget||this});if(this._events){var a=this._events[e];if(a){this._firingCount=this._firingCount+1||1;for(var o=0,s=a.length;o<s;o++){var l=a[o],u=l.fn;l.once&&this.off(e,u,l.ctx),u.call(l.ctx||this,i)}this._firingCount--}}return r&&this._propagateEvent(i),this},listens:function(e,t,n,r){"string"!=typeof e&&console.warn('"string" type argument expected');var i=t;"function"!=typeof t&&(r=!!t,i=void 0,n=void 0);var a=this._events&&this._events[e];if(a&&a.length&&!1!==this._listens(e,i,n))return!0;if(r){for(var o in this._eventParents)if(this._eventParents[o].listens(e,t,n,r))return!0}return!1},_listens:function(e,t,n){if(!this._events)return!1;var r=this._events[e]||[];if(!t)return!!r.length;n===this&&(n=void 0);for(var i=0,a=r.length;i<a;i++)if(r[i].fn===t&&r[i].ctx===n)return i;return!1},once:function(e,t,n){if("object"==typeof e)for(var r in e)this._on(r,e[r],t,!0);else{e=x(e);for(var i=0,a=e.length;i<a;i++)this._on(e[i],t,n,!0)}return this},addEventParent:function(e){return this._eventParents=this._eventParents||{},this._eventParents[f(e)]=e,this},removeEventParent:function(e){return this._eventParents&&delete this._eventParents[f(e)],this},_propagateEvent:function(e){for(var n in this._eventParents)this._eventParents[n].fire(e.type,t({layer:e.target,propagatedFrom:e.target},e),!0)}};F.addEventListener=F.on,F.removeEventListener=F.clearAllEventListeners=F.off,F.addOneTimeEventListener=F.once,F.fireEvent=F.fire,F.hasEventListeners=F.listens;var U=B.extend(F);function j(e,t,n){this.x=n?Math.round(e):e,this.y=n?Math.round(t):t}var z=Math.trunc||function(e){return e>0?Math.floor(e):Math.ceil(e)};function H(e,t,n){return e instanceof j?e:T(e)?new j(e[0],e[1]):null==e?e:"object"==typeof e&&"x"in e&&"y"in e?new j(e.x,e.y):new j(e,t,n)}function G(e,t){if(e)for(var n=t?[e,t]:e,r=0,i=n.length;r<i;r++)this.extend(n[r])}function V(e,t){return!e||e instanceof G?e:new G(e,t)}function W(e,t){if(e)for(var n=t?[e,t]:e,r=0,i=n.length;r<i;r++)this.extend(n[r])}function q(e,t){return e instanceof W?e:new W(e,t)}function $(e,t,n){if(isNaN(e)||isNaN(t))throw Error("Invalid LatLng object: ("+e+", "+t+")");this.lat=+e,this.lng=+t,void 0!==n&&(this.alt=+n)}function J(e,t,n){return e instanceof $?e:T(e)&&"object"!=typeof e[0]?3===e.length?new $(e[0],e[1],e[2]):2===e.length?new $(e[0],e[1]):null:null==e?e:"object"==typeof e&&"lat"in e?new $(e.lat,"lng"in e?e.lng:e.lon,e.alt):void 0===t?null:new $(e,t,n)}j.prototype={clone:function(){return new j(this.x,this.y)},add:function(e){return this.clone()._add(H(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(H(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new j(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new j(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=z(this.x),this.y=z(this.y),this},distanceTo:function(e){var t=(e=H(e)).x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},equals:function(e){return(e=H(e)).x===this.x&&e.y===this.y},contains:function(e){return Math.abs((e=H(e)).x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+b(this.x)+", "+b(this.y)+")"}},G.prototype={extend:function(e){var t,n;if(!e)return this;if(e instanceof j||"number"==typeof e[0]||"x"in e)t=n=H(e);else if(t=(e=V(e)).min,n=e.max,!t||!n)return this;return this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)):(this.min=t.clone(),this.max=n.clone()),this},getCenter:function(e){return H((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,e)},getBottomLeft:function(){return H(this.min.x,this.max.y)},getTopRight:function(){return H(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(e){var t,n;return(e="number"==typeof e[0]||e instanceof j?H(e):V(e))instanceof G?(t=e.min,n=e.max):t=n=e,t.x>=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=V(e);var t=this.min,n=this.max,r=e.min,i=e.max,a=i.x>=t.x&&r.x<=n.x,o=i.y>=t.y&&r.y<=n.y;return a&&o},overlaps:function(e){e=V(e);var t=this.min,n=this.max,r=e.min,i=e.max,a=i.x>t.x&&r.x<n.x,o=i.y>t.y&&r.y<n.y;return a&&o},isValid:function(){return!!(this.min&&this.max)},pad:function(e){var t=this.min,n=this.max,r=Math.abs(t.x-n.x)*e,i=Math.abs(t.y-n.y)*e;return V(H(t.x-r,t.y-i),H(n.x+r,n.y+i))},equals:function(e){return!!e&&(e=V(e),this.min.equals(e.getTopLeft())&&this.max.equals(e.getBottomRight()))}},W.prototype={extend:function(e){var t,n,r=this._southWest,i=this._northEast;if(e instanceof $)t=e,n=e;else if(!(e instanceof W))return e?this.extend(J(e)||q(e)):this;else if(t=e._southWest,n=e._northEast,!t||!n)return this;return r||i?(r.lat=Math.min(t.lat,r.lat),r.lng=Math.min(t.lng,r.lng),i.lat=Math.max(n.lat,i.lat),i.lng=Math.max(n.lng,i.lng)):(this._southWest=new $(t.lat,t.lng),this._northEast=new $(n.lat,n.lng)),this},pad:function(e){var t=this._southWest,n=this._northEast,r=Math.abs(t.lat-n.lat)*e,i=Math.abs(t.lng-n.lng)*e;return new W(new $(t.lat-r,t.lng-i),new $(n.lat+r,n.lng+i))},getCenter:function(){return new $((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new $(this.getNorth(),this.getWest())},getSouthEast:function(){return new $(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(e){e="number"==typeof e[0]||e instanceof $||"lat"in e?J(e):q(e);var t,n,r=this._southWest,i=this._northEast;return e instanceof W?(t=e.getSouthWest(),n=e.getNorthEast()):t=n=e,t.lat>=r.lat&&n.lat<=i.lat&&t.lng>=r.lng&&n.lng<=i.lng},intersects:function(e){e=q(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),i=e.getNorthEast(),a=i.lat>=t.lat&&r.lat<=n.lat,o=i.lng>=t.lng&&r.lng<=n.lng;return a&&o},overlaps:function(e){e=q(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),i=e.getNorthEast(),a=i.lat>t.lat&&r.lat<n.lat,o=i.lng>t.lng&&r.lng<n.lng;return a&&o},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(e,t){return!!e&&(e=q(e),this._southWest.equals(e.getSouthWest(),t)&&this._northEast.equals(e.getNorthEast(),t))},isValid:function(){return!!(this._southWest&&this._northEast)}},$.prototype={equals:function(e,t){return!!e&&(e=J(e),Math.max(Math.abs(this.lat-e.lat),Math.abs(this.lng-e.lng))<=(void 0===t?1e-9:t))},toString:function(e){return"LatLng("+b(this.lat,e)+", "+b(this.lng,e)+")"},distanceTo:function(e){return Y.distance(this,J(e))},wrap:function(){return Y.wrapLatLng(this)},toBounds:function(e){var t=180*e/0x2637f09,n=t/Math.cos(Math.PI/180*this.lat);return q([this.lat-t,this.lng-n],[this.lat+t,this.lng+n])},clone:function(){return new $(this.lat,this.lng,this.alt)}};var K={latLngToPoint:function(e,t){var n=this.projection.project(e),r=this.scale(t);return this.transformation._transform(n,r)},pointToLatLng:function(e,t){var n=this.scale(t),r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},scale:function(e){return 256*Math.pow(2,e)},zoom:function(e){return Math.log(e/256)/Math.LN2},getProjectedBounds:function(e){if(this.infinite)return null;var t=this.projection.bounds,n=this.scale(e);return new G(this.transformation.transform(t.min,n),this.transformation.transform(t.max,n))},infinite:!1,wrapLatLng:function(e){var t=this.wrapLng?v(e.lng,this.wrapLng,!0):e.lng;return new $(this.wrapLat?v(e.lat,this.wrapLat,!0):e.lat,t,e.alt)},wrapLatLngBounds:function(e){var t=e.getCenter(),n=this.wrapLatLng(t),r=t.lat-n.lat,i=t.lng-n.lng;if(0===r&&0===i)return e;var a=e.getSouthWest(),o=e.getNorthEast();return new W(new $(a.lat-r,a.lng-i),new $(o.lat-r,o.lng-i))}},Y=t({},K,{wrapLng:[-180,180],R:6371e3,distance:function(e,t){var n=Math.PI/180,r=e.lat*n,i=t.lat*n,a=Math.sin((t.lat-e.lat)*n/2),o=Math.sin((t.lng-e.lng)*n/2),s=a*a+Math.cos(r)*Math.cos(i)*o*o,l=2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s));return this.R*l}}),X={R:6378137,MAX_LATITUDE:85.0511287798,project:function(e){var t=Math.PI/180,n=this.MAX_LATITUDE,r=Math.sin(Math.max(Math.min(n,e.lat),-n)*t);return new j(this.R*e.lng*t,this.R*Math.log((1+r)/(1-r))/2)},unproject:function(e){var t=180/Math.PI;return new $((2*Math.atan(Math.exp(e.y/this.R))-Math.PI/2)*t,e.x*t/this.R)},bounds:new G([-(l=6378137*Math.PI),-l],[l,l])};function Z(e,t,n,r){if(T(e)){this._a=e[0],this._b=e[1],this._c=e[2],this._d=e[3];return}this._a=e,this._b=t,this._c=n,this._d=r}function Q(e,t,n,r){return new Z(e,t,n,r)}Z.prototype={transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return e.x=(t=t||1)*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t=t||1,new j((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}};var ee=t({},Y,{code:"EPSG:3857",projection:X,transformation:Q(u=.5/(Math.PI*X.R),.5,-u,.5)}),et=t({},ee,{code:"EPSG:900913"});function en(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function er(e,t){var n,r,i,a,o,s,l="";for(n=0,i=e.length;n<i;n++){for(r=0,a=(o=e[n]).length;r<a;r++)s=o[r],l+=(r?"L":"M")+s.x+" "+s.y;l+=t?eD.svg?"z":"x":""}return l||"M0 0"}var ei=document.documentElement.style,ea="ActiveXObject"in window,eo=ea&&!document.addEventListener,es="msLaunchUri"in navigator&&!("documentMode"in document),el=eL("webkit"),eu=eL("android"),ec=eL("android 2")||eL("android 3"),ed=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),eh=eu&&eL("Google")&&ed<537&&!("AudioNode"in window),ep=!!window.opera,em=!es&&eL("chrome"),ef=eL("gecko")&&!el&&!ep&&!ea,eg=!em&&eL("safari"),ev=eL("phantom"),ey="OTransition"in ei,eb=0===navigator.platform.indexOf("Win"),e_=ea&&"transition"in ei,ex="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ec,ew="MozPerspective"in ei,eS=!window.L_DISABLE_3D&&(e_||ex||ew)&&!ey&&!ev,eE="u">typeof orientation||eL("mobile"),eA=!window.PointerEvent&&window.MSPointerEvent,eT=!!(window.PointerEvent||eA),eI="ontouchstart"in window||!!window.TouchEvent,eC=!window.L_NO_TOUCH&&(eI||eT),eM=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,eN=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",y,t),window.removeEventListener("testPassiveEventSupport",y,t)}catch(e){}return e}(),eR=!!document.createElement("canvas").getContext,eO=!!(document.createElementNS&&en("svg").createSVGRect),eP=!!eO&&((c=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===(c.firstChild&&c.firstChild.namespaceURI)),ek=!eO&&function(){try{var e=document.createElement("div");e.innerHTML='<v:shape adj="1"/>';var t=e.firstChild;return t.style.behavior="url(#default#VML)",t&&"object"==typeof t.adj}catch(e){return!1}}();function eL(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var eD={ie:ea,ielt9:eo,edge:es,webkit:el,android:eu,android23:ec,androidStock:eh,opera:ep,chrome:em,gecko:ef,safari:eg,phantom:ev,opera12:ey,win:eb,ie3d:e_,webkit3d:ex,gecko3d:ew,any3d:eS,mobile:eE,mobileWebkit:eE&&el,mobileWebkit3d:eE&&ex,msPointer:eA,pointer:eT,touch:eC,touchNative:eI,mobileOpera:eE&&ep,mobileGecko:eE&&ef,retina:eM,passiveEvents:eN,canvas:eR,svg:eO,vml:ek,inlineSvg:eP,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},eB=eD.msPointer?"MSPointerDown":"pointerdown",eF=eD.msPointer?"MSPointerMove":"pointermove",eU=eD.msPointer?"MSPointerUp":"pointerup",ej=eD.msPointer?"MSPointerCancel":"pointercancel",ez={touchstart:eB,touchmove:eF,touchend:eU,touchcancel:ej},eH={touchstart:function(e,t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&tw(t),eJ(e,t)},touchmove:eJ,touchend:eJ,touchcancel:eJ},eG={},eV=!1;function eW(e){eG[e.pointerId]=e}function eq(e){eG[e.pointerId]&&(eG[e.pointerId]=e)}function e$(e){delete eG[e.pointerId]}function eJ(e,t){if(t.pointerType!==(t.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in t.touches=[],eG)t.touches.push(eG[n]);t.changedTouches=[t],e(t)}}var eK=tt(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),eY=tt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),eX="webkitTransition"===eY||"OTransition"===eY?eY+"End":"transitionend";function eZ(e){return"string"==typeof e?document.getElementById(e):e}function eQ(e,t){var n=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!n||"auto"===n)&&document.defaultView){var r=document.defaultView.getComputedStyle(e,null);n=r?r[t]:null}return"auto"===n?null:n}function e0(e,t,n){var r=document.createElement(e);return r.className=t||"",n&&n.appendChild(r),r}function e1(e){var t=e.parentNode;t&&t.removeChild(e)}function e2(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function e3(e){var t=e.parentNode;t&&t.lastChild!==e&&t.appendChild(e)}function e4(e){var t=e.parentNode;t&&t.firstChild!==e&&t.insertBefore(e,t.firstChild)}function e5(e,t){if(void 0!==e.classList)return e.classList.contains(t);var n=e9(e);return n.length>0&&RegExp("(^|\\s)"+t+"(\\s|$)").test(n)}function e6(e,t){if(void 0!==e.classList)for(var n=x(t),r=0,i=n.length;r<i;r++)e.classList.add(n[r]);else if(!e5(e,t)){var a=e9(e);e7(e,(a?a+" ":"")+t)}}function e8(e,t){void 0!==e.classList?e.classList.remove(t):e7(e,_((" "+e9(e)+" ").replace(" "+t+" "," ")))}function e7(e,t){void 0===e.className.baseVal?e.className=t:e.className.baseVal=t}function e9(e){return e.correspondingElement&&(e=e.correspondingElement),void 0===e.className.baseVal?e.className:e.className.baseVal}function te(e,t){"opacity"in e.style?e.style.opacity=t:"filter"in e.style&&function(e,t){var n=!1,r="DXImageTransform.Microsoft.Alpha";try{n=e.filters.item(r)}catch(e){if(1===t)return}t=Math.round(100*t),n?(n.Enabled=100!==t,n.Opacity=t):e.style.filter+=" progid:"+r+"(opacity="+t+")"}(e,t)}function tt(e){for(var t=document.documentElement.style,n=0;n<e.length;n++)if(e[n]in t)return e[n];return!1}function tn(e,t,n){var r=t||new j(0,0);e.style[eK]=(eD.ie3d?"translate("+r.x+"px,"+r.y+"px)":"translate3d("+r.x+"px,"+r.y+"px,0)")+(n?" scale("+n+")":"")}function tr(e,t){e._leaflet_pos=t,eD.any3d?tn(e,t):(e.style.left=t.x+"px",e.style.top=t.y+"px")}function ti(e){return e._leaflet_pos||new j(0,0)}if("onselectstart"in document)n=function(){th(window,"selectstart",tw)},r=function(){tm(window,"selectstart",tw)};else{var ta=tt(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);n=function(){if(ta){var e=document.documentElement.style;i=e[ta],e[ta]="none"}},r=function(){ta&&(document.documentElement.style[ta]=i,i=void 0)}}function to(){th(window,"dragstart",tw)}function ts(){tm(window,"dragstart",tw)}function tl(e){for(;-1===e.tabIndex;)e=e.parentNode;e.style&&(tu(),a=e,o=e.style.outlineStyle,e.style.outlineStyle="none",th(window,"keydown",tu))}function tu(){a&&(a.style.outlineStyle=o,a=void 0,o=void 0,tm(window,"keydown",tu))}function tc(e){do e=e.parentNode;while((!e.offsetWidth||!e.offsetHeight)&&e!==document.body)return e}function td(e){var t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}function th(e,t,n,r){if(t&&"object"==typeof t)for(var i in t)tv(e,i,t[i],n);else{t=x(t);for(var a=0,o=t.length;a<o;a++)tv(e,t[a],n,r)}return this}var tp="_leaflet_events";function tm(e,t,n,r){if(1==arguments.length)tf(e),delete e[tp];else if(t&&"object"==typeof t)for(var i in t)ty(e,i,t[i],n);else if(t=x(t),2==arguments.length)tf(e,function(e){return -1!==I(t,e)});else for(var a=0,o=t.length;a<o;a++)ty(e,t[a],n,r);return this}function tf(e,t){for(var n in e[tp]){var r=n.split(/\d/)[0];(!t||t(r))&&ty(e,r,null,null,n)}}var tg={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function tv(e,t,n,r){var i=t+f(n)+(r?"_"+f(r):"");if(e[tp]&&e[tp][i])return this;var a=function(t){return n.call(r||e,t||window.event)},o=a;!eD.touchNative&&eD.pointer&&0===t.indexOf("touch")?a=function(e,t,n){return("touchstart"===t&&(eV||(document.addEventListener(eB,eW,!0),document.addEventListener(eF,eq,!0),document.addEventListener(eU,e$,!0),document.addEventListener(ej,e$,!0),eV=!0)),eH[t])?(n=eH[t].bind(this,n),e.addEventListener(ez[t],n,!1),n):(console.warn("wrong event specified:",t),y)}(e,t,a):eD.touch&&"dblclick"===t?a=function(e,t){e.addEventListener("dblclick",t);var n,r=0;function i(e){if(1!==e.detail){n=e.detail;return}if("mouse"!==e.pointerType&&(!e.sourceCapabilities||e.sourceCapabilities.firesTouchEvents)){var i=tE(e);if(!i.some(function(e){return e instanceof HTMLLabelElement&&e.attributes.for})||i.some(function(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement})){var a=Date.now();a-r<=200?2==++n&&t(function(e){var t,n,r={};for(n in e)t=e[n],r[n]=t&&t.bind?t.bind(e):t;return e=r,r.type="dblclick",r.detail=2,r.isTrusted=!1,r._simulated=!0,r}(e)):n=1,r=a}}}return e.addEventListener("click",i),{dblclick:t,simDblclick:i}}(e,a):"addEventListener"in e?"touchstart"===t||"touchmove"===t||"wheel"===t||"mousewheel"===t?e.addEventListener(tg[t]||t,a,!!eD.passiveEvents&&{passive:!1}):"mouseenter"===t||"mouseleave"===t?(a=function(t){tC(e,t=t||window.event)&&o(t)},e.addEventListener(tg[t],a,!1)):e.addEventListener(t,o,!1):e.attachEvent("on"+t,a),e[tp]=e[tp]||{},e[tp][i]=a}function ty(e,t,n,r,i){i=i||t+f(n)+(r?"_"+f(r):"");var a=e[tp]&&e[tp][i];if(!a)return this;!eD.touchNative&&eD.pointer&&0===t.indexOf("touch")?ez[t]?e.removeEventListener(ez[t],a,!1):console.warn("wrong event specified:",t):eD.touch&&"dblclick"===t?(e.removeEventListener("dblclick",a.dblclick),e.removeEventListener("click",a.simDblclick)):"removeEventListener"in e?e.removeEventListener(tg[t]||t,a,!1):e.detachEvent("on"+t,a),e[tp][i]=null}function tb(e){return e.stopPropagation?e.stopPropagation():e.originalEvent?e.originalEvent._stopped=!0:e.cancelBubble=!0,this}function t_(e){return tv(e,"wheel",tb),this}function tx(e){return th(e,"mousedown touchstart dblclick contextmenu",tb),e._leaflet_disable_click=!0,this}function tw(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this}function tS(e){return tw(e),tb(e),this}function tE(e){if(e.composedPath)return e.composedPath();for(var t=[],n=e.target;n;)t.push(n),n=n.parentNode;return t}function tA(e,t){if(!t)return new j(e.clientX,e.clientY);var n=td(t),r=n.boundingClientRect;return new j((e.clientX-r.left)/n.x-t.clientLeft,(e.clientY-r.top)/n.y-t.clientTop)}var tT=eD.linux&&eD.chrome?window.devicePixelRatio:eD.mac?3*window.devicePixelRatio:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function tI(e){return eD.edge?e.wheelDeltaY/2:e.deltaY&&0===e.deltaMode?-e.deltaY/tT:e.deltaY&&1===e.deltaMode?-(20*e.deltaY):e.deltaY&&2===e.deltaMode?-(60*e.deltaY):e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&32765>Math.abs(e.detail)?-(20*e.detail):e.detail?-(60*(e.detail/32765)):0}function tC(e,t){var n=t.relatedTarget;if(!n)return!0;try{for(;n&&n!==e;)n=n.parentNode}catch(e){return!1}return n!==e}var tM=U.extend({run:function(e,t,n,r){this.stop(),this._el=e,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=ti(e),this._offset=t.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=k(this._animate,this),this._step()},_step:function(e){var t=new Date-this._startTime,n=1e3*this._duration;t<n?this._runFrame(this._easeOut(t/n),e):(this._runFrame(1),this._complete())},_runFrame:function(e,t){var n=this._startPos.add(this._offset.multiplyBy(e));t&&n._round(),tr(this._el,n),this.fire("step")},_complete:function(){D(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(e){return 1-Math.pow(1-e,this._easeOutPower)}}),tN=U.extend({options:{crs:ee,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(e,t){t=w(this,t),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(e),this._initLayout(),this._onResize=p(this._onResize,this),this._initEvents(),t.maxBounds&&this.setMaxBounds(t.maxBounds),void 0!==t.zoom&&(this._zoom=this._limitZoom(t.zoom)),t.center&&void 0!==t.zoom&&this.setView(J(t.center),t.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=eY&&eD.any3d&&!eD.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),th(this._proxy,eX,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(e,n,r){return(n=void 0===n?this._zoom:this._limitZoom(n),e=this._limitCenter(J(e),n,this.options.maxBounds),r=r||{},this._stop(),this._loaded&&!r.reset&&!0!==r&&(void 0!==r.animate&&(r.zoom=t({animate:r.animate},r.zoom),r.pan=t({animate:r.animate,duration:r.duration},r.pan)),this._zoom!==n?this._tryAnimatedZoom&&this._tryAnimatedZoom(e,n,r.zoom):this._tryAnimatedPan(e,r.pan)))?(clearTimeout(this._sizeTimer),this):(this._resetView(e,n,r.pan&&r.pan.noMoveStart),this)},setZoom:function(e,t){return this._loaded?this.setView(this.getCenter(),e,{zoom:t}):(this._zoom=e,this)},zoomIn:function(e,t){return e=e||(eD.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+e,t)},zoomOut:function(e,t){return e=e||(eD.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-e,t)},setZoomAround:function(e,t,n){var r=this.getZoomScale(t),i=this.getSize().divideBy(2),a=(e instanceof j?e:this.latLngToContainerPoint(e)).subtract(i).multiplyBy(1-1/r),o=this.containerPointToLatLng(i.add(a));return this.setView(o,t,{zoom:n})},_getBoundsCenterZoom:function(e,t){t=t||{},e=e.getBounds?e.getBounds():q(e);var n=H(t.paddingTopLeft||t.padding||[0,0]),r=H(t.paddingBottomRight||t.padding||[0,0]),i=this.getBoundsZoom(e,!1,n.add(r));if(1/0===(i="number"==typeof t.maxZoom?Math.min(t.maxZoom,i):i))return{center:e.getCenter(),zoom:i};var a=r.subtract(n).divideBy(2),o=this.project(e.getSouthWest(),i),s=this.project(e.getNorthEast(),i);return{center:this.unproject(o.add(s).divideBy(2).add(a),i),zoom:i}},fitBounds:function(e,t){if(!(e=q(e)).isValid())throw Error("Bounds are not valid.");var n=this._getBoundsCenterZoom(e,t);return this.setView(n.center,n.zoom,t)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,t){return this.setView(e,this._zoom,{pan:t})},panBy:function(e,t){if(e=H(e).round(),t=t||{},!e.x&&!e.y)return this.fire("moveend");if(!0!==t.animate&&!this.getSize().contains(e))return this._resetView(this.unproject(this.project(this.getCenter()).add(e)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new tM,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),t.noMoveStart||this.fire("movestart"),!1!==t.animate){e6(this._mapPane,"leaflet-pan-anim");var n=this._getMapPanePos().subtract(e).round();this._panAnim.run(this._mapPane,n,t.duration||.25,t.easeLinearity)}else this._rawPanBy(e),this.fire("move").fire("moveend");return this},flyTo:function(e,t,n){if(!1===(n=n||{}).animate||!eD.any3d)return this.setView(e,t,n);this._stop();var r=this.project(this.getCenter()),i=this.project(e),a=this.getSize(),o=this._zoom;e=J(e),t=void 0===t?o:t;var s=Math.max(a.x,a.y),l=s*this.getZoomScale(o,t),u=i.distanceTo(r)||1;function c(e){var t=(l*l-s*s+(e?-1:1)*2.0164*2.0164*u*u)/(2*(e?l:s)*2.0164*u),n=Math.sqrt(t*t+1)-t;return n<1e-9?-18:Math.log(n)}function d(e){return(Math.exp(e)-Math.exp(-e))/2}function h(e){return(Math.exp(e)+Math.exp(-e))/2}var p=c(0),m=Date.now(),f=(c(1)-p)/1.42,g=n.duration?1e3*n.duration:1e3*f*.8;function v(){var n,a=(Date.now()-m)/g,l=(1-Math.pow(1-a,1.5))*f;a<=1?(this._flyToFrame=k(v,this),this._move(this.unproject(r.add(i.subtract(r).multiplyBy(s*(h(p)*(d(n=p+1.42*l)/h(n))-d(p))/2.0164/u)),o),this.getScaleZoom(s/(s*(h(p)/h(p+1.42*l))),o),{flyTo:!0})):this._move(e,t)._moveEnd(!0)}return this._moveStart(!0,n.noMoveStart),v.call(this),this},flyToBounds:function(e,t){var n=this._getBoundsCenterZoom(e,t);return this.flyTo(n.center,n.zoom,t)},setMaxBounds:function(e){return(e=q(e),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),e.isValid())?(this.options.maxBounds=e,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(e){var t=this.options.minZoom;return(this.options.minZoom=e,this._loaded&&t!==e&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom))?this.setZoom(e):this},setMaxZoom:function(e){var t=this.options.maxZoom;return(this.options.maxZoom=e,this._loaded&&t!==e&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom))?this.setZoom(e):this},panInsideBounds:function(e,t){this._enforcingBounds=!0;var n=this.getCenter(),r=this._limitCenter(n,this._zoom,q(e));return n.equals(r)||this.panTo(r,t),this._enforcingBounds=!1,this},panInside:function(e,t){var n=H((t=t||{}).paddingTopLeft||t.padding||[0,0]),r=H(t.paddingBottomRight||t.padding||[0,0]),i=this.project(this.getCenter()),a=this.project(e),o=this.getPixelBounds(),s=V([o.min.add(n),o.max.subtract(r)]),l=s.getSize();if(!s.contains(a)){this._enforcingBounds=!0;var u=a.subtract(s.getCenter()),c=s.extend(a).getSize().subtract(l);i.x+=u.x<0?-c.x:c.x,i.y+=u.y<0?-c.y:c.y,this.panTo(this.unproject(i),t),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=t({animate:!1,pan:!0},!0===e?{animate:!0}:e);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var r=this.getSize(),i=n.divideBy(2).round(),a=r.divideBy(2).round(),o=i.subtract(a);return o.x||o.y?(e.animate&&e.pan?this.panBy(o):(e.pan&&this._rawPanBy(o),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(p(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:r})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=t({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=p(this._handleGeolocationResponse,this),r=p(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,r,e):navigator.geolocation.getCurrentPosition(n,r,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var t=e.code,n=e.message||(1===t?"permission denied":2===t?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:t,message:"Geolocation error: "+n+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var t=new $(e.coords.latitude,e.coords.longitude),n=t.toBounds(2*e.coords.accuracy),r=this._locateOptions;if(r.setView){var i=this.getBoundsZoom(n);this.setView(t,r.maxZoom?Math.min(i,r.maxZoom):i)}var a={latlng:t,bounds:n,timestamp:e.timestamp};for(var o in e.coords)"number"==typeof e.coords[o]&&(a[o]=e.coords[o]);this.fire("locationfound",a)}},addHandler:function(e,t){if(!t)return this;var n=this[e]=new t(this);return this._handlers.push(n),this.options[e]&&n.enable(),this},remove:function(){var e;if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}for(e in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),e1(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(D(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[e].remove();for(e in this._panes)e1(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,t){var n=e0("div","leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),t||this._mapPane);return e&&(this._panes[e]=n),n},getCenter:function(){return(this._checkIfLoaded(),this._lastCenter&&!this._moved())?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds();return new W(this.unproject(e.getBottomLeft()),this.unproject(e.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,t,n){e=q(e),n=H(n||[0,0]);var r=this.getZoom()||0,i=this.getMinZoom(),a=this.getMaxZoom(),o=e.getNorthWest(),s=e.getSouthEast(),l=this.getSize().subtract(n),u=V(this.project(s,r),this.project(o,r)).getSize(),c=eD.any3d?this.options.zoomSnap:1,d=l.x/u.x,h=l.y/u.y,p=t?Math.max(d,h):Math.min(d,h);return r=this.getScaleZoom(p,r),c&&(r=c/100*Math.round(r/(c/100)),r=t?Math.ceil(r/c)*c:Math.floor(r/c)*c),Math.max(i,Math.min(a,r))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new j(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,t){var n=this._getTopLeftPoint(e,t);return new G(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(void 0===e?this.getZoom():e)},getPane:function(e){return"string"==typeof e?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,t){var n=this.options.crs;return t=void 0===t?this._zoom:t,n.scale(e)/n.scale(t)},getScaleZoom:function(e,t){var n=this.options.crs;t=void 0===t?this._zoom:t;var r=n.zoom(e*n.scale(t));return isNaN(r)?1/0:r},project:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.latLngToPoint(J(e),t)},unproject:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.pointToLatLng(H(e),t)},layerPointToLatLng:function(e){var t=H(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){return this.project(J(e))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(J(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(q(e))},distance:function(e,t){return this.options.crs.distance(J(e),J(t))},containerPointToLayerPoint:function(e){return H(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return H(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(H(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(J(e)))},mouseEventToContainerPoint:function(e){return tA(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=eZ(e);if(t){if(t._leaflet_id)throw Error("Map container is already initialized.")}else throw Error("Map container not found.");th(t,"scroll",this._onScroll,this),this._containerId=f(t)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&eD.any3d,e6(e,"leaflet-container"+(eD.touch?" leaflet-touch":"")+(eD.retina?" leaflet-retina":"")+(eD.ielt9?" leaflet-oldie":"")+(eD.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var t=eQ(e,"position");"absolute"!==t&&"relative"!==t&&"fixed"!==t&&"sticky"!==t&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),tr(this._mapPane,new j(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(e6(e.markerPane,"leaflet-zoom-hide"),e6(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,t,n){tr(this._mapPane,new j(0,0));var r=!this._loaded;this._loaded=!0,t=this._limitZoom(t),this.fire("viewprereset");var i=this._zoom!==t;this._moveStart(i,n)._move(e,t)._moveEnd(i),this.fire("viewreset"),r&&this.fire("load")},_moveStart:function(e,t){return e&&this.fire("zoomstart"),t||this.fire("movestart"),this},_move:function(e,t,n,r){void 0===t&&(t=this._zoom);var i=this._zoom!==t;return this._zoom=t,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),r?n&&n.pinch&&this.fire("zoom",n):((i||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return D(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){tr(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw Error("Set map center and zoom first.")},_initEvents:function(e){this._targets={},this._targets[f(this._container)]=this;var t=e?tm:th;t(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&t(window,"resize",this._onResize,this),eD.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){D(this._resizeRequest),this._resizeRequest=k(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,t){for(var n,r=[],i="mouseout"===t||"mouseover"===t,a=e.target||e.srcElement,o=!1;a;){if((n=this._targets[f(a)])&&("click"===t||"preclick"===t)&&this._draggableMoved(n)){o=!0;break}if(n&&n.listens(t,!0)&&(i&&!tC(a,e)||(r.push(n),i)))break;if(a===this._container)break;a=a.parentNode}return!r.length&&!o&&!i&&this.listens(t,!0)&&(r=[this]),r},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var t=e.target||e.srcElement;if(!(!this._loaded||t._leaflet_disable_events||"click"===e.type&&this._isClickDisabled(t))){var n=e.type;"mousedown"===n&&tl(t),this._fireDOMEvent(e,n)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,n,r){if("click"===e.type){var i=t({},e);i.type="preclick",this._fireDOMEvent(i,i.type,r)}var a=this._findEventTargets(e,n);if(r){for(var o=[],s=0;s<r.length;s++)r[s].listens(n,!0)&&o.push(r[s]);a=o.concat(a)}if(a.length){"contextmenu"===n&&tw(e);var l=a[0],u={originalEvent:e};if("keypress"!==e.type&&"keydown"!==e.type&&"keyup"!==e.type){var c=l.getLatLng&&(!l._radius||l._radius<=10);u.containerPoint=c?this.latLngToContainerPoint(l.getLatLng()):this.mouseEventToContainerPoint(e),u.layerPoint=this.containerPointToLayerPoint(u.containerPoint),u.latlng=c?l.getLatLng():this.layerPointToLatLng(u.layerPoint)}for(s=0;s<a.length;s++)if(a[s].fire(n,u,!0),u.originalEvent._stopped||!1===a[s].options.bubblingMouseEvents&&-1!==I(this._mouseEvents,n))return}},_draggableMoved:function(e){return(e=e.dragging&&e.dragging.enabled()?e:this).dragging&&e.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var e=0,t=this._handlers.length;e<t;e++)this._handlers[e].disable()},whenReady:function(e,t){return this._loaded?e.call(t||this,{target:this}):this.on("load",e,t),this},_getMapPanePos:function(){return ti(this._mapPane)||new j(0,0)},_moved:function(){var e=this._getMapPanePos();return e&&!e.equals([0,0])},_getTopLeftPoint:function(e,t){return(e&&void 0!==t?this._getNewPixelOrigin(e,t):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(e,t){var n=this.getSize()._divideBy(2);return this.project(e,t)._subtract(n)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(e,t,n){var r=this._getNewPixelOrigin(n,t);return this.project(e,t)._subtract(r)},_latLngBoundsToNewLayerBounds:function(e,t,n){var r=this._getNewPixelOrigin(n,t);return V([this.project(e.getSouthWest(),t)._subtract(r),this.project(e.getNorthWest(),t)._subtract(r),this.project(e.getSouthEast(),t)._subtract(r),this.project(e.getNorthEast(),t)._subtract(r)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(e){return this.latLngToLayerPoint(e).subtract(this._getCenterLayerPoint())},_limitCenter:function(e,t,n){if(!n)return e;var r=this.project(e,t),i=this.getSize().divideBy(2),a=new G(r.subtract(i),r.add(i)),o=this._getBoundsOffset(a,n,t);return 1>=Math.abs(o.x)&&1>=Math.abs(o.y)?e:this.unproject(r.add(o),t)},_limitOffset:function(e,t){if(!t)return e;var n=this.getPixelBounds(),r=new G(n.min.add(e),n.max.add(e));return e.add(this._getBoundsOffset(r,t))},_getBoundsOffset:function(e,t,n){var r=V(this.project(t.getNorthEast(),n),this.project(t.getSouthWest(),n)),i=r.min.subtract(e.min),a=r.max.subtract(e.max);return new j(this._rebound(i.x,-a.x),this._rebound(i.y,-a.y))},_rebound:function(e,t){return e+t>0?Math.round(e-t)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(t))},_limitZoom:function(e){var t=this.getMinZoom(),n=this.getMaxZoom(),r=eD.any3d?this.options.zoomSnap:1;return r&&(e=Math.round(e/r)*r),Math.max(t,Math.min(n,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){e8(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,t){var n=this._getCenterOffset(e)._trunc();return(!0===(t&&t.animate)||!!this.getSize().contains(n))&&(this.panBy(n,t),!0)},_createAnimProxy:function(){var e=this._proxy=e0("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(e){var t=this._proxy.style[eK];tn(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),t===this._proxy.style[eK]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){e1(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),t=this.getZoom();tn(this._proxy,this.project(e,t),this.getZoomScale(t,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,t,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),i=this._getCenterOffset(e)._divideBy(1-1/r);return(!0===n.animate||!!this.getSize().contains(i))&&(k(function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(e,t,!0)},this),!0)},_animateZoom:function(e,t,n,r){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=t,e6(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:t,noUpdate:r}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(p(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&e8(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}}),tR=B.extend({options:{position:"topright"},initialize:function(e){w(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var t=this._container=this.onAdd(e),n=this.getPosition(),r=e._controlCorners[n];return e6(t,"leaflet-control"),-1!==n.indexOf("bottom")?r.insertBefore(t,r.firstChild):r.appendChild(t),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(e1(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),tO=function(e){return new tR(e)};tN.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},t="leaflet-",n=this._controlContainer=e0("div",t+"control-container",this._container);function r(r,i){e[r+i]=e0("div",t+r+" "+t+i,n)}r("top","left"),r("top","right"),r("bottom","left"),r("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)e1(this._controlCorners[e]);e1(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var tP=tR.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,t,n,r){return n<r?-1:+(r<n)}},initialize:function(e,t,n){for(var r in w(this,n),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,e)this._addLayer(e[r],r);for(r in t)this._addLayer(t[r],r,!0)},onAdd:function(e){this._initLayout(),this._update(),this._map=e,e.on("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(e){return tR.prototype.addTo.call(this,e),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(e,t){return this._addLayer(e,t),this._map?this._update():this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._map?this._update():this},removeLayer:function(e){e.off("add remove",this._onLayerChange,this);var t=this._getLayer(f(e));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){e6(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var e=this._map.getSize().y-(this._container.offsetTop+50);return e<this._section.clientHeight?(e6(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=e+"px"):e8(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return e8(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var e="leaflet-control-layers",t=this._container=e0("div",e),n=this.options.collapsed;t.setAttribute("aria-haspopup",!0),tx(t),t_(t);var r=this._section=e0("section",e+"-list");n&&(this._map.on("click",this.collapse,this),th(t,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var i=this._layersLink=e0("a",e+"-toggle",t);i.href="#",i.title="Layers",i.setAttribute("role","button"),th(i,{keydown:function(e){13===e.keyCode&&this._expandSafely()},click:function(e){tw(e),this._expandSafely()}},this),n||this.expand(),this._baseLayersList=e0("div",e+"-base",r),this._separator=e0("div",e+"-separator",r),this._overlaysList=e0("div",e+"-overlays",r),t.appendChild(r)},_getLayer:function(e){for(var t=0;t<this._layers.length;t++)if(this._layers[t]&&f(this._layers[t].layer)===e)return this._layers[t]},_addLayer:function(e,t,n){this._map&&e.on("add remove",this._onLayerChange,this),this._layers.push({layer:e,name:t,overlay:n}),this.options.sortLayers&&this._layers.sort(p(function(e,t){return this.options.sortFunction(e.layer,t.layer,e.name,t.name)},this)),this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;e2(this._baseLayersList),e2(this._overlaysList),this._layerControlInputs=[];var e,t,n,r,i=0;for(n=0;n<this._layers.length;n++)r=this._layers[n],this._addItem(r),t=t||r.overlay,e=e||!r.overlay,i+=+!r.overlay;return this.options.hideSingleBase&&(e=e&&i>1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=t&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var t=this._getLayer(f(e.target)),n=t.overlay?"add"===e.type?"overlayadd":"overlayremove":"add"===e.type?"baselayerchange":null;n&&this._map.fire(n,t)},_createRadioElement:function(e,t){var n=document.createElement("div");return n.innerHTML='<input type="radio" class="leaflet-control-layers-selector" name="'+e+'"'+(t?' checked="checked"':"")+"/>",n.firstChild},_addItem:function(e){var t,n=document.createElement("label"),r=this._map.hasLayer(e.layer);e.overlay?((t=document.createElement("input")).type="checkbox",t.className="leaflet-control-layers-selector",t.defaultChecked=r):t=this._createRadioElement("leaflet-base-layers_"+f(this),r),this._layerControlInputs.push(t),t.layerId=f(e.layer),th(t,"click",this._onInputClick,this);var i=document.createElement("span");i.innerHTML=" "+e.name;var a=document.createElement("span");return n.appendChild(a),a.appendChild(t),a.appendChild(i),(e.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var e,t,n=this._layerControlInputs,r=[],i=[];this._handlingClick=!0;for(var a=n.length-1;a>=0;a--)e=n[a],t=this._getLayer(e.layerId).layer,e.checked?r.push(t):e.checked||i.push(t);for(a=0;a<i.length;a++)this._map.hasLayer(i[a])&&this._map.removeLayer(i[a]);for(a=0;a<r.length;a++)this._map.hasLayer(r[a])||this._map.addLayer(r[a]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var e,t,n=this._layerControlInputs,r=this._map.getZoom(),i=n.length-1;i>=0;i--)e=n[i],t=this._getLayer(e.layerId).layer,e.disabled=void 0!==t.options.minZoom&&r<t.options.minZoom||void 0!==t.options.maxZoom&&r>t.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,th(e,"click",tw),this.expand();var t=this;setTimeout(function(){tm(e,"click",tw),t._preventClick=!1})}}),tk=tR.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(e){var t="leaflet-control-zoom",n=e0("div",t+" leaflet-bar"),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,t+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,t+"-out",n,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(e.shiftKey?3:1))},_zoomOut:function(e){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,t,n,r,i){var a=e0("a",n,r);return a.innerHTML=e,a.href="#",a.title=t,a.setAttribute("role","button"),a.setAttribute("aria-label",t),tx(a),th(a,"click",tS),th(a,"click",i,this),th(a,"click",this._refocusOnMap,this),a},_updateDisabled:function(){var e=this._map,t="leaflet-disabled";e8(this._zoomInButton,t),e8(this._zoomOutButton,t),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(e6(this._zoomOutButton,t),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(e6(this._zoomInButton,t),this._zoomInButton.setAttribute("aria-disabled","true"))}});tN.mergeOptions({zoomControl:!0}),tN.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new tk,this.addControl(this.zoomControl))});var tL=tR.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var t="leaflet-control-scale",n=e0("div",t),r=this.options;return this._addScales(r,t+"-line",n),e.on(r.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),n},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=e0("div",t,n)),e.imperial&&(this._iScale=e0("div",t,n))},_update:function(){var e=this._map,t=e.getSize().y/2,n=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(n)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var t=this._getRoundNum(e);this._updateScale(this._mScale,t<1e3?t+" m":t/1e3+" km",t/e)},_updateImperial:function(e){var t,n,r,i=3.2808399*e;i>5280?(t=i/5280,n=this._getRoundNum(t),this._updateScale(this._iScale,n+" mi",n/t)):(r=this._getRoundNum(i),this._updateScale(this._iScale,r+" ft",r/i))},_updateScale:function(e,t,n){e.style.width=Math.round(this.options.maxWidth*n)+"px",e.innerHTML=t},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return t*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),tD=tR.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(eD.inlineSvg?'<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg> ':"")+"Leaflet</a>"},initialize:function(e){w(this,e),this._attributions={}},onAdd:function(e){for(var t in e.attributionControl=this,this._container=e0("div","leaflet-control-attribution"),tx(this._container),e._layers)e._layers[t].getAttribution&&this.addAttribution(e._layers[t].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e&&(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update()),this},removeAttribution:function(e){return e&&this._attributions[e]&&(this._attributions[e]--,this._update()),this},_update:function(){if(this._map){var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(' <span aria-hidden="true">|</span> ')}}});tN.mergeOptions({attributionControl:!0}),tN.addInitHook(function(){this.options.attributionControl&&new tD().addTo(this)}),tR.Layers=tP,tR.Zoom=tk,tR.Scale=tL,tR.Attribution=tD,tO.layers=function(e,t,n){return new tP(e,t,n)},tO.zoom=function(e){return new tk(e)},tO.scale=function(e){return new tL(e)},tO.attribution=function(e){return new tD(e)};var tB=B.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}});tB.addTo=function(e,t){return e.addHandler(t,this),this};var tF=eD.touch?"touchstart mousedown":"mousedown",tU=U.extend({options:{clickTolerance:3},initialize:function(e,t,n,r){w(this,r),this._element=e,this._dragStartTarget=t||e,this._preventOutline=n},enable:function(){this._enabled||(th(this._dragStartTarget,tF,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(tU._dragging===this&&this.finishDrag(!0),tm(this._dragStartTarget,tF,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(!(!this._enabled||(this._moved=!1,e5(this._element,"leaflet-zoom-anim")))){if(e.touches&&1!==e.touches.length){tU._dragging===this&&this.finishDrag();return}if(!tU._dragging&&!e.shiftKey&&(1===e.which||1===e.button||e.touches)&&(tU._dragging=this,this._preventOutline&&tl(this._element),to(),n(),!this._moving)){this.fire("down");var t=e.touches?e.touches[0]:e,r=tc(this._element);this._startPoint=new j(t.clientX,t.clientY),this._startPos=ti(this._element),this._parentScale=td(r);var i="mousedown"===e.type;th(document,i?"mousemove":"touchmove",this._onMove,this),th(document,i?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var t=e.touches&&1===e.touches.length?e.touches[0]:e,n=new j(t.clientX,t.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)<this.options.clickTolerance||(n.x/=this._parentScale.x,n.y/=this._parentScale.y,tw(e),this._moved||(this.fire("dragstart"),this._moved=!0,e6(document.body,"leaflet-dragging"),this._lastTarget=e.target||e.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),e6(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(n),this._moving=!0,this._lastEvent=e,this._updatePosition()))}},_updatePosition:function(){var e={originalEvent:this._lastEvent};this.fire("predrag",e),tr(this._element,this._newPos),this.fire("drag",e)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(e){e8(document.body,"leaflet-dragging"),this._lastTarget&&(e8(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),tm(document,"mousemove touchmove",this._onMove,this),tm(document,"mouseup touchend touchcancel",this._onUp,this),ts(),r();var t=this._moved&&this._moving;this._moving=!1,tU._dragging=!1,t&&this.fire("dragend",{noInertia:e,distance:this._newPos.distanceTo(this._startPos)})}});function tj(e,t,n){var r,i,a,o,s,l,u,c,d,h=[1,4,2,8];for(i=0,u=e.length;i<u;i++)e[i]._code=t$(e[i],t);for(o=0;o<4;o++){for(c=h[o],r=[],i=0,a=(u=e.length)-1;i<u;a=i++)s=e[i],l=e[a],s._code&c?l._code&c||((d=tq(l,s,c,t,n))._code=t$(d,t),r.push(d)):(l._code&c&&((d=tq(l,s,c,t,n))._code=t$(d,t),r.push(d)),r.push(s));e=r}return e}function tz(e,t){if(!e||0===e.length)throw Error("latlngs not passed");tK(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var n,r,i,a,o,s,l,u,c,d=J([0,0]),h=q(e);h.getNorthWest().distanceTo(h.getSouthWest())*h.getNorthEast().distanceTo(h.getNorthWest())<1700&&(d=tH(e));var p=e.length,m=[];for(n=0;n<p;n++){var f=J(e[n]);m.push(t.project(J([f.lat-d.lat,f.lng-d.lng])))}for(s=l=u=0,n=0,r=p-1;n<p;r=n++)i=m[n],a=m[r],o=i.y*a.x-a.y*i.x,l+=(i.x+a.x)*o,u+=(i.y+a.y)*o,s+=3*o;c=0===s?m[0]:[l/s,u/s];var g=t.unproject(H(c));return J([g.lat+d.lat,g.lng+d.lng])}function tH(e){for(var t=0,n=0,r=0,i=0;i<e.length;i++){var a=J(e[i]);t+=a.lat,n+=a.lng,r++}return J([t/r,n/r])}function tG(e,t){if(!t||!e.length)return e.slice();var n=t*t;return function(e,t){var n=e.length,r=new("u">typeof Uint8Array?Uint8Array:Array)(n);r[0]=r[n-1]=1,function e(t,n,r,i,a){var o,s,l,u=0;for(s=i+1;s<=a-1;s++)(l=tJ(t[s],t[i],t[a],!0))>u&&(o=s,u=l);u>r&&(n[o]=1,e(t,n,r,i,o),e(t,n,r,o,a))}(e,r,t,0,n-1);var i,a=[];for(i=0;i<n;i++)r[i]&&a.push(e[i]);return a}(e=function(e,t){for(var n=[e[0]],r=1,i=0,a=e.length;r<a;r++)(function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r})(e[r],e[i])>t&&(n.push(e[r]),i=r);return i<a-1&&n.push(e[a-1]),n}(e,n),n)}function tV(e,t,n){return Math.sqrt(tJ(e,t,n,!0))}function tW(e,t,n,r,i){var a,o,l,u=r?s:t$(e,n),c=t$(t,n);for(s=c;;){if(!(u|c))return[e,t];if(u&c)return!1;l=t$(o=tq(e,t,a=u||c,n,i),n),a===u?(e=o,u=l):(t=o,c=l)}}function tq(e,t,n,r,i){var a,o,s=t.x-e.x,l=t.y-e.y,u=r.min,c=r.max;return 8&n?(a=e.x+s*(c.y-e.y)/l,o=c.y):4&n?(a=e.x+s*(u.y-e.y)/l,o=u.y):2&n?(a=c.x,o=e.y+l*(c.x-e.x)/s):1&n&&(a=u.x,o=e.y+l*(u.x-e.x)/s),new j(a,o,i)}function t$(e,t){var n=0;return e.x<t.min.x?n|=1:e.x>t.max.x&&(n|=2),e.y<t.min.y?n|=4:e.y>t.max.y&&(n|=8),n}function tJ(e,t,n,r){var i,a=t.x,o=t.y,s=n.x-a,l=n.y-o,u=s*s+l*l;return u>0&&((i=((e.x-a)*s+(e.y-o)*l)/u)>1?(a=n.x,o=n.y):i>0&&(a+=s*i,o+=l*i)),s=e.x-a,l=e.y-o,r?s*s+l*l:new j(a,o)}function tK(e){return!T(e[0])||"object"!=typeof e[0][0]&&void 0!==e[0][0]}function tY(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),tK(e)}function tX(e,t){if(!e||0===e.length)throw Error("latlngs not passed");tK(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var n,r,i,a,o,s,l,u,c=J([0,0]),d=q(e);d.getNorthWest().distanceTo(d.getSouthWest())*d.getNorthEast().distanceTo(d.getNorthWest())<1700&&(c=tH(e));var h=e.length,p=[];for(n=0;n<h;n++){var m=J(e[n]);p.push(t.project(J([m.lat-c.lat,m.lng-c.lng])))}for(n=0,r=0;n<h-1;n++)r+=p[n].distanceTo(p[n+1])/2;if(0===r)u=p[0];else for(n=0,a=0;n<h-1;n++)if(o=p[n],s=p[n+1],(a+=i=o.distanceTo(s))>r){l=(a-r)/i,u=[s.x-l*(s.x-o.x),s.y-l*(s.y-o.y)];break}var f=t.unproject(H(u));return J([f.lat+c.lat,f.lng+c.lng])}var tZ={project:function(e){return new j(e.lng,e.lat)},unproject:function(e){return new $(e.y,e.x)},bounds:new G([-180,-90],[180,90])},tQ={R:6378137,R_MINOR:6356752.314245179,bounds:new G([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(e){var t=Math.PI/180,n=this.R,r=e.lat*t,i=this.R_MINOR/n,a=Math.sqrt(1-i*i),o=a*Math.sin(r);return r=-n*Math.log(Math.max(Math.tan(Math.PI/4-r/2)/Math.pow((1-o)/(1+o),a/2),1e-10)),new j(e.lng*t*n,r)},unproject:function(e){for(var t,n=180/Math.PI,r=this.R,i=this.R_MINOR/r,a=Math.sqrt(1-i*i),o=Math.exp(-e.y/r),s=Math.PI/2-2*Math.atan(o),l=0,u=.1;l<15&&Math.abs(u)>1e-7;l++)u=Math.PI/2-2*Math.atan(o*(t=Math.pow((1-(t=a*Math.sin(s)))/(1+t),a/2)))-s,s+=u;return new $(s*n,e.x*n/r)}},t0=t({},Y,{code:"EPSG:3395",projection:tQ,transformation:Q(d=.5/(Math.PI*tQ.R),.5,-d,.5)}),t1=t({},Y,{code:"EPSG:4326",projection:tZ,transformation:Q(1/180,1,-1/180,.5)}),t2=t({},K,{projection:tZ,transformation:Q(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lng-e.lng,r=t.lat-e.lat;return Math.sqrt(n*n+r*r)},infinite:!0});K.Earth=Y,K.EPSG3395=t0,K.EPSG3857=ee,K.EPSG900913=et,K.EPSG4326=t1,K.Simple=t2;var t3=U.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[f(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[f(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var t=e.target;if(t.hasLayer(this)){if(this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents){var n=this.getEvents();t.on(n,this),this.once("remove",function(){t.off(n,this)},this)}this.onAdd(t),this.fire("add"),t.fire("layeradd",{layer:this})}}});tN.include({addLayer:function(e){if(!e._layerAdd)throw Error("The provided object is not a Layer.");var t=f(e);return this._layers[t]||(this._layers[t]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e)),this},removeLayer:function(e){var t=f(e);return this._layers[t]&&(this._loaded&&e.onRemove(this),delete this._layers[t],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null),this},hasLayer:function(e){return f(e)in this._layers},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},_addLayers:function(e){e=e?T(e)?e:[e]:[];for(var t=0,n=e.length;t<n;t++)this.addLayer(e[t])},_addZoomLimit:function(e){isNaN(e.options.maxZoom)&&isNaN(e.options.minZoom)||(this._zoomBoundLayers[f(e)]=e,this._updateZoomLevels())},_removeZoomLimit:function(e){var t=f(e);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var e=1/0,t=-1/0,n=this._getZoomSpan();for(var r in this._zoomBoundLayers){var i=this._zoomBoundLayers[r].options;e=void 0===i.minZoom?e:Math.min(e,i.minZoom),t=void 0===i.maxZoom?t:Math.max(t,i.maxZoom)}this._layersMaxZoom=-1/0===t?void 0:t,this._layersMinZoom=1/0===e?void 0:e,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var t4=t3.extend({initialize:function(e,t){var n,r;if(w(this,t),this._layers={},e)for(n=0,r=e.length;n<r;n++)this.addLayer(e[n])},addLayer:function(e){var t=this.getLayerId(e);return this._layers[t]=e,this._map&&this._map.addLayer(e),this},removeLayer:function(e){var t=e in this._layers?e:this.getLayerId(e);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(e){return("number"==typeof e?e:this.getLayerId(e))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(e){var t,n,r=Array.prototype.slice.call(arguments,1);for(t in this._layers)(n=this._layers[t])[e]&&n[e].apply(n,r);return this},onAdd:function(e){this.eachLayer(e.addLayer,e)},onRemove:function(e){this.eachLayer(e.removeLayer,e)},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},getLayer:function(e){return this._layers[e]},getLayers:function(){var e=[];return this.eachLayer(e.push,e),e},setZIndex:function(e){return this.invoke("setZIndex",e)},getLayerId:function(e){return f(e)}}),t5=t4.extend({addLayer:function(e){return this.hasLayer(e)?this:(e.addEventParent(this),t4.prototype.addLayer.call(this,e),this.fire("layeradd",{layer:e}))},removeLayer:function(e){return this.hasLayer(e)?(e in this._layers&&(e=this._layers[e]),e.removeEventParent(this),t4.prototype.removeLayer.call(this,e),this.fire("layerremove",{layer:e})):this},setStyle:function(e){return this.invoke("setStyle",e)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var e=new W;for(var t in this._layers){var n=this._layers[t];e.extend(n.getBounds?n.getBounds():n.getLatLng())}return e}}),t6=B.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(e){w(this,e)},createIcon:function(e){return this._createIcon("icon",e)},createShadow:function(e){return this._createIcon("shadow",e)},_createIcon:function(e,t){var n=this._getIconUrl(e);if(!n){if("icon"===e)throw Error("iconUrl not set in Icon options (see the docs).");return null}var r=this._createImg(n,t&&"IMG"===t.tagName?t:null);return this._setIconStyles(r,e),(this.options.crossOrigin||""===this.options.crossOrigin)&&(r.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),r},_setIconStyles:function(e,t){var n=this.options,r=n[t+"Size"];"number"==typeof r&&(r=[r,r]);var i=H(r),a=H("shadow"===t&&n.shadowAnchor||n.iconAnchor||i&&i.divideBy(2,!0));e.className="leaflet-marker-"+t+" "+(n.className||""),a&&(e.style.marginLeft=-a.x+"px",e.style.marginTop=-a.y+"px"),i&&(e.style.width=i.x+"px",e.style.height=i.y+"px")},_createImg:function(e,t){return(t=t||document.createElement("img")).src=e,t},_getIconUrl:function(e){return eD.retina&&this.options[e+"RetinaUrl"]||this.options[e+"Url"]}}),t8=t6.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(e){return"string"!=typeof t8.imagePath&&(t8.imagePath=this._detectIconPath()),(this.options.imagePath||t8.imagePath)+t6.prototype._getIconUrl.call(this,e)},_stripUrl:function(e){var t=function(e,t,n){var r=t.exec(e);return r&&r[n]};return(e=t(e,/^url\((['"])?(.+)\1\)$/,2))&&t(e,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var e=e0("div","leaflet-default-icon-path",document.body),t=eQ(e,"background-image")||eQ(e,"backgroundImage");if(document.body.removeChild(e),t=this._stripUrl(t))return t;var n=document.querySelector('link[href$="leaflet.css"]');return n?n.href.substring(0,n.href.length-11-1):""}}),t7=tB.extend({initialize:function(e){this._marker=e},addHooks:function(){var e=this._marker._icon;this._draggable||(this._draggable=new tU(e,e,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),e6(e,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&e8(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(e){var t=this._marker,n=t._map,r=this._marker.options.autoPanSpeed,i=this._marker.options.autoPanPadding,a=ti(t._icon),o=n.getPixelBounds(),s=n.getPixelOrigin(),l=V(o.min._subtract(s).add(i),o.max._subtract(s).subtract(i));if(!l.contains(a)){var u=H((Math.max(l.max.x,a.x)-l.max.x)/(o.max.x-l.max.x)-(Math.min(l.min.x,a.x)-l.min.x)/(o.min.x-l.min.x),(Math.max(l.max.y,a.y)-l.max.y)/(o.max.y-l.max.y)-(Math.min(l.min.y,a.y)-l.min.y)/(o.min.y-l.min.y)).multiplyBy(r);n.panBy(u,{animate:!1}),this._draggable._newPos._add(u),this._draggable._startPos._add(u),tr(t._icon,this._draggable._newPos),this._onDrag(e),this._panRequest=k(this._adjustPan.bind(this,e))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(e){this._marker.options.autoPan&&(D(this._panRequest),this._panRequest=k(this._adjustPan.bind(this,e)))},_onDrag:function(e){var t=this._marker,n=t._shadow,r=ti(t._icon),i=t._map.layerPointToLatLng(r);n&&tr(n,r),t._latlng=i,e.latlng=i,e.oldLatLng=this._oldLatLng,t.fire("move",e).fire("drag",e)},_onDragEnd:function(e){D(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",e)}}),t9=t3.extend({options:{icon:new t8,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(e,t){w(this,t),this._latlng=J(e)},onAdd:function(e){this._zoomAnimated=this._zoomAnimated&&e.options.markerZoomAnimation,this._zoomAnimated&&e.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(e){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&e.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(e){var t=this._latlng;return this._latlng=J(e),this.update(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},setZIndexOffset:function(e){return this.options.zIndexOffset=e,this.update()},getIcon:function(){return this.options.icon},setIcon:function(e){return this.options.icon=e,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var e=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(e)}return this},_initIcon:function(){var e=this.options,t="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),n=e.icon.createIcon(this._icon),r=!1;n!==this._icon&&(this._icon&&this._removeIcon(),r=!0,e.title&&(n.title=e.title),"IMG"===n.tagName&&(n.alt=e.alt||"")),e6(n,t),e.keyboard&&(n.tabIndex="0",n.setAttribute("role","button")),this._icon=n,e.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&th(n,"focus",this._panOnFocus,this);var i=e.icon.createShadow(this._shadow),a=!1;i!==this._shadow&&(this._removeShadow(),a=!0),i&&(e6(i,t),i.alt=""),this._shadow=i,e.opacity<1&&this._updateOpacity(),r&&this.getPane().appendChild(this._icon),this._initInteraction(),i&&a&&this.getPane(e.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&tm(this._icon,"focus",this._panOnFocus,this),e1(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&e1(this._shadow),this._shadow=null},_setPos:function(e){this._icon&&tr(this._icon,e),this._shadow&&tr(this._shadow,e),this._zIndex=e.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(e){this._icon&&(this._icon.style.zIndex=this._zIndex+e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center).round();this._setPos(t)},_initInteraction:function(){if(this.options.interactive&&(e6(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),t7)){var e=this.options.draggable;this.dragging&&(e=this.dragging.enabled(),this.dragging.disable()),this.dragging=new t7(this),e&&this.dragging.enable()}},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var e=this.options.opacity;this._icon&&te(this._icon,e),this._shadow&&te(this._shadow,e)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var e=this._map;if(e){var t=this.options.icon.options,n=t.iconSize?H(t.iconSize):H(0,0),r=t.iconAnchor?H(t.iconAnchor):H(0,0);e.panInside(this._latlng,{paddingTopLeft:r,paddingBottomRight:n.subtract(r)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}}),ne=t3.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(e){this._renderer=e.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(e){return w(this,e),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&e&&Object.prototype.hasOwnProperty.call(e,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),nt=ne.extend({options:{fill:!0,radius:10},initialize:function(e,t){w(this,t),this._latlng=J(e),this._radius=this.options.radius},setLatLng:function(e){var t=this._latlng;return this._latlng=J(e),this.redraw(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(e){return this.options.radius=this._radius=e,this.redraw()},getRadius:function(){return this._radius},setStyle:function(e){var t=e&&e.radius||this._radius;return ne.prototype.setStyle.call(this,e),this.setRadius(t),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var e=this._radius,t=this._radiusY||e,n=this._clickTolerance(),r=[e+n,t+n];this._pxBounds=new G(this._point.subtract(r),this._point.add(r))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(e){return e.distanceTo(this._point)<=this._radius+this._clickTolerance()}}),nn=nt.extend({initialize:function(e,n,r){if("number"==typeof n&&(n=t({},r,{radius:n})),w(this,n),this._latlng=J(e),isNaN(this.options.radius))throw Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(e){return this._mRadius=e,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var e=[this._radius,this._radiusY||this._radius];return new W(this._map.layerPointToLatLng(this._point.subtract(e)),this._map.layerPointToLatLng(this._point.add(e)))},setStyle:ne.prototype.setStyle,_project:function(){var e=this._latlng.lng,t=this._latlng.lat,n=this._map,r=n.options.crs;if(r.distance===Y.distance){var i=Math.PI/180,a=this._mRadius/Y.R/i,o=n.project([t+a,e]),s=n.project([t-a,e]),l=o.add(s).divideBy(2),u=n.unproject(l).lat,c=Math.acos((Math.cos(a*i)-Math.sin(t*i)*Math.sin(u*i))/(Math.cos(t*i)*Math.cos(u*i)))/i;(isNaN(c)||0===c)&&(c=a/Math.cos(Math.PI/180*t)),this._point=l.subtract(n.getPixelOrigin()),this._radius=isNaN(c)?0:l.x-n.project([u,e-c]).x,this._radiusY=l.y-o.y}else{var d=r.unproject(r.project(this._latlng).subtract([this._mRadius,0]));this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(d).x}this._updateBounds()}}),nr=ne.extend({options:{smoothFactor:1,noClip:!1},initialize:function(e,t){w(this,t),this._setLatLngs(e)},getLatLngs:function(){return this._latlngs},setLatLngs:function(e){return this._setLatLngs(e),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(e){for(var t,n,r=1/0,i=null,a=tJ,o=0,s=this._parts.length;o<s;o++)for(var l=this._parts[o],u=1,c=l.length;u<c;u++){var d=a(e,t=l[u-1],n=l[u],!0);d<r&&(r=d,i=a(e,t,n))}return i&&(i.distance=Math.sqrt(r)),i},getCenter:function(){if(!this._map)throw Error("Must add layer to map before using getCenter()");return tX(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(e,t){return t=t||this._defaultShape(),e=J(e),t.push(e),this._bounds.extend(e),this.redraw()},_setLatLngs:function(e){this._bounds=new W,this._latlngs=this._convertLatLngs(e)},_defaultShape:function(){return tK(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(e){for(var t=[],n=tK(e),r=0,i=e.length;r<i;r++)n?(t[r]=J(e[r]),this._bounds.extend(t[r])):t[r]=this._convertLatLngs(e[r]);return t},_project:function(){var e=new G;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,e),this._bounds.isValid()&&e.isValid()&&(this._rawPxBounds=e,this._updateBounds())},_updateBounds:function(){var e=this._clickTolerance(),t=new j(e,e);this._rawPxBounds&&(this._pxBounds=new G([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(e,t,n){var r,i,a=e[0]instanceof $,o=e.length;if(a){for(r=0,i=[];r<o;r++)i[r]=this._map.latLngToLayerPoint(e[r]),n.extend(i[r]);t.push(i)}else for(r=0;r<o;r++)this._projectLatlngs(e[r],t,n)},_clipPoints:function(){var e=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(e)){if(this.options.noClip){this._parts=this._rings;return}var t,n,r,i,a,o,s,l=this._parts;for(t=0,r=0,i=this._rings.length;t<i;t++)for(n=0,a=(s=this._rings[t]).length;n<a-1;n++)(o=tW(s[n],s[n+1],e,n,!0))&&(l[r]=l[r]||[],l[r].push(o[0]),(o[1]!==s[n+1]||n===a-2)&&(l[r].push(o[1]),r++))}},_simplifyPoints:function(){for(var e=this._parts,t=this.options.smoothFactor,n=0,r=e.length;n<r;n++)e[n]=tG(e[n],t)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(e,t){var n,r,i,a,o,s,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(n=0,a=this._parts.length;n<a;n++)for(r=0,i=(o=(s=this._parts[n]).length)-1;r<o;i=r++)if((t||0!==r)&&tV(e,s[i],s[r])<=l)return!0;return!1}});nr._flat=tY;var ni=nr.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw Error("Must add layer to map before using getCenter()");return tz(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(e){var t=nr.prototype._convertLatLngs.call(this,e),n=t.length;return n>=2&&t[0]instanceof $&&t[0].equals(t[n-1])&&t.pop(),t},_setLatLngs:function(e){nr.prototype._setLatLngs.call(this,e),tK(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return tK(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,t=this.options.weight,n=new j(t,t);if(e=new G(e.min.subtract(n),e.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(e)){if(this.options.noClip){this._parts=this._rings;return}for(var r,i=0,a=this._rings.length;i<a;i++)(r=tj(this._rings[i],e,!0)).length&&this._parts.push(r)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(e){var t,n,r,i,a,o,s,l,u=!1;if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(i=0,s=this._parts.length;i<s;i++)for(a=0,o=(l=(t=this._parts[i]).length)-1;a<l;o=a++)n=t[a],r=t[o],n.y>e.y!=r.y>e.y&&e.x<(r.x-n.x)*(e.y-n.y)/(r.y-n.y)+n.x&&(u=!u);return u||nr.prototype._containsPoint.call(this,e,!0)}}),na=t5.extend({initialize:function(e,t){w(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t,n,r,i=T(e)?e:e.features;if(i){for(t=0,n=i.length;t<n;t++)((r=i[t]).geometries||r.geometry||r.features||r.coordinates)&&this.addData(r);return this}var a=this.options;if(a.filter&&!a.filter(e))return this;var o=no(e,a);return o?(o.feature=np(e),o.defaultOptions=o.options,this.resetStyle(o),a.onEachFeature&&a.onEachFeature(e,o),this.addLayer(o)):this},resetStyle:function(e){return void 0===e?this.eachLayer(this.resetStyle,this):(e.options=t({},e.defaultOptions),this._setLayerStyle(e,this.options.style),this)},setStyle:function(e){return this.eachLayer(function(t){this._setLayerStyle(t,e)},this)},_setLayerStyle:function(e,t){e.setStyle&&("function"==typeof t&&(t=t(e.feature)),e.setStyle(t))}});function no(e,t){var n,r,i,a="Feature"===e.type?e.geometry:e,o=a?a.coordinates:null,s=[],l=t&&t.pointToLayer,u=t&&t.coordsToLatLng||nl;if(!o&&!a)return null;switch(a.type){case"Point":return ns(l,e,n=u(o),t);case"MultiPoint":for(r=0,i=o.length;r<i;r++)n=u(o[r]),s.push(ns(l,e,n,t));return new t5(s);case"LineString":case"MultiLineString":return new nr(nu(o,+("LineString"!==a.type),u),t);case"Polygon":case"MultiPolygon":return new ni(nu(o,"Polygon"===a.type?1:2,u),t);case"GeometryCollection":for(r=0,i=a.geometries.length;r<i;r++){var c=no({geometry:a.geometries[r],type:"Feature",properties:e.properties},t);c&&s.push(c)}return new t5(s);case"FeatureCollection":for(r=0,i=a.features.length;r<i;r++){var d=no(a.features[r],t);d&&s.push(d)}return new t5(s);default:throw Error("Invalid GeoJSON object.")}}function ns(e,t,n,r){return e?e(t,n):new t9(n,r&&r.markersInheritOptions&&r)}function nl(e){return new $(e[1],e[0],e[2])}function nu(e,t,n){for(var r=[],i=0,a=e.length;i<a;i++)r.push(t?nu(e[i],t-1,n):(n||nl)(e[i]));return r}function nc(e,t){return void 0!==(e=J(e)).alt?[b(e.lng,t),b(e.lat,t),b(e.alt,t)]:[b(e.lng,t),b(e.lat,t)]}function nd(e,t,n,r){for(var i=[],a=0,o=e.length;a<o;a++)i.push(t?nd(e[a],tK(e[a])?0:t-1,n,r):nc(e[a],r));return!t&&n&&i.length>0&&i.push(i[0].slice()),i}function nh(e,n){return e.feature?t({},e.feature,{geometry:n}):np(n)}function np(e){return"Feature"===e.type||"FeatureCollection"===e.type?e:{type:"Feature",properties:{},geometry:e}}var nm={toGeoJSON:function(e){return nh(this,{type:"Point",coordinates:nc(this.getLatLng(),e)})}};function nf(e,t){return new na(e,t)}t9.include(nm),nn.include(nm),nt.include(nm),nr.include({toGeoJSON:function(e){var t=!tK(this._latlngs),n=nd(this._latlngs,+!!t,!1,e);return nh(this,{type:(t?"Multi":"")+"LineString",coordinates:n})}}),ni.include({toGeoJSON:function(e){var t=!tK(this._latlngs),n=t&&!tK(this._latlngs[0]),r=nd(this._latlngs,n?2:+!!t,!0,e);return t||(r=[r]),nh(this,{type:(n?"Multi":"")+"Polygon",coordinates:r})}}),t4.include({toMultiPoint:function(e){var t=[];return this.eachLayer(function(n){t.push(n.toGeoJSON(e).geometry.coordinates)}),nh(this,{type:"MultiPoint",coordinates:t})},toGeoJSON:function(e){var t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===t)return this.toMultiPoint(e);var n="GeometryCollection"===t,r=[];return(this.eachLayer(function(t){if(t.toGeoJSON){var i=t.toGeoJSON(e);if(n)r.push(i.geometry);else{var a=np(i);"FeatureCollection"===a.type?r.push.apply(r,a.features):r.push(a)}}}),n)?nh(this,{geometries:r,type:"GeometryCollection"}):{type:"FeatureCollection",features:r}}});var ng=t3.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,t,n){this._url=e,this._bounds=q(t),w(this,n)},onAdd:function(){!this._image&&(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(e6(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){e1(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&e3(this._image),this},bringToBack:function(){return this._map&&e4(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=q(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e="IMG"===this._url.tagName,t=this._image=e?this._url:e0("img");if(e6(t,"leaflet-image-layer"),this._zoomAnimated&&e6(t,"leaflet-zoom-animated"),this.options.className&&e6(t,this.options.className),t.onselectstart=y,t.onmousemove=y,t.onload=p(this.fire,this,"load"),t.onerror=p(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(t.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e){this._url=t.src;return}t.src=this._url,t.alt=this.options.alt},_animateZoom:function(e){var t=this._map.getZoomScale(e.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;tn(this._image,n,t)},_reset:function(){var e=this._image,t=new G(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=t.getSize();tr(e,t.min),e.style.width=n.x+"px",e.style.height=n.y+"px"},_updateOpacity:function(){te(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),nv=ng.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e="VIDEO"===this._url.tagName,t=this._image=e?this._url:e0("video");if(e6(t,"leaflet-image-layer"),this._zoomAnimated&&e6(t,"leaflet-zoom-animated"),this.options.className&&e6(t,this.options.className),t.onselectstart=y,t.onmousemove=y,t.onloadeddata=p(this.fire,this,"load"),e){for(var n=t.getElementsByTagName("source"),r=[],i=0;i<n.length;i++)r.push(n[i].src);this._url=n.length>0?r:[t.src];return}T(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(t.style,"objectFit")&&(t.style.objectFit="fill"),t.autoplay=!!this.options.autoplay,t.loop=!!this.options.loop,t.muted=!!this.options.muted,t.playsInline=!!this.options.playsInline;for(var a=0;a<this._url.length;a++){var o=e0("source");o.src=this._url[a],t.appendChild(o)}}}),ny=ng.extend({_initImage:function(){var e=this._image=this._url;e6(e,"leaflet-image-layer"),this._zoomAnimated&&e6(e,"leaflet-zoom-animated"),this.options.className&&e6(e,this.options.className),e.onselectstart=y,e.onmousemove=y}}),nb=t3.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(e,t){e&&(e instanceof $||T(e))?(this._latlng=J(e),w(this,t)):(w(this,e),this._source=t),this.options.content&&(this._content=this.options.content)},openOn:function(e){return e=arguments.length?e:this._source._map,e.hasLayer(this)||e.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(e){return this._map?this.close():(arguments.length?this._source=e:e=this._source,this._prepareOpen(),this.openOn(e._map)),this},onAdd:function(e){this._zoomAnimated=e._zoomAnimated,this._container||this._initLayout(),e._fadeAnimated&&te(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),e._fadeAnimated&&te(this._container,1),this.bringToFront(),this.options.interactive&&(e6(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(e){e._fadeAnimated?(te(this._container,0),this._removeTimeout=setTimeout(p(e1,void 0,this._container),200)):e1(this._container),this.options.interactive&&(e8(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(e){return this._latlng=J(e),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(e){return this._content=e,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var e={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&e3(this._container),this},bringToBack:function(){return this._map&&e4(this._container),this},_prepareOpen:function(e){var t=this._source;if(!t._map)return!1;if(t instanceof t5){t=null;var n=this._source._layers;for(var r in n)if(n[r]._map){t=n[r];break}if(!t)return!1;this._source=t}if(!e)if(t.getCenter)e=t.getCenter();else if(t.getLatLng)e=t.getLatLng();else if(t.getBounds)e=t.getBounds().getCenter();else throw Error("Unable to get source layer LatLng.");return this.setLatLng(e),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var e=this._contentNode,t="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof t)e.innerHTML=t;else{for(;e.hasChildNodes();)e.removeChild(e.firstChild);e.appendChild(t)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var e=this._map.latLngToLayerPoint(this._latlng),t=H(this.options.offset),n=this._getAnchor();this._zoomAnimated?tr(this._container,e.add(n)):t=t.add(e).add(n);var r=this._containerBottom=-t.y,i=this._containerLeft=-Math.round(this._containerWidth/2)+t.x;this._container.style.bottom=r+"px",this._container.style.left=i+"px"}},_getAnchor:function(){return[0,0]}});tN.include({_initOverlay:function(e,t,n,r){var i=t;return i instanceof e||(i=new e(r).setContent(t)),n&&i.setLatLng(n),i}}),t3.include({_initOverlay:function(e,t,n,r){var i=n;return i instanceof e?(w(i,r),i._source=this):(i=t&&!r?t:new e(r,this)).setContent(n),i}});var n_=nb.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(e){return e=arguments.length?e:this._source._map,!e.hasLayer(this)&&e._popup&&e._popup.options.autoClose&&e.removeLayer(e._popup),e._popup=this,nb.prototype.openOn.call(this,e)},onAdd:function(e){nb.prototype.onAdd.call(this,e),e.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof ne||this._source.on("preclick",tb))},onRemove:function(e){nb.prototype.onRemove.call(this,e),e.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof ne||this._source.off("preclick",tb))},getEvents:function(){var e=nb.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(e.preclick=this.close),this.options.keepInView&&(e.moveend=this._adjustPan),e},_initLayout:function(){var e="leaflet-popup",t=this._container=e0("div",e+" "+(this.options.className||"")+" leaflet-zoom-animated"),n=this._wrapper=e0("div",e+"-content-wrapper",t);if(this._contentNode=e0("div",e+"-content",n),tx(t),t_(this._contentNode),th(t,"contextmenu",tb),this._tipContainer=e0("div",e+"-tip-container",t),this._tip=e0("div",e+"-tip",this._tipContainer),this.options.closeButton){var r=this._closeButton=e0("a",e+"-close-button",t);r.setAttribute("role","button"),r.setAttribute("aria-label","Close popup"),r.href="#close",r.innerHTML='<span aria-hidden="true">&#215;</span>',th(r,"click",function(e){tw(e),this.close()},this)}},_updateLayout:function(){var e=this._contentNode,t=e.style;t.width="",t.whiteSpace="nowrap";var n=e.offsetWidth;t.width=(n=Math.max(n=Math.min(n,this.options.maxWidth),this.options.minWidth))+1+"px",t.whiteSpace="",t.height="";var r=e.offsetHeight,i=this.options.maxHeight,a="leaflet-popup-scrolled";i&&r>i?(t.height=i+"px",e6(e,a)):e8(e,a),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),n=this._getAnchor();tr(this._container,t.add(n))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var e=this._map,t=parseInt(eQ(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+t,r=this._containerWidth,i=new j(this._containerLeft,-n-this._containerBottom);i._add(ti(this._container));var a=e.layerPointToContainerPoint(i),o=H(this.options.autoPanPadding),s=H(this.options.autoPanPaddingTopLeft||o),l=H(this.options.autoPanPaddingBottomRight||o),u=e.getSize(),c=0,d=0;a.x+r+l.x>u.x&&(c=a.x+r-u.x+l.x),a.x-c-s.x<0&&(c=a.x-s.x),a.y+n+l.y>u.y&&(d=a.y+n-u.y+l.y),a.y-d-s.y<0&&(d=a.y-s.y),(c||d)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([c,d]))}},_getAnchor:function(){return H(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});tN.mergeOptions({closePopupOnClick:!0}),tN.include({openPopup:function(e,t,n){return this._initOverlay(n_,e,t,n).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),t3.include({bindPopup:function(e,t){return this._popup=this._initOverlay(n_,this._popup,e,t),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(e){return this._popup&&(this instanceof t5||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(this._popup&&this._map){tS(e);var t=e.layer||e.target;if(this._popup._source===t&&!(t instanceof ne))return void(this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng));this._popup._source=t,this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){13===e.originalEvent.keyCode&&this._openPopup(e)}});var nx=nb.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){nb.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){nb.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=nb.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=e0("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+f(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var t,n,r=this._map,i=this._container,a=r.latLngToContainerPoint(r.getCenter()),o=r.layerPointToContainerPoint(e),s=this.options.direction,l=i.offsetWidth,u=i.offsetHeight,c=H(this.options.offset),d=this._getAnchor();"top"===s?(t=l/2,n=u):"bottom"===s?(t=l/2,n=0):("center"===s?t=l/2:"right"===s?t=0:"left"===s?t=l:o.x<a.x?(s="right",t=0):(s="left",t=l+(c.x+d.x)*2),n=u/2),e=e.subtract(H(t,n,!0)).add(c).add(d),e8(i,"leaflet-tooltip-right"),e8(i,"leaflet-tooltip-left"),e8(i,"leaflet-tooltip-top"),e8(i,"leaflet-tooltip-bottom"),e6(i,"leaflet-tooltip-"+s),tr(i,e)},_updatePosition:function(){var e=this._map.latLngToLayerPoint(this._latlng);this._setPosition(e)},setOpacity:function(e){this.options.opacity=e,this._container&&te(this._container,e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);this._setPosition(t)},_getAnchor:function(){return H(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}});tN.include({openTooltip:function(e,t,n){return this._initOverlay(nx,e,t,n).openOn(this),this},closeTooltip:function(e){return e.close(),this}}),t3.include({bindTooltip:function(e,t){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(nx,this._tooltip,e,t),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(e){if(e||!this._tooltipHandlersAdded){var t={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?t.add=this._openTooltip:(t.mouseover=this._openTooltip,t.mouseout=this.closeTooltip,t.click=this._openTooltip,this._map?this._addFocusListeners():t.add=this._addFocusListeners),this._tooltip.options.sticky&&(t.mousemove=this._moveTooltip),this[e?"off":"on"](t),this._tooltipHandlersAdded=!e}},openTooltip:function(e){return this._tooltip&&(this instanceof t5||(this._tooltip._source=this),this._tooltip._prepareOpen(e)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(e){return this._tooltip&&this._tooltip.setContent(e),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(e){var t="function"==typeof e.getElement&&e.getElement();t&&(th(t,"focus",function(){this._tooltip._source=e,this.openTooltip()},this),th(t,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(e){var t="function"==typeof e.getElement&&e.getElement();t&&t.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(e){if(this._tooltip&&this._map){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var t=this;this._map.once("moveend",function(){t._openOnceFlag=!1,t._openTooltip(e)});return}this._tooltip._source=e.layer||e.target,this.openTooltip(this._tooltip.options.sticky?e.latlng:void 0)}},_moveTooltip:function(e){var t,n,r=e.latlng;this._tooltip.options.sticky&&e.originalEvent&&(t=this._map.mouseEventToContainerPoint(e.originalEvent),n=this._map.containerPointToLayerPoint(t),r=this._map.layerPointToLatLng(n)),this._tooltip.setLatLng(r)}});var nw=t6.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(e){var t=e&&"DIV"===e.tagName?e:document.createElement("div"),n=this.options;if(n.html instanceof Element?(e2(t),t.appendChild(n.html)):t.innerHTML=!1!==n.html?n.html:"",n.bgPos){var r=H(n.bgPos);t.style.backgroundPosition=-r.x+"px "+-r.y+"px"}return this._setIconStyles(t,"icon"),t},createShadow:function(){return null}});t6.Default=t8;var nS=t3.extend({options:{tileSize:256,opacity:1,updateWhenIdle:eD.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(e){w(this,e)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(e){e._addZoomLimit(this)},onRemove:function(e){this._removeAllTiles(),e1(this._container),e._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(e3(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(e4(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var e=this._clampZoom(this._map.getZoom());e!==this._tileZoom&&(this._tileZoom=e,this._updateLevels()),this._update()}return this},getEvents:function(){var e={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=g(this._onMoveEnd,this.options.updateInterval,this)),e.move=this._onMove),this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},createTile:function(){return document.createElement("div")},getTileSize:function(){var e=this.options.tileSize;return e instanceof j?e:new j(e,e)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e){for(var t,n=this.getPane().children,r=-e(-1/0,1/0),i=0,a=n.length;i<a;i++)t=n[i].style.zIndex,n[i]!==this._container&&t&&(r=e(r,+t));isFinite(r)&&(this.options.zIndex=r+e(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!eD.ielt9){te(this._container,this.options.opacity);var e=+new Date,t=!1,n=!1;for(var r in this._tiles){var i=this._tiles[r];if(i.current&&i.loaded){var a=Math.min(1,(e-i.loaded)/200);te(i.el,a),a<1?t=!0:(i.active?n=!0:this._onOpaqueTile(i),i.active=!0)}}n&&!this._noPrune&&this._pruneTiles(),t&&(D(this._fadeFrame),this._fadeFrame=k(this._updateOpacity,this))}},_onOpaqueTile:y,_initContainer:function(){this._container||(this._container=e0("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var e=this._tileZoom,t=this.options.maxZoom;if(void 0!==e){for(var n in this._levels)n=Number(n),this._levels[n].el.children.length||n===e?(this._levels[n].el.style.zIndex=t-Math.abs(e-n),this._onUpdateLevel(n)):(e1(this._levels[n].el),this._removeTilesAtZoom(n),this._onRemoveLevel(n),delete this._levels[n]);var r=this._levels[e],i=this._map;return r||((r=this._levels[e]={}).el=e0("div","leaflet-tile-container leaflet-zoom-animated",this._container),r.el.style.zIndex=t,r.origin=i.project(i.unproject(i.getPixelOrigin()),e).round(),r.zoom=e,this._setZoomTransform(r,i.getCenter(),i.getZoom()),y(r.el.offsetWidth),this._onCreateLevel(r)),this._level=r,r}},_onUpdateLevel:y,_onRemoveLevel:y,_onCreateLevel:y,_pruneTiles:function(){if(this._map){var e,t,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)return void this._removeAllTiles();for(e in this._tiles)(t=this._tiles[e]).retain=t.current;for(e in this._tiles)if((t=this._tiles[e]).current&&!t.active){var r=t.coords;this._retainParent(r.x,r.y,r.z,r.z-5)||this._retainChildren(r.x,r.y,r.z,r.z+2)}for(e in this._tiles)this._tiles[e].retain||this._removeTile(e)}},_removeTilesAtZoom:function(e){for(var t in this._tiles)this._tiles[t].coords.z===e&&this._removeTile(t)},_removeAllTiles:function(){for(var e in this._tiles)this._removeTile(e)},_invalidateAll:function(){for(var e in this._levels)e1(this._levels[e].el),this._onRemoveLevel(Number(e)),delete this._levels[e];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(e,t,n,r){var i=Math.floor(e/2),a=Math.floor(t/2),o=n-1,s=new j(+i,+a);s.z=+o;var l=this._tileCoordsToKey(s),u=this._tiles[l];return u&&u.active?(u.retain=!0,!0):(u&&u.loaded&&(u.retain=!0),o>r&&this._retainParent(i,a,o,r))},_retainChildren:function(e,t,n,r){for(var i=2*e;i<2*e+2;i++)for(var a=2*t;a<2*t+2;a++){var o=new j(i,a);o.z=n+1;var s=this._tileCoordsToKey(o),l=this._tiles[s];if(l&&l.active){l.retain=!0;continue}l&&l.loaded&&(l.retain=!0),n+1<r&&this._retainChildren(i,a,n+1,r)}},_resetView:function(e){var t=e&&(e.pinch||e.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(e){this._setView(e.center,e.zoom,!0,e.noUpdate)},_clampZoom:function(e){var t=this.options;return void 0!==t.minNativeZoom&&e<t.minNativeZoom?t.minNativeZoom:void 0!==t.maxNativeZoom&&t.maxNativeZoom<e?t.maxNativeZoom:e},_setView:function(e,t,n,r){var i=Math.round(t);i=void 0!==this.options.maxZoom&&i>this.options.maxZoom||void 0!==this.options.minZoom&&i<this.options.minZoom?void 0:this._clampZoom(i);var a=this.options.updateWhenZooming&&i!==this._tileZoom;(!r||a)&&(this._tileZoom=i,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==i&&this._update(e),n||this._pruneTiles(),this._noPrune=!!n),this._setZoomTransforms(e,t)},_setZoomTransforms:function(e,t){for(var n in this._levels)this._setZoomTransform(this._levels[n],e,t)},_setZoomTransform:function(e,t,n){var r=this._map.getZoomScale(n,e.zoom),i=e.origin.multiplyBy(r).subtract(this._map._getNewPixelOrigin(t,n)).round();eD.any3d?tn(e.el,i,r):tr(e.el,i)},_resetGrid:function(){var e=this._map,t=e.options.crs,n=this._tileSize=this.getTileSize(),r=this._tileZoom,i=this._map.getPixelWorldBounds(this._tileZoom);i&&(this._globalTileRange=this._pxBoundsToTileRange(i)),this._wrapX=t.wrapLng&&!this.options.noWrap&&[Math.floor(e.project([0,t.wrapLng[0]],r).x/n.x),Math.ceil(e.project([0,t.wrapLng[1]],r).x/n.y)],this._wrapY=t.wrapLat&&!this.options.noWrap&&[Math.floor(e.project([t.wrapLat[0],0],r).y/n.x),Math.ceil(e.project([t.wrapLat[1],0],r).y/n.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(e){var t=this._map,n=t._animatingZoom?Math.max(t._animateToZoom,t.getZoom()):t.getZoom(),r=t.getZoomScale(n,this._tileZoom),i=t.project(e,this._tileZoom).floor(),a=t.getSize().divideBy(2*r);return new G(i.subtract(a),i.add(a))},_update:function(e){var t=this._map;if(t){var n=this._clampZoom(t.getZoom());if(void 0===e&&(e=t.getCenter()),void 0!==this._tileZoom){var r=this._getTiledPixelBounds(e),i=this._pxBoundsToTileRange(r),a=i.getCenter(),o=[],s=this.options.keepBuffer,l=new G(i.getBottomLeft().subtract([s,-s]),i.getTopRight().add([s,-s]));if(!(isFinite(i.min.x)&&isFinite(i.min.y)&&isFinite(i.max.x)&&isFinite(i.max.y)))throw Error("Attempted to load an infinite number of tiles");for(var u in this._tiles){var c=this._tiles[u].coords;c.z===this._tileZoom&&l.contains(new j(c.x,c.y))||(this._tiles[u].current=!1)}if(Math.abs(n-this._tileZoom)>1)return void this._setView(e,n);for(var d=i.min.y;d<=i.max.y;d++)for(var h=i.min.x;h<=i.max.x;h++){var p=new j(h,d);if(p.z=this._tileZoom,this._isValidTile(p)){var m=this._tiles[this._tileCoordsToKey(p)];m?m.current=!0:o.push(p)}}if(o.sort(function(e,t){return e.distanceTo(a)-t.distanceTo(a)}),0!==o.length){this._loading||(this._loading=!0,this.fire("loading"));var f=document.createDocumentFragment();for(h=0;h<o.length;h++)this._addTile(o[h],f);this._level.el.appendChild(f)}}}},_isValidTile:function(e){var t=this._map.options.crs;if(!t.infinite){var n=this._globalTileRange;if(!t.wrapLng&&(e.x<n.min.x||e.x>n.max.x)||!t.wrapLat&&(e.y<n.min.y||e.y>n.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(e);return q(this.options.bounds).overlaps(r)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var t=this._map,n=this.getTileSize(),r=e.scaleBy(n),i=r.add(n);return[t.unproject(r,e.z),t.unproject(i,e.z)]},_tileCoordsToBounds:function(e){var t=this._tileCoordsToNwSe(e),n=new W(t[0],t[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var t=e.split(":"),n=new j(+t[0],+t[1]);return n.z=+t[2],n},_removeTile:function(e){var t=this._tiles[e];t&&(e1(t.el),delete this._tiles[e],this.fire("tileunload",{tile:t.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){e6(e,"leaflet-tile");var t=this.getTileSize();e.style.width=t.x+"px",e.style.height=t.y+"px",e.onselectstart=y,e.onmousemove=y,eD.ielt9&&this.options.opacity<1&&te(e,this.options.opacity)},_addTile:function(e,t){var n=this._getTilePos(e),r=this._tileCoordsToKey(e),i=this.createTile(this._wrapCoords(e),p(this._tileReady,this,e));this._initTile(i),this.createTile.length<2&&k(p(this._tileReady,this,e,null,i)),tr(i,n),this._tiles[r]={el:i,coords:e,current:!0},t.appendChild(i),this.fire("tileloadstart",{tile:i,coords:e})},_tileReady:function(e,t,n){t&&this.fire("tileerror",{error:t,tile:n,coords:e});var r=this._tileCoordsToKey(e);(n=this._tiles[r])&&(n.loaded=+new Date,this._map._fadeAnimated?(te(n.el,0),D(this._fadeFrame),this._fadeFrame=k(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),t||(e6(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),eD.ielt9||!this._map._fadeAnimated?k(this._pruneTiles,this):setTimeout(p(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var t=new j(this._wrapX?v(e.x,this._wrapX):e.x,this._wrapY?v(e.y,this._wrapY):e.y);return t.z=e.z,t},_pxBoundsToTileRange:function(e){var t=this.getTileSize();return new G(e.min.unscaleBy(t).floor(),e.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}}),nE=nS.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,t){this._url=e,(t=w(this,t)).detectRetina&&eD.retina&&t.maxZoom>0?(t.tileSize=Math.floor(t.tileSize/2),t.zoomReverse?(t.zoomOffset--,t.minZoom=Math.min(t.maxZoom,t.minZoom+1)):(t.zoomOffset++,t.maxZoom=Math.max(t.minZoom,t.maxZoom-1)),t.minZoom=Math.max(0,t.minZoom)):t.zoomReverse?t.minZoom=Math.min(t.maxZoom,t.minZoom):t.maxZoom=Math.max(t.minZoom,t.maxZoom),"string"==typeof t.subdomains&&(t.subdomains=t.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(e,t){return this._url===e&&void 0===t&&(t=!0),this._url=e,t||this.redraw(),this},createTile:function(e,t){var n=document.createElement("img");return th(n,"load",p(this._tileOnLoad,this,t,n)),th(n,"error",p(this._tileOnError,this,t,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(n.referrerPolicy=this.options.referrerPolicy),n.alt="",n.src=this.getTileUrl(e),n},getTileUrl:function(e){var n={r:eD.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var r=this._globalTileRange.max.y-e.y;this.options.tms&&(n.y=r),n["-y"]=r}return A(this._url,t(n,this.options))},_tileOnLoad:function(e,t){eD.ielt9?setTimeout(p(e,this,null,t),0):e(null,t)},_tileOnError:function(e,t,n){var r=this.options.errorTileUrl;r&&t.getAttribute("src")!==r&&(t.src=r),e(n,t)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,t=this.options.maxZoom,n=this.options.zoomReverse,r=this.options.zoomOffset;return n&&(e=t-e),e+r},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var e,t;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&((t=this._tiles[e].el).onload=y,t.onerror=y,!t.complete)){t.src=C;var n=this._tiles[e].coords;e1(t),delete this._tiles[e],this.fire("tileabort",{tile:t,coords:n})}},_removeTile:function(e){var t=this._tiles[e];if(t)return t.el.setAttribute("src",C),nS.prototype._removeTile.call(this,e)},_tileReady:function(e,t,n){if(this._map&&(!n||n.getAttribute("src")!==C))return nS.prototype._tileReady.call(this,e,t,n)}});function nA(e,t){return new nE(e,t)}var nT=nE.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,n){this._url=e;var r=t({},this.defaultWmsParams);for(var i in n)i in this.options||(r[i]=n[i]);var a=(n=w(this,n)).detectRetina&&eD.retina?2:1,o=this.getTileSize();r.width=o.x*a,r.height=o.y*a,this.wmsParams=r},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[t]=this._crs.code,nE.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._tileCoordsToNwSe(e),n=this._crs,r=V(n.project(t[0]),n.project(t[1])),i=r.min,a=r.max,o=(this._wmsVersion>=1.3&&this._crs===t1?[i.y,i.x,a.y,a.x]:[i.x,i.y,a.x,a.y]).join(","),s=nE.prototype.getTileUrl.call(this,e);return s+S(this.wmsParams,s,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+o},setParams:function(e,n){return t(this.wmsParams,e),n||this.redraw(),this}});nE.WMS=nT,nA.wms=function(e,t){return new nT(e,t)};var nI=t3.extend({options:{padding:.1},initialize:function(e){w(this,e),f(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),e6(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,t){var n=this._map.getZoomScale(t,this._zoom),r=this._map.getSize().multiplyBy(.5+this.options.padding),i=this._map.project(this._center,t),a=r.multiplyBy(-n).add(i).subtract(this._map._getNewPixelOrigin(e,t));eD.any3d?tn(this._container,a,n):tr(this._container,a)},_reset:function(){for(var e in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,t=this._map.getSize(),n=this._map.containerPointToLayerPoint(t.multiplyBy(-e)).round();this._bounds=new G(n,n.add(t.multiplyBy(1+2*e)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),nC=nI.extend({options:{tolerance:0},getEvents:function(){var e=nI.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){nI.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");th(e,"mousemove",this._onMouseMove,this),th(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),th(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){D(this._redrawRequest),delete this._ctx,e1(this._container),tm(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var e in this._redrawBounds=null,this._layers)this._layers[e]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){nI.prototype._update.call(this);var e=this._bounds,t=this._container,n=e.getSize(),r=eD.retina?2:1;tr(t,e.min),t.width=r*n.x,t.height=r*n.y,t.style.width=n.x+"px",t.style.height=n.y+"px",eD.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){nI.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[f(e)]=e;var t=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var t=e._order,n=t.next,r=t.prev;n?n.prev=r:this._drawLast=r,r?r.next=n:this._drawFirst=n,delete e._order,delete this._layers[f(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if("string"==typeof e.options.dashArray){var t,n,r=e.options.dashArray.split(/[, ]+/),i=[];for(n=0;n<r.length;n++){if(isNaN(t=Number(r[n])))return;i.push(t)}e.options._dashArray=i}else e.options._dashArray=e.options.dashArray},_requestRedraw:function(e){this._map&&(this._extendRedrawBounds(e),this._redrawRequest=this._redrawRequest||k(this._redraw,this))},_extendRedrawBounds:function(e){if(e._pxBounds){var t=(e.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new G,this._redrawBounds.extend(e._pxBounds.min.subtract([t,t])),this._redrawBounds.extend(e._pxBounds.max.add([t,t]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var e=this._redrawBounds;if(e){var t=e.getSize();this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var e,t=this._redrawBounds;if(this._ctx.save(),t){var n=t.getSize();this._ctx.beginPath(),this._ctx.rect(t.min.x,t.min.y,n.x,n.y),this._ctx.clip()}this._drawing=!0;for(var r=this._drawFirst;r;r=r.next)e=r.layer,(!t||e._pxBounds&&e._pxBounds.intersects(t))&&e._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(e,t){if(this._drawing){var n,r,i,a,o=e._parts,s=o.length,l=this._ctx;if(s){for(l.beginPath(),n=0;n<s;n++){for(r=0,i=o[n].length;r<i;r++)a=o[n][r],l[r?"lineTo":"moveTo"](a.x,a.y);t&&l.closePath()}this._fillStroke(l,e)}}},_updateCircle:function(e){if(!(!this._drawing||e._empty())){var t=e._point,n=this._ctx,r=Math.max(Math.round(e._radius),1),i=(Math.max(Math.round(e._radiusY),1)||r)/r;1!==i&&(n.save(),n.scale(1,i)),n.beginPath(),n.arc(t.x,t.y/i,r,0,2*Math.PI,!1),1!==i&&n.restore(),this._fillStroke(n,e)}},_fillStroke:function(e,t){var n=t.options;n.fill&&(e.globalAlpha=n.fillOpacity,e.fillStyle=n.fillColor||n.color,e.fill(n.fillRule||"evenodd")),n.stroke&&0!==n.weight&&(e.setLineDash&&e.setLineDash(t.options&&t.options._dashArray||[]),e.globalAlpha=n.opacity,e.lineWidth=n.weight,e.strokeStyle=n.color,e.lineCap=n.lineCap,e.lineJoin=n.lineJoin,e.stroke())},_onClick:function(e){for(var t,n,r=this._map.mouseEventToLayerPoint(e),i=this._drawFirst;i;i=i.next)(t=i.layer).options.interactive&&t._containsPoint(r)&&("click"!==e.type&&"preclick"!==e.type||!this._map._draggableMoved(t))&&(n=t);this._fireEvent(!!n&&[n],e)},_onMouseMove:function(e){if(!(!this._map||this._map.dragging.moving())&&!this._map._animatingZoom){var t=this._map.mouseEventToLayerPoint(e);this._handleMouseHover(e,t)}},_handleMouseOut:function(e){var t=this._hoveredLayer;t&&(e8(this._container,"leaflet-interactive"),this._fireEvent([t],e,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(e,t){if(!this._mouseHoverThrottled){for(var n,r,i=this._drawFirst;i;i=i.next)(n=i.layer).options.interactive&&n._containsPoint(t)&&(r=n);r!==this._hoveredLayer&&(this._handleMouseOut(e),r&&(e6(this._container,"leaflet-interactive"),this._fireEvent([r],e,"mouseover"),this._hoveredLayer=r)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],e),this._mouseHoverThrottled=!0,setTimeout(p(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(e,t,n){this._map._fireDOMEvent(t,n||t.type,e)},_bringToFront:function(e){var t=e._order;if(t){var n=t.next,r=t.prev;if(!n)return;n.prev=r,r?r.next=n:n&&(this._drawFirst=n),t.prev=this._drawLast,this._drawLast.next=t,t.next=null,this._drawLast=t,this._requestRedraw(e)}},_bringToBack:function(e){var t=e._order;if(t){var n=t.next,r=t.prev;if(!r)return;r.next=n,n?n.prev=r:r&&(this._drawLast=r),t.prev=null,t.next=this._drawFirst,this._drawFirst.prev=t,this._drawFirst=t,this._requestRedraw(e)}}});function nM(e){return eD.canvas?new nC(e):null}var nN=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(e){return document.createElement("<lvml:"+e+' class="lvml">')}}catch(e){}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),nR=eD.vml?nN:en,nO=nI.extend({_initContainer:function(){this._container=nR("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=nR("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){e1(this._container),tm(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){nI.prototype._update.call(this);var e=this._bounds,t=e.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(t)||(this._svgSize=t,n.setAttribute("width",t.x),n.setAttribute("height",t.y)),tr(n,e.min),n.setAttribute("viewBox",[e.min.x,e.min.y,t.x,t.y].join(" ")),this.fire("update")}},_initPath:function(e){var t=e._path=nR("path");e.options.className&&e6(t,e.options.className),e.options.interactive&&e6(t,"leaflet-interactive"),this._updateStyle(e),this._layers[f(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){e1(e._path),e.removeInteractiveTarget(e._path),delete this._layers[f(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var t=e._path,n=e.options;t&&(n.stroke?(t.setAttribute("stroke",n.color),t.setAttribute("stroke-opacity",n.opacity),t.setAttribute("stroke-width",n.weight),t.setAttribute("stroke-linecap",n.lineCap),t.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?t.setAttribute("stroke-dasharray",n.dashArray):t.removeAttribute("stroke-dasharray"),n.dashOffset?t.setAttribute("stroke-dashoffset",n.dashOffset):t.removeAttribute("stroke-dashoffset")):t.setAttribute("stroke","none"),n.fill?(t.setAttribute("fill",n.fillColor||n.color),t.setAttribute("fill-opacity",n.fillOpacity),t.setAttribute("fill-rule",n.fillRule||"evenodd")):t.setAttribute("fill","none"))},_updatePoly:function(e,t){this._setPath(e,er(e._parts,t))},_updateCircle:function(e){var t=e._point,n=Math.max(Math.round(e._radius),1),r=Math.max(Math.round(e._radiusY),1)||n,i="a"+n+","+r+" 0 1,0 ",a=e._empty()?"M0 0":"M"+(t.x-n)+","+t.y+i+2*n+",0 "+i+-(2*n)+",0 ";this._setPath(e,a)},_setPath:function(e,t){e._path.setAttribute("d",t)},_bringToFront:function(e){e3(e._path)},_bringToBack:function(e){e4(e._path)}});function nP(e){return eD.svg||eD.vml?new nO(e):null}eD.vml&&nO.include({_initContainer:function(){this._container=e0("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(nI.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var t=e._container=nN("shape");e6(t,"leaflet-vml-shape "+(this.options.className||"")),t.coordsize="1 1",e._path=nN("path"),t.appendChild(e._path),this._updateStyle(e),this._layers[f(e)]=e},_addPath:function(e){var t=e._container;this._container.appendChild(t),e.options.interactive&&e.addInteractiveTarget(t)},_removePath:function(e){var t=e._container;e1(t),e.removeInteractiveTarget(t),delete this._layers[f(e)]},_updateStyle:function(e){var t=e._stroke,n=e._fill,r=e.options,i=e._container;i.stroked=!!r.stroke,i.filled=!!r.fill,r.stroke?(t||(t=e._stroke=nN("stroke")),i.appendChild(t),t.weight=r.weight+"px",t.color=r.color,t.opacity=r.opacity,r.dashArray?t.dashStyle=T(r.dashArray)?r.dashArray.join(" "):r.dashArray.replace(/( *, *)/g," "):t.dashStyle="",t.endcap=r.lineCap.replace("butt","flat"),t.joinstyle=r.lineJoin):t&&(i.removeChild(t),e._stroke=null),r.fill?(n||(n=e._fill=nN("fill")),i.appendChild(n),n.color=r.fillColor||r.color,n.opacity=r.fillOpacity):n&&(i.removeChild(n),e._fill=null)},_updateCircle:function(e){var t=e._point.round(),n=Math.round(e._radius),r=Math.round(e._radiusY||n);this._setPath(e,e._empty()?"M0 0":"AL "+t.x+","+t.y+" "+n+","+r+" 0,23592600")},_setPath:function(e,t){e._path.v=t},_bringToFront:function(e){e3(e._container)},_bringToBack:function(e){e4(e._container)}}),tN.include({getRenderer:function(e){var t=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return t||(t=this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(e){if("overlayPane"===e||void 0===e)return!1;var t=this._paneRenderers[e];return void 0===t&&(t=this._createRenderer({pane:e}),this._paneRenderers[e]=t),t},_createRenderer:function(e){return this.options.preferCanvas&&nM(e)||nP(e)}});var nk=ni.extend({initialize:function(e,t){ni.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return[(e=q(e)).getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});nO.create=nR,nO.pointsToPath=er,na.geometryToLayer=no,na.coordsToLatLng=nl,na.coordsToLatLngs=nu,na.latLngToCoords=nc,na.latLngsToCoords=nd,na.getFeature=nh,na.asFeature=np,tN.mergeOptions({boxZoom:!0});var nL=tB.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){th(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){tm(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){e1(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||1!==e.which&&1!==e.button)return!1;this._clearDeferredResetState(),this._resetState(),n(),to(),this._startPoint=this._map.mouseEventToContainerPoint(e),th(document,{contextmenu:tS,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=e0("div","leaflet-zoom-box",this._container),e6(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var t=new G(this._point,this._startPoint),n=t.getSize();tr(this._box,t.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(e1(this._box),e8(this._container,"leaflet-crosshair")),r(),ts(),tm(document,{contextmenu:tS,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if((1===e.which||1===e.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(p(this._resetState,this),0);var t=new W(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})}},_onKeyDown:function(e){27===e.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});tN.addInitHook("addHandler","boxZoom",nL),tN.mergeOptions({doubleClickZoom:!0});var nD=tB.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var t=this._map,n=t.getZoom(),r=t.options.zoomDelta,i=e.originalEvent.shiftKey?n-r:n+r;"center"===t.options.doubleClickZoom?t.setZoom(i):t.setZoomAround(e.containerPoint,i)}});tN.addInitHook("addHandler","doubleClickZoom",nD),tN.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var nB=tB.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new tU(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}e6(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){e8(this._map._container,"leaflet-grab"),e8(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var t=q(this._map.options.maxBounds);this._offsetLimit=V(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var t=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(t),this._prunePositions(t)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,t){return e-(e-t)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var e=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;e.x<t.min.x&&(e.x=this._viscousLimit(e.x,t.min.x)),e.y<t.min.y&&(e.y=this._viscousLimit(e.y,t.min.y)),e.x>t.max.x&&(e.x=this._viscousLimit(e.x,t.max.x)),e.y>t.max.y&&(e.y=this._viscousLimit(e.y,t.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,i=(r-t+n)%e+t-n,a=(r+t+n)%e-t-n,o=Math.abs(i+n)<Math.abs(a+n)?i:a;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=o},_onDragEnd:function(e){var t=this._map,n=t.options,r=!n.inertia||e.noInertia||this._times.length<2;if(t.fire("dragend",e),r)t.fire("moveend");else{this._prunePositions(+new Date);var i=this._lastPos.subtract(this._positions[0]),a=(this._lastTime-this._times[0])/1e3,o=n.easeLinearity,s=i.multiplyBy(o/a),l=s.distanceTo([0,0]),u=Math.min(n.inertiaMaxSpeed,l),c=s.multiplyBy(u/l),d=u/(n.inertiaDeceleration*o),h=c.multiplyBy(-d/2).round();h.x||h.y?(h=t._limitOffset(h,t.options.maxBounds),k(function(){t.panBy(h,{duration:d,easeLinearity:o,noMoveStart:!0,animate:!0})})):t.fire("moveend")}}});tN.addInitHook("addHandler","dragging",nB),tN.mergeOptions({keyboard:!0,keyboardPanDelta:80});var nF=tB.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(e){this._map=e,this._setPanDelta(e.options.keyboardPanDelta),this._setZoomDelta(e.options.zoomDelta)},addHooks:function(){var e=this._map._container;e.tabIndex<=0&&(e.tabIndex="0"),th(e,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),tm(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var e=document.body,t=document.documentElement,n=e.scrollTop||t.scrollTop,r=e.scrollLeft||t.scrollLeft;this._map._container.focus(),window.scrollTo(r,n)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(e){var t,n,r=this._panKeys={},i=this.keyCodes;for(t=0,n=i.left.length;t<n;t++)r[i.left[t]]=[-1*e,0];for(t=0,n=i.right.length;t<n;t++)r[i.right[t]]=[e,0];for(t=0,n=i.down.length;t<n;t++)r[i.down[t]]=[0,e];for(t=0,n=i.up.length;t<n;t++)r[i.up[t]]=[0,-1*e]},_setZoomDelta:function(e){var t,n,r=this._zoomKeys={},i=this.keyCodes;for(t=0,n=i.zoomIn.length;t<n;t++)r[i.zoomIn[t]]=e;for(t=0,n=i.zoomOut.length;t<n;t++)r[i.zoomOut[t]]=-e},_addHooks:function(){th(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){tm(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(e){if(!e.altKey&&!e.ctrlKey&&!e.metaKey){var t,n=e.keyCode,r=this._map;if(n in this._panKeys){if(!r._panAnim||!r._panAnim._inProgress)if(t=this._panKeys[n],e.shiftKey&&(t=H(t).multiplyBy(3)),r.options.maxBounds&&(t=r._limitOffset(H(t),r.options.maxBounds)),r.options.worldCopyJump){var i=r.wrapLatLng(r.unproject(r.project(r.getCenter()).add(t)));r.panTo(i)}else r.panBy(t)}else if(n in this._zoomKeys)r.setZoom(r.getZoom()+(e.shiftKey?3:1)*this._zoomKeys[n]);else{if(27!==n||!r._popup||!r._popup.options.closeOnEscapeKey)return;r.closePopup()}tS(e)}}});tN.addInitHook("addHandler","keyboard",nF),tN.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var nU=tB.extend({addHooks:function(){th(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){tm(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(e){var t=tI(e),n=this._map.options.wheelDebounceTime;this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),this._startTime||(this._startTime=+new Date);var r=Math.max(n-(new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(p(this._performZoom,this),r),tS(e)},_performZoom:function(){var e=this._map,t=e.getZoom(),n=this._map.options.zoomSnap||0;e._stop();var r=4*Math.log(2/(1+Math.exp(-Math.abs(this._delta/(4*this._map.options.wheelPxPerZoomLevel)))))/Math.LN2,i=n?Math.ceil(r/n)*n:r,a=e._limitZoom(t+(this._delta>0?i:-i))-t;this._delta=0,this._startTime=null,a&&("center"===e.options.scrollWheelZoom?e.setZoom(t+a):e.setZoomAround(this._lastMousePos,t+a))}});tN.addInitHook("addHandler","scrollWheelZoom",nU),tN.mergeOptions({tapHold:eD.touchNative&&eD.safari&&eD.mobile,tapTolerance:15});var nj=tB.extend({addHooks:function(){th(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){tm(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),1===e.touches.length){var t=e.touches[0];this._startPos=this._newPos=new j(t.clientX,t.clientY),this._holdTimeout=setTimeout(p(function(){this._cancel(),this._isTapValid()&&(th(document,"touchend",tw),th(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",t))},this),600),th(document,"touchend touchcancel contextmenu",this._cancel,this),th(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){tm(document,"touchend",tw),tm(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),tm(document,"touchend touchcancel contextmenu",this._cancel,this),tm(document,"touchmove",this._onMove,this)},_onMove:function(e){var t=e.touches[0];this._newPos=new j(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,t){var n=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY});n._simulated=!0,t.target.dispatchEvent(n)}});tN.addInitHook("addHandler","tapHold",nj),tN.mergeOptions({touchZoom:eD.touch,bounceAtZoomLimits:!0});var nz=tB.extend({addHooks:function(){e6(this._map._container,"leaflet-touch-zoom"),th(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){e8(this._map._container,"leaflet-touch-zoom"),tm(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(e.touches&&2===e.touches.length&&!t._animatingZoom&&!this._zooming){var n=t.mouseEventToContainerPoint(e.touches[0]),r=t.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=t.getSize()._divideBy(2),this._startLatLng=t.containerPointToLatLng(this._centerPoint),"center"!==t.options.touchZoom&&(this._pinchStartLatLng=t.containerPointToLatLng(n.add(r)._divideBy(2))),this._startDist=n.distanceTo(r),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),th(document,"touchmove",this._onTouchMove,this),th(document,"touchend touchcancel",this._onTouchEnd,this),tw(e)}},_onTouchMove:function(e){if(e.touches&&2===e.touches.length&&this._zooming){var t=this._map,n=t.mouseEventToContainerPoint(e.touches[0]),r=t.mouseEventToContainerPoint(e.touches[1]),i=n.distanceTo(r)/this._startDist;if(this._zoom=t.getScaleZoom(i,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoom<t.getMinZoom()&&i<1||this._zoom>t.getMaxZoom()&&i>1)&&(this._zoom=t._limitZoom(this._zoom)),"center"===t.options.touchZoom){if(this._center=this._startLatLng,1===i)return}else{var a=n._add(r)._divideBy(2)._subtract(this._centerPoint);if(1===i&&0===a.x&&0===a.y)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(a),this._zoom)}this._moved||(t._moveStart(!0,!1),this._moved=!0),D(this._animRequest);var o=p(t._move,t,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=k(o,this,!0),tw(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,D(this._animRequest),tm(document,"touchmove",this._onTouchMove,this),tm(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});tN.addInitHook("addHandler","touchZoom",nz),tN.BoxZoom=nL,tN.DoubleClickZoom=nD,tN.Drag=nB,tN.Keyboard=nF,tN.ScrollWheelZoom=nU,tN.TapHold=nj,tN.TouchZoom=nz,e.Bounds=G,e.Browser=eD,e.CRS=K,e.Canvas=nC,e.Circle=nn,e.CircleMarker=nt,e.Class=B,e.Control=tR,e.DivIcon=nw,e.DivOverlay=nb,e.DomEvent={__proto__:null,on:th,off:tm,stopPropagation:tb,disableScrollPropagation:t_,disableClickPropagation:tx,preventDefault:tw,stop:tS,getPropagationPath:tE,getMousePosition:tA,getWheelDelta:tI,isExternalTarget:tC,addListener:th,removeListener:tm},e.DomUtil={__proto__:null,TRANSFORM:eK,TRANSITION:eY,TRANSITION_END:eX,get:eZ,getStyle:eQ,create:e0,remove:e1,empty:e2,toFront:e3,toBack:e4,hasClass:e5,addClass:e6,removeClass:e8,setClass:e7,getClass:e9,setOpacity:te,testProp:tt,setTransform:tn,setPosition:tr,getPosition:ti,get disableTextSelection(){return n},get enableTextSelection(){return r},disableImageDrag:to,enableImageDrag:ts,preventOutline:tl,restoreOutline:tu,getSizedParentNode:tc,getScale:td},e.Draggable=tU,e.Evented=U,e.FeatureGroup=t5,e.GeoJSON=na,e.GridLayer=nS,e.Handler=tB,e.Icon=t6,e.ImageOverlay=ng,e.LatLng=$,e.LatLngBounds=W,e.Layer=t3,e.LayerGroup=t4,e.LineUtil={__proto__:null,simplify:tG,pointToSegmentDistance:tV,closestPointOnSegment:function(e,t,n){return tJ(e,t,n)},clipSegment:tW,_getEdgeIntersection:tq,_getBitCode:t$,_sqClosestPointOnSegment:tJ,isFlat:tK,_flat:tY,polylineCenter:tX},e.Map=tN,e.Marker=t9,e.Mixin={Events:F},e.Path=ne,e.Point=j,e.PolyUtil={__proto__:null,clipPolygon:tj,polygonCenter:tz,centroid:tH},e.Polygon=ni,e.Polyline=nr,e.Popup=n_,e.PosAnimation=tM,e.Projection={__proto__:null,LonLat:tZ,Mercator:tQ,SphericalMercator:X},e.Rectangle=nk,e.Renderer=nI,e.SVG=nO,e.SVGOverlay=ny,e.TileLayer=nE,e.Tooltip=nx,e.Transformation=Z,e.Util={__proto__:null,extend:t,create:h,bind:p,get lastId(){return m},stamp:f,throttle:g,wrapNum:v,falseFn:y,formatNum:b,trim:_,splitWords:x,setOptions:w,getParamString:S,template:A,isArray:T,indexOf:I,emptyImageUrl:C,requestFn:O,cancelFn:P,requestAnimFrame:k,cancelAnimFrame:D},e.VideoOverlay=nv,e.bind=p,e.bounds=V,e.canvas=nM,e.circle=function(e,t,n){return new nn(e,t,n)},e.circleMarker=function(e,t){return new nt(e,t)},e.control=tO,e.divIcon=function(e){return new nw(e)},e.extend=t,e.featureGroup=function(e,t){return new t5(e,t)},e.geoJSON=nf,e.geoJson=nf,e.gridLayer=function(e){return new nS(e)},e.icon=function(e){return new t6(e)},e.imageOverlay=function(e,t,n){return new ng(e,t,n)},e.latLng=J,e.latLngBounds=q,e.layerGroup=function(e,t){return new t4(e,t)},e.map=function(e,t){return new tN(e,t)},e.marker=function(e,t){return new t9(e,t)},e.point=H,e.polygon=function(e,t){return new ni(e,t)},e.polyline=function(e,t){return new nr(e,t)},e.popup=function(e,t){return new n_(e,t)},e.rectangle=function(e,t){return new nk(e,t)},e.setOptions=w,e.stamp=f,e.svg=nP,e.svgOverlay=function(e,t,n){return new ny(e,t,n)},e.tileLayer=nA,e.tooltip=function(e,t){return new nx(e,t)},e.transformation=Q,e.version="1.9.4",e.videoOverlay=function(e,t,n){return new nv(e,t,n)};var nH=window.L;e.noConflict=function(){return window.L=nH,this},window.L=e}($P);var em=ec("85Hg2");function $k(){return($k=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}).apply(this,arguments)}let $L=(0,em.forwardRef)(function({bounds:e,boundsOptions:t,center:n,children:r,className:i,id:a,placeholder:o,style:s,whenReady:l,zoom:u,...c},d){let[h]=(0,em.useState)({className:i,id:a,style:s}),[p,m]=(0,em.useState)(null);(0,em.useImperativeHandle)(d,()=>p?.map??null,[p]);let f=(0,em.useCallback)(r=>{if(null!==r&&null===p){let i=new(0,$P.Map)(r,c);null!=n&&null!=u?i.setView(n,u):null!=e&&i.fitBounds(e,t),null!=l&&i.whenReady(l),m(Object.freeze({__version:1,map:i}))}},[]);(0,em.useEffect)(()=>()=>{p?.map.remove()},[p]);let g=p?(b(em)).createElement($R,{value:p},r):o??null;return(b(em)).createElement("div",$k({},h,{ref:f}),g)});function $D(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function $B(e,t){return null==t?function(t,n){let r=(0,em.useRef)();return r.current||(r.current=e(t,n)),r}:function(n,r){let i=(0,em.useRef)();i.current||(i.current=e(n,r));let a=(0,em.useRef)(n),{instance:o}=i.current;return(0,em.useEffect)(function(){a.current!==n&&(t(o,n,a.current),a.current=n)},[o,n,r]),i}}function $F(e,t){let n=(0,em.useRef)(t);(0,em.useEffect)(function(){t!==n.current&&null!=e.attributionControl&&(null!=n.current&&e.attributionControl.removeAttribution(n.current),null!=t&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}function $U(e,t){let n=(0,em.useRef)();(0,em.useEffect)(function(){return null!=t&&e.instance.on(t),n.current=t,function(){null!=n.current&&e.instance.off(n.current),n.current=null}},[e,t])}function $j(e,t){let n=e.pane??t.pane;return n?{...e,pane:n}:e}function $z(e){return function(t){var n;let r=$O(),i=e($j(t,r),r);return $F(r.map,t.attribution),$U(i.current,t.eventHandlers),n=i.current,(0,em.useEffect)(function(){return(r.layerContainer??r.map).addLayer(n.instance),function(){r.layerContainer?.removeLayer(n.instance),r.map.removeLayer(n.instance)}},[r,n]),i}}var em=(ec("85Hg2"),ec("85Hg2"),ec("85Hg2"),ec("85Hg2"),ec("85Hg2"),ec("85Hg2"),ec("85Hg2"));let $H=(J=$z($B(function({url:e,...t},n){return $D(new(0,$P.TileLayer)(e,$j(t,n)),n)},function(e,t,n){!function(e,t,n){let{opacity:r,zIndex:i}=t;null!=r&&r!==n.opacity&&e.setOpacity(r),null!=i&&i!==n.zIndex&&e.setZIndex(i)}(e,t,n);let{url:r}=t;null!=r&&r!==n.url&&e.setUrl(r)})),(0,em.forwardRef)(function(e,t){let{instance:n}=J(e).current;return(0,em.useImperativeHandle)(t,()=>n),null})),$G=(K=$z($B(function({position:e,...t},n){var r;let i=new(0,$P.Marker)(e,t);return $D(i,(r={overlayContainer:i},Object.freeze({...n,...r})))},function(e,t,n){t.position!==n.position&&e.setLatLng(t.position),null!=t.icon&&t.icon!==n.icon&&e.setIcon(t.icon),null!=t.zIndexOffset&&t.zIndexOffset!==n.zIndexOffset&&e.setZIndexOffset(t.zIndexOffset),null!=t.opacity&&t.opacity!==n.opacity&&e.setOpacity(t.opacity),null!=e.dragging&&t.draggable!==n.draggable&&(!0===t.draggable?e.dragging.enable():e.dragging.disable())})),(0,em.forwardRef)(function(e,t){let{instance:n,context:r}=K(e).current;return(0,em.useImperativeHandle)(t,()=>n),null==e.children?null:(b(em)).createElement($R,{value:r},e.children)}));var em=ec("85Hg2");let $V=(Y=function(e,t){return $D(new(0,$P.Popup)(e,t.overlayContainer),t)},X=function(e,t,{position:n},r){(0,em.useEffect)(function(){let{instance:i}=e;function a(e){e.popup===i&&(i.update(),r(!0))}function o(e){e.popup===i&&r(!1)}return t.map.on({popupopen:a,popupclose:o}),null==t.overlayContainer?(null!=n&&i.setLatLng(n),i.openOn(t.map)):t.overlayContainer.bindPopup(i),function(){t.map.off({popupopen:a,popupclose:o}),t.overlayContainer?.unbindPopup(),t.map.removeLayer(i)}},[e,t,r,n])},Z=$B(Y),Q=function(e,t){let n=$O(),r=Z($j(e,n),n);return $F(n.map,e.attribution),$U(r.current,e.eventHandlers),X(r.current,n,e,t),r},(0,em.forwardRef)(function(e,t){let[n,r]=(0,em.useState)(!1),{instance:i}=Q(e,r).current;(0,em.useImperativeHandle)(t,()=>i),(0,em.useEffect)(function(){n&&i.update()},[i,n,e.children]);let a=i._contentNode;return a?(0,ep.createPortal)(e.children,a):null})),$W=({center:e,size:t})=>{let n=$O();return(0,em.useEffect)(()=>{let r=new(b($P)).Circle(e,t),i=n.layerContainer||n.map;return i.addLayer(r),()=>{i.removeLayer(r)}}),null},$q=({center:e,uncertainty:t})=>{let[n,r]=(0,em.useState)(!1),i=$O().map,a=(0,em.useCallback)(()=>{let n=void 0!==t?Math.round(Math.log2(1e7/t)):i.getZoom();i.setView(e,n)},[e,t,i]);return(0,em.useEffect)(()=>{n||(a(),r(!0))},[]),(0,em.useEffect)(()=>{a()},[e,t,a]),null},$$=(b($P)).icon({iconUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12.5,20.5],shadowAnchor:[12.5,20.5]});function $J(e){let t="Position";return(null==e?void 0:e.address)?t=[e.address.village||e.address.suburb,e.address.town||e.address.city||e.address.county||e.address.state,e.address.country].filter(Boolean).filter((e,t,n)=>n.indexOf(e)===t).join(", "):(null==e?void 0:e.display_name)&&(t=e.display_name),t}(b($P)).Marker.prototype.options.icon=$$;let $K=({venue:e,query:t,fetching:n,suggestions:r,onQueryChange:i,onChange:a,getPlaceName:o,t:s,autocompleteRootId:l="venue-widget-search",inputRef:u})=>{var c;let[d,h]=(0,em.useState)(!1),[p,m]=(0,em.useState)(!1),[f,g]=(0,em.useState)(!1),v=(0,em.useRef)(null),y=null!=u?u:v,b=(null==e?void 0:e.latitude)!=null?{place_id:0,lat:e.latitude,lon:e.longitude,display_name:null!=(c=e.placeName)?c:"",type:"",category:"",importance:0,place_rank:0,boundingbox:[0,0,0,0]}:void 0,_=b?o(b):"";(0,em.useLayoutEffect)(()=>{let e=y.current;if(!e)return;let n=()=>{m(!0),_&&""===t&&!f&&i(_,{skipSearch:!0})},r=()=>m(!1);return e.addEventListener("focus",n),e.addEventListener("blur",r),()=>{e.removeEventListener("focus",n),e.removeEventListener("blur",r)}},[d,t,_,i,f]);let x=p||d||""!==t||f?t:_,w=r.map(e=>({value:o(e)||e.display_name,label:e.display_name}));return(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("label",{htmlFor:l,className:"sr-only",children:s("searchVenue")}),(0,eh.jsx)(bS,{id:l,inputRef:y,className:"memori--venue-widget-search",options:w,mode:"none",filter:null,value:x,onChange:(e,t)=>{if("item-press"===t.reason){let t=r.find(t=>(o(t)||t.display_name)===e);t&&(g(!1),i(e,{skipSearch:!0}),a(t));return}g(""===e.trim()),i(e)},open:d,onOpenChange:e=>h(e),placeholder:s("searchVenue"),loading:n,loadingText:`${s("loading")}...`,emptyText:t.trim()?s("nothingFound"):"​",autoHighlight:!0,clearable:""!==x.trim()})]})},$Y=({venue:e})=>{var t,n;let[r,i]=(0,em.useState)(!1);return(0,em.useEffect)(()=>{i(!0)},[]),(0,em.useEffect)(()=>{let e=document.createElement("link");return e.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",e.rel="stylesheet",e.integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=",e.crossOrigin="",document.head.appendChild(e),()=>{document.head.removeChild(e)}},[]),(0,eh.jsx)("div",{className:"memori--venue-widget__map-container",role:"region","aria-label":"Location map",children:r&&(0,eh.jsxs)($L,{className:"memori--venue-widget__map",center:(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)?[e.latitude,e.longitude]:[44.66579,11.48823],zoom:13,scrollWheelZoom:!0,children:[(0,eh.jsx)($H,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),(0,eh.jsx)($q,{center:(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)?[e.latitude,e.longitude]:[44.66579,11.48823],uncertainty:(null!=(t=null==e?void 0:e.uncertainty)?t:0)*1e3}),(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)&&(0,eh.jsx)($G,{position:[e.latitude,e.longitude],icon:$$,children:(0,eh.jsx)($V,{children:null!=(n=e.placeName)?n:""})}),(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)&&(null==e?void 0:e.uncertainty)!==void 0&&(0,eh.jsx)($W,{center:[e.latitude,e.longitude],size:1e3*e.uncertainty})]})})};function $X(e){return!!((null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude))}let $Z=({venue:e,setVenue:t,autoStartGeolocation:n=!1})=>{var r,i;let a,o,{t:s}=tA(),[l,u]=(0,em.useState)(!1),[c,d]=(0,em.useState)(!1),[h,p]=(0,em.useState)(null),[m,f]=(0,em.useState)(null),[g,v]=(0,em.useState)(!1),[y,_]=(0,em.useState)(""),[x,w]=(0,em.useState)([]),S=(0,em.useRef)(0),E=(0,em.useRef)(null),A=(0,em.useRef)(!1),T=l||$X(e),I=(i=async e=>{v(!0);try{let t=await fetch(`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(e)}&format=jsonv2&limit=5&addressdetails=1`),n=await t.json();w(n)}catch(e){f(String(s("widget.geocodingFailed")))}finally{v(!1)}},a=(0,em.useRef)(),o=(0,em.useRef)(null),(0,em.useEffect)(()=>(o.current=i,()=>{o.current=null}),[i]),(0,em.useEffect)(()=>()=>{clearTimeout(a.current)},[]),(0,em.useMemo)(()=>(...e)=>{clearTimeout(a.current),a.current=window.setTimeout(()=>{o.current&&o.current(...e)},1e3)},[1e3])),C=(0,em.useCallback)((e,t)=>{if(_(e),null==t||!t.skipSearch){if(!e.trim())return void w([]);I(e)}},[I]),M=(0,em.useCallback)(e=>{let n=$J(e);t({latitude:e.lat,longitude:e.lon,placeName:n,uncertainty:(null==e?void 0:e.boundingbox)?(e=>{let[t,n,r,i]="string"==typeof e[0]?e.map(parseFloat):e,a=t*$M,o=r*$M,s=n*$M,l=i*$M;return 6367.5*(2*Math.asin(Math.sqrt(Math.sin((s-a)/2)*Math.sin((s-a)/2)+Math.cos(a)*Math.cos(s)*Math.sin((l-o)/2)*Math.sin((l-o)/2))))})(e.boundingbox):2}),d(!1),_(""),w([]),f(null),p(null)},[t,s]),N=(0,em.useCallback)(()=>{let e=++S.current;if(p(null),f(null),!navigator.geolocation){u(!1),p(String(s("widget.positionUnavailableManual"))),d(!0);return}u(!0),navigator.geolocation.getCurrentPosition(n=>{if(e!==S.current)return;let r={latitude:n.coords.latitude,longitude:n.coords.longitude,placeName:"",uncertainty:n.coords.accuracy/1e3};t(r),u(!1);let i=new AbortController,a=window.setTimeout(()=>i.abort(),8e3);(async()=>{try{let a=await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${n.coords.latitude}&lon=${n.coords.longitude}&format=jsonv2&addressdetails=1`,{signal:i.signal});if(e!==S.current)return;let o=await a.json(),s=$J(o);t({...r,placeName:s})}catch(t){if(e!==S.current||"AbortError"===t.name)return;console.error("[PositionPopover] reverse geocode failed",t),f(String(s("widget.geocodingFailed")))}finally{window.clearTimeout(a)}})()},n=>{e!==S.current||(u(!1),t(void 0),1===n.code?(p(String(s("widget.positionUnavailableManual"))),d(!0)):f(String(s("widget.geocodingFailed"))))},{enableHighAccuracy:!0,timeout:15e3,maximumAge:0})},[t,s]),R=(0,em.useCallback)(()=>{if(p(null),f(null),T&&!l){S.current+=1,t({latitude:0,longitude:0,placeName:"",uncertainty:0}),d(!1),_(""),w([]);return}if(l){S.current+=1,u(!1),t(void 0);return}N()},[l,t,T,N]);(0,em.useEffect)(()=>{if(!n){A.current=!1;return}A.current||$X(e)||l||(A.current=!0,N())},[n,l,N,e]),(0,em.useEffect)(()=>{if(!c)return;let e=requestAnimationFrame(()=>{var e;null==(e=E.current)||e.focus()});return()=>cancelAnimationFrame(e)},[c]);let O=h||m,P=s("widget.shareLocationHint")||"Get answers tailored to where you are";return(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("div",{className:"memori-position-popover__row memori-position-popover__switch-row",children:(0,eh.jsxs)("button",{type:"button",className:"memori-dropdown--auth-row",onClick:()=>{R()},children:[(0,eh.jsx)("span",{className:"memori-dropdown--auth-icon-wrap",children:(0,eh.jsx)(VS,{size:16})}),(0,eh.jsxs)("span",{className:"memori-dropdown--auth-copy",children:[(0,eh.jsx)("span",{className:"memori-dropdown--auth-title",children:s("widget.shareLocation")||"Share my location"}),(0,eh.jsx)(_H,{title:P,placement:"top",children:(0,eh.jsx)("span",{className:"memori-dropdown--auth-subtitle",children:P})})]}),(0,eh.jsx)("span",{className:(b(tT))("memori-dropdown--switch",T&&"memori-dropdown--switch--on"),"aria-hidden":!0})]})}),(T||l||c)&&(0,eh.jsx)("div",{className:"memori-position-popover__tag-block",children:l?(0,eh.jsxs)("div",{className:"memori-position-popover__tag memori-position-popover__tag--loading","aria-busy":"true","aria-live":"polite",children:[(0,eh.jsx)("span",{className:"memori-position-popover__spinner","aria-hidden":!0}),(0,eh.jsx)("span",{className:"memori-position-popover__tag-skeleton"})]}):c?(0,eh.jsx)("div",{className:"memori-position-popover__autocomplete-wrap",children:(0,eh.jsx)($K,{venue:e,query:y,fetching:g,suggestions:x,onQueryChange:C,onChange:M,getPlaceName:$J,t:s,autocompleteRootId:"memori-position-popover-venue-search",inputRef:E})}):(0,eh.jsxs)("div",{className:"memori-position-popover__tag",children:[(0,eh.jsx)("span",{className:"memori-position-popover__tag-text",children:(null==(r=null==e?void 0:e.placeName)?void 0:r.trim())?e.placeName:s("widget.positionResolving")}),(0,eh.jsx)(yt,{type:"button",variant:"ghost",icon:(0,eh.jsx)(VF,{size:16,strokeWidth:2,"aria-hidden":!0}),size:"sm",className:"memori-position-popover__tag-edit","aria-label":String(s("widget.editPositionAria")),onClick:()=>{d(!0),p(null)}})]})}),O&&(0,eh.jsx)("p",{className:"memori-position-popover__error",role:"alert",children:O}),$X(e)&&!l&&(0,eh.jsx)("div",{className:"memori-position-popover__map",children:(0,eh.jsx)($Y,{venue:e})})]})};var $Q=({venue:e,setVenue:t,open:n,onOpenChange:r,triggerClassName:i,triggerButtonVariant:a="toolbar",triggerAriaLabel:o,positionerClassName:s,autoStartGeolocation:l=!1})=>{let u=$X(e);return(0,eh.jsx)(x2,{open:n,onOpenChange:r,modal:!1,closable:!1,placement:"bottom-end",sideOffset:8,contentClassName:"memori-position-popover__popup",slotProps:{trigger:{className:i,render:e=>(0,eh.jsx)(Gc,{...e,type:"button",variant:a,active:n,className:(b(tT))("memori-header--button","memori-header--button--position",u&&"memori-header--button--position--active",i),"aria-label":o,"aria-expanded":n,icon:(0,eh.jsx)(VS,{"aria-hidden":!0})})},positioner:{className:(b(tT))("memori-position-popover__positioner",s)}},content:(0,eh.jsx)($Z,{venue:e,setVenue:t,autoStartGeolocation:n&&l}),children:null})},$0=({className:e,title:t})=>(0,eh.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:800,height:800,fill:"none",viewBox:"0 0 24 24",className:e,"aria-label":t,children:[(0,eh.jsx)("path",{stroke:"currentColor",strokeWidth:1.5,d:"M16 22V8c0-2.828 0-4.243-.879-5.121C14.243 2 12.828 2 10 2H9c-2.828 0-4.243 0-5.121.879C3 3.757 3 5.172 3 8v14"}),(0,eh.jsx)("path",{stroke:"currentColor",strokeWidth:1.5,d:"M11 6H8c-.943 0-1.414 0-1.707.293C6 6.586 6 7.057 6 8c0 .943 0 1.414.293 1.707C6.586 10 7.057 10 8 10h3c.943 0 1.414 0 1.707-.293C13 9.414 13 8.943 13 8c0-.943 0-1.414-.293-1.707C12.414 6 11.943 6 11 6Z"}),(0,eh.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M7 17h5M17 22H2M19.5 4l1.233.986c.138.11.207.166.27.222a3 3 0 0 1 .992 2.066c.005.084.005.172.005.348V18.5a1.5 1.5 0 0 1-3 0v-.071c0-.79-.64-1.429-1.429-1.429H16"}),(0,eh.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M22 8h-1.5A1.5 1.5 0 0 0 19 9.5v2.419a1.5 1.5 0 0 0 1.026 1.423L22 14"})]}),em=ec("85Hg2");let $1=e=>{if("number"==typeof e&&Number.isFinite(e))return e;if(e&&"object"==typeof e){if("number"==typeof e.parsedValue&&Number.isFinite(e.parsedValue))return e.parsedValue;if("string"==typeof e.source){let t=Number(e.source);if(Number.isFinite(t))return t}}},$2=(e,t)=>new Intl.NumberFormat(t,{minimumFractionDigits:0,maximumFractionDigits:Math.abs(e)>=1?3:4}).format(e),$3=(e,t)=>new Intl.NumberFormat(t,{maximumFractionDigits:0}).format(e),$4=(e,t,n)=>{let r=Math.abs(e);if("energy"===t){if(r>=1)return`${$2(e,n)} kWh`;let t=1e3*e;return Math.abs(t)>=1?`${$2(t,n)} Wh`:`${$2(1e3*t,n)} mWh`}if("co2"===t){if(r>=1)return`${$2(e,n)} kg`;let t=1e3*e;return Math.abs(t)>=1?`${$2(t,n)} g`:`${$2(1e3*t,n)} mg`}if(r>=1)return`${$2(e,n)} L`;let i=1e3*e;return Math.abs(i)>=1?`${$2(i,n)} mL`:`${$2(1e3*i,n)} \u{3BC}L`},$5=({history:e,showTitle:t=!0,className:n})=>{let{t:r,i18n:i}=tA(),a=i.language||navigator.language||"en",o=(0,em.useMemo)(()=>({lines:e}),[e]),s=(0,em.useMemo)(()=>{var e;let t={totalInputTokens:0,totalOutputTokens:0,energy:0,gwp:0,wcf:0,models:new Set};return(null!=(e=null==o?void 0:o.lines)?e:[]).forEach(e=>{var n,r,i,a,o;let s=e.llmUsage;if(!s||(t.totalInputTokens+=null!=(n=s.totalInputTokens)?n:0,t.totalOutputTokens+=null!=(r=s.outputTokens)?r:0,(s.provider||s.model)&&t.models.add([s.provider,s.model].filter(Boolean).join(" · ")),!s.energyImpact))return;let l=s.energyImpact;t.energy+=null!=(i=$1(l.energy))?i:0,t.gwp+=null!=(a=$1(l.gwp))?a:0,t.wcf+=null!=(o=$1(l.wcf))?o:0}),t},[o]),l=(0,em.useMemo)(()=>Array.from(s.models),[s.models]);return(0,eh.jsxs)("div",{className:(b(tT))("memori-dropdown--sustainability",n),children:[t&&(0,eh.jsx)("h4",{className:"memori-dropdown--sustainability-title",children:r("chatLogs.totalChatConsumptionTitle")||"Consumo Totale Chat"}),(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-section",children:[(0,eh.jsx)("h5",{className:"memori-dropdown--sustainability-section-title",children:r("chatLogs.modelUsage")||"Model usage"}),(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-summary",children:[(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-stat",children:[(0,eh.jsx)("span",{className:"memori-dropdown--sustainability-stat-label",children:r("chatLogs.input")||"Input"}),(0,eh.jsx)("strong",{className:"memori-dropdown--sustainability-stat-value",children:$3(s.totalInputTokens,a)}),(0,eh.jsx)("span",{className:"memori-dropdown--sustainability-stat-meta",children:r("chatLogs.tokens")||"Tokens"})]}),(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-stat",children:[(0,eh.jsx)("span",{className:"memori-dropdown--sustainability-stat-label",children:r("chatLogs.output")||"Output"}),(0,eh.jsx)("strong",{className:"memori-dropdown--sustainability-stat-value",children:$3(s.totalOutputTokens,a)}),(0,eh.jsx)("span",{className:"memori-dropdown--sustainability-stat-meta",children:r("chatLogs.tokens")||"Tokens"})]})]}),l.length>0&&(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-row memori-dropdown--sustainability-row--stacked",children:[(0,eh.jsxs)("span",{className:"memori-dropdown--sustainability-label",children:[r("chatLogs.provider")||"Provider"," /"," ",r("chatLogs.model")||"Model"]}),(0,eh.jsx)("div",{className:"memori-dropdown--sustainability-tags",children:l.map(e=>(0,eh.jsx)("span",{className:"memori-dropdown--sustainability-tag",children:e},e))})]})]}),(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-metrics",children:[(0,eh.jsx)("h5",{className:"memori-dropdown--sustainability-section-title",children:r("chatLogs.environmentalImpact")||"Environmental impact"}),(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-row",children:[(0,eh.jsxs)("span",{className:"memori-dropdown--sustainability-label",children:[(0,eh.jsx)("span",{"aria-hidden":"true",children:Vd.energy})," ",r("chatLogs.energy")||"Energy"]}),(0,eh.jsx)("strong",{className:"memori-dropdown--sustainability-value",children:$4(s.energy,"energy",a)})]}),(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-row",children:[(0,eh.jsxs)("span",{className:"memori-dropdown--sustainability-label",children:[(0,eh.jsx)("span",{"aria-hidden":"true",children:Vd.co2})," ",r("chatLogs.co2")||"CO2"]}),(0,eh.jsx)("strong",{className:"memori-dropdown--sustainability-value",children:$4(s.gwp,"co2",a)})]}),(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-row",children:[(0,eh.jsxs)("span",{className:"memori-dropdown--sustainability-label",children:[(0,eh.jsx)("span",{"aria-hidden":"true",children:Vd.water})," ",r("chatLogs.water")||"Water"]}),(0,eh.jsx)("strong",{className:"memori-dropdown--sustainability-value",children:$4(s.wcf,"water",a)})]})]})]})};var $6=({history:e,triggerVariant:t="ghost",trigger:n,open:r,onOpenChange:i,hideTrigger:a=!1})=>{let{t:o}=tA(),[s,l]=(0,em.useState)(!1),u=void 0!==r,c=u?r:s,d=e=>{u||l(e),null==i||i(e)},h=(0,em.useMemo)(()=>(null!=e?e:[]).some(e=>!!e.llmUsage),[e]),p=o("write_and_speak.showMessageConsumptionLabel")||"Show chat consumption",m=o("chatLogs.totalChatConsumptionTitle")||"Consumo Totale Chat",f=e=>{var n;return(0,eh.jsx)(_H,{title:p,placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{...e,variant:t,shape:"default",active:c,disabled:null!=(n=e.disabled)?n:!h,className:(b(tT))("memori-header--button memori-header--button--sustainability",e.className),"aria-label":p,icon:(0,eh.jsx)($0,{className:"memori-header--button--sustainability-icon"})})})})};return h?(0,eh.jsxs)(eh.Fragment,{children:[!a&&(e=>{var t;if(!n)return f(e);if("function"==typeof n)return n(e,{open:c});if(!(b(em)).isValidElement(n))return f(e);let r=null!=(t=n.props)?t:{},i=(b(tT))(e.className,r.className);return(b(em)).cloneElement(n,{...r,...e,className:i||void 0,onClick:t=>{var n,i;null==(n=e.onClick)||n.call(e,t),null==(i=r.onClick)||i.call(r,t)}})})({onClick:e=>{h&&(d(!0),e.currentTarget.blur())}}),(0,eh.jsx)(__,{open:c,onClose:()=>d(!1),title:m,className:"memori-chat--usage-modal memori-chat--consumption-modal",width:"30rem",stacking:"stacked",closable:!0,children:(0,eh.jsx)($5,{history:e,showTitle:!1})})]}):a||n?null:f({disabled:!0})},$8=({className:e,buttonVariant:t="ghost",memori:n,tenant:r,history:i,position:a,setVenue:o,positionPopoverOpen:s,setPositionPopoverOpen:l,autoStartPositionGeolocation:u=!1,setShowSettingsDrawer:c,setShowChatHistoryDrawer:d,setShowKnownFactsDrawer:h,setShowExpertsDrawer:p,enableAudio:m=!0,speakerMuted:f,setSpeakerMuted:g,hasUserActivatedSpeak:v=!1,showShare:y=!0,showSettings:_=!0,showReload:x=!1,showClear:w=!1,showExperts:S=!1,showLogin:E=!0,setShowLoginDrawer:A,clearHistory:T,loginToken:I,user:C,sessionID:M,showChatHistory:N=!0,fullScreenHandler:R,baseUrl:O,onLogout:P,apiClient:k,layout:D,additionalSettings:B,showMessageConsumption:F=!1,showFullscreen:U=!0,extraActions:j})=>{var z;let H,G,{t:V,i18n:W}=tA(),q="dark"===v3()?"inverse":t,{add:$}=vZ(),{uploadAsset:J,pwlUpdateUser:K}=k.backend,[Y,X]=(0,em.useState)(!1),[Z,Q]=(0,em.useState)(!1),[ee,et]=(0,em.useState)(!1),[en,er]=(0,em.useState)(!1),[ei,ea]=(0,em.useState)(!1),eo=Lm(),es=e=>{if("number"==typeof e&&Number.isFinite(e))return e;if(e&&"object"==typeof e){if("number"==typeof e.parsedValue&&Number.isFinite(e.parsedValue))return e.parsedValue;if("string"==typeof e.source){let t=Number(e.source);if(Number.isFinite(t))return t}}},el=(e,t)=>new Intl.NumberFormat(t,{minimumFractionDigits:0,maximumFractionDigits:Math.abs(e)>=1?3:4}).format(e),eu=(e,t,n)=>{let r=Math.abs(e);if("energy"===t){if(r>=1)return`${el(e,n)} kWh`;let t=1e3*e;return Math.abs(t)>=1?`${el(t,n)} Wh`:`${el(1e3*t,n)} mWh`}if("co2"===t){if(r>=1)return`${el(e,n)} kg`;let t=1e3*e;return Math.abs(t)>=1?`${el(t,n)} g`:`${el(1e3*t,n)} mg`}if(r>=1)return`${el(e,n)} L`;let i=1e3*e;return Math.abs(i)>=1?`${el(i,n)} mL`:`${el(1e3*i,n)} \u{3BC}L`},ec=W.language||navigator.language||"en",ed=(0,em.useMemo)(()=>({lines:i}),[i]),ep=(0,em.useMemo)(()=>{var e;let t={energy:0,gwp:0,wcf:0};return(null!=(e=null==ed?void 0:ed.lines)?e:[]).forEach(e=>{var n,r,i,a;let o=null==(n=e.llmUsage)?void 0:n.energyImpact;o&&(t.energy+=null!=(r=es(o.energy))?r:0,t.gwp+=null!=(i=es(o.gwp))?i:0,t.wcf+=null!=(a=es(o.wcf))?a:0)}),t},[ed]),ef=(0,em.useMemo)(()=>{var e;return(null!=(e=null==ed?void 0:ed.lines)?e:[]).some(e=>{var t;return!!(null==(t=e.llmUsage)?void 0:t.energyImpact)})},[ed]),eg=(0,em.useMemo)(()=>{var e;return(null!=(e=null==ed?void 0:ed.lines)?e:[]).some(e=>!!e.llmUsage)},[ed]);(0,em.useEffect)(()=>{document.fullscreenEnabled&&X(!0)},[]),(0,em.useEffect)(()=>{let e=()=>{var e;let t=!!document.fullscreenElement;if(Q(t),!t){let t=document.querySelector(".memori-widget");(null==(e=null==t?void 0:t.dataset)?void 0:e.memoriPrevBgColor)!==void 0&&(t.style.backgroundColor=t.dataset.memoriPrevBgColor,delete t.dataset.memoriPrevBgColor)}};return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]);let[ev,ey]=(0,em.useState)(()=>"u"<typeof window||!window.matchMedia||!window.matchMedia("(max-width: 767px)").matches);(0,em.useEffect)(()=>{if(!window.matchMedia)return;let e=window.matchMedia("(max-width: 767px)"),t=()=>ey(!e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let eb=(0,em.useCallback)((e,t)=>"TOTEM"===e||t&&Object.keys(t).length>0||!1,[D,B]),e_=async e=>{if(e&&I){let t=new FileReader;t.onload=async t=>{var n,r,i;try{let{asset:a,...o}=await J(null!=(n=e.name)?n:"avatar",null==(r=t.target)?void 0:r.result,null!=I?I:"");if(0!==o.resultCode)console.error("[updateAvatar] Upload failed:",o),$(v9({description:V(Lx(o.resultCode)),severity:"error"}));else if(a){let e={userID:null==C?void 0:C.userID,avatarURL:a.assetURL},{user:t,...n}=await K(null!=I?I:"",null!=(i=null==C?void 0:C.userID)?i:"",e);0!==n.resultCode?$(v9({description:V(Lx(n.resultCode)),severity:"error"})):$(v9({description:V("login.avatarUploadSuccess"),severity:"success"}))}}catch(e){console.error("[updateAvatar] Error:",e),(null==e?void 0:e.message)&&$(v9({description:e.message,severity:"error"}))}},t.readAsDataURL(e)}else console.error("[updateAvatar] Missing avatar or login token",{avatar:e,loginToken:I}),$(v9({description:V("login.avatarUploadError"),severity:"error"}))},ex="FULLPAGE"===D||"CHAT"===D;(0,em.useEffect)(()=>{if(!ex)return;let e=document.querySelector(".memori-widget .memori-chat--history");if(!e)return;let t=()=>{let t=e.scrollTop>2;document.querySelectorAll(".memori-widget .memori-chat-layout--header, .memori-widget .memori-fullpage-top-header, .memori-widget .memori-fullpage-header-row").forEach(e=>{e.classList.toggle("memori-header--scrolled",t)})};return t(),e.addEventListener("scroll",t,{passive:!0}),()=>{e.removeEventListener("scroll",t),document.querySelectorAll(".memori-header--scrolled").forEach(e=>e.classList.remove("memori-header--scrolled"))}},[ex,M,v]);let ew="TOTEM"===D?void 0:V("widget.headerHistory")||"History",eS=V("widget.headerLogin")||V("login.login")||"Login",eE=V("widget.mobileSession.sessionInfo")||"Session info",eA=f?V("widget.soundOff",{defaultValue:"Audio off"}):V("widget.sound",{defaultValue:"Audio"}),eT=Z?V("fullscreenExit")||"Exit fullscreen":V("fullscreenEnter")||"Full screen",eI=!!I&&!!(null==C?void 0:C.userID),eC=(null==C?void 0:C.userName)||(null==C?void 0:C.eMail)||V("login.user"),eM=(G=(H=((null==C?void 0:C.userName)||(null==C?void 0:C.eMail)||"U").trim()).split(/[\s._@-]+/).filter(Boolean)).length>=2?`${G[0][0]}${G[1][0]}`.toUpperCase():H.slice(0,2).toUpperCase(),eN=!!(M&&v),eR=!!n.enableDeepThought&&!!I&&!!(null==C?void 0:C.pAndCUAccepted),eO=eN&&ev&&(eR||F),eP=(null==(z=null==n?void 0:n.name)?void 0:z.trim())||"",ek=(0,em.useMemo)(()=>{var e;let t=null==(e=null==n?void 0:n.description)?void 0:e.trim();return t?t.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim():""},[null==n?void 0:n.description]),eL=(0,em.useMemo)(()=>{if(ex&&n)return n.avatarURL&&n.avatarURL.length>0?La({type:"avatar",tenantID:null==r?void 0:r.name,resourceURI:n.avatarURL,baseURL:O,apiURL:""}):La({type:"avatar",tenantID:null==r?void 0:r.name,baseURL:O,apiURL:""})},[ex,n,r,O]),eD=N&&!!I,eB=!!(_&&eb(D,B)),eF=S&&!!n.enableBoardOfExperts,eU=!!n.needsPosition||x||w||F||U&&Y||eR&&eN||eF||m||eB||y,ej=eO||U&&Y||m||!!n.needsPosition||x||w||eF||eB||y,ez=ev&&eD&&(eI?ej||!!E:eU||!!E),eH=ev&&!!E&&(eI?ej:eU),eG=N&&!!I&&(0,eh.jsx)(_H,{title:V("write_and_speak.chatHistory")||"Chat history",placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-header--chat-history-button",disabled:!I,"aria-label":V("write_and_speak.chatHistory")||"Chat history",icon:(0,eh.jsx)($t,{}),onClick:()=>d(!0),children:ew?(0,eh.jsx)("span",{className:"memori-header--action-label",children:ew}):null})})}),eV=E&&(0,eh.jsx)(eh.Fragment,{children:I&&(null==C?void 0:C.userID)?(0,eh.jsx)(x2,{className:"memori-header--dropdown",open:ee,onOpenChange:e=>{et(e),e&&(er(!1),l(!1))},placement:"bottom-end",sideOffset:8,closable:!1,contentClassName:"memori-dropdown--menu",slotProps:{trigger:{className:(b(tT))("memori-dropdown--user-trigger","memori-dropdown--user-trigger--identity",ex&&"memori-dropdown--user-trigger--fullpage"),render:e=>(0,eh.jsx)(_H,{title:eC,placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsxs)(Gc,{...e,active:ee,variant:q,className:(b(tT))("memori-dropdown--user-trigger-button","memori-dropdown--user-trigger-button--identity"),"aria-label":String(eC),children:[(0,eh.jsx)("span",{className:"memori-dropdown--user-trigger-name",children:(null==C?void 0:C.userName)||V("login.welcomeUser")}),(null==C?void 0:C.avatarURL)?(0,eh.jsx)("img",{src:C.avatarURL,alt:"",className:"memori-dropdown--user-trigger-avatar"}):(0,eh.jsx)("span",{className:"memori-dropdown--user-trigger-initials","aria-hidden":!0,children:eM})]})})})}},content:(0,eh.jsxs)("div",{className:"memori-dropdown--content",children:[(0,eh.jsx)("div",{className:"memori-dropdown--user-item",children:(0,eh.jsxs)("div",{className:"memori-dropdown--user-info",children:[(0,eh.jsx)("div",{className:"memori-dropdown--avatar-wrap",children:C.avatarURL?(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("img",{src:C.avatarURL,alt:C.userName||C.eMail,className:"memori-dropdown--avatar"}),(0,eh.jsx)("span",{className:"memori-dropdown--avatar-overlay","aria-hidden":!0,children:(0,eh.jsx)($n,{size:20,strokeWidth:2})}),(0,eh.jsx)("label",{htmlFor:"avatar",className:"sr-only",children:V("login.avatarChange")}),(0,eh.jsx)("input",{type:"file",name:"avatar",id:"avatar",className:"memori-dropdown--avatar-input",onChange:e=>{var t,n;return e_(null!=(n=null==(t=e.target.files)?void 0:t[0])?n:null)},accept:Li.join(", ")})]}):(0,eh.jsx)(eh.Fragment,{children:(0,eh.jsxs)("div",{className:"memori-dropdown--avatar-placeholder",children:[(0,eh.jsx)("span",{className:"memori-dropdown--avatar-initial",children:(C.userName||C.eMail||"U").charAt(0).toUpperCase()}),(0,eh.jsx)("span",{className:"memori-dropdown--avatar-overlay","aria-hidden":!0,children:(0,eh.jsx)($n,{size:20,strokeWidth:2})}),(0,eh.jsx)("label",{htmlFor:"avatar",className:"sr-only",children:V("login.avatarChange")}),(0,eh.jsx)("input",{type:"file",name:"avatar",id:"avatar",className:"memori-dropdown--avatar-input",onChange:e=>{var t,n;return e_(null!=(n=null==(t=e.target.files)?void 0:t[0])?n:null)},accept:Li.join(", ")})]})})}),(0,eh.jsxs)("div",{className:"memori-dropdown--user-details",children:[(0,eh.jsx)("h3",{className:"memori-dropdown--user-name",children:C.userName||V("login.welcomeUser")}),(0,eh.jsx)("p",{className:"memori-dropdown--user-email",children:C.eMail}),(0,eh.jsx)("div",{className:"memori-dropdown--user-badge",children:C.birthDate?new Date(C.birthDate).toLocaleDateString():V("login.notSet")})]})]})}),(0,eh.jsx)("div",{className:"memori-dropdown--separator"}),(0,eh.jsx)(Gc,{type:"button",variant:q,onClick:P,className:"memori-dropdown--action-button memori-dropdown--action-button--logout",icon:(0,eh.jsx)($r,{size:18,strokeWidth:2,"aria-hidden":!0}),children:(0,eh.jsx)("span",{className:"memori-header--action-label",children:V("login.logout")||"Logout"})})]}),children:null}):ex?(0,eh.jsx)(_H,{title:V("login.login")||"Login",placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(yt,{variant:"primary",className:"memori-header--button memori-header--button-login",icon:(0,eh.jsx)(Lp,{}),title:V("login.login")||"Login","aria-label":V("login.login")||"Login",onClick:()=>A(!0),children:eS})})}):(0,eh.jsx)(_H,{title:V("login.login")||"Login",placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-header--button memori-header--button-login",icon:(0,eh.jsx)(Lp,{}),title:V("login.login")||"Login","aria-label":V("login.login")||"Login",onClick:()=>A(!0)})})})}),eW=(e,t="bottom")=>(0,eh.jsx)(_H,{title:V("reload")||"Reload",placement:t,children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:e,"aria-label":V("reload")||"Reload",icon:(0,eh.jsx)($i,{}),onClick:()=>{window.location.reload()}})})}),eq=(e,t="bottom")=>(0,eh.jsx)(_H,{title:V("clearHistory")||"Clear chat",placement:t,children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:e,"aria-label":V("clearHistory")||"Clear chat",icon:(0,eh.jsx)($a,{}),onClick:()=>{T(),$(v9({description:V("clearHistoryDone"),severity:"success"}))}})})}),e$=(e,t="bottom")=>(0,eh.jsx)(_H,{title:V("widget.showExpertsInTheBoard")||"Experts in this board",placement:t,children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:e,icon:(0,eh.jsx)(VA,{}),disabled:!v||!M,"aria-label":V("widget.showExpertsInTheBoard")||"Experts in this board",onClick:()=>p(!0)})})}),eJ=(e,t="bottom")=>(0,eh.jsx)(_H,{title:V("widget.settings")||"Settings",placement:t,children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:e,icon:(0,eh.jsx)($o,{}),"aria-label":V("widget.settings")||"Settings",onClick:()=>c(!0)})})}),eK=(0,eh.jsxs)(eh.Fragment,{children:[n.needsPosition&&(0,eh.jsx)("div",{className:"memori-header--position",children:(0,eh.jsx)(_H,{title:V("widget.position")||"Position",placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)($Q,{venue:a,setVenue:o,open:s,autoStartGeolocation:u,onOpenChange:e=>{l(e),e&&(er(!1),et(!1))},triggerButtonVariant:q,triggerAriaLabel:V("widget.position")||"Position",positionerClassName:"WEBSITE_ASSISTANT"===D?"memori-position-popover__positioner--website-assistant":void 0})})})}),x&&eW(),w&&eq()]}),eY=(0,eh.jsxs)(eh.Fragment,{children:[F&&(0,eh.jsx)($6,{history:i,triggerVariant:q}),U&&Y&&(0,eh.jsx)(_H,{title:eT,placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,title:eT,"aria-label":eT,icon:Z?(0,eh.jsx)($s,{}):(0,eh.jsx)($l,{}),onClick:R||(()=>{var e;if(document.fullscreenElement)document.exitFullscreen&&document.exitFullscreen().then(()=>{var e;Q(!1);let t=document.querySelector(".memori-widget");(null==(e=null==t?void 0:t.dataset)?void 0:e.memoriPrevBgColor)!==void 0&&(t.style.backgroundColor=t.dataset.memoriPrevBgColor,delete t.dataset.memoriPrevBgColor)}).catch(e=>{console.warn("Error attempting to exit fullscreen:",e)});else{let t="HIDDEN_CHAT"!==D&&"WEBSITE_ASSISTANT"!==D?document.body:document.querySelector(".memori-widget");if(t){let n=document.querySelector(".memori-widget");n&&(void 0===n.dataset.memoriPrevBgColor&&(n.dataset.memoriPrevBgColor=null!=(e=n.style.backgroundColor)?e:""),n.style.backgroundColor=""),t.requestFullscreen().then(()=>Q(!0)).catch(e=>{console.warn("Error attempting to enable fullscreen:",e)})}}})})})}),eR&&eN&&(0,eh.jsx)(_H,{title:V("knownFacts.title")||"Known facts",placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,icon:(0,eh.jsx)($u,{}),"aria-label":V("knownFacts.title")||"Known facts",onClick:()=>h(!0)})})}),eF&&e$(),m&&(0,eh.jsx)(_H,{title:eA,placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,icon:f?(0,eh.jsx)($c,{size:20,strokeWidth:2.35,"aria-hidden":!0}):(0,eh.jsx)(GL,{size:20,strokeWidth:2,"aria-hidden":!0}),title:eA,"aria-label":eA,onClick:()=>g(!f)})})}),eB&&eJ(),y&&(0,eh.jsx)($C,{title:n.name,memori:n,sessionID:M,tenant:r,showQrCode:!0,align:"left",baseUrl:O,history:i,triggerVariant:q})]}),eX=ef?`${eu(ep.energy,"energy",ec)} \u{2022} ${eu(ep.gwp,"co2",ec)}`:V("widget.noData",{defaultValue:"Nessun dato disponibile"}),eZ=(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsxs)("div",{className:"memori-header--auth-icon-controls",children:[eO&&(0,eh.jsx)(x2,{className:"memori-header--dropdown",open:en,onOpenChange:e=>{er(e),e&&(et(!1),l(!1))},placement:"bottom-end",sideOffset:8,closable:!1,contentClassName:"memori-dropdown--menu memori-dropdown--auth-menu",slotProps:{trigger:{render:e=>(0,eh.jsx)(_H,{title:eE,placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{...e,active:en,variant:q,className:"memori-header--auth-icon-button","aria-label":eE,icon:(0,eh.jsx)(H3,{})})})})}},content:(0,eh.jsxs)("div",{className:"memori-dropdown--auth-content",children:[eR&&(0,eh.jsxs)("button",{type:"button",className:"memori-dropdown--auth-row memori-dropdown--auth-row--navigable",onClick:()=>{h(!0),er(!1)},children:[(0,eh.jsx)("span",{className:"memori-dropdown--auth-icon-wrap",children:(0,eh.jsx)($u,{size:16})}),(0,eh.jsxs)("span",{className:"memori-dropdown--auth-copy",children:[(0,eh.jsx)("span",{className:"memori-dropdown--auth-title",children:V("knownFacts.title")||"Known facts"}),(0,eh.jsx)("span",{className:"memori-dropdown--auth-subtitle",children:V("widget.knownFactsHint")||"What I remember about you"})]})]}),F&&(eg?(0,eh.jsxs)("button",{type:"button",className:(b(tT))("memori-dropdown--auth-row","memori-dropdown--auth-row--navigable",ei&&"memori-dropdown--auth-row--active"),onClick:()=>{ea(!0),er(!1)},children:[(0,eh.jsx)("span",{className:"memori-dropdown--auth-icon-wrap",children:(0,eh.jsx)($0,{})}),(0,eh.jsxs)("span",{className:"memori-dropdown--auth-copy",children:[(0,eh.jsx)("span",{className:"memori-dropdown--auth-title",children:V("widget.aiConsumption")||"AI usage"}),(0,eh.jsx)("span",{className:"memori-dropdown--auth-subtitle",children:eX})]})]}):(0,eh.jsxs)("button",{type:"button",disabled:!0,className:"memori-dropdown--auth-row memori-dropdown--auth-row--navigable memori-dropdown--auth-row--disabled",children:[(0,eh.jsx)("span",{className:"memori-dropdown--auth-icon-wrap",children:(0,eh.jsx)($0,{})}),(0,eh.jsxs)("span",{className:"memori-dropdown--auth-copy",children:[(0,eh.jsx)("span",{className:"memori-dropdown--auth-title",children:V("widget.aiConsumption")||"AI usage"}),(0,eh.jsx)("span",{className:"memori-dropdown--auth-subtitle",children:eX})]})]}))]}),children:null}),U&&Y&&(0,eh.jsx)(_H,{title:eT,placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-header--auth-icon-button",title:eT,"aria-label":eT,icon:Z?(0,eh.jsx)($s,{}):(0,eh.jsx)($l,{}),onClick:R||(()=>{var e;if(document.fullscreenElement)document.exitFullscreen&&document.exitFullscreen().then(()=>{var e;Q(!1);let t=document.querySelector(".memori-widget");(null==(e=null==t?void 0:t.dataset)?void 0:e.memoriPrevBgColor)!==void 0&&(t.style.backgroundColor=t.dataset.memoriPrevBgColor,delete t.dataset.memoriPrevBgColor)}).catch(e=>{console.warn("Error attempting to exit fullscreen:",e)});else{let t="HIDDEN_CHAT"!==D&&"WEBSITE_ASSISTANT"!==D?document.body:document.querySelector(".memori-widget");if(t){let n=document.querySelector(".memori-widget");n&&(void 0===n.dataset.memoriPrevBgColor&&(n.dataset.memoriPrevBgColor=null!=(e=n.style.backgroundColor)?e:""),n.style.backgroundColor=""),t.requestFullscreen().then(()=>Q(!0)).catch(e=>{console.warn("Error attempting to enable fullscreen:",e)})}}})})})}),m&&(0,eh.jsx)(_H,{title:eA,placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-header--auth-icon-button",title:eA,"aria-label":eA,icon:f?(0,eh.jsx)($c,{size:20,strokeWidth:2.35,"aria-hidden":!0}):(0,eh.jsx)(GL,{size:20,strokeWidth:2,"aria-hidden":!0}),onClick:()=>g(!f)})})}),n.needsPosition&&(0,eh.jsx)(_H,{title:V("widget.position")||"Position",placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)($Q,{venue:a,setVenue:o,open:s,autoStartGeolocation:u,onOpenChange:e=>{l(e),e&&(er(!1),et(!1))},triggerButtonVariant:q,triggerClassName:"memori-header--auth-icon-button",triggerAriaLabel:V("widget.position")||"Position",positionerClassName:"WEBSITE_ASSISTANT"===D?"memori-position-popover__positioner--website-assistant":void 0})})}),x&&eW("memori-header--auth-icon-button"),w&&eq("memori-header--auth-icon-button"),eF&&e$("memori-header--auth-icon-button"),eB&&eJ("memori-header--auth-icon-button"),y&&(0,eh.jsx)("span",{className:"memori-header--auth-share-button-wrap",children:(0,eh.jsx)($C,{title:n.name,memori:n,sessionID:M,tenant:r,showQrCode:!0,align:"left",baseUrl:O,history:i,triggerVariant:q,className:"memori-header--auth-share-button"})})]}),F&&eg&&(0,eh.jsx)($6,{history:i,triggerVariant:q,hideTrigger:!0,open:ei,onOpenChange:ea})]}),eQ=V("login.user")||"Account",e0=V("reload")||"Restart conversation",e1=V("widget.settings")||"Settings",e2=V("knownFacts.title")||"Known facts",e3=V("write_and_speak.chatHistory")||"Chat history",e4=eR&&eN,e5=!!(E||e4),e6=(0,eh.jsxs)("div",{className:(b(tT))("memori-totem-rail",e),role:"toolbar","aria-label":String(V("widget.sessionControls",{defaultValue:"Controlli"})),"aria-orientation":"vertical",children:[(0,eh.jsxs)("div",{className:"memori-totem-rail--group",children:[m&&(0,eh.jsx)(_H,{title:eA,placement:"left",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-totem-rail--button",icon:f?(0,eh.jsx)($c,{size:20,strokeWidth:2.35,"aria-hidden":!0}):(0,eh.jsx)(GL,{size:20,strokeWidth:2,"aria-hidden":!0}),title:eA,"aria-label":eA,"aria-pressed":f,onClick:()=>g(!f)})})}),U&&Y&&(0,eh.jsx)(_H,{title:eT,placement:"left",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-totem-rail--button",icon:Z?(0,eh.jsx)($s,{}):(0,eh.jsx)($l,{}),title:eT,"aria-label":eT,"aria-pressed":Z,onClick:e=>{var t,n,r;R?R(e):document.fullscreenElement?null==(r=document.exitFullscreen)||r.call(document).then(()=>Q(!1)).catch(()=>{}):null==(n=(t=document.documentElement).requestFullscreen)||n.call(t).then(()=>Q(!0)).catch(()=>{})}})})}),y&&(0,eh.jsx)($C,{title:n.name,memori:n,sessionID:M,tenant:r,showQrCode:!0,align:"left",baseUrl:O,history:i,triggerVariant:q,className:"memori-totem-rail--button"}),x&&(0,eh.jsx)(_H,{title:e0,placement:"left",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-totem-rail--button",icon:(0,eh.jsx)($i,{}),title:e0,"aria-label":e0,onClick:()=>{window.location.reload()}})})}),w&&eq("memori-totem-rail--button","left"),eF&&e$("memori-totem-rail--button","left"),eB&&(0,eh.jsx)(_H,{title:e1,placement:"left",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-totem-rail--button",icon:(0,eh.jsx)($o,{}),title:e1,"aria-label":e1,onClick:()=>c(!0)})})}),N&&!!I&&(0,eh.jsx)(_H,{title:e3,placement:"left",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-totem-rail--button",icon:(0,eh.jsx)($t,{}),title:e3,"aria-label":e3,onClick:()=>d(!0)})})})]}),e5&&(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("div",{className:"memori-totem-rail--divider","aria-hidden":"true"}),(0,eh.jsx)("div",{className:"memori-totem-rail--group",children:(0,eh.jsx)(x2,{className:"memori-header--dropdown",open:ee,onOpenChange:e=>{et(e),e&&(er(!1),l(!1))},placement:"left-start",sideOffset:8,closable:!1,contentClassName:"memori-dropdown--menu memori-totem-rail--menu",slotProps:{trigger:{render:e=>(0,eh.jsx)(_H,{title:eQ,placement:"left",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{...e,active:ee,variant:q,className:(b(tT))("memori-totem-rail--button","memori-totem-rail--account-trigger"),title:eQ,"aria-label":eQ,icon:(0,eh.jsx)(Lp,{})})})})}},content:(0,eh.jsxs)("div",{className:"memori-totem-rail--menu-content",children:[E&&eI&&(0,eh.jsxs)("div",{className:"memori-totem-rail--menu-identity",children:[(0,eh.jsx)("span",{className:"memori-totem-rail--menu-identity-name",children:(null==C?void 0:C.userName)||V("login.welcomeUser")}),(null==C?void 0:C.eMail)&&(0,eh.jsx)("span",{className:"memori-totem-rail--menu-identity-email",children:C.eMail})]}),e4&&(0,eh.jsx)(yt,{type:"button",variant:"ghost",className:"memori-totem-rail--menu-item",icon:(0,eh.jsx)($u,{size:18,"aria-hidden":!0}),title:e2,"aria-label":e2,onClick:()=>{et(!1),h(!0)},children:e2}),E&&(eI?(0,eh.jsx)(yt,{type:"button",variant:"ghost",className:"memori-totem-rail--menu-item memori-totem-rail--menu-item--logout",icon:(0,eh.jsx)($r,{size:18,"aria-hidden":!0}),title:V("login.logout")||"Logout","aria-label":V("login.logout")||"Logout",onClick:()=>{et(!1),null==P||P()},children:V("login.logout")||"Logout"}):(0,eh.jsx)(yt,{type:"button",variant:"ghost",className:"memori-totem-rail--menu-item",icon:(0,eh.jsx)(Lp,{size:18,"aria-hidden":!0}),title:V("login.login")||"Login","aria-label":V("login.login")||"Login",onClick:()=>{et(!1),A(!0)},children:V("login.login")||"Login"}))]}),children:null})})]})]}),e8=(0,eh.jsxs)("div",{className:(b(tT))("memori-header",e,ex&&"memori-header--fullpage","FULLPAGE"===D&&!I&&"memori-header--fullpage-guest"),children:[ex&&eI?(0,eh.jsxs)(eh.Fragment,{children:[eD&&(0,eh.jsx)("div",{className:"memori-header--fullpage-primary",children:eG}),ez&&(0,eh.jsx)("div",{className:"memori-header--fullpage-divider","aria-hidden":"true"}),ej&&(0,eh.jsx)("div",{className:"memori-header--fullpage-secondary",children:eZ}),eH&&(0,eh.jsx)("div",{className:"memori-header--fullpage-divider","aria-hidden":"true"}),eV]}):ex?(0,eh.jsxs)(eh.Fragment,{children:[eD&&(0,eh.jsx)("div",{className:"memori-header--fullpage-primary",children:eG}),ez&&(0,eh.jsx)("div",{className:"memori-header--fullpage-divider","aria-hidden":"true"}),eU&&(0,eh.jsxs)("div",{className:"memori-header--fullpage-secondary",children:[eK,eY]}),eH&&(0,eh.jsx)("div",{className:"memori-header--fullpage-divider","aria-hidden":"true"}),eV]}):(0,eh.jsxs)(eh.Fragment,{children:[eK,eG,eY,eV]}),j]});return"TOTEM"===D?e6:ex?(0,eh.jsxs)(eh.Fragment,{children:[eN&&n&&(0,eh.jsxs)("div",{className:"memori-fullpage-header-brand",children:[eL?(0,eh.jsx)("img",{className:"memori-fullpage-header-brand-icon memori-fullpage-header-brand-icon--avatar",src:eL,alt:"",role:"presentation"}):(0,eh.jsx)("span",{className:"memori-fullpage-header-brand-icon","aria-hidden":!0}),(eP||ek)&&(0,eh.jsxs)("div",{className:"memori-fullpage-header-brand-text",children:[eP?(0,eh.jsx)("span",{className:"memori-fullpage-header-brand-name",title:eP,children:eP}):null,ek?(0,eh.jsx)(_H,{title:ek,placement:"bottom",...eo.tooltipProps,slotProps:{positioner:eo.positionerProps,popup:{className:"memori-fullpage-header-brand-role-tooltip"}},children:(0,eh.jsx)("span",{ref:eo.anchorRef,className:"memori-fullpage-header-brand-role",...eo.pressTriggerProps,children:ek})}):null]})]}),(0,eh.jsx)("div",{className:"memori-fullpage-header-actions",children:e8})]}):e8},$7=e=>(0,eh.jsxs)("svg",{className:"memori-ai-logo",width:800,height:800,fill:"currentColor",viewBox:"0 0 670.70013 639.67999","aria-label":"Memori AI",...e,children:[(0,eh.jsxs)("defs",{children:[(0,eh.jsx)("style",{children:"\n .cls-1 {\n fill: url(#Sfumatura_senza_nome_6);\n }\n\n .cls-1,\n .cls-2 {\n stroke-width: 0px;\n }\n\n .cls-2 {\n fill: var(--memori-text-color, '#744c99');\n }\n "}),(0,eh.jsxs)("linearGradient",{id:"Sfumatura_senza_nome_6","data-name":"Sfumatura senza nome 6",x1:392.82999,y1:-13.83,x2:786.29999,y2:628.33002,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(-304.65445,-80.16)",children:[(0,eh.jsx)("stop",{offset:.18,stopColor:"#9ad2d5",id:"stop1"}),(0,eh.jsx)("stop",{offset:.32,stopColor:"#26b5cb",id:"stop2"}),(0,eh.jsx)("stop",{offset:.38,stopColor:"#379cbe",id:"stop3"}),(0,eh.jsx)("stop",{offset:.46,stopColor:"#4c7eb0",id:"stop4"}),(0,eh.jsx)("stop",{offset:.55,stopColor:"#5d66a4",id:"stop5"}),(0,eh.jsx)("stop",{offset:.65,stopColor:"#69569c",id:"stop6"}),(0,eh.jsx)("stop",{offset:.76,stopColor:"#704c97",id:"stop7"}),(0,eh.jsx)("stop",{offset:.89,stopColor:"#734996",id:"stop8"})]})]}),(0,eh.jsxs)("g",{id:"g13",transform:"translate(-304.65445,-80.16)",children:[(0,eh.jsx)("path",{className:"cls-2",d:"m 451.79,434.96 v -78.79 c 0,-15.73 8.09,-25.54 22.73,-25.54 7.01,0 12.93,3.11 16.82,8.41 3.9,-5.29 9.81,-8.41 16.82,-8.41 14.64,0 22.74,9.81 22.74,25.54 v 78.79 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 v -77.08 c 0,-11.21 -3.74,-16.35 -10.9,-16.35 -7.16,0 -10.9,5.14 -10.9,16.35 v 77.08 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 v -77.08 c 0,-11.21 -3.74,-16.35 -10.9,-16.35 -7.16,0 -10.9,5.14 -10.9,16.35 v 77.08 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 z",id:"path8"}),(0,eh.jsx)("path",{className:"cls-2",d:"m 588.37,435.12 c 0,3.11 -2.65,5.45 -5.76,5.45 h -23.98 c -6.7,0 -9.5,-2.81 -9.5,-9.34 v -90.31 c 0,-6.54 2.8,-9.34 9.5,-9.34 h 23.98 c 3.11,0 5.76,2.33 5.76,5.45 0,3.12 -2.65,5.45 -5.76,5.45 h -21.65 v 32.7 h 19.31 c 3.11,0 5.76,2.33 5.76,5.45 0,3.12 -2.65,5.45 -5.76,5.45 h -19.31 v 43.6 h 21.65 c 3.11,0 5.76,2.33 5.76,5.45 z",id:"path9"}),(0,eh.jsx)("path",{className:"cls-2",d:"m 599.59,434.96 v -78.79 c 0,-15.73 8.09,-25.54 22.73,-25.54 7.01,0 12.93,3.11 16.82,8.41 3.9,-5.29 9.81,-8.41 16.82,-8.41 14.64,0 22.74,9.81 22.74,25.54 v 78.79 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 v -77.08 c 0,-11.21 -3.74,-16.35 -10.9,-16.35 -7.16,0 -10.9,5.14 -10.9,16.35 v 77.08 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 v -77.08 c 0,-11.21 -3.74,-16.35 -10.9,-16.35 -7.16,0 -10.9,5.14 -10.9,16.35 v 77.08 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 z",id:"path10"}),(0,eh.jsx)("path",{className:"cls-2",d:"m 692.72,416.28 v -60.1 c 0,-15.73 8.09,-25.54 23.35,-25.54 15.26,0 23.36,9.81 23.36,25.54 v 60.1 c 0,15.73 -8.1,25.54 -23.36,25.54 -15.26,0 -23.35,-9.81 -23.35,-25.54 z m 34.88,-2.02 v -56.05 c 0,-11.68 -4.05,-16.35 -11.52,-16.35 -7.47,0 -11.52,4.67 -11.52,16.35 v 56.05 c 0,11.68 4.05,16.35 11.52,16.35 7.47,0 11.52,-4.67 11.52,-16.35 z",id:"path11"}),(0,eh.jsx)("path",{className:"cls-2",d:"m 789.27,391.52 c 4.36,2.49 8.88,8.88 8.88,18.07 v 25.38 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 v -22.11 c 0,-8.88 -4.67,-15.73 -12.3,-15.73 h -8.25 v 37.84 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 v -94.05 c 0,-6.54 2.8,-9.34 9.5,-9.34 h 10.43 c 15.57,0 24.6,10.27 24.6,29.11 v 7.32 c 0,10.75 -2.81,18.69 -9.19,23.51 z m -2.33,-26 v -2.34 c 0,-14.02 -4.2,-20.71 -14.17,-20.71 h -7.01 v 43.75 h 7.01 c 9.97,0 14.17,-6.7 14.17,-20.71 z",id:"path12"}),(0,eh.jsx)("path",{className:"cls-2",d:"m 812.95,434.96 v -98.1 c 0,-3.27 2.65,-5.92 5.92,-5.92 3.27,0 5.92,2.65 5.92,5.92 v 98.1 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 z",id:"path13"})]}),(0,eh.jsx)("path",{className:"cls-1",d:"m 667.73555,242.64 c -6.38,-56.35 -42.43,-113.07 -98.9,-155.61 -49.7,-37.44 -109.37,-60.33 -170.6,-65.94 C 364.22555,7.6 328.15555,0 291.96555,0 c -69.91,0 -135.47,27.64 -189.6,79.93 C 82.235546,99.38 55.165546,139 38.215546,191.67 c -9.13,16.42 -16.91,33.67 -23.02,51.57 -33.85,99.22 -10.5500001,199.69 63.94,275.65 9.79,9.98 26.710004,23.27 49.530004,36.03 70.06,71.95 151.03,84.76 199.59,84.76 45.54,0 92.21,-11.24 124.84,-30.07 28.3,-16.34 52.64,-36.17 72.92,-59.28 108.74,-60.36 157.72,-166.32 141.72,-307.69 z m -73.68,9.57 c -8.31,-61.54 -42.48,-119.59 -90.75,-164.46 37.26,23.3 66.15,54.54 87.71,91.36 27.6,47.13 46.44,143.64 0.76,233.55 9.47,-47.57 10.27,-101.25 2.28,-160.44 z m -11.27,1.52 c 10.34,76.59 5.37,140.08 -11.29,192.23 -24.15,33.64 -58.84,65.28 -107.4,91.69 -31.3,17.03 -61.5,28.71 -90.28,36.23 -8.25,-0.19 -16.63,-0.69 -25.09,-1.54 22.94,-3.81 46.17,-10.56 69.46,-20.26 96.74,-40.31 136.66,-112.17 153.12,-165.35 20.63,-66.68 13.55,-131.72 1.21,-167.16 -36.47,-104.77 -118.35,-165.33 -237.85,-176.66 46.26,0.76 86.54,8.18 121.19,21.31 67.54,45.83 117.02,116.16 126.92,189.52 z m -78.06,294.93 c -21.61,10.54 -52.6,19.64 -88.2,23.43 17.75,-6.76 35.44,-14.89 53.01,-24.45 35,-19.04 64.77,-41.9 88.88,-67.95 -10.72,23.16 -24.08,43.65 -39.67,61.68 -4.6,2.51 -9.26,4.97 -14.02,7.29 z m -368.96,-2.75 c -19.71,-20.45 -38.150004,-45.4 -54.570004,-75.6 -59.13,-108.81 -54.64,-204.44 -32.59,-273.88 40.79,-72.66 110.320004,-128.92 184.840004,-145.21 -6.05,2.97 -12.04,6.12 -17.94,9.49 -48.68,23.3 -93.61,65.79 -123.390004,119.76 -51.8,93.85 -49.11,199.1 7.38,288.77 23.170004,36.78 95.600004,106.18 204.320004,106.77 10.31,2.55 20.33,4.47 29.9,5.87 -15.51,2.15 -30.53,3.16 -44.97,3.16 -63.65,0 -116.29,-18.88 -152.97,-39.14 z m 169.2,18.75 c -62.68,-15.85 -125.37,-53.95 -169.73,-129.36 -100.020004,-170.04 3.83,-303.77 44.43,-336.4 14.06,-11.3 28.49,-21 43.15,-29.29 24.09,-11.11 49.2,-17.27 73.97,-17.27 0.69,0 1.41,0 2.1,0.02 148.62,2.08 228.54,72.27 262.89,170.95 25.29,72.64 20.48,248.09 -147.96,318.27 -39.5,16.46 -75.82,23.09 -108.64,23.09 -0.07,0 -0.14,0 -0.21,0 z m -50.13,-5.41 c -78.55,-17.09 -129.59,-70.46 -145.73,-96.07 -63.580004,-100.94 -49.220004,-209.44 0.22,-289.59 -5.85,11.99 -11.140004,24.86 -15.460004,38.56 -23.54,74.64 -12.63,153.8 31.560004,228.92 36.33,61.76 83.37,97.63 129.41,118.18 z m 93.31,-527.42 c 6.92,-0.48 13.83,-0.76 20.7,-0.76 9.21,0 18.36,0.43 27.44,1.24 5.8,2.34 11.5,4.89 17.15,7.57 -20.54,-4.36 -42.3,-7.05 -65.28,-8.06 z m -237.88,56.28 c 56.12,-54.22 119.7,-76.74 181.69,-76.74 22.56,0 44.9,3.01 66.59,8.54 -27.97,0.93 -55.36,5.59 -81.73,13.89 -9.47,0.87 -19.03,1.9 -28.75,3.25 -66.39,9.19 -130.73,49.37 -177.320004,106.6 13.93,-26.25 28.93,-45.3 39.520004,-55.54 z M 87.255546,510.92 C 8.3455459,430.46 -2.7544541,333.8 25.095546,249.55 c -9.9,74.5 5.8,152.05 46.09,226.19 9.7,17.85 20.01,33.8 30.760004,48.04 -5.970004,-4.67 -10.990004,-9.07 -14.700004,-12.85 z m 360.150004,88.83 c -27.18,15.69 -70.3,28.55 -119.16,28.55 -52.11,0 -110.74,-14.68 -163.49,-56.16 34.18,13.85 76.16,24.27 123.97,24.27 28.75,0 57.59,-3.76 86.33,-11.13 2.13,0.04 4.2,0.06 6.22,0.06 40.23,0 81.61,-7.43 114.06,-20.19 -14.66,13.13 -30.69,24.65 -47.93,34.6 z m 98.55,-75.09 c 10.02,-14.65 18.69,-30.34 25.92,-47.11 3.74,-8.67 7.06,-17.66 10.05,-26.89 17.66,-24.96 30.8,-52.23 38.94,-81.46 22.51,-80.87 3.27,-156.05 -20.04,-195.85 -33.54,-57.28 -80.82,-97.29 -141.07,-119.95 -8.19,-5.44 -16.61,-10.57 -25.24,-15.28 116.19,24.92 211.36,112.54 221.92,205.8 15.48,136.7 -31.24,226.21 -110.47,280.75 z",id:"path14",style:{fill:"url(#Sfumatura_senza_nome_6)"}})]}),$9=({tenant:e,userLang:t="en",integrationID:n,memoriHash:r})=>{let i=`https://memori.ai/${(null==t?void 0:t.toLowerCase())==="it"?"it":"en"}${n?`?integrationID=${n}`:""}${r?`${n?"&":"?"}memori=${r}`:""}`;return(0,eh.jsxs)("div",{className:"memori--powered-by",children:[(0,eh.jsx)($7,{className:"memori--powered-by-icon","aria-hidden":!0}),(0,eh.jsxs)("p",{className:"memori--powered-by-label",children:[(0,eh.jsx)("span",{children:"Powered by "}),(0,eh.jsx)("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:"Memori.AI"})]})]})},em=ec("85Hg2");let Je=wv("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),Jt=(0,em.memo)(({defaultDate:e,onChange:t,disabled:n=!1,minAge:r=18})=>{let{t:i}=tA(),a=(0,em.useMemo)(()=>i5.now().minus({years:r}).startOf("day"),[r]),o=(0,em.useMemo)(()=>i5.fromObject({year:1900,month:1,day:1}),[]),[s,l]=(0,em.useState)(""),[u,c]=(0,em.useState)(""),[d,h]=(0,em.useState)("");(0,em.useEffect)(()=>{if(e){let t="string"==typeof e?i5.fromISO(e):i5.fromJSDate(e);t.isValid&&(l(t.day.toString()),c(t.month.toString()),h(t.year.toString()))}},[e]);let[p,m]=(0,em.useState)(!1),f=(0,em.useRef)(null),g=(0,em.useRef)(null),v=(0,em.useRef)(null);(0,em.useEffect)(()=>{let e=()=>{m(window.innerWidth<768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let y=(0,em.useRef)(t);y.current=t;let b=(0,em.useRef)(void 0);if((0,em.useEffect)(()=>{let e=e=>{let t=(null==e?void 0:e.isValid)?e.toISODate():null;t!==b.current&&(b.current=t,y.current(e))};if(!s||!u||!d)return void e(void 0);let t=parseInt(s),n=parseInt(u),r=parseInt(d);if(isNaN(t)||isNaN(n)||isNaN(r))return void e(void 0);let i=i5.fromObject({year:r,month:n,day:t});e(i.isValid&&i>=o&&i<=a?i:void 0)},[s,u,d,o,a]),p){let e=s&&u&&d?i5.fromObject({year:parseInt(d),month:parseInt(u),day:parseInt(s)}):null,t=(null==e?void 0:e.isValid)&&e.toISODate()||"",r=!t,p=i("login.birthDatePlaceholder")||"DD/MM/YYYY";return(0,eh.jsxs)("div",{className:"memori--date-selector memori--date-selector--mobile",children:[(0,eh.jsxs)("label",{htmlFor:"birth-date-mobile",className:"memori--date-selector__mobile-label",children:[i("birthDate")||"Birth Date",":"]}),(0,eh.jsxs)("div",{className:`memori--date-selector__mobile-input-wrap${r?" memori--date-selector__mobile-input-wrap--empty":""}`,children:[(0,eh.jsx)("input",{id:"birth-date-mobile",type:"date",className:"memori--date-selector__mobile-input",value:t,onChange:e=>{let t=e.target.value;if(t){let e=i5.fromISO(t);e.isValid&&(l(e.day.toString()),c(e.month.toString()),h(e.year.toString()))}else l(""),c(""),h("")},disabled:n,min:o.toISODate()||"1900-01-01",max:a.toISODate()||"","aria-label":String(i("birthDate")||i("date"))}),r&&(0,eh.jsx)("span",{className:"memori--date-selector__mobile-placeholder","aria-hidden":!0,children:p}),(0,eh.jsx)(Je,{className:"memori--date-selector__mobile-icon","aria-hidden":!0,size:20,strokeWidth:1.75})]})]})}return(0,eh.jsxs)("div",{className:"memori--date-selector memori--date-selector--desktop",children:[(0,eh.jsxs)("div",{className:"memori--date-selector__input-group",children:[(0,eh.jsx)("label",{htmlFor:"birth-day",className:"memori--date-selector__label",children:i("day")||"Day"}),(0,eh.jsx)("input",{id:"birth-day",ref:f,type:"number",inputMode:"numeric",className:"memori--date-selector__input",value:s,onChange:e=>{var t;let n=e.target.value;if(""===n||/^\d+$/.test(n)){if(n.length>2||parseInt(n)>31)return;l(n),n.length>=2&&(null==(t=g.current)||t.focus())}},placeholder:i("dayPlaceholder")||"DD",min:1,max:31,disabled:n})]}),(0,eh.jsxs)("div",{className:"memori--date-selector__input-group",children:[(0,eh.jsx)("label",{htmlFor:"birth-month",className:"memori--date-selector__label",children:i("month")||"Month"}),(0,eh.jsx)("input",{id:"birth-month",ref:g,type:"number",inputMode:"numeric",className:"memori--date-selector__input",value:u,onChange:e=>{var t;let n=e.target.value;if(""===n||/^\d+$/.test(n)){if(n.length>2||parseInt(n)>12)return;c(n),n.length>=2&&(null==(t=v.current)||t.focus())}},placeholder:i("monthPlaceholder")||"MM",min:1,max:12,disabled:n})]}),(0,eh.jsxs)("div",{className:"memori--date-selector__input-group memori--date-selector__input-group--year",children:[(0,eh.jsx)("label",{htmlFor:"birth-year",className:"memori--date-selector__label",children:i("year")||"Year"}),(0,eh.jsx)("input",{id:"birth-year",ref:v,type:"number",inputMode:"numeric",className:"memori--date-selector__input",value:d,onChange:e=>{let t=e.target.value;if(""===t||/^\d+$/.test(t)){if(t.length>4)return;h(t)}},placeholder:i("yearPlaceholder")||"YYYY",min:o.year,max:a.year,disabled:n})]})]})});Jt.displayName="DateSelector";var em=ec("85Hg2"),Jn=({visible:e=!1,onClose:t,minAge:n})=>{let{t:r}=tA(),{add:i}=vZ(),[a,o]=(0,em.useState)(),[s,l]=(0,em.useState)(),[u,c]=(0,em.useState)(!1),d=(0,em.useCallback)(()=>{if(c(!0),!a){i(v9({description:r("requiredField"),severity:"error"})),l(r("requiredField")||"Required field"),c(!1);return}if(i5.now().diff(a,"years").years<n){i(v9({description:r("underageTwinSession",{age:n}),severity:"error"})),l(r("underageTwinSession",{age:n})||`You must be at least ${n} years old to interact with this Agent`),c(!1);return}l(void 0),i(v9({description:r("ageVerificationSuccess"),severity:"success"})),t(a.toJSDate().toISOString()),c(!1)},[i,a,n,t,r]),h=(0,em.useCallback)(e=>{o(e)},[]);return(0,eh.jsxs)(__,{open:e,width:"600px",widthMd:"600px",stacking:"stacked",title:r("ageVerification"),className:"age-verification-modal",backdropClassName:"age-verification-modal-backdrop",closable:!1,children:[(0,eh.jsx)("p",{className:"age-verification-text",children:r("ageVerificationText",{minAge:n})}),(0,eh.jsxs)(xD,{name:"ageVerification",className:"age-verification-form",onSubmit:e=>{e.preventDefault(),d()},children:[(0,eh.jsx)(xk,{className:"age-verification-birth-field",helperText:r("birthDateHelper"),error:s,invalid:!!s,required:!0,children:(0,eh.jsx)(Jt,{minAge:n,onChange:e=>{h(e),l(void 0)}})}),(0,eh.jsx)(yt,{variant:"primary",type:"submit",size:"lg",loading:u,disabled:!a,style:{marginBottom:"0.25rem"},children:r("confirm")})]})]})},Jr=({open:e,layout:t="FULLPAGE",onClose:n,controlsPosition:r,setControlsPosition:i,hideEmissions:a,setHideEmissions:o,additionalSettings:s,avatarType:l,setAvatarType:u,enablePositionControls:c,setEnablePositionControls:d,isAvatar3d:h})=>{let{t:p}=tA();return(0,eh.jsxs)(xf,{className:"memori-settings-drawer",open:e,onClose:n,title:p("widget.settings")||"Settings",children:["TOTEM"===t&&(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,eh.jsxs)("label",{htmlFor:"#controlsPosition",children:[p("write_and_speak.controlsPosition")||"Controls",":"]}),(0,eh.jsxs)("div",{id:"controlsPosition",className:"memori-settings-drawer--controlsposition-radio",role:"radiogroup",children:[(0,eh.jsx)(yt,{role:"radio","aria-checked":"center"===r,variant:"center"===r?"primary":"outline",className:"memori-settings-drawer--controlsposition-radio-button",onClick:()=>{i("center"),qk("controlsPosition","center")},children:p("center")||"Center"}),(0,eh.jsx)(yt,{role:"radio","aria-checked":"bottom"===r,variant:"bottom"===r?"primary":"outline",className:"memori-settings-drawer--controlsposition-radio-button",onClick:()=>{i("bottom"),qk("controlsPosition","bottom")},children:p("bottom")||"Bottom"})]})]}),h&&(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,eh.jsxs)("label",{htmlFor:"avatarType",className:"memori-settings-drawer-label",children:[p("write_and_speak.avatarType")||"Avatar type",":"]}),(0,eh.jsxs)("div",{id:"avatarType",className:"memori-settings-drawer--avatarType-radio",role:"radiogroup",children:[(0,eh.jsx)(yt,{role:"radio","aria-checked":"blob"===l,variant:"blob"===l?"primary":"outline",className:"memori-settings-drawer--avatarType-radio-button",onClick:()=>{null==u||u("blob"),qk("avatarType","blob")},children:p("write_and_speak.blob")||"Blob"}),(0,eh.jsx)(yt,{role:"radio","aria-checked":"avatar3d"===l,variant:"avatar3d"===l?"primary":"outline",className:"memori-settings-drawer--avatarType-radio-button",onClick:()=>{null==u||u("avatar3d"),qk("avatarType","avatar3d")},children:p("write_and_speak.avatar3d")||"Avatar 3D"})]})]}),(0,eh.jsx)("div",{className:"memori-settings-drawer--field",children:(0,eh.jsx)(bq,{label:p("write_and_speak.enablePositionControls")||"Enable position controls",name:"enablePositionControls",checked:c,onChange:e=>{d(e)}})})]}),(0,eh.jsx)("div",{className:"memori-settings-drawer--field",children:(0,eh.jsx)(bq,{label:p("write_and_speak.hideEmissionsLabel")||"Hide emissions",name:"hideControls",checked:a,onChange:e=>{o(e),qk("hideEmissions",e)}})})]}),s&&(0,eh.jsx)("div",{className:"memori-settings-drawer--field controls",children:s})]})},em=ec("85Hg2");let Ji=wv("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),Ja=wv("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),Jo=e=>{if(!e)return null;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?null:t},Js=(e,t)=>{let n=t.trim().toLowerCase();return n?e.filter(e=>e.text.toLowerCase().includes(n)):e};var Jl=({apiClient:e,sessionID:t,memori:n,disableFetch:r=!1,visible:i=!0,initialKnownFacts:a=[],closeDrawer:o})=>{let{t:s,i18n:l}=tA(),{add:u}=vZ(),{getKnownFacts:c,getKnownFactsPaginated:d,deleteKnownFact:h}=e.knownFacts,p=(0,em.useRef)(a);p.current=a;let[m,f]=(0,em.useState)(a.slice(0,8)),[g,v]=(0,em.useState)(a.length),[y,_]=(0,em.useState)(Math.min(8,a.length)),[x,w]=(0,em.useState)(!1),[S,E]=(0,em.useState)(!1),[A,T]=(0,em.useState)(""),I=k2(A,300),[C,M]=(0,em.useState)(!1),[N,R]=(0,em.useState)([]),[O,P]=(0,em.useState)(!1),[k,D]=(0,em.useState)(!1),[B,F]=(0,em.useState)(),[U,j]=(0,em.useState)(!1),z=(0,em.useCallback)((e,t)=>{let n=Js(p.current,I),r=n.slice(0,e+8);f(r),v(n.length),_(r.length),t||R(e=>e.filter(e=>r.some(t=>t.knownFactID===e)))},[I]),H=(0,em.useCallback)(async({from:e=0,append:n=!1}={})=>{if(r)return void z(e,n);if(t){n?E(!0):w(!0);try{if(I.trim()){let{knownFacts:n,count:r,...i}=await c(t);0!==i.resultCode&&u(v9({description:s(Lx(i.resultCode)),severity:"error"}));let a=Js(Array.isArray(n)?n:[],I),o=a.slice(0,e+8);f(o),v(a.length||r||0),_(o.length)}else{let{knownFacts:r,count:i,...a}=await d(t,e,8);0!==a.resultCode&&u(v9({description:s(Lx(a.resultCode)),severity:"error"}));let o=Array.isArray(r)?r:[];f(e=>n?[...e,...o]:o),v(null!=i?i:0),_(e+o.length)}}catch(e){console.error("KNOWN_FACTS/FETCH",e),n||(f([]),v(0),_(0))}finally{w(!1),E(!1)}}},[u,z,r,c,d,I,t,s]);(0,em.useEffect)(()=>{H({from:0,append:!1})},[t,I,r]),(0,em.useEffect)(()=>{M(!1),R([])},[I]);let G=(0,em.useMemo)(()=>s("knownFacts.selected",{count:N.length,defaultValue:s("knownFacts.selectedRows",{count:N.length})}),[N.length,s]),V=g>0||m.length>0,W=y<g,q=!x&&!I.trim()&&0===m.length,$=!x&&!!I.trim()&&0===m.length,J=async e=>{if(0===e.length)return;if(r){let t=p.current.filter(t=>!e.includes(t.knownFactID));return p.current=t,z(0,!1),!0}let n=await Promise.all(e.map(e=>h(t,e)));if(n.every(e=>0===e.resultCode))return u(v9({description:s("knownFacts.deleteSuccess"),severity:"success"})),await H({from:0,append:!1}),!0;let i=n.find(e=>0!==e.resultCode);return(null==i?void 0:i.resultCode)!==void 0&&u(v9({description:s(Lx(i.resultCode)),severity:"error"})),!1},K=V&&!q?(0,eh.jsx)(Hf,{start:(0,eh.jsx)("span",{className:"memori-known-facts-count",children:s("knownFacts.shownOfTotal",{shown:m.length,total:g})}),end:W?(0,eh.jsx)(yt,{variant:"outline",loading:S,disabled:S,icon:(0,eh.jsx)(Hg,{"aria-hidden":!0}),iconPosition:"right",onClick:()=>void H({from:y,append:!0}),children:s("knownFacts.loadMore")}):void 0}):void 0;return(0,eh.jsxs)(Hm,{open:i,size:"md",className:"memori-known-facts-drawer",title:s("knownFacts.title"),description:s("knownFacts.description",{memoriName:n.name}),closeLabel:s("close")||"Close",footer:K,onClose:o,children:[!q&&(0,eh.jsxs)("div",{className:"memori-known-facts-toolbar",children:[(0,eh.jsxs)("div",{className:"memori-known-facts-search",children:[(0,eh.jsx)("label",{className:"memori-sr-only",htmlFor:"memori-known-facts-search",children:s("knownFacts.searchPlaceholder")}),(0,eh.jsx)(xM,{id:"memori-known-facts-search",fullWidth:!0,prefix:(0,eh.jsx)(Ji,{"aria-hidden":!0}),value:A,placeholder:s("knownFacts.searchPlaceholder")||"",onValueChange:T})]}),(0,eh.jsx)(yt,{variant:"outline",active:C,icon:(0,eh.jsx)(Ll,{"aria-hidden":!0}),onClick:()=>{M(e=>!e),R([])},children:s("knownFacts.select")})]}),C&&N.length>0&&(0,eh.jsxs)("div",{className:"memori-known-facts-selection-bar",role:"region","aria-label":G,children:[(0,eh.jsx)("span",{className:"memori-known-facts-selection-bar__count",children:G}),(0,eh.jsxs)("div",{className:"memori-known-facts-selection-bar__actions",children:[(0,eh.jsx)(yt,{variant:"danger",className:"memori-known-facts-selection-bar__delete",icon:(0,eh.jsx)($a,{"aria-hidden":!0}),onClick:()=>P(!0),children:s("delete")}),(0,eh.jsx)(yt,{variant:"ghost",onClick:()=>{R([]),M(!1)},children:s("cancel")})]})]}),q&&(0,eh.jsx)(Hp,{icon:(0,eh.jsx)(Ja,{}),title:s("knownFacts.emptyTitle"),description:s("knownFacts.emptyDescription")}),$&&(0,eh.jsx)(Hp,{icon:(0,eh.jsx)(Ji,{}),title:s("write_and_speak.noResultsFound",{searchText:I})}),!q&&!$&&(0,eh.jsx)("ul",{className:"memori-known-facts-list","aria-busy":x||void 0,children:m.map(e=>{var t,n;let r,i=N.includes(e.knownFactID),a=e.creationTimestamp?((e,t,n=new Date)=>{let r=Jo(e);if(!r)return"";let i=r.getTime()-n.getTime(),a=Math.abs(i),o=new Intl.RelativeTimeFormat(t,{numeric:"auto"});return a<6e4?o.format(Math.round(i/1e3),"second"):a<36e5?o.format(Math.round(i/6e4),"minute"):a<864e5?o.format(Math.round(i/36e5),"hour"):a<6048e5?o.format(Math.round(i/864e5),"day"):a<2592e6?o.format(Math.round(i/6048e5),"week"):a<31536e6?o.format(Math.round(i/2592e6),"month"):o.format(Math.round(i/31536e6),"year")})(e.creationTimestamp,l.language):"",o=e.creationTimestamp?(t=e.creationTimestamp,n=l.language,(r=Jo(t))?new Intl.DateTimeFormat(n,{dateStyle:"short",timeStyle:"short"}).format(r):""):"";return(0,eh.jsx)("li",{children:C?(0,eh.jsxs)("label",{className:(b(tT))("memori-known-facts-card",{"memori-known-facts-card--selected":i}),children:[(0,eh.jsx)(bq,{checked:i,onChange:()=>{var t;return t=e.knownFactID,void R(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},"aria-label":s("selected")||void 0}),(0,eh.jsx)("span",{className:"memori-known-facts-card__text",children:e.text})]}):(0,eh.jsxs)("article",{className:"memori-known-facts-card",children:[(0,eh.jsxs)("div",{className:"memori-known-facts-card__content",children:[(0,eh.jsx)("p",{className:"memori-known-facts-card__text",children:e.text}),a&&(0,eh.jsx)(_H,{title:o,placement:"bottom",children:(0,eh.jsx)("time",{className:"memori-known-facts-card__date",dateTime:e.creationTimestamp,children:a})})]}),(0,eh.jsx)("div",{className:"memori-known-facts-card__actions",children:(0,eh.jsx)(yt,{variant:"ghost",shape:"circle",size:"sm",className:"memori-known-facts-card__delete","aria-label":s("knownFacts.deleteLabel")||void 0,title:s("delete")||"",icon:(0,eh.jsx)($a,{"aria-hidden":!0}),onClick:()=>F(e.knownFactID)})})]})},e.knownFactID)})}),(0,eh.jsx)(__,{className:"memori-known-facts-modal",stacking:"stacked",open:O,closable:!0,title:N.length>1?s("knownFacts.deleteSelectedConfirmTitle"):s("knownFacts.deleteConfirmTitle"),description:`${G}. ${s("knownFacts.deleteSelectedConfirmMessage",{number:N.length})}`,onOpenChange:e=>{e||P(!1)},footer:(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)(yt,{variant:"ghost",onClick:()=>P(!1),children:s("cancel")}),(0,eh.jsx)(yt,{variant:"danger",loading:k,disabled:k,onClick:async()=>{D(!0);try{await J(N)&&(R([]),M(!1),P(!1))}finally{D(!1)}},children:s("confirm")})]})}),(0,eh.jsx)(__,{className:"memori-known-facts-modal",stacking:"stacked",open:void 0!==B,closable:!0,title:s("knownFacts.deleteConfirmTitle"),description:s("knownFacts.deleteConfirmMessage"),onOpenChange:e=>{e||F(void 0)},footer:(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)(yt,{variant:"ghost",onClick:()=>F(void 0),children:s("cancel")}),(0,eh.jsx)(yt,{variant:"danger",loading:U,disabled:U,onClick:async()=>{if(B){j(!0);try{await J([B])&&F(void 0)}finally{j(!1)}}},children:s("confirm")})]})})]})},Ju=({open:e=!1,baseUrl:t,apiUrl:n,tenant:r,experts:i,onClose:a})=>{let{t:o}=tA();return(0,eh.jsx)(xf,{open:e,onClose:a,className:"memori--experts-drawer",title:(0,eh.jsx)("h2",{className:"memori--experts-drawer--title",children:o("widget.expertsInTheBoard")}),children:(0,eh.jsx)("ul",{className:"memori--experts-drawer--list",children:i.map(e=>(0,eh.jsxs)("li",{className:"memori--experts-drawer--item",children:[(0,eh.jsx)("figure",{className:"memori--experts-drawer--avatar",children:(0,eh.jsx)("img",{src:`${new URL(n).origin}/api/v1/memoriai/memori/avatar/${e.expertMemoriID}`,alt:e.name,onError:e=>{e.currentTarget.src=La({tenantID:null==r?void 0:r.name,type:"avatar",baseURL:t}),e.currentTarget.onerror=null}})}),(0,eh.jsx)("div",{className:"memori--experts-drawer--content",children:(0,eh.jsx)("h3",{className:"memori--experts-drawer--name",children:e.name})})]},e.expertID))})})},em=ec("85Hg2"),Jc=({open:e=!1,onClose:t,onLogin:n,user:r,loginToken:i,setUser:a,tenant:o,apiClient:s,__TEST__signup:l=!1,__TEST__needMissingData:u=!1,modalClassName:c,memoriName:d,onLogout:h})=>{var p;let{t:m,i18n:f}=tA(),{add:g}=vZ(),v="it"===f.language?"it":"en",{pwlUpdateUser:y,loginWithOTP:_,validateOTPCode:x,pwlGetCurrentUser:w}=s.backend,[S,E]=(0,em.useState)(!1),[A,T]=(0,em.useState)(null),[I,C]=(0,em.useState)(""),[M,N]=(0,em.useState)(""),[R,O]=(0,em.useState)(null),[P,k]=(0,em.useState)(!1),[D,B]=(0,em.useState)(null),[F,U]=(0,em.useState)(!1),[j,z]=(0,em.useState)(!1),[H,G]=(0,em.useState)(0),[V,W]=(0,em.useState)(""),[q,$]=(0,em.useState)(!1),[J,K]=(0,em.useState)(!1),[Y,X]=(0,em.useState)(!1),[Z,Q]=(0,em.useState)(!1),ee=(0,em.useRef)([]),et=(0,em.useRef)(!1),[en,er]=(0,em.useState)(u?{token:"token",birthDate:!0,tnCAndPPAccepted:!0}:{});(0,em.useEffect)(()=>{let e;return null!=D&&D>0&&(e=setInterval(()=>{B(e=>null!=e&&e>0?e-1:0)},1e3)),()=>{e&&clearInterval(e)}},[D]),(0,em.useEffect)(()=>{0===D&&B(null)},[D]),(0,em.useEffect)(()=>{e||z(!1)},[e]),(0,em.useEffect)(()=>{let e=window.matchMedia("(max-width: 768px)"),t=()=>K(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let ei=async(e,t=!1)=>{let n=e.trim();if(!n)return void O(m("login.emailRequired"));if(!k1.test(n))return void O(m("login.emailInvalid"));t?U(!0):E(!0),O(null);try{let e=await _({tenant:o.name,eMail:n});0===e.resultCode?(N(n),k(!0),B(60),C(""),G(0)):O(e.resultMessage||m("login.otpSendError"))}catch(e){console.error("[OTP SEND]",e),O(m("login.otpSendError"))}finally{E(!1),U(!1)}},ea=async e=>{var t,r,i;if(!et.current){if(!e||4!==e.length)return void O(m("login.otpInvalidFormat"));if(!M||0===M.trim().length)return void O(m("login.emailRequired"));et.current=!0,E(!0),O(null);try{let s=await x(e,o.name,void 0,M.trim());if(0===s.resultCode)try{let{user:e}=await w(s.newSessionToken);e.age&&e.tnCAndPPAccepted?(z(!0),k(!1),C(""),N(""),n(e,s.newSessionToken)):(a(e),W(null!=(t=null==e?void 0:e.birthDate)?t:""),X(null!=(r=null==e?void 0:e.tnCAndPPAccepted)&&r),Q(null!=(i=null==e?void 0:e.pAndCUAccepted)&&i),er({token:s.newSessionToken,birthDate:!e.age,tnCAndPPAccepted:!e.tnCAndPPAccepted}),k(!1),C(""))}catch(e){console.error("[GET USER]",e),O(m("login.userFetchError"))}else -107===s.resultCode?O(m("login.otpNotFound")):-108===s.resultCode?(O(m("login.otpExpired")),B(null)):-109===s.resultCode?(O(m("login.otpInvalid")),C(""),G(0),window.setTimeout(()=>{var e;null==(e=ee.current[0])||e.focus()},50)):-110===s.resultCode?(O(m("login.otpAttemptsExceeded")),C(""),B(null),k(!1)):O(s.resultMessage||m("login.otpInvalid"))}catch(e){console.error("[OTP VALIDATION]",e),O(m("login.otpError"))}finally{E(!1),et.current=!1}}};(0,em.useEffect)(()=>{P&&!S&&window.setTimeout(()=>{var e;null==(e=ee.current[0])||e.focus()},50)},[P,S]);let eo=async e=>{if(e.preventDefault(),!(null==r?void 0:r.userID)||!(null==en?void 0:en.token))return void T(m("login.userNotFound"));if(!V||!Y)return void T(m("missingData"));let t={userID:r.userID,birthDate:(null==r?void 0:r.birthDate)||!en.birthDate?void 0:V,tnCAndPPAccepted:Y||(null==r?void 0:r.tnCAndPPAccepted),tnCAndPPAcceptanceDate:Y?new Date().toISOString():void 0,pAndCUAccepted:Z||(null==r?void 0:r.pAndCUAccepted),pAndCUAcceptanceDate:Z?new Date().toISOString():void 0},{user:i,...a}=await y(en.token,r.userID,t);0!==a.resultCode?(console.error(a),g(v9({description:m(Lx(a.resultCode)),severity:"error"})),T(a.resultMessage)):n(i||t,en.token)},es=(null==d?void 0:d.trim())||m("login.defaultAgentName")||"AI",el=m("login.login")||"Login",eu=4===I.length,ec=!!(null==(p=null==en?void 0:en.token)?void 0:p.length),ed=(0,eh.jsxs)("div",{className:"memori--login-modal--step",children:[(0,eh.jsx)("p",{className:"memori--login-modal--benefit",children:m("login.loginBenefitLine1",{memoriName:es})}),(0,eh.jsxs)(xN,{className:"memori--login-modal--field",children:[(0,eh.jsx)(xR,{htmlFor:"otp-email",children:m("login.email")}),(0,eh.jsx)(xM,{id:"otp-email",name:"email",type:"email",size:"lg",className:(b(tT))("memori--login-modal--email-input",{error:!!R}),value:M,onChange:e=>{N(e.target.value),O(null)},placeholder:m("login.emailPlaceholder")||"Enter your email…",autoComplete:"email",spellCheck:!1,required:!0,disabled:S,"aria-invalid":!!R,"aria-describedby":R?"otp-email-error":"email-help"}),R?(0,eh.jsx)(xP,{id:"otp-email-error",children:R}):(0,eh.jsx)("p",{id:"email-help",className:"sr-only",children:m("login.otpEmailDescription")})]}),(0,eh.jsx)(yt,{variant:"primary",className:"memori--login-modal--primary",onClick:()=>ei(M),disabled:S,loading:S,size:"lg",children:m("login.sendOtp")}),(0,eh.jsx)("p",{className:"memori--login-modal--footnote",children:m("login.passwordlessHint")})]}),ep=(0,eh.jsxs)("div",{className:"memori--login-modal--step",children:[(0,eh.jsx)("p",{className:"memori--login-modal--sent-copy",children:m("login.otpSentToPrefix")}),(0,eh.jsxs)("p",{className:"memori--login-modal--email-row",children:[(0,eh.jsx)("strong",{className:"memori--login-modal--email-value",children:M})," ",(0,eh.jsx)("button",{type:"button",className:"memori--login-modal--edit-link",onClick:()=>{k(!1),C(""),O(null),B(null)},disabled:S,children:m("login.editEmail")})]}),(0,eh.jsxs)("fieldset",{className:"memori--login-modal--otp-fieldset","aria-describedby":"otp-help",children:[(0,eh.jsx)("legend",{className:"memori--login-modal--otp-label",children:m("login.otpCodeShort")}),(0,eh.jsx)("div",{className:"memori--login-modal--otp-digits",children:[0,1,2,3].map(e=>(0,eh.jsx)(xM,{id:0===e?"otp-code":`otp-code-${e}`,name:`otp-code-${e}`,"aria-label":`${m("login.otpCode")} ${e+1} / 4`,type:"text",inputMode:"numeric",pattern:"[0-9]*",enterKeyHint:3===e?"done":"next",autoComplete:0===e?"one-time-code":"off",spellCheck:!1,className:(b(tT))("memori--login-modal--otp-digit",{active:H===e,error:!!R}),value:I[e]||"",onChange:t=>((e,t)=>{var n,r;let i=t.replace(/\D/g,""),a=I.padEnd(4," ").split("");if(!i.length){a[e]=" ",C(a.join("").replace(/\s/g,"")),O(null);return}if(i.length>1){let t=[...a];i.slice(0,4).split("").forEach((n,r)=>{e+r<4&&(t[e+r]=n)});let r=t.join("").replace(/\s/g,"").slice(0,4);C(r),O(null);let o=Math.min(e+i.length,3);null==(n=ee.current[o])||n.focus(),G(o),4===r.length&&M.trim().length>0&&ea(r);return}a[e]=i[0];let o=a.join("").replace(/\s/g,"").slice(0,4);C(o),O(null),4===o.length&&M.trim().length>0&&ea(o),e<3&&(null==(r=ee.current[e+1])||r.focus(),G(e+1))})(e,t.target.value),onFocus:()=>G(e),onKeyDown:t=>{var n,r,i;"Backspace"===t.key&&!I[e]&&e>0&&(null==(n=ee.current[e-1])||n.focus(),G(e-1)),"ArrowLeft"===t.key&&e>0&&(t.preventDefault(),null==(r=ee.current[e-1])||r.focus(),G(e-1)),"ArrowRight"===t.key&&e<3&&(t.preventDefault(),null==(i=ee.current[e+1])||i.focus(),G(e+1))},onPaste:t=>((e,t)=>{var n;let r=t.clipboardData.getData("text").replace(/\D/g,"").slice(0,4);if(!r.length)return;t.preventDefault();let i=I.padEnd(4," ").split("");r.split("").forEach((t,n)=>{e+n<4&&(i[e+n]=t)});let a=i.join("").replace(/\s/g,"").slice(0,4);C(a),O(null);let o=Math.min(e+r.length,3);null==(n=ee.current[o])||n.focus(),G(o),4===a.length&&M.trim().length>0&&ea(a)})(e,t),maxLength:1,required:!0,disabled:S,ref:t=>{ee.current[e]=t}},e))}),(0,eh.jsx)("p",{id:"otp-help",className:"sr-only",children:m("login.otpCodeDescription",{email:M})})]}),R&&(0,eh.jsx)("p",{role:"alert",className:"memori--login-modal--inline-error",children:R}),(0,eh.jsx)(yt,{variant:"primary",className:"memori--login-modal--primary",onClick:()=>ea(I),disabled:S||!eu,loading:S,size:"lg",children:el}),(0,eh.jsx)("p",{className:"memori--login-modal--resend",children:null!=D&&D>0?m("login.resendOtpPrompt",{seconds:D}):(0,eh.jsxs)(eh.Fragment,{children:[m("login.resendOtpQuestion")," ",(0,eh.jsx)("button",{type:"button",className:"memori--login-modal--edit-link",onClick:()=>{M&&k1.test(M)&&ei(M,!0)},disabled:S||F||!M,children:F?m("login.resending"):m("login.resendOtp")})]})})]}),ef=(0,eh.jsxs)("div",{className:"memori--login-modal--step memori--login-modal--logging-in",role:"status","aria-live":"polite",children:[(0,eh.jsx)("span",{className:"memori--login-modal--spinner","aria-hidden":"true"}),(0,eh.jsx)("p",{className:"memori--login-modal--logging-in-text",children:m("login.loggingIn")})]}),eg=(0,eh.jsxs)("div",{className:"memori--login-modal--missing-data",children:[(0,eh.jsx)("p",{className:"memori--login-modal--missing-helper",children:m("login.missingDataHelper")}),(0,eh.jsxs)(xD,{name:"updateMissingData",className:"memori--login-modal--form memori--login-modal--form--missing",onSubmit:eo,children:[(0,eh.jsxs)("div",{className:"memori--login-modal--form-body",children:[en.birthDate&&(0,eh.jsxs)(xN,{className:"memori--login-modal--field",children:[(0,eh.jsx)(xR,{htmlFor:"birthDate",children:m("login.birthDate")}),(0,eh.jsx)(xM,{id:"birthDate",name:"birthDate",type:!J||V||q?"date":"text",required:!0,onChange:e=>W(e.target.value),value:V,placeholder:J?m("login.birthDatePlaceholder")||"DD/MM/YYYY":void 0,onFocus:()=>$(!0),onBlur:()=>$(!1),autoComplete:"bday"}),(0,eh.jsx)(xO,{children:m("login.birthDateHelper")})]}),(null==en?void 0:en.tnCAndPPAccepted)&&(0,eh.jsxs)("div",{className:"memori--login-modal--consent-block",children:[(0,eh.jsx)(bq,{name:"tnCAndPPAccepted",className:"memori-login-modal--consent",checked:Y,onChange:e=>X(e),label:(0,eh.jsxs)(eh.Fragment,{children:[m("login.privacyLabel")," ",(0,eh.jsx)("a",{href:`https://memori.ai/${v}/privacy_and_cookie`,target:"_blank",rel:"noopener noreferrer",children:m("login.privacyAndCookiePolicy")})," ",m("login.and")," ",(0,eh.jsx)("a",{href:`https://memori.ai/${v}/tos`,target:"_blank",rel:"noopener noreferrer",children:m("login.termsOfService")})]})}),(0,eh.jsx)(bq,{name:"pAndCUAccepted",className:"memori-login-modal--consent",checked:Z,onChange:e=>Q(e),label:(0,eh.jsxs)(eh.Fragment,{children:[m("login.pAndCUAccepted")," ",(0,eh.jsx)("small",{children:(0,eh.jsxs)("em",{children:["(",m("login.optional"),")"]})})]})}),(0,eh.jsx)("p",{className:"memori--login-modal--consent-note",children:m("login.goToAccountToChangeYourPreferences")}),(0,eh.jsx)("p",{className:"memori--login-modal--consent-note memori--login-modal--deep-thought",children:m("login.deepThoughtExplaination")})]}),A&&(0,eh.jsx)("p",{className:"memori--login-modal--inline-error",children:A})]}),(0,eh.jsx)("div",{className:"memori--login-modal--form-footer",children:(0,eh.jsx)(yt,{type:"submit",variant:"primary",className:"memori--login-modal--primary",loading:S,children:m("login.save")})})]})]});return(0,eh.jsx)(__,{open:e,onClose:t,onOpenChange:e=>{e||t()},className:(b(tT))("memori--login-modal",{"memori--login-modal--missing":ec},c),contentClassName:"memori--login-modal--content",titleClassName:"memori--login-modal--title",title:ec?m("login.missingData"):el,size:"sm",width:ec?"480px":"420px",widthMd:ec?"480px":"420px",centered:!0,closable:!0,children:j?ef:ec?eg:P?ep:ed})},em=ec("85Hg2");let Jd=wv("Expand",[["path",{d:"m21 21-6-6m6 6v-4.8m0 4.8h-4.8",key:"1c15vz"}],["path",{d:"M3 16.2V21m0 0h4.8M3 21l6-6",key:"1fsnz2"}],["path",{d:"M21 7.8V3m0 0h-4.8M21 3l-6 6",key:"hawz9i"}],["path",{d:"M3 7.8V3m0 0h4.8M3 3l6 6",key:"u9ee12"}]]);var em=ec("85Hg2");let Jh=wv("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]),Jp=wv("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),Jm=e=>{if("number"==typeof e&&Number.isFinite(e))return e;if(e&&"object"==typeof e){if("number"==typeof e.parsedValue&&Number.isFinite(e.parsedValue))return e.parsedValue;if("string"==typeof e.source){let t=Number(e.source);if(Number.isFinite(t))return t}}},Jf=(e,t)=>new Intl.NumberFormat(t,{minimumFractionDigits:0,maximumFractionDigits:Math.abs(e)>=1?3:4}).format(e),Jg=(e,t,n)=>{let r=Math.abs(e);if("energy"===t){if(r>=1)return`${Jf(e,n)} kWh`;let t=1e3*e;return Math.abs(t)>=1?`${Jf(t,n)} Wh`:`${Jf(1e3*t,n)} mWh`}if("co2"===t){if(r>=1)return`${Jf(e,n)} kg`;let t=1e3*e;return Math.abs(t)>=1?`${Jf(t,n)} g`:`${Jf(1e3*t,n)} mg`}if(r>=1)return`${Jf(e,n)} L`;let i=1e3*e;return Math.abs(i)>=1?`${Jf(i,n)} mL`:`${Jf(1e3*i,n)} \u{3BC}L`},Jv=e=>e.some(e=>!!e.llmUsage),Jy=e=>e.filter(e=>{let t=e.key.toLowerCase(),n=e.title.toLowerCase(),r="knownFacts"===e.view,i=t.includes("audio")||n.includes("audio")||n.includes("sound");return!r&&!i}),Jb=({actions:e,loginToken:t,showChatHistory:n=!1,onChatHistoryOpen:r,showKnownFacts:i=!1,showMessageConsumption:a=!1,history:o=[],isLoggedIn:s=!1,showLogin:l=!1,aiUsageTitle:u})=>{let{t:c}=tA();return(0,em.useMemo)(()=>{let d=[];n&&t&&d.push({key:"chatHistory",icon:(0,eh.jsx)($t,{size:18}),title:c("write_and_speak.chatHistory")||"Chat history",onClick:r}),a&&d.push({key:"aiUsage",icon:(0,eh.jsx)($0,{}),title:u||c("widget.aiConsumption")||"AI usage",view:"aiUsage",disabled:!Jv(o)}),d.push(...Jy(e));let h=l||s&&i;return{hasContent:d.length>0||h,directAction:l||s||1!==d.length?void 0:d[0]}},[e,t,n,r,i,a,o,s,l,u,c])},J_=({entries:{hasContent:e,directAction:t},open:n,onToggle:r})=>{let{t:i}=tA();if(!e)return null;if(t){let e=!!t.view;return(0,eh.jsx)(_H,{title:t.title,placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{className:"memori-chat-layout--overflow-trigger",active:e&&n,"aria-label":t.title,icon:t.icon,disabled:t.disabled,onClick:e?r:t.onClick})})})}return(0,eh.jsx)(Gc,{className:"memori-chat-layout--overflow-trigger",active:n,"aria-label":i("widget.moreActions")||"More actions",icon:(0,eh.jsx)(H3,{}),onClick:r})};var Jx=({open:e,onClose:t,presentation:n="sheet",title:r,loginToken:i,userName:a,user:o,apiClient:s,userEmail:l,birthDate:u,avatarURL:c,actions:d,logoutLabel:h="Log out",onLogout:p,onKnownFactsOpen:m,onLocationEnable:f,onLocationDisable:g,knownFactsPageTitle:v="Known facts",sharePageTitle:y="Share",locationPageTitle:b="Location tracking",backLabel:_="Back",locationStatusLabel:x="Status",locationPlace:w,locationUnknownLabel:S="Unknown position",locationEnableLabel:E="Use current position",locationDisableLabel:A="Disable location sharing",knownFactsDescription:T,knownFactsCtaLabel:I="Open full known facts",knownFactsCountLabel:C,shareContent:M,knownFactsDisabled:N=!1,knownFactsHint:R,showKnownFacts:O=!1,showChatHistory:P=!1,onChatHistoryOpen:k,history:D=[],aiUsageTitle:B,showMessageConsumption:F=!1,isLoggedIn:U=!1,showLogin:j=!1,loginLabel:z="Log in",onLogin:H,venue:G,setVenue:V,initialView:W="session",autoStartGeolocation:q=!1})=>{let $=j&&U,J=(0,em.useRef)(null),K="mobile-session-panel-title",Y=(0,em.useRef)(0),[X,Z]=(0,em.useState)(0),[Q,ee]=(0,em.useState)("session"),{uploadAsset:et,pwlUpdateUser:en}=(null==s?void 0:s.backend)||{},{add:er}=vZ(),{t:ei,i18n:ea}=tA(),eo=ea.language||navigator.language||"en",es=(0,em.useMemo)(()=>{let e={energy:0,gwp:0,wcf:0};return D.forEach(t=>{var n,r,i,a;let o=null==(n=t.llmUsage)?void 0:n.energyImpact;o&&(e.energy+=null!=(r=Jm(o.energy))?r:0,e.gwp+=null!=(i=Jm(o.gwp))?i:0,e.wcf+=null!=(a=Jm(o.wcf))?a:0)}),e},[D]),el=(0,em.useMemo)(()=>D.some(e=>{var t;return!!(null==(t=e.llmUsage)?void 0:t.energyImpact)}),[D]),eu=(0,em.useMemo)(()=>Jv(D),[D]),{directAction:ec}=Jb({actions:d,loginToken:i,showChatHistory:P,onChatHistoryOpen:k,showKnownFacts:O,showMessageConsumption:F,history:D,isLoggedIn:U,showLogin:j,aiUsageTitle:B}),ed=(null==ec?void 0:ec.view)!==Q,ep=el?`${Jg(es.energy,"energy",eo)} \u{2022} ${Jg(es.gwp,"co2",eo)}`:ei("widget.noData",{defaultValue:"Nessun dato disponibile"}),ef=R||ei("widget.knownFactsHint")||"What I remember about you",eg=B||ei("widget.aiConsumption")||"AI usage",ev=ei("write_and_speak.chatHistory")||"Chat history",ey=ei("write_and_speak.chatHistoryDescription")||"Show chat history with this agent";(0,em.useEffect)(()=>{e&&ee(W)},[e,W]);let eb=async e=>{if(!et||!en)return void er(v9({description:ei("login.avatarUploadError"),severity:"error"}));if(e&&i){let t=new FileReader;t.onload=async t=>{var n,r,a,s;try{let{asset:l,...u}=await et(null!=(n=e.name)?n:"avatar",null==(r=t.target)?void 0:r.result,null!=i?i:"");if(0!==u.resultCode)console.error("[updateAvatar] Upload failed:",u),er(v9({description:ei(Lx(u.resultCode)),severity:"error"}));else if(l){let e={userID:null!=(a=null==o?void 0:o.userID)?a:"",avatarURL:l.assetURL},{...t}=await en(null!=i?i:"",null!=(s=null==o?void 0:o.userID)?s:"",e);0!==t.resultCode?er(v9({description:ei(Lx(t.resultCode)),severity:"error"})):er(v9({description:ei("login.avatarUploadSuccess"),severity:"success"}))}}catch(e){console.error("[updateAvatar] Error:",e),(null==e?void 0:e.message)&&er(v9({description:e.message,severity:"error"}))}},t.readAsDataURL(e)}else console.error("[updateAvatar] Missing avatar or login token",{avatar:e,loginToken:i}),er(v9({description:ei("login.avatarUploadError"),severity:"error"}))},e_="popover"===n,ex=!!(w&&w.trim().length>0&&w!==S),ew=Jy(d),eS=(0,eh.jsxs)("section",{ref:J,tabIndex:-1,className:`memori-mobile-session-panel ${e_?"memori-mobile-session-panel--popover":""}`,role:e_?"dialog":void 0,"aria-modal":!!e_||void 0,"aria-labelledby":K,onClick:e=>e.stopPropagation(),onTouchStart:e_?void 0:e=>{Y.current=e.touches[0].clientY,Z(0)},onTouchMove:e_?void 0:e=>{var t;let n=null==(t=J.current)?void 0:t.closest(".memori-drawer__body");if(n instanceof HTMLElement&&n.scrollTop>0)return;let r=e.touches[0].clientY-Y.current;r>0&&Z(r)},onTouchEnd:e_?void 0:()=>{X>90&&t(),Z(0)},style:{transform:X?`translateY(${X}px)`:void 0},children:[!e_&&(0,eh.jsx)("div",{className:"memori-mobile-session-panel--handle"}),"session"===Q?(0,eh.jsxs)(eh.Fragment,{children:[$&&(0,eh.jsxs)("div",{className:"memori-mobile-session-panel--user",children:[(0,eh.jsx)("div",{className:"memori-dropdown--avatar-wrap",children:c?(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("img",{src:c,alt:a||l,className:"memori-dropdown--avatar"}),(0,eh.jsx)("span",{className:"memori-dropdown--avatar-overlay","aria-hidden":!0,children:(0,eh.jsx)($n,{size:20,strokeWidth:2})}),(0,eh.jsx)("label",{htmlFor:"mobile-session-avatar-upload",className:"sr-only",children:ei("login.changeAvatar",{defaultValue:"Change profile picture"})}),(0,eh.jsx)("input",{type:"file",name:"avatar",id:"mobile-session-avatar-upload",className:"memori-dropdown--avatar-input",onChange:e=>{var t,n;return eb(null!=(n=null==(t=e.target.files)?void 0:t[0])?n:null)},accept:Li.join(", ")})]}):(0,eh.jsx)(eh.Fragment,{children:(0,eh.jsxs)("div",{className:"memori-dropdown--avatar-placeholder",children:[(0,eh.jsx)("span",{className:"memori-dropdown--avatar-initial",children:(a||l||"U").charAt(0).toUpperCase()}),(0,eh.jsx)("span",{className:"memori-dropdown--avatar-overlay","aria-hidden":!0,children:(0,eh.jsx)($n,{size:20,strokeWidth:2})}),(0,eh.jsx)("label",{htmlFor:"mobile-session-avatar-upload-placeholder",className:"sr-only",children:ei("login.changeAvatar",{defaultValue:"Change profile picture"})}),(0,eh.jsx)("input",{type:"file",name:"avatar",id:"mobile-session-avatar-upload-placeholder",className:"memori-dropdown--avatar-input",onChange:e=>{var t,n;return eb(null!=(n=null==(t=e.target.files)?void 0:t[0])?n:null)},accept:Li.join(", ")})]})})}),(0,eh.jsxs)("div",{className:"memori-dropdown--user-details",children:[(0,eh.jsx)("h3",{className:"memori-dropdown--user-name",children:a}),(0,eh.jsx)("p",{className:"memori-dropdown--user-email",children:l}),(0,eh.jsx)("div",{className:"memori-dropdown--user-badge",children:u?new Date(u).toLocaleDateString():"Not set"})]})]}),(0,eh.jsx)("h2",{id:K,className:"memori-mobile-session-panel--section-title",children:r}),(U&&O||F)&&(0,eh.jsxs)("ul",{className:"memori-mobile-session-panel--actions memori-mobile-session-panel--session-info",children:[U&&O&&(0,eh.jsx)("li",{children:(0,eh.jsxs)(yt,{variant:"toolbar",size:"sm",className:"memori-mobile-session-panel--action",disabled:N,onClick:()=>{N||null==m||m()},children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-icon",children:(0,eh.jsx)($u,{size:18})}),(0,eh.jsxs)("span",{className:"memori-mobile-session-panel--action-copy",children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-title",children:v}),(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-subtitle",children:ef})]})]})}),F&&(0,eh.jsx)("li",{children:(0,eh.jsxs)(yt,{variant:"toolbar",size:"sm",className:"memori-mobile-session-panel--action",disabled:!eu,onClick:()=>{eu&&ee("aiUsage")},children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-icon",children:(0,eh.jsx)($0,{})}),(0,eh.jsxs)("span",{className:"memori-mobile-session-panel--action-copy",children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-title",children:eg}),(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-subtitle",children:ep})]}),(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-trailing",children:(0,eh.jsx)(HM,{size:16})})]})})]}),(0,eh.jsxs)("ul",{className:"memori-mobile-session-panel--actions",children:[P&&!!i&&(0,eh.jsx)("li",{children:(0,eh.jsxs)(yt,{variant:"toolbar",size:"sm",className:"memori-mobile-session-panel--action memori-mobile-session-panel--chat-history",onClick:()=>null==k?void 0:k(),children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-icon",children:(0,eh.jsx)($t,{size:18})}),(0,eh.jsxs)("span",{className:"memori-mobile-session-panel--action-copy",children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-title",children:ev}),(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-subtitle",children:ey})]})]})}),ew.map(e=>{let t,n,r;return(0,eh.jsx)("li",{children:(t="knownFacts"===e.view,n="share"===e.view,r=e.disabled||t&&!U,(0,eh.jsxs)(yt,{variant:"toolbar",size:"sm",className:"memori-mobile-session-panel--action",disabled:r,onClick:()=>{var t;if(!r){if("knownFacts"===e.view&&m)return void m();if(e.view)return void ee(e.view);null==(t=e.onClick)||t.call(e)}},children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-icon",children:e.icon}),(0,eh.jsxs)("span",{className:"memori-mobile-session-panel--action-copy",children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-title",children:e.title}),e.subtitle&&(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-subtitle",children:e.subtitle})]}),(n||"location"===e.view)&&(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-trailing",children:(0,eh.jsx)(HM,{size:16})})]}))},e.key)})]}),$&&(0,eh.jsxs)(yt,{variant:"toolbar",size:"sm",shape:"default",className:"memori-mobile-session-panel--logout",onClick:p,children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-icon",children:(0,eh.jsx)($r,{size:18})}),(0,eh.jsx)("span",{className:"memori-mobile-session-panel--logout-label",children:h})]}),j&&!U&&(0,eh.jsx)("div",{className:"memori-mobile-session-panel--login-cta-wrap",children:(0,eh.jsxs)(yt,{variant:"toolbar",size:"sm",className:"memori-mobile-session-panel--login-cta",onClick:H,children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-icon",children:(0,eh.jsx)(Jh,{size:18})}),z]})})]}):(0,eh.jsxs)("div",{className:"memori-mobile-session-panel--page",children:[(0,eh.jsxs)("div",{className:"memori-mobile-session-panel--page-header",children:[ed&&(0,eh.jsxs)(yt,{variant:"toolbar",size:"sm",className:"memori-mobile-session-panel--back",onClick:()=>ee("session"),children:[(0,eh.jsx)(Jp,{size:16}),_]}),(0,eh.jsx)("h3",{className:"memori-mobile-session-panel--page-title",children:"location"===Q?b:"share"===Q?y:"aiUsage"===Q?eg:v})]}),"location"===Q?(0,eh.jsx)("div",{className:"memori-mobile-session-panel--page-content memori-mobile-session-panel--location-content",children:V?(0,eh.jsx)($Z,{venue:G,setVenue:V,autoStartGeolocation:q}):(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("p",{className:"memori-mobile-session-panel--meta-label",children:x}),(0,eh.jsx)("p",{className:"memori-mobile-session-panel--meta-value",children:w||S}),(0,eh.jsxs)("div",{className:"memori-mobile-session-panel--page-actions",children:[(0,eh.jsx)(yt,{variant:"toolbar",size:"sm",className:`memori-mobile-session-panel--page-btn ${ex?"memori-mobile-session-panel--page-btn-active":""}`,onClick:f,children:(0,eh.jsx)("span",{children:E})}),(0,eh.jsx)(yt,{variant:"toolbar",size:"sm",className:"memori-mobile-session-panel--page-btn memori-mobile-session-panel--page-btn-secondary",onClick:g,children:A})]})]})}):"share"===Q?(0,eh.jsx)("div",{className:"memori-mobile-session-panel--page-content memori-mobile-session-panel--share-content",children:M}):"aiUsage"===Q?(0,eh.jsx)("div",{className:"memori-mobile-session-panel--page-content memori-mobile-session-panel--ai-usage-content",children:(0,eh.jsx)($5,{history:D,showTitle:!1,className:"memori-mobile-session-panel--ai-usage"})}):(0,eh.jsxs)("div",{className:"memori-mobile-session-panel--page-content",children:[T&&(0,eh.jsx)("p",{className:"memori-mobile-session-panel--known-facts-description",children:T}),C&&(0,eh.jsx)("p",{className:"memori-mobile-session-panel--known-facts-count",children:C}),(0,eh.jsx)(yt,{variant:"toolbar",size:"sm",className:"memori-mobile-session-panel--page-btn",disabled:N,onClick:m,children:I})]})]})]});return e_?e?(0,eh.jsx)("div",{className:"memori-mobile-session-panel--overlay memori-mobile-session-panel--overlay-popover",role:"presentation",children:eS}):null:(0,eh.jsx)(xf,{open:e,onClose:t,anchor:"bottom",size:"lg",className:"memori-mobile-session-panel-drawer",closable:!1,children:eS})},em=ec("85Hg2");function Jw(e){var t;let{t:n}=tA(),[r,i]=(0,em.useState)(!1),[a,o]=(0,em.useState)(720),[s,l]=(0,em.useState)(!1),u=(0,em.useRef)(null);(0,em.useEffect)(()=>{let e=window.matchMedia("(max-width: 1199px)"),t=()=>i(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let c=(0,em.useCallback)(e=>{var t;let n;return(n=Math.max(0,((null==(t=u.current)?void 0:t.getBoundingClientRect().width)||window.innerWidth)-400*!r))<=460?n:Math.min(Math.max(e,460),n)},[r]);(0,em.useEffect)(()=>{e&&o(e=>c(e))},[e,r,c]);let d=(0,em.useCallback)(e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),l(!0)},[]),h=(0,em.useCallback)(e=>{if(!s)return;let t=u.current;t&&o(c(t.getBoundingClientRect().right-e.clientX))},[c,s]),p=(0,em.useCallback)(()=>{l(!1)},[]),m=(0,em.useCallback)(e=>{let t=e.shiftKey?40:16;"ArrowLeft"===e.key?(e.preventDefault(),o(e=>c(e+t))):"ArrowRight"===e.key?(e.preventDefault(),o(e=>c(e-t))):"Home"===e.key?(e.preventDefault(),o(e=>c(e+200))):"End"===e.key&&(e.preventDefault(),o(e=>c(e-200)))},[c]),f=e?{"--memori-artifact-column-width":`${a}px`}:void 0,g={role:"separator","aria-orientation":"vertical","aria-label":n("artifact.resizeHandle")||"Resize artifact panel","aria-valuemin":460,"aria-valuemax":Math.round((null==(t=u.current)?void 0:t.getBoundingClientRect().width)||0)||void 0,"aria-valuenow":Math.round(a),tabIndex:0,onPointerDown:d,onPointerMove:h,onPointerUp:p,onPointerCancel:p,onKeyDown:m};return{contentRowRef:u,isArtifactOverlay:r,isResizingArtifact:s,columnWidthStyle:f,resizeHandleProps:g}}var JS=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:a,StartPanel:o,startPanelProps:s,integrationStyle:l,integrationBackground:u,sessionId:c,hasUserActivatedSpeak:d,loading:h=!1,poweredBy:p})=>{var m,f,g,v,y,b,_,x,w;let{t:S}=tA(),{state:E}=e9();E.currentArtifact;let A=E.isDrawerOpen&&!E.isChatLogPanelPresentation,[T,I]=(0,em.useState)(!1),[C,M]=(0,em.useState)(!1),{contentRowRef:N,isArtifactOverlay:R,isResizingArtifact:O,columnWidthStyle:P,resizeHandleProps:k}=Jw(A);(0,em.useEffect)(()=>{let e=window.matchMedia("(max-width: 768px)"),t=()=>I(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let D=null==t?void 0:t.memori;null==t||t.tenant,null==t||t.baseUrl;let B=(null==t?void 0:t.loginToken)&&(null==(m=null==t?void 0:t.user)?void 0:m.userID)?t.user:void 0,F=[null==B?void 0:B.name,null==B?void 0:B.surname].filter(Boolean).join(" ").trim()||(null==B?void 0:B.userName)||(null==B?void 0:B.eMail)||(null==D?void 0:D.name)||"User",U=F.charAt(0).toUpperCase(),j=!!(c&&d),z=(0,em.useMemo)(()=>(null==a?void 0:a.isPlayingAudio)?{key:"speaking",label:S("widget.agentStatusSpeaking",{defaultValue:"sta parlando"})}:(null==a?void 0:a.memoriTyping)?{key:"processing",label:S("widget.agentStatusProcessing",{defaultValue:"in elaborazione"})}:(null==a?void 0:a.listening)?{key:"listening",label:S("widget.agentStatusListening",{defaultValue:"in ascolto"})}:null,[null==a?void 0:a.isPlayingAudio,null==a?void 0:a.memoriTyping,null==a?void 0:a.listening,S]),H=(0,em.useCallback)(()=>{if(function(){if("u"<typeof document)return!1;if(!0===document.fullscreenEnabled)return!0;let e=document.querySelector('meta[name="memori-fullscreen-enabled"], meta[name="fullscreen-enabled"]');return(null==e?void 0:e.getAttribute("content"))==="true"}()){if(!document.fullscreenElement)return void document.documentElement.requestFullscreen().catch(()=>{});document.exitFullscreen().catch(()=>{})}},[]),G=(0,em.useMemo)(()=>{if(t)return T?{...t,showReload:!1,showClear:!1,showSettings:!1,showShare:!1,showLogin:!1,showFullscreen:!1,showMessageConsumption:!1,memori:{...t.memori,needsPosition:!1,enableDeepThought:!1},showChatHistory:!1}:t},[t,T]),V=(0,em.useMemo)(()=>{var e,n;if(!t)return[];let r=T&&!!t.loginToken&&!1!==t.showChatHistory,i=!T&&!1!==t.showFullscreen,a=!1!==t.showShare,o=!!(null==(e=t.memori)?void 0:e.needsPosition);return[...r?[{key:"chatHistory",icon:(0,eh.jsx)($t,{size:18}),title:S("widget.headerHistory")||S("write_and_speak.chatHistory")||"Chat history",onClick:()=>{t.setShowChatHistoryDrawer(!0),M(!1)}}]:[],...i?[{key:"fullscreen",icon:(0,eh.jsx)(Jd,{size:18}),title:S("fullscreenEnter")||"Full screen",subtitle:S("widget.expandToImmersive")||"Expand to immersive view",onClick:()=>{H(),M(!1)}}]:[],...a?[{key:"share",icon:(0,eh.jsx)($h,{size:18}),title:S("widget.share")||"Share chat",subtitle:S("widget.mobileSession.copyLinkOrDownload")||"Copy link or download",view:"share"}]:[],...o?[{key:"location",icon:(0,eh.jsx)(VS,{size:18}),title:S("widget.mobileSession.locationTracking")||"Location tracking",subtitle:(null==(n=t.position)?void 0:n.placeName)||S("widget.mobileSession.currentlyOff")||"Currently off",view:"location",trailing:(0,eh.jsx)("span",{className:"memori-mobile-session-panel--chevron",children:">"})}]:[]]},[t,T,j,S,H]),W=!!(null==(f=null==t?void 0:t.memori)?void 0:f.enableDeepThought)&&!!(null==t?void 0:t.loginToken)&&!!(null==(g=null==t?void 0:t.user)?void 0:g.pAndCUAccepted),q=Jb({actions:V,loginToken:null==t?void 0:t.loginToken,showKnownFacts:W,showMessageConsumption:!!(null==t?void 0:t.showMessageConsumption),history:null==t?void 0:t.history,isLoggedIn:!!B,showLogin:!!(null==t?void 0:t.showLogin)});return(0,eh.jsxs)(eh.Fragment,{children:[l,u,(0,eh.jsxs)(bV,{spinning:!!(h&&j),children:[e&&t&&G&&(0,eh.jsx)("div",{className:"memori-fullpage-top-header",children:(0,eh.jsx)("div",{className:"memori-chat-layout--header",children:(0,eh.jsx)("div",{className:"memori-fullpage-header-row",children:(0,eh.jsx)(e,{...G,layout:"FULLPAGE",buttonVariant:"outline",extraActions:T?(0,eh.jsx)(J_,{entries:q,open:C,onToggle:()=>M(e=>!e)}):void 0})})})}),t&&(0,eh.jsx)(Jx,{open:C,presentation:"popover",onClose:()=>M(!1),initialView:null!=(y=null==(v=q.directAction)?void 0:v.view)?y:"session",title:S("widget.mobileSession.session")||"Session",loginToken:t.loginToken,user:t.user,apiClient:t.apiClient,userName:F,userEmail:null==B?void 0:B.eMail,userInitial:U,avatarURL:null==B?void 0:B.avatarURL,birthDate:null==B?void 0:B.birthDate,actions:V,knownFactsPageTitle:S("knownFacts.title")||"Known facts",sharePageTitle:S("widget.share")||"Share",locationPageTitle:S("widget.mobileSession.locationTracking")||"Location tracking",backLabel:S("back")||"Back",locationStatusLabel:S("widget.mobileSession.locationStatus")||"Status",locationPlace:null==(b=t.position)?void 0:b.placeName,locationUnknownLabel:S("write_and_speak.unknownPosition")||"Unknown position",locationEnableLabel:S("widget.shareLocation")||"Share location",locationDisableLabel:S("widget.mobileSession.disableLocationSharing")||"Disable location sharing",knownFactsDescription:S("knownFacts.description",{memoriName:(null==D?void 0:D.name)||""})||"",knownFactsCtaLabel:S("widget.mobileSession.openKnownFacts")||"Open full known facts",knownFactsCountLabel:S("widget.mobileSession.knownFactsMessages",{count:(null==(_=t.history)?void 0:_.length)||0})||"",shareContent:(0,eh.jsx)($C,{tenant:null==t?void 0:t.tenant,memori:null==t?void 0:t.memori,sessionID:null==t?void 0:t.sessionID,title:null==(x=null==t?void 0:t.memori)?void 0:x.name,baseUrl:null==t?void 0:t.baseUrl,align:"left",history:null==t?void 0:t.history,renderMode:"inline"}),knownFactsDisabled:!j,showKnownFacts:W,showMessageConsumption:!!t.showMessageConsumption,history:null!=(w=t.history)?w:[],isLoggedIn:!!B,showLogin:!!t.showLogin,loginLabel:S("login.login")||"Log in",onLogin:()=>{t.setShowLoginDrawer(!0),M(!1)},onKnownFactsOpen:()=>{j&&(t.setShowKnownFactsDrawer(!0),M(!1))},onLocationEnable:()=>{if(t){if(!navigator.geolocation)return void t.setPositionPopoverOpen(!0);navigator.geolocation.getCurrentPosition(e=>{let n=e.coords.latitude,r=e.coords.longitude;t.setVenue({latitude:n,longitude:r,placeName:`${n.toFixed(5)}, ${r.toFixed(5)}`,uncertainty:e.coords.accuracy/1e3})},()=>{t.setPositionPopoverOpen(!0)},{enableHighAccuracy:!0,timeout:15e3,maximumAge:0})}},onLocationDisable:()=>{null==t||t.setVenue({latitude:0,longitude:0,placeName:"",uncertainty:0})},venue:t.position,setVenue:t.setVenue,logoutLabel:S("login.logout")||"Log out",onLogout:()=>{(()=>{if(t){if(B&&t.onLogout)return t.onLogout();t.setShowLoginDrawer(!0)}})(),M(!1)}}),(0,eh.jsxs)("div",{ref:N,className:`memori-fullpage-content-row${A&&R?" memori-fullpage-content-row--artifact-overlay":""}${O?" memori-fullpage-content-row--resizing":""}`,style:P,children:[(0,eh.jsxs)("div",{className:"memori--grid",children:[(0,eh.jsxs)("div",{className:"memori--grid-column memori--grid-column-left",hidden:A,children:[j&&z&&(0,eh.jsxs)("div",{className:"memori-fullpage-agent-status",role:"status","aria-live":"polite",children:[(0,eh.jsx)("span",{className:`memori-fullpage-agent-status--dot memori-fullpage-agent-status--dot-${z.key}`,"aria-hidden":"true"}),(0,eh.jsx)("span",{className:"memori-fullpage-agent-status--label",children:z.label})]}),n&&r&&(0,eh.jsx)(n,{chatProps:a,...r}),(0,eh.jsx)("div",{id:"extension"})]}),(0,eh.jsx)("div",{className:"memori-chat-layout--main",children:(0,eh.jsx)("div",{className:E.isFullscreen?"memori-chat-layout-controls-hide":"memori-chat-layout--controls",children:c&&d&&i&&a?(0,eh.jsx)(i,{...a,footerBrand:p,showAiGeneratedNote:!0}):s?(0,eh.jsx)("div",{className:"memori-conversation-column",children:(0,eh.jsx)(o,{...s,footerBrand:p})}):null})})]}),(0,eh.jsx)("div",{className:`memori--grid-column-artifact${A?" memori--grid-column-artifact--open":""}`,children:A&&(0,eh.jsxs)(eh.Fragment,{children:[!T&&(0,eh.jsx)("div",{className:"memori-artifact-resize-handle",...k}),(0,eh.jsx)(Gh,{isLayoutColumn:!0})]})})]})]})]})},JE=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:a,StartPanel:o,startPanelProps:s,integrationStyle:l,integrationBackground:u,sessionId:c,hasUserActivatedSpeak:d,loading:h=!1,poweredBy:p,totemContentMaxWidth:m})=>{let f=null!=m?{"--memori-totem-max-width":"number"==typeof m?`${m}px`:m}:void 0;return(0,eh.jsxs)(eh.Fragment,{children:[l,u,(0,eh.jsxs)(bV,{spinning:!!(h&&c&&d),className:"memori-totem-layout",style:f,children:[p,(0,eh.jsx)("div",{className:"memori-totem-layout--header",children:e&&t&&(0,eh.jsx)(e,{buttonVariant:"outline",...t})}),(0,eh.jsx)("div",{className:"memori-totem-layout--avatar",children:n&&r&&(0,eh.jsx)(n,{chatProps:a,...r,isTotem:!0})}),(0,eh.jsx)("div",{id:"extension"}),(0,eh.jsx)("div",{className:"memori-totem-layout--controls",children:c&&d&&i&&a?(0,eh.jsx)(i,{...a}):s?(0,eh.jsx)(o,{...s}):null})]})]})},em=ec("85Hg2"),JA=({Header:e,headerProps:t,Chat:n,chatProps:r,StartPanel:i,startPanelProps:a,integrationStyle:o,integrationBackground:s,sessionId:l,hasUserActivatedSpeak:u,loading:c=!1,poweredBy:d})=>{var h,p,m,f,g,v,y,b,_,x;let{t:w}=tA(),{state:S}=e9(),E=S.isDrawerOpen&&!S.isChatLogPanelPresentation,[A,T]=(0,em.useState)(!1),[I,C]=(0,em.useState)(!1),{contentRowRef:M,isResizingArtifact:N,columnWidthStyle:R,resizeHandleProps:O}=Jw(E);(0,em.useEffect)(()=>{let e=window.matchMedia("(max-width: 768px)"),t=()=>T(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let P=null==r?void 0:r.globalBackground,k=null==t?void 0:t.memori;null==t||t.tenant,null==t||t.baseUrl;let D=(null==t?void 0:t.loginToken)&&(null==(h=null==t?void 0:t.user)?void 0:h.userID)?t.user:void 0,B=[null==D?void 0:D.name,null==D?void 0:D.surname].filter(Boolean).join(" ").trim()||(null==D?void 0:D.userName)||(null==D?void 0:D.eMail)||(null==k?void 0:k.name)||"User",F=B.charAt(0).toUpperCase(),U=!!(l&&u),j=(0,em.useMemo)(()=>{if(t)return A?{...t,showReload:!1,showClear:!1,showSettings:!1,showShare:!1,showLogin:!1,showFullscreen:!1,showMessageConsumption:!1,memori:{...t.memori,needsPosition:!1,enableDeepThought:!1},showChatHistory:!1}:t},[t,A]),z=(0,em.useMemo)(()=>{var e,n;if(!t)return[];let r=A&&!!t.loginToken&&!1!==t.showChatHistory,i=!1!==t.showShare,a=!!(null==(e=t.memori)?void 0:e.needsPosition);return[...r?[{key:"chatHistory",icon:(0,eh.jsx)($t,{size:18}),title:w("widget.headerHistory")||w("write_and_speak.chatHistory")||"Chat history",onClick:()=>{t.setShowChatHistoryDrawer(!0),C(!1)}}]:[],...i?[{key:"share",icon:(0,eh.jsx)($h,{size:18}),title:w("widget.share")||"Share chat",subtitle:w("widget.mobileSession.copyLinkOrDownload")||"Copy link or download",view:"share"}]:[],...a?[{key:"location",icon:(0,eh.jsx)(VS,{size:18}),title:w("widget.mobileSession.locationTracking")||"Location tracking",subtitle:(null==(n=t.position)?void 0:n.placeName)||w("widget.mobileSession.currentlyOff")||"Currently off",view:"location",trailing:(0,eh.jsx)("span",{className:"memori-mobile-session-panel--chevron",children:">"})}]:[]]},[t,A,w]),H=!!(null==(p=null==t?void 0:t.memori)?void 0:p.enableDeepThought)&&!!(null==t?void 0:t.loginToken)&&!!(null==(m=null==t?void 0:t.user)?void 0:m.pAndCUAccepted),G=Jb({actions:z,loginToken:null==t?void 0:t.loginToken,showKnownFacts:H,showMessageConsumption:!!(null==t?void 0:t.showMessageConsumption),history:null==t?void 0:t.history,isLoggedIn:!!D,showLogin:!!(null==t?void 0:t.showLogin)});return(0,eh.jsxs)(eh.Fragment,{children:[o,s,(0,eh.jsxs)(bV,{spinning:!!(c&&U),className:"memori-chat-layout",children:[(0,eh.jsx)("div",{id:"extension"}),(0,eh.jsx)("div",{className:"memori-chat-layout--header",children:e&&t&&j&&(0,eh.jsx)("div",{className:"memori-fullpage-header-row",children:(0,eh.jsx)(e,{...j,buttonVariant:"outline",extraActions:A?(0,eh.jsx)(J_,{entries:G,open:I,onToggle:()=>C(e=>!e)}):void 0})})}),t&&(0,eh.jsx)(Jx,{open:I,presentation:"popover",onClose:()=>C(!1),initialView:null!=(g=null==(f=G.directAction)?void 0:f.view)?g:"session",title:w("widget.mobileSession.session")||"Session",loginToken:t.loginToken,user:t.user,apiClient:t.apiClient,userName:B,userEmail:null==D?void 0:D.eMail,userInitial:F,avatarURL:null==D?void 0:D.avatarURL,birthDate:null==D?void 0:D.birthDate,actions:z,knownFactsPageTitle:w("knownFacts.title")||"Known facts",sharePageTitle:w("widget.share")||"Share",locationPageTitle:w("widget.mobileSession.locationTracking")||"Location tracking",backLabel:w("back")||"Back",locationStatusLabel:w("widget.mobileSession.locationStatus")||"Status",locationPlace:null==(v=t.position)?void 0:v.placeName,locationUnknownLabel:w("write_and_speak.unknownPosition")||"Unknown position",locationEnableLabel:w("widget.shareLocation")||"Share location",locationDisableLabel:w("widget.mobileSession.disableLocationSharing")||"Disable location sharing",knownFactsDescription:w("knownFacts.description",{memoriName:(null==k?void 0:k.name)||""})||"",knownFactsCtaLabel:w("widget.mobileSession.openKnownFacts")||"Open full known facts",knownFactsCountLabel:w("widget.mobileSession.knownFactsMessages",{count:(null==(y=t.history)?void 0:y.length)||0})||"",shareContent:(0,eh.jsx)($C,{tenant:null==t?void 0:t.tenant,memori:null==t?void 0:t.memori,sessionID:null==t?void 0:t.sessionID,title:null==(b=null==t?void 0:t.memori)?void 0:b.name,baseUrl:null==t?void 0:t.baseUrl,align:"left",history:null==t?void 0:t.history,renderMode:"inline"}),knownFactsDisabled:!U,showKnownFacts:H,showMessageConsumption:!!t.showMessageConsumption,history:null!=(_=t.history)?_:[],isLoggedIn:!!D,showLogin:!!t.showLogin,loginLabel:w("login.login")||"Log in",onLogin:()=>{t.setShowLoginDrawer(!0),C(!1)},onKnownFactsOpen:()=>{U&&(t.setShowKnownFactsDrawer(!0),C(!1))},onLocationEnable:()=>{if(t){if(!navigator.geolocation)return void t.setPositionPopoverOpen(!0);navigator.geolocation.getCurrentPosition(e=>{let n=e.coords.latitude,r=e.coords.longitude;t.setVenue({latitude:n,longitude:r,placeName:`${n.toFixed(5)}, ${r.toFixed(5)}`,uncertainty:e.coords.accuracy/1e3})},()=>{t.setPositionPopoverOpen(!0)},{enableHighAccuracy:!0,timeout:15e3,maximumAge:0})}},onLocationDisable:()=>{null==t||t.setVenue({latitude:0,longitude:0,placeName:"",uncertainty:0})},venue:t.position,setVenue:t.setVenue,logoutLabel:w("login.logout")||"Log out",onLogout:()=>{(()=>{if(t){if(D&&t.onLogout)return t.onLogout();t.setShowLoginDrawer(!0)}})(),C(!1)}}),(0,eh.jsxs)("div",{ref:M,className:`memori-chat-layout--main${P?" memori-chat-layout--main--has-background":""}${N?" memori-chat-layout--main--resizing":""}`,style:{...P?{"--memori-chat-global-background":`url(${P})`}:{},...R},children:[(0,eh.jsx)("div",{className:S.isFullscreen?"memori-chat-layout-controls-hide":"memori-chat-layout--controls",children:(0,eh.jsxs)("div",{className:"memori-conversation-column",children:[(0,eh.jsx)("div",{className:"memori-chat-layout--body",children:l&&u&&n&&r?(0,eh.jsx)(n,{...r,showInputs:!1}):a?(0,eh.jsx)("div",{className:"memori-chat-layout--start-shell",id:"chat-wrapper",children:(0,eh.jsx)("div",{className:"memori-chat-layout--start-panel-wrap",children:(0,eh.jsx)(i,{...a})})}):null}),n&&r&&!1!==r.showInputs&&(0,eh.jsx)(Vo,{userMessage:r.userMessage,onChangeUserMessage:r.onChangeUserMessage,dialogState:r.dialogState,instruct:r.instruct,authToken:r.authToken,sendMessage:r.sendMessage,isTyping:r.memoriTyping,microphoneMode:r.microphoneMode,sendOnEnter:r.sendOnEnter,setSendOnEnter:r.setSendOnEnter,client:r.client,sessionID:U?r.sessionID:void 0,baseUrl:r.baseUrl,showUpload:r.showUpload,attachmentsMenuOpen:r.attachmentsMenuOpen,setAttachmentsMenuOpen:r.setAttachmentsMenuOpen,onTextareaFocus:()=>{var e;null==(e=r.stopListening)||e.call(r)},onTextareaBlur:()=>{},onTextareaExpanded:()=>{},startListening:r.startListening,stopListening:r.stopListening,audioStream:r.audioStream,transcribing:r.transcribing,stopAudio:r.stopAudio,listening:r.listening,isPlayingAudio:r.isPlayingAudio,showMicrophone:r.showMicrophone,memoriID:null==(x=r.memori)?void 0:x.memoriID,maxTextareaCharacters:r.maxTextareaCharacters,maxTotalMessagePayload:r.maxTotalMessagePayload,maxDocumentsPerMessage:kZ,maxDocumentContentLength:3e5,pasteAsCardLineThreshold:100,pasteAsCardCharThreshold:4200,showAiGeneratedNote:U,footerBrand:d})]})}),(0,eh.jsx)("div",{className:`memori--grid-column-artifact${E?" memori--grid-column-artifact--open":""}`,children:E&&(0,eh.jsxs)(eh.Fragment,{children:[!A&&(0,eh.jsx)("div",{className:"memori-artifact-resize-handle",...O}),(0,eh.jsx)(Gh,{isLayoutColumn:!0})]})})]})]})]})},em=ec("85Hg2");let JT="memori-widget--fullscreen";function JI(e){var t;return null!=(t=e.closest(".memori-widget"))?t:e}function JC(e,t){let n=JI(e);return n.classList.add(JT),"function"==typeof n.requestFullscreen&&n.requestFullscreen().catch(e=>{n.classList.remove(JT),null==t||t(e)}),n}function JM(e){JI(e).classList.remove(JT)}let JN="memori-website_assistant--fullscreen";var JR=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:a,StartPanel:o,startPanelProps:s,integrationStyle:l,sessionId:u,hasUserActivatedSpeak:c,loading:d=!1,show3dAvatar:h=!1,sideDrawerOpen:p=!1,onSidebarToggle:m})=>{var f,g,v,y,b,_,x,w;let{t:S}=tA(),{state:E}=e9(),A=E.isDrawerOpen&&!E.isChatLogPanelPresentation,T=A||p,[I,C]=(0,em.useState)(!0),[M,N]=(0,em.useState)(),[R,O]=(0,em.useState)(!1),P=(0,em.useRef)(null),k=(0,em.useRef)({left:"",right:"",width:"",maxWidth:"",height:"",backgroundColor:""}),D=(0,em.useMemo)(()=>null==a?void 0:a.stopAudio,[null==a?void 0:a.stopAudio]),B=null==t?void 0:t.memori,F=null==t?void 0:t.tenant,U=null==t?void 0:t.baseUrl,j=!!(u&&c),z=B?B.avatarURL&&B.avatarURL.length>0?La({type:"avatar",tenantID:null==F?void 0:F.name,resourceURI:B.avatarURL,baseURL:U,apiURL:""}):La({type:"avatar",tenantID:null==F?void 0:F.name,baseURL:U,apiURL:""}):void 0,{add:H}=vZ(),[G,V]=(0,em.useState)(!1),W=(null==t?void 0:t.loginToken)&&(null==(f=null==t?void 0:t.user)?void 0:f.userID)?t.user:void 0,q=(null==W?void 0:W.userName)||(null==W?void 0:W.eMail)||(null==B?void 0:B.name)||"User",$=!!(null==B?void 0:B.enableDeepThought)&&!!(null==t?void 0:t.loginToken)&&!!(null==(g=null==t?void 0:t.user)?void 0:g.pAndCUAccepted),J=!!(null==B?void 0:B.needsPosition)&&!!(null==t?void 0:t.positionPopoverOpen),K=()=>{V(!1),(null==t?void 0:t.positionPopoverOpen)&&t.setPositionPopoverOpen(!1)};(0,em.useEffect)(()=>{J&&V(!0)},[J]);let Y=(0,em.useMemo)(()=>{var e,n,r;return t?[...t.showShare?[{key:"share",icon:(0,eh.jsx)($h,{size:18}),title:S("widget.share")||"Share chat",subtitle:S("widget.mobileSession.copyLinkOrDownload")||"Copy link or download",view:"share"}]:[],...(null==(e=t.memori)?void 0:e.needsPosition)?[{key:"location",icon:(0,eh.jsx)(VS,{size:18}),title:S("widget.mobileSession.locationTracking")||"Location tracking",subtitle:(null==(n=t.position)?void 0:n.placeName)||S("widget.mobileSession.currentlyOff")||"Currently off",view:"location"}]:[],...t.showExperts&&(null==(r=t.memori)?void 0:r.enableBoardOfExperts)?[{key:"experts",icon:(0,eh.jsx)(VA,{size:18}),title:S("widget.showExpertsInTheBoard")||"Experts in this board",disabled:!j,onClick:()=>{t.setShowExpertsDrawer(!0),V(!1)}}]:[],...t.showClear?[{key:"clear",icon:(0,eh.jsx)($a,{size:18}),title:S("clearHistory")||"Clear chat",onClick:()=>{t.clearHistory(),H(v9({description:S("clearHistoryDone"),severity:"success"})),V(!1)}}]:[]]:[]},[t,j,S,H]),X=!!(null==t?void 0:t.showChatHistory)&&!!(null==t?void 0:t.loginToken),Z=()=>{null==t||t.setShowChatHistoryDrawer(!0),K()},Q=Jb({actions:Y,loginToken:null==t?void 0:t.loginToken,showChatHistory:X,onChatHistoryOpen:Z,showKnownFacts:$,showMessageConsumption:!!(null==t?void 0:t.showMessageConsumption),history:null==t?void 0:t.history,isLoggedIn:!!W,showLogin:!!(null==t?void 0:t.showLogin)}),ee=Q.hasContent,et=()=>{let e=P.current;e&&(e.style.left=k.current.left,e.style.right=k.current.right,e.style.width=k.current.width,e.style.maxWidth=k.current.maxWidth,e.style.height=k.current.height,e.style.backgroundColor=k.current.backgroundColor,e.classList.remove(JN),JM(e)),O(!1)};(0,em.useEffect)(()=>{let e=()=>{!document.fullscreenElement&&R&&et()};return document.addEventListener("fullscreenchange",e),()=>{document.removeEventListener("fullscreenchange",e)}},[R]);let en=e=>{e&&R&&(document.fullscreenElement&&document.exitFullscreen().catch(e=>{console.warn("[WebsiteAssistantLayout] Error exiting fullscreen:",e)}),et()),e&&K(),C(e),null==m||m(!e),N(e?void 0:new Date().toISOString());try{null==D||D()}catch(e){console.log(e)}};return(0,eh.jsxs)(eh.Fragment,{children:[I&&(0,eh.jsx)("div",{className:"memori-website_assistant--trigger",children:(0,eh.jsx)(yt,{className:"memori-website_assistant--trigger-button",variant:"ghost",shape:"circle",onClick:()=>en(!1),"aria-label":S("expand")||"Expand","aria-expanded":!1,title:S("expand")||"Expand",children:(0,eh.jsx)(VD,{avatar:null==r?void 0:r.memori.avatarURL})})}),(0,eh.jsx)("div",{ref:P,className:`memori-website_assistant--${I?"collapsed":"expanded"}${T?" memori-website_assistant--drawer-open memori-website_assistant--artifact-open":""}${R?` ${JN}`:""}`,children:!I&&(0,eh.jsxs)(eh.Fragment,{children:[l,(0,eh.jsxs)(bV,{spinning:!!(d&&j),className:"memori-website_assistant-layout",children:[(0,eh.jsxs)("div",{className:"memori-website_assistant-layout--header-row",children:[B&&z&&(0,eh.jsxs)("div",{className:"memori-chat-layout--brand",children:[(0,eh.jsx)("img",{className:"memori-chat-layout--brand-avatar",src:z,alt:"",role:"presentation"}),(0,eh.jsx)("div",{className:"memori-chat-layout--brand-text",children:j&&(0,eh.jsx)("span",{className:"memori-chat-layout--brand-name",title:B.name,children:B.name})})]}),(0,eh.jsxs)("div",{className:"memori-website_assistant-layout--header-actions",children:[e&&t&&(0,eh.jsx)(e,{...t,buttonVariant:"outline",memori:{...t.memori,needsPosition:!1,enableDeepThought:!1,enableBoardOfExperts:!1},showSettings:!1,showReload:!1,showChatHistory:!1,showShare:!1,showClear:!1,showLogin:!1,showMessageConsumption:!1,fullScreenHandler:()=>{if(document.fullscreenElement)document.exitFullscreen&&document.exitFullscreen().catch(e=>{console.warn("[WebsiteAssistantLayout] Error exiting fullscreen:",e)}),et();else{let e=P.current;e&&(k.current={left:e.style.left,right:e.style.right,width:e.style.width,maxWidth:e.style.maxWidth,height:e.style.height,backgroundColor:e.style.backgroundColor},e.style.left="0",e.style.right="0",e.style.width="100%",e.style.maxWidth="none",e.style.height="100%",e.style.backgroundColor="",e.classList.add(JN),JC(e,e=>{console.warn("[WebsiteAssistantLayout] Error enabling fullscreen:",e)})),O(!0)}},extraActions:ee?(0,eh.jsx)(J_,{entries:Q,open:G,onToggle:()=>G?K():V(!0)}):void 0}),(0,eh.jsx)("button",{type:"button",className:"memori-website_assistant--close-button",onClick:()=>en(!0),"aria-label":S("collapse")||"Close",title:S("collapse")||"Close",children:(0,eh.jsx)(H2,{className:"memori-icon-close","aria-hidden":!0})})]})]}),h&&(0,eh.jsx)("div",{className:"memori-website_assistant-layout--avatar",children:n&&r&&(0,em.createElement)(n,{...r,integrationConfig:r.integrationConfig?{...r.integrationConfig,avatarURL:(null==(v=r.integrationConfig)?void 0:v.avatarURL)?`${null==(y=r.integrationConfig)?void 0:y.avatarURL.split("#")[0]}#${M}`:void 0}:{},key:M})}),(0,eh.jsx)("div",{id:"extension"}),(0,eh.jsx)("div",{className:"memori-website_assistant-layout--controls",children:u&&c&&i&&a?(0,eh.jsx)(i,{...a}):s?(0,eh.jsx)(o,{...s,showFullDescriptionOnMobile:!0,showChatHistory:!1}):null})]}),t&&ee&&(0,eh.jsx)(Jx,{open:G,presentation:"popover",onClose:K,initialView:J?"location":null!=(_=null==(b=Q.directAction)?void 0:b.view)?_:"session",autoStartGeolocation:J&&!!t.autoStartPositionGeolocation,title:S("widget.mobileSession.session")||"Session",loginToken:t.loginToken,user:t.user,apiClient:t.apiClient,userName:q,userEmail:null==W?void 0:W.eMail,userInitial:q.charAt(0).toUpperCase(),avatarURL:null==W?void 0:W.avatarURL,birthDate:null==W?void 0:W.birthDate,actions:Y,showChatHistory:X,onChatHistoryOpen:Z,knownFactsPageTitle:S("knownFacts.title")||"Known facts",sharePageTitle:S("widget.share")||"Share",locationPageTitle:S("widget.mobileSession.locationTracking")||"Location tracking",backLabel:S("back")||"Back",shareContent:(0,eh.jsx)($C,{tenant:t.tenant,memori:t.memori,sessionID:t.sessionID,title:null==(x=t.memori)?void 0:x.name,baseUrl:t.baseUrl,align:"left",history:t.history,renderMode:"inline"}),knownFactsDisabled:!j,showKnownFacts:$,showMessageConsumption:!!t.showMessageConsumption,history:null!=(w=t.history)?w:[],isLoggedIn:!!W,showLogin:!!t.showLogin,loginLabel:S("login.login")||"Log in",onLogin:()=>{t.setShowLoginDrawer(!0),K()},onKnownFactsOpen:()=>{j&&(t.setShowKnownFactsDrawer(!0),K())},venue:t.position,setVenue:t.setVenue,logoutLabel:S("login.logout")||"Log out",onLogout:()=>{var e;null==(e=t.onLogout)||e.call(t),K()}})]})}),A&&(0,eh.jsx)(Gh,{})]})},em=ec("85Hg2"),JO=({Header:e,headerProps:t,Chat:n,chatProps:r,startPanelProps:i,sessionId:a,hasUserActivatedSpeak:o,StartPanel:s,onSidebarToggle:l})=>{var u,c;let{t:d}=tA(),[h,p]=(0,em.useState)(!1),[m,f]=(0,em.useState)(!1),g=(0,em.useRef)(null),{state:v,closeArtifact:y}=e9(),b=v.isDrawerOpen&&!v.isChatLogPanelPresentation,_=null==t?void 0:t.memori,x=null==t?void 0:t.tenant,w=null==t?void 0:t.baseUrl,S=(0,em.useMemo)(()=>{if(t)return{...t,showReload:!1,showClear:!1,showSettings:!1,showShare:!1,showLogin:!1,showMessageConsumption:!1,showFullscreen:!0,memori:{...t.memori,needsPosition:!1,enableDeepThought:!1},layout:"HIDDEN_CHAT",showChatHistory:!1}},[t]),E=!!(a&&o),A=_?_.avatarURL&&_.avatarURL.length>0?La({type:"avatar",tenantID:null==x?void 0:x.name,resourceURI:_.avatarURL,baseURL:w,apiURL:""}):La({type:"avatar",tenantID:null==x?void 0:x.name,baseURL:w,apiURL:""}):void 0,T=(0,em.useRef)({left:"",right:"",width:"",maxWidth:"",backgroundColor:""});(0,em.useEffect)(()=>{let e=()=>{!document.fullscreenElement&&m&&C()};return document.addEventListener("fullscreenchange",e),()=>{document.removeEventListener("fullscreenchange",e)}},[m]),(0,em.useEffect)(()=>{var e;let t=document.body,n=document.querySelector(".memori-widget"),r=n&&(null==(e=getComputedStyle(n).getPropertyValue("--memori-hidden-chat-width"))?void 0:e.trim())||"min(450px, 100vw)";h?m?(t.style.width="100%",t.style.marginLeft="0"):"u">typeof window&&window.matchMedia("(max-width: 768px)").matches?(t.style.width="100%",t.style.marginRight="0",t.style.marginLeft="0"):(t.style.width=`calc(100% - ${r})`,t.style.marginRight=r,t.style.transition="all 0.5s"):(t.style.width="100%",t.style.marginRight="0",t.style.marginLeft="0",y())},[h,m]);let I=()=>{m&&h&&(document.fullscreenElement&&document.exitFullscreen().catch(e=>{console.warn("[HiddenChatLayout] Error exiting fullscreen:",e)}),C());let e=!h;p(e),l&&l(e)},C=()=>{let e=g.current;e&&(e.style.left=T.current.left,e.style.right=T.current.right,e.style.width=T.current.width,e.style.maxWidth=T.current.maxWidth,e.style.backgroundColor=T.current.backgroundColor,e.classList.remove("memori-sidebar-fullscreen"),JM(e)),f(!1)};return(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("input",{type:"checkbox",id:"memori-sidebar-toggle",className:`memori-sidebar-toggle ${b?"memori-sidebar-toggle-artifact":""}`,checked:h,onChange:I}),(0,eh.jsxs)("div",{className:"memori-sidebar-container",children:[(0,eh.jsx)("label",{htmlFor:"memori-sidebar-toggle",className:"memori-sidebar-toggle-label memori-open-label",children:(0,eh.jsx)(Ld,{className:"memori-icon","aria-label":null!=(u=d("expand"))?u:void 0})}),(0,eh.jsx)("aside",{ref:g,className:`memori-sidebar memori-chat-layout ${m?"memori-sidebar-fullscreen":""}`,children:(0,eh.jsxs)("div",{className:"memori-hidden-chat-layout--controls memori-chat-layout--controls",children:[(0,eh.jsx)("div",{className:"memori-chat-layout--header",children:e&&t&&(0,eh.jsxs)("div",{className:"memori-chat-layout--header-row",children:[_&&A&&(0,eh.jsxs)("div",{className:"memori-chat-layout--brand",children:[(0,eh.jsx)("img",{className:"memori-chat-layout--brand-avatar",src:A,alt:"",role:"presentation"}),(0,eh.jsx)("div",{className:"memori-chat-layout--brand-text",children:E&&(0,eh.jsx)("span",{className:"memori-chat-layout--brand-name",title:_.name,children:_.name})})]}),(0,eh.jsxs)("div",{className:"memori-hidden-chat-layout--header-actions",children:[S&&(0,eh.jsx)(e,{position:{latitude:0,longitude:0,placeName:""},...S,buttonVariant:"outline",fullScreenHandler:()=>{if(document.fullscreenElement)document.exitFullscreen&&document.exitFullscreen().catch(e=>{console.warn("[HiddenChatLayout] Error exiting fullscreen:",e)}),C();else{let e=g.current;e&&(T.current={left:e.style.left,right:e.style.right,width:e.style.width,maxWidth:e.style.maxWidth,backgroundColor:e.style.backgroundColor},e.style.left="0",e.style.right="0",e.style.width="100%",e.style.maxWidth="none",e.style.backgroundColor="",e.classList.add("memori-sidebar-fullscreen"),JC(e,e=>{console.warn("[HiddenChatLayout] Error enabling fullscreen:",e)})),f(!0)}}}),(0,eh.jsx)("button",{type:"button",className:"memori-website_assistant--close-button memori-hidden-chat-layout--header-close",onClick:I,"aria-label":d("collapse")||"Close",title:d("collapse")||"Close",children:(0,eh.jsx)(H2,{className:"memori-icon-close","aria-hidden":!0})})]})]})}),(0,eh.jsxs)("div",{className:"memori-chat-layout--body",children:[a&&o&&n&&r?(0,eh.jsx)(n,{...r}):i?(0,eh.jsxs)("div",{className:"memori-chat-layout--start-shell",children:[(0,eh.jsx)("div",{className:"memori-chat-layout--start-panel-wrap",children:(0,eh.jsx)(s,{...i})}),n&&r&&!1!==r.showInputs&&(0,eh.jsx)("div",{className:"memori-chat-layout--prechat-inputs",children:(0,eh.jsx)(Vo,{userMessage:r.userMessage,onChangeUserMessage:r.onChangeUserMessage,dialogState:r.dialogState,instruct:r.instruct,authToken:r.authToken,sendMessage:r.sendMessage,isTyping:r.memoriTyping,microphoneMode:r.microphoneMode,sendOnEnter:r.sendOnEnter,setSendOnEnter:r.setSendOnEnter,client:r.client,sessionID:E?r.sessionID:void 0,baseUrl:r.baseUrl,showUpload:r.showUpload,attachmentsMenuOpen:r.attachmentsMenuOpen,setAttachmentsMenuOpen:r.setAttachmentsMenuOpen,onTextareaFocus:()=>{var e;null==(e=r.stopListening)||e.call(r)},onTextareaBlur:()=>{},onTextareaExpanded:()=>{},startListening:r.startListening,stopListening:r.stopListening,audioStream:r.audioStream,transcribing:r.transcribing,stopAudio:r.stopAudio,listening:r.listening,isPlayingAudio:r.isPlayingAudio,showMicrophone:r.showMicrophone,memoriID:null==(c=r.memori)?void 0:c.memoriID,maxTextareaCharacters:r.maxTextareaCharacters,maxDocumentsPerMessage:kZ,maxDocumentContentLength:3e5,pasteAsCardLineThreshold:100,pasteAsCardCharThreshold:4200,showAiGeneratedNote:!1})})]}):(0,eh.jsx)("div",{className:"memori-loading",children:(0,eh.jsx)(bV,{spinning:!0})}),(0,eh.jsx)("div",{id:"extension"})]})]})})]}),b&&(0,eh.jsx)(Gh,{})]})},em=ec("85Hg2"),JP=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:a,StartPanel:o,startPanelProps:s,integrationStyle:l,integrationBackground:u,sessionId:c,hasUserActivatedSpeak:d,loading:h=!1,poweredBy:p})=>{var m,f,g,v,y,b,_,x,w;let{t:S}=tA(),{state:E}=e9();E.currentArtifact;let A=E.isDrawerOpen&&!E.isChatLogPanelPresentation,[T,I]=(0,em.useState)(!1),[C,M]=(0,em.useState)(!1),{contentRowRef:N,isArtifactOverlay:R,isResizingArtifact:O,columnWidthStyle:P,resizeHandleProps:k}=Jw(A);(0,em.useEffect)(()=>{let e=window.matchMedia("(max-width: 768px)"),t=()=>I(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let D=null==t?void 0:t.memori;null==t||t.tenant,null==t||t.baseUrl;let B=(null==t?void 0:t.loginToken)&&(null==(m=null==t?void 0:t.user)?void 0:m.userID)?t.user:void 0,F=[null==B?void 0:B.name,null==B?void 0:B.surname].filter(Boolean).join(" ").trim()||(null==B?void 0:B.userName)||(null==B?void 0:B.eMail)||(null==D?void 0:D.name)||"User",U=F.charAt(0).toUpperCase(),j=!!(c&&d),z=(0,em.useMemo)(()=>(null==a?void 0:a.isPlayingAudio)?{key:"speaking",label:S("widget.agentStatusSpeaking",{defaultValue:"sta parlando"})}:(null==a?void 0:a.memoriTyping)?{key:"processing",label:S("widget.agentStatusProcessing",{defaultValue:"in elaborazione"})}:(null==a?void 0:a.listening)?{key:"listening",label:S("widget.agentStatusListening",{defaultValue:"in ascolto"})}:null,[null==a?void 0:a.isPlayingAudio,null==a?void 0:a.memoriTyping,null==a?void 0:a.listening,S]),H=(0,em.useCallback)(()=>{if(function(){if("u"<typeof document)return!1;if(!0===document.fullscreenEnabled)return!0;let e=document.querySelector('meta[name="memori-fullscreen-enabled"], meta[name="fullscreen-enabled"]');return(null==e?void 0:e.getAttribute("content"))==="true"}()){if(!document.fullscreenElement)return void document.documentElement.requestFullscreen().catch(()=>{});document.exitFullscreen().catch(()=>{})}},[]),G=(0,em.useMemo)(()=>{if(t)return T?{...t,showReload:!1,showClear:!1,showSettings:!1,showShare:!1,showLogin:!1,showFullscreen:!1,showMessageConsumption:!1,memori:{...t.memori,needsPosition:!1,enableDeepThought:!1},showChatHistory:!1}:t},[t,T]),V=(0,em.useMemo)(()=>{var e,n;if(!t)return[];let r=T&&!!t.loginToken&&!1!==t.showChatHistory,i=!T&&!1!==t.showFullscreen,a=!1!==t.showShare,o=!!(null==(e=t.memori)?void 0:e.needsPosition);return[...r?[{key:"chatHistory",icon:(0,eh.jsx)($t,{size:18}),title:S("widget.headerHistory")||S("write_and_speak.chatHistory")||"Chat history",onClick:()=>{t.setShowChatHistoryDrawer(!0),M(!1)}}]:[],...i?[{key:"fullscreen",icon:(0,eh.jsx)(Jd,{size:18}),title:S("fullscreenEnter")||"Full screen",subtitle:S("widget.expandToImmersive")||"Expand to immersive view",onClick:()=>{H(),M(!1)}}]:[],...a?[{key:"share",icon:(0,eh.jsx)($h,{size:18}),title:S("widget.share")||"Share chat",subtitle:S("widget.mobileSession.copyLinkOrDownload")||"Copy link or download",view:"share"}]:[],...o?[{key:"location",icon:(0,eh.jsx)(VS,{size:18}),title:S("widget.mobileSession.locationTracking")||"Location tracking",subtitle:(null==(n=t.position)?void 0:n.placeName)||S("widget.mobileSession.currentlyOff")||"Currently off",view:"location",trailing:(0,eh.jsx)("span",{className:"memori-mobile-session-panel--chevron",children:">"})}]:[]]},[t,T,j,S,H]),W=!!(null==(f=null==t?void 0:t.memori)?void 0:f.enableDeepThought)&&!!(null==t?void 0:t.loginToken)&&!!(null==(g=null==t?void 0:t.user)?void 0:g.pAndCUAccepted),q=Jb({actions:V,loginToken:null==t?void 0:t.loginToken,showKnownFacts:W,showMessageConsumption:!!(null==t?void 0:t.showMessageConsumption),history:null==t?void 0:t.history,isLoggedIn:!!B,showLogin:!!(null==t?void 0:t.showLogin)});return(0,eh.jsxs)(eh.Fragment,{children:[l,u,(0,eh.jsxs)(bV,{spinning:!!(h&&j),children:[e&&t&&G&&(0,eh.jsx)("div",{className:"memori-fullpage-top-header",children:(0,eh.jsx)("div",{className:"memori-chat-layout--header",children:(0,eh.jsx)("div",{className:"memori-fullpage-header-row",children:(0,eh.jsx)(e,{...G,layout:"FULLPAGE",buttonVariant:"outline",extraActions:T?(0,eh.jsx)(J_,{entries:q,open:C,onToggle:()=>M(e=>!e)}):void 0})})})}),t&&(0,eh.jsx)(Jx,{open:C,presentation:"popover",onClose:()=>M(!1),initialView:null!=(y=null==(v=q.directAction)?void 0:v.view)?y:"session",title:S("widget.mobileSession.session")||"Session",loginToken:t.loginToken,user:t.user,apiClient:t.apiClient,userName:F,userEmail:null==B?void 0:B.eMail,userInitial:U,avatarURL:null==B?void 0:B.avatarURL,birthDate:null==B?void 0:B.birthDate,actions:V,knownFactsPageTitle:S("knownFacts.title")||"Known facts",sharePageTitle:S("widget.share")||"Share",locationPageTitle:S("widget.mobileSession.locationTracking")||"Location tracking",backLabel:S("back")||"Back",locationStatusLabel:S("widget.mobileSession.locationStatus")||"Status",locationPlace:null==(b=t.position)?void 0:b.placeName,locationUnknownLabel:S("write_and_speak.unknownPosition")||"Unknown position",locationEnableLabel:S("widget.shareLocation")||"Share location",locationDisableLabel:S("widget.mobileSession.disableLocationSharing")||"Disable location sharing",knownFactsDescription:S("knownFacts.description",{memoriName:(null==D?void 0:D.name)||""})||"",knownFactsCtaLabel:S("widget.mobileSession.openKnownFacts")||"Open full known facts",knownFactsCountLabel:S("widget.mobileSession.knownFactsMessages",{count:(null==(_=t.history)?void 0:_.length)||0})||"",shareContent:(0,eh.jsx)($C,{tenant:null==t?void 0:t.tenant,memori:null==t?void 0:t.memori,sessionID:null==t?void 0:t.sessionID,title:null==(x=null==t?void 0:t.memori)?void 0:x.name,baseUrl:null==t?void 0:t.baseUrl,align:"left",history:null==t?void 0:t.history,renderMode:"inline"}),knownFactsDisabled:!j,showKnownFacts:W,showMessageConsumption:!!t.showMessageConsumption,history:null!=(w=t.history)?w:[],isLoggedIn:!!B,showLogin:!!t.showLogin,loginLabel:S("login.login")||"Log in",onLogin:()=>{t.setShowLoginDrawer(!0),M(!1)},onKnownFactsOpen:()=>{j&&(t.setShowKnownFactsDrawer(!0),M(!1))},onLocationEnable:()=>{if(t){if(!navigator.geolocation)return void t.setPositionPopoverOpen(!0);navigator.geolocation.getCurrentPosition(e=>{let n=e.coords.latitude,r=e.coords.longitude;t.setVenue({latitude:n,longitude:r,placeName:`${n.toFixed(5)}, ${r.toFixed(5)}`,uncertainty:e.coords.accuracy/1e3})},()=>{t.setPositionPopoverOpen(!0)},{enableHighAccuracy:!0,timeout:15e3,maximumAge:0})}},onLocationDisable:()=>{null==t||t.setVenue({latitude:0,longitude:0,placeName:"",uncertainty:0})},venue:t.position,setVenue:t.setVenue,logoutLabel:S("login.logout")||"Log out",onLogout:()=>{(()=>{if(t){if(B&&t.onLogout)return t.onLogout();t.setShowLoginDrawer(!0)}})(),M(!1)}}),(0,eh.jsxs)("div",{ref:N,className:`memori-fullpage-content-row${A&&R?" memori-fullpage-content-row--artifact-overlay":""}${O?" memori-fullpage-content-row--resizing":""}`,style:P,children:[(0,eh.jsxs)("div",{className:"memori--grid",children:[(0,eh.jsxs)("div",{className:"memori--grid-column memori--grid-column-left",hidden:A,children:[j&&z&&(0,eh.jsxs)("div",{className:"memori-fullpage-agent-status",role:"status","aria-live":"polite",children:[(0,eh.jsx)("span",{className:`memori-fullpage-agent-status--dot memori-fullpage-agent-status--dot-${z.key}`,"aria-hidden":"true"}),(0,eh.jsx)("span",{className:"memori-fullpage-agent-status--label",children:z.label})]}),n&&r&&(0,eh.jsx)(n,{chatProps:a,isZoomed:!0,...r}),(0,eh.jsx)("div",{id:"extension"})]}),(0,eh.jsx)("div",{className:"memori-chat-layout--main",children:(0,eh.jsx)("div",{className:E.isFullscreen?"memori-chat-layout-controls-hide":"memori-chat-layout--controls",children:c&&d&&i&&a?(0,eh.jsx)(i,{...a,footerBrand:p,showAiGeneratedNote:!0}):s?(0,eh.jsx)("div",{className:"memori-conversation-column",children:(0,eh.jsx)(o,{...s,footerBrand:p})}):null})})]}),(0,eh.jsx)("div",{className:`memori--grid-column-artifact${A?" memori--grid-column-artifact--open":""}`,children:A&&(0,eh.jsxs)(eh.Fragment,{children:[!T&&(0,eh.jsx)("div",{className:"memori-artifact-resize-handle",...k}),(0,eh.jsx)(Gh,{isLayoutColumn:!0})]})})]})]})]})};let Jk={IT:{MALE:"it-IT-DiegoNeural",FEMALE:"it-IT-ElsaNeural"},DE:{MALE:"de-DE-ConradNeural",FEMALE:"de-DE-KatjaNeural"},EN:{MALE:"en-GB-RyanNeural",FEMALE:"en-GB-SoniaNeural"},ES:{MALE:"es-ES-AlvaroNeural",FEMALE:"es-ES-ElviraNeural"},FR:{MALE:"fr-FR-HenriNeural",FEMALE:"fr-FR-DeniseNeural"},PT:{MALE:"pt-PT-DuarteNeural",FEMALE:"pt-PT-RaquelNeural"},UK:{MALE:"uk-UA-OstapNeural",FEMALE:"uk-UA-PolinaNeural"},RU:{MALE:"ru-RU-DmitryNeural",FEMALE:"ru-RU-SvetlanaNeural"},PL:{MALE:"pl-PL-MarekNeural",FEMALE:"pl-PL-AgnieszkaNeural"},FI:{MALE:"fi-FI-HarriNeural",FEMALE:"fi-FI-SelmaNeural"},EL:{MALE:"el-GR-NestorasNeural",FEMALE:"el-GR-AthinaNeural"},AR:{MALE:"ar-SA-HamedNeural",FEMALE:"ar-SA-ZariyahNeural"},ZH:{MALE:"zh-CN-YunxiNeural",FEMALE:"zh-CN-XiaoxiaoNeural"},JA:{MALE:"ja-JP-KeitaNeural",FEMALE:"ja-JP-NanamiNeural"}},JL={MALE:"en-US-GuyNeural",FEMALE:"en-US-JennyNeural"},JD={DEFAULT:{MALE:"onyx",FEMALE:"nova",NEUTRAL:"alloy"},IT:{MALE:"echo",FEMALE:"nova"},ES:{MALE:"echo",FEMALE:"shimmer"},FR:{MALE:"echo",FEMALE:"fable"},PT:{MALE:"onyx",FEMALE:"shimmer"},DE:{MALE:"onyx",FEMALE:"fable"},EN:{MALE:"echo",FEMALE:"nova"},ZH:{MALE:"echo",FEMALE:"shimmer"},JA:{MALE:"echo",FEMALE:"nova"},RU:{MALE:"onyx",FEMALE:"fable"}};JL.FEMALE;function JB({text:e,preview:t=!1,...n}){return!!(e&&e.trim()&&!t&&!function({defaultEnableAudio:e,defaultSpeakerActive:t,autoStart:n,speakerMuted:r,storedMute:i}){return!e||!!r||!0===i||!1!==i&&(!e||!t||n)}(n))}class JF extends Error{constructor(e,t){super(e),this.name="CreditsCheckError",this.status=t}}let JU=async({operation:e="session_creation",baseUrl:t,userID:n,engineMemoriID:r,tenant:i,characters:a})=>{if(!n&&!r)throw new JF("Either userID or engineMemoriID must be provided");if("import_document"===e&&null==a)throw new JF("characters must be provided for import_document");let o=await fetch(`${t}/api/verify-tokens`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e,...n?{userID:n}:{},...r?{engineMemoriID:r}:{},tenant:i,..."import_document"===e?{characters:a}:{}})});if(!o.ok)throw new JF("Failed to fetch credits",o.status);return o.json()};var em=ec("85Hg2");class Jj extends Error{constructor(e,t,n){super(e),this.name="SpeechRequestError",this.status=t,this.code=n}}function Jz(e){let t=e.sessionIdRef?e.sessionIdRef.current:e.sessionId,n=null==t?void 0:t.trim();if(!n)throw new Jj("Missing required parameter: sessionId",401,"missing_session");return n}function JH(e,t,n){let r,i=t?t.trim().toLowerCase().replace(/^https?:\/\//,"").split("/")[0].split(":")[0]:"";if(!i)return;let a=null!=n?n:"u">typeof window?window.location.href:"http://localhost",o="";try{o=new URL(e,a).hostname.toLowerCase()}catch(e){return i}return!(r=o)||"localhost"===r||"127.0.0.1"===r||r.endsWith(".localhost")||i===o?i:void 0}async function JG(e){let t=await e.json().catch(()=>({})),n="string"==typeof t.error&&t.error.length>0?t.error:`API error: ${e.status}`,r="string"==typeof t.code?t.code:void 0;return new Jj(n,e.status,r)}let JV={missing_session:"errors.speechMissingSession",invalid_session:"errors.speechInvalidSession",tenant_mismatch:"errors.speechTenantMismatch",rate_limited:"errors.speechRateLimited"};var em=ec("85Hg2");let JW=100,Jq=["hello","hi","hey","good morning","good afternoon","good evening","thanks","thank you","thx","tnx","ty","thanks!","thank you!","ok","okay","k","yes","no","yep","nope","yeah","nah","good","great","nice","cool","awesome","perfect","excellent","bye","goodbye","see you","see ya","later","good night","how are you","how are you doing","what's up","sup","please","pls","sorry","excuse me","pardon","i see","i understand","got it","gotcha","understood","continue","go on","tell me more","more","next","start","begin","let's start","let's begin","help","can you help","i need help","test","testing","test message","?","??","???","!","!!","!!!","...","..",".","a","an","the","and","or","but","in","on","at","to","for","of","with","by","ciao","salve","buongiorno","buonasera","buonanotte","grazie","grazie mille","grazie!","grazie mille!","va bene","va bene così","perfetto","ottimo","bene","sì","si","certo","certamente","assolutamente","arrivederci","a presto","a dopo","ci vediamo","addio","come stai","come va","tutto bene","che succede","per favore","per piacere","scusa","scusami","mi dispiace","capisco","ho capito","capito","continua","vai avanti","dimmi di più","altro","altro ancora","inizia","iniziamo","comincia","cominciamo","aiuto","puoi aiutarmi","ho bisogno di aiuto","prova","messaggio di prova","un","una","il","la","gli","le","e","o","ma","su","per","di","con","da"],J$=e=>{let t=new Date(e);return t.setHours(0,0,0,0),t},JJ=e=>{let t=null;for(let n of e){let e=Jo(n.timestamp);e&&(!t||e.getTime()>t.getTime())&&(t=e)}return t},JK=(e,t=new Date)=>{let n,r;return e.getTime()>=(r=(n=J$(t)).getDay(),n.setDate(n.getDate()-(r+6)%7),n).getTime()?{type:"thisWeek"}:{type:"month",year:e.getFullYear(),month:e.getMonth()}};var em=ec("85Hg2");let JY={memoriID:"chat-resume-drawer",name:"AI",culture:"it-IT",coverURL:"",avatarURL:"",enableBoardOfExperts:!1},JX=()=>{};var JZ=({isOpen:e,onClose:t,embedded:n=!1,session:r,isLoading:i=!1,showFunctionCache:a=!1,showMessageConsumption:o=!1,memori:s=JY})=>{let l=(0,em.useMemo)(()=>r.messages.map(e=>{let t=e.attachment?`<document_attachment filename="${e.attachment.name.replaceAll('"',"&quot;")}" type="${e.attachment.type.replaceAll('"',"&quot;")}"></document_attachment>`:"",n="assistant"===e.role&&"interrupted"===e.status?"Risposta interrotta - sessione in pausa":e.content;return{fromUser:"user"===e.role,text:`${n}${t}`,timestamp:e.timestamp,media:e.media||[]}}),[r.messages]),u=(0,eh.jsxs)("div",{className:"memori-chat-resume-drawer--thread",children:[i&&(0,eh.jsx)("div",{className:"memori-chat-resume-drawer--skeletons",children:[0,1,2].map(e=>(0,eh.jsx)("div",{className:"memori-chat-resume-drawer--skeleton-bubble"},e))}),!i&&(0,eh.jsx)("div",{className:"memori-chat-resume-drawer--embedded-chat",children:(0,eh.jsx)(Vx,{memori:s,sessionID:"chat-resume-drawer",history:l,pushMessage:JX,simulateUserPrompt:JX,setSendOnEnter:JX,setAttachmentsMenuOpen:JX,onChangeUserMessage:JX,sendMessage:JX,setEnableFocusChatInput:JX,stopAudio:JX,startListening:JX,stopListening:JX,showInputs:!1,showAIicon:!0,showCopyButton:!0,isHistoryView:!0,isChatlogPanel:!0,showFunctionCache:a,showMessageConsumption:o})})]});return n?e?(0,eh.jsx)("div",{className:"memori-chat-resume-drawer--embedded-shell",children:u}):null:(0,eh.jsx)(xf,{open:e,onClose:t,className:"memori-chat-resume-drawer",anchor:"right",size:"md",showCloseButton:!1,title:Le(r.title),children:u})};let JQ=e=>{let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),o=String(e.getSeconds()).padStart(2,"0"),s=String(e.getMilliseconds()).padStart(3,"0");return`${t}${n}${r}${i}${a}${o}${s}`},J0=e=>{var t,n,r,i;return!((null==(t=e.properties)?void 0:t.functionSignature)||(null==(n=e.properties)?void 0:n.functionCache))&&!(null!=(i=null==(r=e.mimeType)?void 0:r.startsWith("image/"))&&i)},J1=async(e,t,n,r)=>{try{return await Promise.all(e.map(async e=>({...e,lines:await Promise.all(e.lines.map(async e=>{if(!e.text)return e;try{let i=await GP(e.text,n,t,r);return{...e,originalText:e.text,text:i.text}}catch(t){return console.error("Error translating line:",t),e}}))})))}catch(t){return console.error("Error translating chat logs:",t),e}},J2=(e,t=!0)=>(({lines:e,truncate:t=!0})=>{let n=e.filter(e=>e.inbound);if(0===n.length)return"";let r=n.map((e,t)=>{let n=Le(Hl(e.text||""));return{text:n,score:(e=>{let t=e.toLowerCase().trim();if(Jq.includes(t))return 0;let n=t.split(/\s+/).filter(e=>e.length>0).length;if(n<3||t.length<5)return .1;let r=/\?$/.test(t)||/^(what|how|why|when|where|who|which|can|could|would|will|do|does|did|is|are|was|were)/.test(t)||/^(cosa|come|perché|perche|quando|dove|chi|quale|quali|può|puo|potrebbe|vorrebbe|sarà|sara|fa|fai|fanno|è|e|sono|era|erano)/.test(t),i=.5;return r&&(i+=.3),n>5&&(i+=.2),n>10&&(i+=.2),n>20&&(i-=.1),/\d/.test(t)&&(i+=.1),/[A-ZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞŸ][a-zàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ]+/.test(e)&&(i+=.1),Math.min(i,1)})(n),index:t}});r.sort((e,t)=>.1>Math.abs(e.score-t.score)?e.index-t.index:t.score-e.score);let i=r[0];return t?((e,t=JW)=>{if(e.length<=t)return e;let n=e.substring(0,t),r=n.lastIndexOf(" ");return r>.7*t?`${n.substring(0,r)}...`:`${n}...`})(i.text):i.text})({title:e.title,lines:e.lines,truncate:t});var J3=({open:e,onClose:t,apiClient:n,sessionId:r,memori:i,resumeSession:a,baseUrl:o,language:s,userLang:l,isMultilanguageEnabled:u=!1,showFunctionCache:c=!1,showMessageConsumption:d=!1,loginToken:h})=>{let{t:p,i18n:m}=tA(),{getUserChatLogsByTokenPaged:f}=n.chatLogs,[g,v]=(0,em.useState)([]),[y,_]=(0,em.useState)(null),[x,w]=(0,em.useState)(""),S=k2(x,300),[E,A]=(0,em.useState)(!1),[T,I]=(0,em.useState)("all"),[C,M]=(0,em.useState)(3),[N,R]=(0,em.useState)(1),[O,P]=(0,em.useState)(!1),[k,D]=(0,em.useState)(!1),[B,F]=(0,em.useState)(null),[U,j]=(0,em.useState)(0),z=(0,em.useMemo)(()=>{let e=0;return"all"!==T&&(e+=1),3!==C&&(e+=1),e},[T,C]),H=(0,em.useCallback)(async({from:e=0,append:t=!1}={})=>{var n,r;if(!h)return void F(p("errorFetchingSession")||"Login token required to fetch chat history");t?D(!0):P(!0),F(null);try{let a="all"===T?void 0:(e=>{let t=new Date;if("today"===e)return{dateFrom:JQ(new Date(t.getFullYear(),t.getMonth(),t.getDate()-1)),dateTo:JQ(t)};if("yesterday"===e){let e=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1);return{dateFrom:JQ(new Date(e.getFullYear(),e.getMonth(),e.getDate()-2)),dateTo:JQ(e)}}return"last_7_days"===e?{dateFrom:JQ(new Date(t.getFullYear(),t.getMonth(),t.getDate()-7)),dateTo:JQ(t)}:{dateFrom:JQ(new Date(t.getFullYear(),t.getMonth(),t.getDate()-30)),dateTo:JQ(t)}})(T),c=await f({loginToken:h,memoriID:i.engineMemoriID,from:e,howMany:8,filter:S,dateFrom:null==a?void 0:a.dateFrom,dateTo:null==a?void 0:a.dateTo,minimumMessagesPerChat:0===C?N:C}),d=c.chatLogs||[];s.toUpperCase()!==l.toUpperCase()&&u&&(d=await J1(d,s,l,o));let p=null!=(r=null!=(n=c.count)?n:c.totalItems)?r:d.length;j(p),v(e=>t?[...e,...d]:d)}catch(e){F(p("errorFetchingSession")||"Error loading chat history"),console.error("Error fetching chat logs:",e)}finally{P(!1),D(!1)}},[h,i.engineMemoriID,S,T,C,N,s,l,u,o,f]);(0,em.useEffect)(()=>{e||(_(null),w(""),A(!1),I("all"),M(3),R(1))},[e]),(0,em.useEffect)(()=>{e&&H({from:0})},[e,H]);let G=e=>{var t,n;let r,a,o;t=`${p("write_and_speak.conversationStartedLabel")} ${new Intl.DateTimeFormat(m.language,{dateStyle:"short",timeStyle:"short"}).format(new Date)}
1068
+ `})(i,r,a),s=window.open("","_blank","width=800,height=600,scrollbars=yes,resizable=yes");if(!s)throw Error("Popup blocked! Please enable popups to export PDF.");s.document.write(o),s.document.close(),s.document.title=r,setTimeout(()=>{s&&!s.closed&&(s.focus(),s.print(),setTimeout(()=>{s&&!s.closed&&s.close()},1e3))},500),P("export-pdf")}catch(e){console.error("PDF export error:",e),g(v9({description:m("exportChatHistory.error")||"Failed to export chat to PDF. Please try again.",severity:"error"}))}finally{x(!1)}},H=(0,em.useMemo)(()=>{if(t&&n){if(t.ownerUserID)return`${null!=a?a:"https://www.aisuru.com"}/${"it"===f.language?"it":"en"}/shared/${t.ownerUserID}/${t.memoriID}/${n}`;if(t.exposed)return`${null!=a?a:"https://www.aisuru.com"}/${"it"===f.language?"it":"en"}/shared/${t.ownerUserName}/${t.name}/${n}`}},[t,n,a,f.language]),G=(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsxs)("div",{className:"memori-share-button--dropdown-section memori-share-button--dropdown-section-primary",children:[t&&n&&H&&(0,eh.jsxs)("button",{type:"button",className:(b(tT))("memori-share-button--inline-item",{"memori-share-button--menu-item--flash":"share-chat"===T}),onClick:()=>{window.open(H,"_blank"),P("share-chat")},children:[(0,eh.jsx)($h,{}),(0,eh.jsx)("span",{children:m("widget.shareChat")||"Share chat"})]}),l&&l.length>0&&(0,eh.jsxs)("button",{type:"button",className:(b(tT))("memori-share-button--inline-item",{"memori-share-button--menu-item--flash":"export-pdf"===T}),onClick:z,disabled:_,children:[(0,eh.jsx)(Hy,{}),(0,eh.jsx)("span",{children:_?m("exportChatHistory.exporting")||"Exporting...":m("exportChatHistory.exportPDF")||"Export chat as PDF"})]}),(0,eh.jsxs)("button",{type:"button",className:(b(tT))("memori-share-button--inline-item",{"memori-share-button--copy-item--success":"success"===E,"memori-share-button--copy-item--error":"error"===E}),onClick:D,children:["success"===E?(0,eh.jsx)(Ll,{strokeWidth:2.5}):(0,eh.jsx)(H4,{}),(0,eh.jsx)("span",{children:"success"===E?m("copied"):"error"===E?m("copyFailed",{defaultValue:"Could not copy"}):m("copyToClipboard")||void 0})]})]}),(0,eh.jsx)("div",{className:"memori-share-button--dropdown-divider"}),(0,eh.jsx)("div",{className:"memori-share-button--dropdown-section memori-share-button--dropdown-section-social",children:F.map(e=>{let t=e.icon;return(0,eh.jsxs)("button",{type:"button",className:(b(tT))("memori-share-button--inline-item",{"memori-share-button--menu-item--flash":T===e.id}),onClick:()=>{j(e),P(e.id)},children:[(0,eh.jsx)(t,{"aria-hidden":!0}),(0,eh.jsx)("span",{children:e.title})]},e.id)})}),o&&(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("div",{className:"memori-share-button--dropdown-divider"}),(0,eh.jsxs)("div",{className:"memori-share-button--qr-content",children:[(0,eh.jsx)($w,{id:"qr-canvas",value:null!=v?v:"",size:96,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:B,x:void 0,y:void 0,height:24,width:24,excavate:!0}}),(0,eh.jsxs)("button",{type:"button",className:"memori-share-button--qr-download",onClick:U,children:[(0,eh.jsx)(H5,{"aria-hidden":!0}),(0,eh.jsx)("span",{children:m("widget.downloadQrCode")||m("download",{defaultValue:"Download"})})]})]})]})]});return"inline"===p?(0,eh.jsx)("div",{className:(b(tT))("memori-share-button--inline-list",u),children:G}):(0,eh.jsxs)(xm,{onOpenChange:e=>{S(e),e||(R(),O(),A("idle"))},className:(b(tT))("memori-share-button",{"memori-share-button--align-left":"left"===s},u),children:[(0,eh.jsx)(_H,{content:m("widget.share")||void 0,placement:"bottom",children:(0,eh.jsx)(xm.Trigger,{showChevron:!1,className:"memori-share-button--trigger",render:e=>(0,eh.jsx)(Gc,{...e,variant:h,active:w,title:String(d||m("widget.share")||"Share"),"aria-label":String(d||m("widget.share")||"Share"),icon:(0,eh.jsx)($h,{"aria-hidden":!0}),className:(b(tT))({"memori-share-button--trigger-menu-item":"menu-item"===c}),children:"menu-item"===c||d?(0,eh.jsx)("span",{className:"memori-header--action-label",children:d||m("widget.share")}):void 0})})}),(0,eh.jsx)(xm.Menu,{className:"memori-share-button--dropdown-menu",children:(0,eh.jsxs)("div",{ref:N,className:"memori-share-button--dropdown-content",onMouseLeave:()=>{var e;let t=document.activeElement;t instanceof HTMLElement&&(null==(e=N.current)?void 0:e.contains(t))&&t.blur()},children:[(0,eh.jsxs)("div",{className:"memori-share-button--dropdown-section",children:[t&&n&&H&&(0,eh.jsx)(xm.Item,{closeOnClick:!1,className:(b(tT))("memori-share-button--menu-item",{"memori-share-button--menu-item--flash":"share-chat"===T}),onClick:()=>{window.open(H,"_blank"),P("share-chat")},icon:(0,eh.jsx)($h,{}),children:(0,eh.jsx)("span",{className:"memori-share-button--dropdown-item-content",children:m("widget.shareChat")||"Share chat"})},"shared"),l&&l.length>0&&(0,eh.jsx)(xm.Item,{closeOnClick:!1,className:(b(tT))("memori-share-button--menu-item",{"memori-share-button--menu-item--flash":"export-pdf"===T}),onClick:z,disabled:_,icon:(0,eh.jsx)(Hy,{}),children:(0,eh.jsx)("span",{className:"memori-share-button--dropdown-item-content",children:_?m("exportChatHistory.exporting")||"Exporting...":m("exportChatHistory.exportPDF")||"Export chat as PDF"})},"export-pdf"),(0,eh.jsx)(xm.Item,{closeOnClick:!1,className:(b(tT))("memori-share-button--menu-item","memori-share-button--copy-item",{"memori-share-button--copy-item--success":"success"===E,"memori-share-button--copy-item--error":"error"===E}),onClick:D,icon:"success"===E?(0,eh.jsx)(Ll,{className:"memori-share-button--copy-icon","aria-hidden":!0,strokeWidth:2.5}):(0,eh.jsx)(H4,{className:"memori-share-button--copy-icon","aria-hidden":!0}),children:(0,eh.jsx)("span",{className:"memori-share-button--dropdown-item-content memori-share-button--copy-label","aria-live":"polite",children:"success"===E?m("copied"):"error"===E?m("copyFailed",{defaultValue:"Could not copy"}):m("copyToClipboard")||void 0})})]}),(0,eh.jsx)("div",{className:"memori-share-button--dropdown-divider"}),(0,eh.jsx)("div",{className:"memori-share-button--dropdown-section",children:F.map(e=>{let t=e.icon;return(0,eh.jsx)(xm.Item,{closeOnClick:!1,className:(b(tT))("memori-share-button--menu-item",{"memori-share-button--menu-item--flash":T===e.id}),onClick:()=>{j(e),P(e.id)},icon:(0,eh.jsx)(t,{}),children:(0,eh.jsx)("span",{className:"memori-share-button--dropdown-item-content",children:e.title})},e.id)})}),o&&(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("div",{className:"memori-share-button--dropdown-divider"}),(0,eh.jsx)(xm.Item,{closeOnClick:!1,className:(b(tT))("memori-share-button--menu-item","memori-share-button--qr-item",{"memori-share-button--menu-item--flash":"qr-download"===T}),onClick:U,children:(0,eh.jsxs)("div",{className:"memori-share-button--qr-content",children:[(0,eh.jsx)($w,{id:"qr-canvas",value:null!=v?v:"",size:128,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:B,x:void 0,y:void 0,height:32,width:32,excavate:!0}}),(0,eh.jsxs)("button",{type:"button",className:"memori-share-button--qr-download",onClick:e=>{e.stopPropagation(),U()},children:[(0,eh.jsx)(H5,{"aria-hidden":!0}),(0,eh.jsx)("span",{children:String(m("widget.downloadQrCode")||m("download",{defaultValue:"Download"}))})]})]})})]})]})})]})},em=ec("85Hg2");let $M=Math.PI/180;var em=(ec("85Hg2"),ec("85Hg2"));let $N=(0,em.createContext)(null),$R=$N.Provider;function $O(){let e=(0,em.useContext)($N);if(null==e)throw Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return e}var em=ec("85Hg2"),$P={};!function(e){"use strict";function t(e){var t,n,r,i;for(n=1,r=arguments.length;n<r;n++)for(t in i=arguments[n])e[t]=i[t];return e}var n,r,i,a,o,s,l,u,c,d,h=Object.create||function(){function e(){}return function(t){return e.prototype=t,new e}}();function p(e,t){var n=Array.prototype.slice;if(e.bind)return e.bind.apply(e,n.call(arguments,1));var r=n.call(arguments,2);return function(){return e.apply(t,r.length?r.concat(n.call(arguments)):arguments)}}var m=0;function f(e){return"_leaflet_id"in e||(e._leaflet_id=++m),e._leaflet_id}function g(e,t,n){var r,i,a,o;return o=function(){r=!1,i&&(a.apply(n,i),i=!1)},a=function(){r?i=arguments:(e.apply(n,arguments),setTimeout(o,t),r=!0)}}function v(e,t,n){var r=t[1],i=t[0],a=r-i;return e===r&&n?e:((e-i)%a+a)%a+i}function y(){return!1}function b(e,t){if(!1===t)return e;var n=Math.pow(10,void 0===t?6:t);return Math.round(e*n)/n}function _(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function x(e){return _(e).split(/\s+/)}function w(e,t){for(var n in Object.prototype.hasOwnProperty.call(e,"options")||(e.options=e.options?h(e.options):{}),t)e.options[n]=t[n];return e.options}function S(e,t,n){var r=[];for(var i in e)r.push(encodeURIComponent(n?i.toUpperCase():i)+"="+encodeURIComponent(e[i]));return(t&&-1!==t.indexOf("?")?"&":"?")+r.join("&")}var E=/\{ *([\w_ -]+) *\}/g;function A(e,t){return e.replace(E,function(e,n){var r=t[n];if(void 0===r)throw Error("No value provided for variable "+e);return"function"==typeof r&&(r=r(t)),r})}var T=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function I(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return -1}var C="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function M(e){return window["webkit"+e]||window["moz"+e]||window["ms"+e]}var N=0;function R(e){var t=+new Date,n=Math.max(0,16-(t-N));return N=t+n,window.setTimeout(e,n)}var O=window.requestAnimationFrame||M("RequestAnimationFrame")||R,P=window.cancelAnimationFrame||M("CancelAnimationFrame")||M("CancelRequestAnimationFrame")||function(e){window.clearTimeout(e)};function k(e,t,n){if(!n||O!==R)return O.call(window,p(e,t));e.call(t)}function D(e){e&&P.call(window,e)}function B(){}B.extend=function(e){var n=function(){w(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},r=n.__super__=this.prototype,i=h(r);for(var a in i.constructor=n,n.prototype=i,this)Object.prototype.hasOwnProperty.call(this,a)&&"prototype"!==a&&"__super__"!==a&&(n[a]=this[a]);return e.statics&&t(n,e.statics),e.includes&&(function(e){if("u">typeof L&&L&&L.Mixin){e=T(e)?e:[e];for(var t=0;t<e.length;t++)e[t]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",Error().stack)}}(e.includes),t.apply(null,[i].concat(e.includes))),t(i,e),delete i.statics,delete i.includes,i.options&&(i.options=r.options?h(r.options):{},t(i.options,e.options)),i._initHooks=[],i.callInitHooks=function(){if(!this._initHooksCalled){r.callInitHooks&&r.callInitHooks.call(this),this._initHooksCalled=!0;for(var e=0,t=i._initHooks.length;e<t;e++)i._initHooks[e].call(this)}},n},B.include=function(e){var n=this.prototype.options;return t(this.prototype,e),e.options&&(this.prototype.options=n,this.mergeOptions(e.options)),this},B.mergeOptions=function(e){return t(this.prototype.options,e),this},B.addInitHook=function(e){var t=Array.prototype.slice.call(arguments,1),n="function"==typeof e?e:function(){this[e].apply(this,t)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n),this};var F={on:function(e,t,n){if("object"==typeof e)for(var r in e)this._on(r,e[r],t);else{e=x(e);for(var i=0,a=e.length;i<a;i++)this._on(e[i],t,n)}return this},off:function(e,t,n){if(arguments.length)if("object"==typeof e)for(var r in e)this._off(r,e[r],t);else{e=x(e);for(var i=1==arguments.length,a=0,o=e.length;a<o;a++)i?this._off(e[a]):this._off(e[a],t,n)}else delete this._events;return this},_on:function(e,t,n,r){if("function"!=typeof t)return void console.warn("wrong listener type: "+typeof t);if(!1===this._listens(e,t,n)){n===this&&(n=void 0);var i={fn:t,ctx:n};r&&(i.once=!0),this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(i)}},_off:function(e,t,n){if(this._events&&(r=this._events[e])){if(1==arguments.length){if(this._firingCount)for(i=0,a=r.length;i<a;i++)r[i].fn=y;delete this._events[e];return}if("function"!=typeof t)return void console.warn("wrong listener type: "+typeof t);var r,i,a,o=this._listens(e,t,n);if(!1!==o){var s=r[o];this._firingCount&&(s.fn=y,this._events[e]=r=r.slice()),r.splice(o,1)}}},fire:function(e,n,r){if(!this.listens(e,r))return this;var i=t({},n,{type:e,target:this,sourceTarget:n&&n.sourceTarget||this});if(this._events){var a=this._events[e];if(a){this._firingCount=this._firingCount+1||1;for(var o=0,s=a.length;o<s;o++){var l=a[o],u=l.fn;l.once&&this.off(e,u,l.ctx),u.call(l.ctx||this,i)}this._firingCount--}}return r&&this._propagateEvent(i),this},listens:function(e,t,n,r){"string"!=typeof e&&console.warn('"string" type argument expected');var i=t;"function"!=typeof t&&(r=!!t,i=void 0,n=void 0);var a=this._events&&this._events[e];if(a&&a.length&&!1!==this._listens(e,i,n))return!0;if(r){for(var o in this._eventParents)if(this._eventParents[o].listens(e,t,n,r))return!0}return!1},_listens:function(e,t,n){if(!this._events)return!1;var r=this._events[e]||[];if(!t)return!!r.length;n===this&&(n=void 0);for(var i=0,a=r.length;i<a;i++)if(r[i].fn===t&&r[i].ctx===n)return i;return!1},once:function(e,t,n){if("object"==typeof e)for(var r in e)this._on(r,e[r],t,!0);else{e=x(e);for(var i=0,a=e.length;i<a;i++)this._on(e[i],t,n,!0)}return this},addEventParent:function(e){return this._eventParents=this._eventParents||{},this._eventParents[f(e)]=e,this},removeEventParent:function(e){return this._eventParents&&delete this._eventParents[f(e)],this},_propagateEvent:function(e){for(var n in this._eventParents)this._eventParents[n].fire(e.type,t({layer:e.target,propagatedFrom:e.target},e),!0)}};F.addEventListener=F.on,F.removeEventListener=F.clearAllEventListeners=F.off,F.addOneTimeEventListener=F.once,F.fireEvent=F.fire,F.hasEventListeners=F.listens;var U=B.extend(F);function j(e,t,n){this.x=n?Math.round(e):e,this.y=n?Math.round(t):t}var z=Math.trunc||function(e){return e>0?Math.floor(e):Math.ceil(e)};function H(e,t,n){return e instanceof j?e:T(e)?new j(e[0],e[1]):null==e?e:"object"==typeof e&&"x"in e&&"y"in e?new j(e.x,e.y):new j(e,t,n)}function G(e,t){if(e)for(var n=t?[e,t]:e,r=0,i=n.length;r<i;r++)this.extend(n[r])}function V(e,t){return!e||e instanceof G?e:new G(e,t)}function W(e,t){if(e)for(var n=t?[e,t]:e,r=0,i=n.length;r<i;r++)this.extend(n[r])}function q(e,t){return e instanceof W?e:new W(e,t)}function $(e,t,n){if(isNaN(e)||isNaN(t))throw Error("Invalid LatLng object: ("+e+", "+t+")");this.lat=+e,this.lng=+t,void 0!==n&&(this.alt=+n)}function J(e,t,n){return e instanceof $?e:T(e)&&"object"!=typeof e[0]?3===e.length?new $(e[0],e[1],e[2]):2===e.length?new $(e[0],e[1]):null:null==e?e:"object"==typeof e&&"lat"in e?new $(e.lat,"lng"in e?e.lng:e.lon,e.alt):void 0===t?null:new $(e,t,n)}j.prototype={clone:function(){return new j(this.x,this.y)},add:function(e){return this.clone()._add(H(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(H(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new j(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new j(this.x/e.x,this.y/e.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=z(this.x),this.y=z(this.y),this},distanceTo:function(e){var t=(e=H(e)).x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},equals:function(e){return(e=H(e)).x===this.x&&e.y===this.y},contains:function(e){return Math.abs((e=H(e)).x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+b(this.x)+", "+b(this.y)+")"}},G.prototype={extend:function(e){var t,n;if(!e)return this;if(e instanceof j||"number"==typeof e[0]||"x"in e)t=n=H(e);else if(t=(e=V(e)).min,n=e.max,!t||!n)return this;return this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)):(this.min=t.clone(),this.max=n.clone()),this},getCenter:function(e){return H((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,e)},getBottomLeft:function(){return H(this.min.x,this.max.y)},getTopRight:function(){return H(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(e){var t,n;return(e="number"==typeof e[0]||e instanceof j?H(e):V(e))instanceof G?(t=e.min,n=e.max):t=n=e,t.x>=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=V(e);var t=this.min,n=this.max,r=e.min,i=e.max,a=i.x>=t.x&&r.x<=n.x,o=i.y>=t.y&&r.y<=n.y;return a&&o},overlaps:function(e){e=V(e);var t=this.min,n=this.max,r=e.min,i=e.max,a=i.x>t.x&&r.x<n.x,o=i.y>t.y&&r.y<n.y;return a&&o},isValid:function(){return!!(this.min&&this.max)},pad:function(e){var t=this.min,n=this.max,r=Math.abs(t.x-n.x)*e,i=Math.abs(t.y-n.y)*e;return V(H(t.x-r,t.y-i),H(n.x+r,n.y+i))},equals:function(e){return!!e&&(e=V(e),this.min.equals(e.getTopLeft())&&this.max.equals(e.getBottomRight()))}},W.prototype={extend:function(e){var t,n,r=this._southWest,i=this._northEast;if(e instanceof $)t=e,n=e;else if(!(e instanceof W))return e?this.extend(J(e)||q(e)):this;else if(t=e._southWest,n=e._northEast,!t||!n)return this;return r||i?(r.lat=Math.min(t.lat,r.lat),r.lng=Math.min(t.lng,r.lng),i.lat=Math.max(n.lat,i.lat),i.lng=Math.max(n.lng,i.lng)):(this._southWest=new $(t.lat,t.lng),this._northEast=new $(n.lat,n.lng)),this},pad:function(e){var t=this._southWest,n=this._northEast,r=Math.abs(t.lat-n.lat)*e,i=Math.abs(t.lng-n.lng)*e;return new W(new $(t.lat-r,t.lng-i),new $(n.lat+r,n.lng+i))},getCenter:function(){return new $((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new $(this.getNorth(),this.getWest())},getSouthEast:function(){return new $(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(e){e="number"==typeof e[0]||e instanceof $||"lat"in e?J(e):q(e);var t,n,r=this._southWest,i=this._northEast;return e instanceof W?(t=e.getSouthWest(),n=e.getNorthEast()):t=n=e,t.lat>=r.lat&&n.lat<=i.lat&&t.lng>=r.lng&&n.lng<=i.lng},intersects:function(e){e=q(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),i=e.getNorthEast(),a=i.lat>=t.lat&&r.lat<=n.lat,o=i.lng>=t.lng&&r.lng<=n.lng;return a&&o},overlaps:function(e){e=q(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),i=e.getNorthEast(),a=i.lat>t.lat&&r.lat<n.lat,o=i.lng>t.lng&&r.lng<n.lng;return a&&o},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(e,t){return!!e&&(e=q(e),this._southWest.equals(e.getSouthWest(),t)&&this._northEast.equals(e.getNorthEast(),t))},isValid:function(){return!!(this._southWest&&this._northEast)}},$.prototype={equals:function(e,t){return!!e&&(e=J(e),Math.max(Math.abs(this.lat-e.lat),Math.abs(this.lng-e.lng))<=(void 0===t?1e-9:t))},toString:function(e){return"LatLng("+b(this.lat,e)+", "+b(this.lng,e)+")"},distanceTo:function(e){return Y.distance(this,J(e))},wrap:function(){return Y.wrapLatLng(this)},toBounds:function(e){var t=180*e/0x2637f09,n=t/Math.cos(Math.PI/180*this.lat);return q([this.lat-t,this.lng-n],[this.lat+t,this.lng+n])},clone:function(){return new $(this.lat,this.lng,this.alt)}};var K={latLngToPoint:function(e,t){var n=this.projection.project(e),r=this.scale(t);return this.transformation._transform(n,r)},pointToLatLng:function(e,t){var n=this.scale(t),r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},scale:function(e){return 256*Math.pow(2,e)},zoom:function(e){return Math.log(e/256)/Math.LN2},getProjectedBounds:function(e){if(this.infinite)return null;var t=this.projection.bounds,n=this.scale(e);return new G(this.transformation.transform(t.min,n),this.transformation.transform(t.max,n))},infinite:!1,wrapLatLng:function(e){var t=this.wrapLng?v(e.lng,this.wrapLng,!0):e.lng;return new $(this.wrapLat?v(e.lat,this.wrapLat,!0):e.lat,t,e.alt)},wrapLatLngBounds:function(e){var t=e.getCenter(),n=this.wrapLatLng(t),r=t.lat-n.lat,i=t.lng-n.lng;if(0===r&&0===i)return e;var a=e.getSouthWest(),o=e.getNorthEast();return new W(new $(a.lat-r,a.lng-i),new $(o.lat-r,o.lng-i))}},Y=t({},K,{wrapLng:[-180,180],R:6371e3,distance:function(e,t){var n=Math.PI/180,r=e.lat*n,i=t.lat*n,a=Math.sin((t.lat-e.lat)*n/2),o=Math.sin((t.lng-e.lng)*n/2),s=a*a+Math.cos(r)*Math.cos(i)*o*o,l=2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s));return this.R*l}}),X={R:6378137,MAX_LATITUDE:85.0511287798,project:function(e){var t=Math.PI/180,n=this.MAX_LATITUDE,r=Math.sin(Math.max(Math.min(n,e.lat),-n)*t);return new j(this.R*e.lng*t,this.R*Math.log((1+r)/(1-r))/2)},unproject:function(e){var t=180/Math.PI;return new $((2*Math.atan(Math.exp(e.y/this.R))-Math.PI/2)*t,e.x*t/this.R)},bounds:new G([-(l=6378137*Math.PI),-l],[l,l])};function Z(e,t,n,r){if(T(e)){this._a=e[0],this._b=e[1],this._c=e[2],this._d=e[3];return}this._a=e,this._b=t,this._c=n,this._d=r}function Q(e,t,n,r){return new Z(e,t,n,r)}Z.prototype={transform:function(e,t){return this._transform(e.clone(),t)},_transform:function(e,t){return e.x=(t=t||1)*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e},untransform:function(e,t){return t=t||1,new j((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}};var ee=t({},Y,{code:"EPSG:3857",projection:X,transformation:Q(u=.5/(Math.PI*X.R),.5,-u,.5)}),et=t({},ee,{code:"EPSG:900913"});function en(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function er(e,t){var n,r,i,a,o,s,l="";for(n=0,i=e.length;n<i;n++){for(r=0,a=(o=e[n]).length;r<a;r++)s=o[r],l+=(r?"L":"M")+s.x+" "+s.y;l+=t?eD.svg?"z":"x":""}return l||"M0 0"}var ei=document.documentElement.style,ea="ActiveXObject"in window,eo=ea&&!document.addEventListener,es="msLaunchUri"in navigator&&!("documentMode"in document),el=eL("webkit"),eu=eL("android"),ec=eL("android 2")||eL("android 3"),ed=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),eh=eu&&eL("Google")&&ed<537&&!("AudioNode"in window),ep=!!window.opera,em=!es&&eL("chrome"),ef=eL("gecko")&&!el&&!ep&&!ea,eg=!em&&eL("safari"),ev=eL("phantom"),ey="OTransition"in ei,eb=0===navigator.platform.indexOf("Win"),e_=ea&&"transition"in ei,ex="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ec,ew="MozPerspective"in ei,eS=!window.L_DISABLE_3D&&(e_||ex||ew)&&!ey&&!ev,eE="u">typeof orientation||eL("mobile"),eA=!window.PointerEvent&&window.MSPointerEvent,eT=!!(window.PointerEvent||eA),eI="ontouchstart"in window||!!window.TouchEvent,eC=!window.L_NO_TOUCH&&(eI||eT),eM=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,eN=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",y,t),window.removeEventListener("testPassiveEventSupport",y,t)}catch(e){}return e}(),eR=!!document.createElement("canvas").getContext,eO=!!(document.createElementNS&&en("svg").createSVGRect),eP=!!eO&&((c=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===(c.firstChild&&c.firstChild.namespaceURI)),ek=!eO&&function(){try{var e=document.createElement("div");e.innerHTML='<v:shape adj="1"/>';var t=e.firstChild;return t.style.behavior="url(#default#VML)",t&&"object"==typeof t.adj}catch(e){return!1}}();function eL(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var eD={ie:ea,ielt9:eo,edge:es,webkit:el,android:eu,android23:ec,androidStock:eh,opera:ep,chrome:em,gecko:ef,safari:eg,phantom:ev,opera12:ey,win:eb,ie3d:e_,webkit3d:ex,gecko3d:ew,any3d:eS,mobile:eE,mobileWebkit:eE&&el,mobileWebkit3d:eE&&ex,msPointer:eA,pointer:eT,touch:eC,touchNative:eI,mobileOpera:eE&&ep,mobileGecko:eE&&ef,retina:eM,passiveEvents:eN,canvas:eR,svg:eO,vml:ek,inlineSvg:eP,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},eB=eD.msPointer?"MSPointerDown":"pointerdown",eF=eD.msPointer?"MSPointerMove":"pointermove",eU=eD.msPointer?"MSPointerUp":"pointerup",ej=eD.msPointer?"MSPointerCancel":"pointercancel",ez={touchstart:eB,touchmove:eF,touchend:eU,touchcancel:ej},eH={touchstart:function(e,t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&tw(t),eJ(e,t)},touchmove:eJ,touchend:eJ,touchcancel:eJ},eG={},eV=!1;function eW(e){eG[e.pointerId]=e}function eq(e){eG[e.pointerId]&&(eG[e.pointerId]=e)}function e$(e){delete eG[e.pointerId]}function eJ(e,t){if(t.pointerType!==(t.MSPOINTER_TYPE_MOUSE||"mouse")){for(var n in t.touches=[],eG)t.touches.push(eG[n]);t.changedTouches=[t],e(t)}}var eK=tt(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),eY=tt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),eX="webkitTransition"===eY||"OTransition"===eY?eY+"End":"transitionend";function eZ(e){return"string"==typeof e?document.getElementById(e):e}function eQ(e,t){var n=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!n||"auto"===n)&&document.defaultView){var r=document.defaultView.getComputedStyle(e,null);n=r?r[t]:null}return"auto"===n?null:n}function e0(e,t,n){var r=document.createElement(e);return r.className=t||"",n&&n.appendChild(r),r}function e1(e){var t=e.parentNode;t&&t.removeChild(e)}function e2(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function e3(e){var t=e.parentNode;t&&t.lastChild!==e&&t.appendChild(e)}function e4(e){var t=e.parentNode;t&&t.firstChild!==e&&t.insertBefore(e,t.firstChild)}function e5(e,t){if(void 0!==e.classList)return e.classList.contains(t);var n=e9(e);return n.length>0&&RegExp("(^|\\s)"+t+"(\\s|$)").test(n)}function e6(e,t){if(void 0!==e.classList)for(var n=x(t),r=0,i=n.length;r<i;r++)e.classList.add(n[r]);else if(!e5(e,t)){var a=e9(e);e7(e,(a?a+" ":"")+t)}}function e8(e,t){void 0!==e.classList?e.classList.remove(t):e7(e,_((" "+e9(e)+" ").replace(" "+t+" "," ")))}function e7(e,t){void 0===e.className.baseVal?e.className=t:e.className.baseVal=t}function e9(e){return e.correspondingElement&&(e=e.correspondingElement),void 0===e.className.baseVal?e.className:e.className.baseVal}function te(e,t){"opacity"in e.style?e.style.opacity=t:"filter"in e.style&&function(e,t){var n=!1,r="DXImageTransform.Microsoft.Alpha";try{n=e.filters.item(r)}catch(e){if(1===t)return}t=Math.round(100*t),n?(n.Enabled=100!==t,n.Opacity=t):e.style.filter+=" progid:"+r+"(opacity="+t+")"}(e,t)}function tt(e){for(var t=document.documentElement.style,n=0;n<e.length;n++)if(e[n]in t)return e[n];return!1}function tn(e,t,n){var r=t||new j(0,0);e.style[eK]=(eD.ie3d?"translate("+r.x+"px,"+r.y+"px)":"translate3d("+r.x+"px,"+r.y+"px,0)")+(n?" scale("+n+")":"")}function tr(e,t){e._leaflet_pos=t,eD.any3d?tn(e,t):(e.style.left=t.x+"px",e.style.top=t.y+"px")}function ti(e){return e._leaflet_pos||new j(0,0)}if("onselectstart"in document)n=function(){th(window,"selectstart",tw)},r=function(){tm(window,"selectstart",tw)};else{var ta=tt(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);n=function(){if(ta){var e=document.documentElement.style;i=e[ta],e[ta]="none"}},r=function(){ta&&(document.documentElement.style[ta]=i,i=void 0)}}function to(){th(window,"dragstart",tw)}function ts(){tm(window,"dragstart",tw)}function tl(e){for(;-1===e.tabIndex;)e=e.parentNode;e.style&&(tu(),a=e,o=e.style.outlineStyle,e.style.outlineStyle="none",th(window,"keydown",tu))}function tu(){a&&(a.style.outlineStyle=o,a=void 0,o=void 0,tm(window,"keydown",tu))}function tc(e){do e=e.parentNode;while((!e.offsetWidth||!e.offsetHeight)&&e!==document.body)return e}function td(e){var t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}function th(e,t,n,r){if(t&&"object"==typeof t)for(var i in t)tv(e,i,t[i],n);else{t=x(t);for(var a=0,o=t.length;a<o;a++)tv(e,t[a],n,r)}return this}var tp="_leaflet_events";function tm(e,t,n,r){if(1==arguments.length)tf(e),delete e[tp];else if(t&&"object"==typeof t)for(var i in t)ty(e,i,t[i],n);else if(t=x(t),2==arguments.length)tf(e,function(e){return -1!==I(t,e)});else for(var a=0,o=t.length;a<o;a++)ty(e,t[a],n,r);return this}function tf(e,t){for(var n in e[tp]){var r=n.split(/\d/)[0];(!t||t(r))&&ty(e,r,null,null,n)}}var tg={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function tv(e,t,n,r){var i=t+f(n)+(r?"_"+f(r):"");if(e[tp]&&e[tp][i])return this;var a=function(t){return n.call(r||e,t||window.event)},o=a;!eD.touchNative&&eD.pointer&&0===t.indexOf("touch")?a=function(e,t,n){return("touchstart"===t&&(eV||(document.addEventListener(eB,eW,!0),document.addEventListener(eF,eq,!0),document.addEventListener(eU,e$,!0),document.addEventListener(ej,e$,!0),eV=!0)),eH[t])?(n=eH[t].bind(this,n),e.addEventListener(ez[t],n,!1),n):(console.warn("wrong event specified:",t),y)}(e,t,a):eD.touch&&"dblclick"===t?a=function(e,t){e.addEventListener("dblclick",t);var n,r=0;function i(e){if(1!==e.detail){n=e.detail;return}if("mouse"!==e.pointerType&&(!e.sourceCapabilities||e.sourceCapabilities.firesTouchEvents)){var i=tE(e);if(!i.some(function(e){return e instanceof HTMLLabelElement&&e.attributes.for})||i.some(function(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement})){var a=Date.now();a-r<=200?2==++n&&t(function(e){var t,n,r={};for(n in e)t=e[n],r[n]=t&&t.bind?t.bind(e):t;return e=r,r.type="dblclick",r.detail=2,r.isTrusted=!1,r._simulated=!0,r}(e)):n=1,r=a}}}return e.addEventListener("click",i),{dblclick:t,simDblclick:i}}(e,a):"addEventListener"in e?"touchstart"===t||"touchmove"===t||"wheel"===t||"mousewheel"===t?e.addEventListener(tg[t]||t,a,!!eD.passiveEvents&&{passive:!1}):"mouseenter"===t||"mouseleave"===t?(a=function(t){tC(e,t=t||window.event)&&o(t)},e.addEventListener(tg[t],a,!1)):e.addEventListener(t,o,!1):e.attachEvent("on"+t,a),e[tp]=e[tp]||{},e[tp][i]=a}function ty(e,t,n,r,i){i=i||t+f(n)+(r?"_"+f(r):"");var a=e[tp]&&e[tp][i];if(!a)return this;!eD.touchNative&&eD.pointer&&0===t.indexOf("touch")?ez[t]?e.removeEventListener(ez[t],a,!1):console.warn("wrong event specified:",t):eD.touch&&"dblclick"===t?(e.removeEventListener("dblclick",a.dblclick),e.removeEventListener("click",a.simDblclick)):"removeEventListener"in e?e.removeEventListener(tg[t]||t,a,!1):e.detachEvent("on"+t,a),e[tp][i]=null}function tb(e){return e.stopPropagation?e.stopPropagation():e.originalEvent?e.originalEvent._stopped=!0:e.cancelBubble=!0,this}function t_(e){return tv(e,"wheel",tb),this}function tx(e){return th(e,"mousedown touchstart dblclick contextmenu",tb),e._leaflet_disable_click=!0,this}function tw(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this}function tS(e){return tw(e),tb(e),this}function tE(e){if(e.composedPath)return e.composedPath();for(var t=[],n=e.target;n;)t.push(n),n=n.parentNode;return t}function tA(e,t){if(!t)return new j(e.clientX,e.clientY);var n=td(t),r=n.boundingClientRect;return new j((e.clientX-r.left)/n.x-t.clientLeft,(e.clientY-r.top)/n.y-t.clientTop)}var tT=eD.linux&&eD.chrome?window.devicePixelRatio:eD.mac?3*window.devicePixelRatio:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function tI(e){return eD.edge?e.wheelDeltaY/2:e.deltaY&&0===e.deltaMode?-e.deltaY/tT:e.deltaY&&1===e.deltaMode?-(20*e.deltaY):e.deltaY&&2===e.deltaMode?-(60*e.deltaY):e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&32765>Math.abs(e.detail)?-(20*e.detail):e.detail?-(60*(e.detail/32765)):0}function tC(e,t){var n=t.relatedTarget;if(!n)return!0;try{for(;n&&n!==e;)n=n.parentNode}catch(e){return!1}return n!==e}var tM=U.extend({run:function(e,t,n,r){this.stop(),this._el=e,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=ti(e),this._offset=t.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=k(this._animate,this),this._step()},_step:function(e){var t=new Date-this._startTime,n=1e3*this._duration;t<n?this._runFrame(this._easeOut(t/n),e):(this._runFrame(1),this._complete())},_runFrame:function(e,t){var n=this._startPos.add(this._offset.multiplyBy(e));t&&n._round(),tr(this._el,n),this.fire("step")},_complete:function(){D(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(e){return 1-Math.pow(1-e,this._easeOutPower)}}),tN=U.extend({options:{crs:ee,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(e,t){t=w(this,t),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(e),this._initLayout(),this._onResize=p(this._onResize,this),this._initEvents(),t.maxBounds&&this.setMaxBounds(t.maxBounds),void 0!==t.zoom&&(this._zoom=this._limitZoom(t.zoom)),t.center&&void 0!==t.zoom&&this.setView(J(t.center),t.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=eY&&eD.any3d&&!eD.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),th(this._proxy,eX,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(e,n,r){return(n=void 0===n?this._zoom:this._limitZoom(n),e=this._limitCenter(J(e),n,this.options.maxBounds),r=r||{},this._stop(),this._loaded&&!r.reset&&!0!==r&&(void 0!==r.animate&&(r.zoom=t({animate:r.animate},r.zoom),r.pan=t({animate:r.animate,duration:r.duration},r.pan)),this._zoom!==n?this._tryAnimatedZoom&&this._tryAnimatedZoom(e,n,r.zoom):this._tryAnimatedPan(e,r.pan)))?(clearTimeout(this._sizeTimer),this):(this._resetView(e,n,r.pan&&r.pan.noMoveStart),this)},setZoom:function(e,t){return this._loaded?this.setView(this.getCenter(),e,{zoom:t}):(this._zoom=e,this)},zoomIn:function(e,t){return e=e||(eD.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+e,t)},zoomOut:function(e,t){return e=e||(eD.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-e,t)},setZoomAround:function(e,t,n){var r=this.getZoomScale(t),i=this.getSize().divideBy(2),a=(e instanceof j?e:this.latLngToContainerPoint(e)).subtract(i).multiplyBy(1-1/r),o=this.containerPointToLatLng(i.add(a));return this.setView(o,t,{zoom:n})},_getBoundsCenterZoom:function(e,t){t=t||{},e=e.getBounds?e.getBounds():q(e);var n=H(t.paddingTopLeft||t.padding||[0,0]),r=H(t.paddingBottomRight||t.padding||[0,0]),i=this.getBoundsZoom(e,!1,n.add(r));if(1/0===(i="number"==typeof t.maxZoom?Math.min(t.maxZoom,i):i))return{center:e.getCenter(),zoom:i};var a=r.subtract(n).divideBy(2),o=this.project(e.getSouthWest(),i),s=this.project(e.getNorthEast(),i);return{center:this.unproject(o.add(s).divideBy(2).add(a),i),zoom:i}},fitBounds:function(e,t){if(!(e=q(e)).isValid())throw Error("Bounds are not valid.");var n=this._getBoundsCenterZoom(e,t);return this.setView(n.center,n.zoom,t)},fitWorld:function(e){return this.fitBounds([[-90,-180],[90,180]],e)},panTo:function(e,t){return this.setView(e,this._zoom,{pan:t})},panBy:function(e,t){if(e=H(e).round(),t=t||{},!e.x&&!e.y)return this.fire("moveend");if(!0!==t.animate&&!this.getSize().contains(e))return this._resetView(this.unproject(this.project(this.getCenter()).add(e)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new tM,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),t.noMoveStart||this.fire("movestart"),!1!==t.animate){e6(this._mapPane,"leaflet-pan-anim");var n=this._getMapPanePos().subtract(e).round();this._panAnim.run(this._mapPane,n,t.duration||.25,t.easeLinearity)}else this._rawPanBy(e),this.fire("move").fire("moveend");return this},flyTo:function(e,t,n){if(!1===(n=n||{}).animate||!eD.any3d)return this.setView(e,t,n);this._stop();var r=this.project(this.getCenter()),i=this.project(e),a=this.getSize(),o=this._zoom;e=J(e),t=void 0===t?o:t;var s=Math.max(a.x,a.y),l=s*this.getZoomScale(o,t),u=i.distanceTo(r)||1;function c(e){var t=(l*l-s*s+(e?-1:1)*2.0164*2.0164*u*u)/(2*(e?l:s)*2.0164*u),n=Math.sqrt(t*t+1)-t;return n<1e-9?-18:Math.log(n)}function d(e){return(Math.exp(e)-Math.exp(-e))/2}function h(e){return(Math.exp(e)+Math.exp(-e))/2}var p=c(0),m=Date.now(),f=(c(1)-p)/1.42,g=n.duration?1e3*n.duration:1e3*f*.8;function v(){var n,a=(Date.now()-m)/g,l=(1-Math.pow(1-a,1.5))*f;a<=1?(this._flyToFrame=k(v,this),this._move(this.unproject(r.add(i.subtract(r).multiplyBy(s*(h(p)*(d(n=p+1.42*l)/h(n))-d(p))/2.0164/u)),o),this.getScaleZoom(s/(s*(h(p)/h(p+1.42*l))),o),{flyTo:!0})):this._move(e,t)._moveEnd(!0)}return this._moveStart(!0,n.noMoveStart),v.call(this),this},flyToBounds:function(e,t){var n=this._getBoundsCenterZoom(e,t);return this.flyTo(n.center,n.zoom,t)},setMaxBounds:function(e){return(e=q(e),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),e.isValid())?(this.options.maxBounds=e,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(e){var t=this.options.minZoom;return(this.options.minZoom=e,this._loaded&&t!==e&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom))?this.setZoom(e):this},setMaxZoom:function(e){var t=this.options.maxZoom;return(this.options.maxZoom=e,this._loaded&&t!==e&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom))?this.setZoom(e):this},panInsideBounds:function(e,t){this._enforcingBounds=!0;var n=this.getCenter(),r=this._limitCenter(n,this._zoom,q(e));return n.equals(r)||this.panTo(r,t),this._enforcingBounds=!1,this},panInside:function(e,t){var n=H((t=t||{}).paddingTopLeft||t.padding||[0,0]),r=H(t.paddingBottomRight||t.padding||[0,0]),i=this.project(this.getCenter()),a=this.project(e),o=this.getPixelBounds(),s=V([o.min.add(n),o.max.subtract(r)]),l=s.getSize();if(!s.contains(a)){this._enforcingBounds=!0;var u=a.subtract(s.getCenter()),c=s.extend(a).getSize().subtract(l);i.x+=u.x<0?-c.x:c.x,i.y+=u.y<0?-c.y:c.y,this.panTo(this.unproject(i),t),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=t({animate:!1,pan:!0},!0===e?{animate:!0}:e);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var r=this.getSize(),i=n.divideBy(2).round(),a=r.divideBy(2).round(),o=i.subtract(a);return o.x||o.y?(e.animate&&e.pan?this.panBy(o):(e.pan&&this._rawPanBy(o),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(p(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:r})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=t({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=p(this._handleGeolocationResponse,this),r=p(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,r,e):navigator.geolocation.getCurrentPosition(n,r,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var t=e.code,n=e.message||(1===t?"permission denied":2===t?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:t,message:"Geolocation error: "+n+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var t=new $(e.coords.latitude,e.coords.longitude),n=t.toBounds(2*e.coords.accuracy),r=this._locateOptions;if(r.setView){var i=this.getBoundsZoom(n);this.setView(t,r.maxZoom?Math.min(i,r.maxZoom):i)}var a={latlng:t,bounds:n,timestamp:e.timestamp};for(var o in e.coords)"number"==typeof e.coords[o]&&(a[o]=e.coords[o]);this.fire("locationfound",a)}},addHandler:function(e,t){if(!t)return this;var n=this[e]=new t(this);return this._handlers.push(n),this.options[e]&&n.enable(),this},remove:function(){var e;if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}for(e in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),e1(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(D(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[e].remove();for(e in this._panes)e1(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,t){var n=e0("div","leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),t||this._mapPane);return e&&(this._panes[e]=n),n},getCenter:function(){return(this._checkIfLoaded(),this._lastCenter&&!this._moved())?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds();return new W(this.unproject(e.getBottomLeft()),this.unproject(e.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(e,t,n){e=q(e),n=H(n||[0,0]);var r=this.getZoom()||0,i=this.getMinZoom(),a=this.getMaxZoom(),o=e.getNorthWest(),s=e.getSouthEast(),l=this.getSize().subtract(n),u=V(this.project(s,r),this.project(o,r)).getSize(),c=eD.any3d?this.options.zoomSnap:1,d=l.x/u.x,h=l.y/u.y,p=t?Math.max(d,h):Math.min(d,h);return r=this.getScaleZoom(p,r),c&&(r=c/100*Math.round(r/(c/100)),r=t?Math.ceil(r/c)*c:Math.floor(r/c)*c),Math.max(i,Math.min(a,r))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new j(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,t){var n=this._getTopLeftPoint(e,t);return new G(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(void 0===e?this.getZoom():e)},getPane:function(e){return"string"==typeof e?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,t){var n=this.options.crs;return t=void 0===t?this._zoom:t,n.scale(e)/n.scale(t)},getScaleZoom:function(e,t){var n=this.options.crs;t=void 0===t?this._zoom:t;var r=n.zoom(e*n.scale(t));return isNaN(r)?1/0:r},project:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.latLngToPoint(J(e),t)},unproject:function(e,t){return t=void 0===t?this._zoom:t,this.options.crs.pointToLatLng(H(e),t)},layerPointToLatLng:function(e){var t=H(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){return this.project(J(e))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(J(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(q(e))},distance:function(e,t){return this.options.crs.distance(J(e),J(t))},containerPointToLayerPoint:function(e){return H(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return H(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(H(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(J(e)))},mouseEventToContainerPoint:function(e){return tA(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=eZ(e);if(t){if(t._leaflet_id)throw Error("Map container is already initialized.")}else throw Error("Map container not found.");th(t,"scroll",this._onScroll,this),this._containerId=f(t)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&eD.any3d,e6(e,"leaflet-container"+(eD.touch?" leaflet-touch":"")+(eD.retina?" leaflet-retina":"")+(eD.ielt9?" leaflet-oldie":"")+(eD.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var t=eQ(e,"position");"absolute"!==t&&"relative"!==t&&"fixed"!==t&&"sticky"!==t&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),tr(this._mapPane,new j(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(e6(e.markerPane,"leaflet-zoom-hide"),e6(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,t,n){tr(this._mapPane,new j(0,0));var r=!this._loaded;this._loaded=!0,t=this._limitZoom(t),this.fire("viewprereset");var i=this._zoom!==t;this._moveStart(i,n)._move(e,t)._moveEnd(i),this.fire("viewreset"),r&&this.fire("load")},_moveStart:function(e,t){return e&&this.fire("zoomstart"),t||this.fire("movestart"),this},_move:function(e,t,n,r){void 0===t&&(t=this._zoom);var i=this._zoom!==t;return this._zoom=t,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),r?n&&n.pinch&&this.fire("zoom",n):((i||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return D(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){tr(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw Error("Set map center and zoom first.")},_initEvents:function(e){this._targets={},this._targets[f(this._container)]=this;var t=e?tm:th;t(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&t(window,"resize",this._onResize,this),eD.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){D(this._resizeRequest),this._resizeRequest=k(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,t){for(var n,r=[],i="mouseout"===t||"mouseover"===t,a=e.target||e.srcElement,o=!1;a;){if((n=this._targets[f(a)])&&("click"===t||"preclick"===t)&&this._draggableMoved(n)){o=!0;break}if(n&&n.listens(t,!0)&&(i&&!tC(a,e)||(r.push(n),i)))break;if(a===this._container)break;a=a.parentNode}return!r.length&&!o&&!i&&this.listens(t,!0)&&(r=[this]),r},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var t=e.target||e.srcElement;if(!(!this._loaded||t._leaflet_disable_events||"click"===e.type&&this._isClickDisabled(t))){var n=e.type;"mousedown"===n&&tl(t),this._fireDOMEvent(e,n)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,n,r){if("click"===e.type){var i=t({},e);i.type="preclick",this._fireDOMEvent(i,i.type,r)}var a=this._findEventTargets(e,n);if(r){for(var o=[],s=0;s<r.length;s++)r[s].listens(n,!0)&&o.push(r[s]);a=o.concat(a)}if(a.length){"contextmenu"===n&&tw(e);var l=a[0],u={originalEvent:e};if("keypress"!==e.type&&"keydown"!==e.type&&"keyup"!==e.type){var c=l.getLatLng&&(!l._radius||l._radius<=10);u.containerPoint=c?this.latLngToContainerPoint(l.getLatLng()):this.mouseEventToContainerPoint(e),u.layerPoint=this.containerPointToLayerPoint(u.containerPoint),u.latlng=c?l.getLatLng():this.layerPointToLatLng(u.layerPoint)}for(s=0;s<a.length;s++)if(a[s].fire(n,u,!0),u.originalEvent._stopped||!1===a[s].options.bubblingMouseEvents&&-1!==I(this._mouseEvents,n))return}},_draggableMoved:function(e){return(e=e.dragging&&e.dragging.enabled()?e:this).dragging&&e.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var e=0,t=this._handlers.length;e<t;e++)this._handlers[e].disable()},whenReady:function(e,t){return this._loaded?e.call(t||this,{target:this}):this.on("load",e,t),this},_getMapPanePos:function(){return ti(this._mapPane)||new j(0,0)},_moved:function(){var e=this._getMapPanePos();return e&&!e.equals([0,0])},_getTopLeftPoint:function(e,t){return(e&&void 0!==t?this._getNewPixelOrigin(e,t):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(e,t){var n=this.getSize()._divideBy(2);return this.project(e,t)._subtract(n)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(e,t,n){var r=this._getNewPixelOrigin(n,t);return this.project(e,t)._subtract(r)},_latLngBoundsToNewLayerBounds:function(e,t,n){var r=this._getNewPixelOrigin(n,t);return V([this.project(e.getSouthWest(),t)._subtract(r),this.project(e.getNorthWest(),t)._subtract(r),this.project(e.getSouthEast(),t)._subtract(r),this.project(e.getNorthEast(),t)._subtract(r)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(e){return this.latLngToLayerPoint(e).subtract(this._getCenterLayerPoint())},_limitCenter:function(e,t,n){if(!n)return e;var r=this.project(e,t),i=this.getSize().divideBy(2),a=new G(r.subtract(i),r.add(i)),o=this._getBoundsOffset(a,n,t);return 1>=Math.abs(o.x)&&1>=Math.abs(o.y)?e:this.unproject(r.add(o),t)},_limitOffset:function(e,t){if(!t)return e;var n=this.getPixelBounds(),r=new G(n.min.add(e),n.max.add(e));return e.add(this._getBoundsOffset(r,t))},_getBoundsOffset:function(e,t,n){var r=V(this.project(t.getNorthEast(),n),this.project(t.getSouthWest(),n)),i=r.min.subtract(e.min),a=r.max.subtract(e.max);return new j(this._rebound(i.x,-a.x),this._rebound(i.y,-a.y))},_rebound:function(e,t){return e+t>0?Math.round(e-t)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(t))},_limitZoom:function(e){var t=this.getMinZoom(),n=this.getMaxZoom(),r=eD.any3d?this.options.zoomSnap:1;return r&&(e=Math.round(e/r)*r),Math.max(t,Math.min(n,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){e8(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,t){var n=this._getCenterOffset(e)._trunc();return(!0===(t&&t.animate)||!!this.getSize().contains(n))&&(this.panBy(n,t),!0)},_createAnimProxy:function(){var e=this._proxy=e0("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(e){var t=this._proxy.style[eK];tn(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),t===this._proxy.style[eK]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){e1(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),t=this.getZoom();tn(this._proxy,this.project(e,t),this.getZoomScale(t,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,t,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),i=this._getCenterOffset(e)._divideBy(1-1/r);return(!0===n.animate||!!this.getSize().contains(i))&&(k(function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(e,t,!0)},this),!0)},_animateZoom:function(e,t,n,r){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=t,e6(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:t,noUpdate:r}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(p(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&e8(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}}),tR=B.extend({options:{position:"topright"},initialize:function(e){w(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var t=this._container=this.onAdd(e),n=this.getPosition(),r=e._controlCorners[n];return e6(t,"leaflet-control"),-1!==n.indexOf("bottom")?r.insertBefore(t,r.firstChild):r.appendChild(t),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(e1(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),tO=function(e){return new tR(e)};tN.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},t="leaflet-",n=this._controlContainer=e0("div",t+"control-container",this._container);function r(r,i){e[r+i]=e0("div",t+r+" "+t+i,n)}r("top","left"),r("top","right"),r("bottom","left"),r("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)e1(this._controlCorners[e]);e1(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var tP=tR.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,t,n,r){return n<r?-1:+(r<n)}},initialize:function(e,t,n){for(var r in w(this,n),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,e)this._addLayer(e[r],r);for(r in t)this._addLayer(t[r],r,!0)},onAdd:function(e){this._initLayout(),this._update(),this._map=e,e.on("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(e){return tR.prototype.addTo.call(this,e),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(e,t){return this._addLayer(e,t),this._map?this._update():this},addOverlay:function(e,t){return this._addLayer(e,t,!0),this._map?this._update():this},removeLayer:function(e){e.off("add remove",this._onLayerChange,this);var t=this._getLayer(f(e));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){e6(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var e=this._map.getSize().y-(this._container.offsetTop+50);return e<this._section.clientHeight?(e6(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=e+"px"):e8(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return e8(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var e="leaflet-control-layers",t=this._container=e0("div",e),n=this.options.collapsed;t.setAttribute("aria-haspopup",!0),tx(t),t_(t);var r=this._section=e0("section",e+"-list");n&&(this._map.on("click",this.collapse,this),th(t,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var i=this._layersLink=e0("a",e+"-toggle",t);i.href="#",i.title="Layers",i.setAttribute("role","button"),th(i,{keydown:function(e){13===e.keyCode&&this._expandSafely()},click:function(e){tw(e),this._expandSafely()}},this),n||this.expand(),this._baseLayersList=e0("div",e+"-base",r),this._separator=e0("div",e+"-separator",r),this._overlaysList=e0("div",e+"-overlays",r),t.appendChild(r)},_getLayer:function(e){for(var t=0;t<this._layers.length;t++)if(this._layers[t]&&f(this._layers[t].layer)===e)return this._layers[t]},_addLayer:function(e,t,n){this._map&&e.on("add remove",this._onLayerChange,this),this._layers.push({layer:e,name:t,overlay:n}),this.options.sortLayers&&this._layers.sort(p(function(e,t){return this.options.sortFunction(e.layer,t.layer,e.name,t.name)},this)),this.options.autoZIndex&&e.setZIndex&&(this._lastZIndex++,e.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;e2(this._baseLayersList),e2(this._overlaysList),this._layerControlInputs=[];var e,t,n,r,i=0;for(n=0;n<this._layers.length;n++)r=this._layers[n],this._addItem(r),t=t||r.overlay,e=e||!r.overlay,i+=+!r.overlay;return this.options.hideSingleBase&&(e=e&&i>1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=t&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var t=this._getLayer(f(e.target)),n=t.overlay?"add"===e.type?"overlayadd":"overlayremove":"add"===e.type?"baselayerchange":null;n&&this._map.fire(n,t)},_createRadioElement:function(e,t){var n=document.createElement("div");return n.innerHTML='<input type="radio" class="leaflet-control-layers-selector" name="'+e+'"'+(t?' checked="checked"':"")+"/>",n.firstChild},_addItem:function(e){var t,n=document.createElement("label"),r=this._map.hasLayer(e.layer);e.overlay?((t=document.createElement("input")).type="checkbox",t.className="leaflet-control-layers-selector",t.defaultChecked=r):t=this._createRadioElement("leaflet-base-layers_"+f(this),r),this._layerControlInputs.push(t),t.layerId=f(e.layer),th(t,"click",this._onInputClick,this);var i=document.createElement("span");i.innerHTML=" "+e.name;var a=document.createElement("span");return n.appendChild(a),a.appendChild(t),a.appendChild(i),(e.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var e,t,n=this._layerControlInputs,r=[],i=[];this._handlingClick=!0;for(var a=n.length-1;a>=0;a--)e=n[a],t=this._getLayer(e.layerId).layer,e.checked?r.push(t):e.checked||i.push(t);for(a=0;a<i.length;a++)this._map.hasLayer(i[a])&&this._map.removeLayer(i[a]);for(a=0;a<r.length;a++)this._map.hasLayer(r[a])||this._map.addLayer(r[a]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var e,t,n=this._layerControlInputs,r=this._map.getZoom(),i=n.length-1;i>=0;i--)e=n[i],t=this._getLayer(e.layerId).layer,e.disabled=void 0!==t.options.minZoom&&r<t.options.minZoom||void 0!==t.options.maxZoom&&r>t.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,th(e,"click",tw),this.expand();var t=this;setTimeout(function(){tm(e,"click",tw),t._preventClick=!1})}}),tk=tR.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(e){var t="leaflet-control-zoom",n=e0("div",t+" leaflet-bar"),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,t+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,t+"-out",n,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(e){e.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(e.shiftKey?3:1))},_zoomOut:function(e){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,t,n,r,i){var a=e0("a",n,r);return a.innerHTML=e,a.href="#",a.title=t,a.setAttribute("role","button"),a.setAttribute("aria-label",t),tx(a),th(a,"click",tS),th(a,"click",i,this),th(a,"click",this._refocusOnMap,this),a},_updateDisabled:function(){var e=this._map,t="leaflet-disabled";e8(this._zoomInButton,t),e8(this._zoomOutButton,t),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(e6(this._zoomOutButton,t),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(e6(this._zoomInButton,t),this._zoomInButton.setAttribute("aria-disabled","true"))}});tN.mergeOptions({zoomControl:!0}),tN.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new tk,this.addControl(this.zoomControl))});var tL=tR.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var t="leaflet-control-scale",n=e0("div",t),r=this.options;return this._addScales(r,t+"-line",n),e.on(r.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),n},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=e0("div",t,n)),e.imperial&&(this._iScale=e0("div",t,n))},_update:function(){var e=this._map,t=e.getSize().y/2,n=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(n)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var t=this._getRoundNum(e);this._updateScale(this._mScale,t<1e3?t+" m":t/1e3+" km",t/e)},_updateImperial:function(e){var t,n,r,i=3.2808399*e;i>5280?(t=i/5280,n=this._getRoundNum(t),this._updateScale(this._iScale,n+" mi",n/t)):(r=this._getRoundNum(i),this._updateScale(this._iScale,r+" ft",r/i))},_updateScale:function(e,t,n){e.style.width=Math.round(this.options.maxWidth*n)+"px",e.innerHTML=t},_getRoundNum:function(e){var t=Math.pow(10,(Math.floor(e)+"").length-1),n=e/t;return t*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),tD=tR.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(eD.inlineSvg?'<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg> ':"")+"Leaflet</a>"},initialize:function(e){w(this,e),this._attributions={}},onAdd:function(e){for(var t in e.attributionControl=this,this._container=e0("div","leaflet-control-attribution"),tx(this._container),e._layers)e._layers[t].getAttribution&&this.addAttribution(e._layers[t].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e&&(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update()),this},removeAttribution:function(e){return e&&this._attributions[e]&&(this._attributions[e]--,this._update()),this},_update:function(){if(this._map){var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(", ")),this._container.innerHTML=n.join(' <span aria-hidden="true">|</span> ')}}});tN.mergeOptions({attributionControl:!0}),tN.addInitHook(function(){this.options.attributionControl&&new tD().addTo(this)}),tR.Layers=tP,tR.Zoom=tk,tR.Scale=tL,tR.Attribution=tD,tO.layers=function(e,t,n){return new tP(e,t,n)},tO.zoom=function(e){return new tk(e)},tO.scale=function(e){return new tL(e)},tO.attribution=function(e){return new tD(e)};var tB=B.extend({initialize:function(e){this._map=e},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}});tB.addTo=function(e,t){return e.addHandler(t,this),this};var tF=eD.touch?"touchstart mousedown":"mousedown",tU=U.extend({options:{clickTolerance:3},initialize:function(e,t,n,r){w(this,r),this._element=e,this._dragStartTarget=t||e,this._preventOutline=n},enable:function(){this._enabled||(th(this._dragStartTarget,tF,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(tU._dragging===this&&this.finishDrag(!0),tm(this._dragStartTarget,tF,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(!(!this._enabled||(this._moved=!1,e5(this._element,"leaflet-zoom-anim")))){if(e.touches&&1!==e.touches.length){tU._dragging===this&&this.finishDrag();return}if(!tU._dragging&&!e.shiftKey&&(1===e.which||1===e.button||e.touches)&&(tU._dragging=this,this._preventOutline&&tl(this._element),to(),n(),!this._moving)){this.fire("down");var t=e.touches?e.touches[0]:e,r=tc(this._element);this._startPoint=new j(t.clientX,t.clientY),this._startPos=ti(this._element),this._parentScale=td(r);var i="mousedown"===e.type;th(document,i?"mousemove":"touchmove",this._onMove,this),th(document,i?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var t=e.touches&&1===e.touches.length?e.touches[0]:e,n=new j(t.clientX,t.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)<this.options.clickTolerance||(n.x/=this._parentScale.x,n.y/=this._parentScale.y,tw(e),this._moved||(this.fire("dragstart"),this._moved=!0,e6(document.body,"leaflet-dragging"),this._lastTarget=e.target||e.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),e6(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(n),this._moving=!0,this._lastEvent=e,this._updatePosition()))}},_updatePosition:function(){var e={originalEvent:this._lastEvent};this.fire("predrag",e),tr(this._element,this._newPos),this.fire("drag",e)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(e){e8(document.body,"leaflet-dragging"),this._lastTarget&&(e8(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),tm(document,"mousemove touchmove",this._onMove,this),tm(document,"mouseup touchend touchcancel",this._onUp,this),ts(),r();var t=this._moved&&this._moving;this._moving=!1,tU._dragging=!1,t&&this.fire("dragend",{noInertia:e,distance:this._newPos.distanceTo(this._startPos)})}});function tj(e,t,n){var r,i,a,o,s,l,u,c,d,h=[1,4,2,8];for(i=0,u=e.length;i<u;i++)e[i]._code=t$(e[i],t);for(o=0;o<4;o++){for(c=h[o],r=[],i=0,a=(u=e.length)-1;i<u;a=i++)s=e[i],l=e[a],s._code&c?l._code&c||((d=tq(l,s,c,t,n))._code=t$(d,t),r.push(d)):(l._code&c&&((d=tq(l,s,c,t,n))._code=t$(d,t),r.push(d)),r.push(s));e=r}return e}function tz(e,t){if(!e||0===e.length)throw Error("latlngs not passed");tK(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var n,r,i,a,o,s,l,u,c,d=J([0,0]),h=q(e);h.getNorthWest().distanceTo(h.getSouthWest())*h.getNorthEast().distanceTo(h.getNorthWest())<1700&&(d=tH(e));var p=e.length,m=[];for(n=0;n<p;n++){var f=J(e[n]);m.push(t.project(J([f.lat-d.lat,f.lng-d.lng])))}for(s=l=u=0,n=0,r=p-1;n<p;r=n++)i=m[n],a=m[r],o=i.y*a.x-a.y*i.x,l+=(i.x+a.x)*o,u+=(i.y+a.y)*o,s+=3*o;c=0===s?m[0]:[l/s,u/s];var g=t.unproject(H(c));return J([g.lat+d.lat,g.lng+d.lng])}function tH(e){for(var t=0,n=0,r=0,i=0;i<e.length;i++){var a=J(e[i]);t+=a.lat,n+=a.lng,r++}return J([t/r,n/r])}function tG(e,t){if(!t||!e.length)return e.slice();var n=t*t;return function(e,t){var n=e.length,r=new("u">typeof Uint8Array?Uint8Array:Array)(n);r[0]=r[n-1]=1,function e(t,n,r,i,a){var o,s,l,u=0;for(s=i+1;s<=a-1;s++)(l=tJ(t[s],t[i],t[a],!0))>u&&(o=s,u=l);u>r&&(n[o]=1,e(t,n,r,i,o),e(t,n,r,o,a))}(e,r,t,0,n-1);var i,a=[];for(i=0;i<n;i++)r[i]&&a.push(e[i]);return a}(e=function(e,t){for(var n=[e[0]],r=1,i=0,a=e.length;r<a;r++)(function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r})(e[r],e[i])>t&&(n.push(e[r]),i=r);return i<a-1&&n.push(e[a-1]),n}(e,n),n)}function tV(e,t,n){return Math.sqrt(tJ(e,t,n,!0))}function tW(e,t,n,r,i){var a,o,l,u=r?s:t$(e,n),c=t$(t,n);for(s=c;;){if(!(u|c))return[e,t];if(u&c)return!1;l=t$(o=tq(e,t,a=u||c,n,i),n),a===u?(e=o,u=l):(t=o,c=l)}}function tq(e,t,n,r,i){var a,o,s=t.x-e.x,l=t.y-e.y,u=r.min,c=r.max;return 8&n?(a=e.x+s*(c.y-e.y)/l,o=c.y):4&n?(a=e.x+s*(u.y-e.y)/l,o=u.y):2&n?(a=c.x,o=e.y+l*(c.x-e.x)/s):1&n&&(a=u.x,o=e.y+l*(u.x-e.x)/s),new j(a,o,i)}function t$(e,t){var n=0;return e.x<t.min.x?n|=1:e.x>t.max.x&&(n|=2),e.y<t.min.y?n|=4:e.y>t.max.y&&(n|=8),n}function tJ(e,t,n,r){var i,a=t.x,o=t.y,s=n.x-a,l=n.y-o,u=s*s+l*l;return u>0&&((i=((e.x-a)*s+(e.y-o)*l)/u)>1?(a=n.x,o=n.y):i>0&&(a+=s*i,o+=l*i)),s=e.x-a,l=e.y-o,r?s*s+l*l:new j(a,o)}function tK(e){return!T(e[0])||"object"!=typeof e[0][0]&&void 0!==e[0][0]}function tY(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),tK(e)}function tX(e,t){if(!e||0===e.length)throw Error("latlngs not passed");tK(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var n,r,i,a,o,s,l,u,c=J([0,0]),d=q(e);d.getNorthWest().distanceTo(d.getSouthWest())*d.getNorthEast().distanceTo(d.getNorthWest())<1700&&(c=tH(e));var h=e.length,p=[];for(n=0;n<h;n++){var m=J(e[n]);p.push(t.project(J([m.lat-c.lat,m.lng-c.lng])))}for(n=0,r=0;n<h-1;n++)r+=p[n].distanceTo(p[n+1])/2;if(0===r)u=p[0];else for(n=0,a=0;n<h-1;n++)if(o=p[n],s=p[n+1],(a+=i=o.distanceTo(s))>r){l=(a-r)/i,u=[s.x-l*(s.x-o.x),s.y-l*(s.y-o.y)];break}var f=t.unproject(H(u));return J([f.lat+c.lat,f.lng+c.lng])}var tZ={project:function(e){return new j(e.lng,e.lat)},unproject:function(e){return new $(e.y,e.x)},bounds:new G([-180,-90],[180,90])},tQ={R:6378137,R_MINOR:6356752.314245179,bounds:new G([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(e){var t=Math.PI/180,n=this.R,r=e.lat*t,i=this.R_MINOR/n,a=Math.sqrt(1-i*i),o=a*Math.sin(r);return r=-n*Math.log(Math.max(Math.tan(Math.PI/4-r/2)/Math.pow((1-o)/(1+o),a/2),1e-10)),new j(e.lng*t*n,r)},unproject:function(e){for(var t,n=180/Math.PI,r=this.R,i=this.R_MINOR/r,a=Math.sqrt(1-i*i),o=Math.exp(-e.y/r),s=Math.PI/2-2*Math.atan(o),l=0,u=.1;l<15&&Math.abs(u)>1e-7;l++)u=Math.PI/2-2*Math.atan(o*(t=Math.pow((1-(t=a*Math.sin(s)))/(1+t),a/2)))-s,s+=u;return new $(s*n,e.x*n/r)}},t0=t({},Y,{code:"EPSG:3395",projection:tQ,transformation:Q(d=.5/(Math.PI*tQ.R),.5,-d,.5)}),t1=t({},Y,{code:"EPSG:4326",projection:tZ,transformation:Q(1/180,1,-1/180,.5)}),t2=t({},K,{projection:tZ,transformation:Q(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lng-e.lng,r=t.lat-e.lat;return Math.sqrt(n*n+r*r)},infinite:!0});K.Earth=Y,K.EPSG3395=t0,K.EPSG3857=ee,K.EPSG900913=et,K.EPSG4326=t1,K.Simple=t2;var t3=U.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[f(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[f(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var t=e.target;if(t.hasLayer(this)){if(this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents){var n=this.getEvents();t.on(n,this),this.once("remove",function(){t.off(n,this)},this)}this.onAdd(t),this.fire("add"),t.fire("layeradd",{layer:this})}}});tN.include({addLayer:function(e){if(!e._layerAdd)throw Error("The provided object is not a Layer.");var t=f(e);return this._layers[t]||(this._layers[t]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e)),this},removeLayer:function(e){var t=f(e);return this._layers[t]&&(this._loaded&&e.onRemove(this),delete this._layers[t],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null),this},hasLayer:function(e){return f(e)in this._layers},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},_addLayers:function(e){e=e?T(e)?e:[e]:[];for(var t=0,n=e.length;t<n;t++)this.addLayer(e[t])},_addZoomLimit:function(e){isNaN(e.options.maxZoom)&&isNaN(e.options.minZoom)||(this._zoomBoundLayers[f(e)]=e,this._updateZoomLevels())},_removeZoomLimit:function(e){var t=f(e);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var e=1/0,t=-1/0,n=this._getZoomSpan();for(var r in this._zoomBoundLayers){var i=this._zoomBoundLayers[r].options;e=void 0===i.minZoom?e:Math.min(e,i.minZoom),t=void 0===i.maxZoom?t:Math.max(t,i.maxZoom)}this._layersMaxZoom=-1/0===t?void 0:t,this._layersMinZoom=1/0===e?void 0:e,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var t4=t3.extend({initialize:function(e,t){var n,r;if(w(this,t),this._layers={},e)for(n=0,r=e.length;n<r;n++)this.addLayer(e[n])},addLayer:function(e){var t=this.getLayerId(e);return this._layers[t]=e,this._map&&this._map.addLayer(e),this},removeLayer:function(e){var t=e in this._layers?e:this.getLayerId(e);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(e){return("number"==typeof e?e:this.getLayerId(e))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(e){var t,n,r=Array.prototype.slice.call(arguments,1);for(t in this._layers)(n=this._layers[t])[e]&&n[e].apply(n,r);return this},onAdd:function(e){this.eachLayer(e.addLayer,e)},onRemove:function(e){this.eachLayer(e.removeLayer,e)},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},getLayer:function(e){return this._layers[e]},getLayers:function(){var e=[];return this.eachLayer(e.push,e),e},setZIndex:function(e){return this.invoke("setZIndex",e)},getLayerId:function(e){return f(e)}}),t5=t4.extend({addLayer:function(e){return this.hasLayer(e)?this:(e.addEventParent(this),t4.prototype.addLayer.call(this,e),this.fire("layeradd",{layer:e}))},removeLayer:function(e){return this.hasLayer(e)?(e in this._layers&&(e=this._layers[e]),e.removeEventParent(this),t4.prototype.removeLayer.call(this,e),this.fire("layerremove",{layer:e})):this},setStyle:function(e){return this.invoke("setStyle",e)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var e=new W;for(var t in this._layers){var n=this._layers[t];e.extend(n.getBounds?n.getBounds():n.getLatLng())}return e}}),t6=B.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(e){w(this,e)},createIcon:function(e){return this._createIcon("icon",e)},createShadow:function(e){return this._createIcon("shadow",e)},_createIcon:function(e,t){var n=this._getIconUrl(e);if(!n){if("icon"===e)throw Error("iconUrl not set in Icon options (see the docs).");return null}var r=this._createImg(n,t&&"IMG"===t.tagName?t:null);return this._setIconStyles(r,e),(this.options.crossOrigin||""===this.options.crossOrigin)&&(r.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),r},_setIconStyles:function(e,t){var n=this.options,r=n[t+"Size"];"number"==typeof r&&(r=[r,r]);var i=H(r),a=H("shadow"===t&&n.shadowAnchor||n.iconAnchor||i&&i.divideBy(2,!0));e.className="leaflet-marker-"+t+" "+(n.className||""),a&&(e.style.marginLeft=-a.x+"px",e.style.marginTop=-a.y+"px"),i&&(e.style.width=i.x+"px",e.style.height=i.y+"px")},_createImg:function(e,t){return(t=t||document.createElement("img")).src=e,t},_getIconUrl:function(e){return eD.retina&&this.options[e+"RetinaUrl"]||this.options[e+"Url"]}}),t8=t6.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(e){return"string"!=typeof t8.imagePath&&(t8.imagePath=this._detectIconPath()),(this.options.imagePath||t8.imagePath)+t6.prototype._getIconUrl.call(this,e)},_stripUrl:function(e){var t=function(e,t,n){var r=t.exec(e);return r&&r[n]};return(e=t(e,/^url\((['"])?(.+)\1\)$/,2))&&t(e,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var e=e0("div","leaflet-default-icon-path",document.body),t=eQ(e,"background-image")||eQ(e,"backgroundImage");if(document.body.removeChild(e),t=this._stripUrl(t))return t;var n=document.querySelector('link[href$="leaflet.css"]');return n?n.href.substring(0,n.href.length-11-1):""}}),t7=tB.extend({initialize:function(e){this._marker=e},addHooks:function(){var e=this._marker._icon;this._draggable||(this._draggable=new tU(e,e,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),e6(e,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&e8(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(e){var t=this._marker,n=t._map,r=this._marker.options.autoPanSpeed,i=this._marker.options.autoPanPadding,a=ti(t._icon),o=n.getPixelBounds(),s=n.getPixelOrigin(),l=V(o.min._subtract(s).add(i),o.max._subtract(s).subtract(i));if(!l.contains(a)){var u=H((Math.max(l.max.x,a.x)-l.max.x)/(o.max.x-l.max.x)-(Math.min(l.min.x,a.x)-l.min.x)/(o.min.x-l.min.x),(Math.max(l.max.y,a.y)-l.max.y)/(o.max.y-l.max.y)-(Math.min(l.min.y,a.y)-l.min.y)/(o.min.y-l.min.y)).multiplyBy(r);n.panBy(u,{animate:!1}),this._draggable._newPos._add(u),this._draggable._startPos._add(u),tr(t._icon,this._draggable._newPos),this._onDrag(e),this._panRequest=k(this._adjustPan.bind(this,e))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(e){this._marker.options.autoPan&&(D(this._panRequest),this._panRequest=k(this._adjustPan.bind(this,e)))},_onDrag:function(e){var t=this._marker,n=t._shadow,r=ti(t._icon),i=t._map.layerPointToLatLng(r);n&&tr(n,r),t._latlng=i,e.latlng=i,e.oldLatLng=this._oldLatLng,t.fire("move",e).fire("drag",e)},_onDragEnd:function(e){D(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",e)}}),t9=t3.extend({options:{icon:new t8,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(e,t){w(this,t),this._latlng=J(e)},onAdd:function(e){this._zoomAnimated=this._zoomAnimated&&e.options.markerZoomAnimation,this._zoomAnimated&&e.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(e){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&e.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(e){var t=this._latlng;return this._latlng=J(e),this.update(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},setZIndexOffset:function(e){return this.options.zIndexOffset=e,this.update()},getIcon:function(){return this.options.icon},setIcon:function(e){return this.options.icon=e,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var e=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(e)}return this},_initIcon:function(){var e=this.options,t="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),n=e.icon.createIcon(this._icon),r=!1;n!==this._icon&&(this._icon&&this._removeIcon(),r=!0,e.title&&(n.title=e.title),"IMG"===n.tagName&&(n.alt=e.alt||"")),e6(n,t),e.keyboard&&(n.tabIndex="0",n.setAttribute("role","button")),this._icon=n,e.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&th(n,"focus",this._panOnFocus,this);var i=e.icon.createShadow(this._shadow),a=!1;i!==this._shadow&&(this._removeShadow(),a=!0),i&&(e6(i,t),i.alt=""),this._shadow=i,e.opacity<1&&this._updateOpacity(),r&&this.getPane().appendChild(this._icon),this._initInteraction(),i&&a&&this.getPane(e.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&tm(this._icon,"focus",this._panOnFocus,this),e1(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&e1(this._shadow),this._shadow=null},_setPos:function(e){this._icon&&tr(this._icon,e),this._shadow&&tr(this._shadow,e),this._zIndex=e.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(e){this._icon&&(this._icon.style.zIndex=this._zIndex+e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center).round();this._setPos(t)},_initInteraction:function(){if(this.options.interactive&&(e6(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),t7)){var e=this.options.draggable;this.dragging&&(e=this.dragging.enabled(),this.dragging.disable()),this.dragging=new t7(this),e&&this.dragging.enable()}},setOpacity:function(e){return this.options.opacity=e,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var e=this.options.opacity;this._icon&&te(this._icon,e),this._shadow&&te(this._shadow,e)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var e=this._map;if(e){var t=this.options.icon.options,n=t.iconSize?H(t.iconSize):H(0,0),r=t.iconAnchor?H(t.iconAnchor):H(0,0);e.panInside(this._latlng,{paddingTopLeft:r,paddingBottomRight:n.subtract(r)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}}),ne=t3.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(e){this._renderer=e.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(e){return w(this,e),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&e&&Object.prototype.hasOwnProperty.call(e,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),nt=ne.extend({options:{fill:!0,radius:10},initialize:function(e,t){w(this,t),this._latlng=J(e),this._radius=this.options.radius},setLatLng:function(e){var t=this._latlng;return this._latlng=J(e),this.redraw(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(e){return this.options.radius=this._radius=e,this.redraw()},getRadius:function(){return this._radius},setStyle:function(e){var t=e&&e.radius||this._radius;return ne.prototype.setStyle.call(this,e),this.setRadius(t),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var e=this._radius,t=this._radiusY||e,n=this._clickTolerance(),r=[e+n,t+n];this._pxBounds=new G(this._point.subtract(r),this._point.add(r))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(e){return e.distanceTo(this._point)<=this._radius+this._clickTolerance()}}),nn=nt.extend({initialize:function(e,n,r){if("number"==typeof n&&(n=t({},r,{radius:n})),w(this,n),this._latlng=J(e),isNaN(this.options.radius))throw Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(e){return this._mRadius=e,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var e=[this._radius,this._radiusY||this._radius];return new W(this._map.layerPointToLatLng(this._point.subtract(e)),this._map.layerPointToLatLng(this._point.add(e)))},setStyle:ne.prototype.setStyle,_project:function(){var e=this._latlng.lng,t=this._latlng.lat,n=this._map,r=n.options.crs;if(r.distance===Y.distance){var i=Math.PI/180,a=this._mRadius/Y.R/i,o=n.project([t+a,e]),s=n.project([t-a,e]),l=o.add(s).divideBy(2),u=n.unproject(l).lat,c=Math.acos((Math.cos(a*i)-Math.sin(t*i)*Math.sin(u*i))/(Math.cos(t*i)*Math.cos(u*i)))/i;(isNaN(c)||0===c)&&(c=a/Math.cos(Math.PI/180*t)),this._point=l.subtract(n.getPixelOrigin()),this._radius=isNaN(c)?0:l.x-n.project([u,e-c]).x,this._radiusY=l.y-o.y}else{var d=r.unproject(r.project(this._latlng).subtract([this._mRadius,0]));this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(d).x}this._updateBounds()}}),nr=ne.extend({options:{smoothFactor:1,noClip:!1},initialize:function(e,t){w(this,t),this._setLatLngs(e)},getLatLngs:function(){return this._latlngs},setLatLngs:function(e){return this._setLatLngs(e),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(e){for(var t,n,r=1/0,i=null,a=tJ,o=0,s=this._parts.length;o<s;o++)for(var l=this._parts[o],u=1,c=l.length;u<c;u++){var d=a(e,t=l[u-1],n=l[u],!0);d<r&&(r=d,i=a(e,t,n))}return i&&(i.distance=Math.sqrt(r)),i},getCenter:function(){if(!this._map)throw Error("Must add layer to map before using getCenter()");return tX(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(e,t){return t=t||this._defaultShape(),e=J(e),t.push(e),this._bounds.extend(e),this.redraw()},_setLatLngs:function(e){this._bounds=new W,this._latlngs=this._convertLatLngs(e)},_defaultShape:function(){return tK(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(e){for(var t=[],n=tK(e),r=0,i=e.length;r<i;r++)n?(t[r]=J(e[r]),this._bounds.extend(t[r])):t[r]=this._convertLatLngs(e[r]);return t},_project:function(){var e=new G;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,e),this._bounds.isValid()&&e.isValid()&&(this._rawPxBounds=e,this._updateBounds())},_updateBounds:function(){var e=this._clickTolerance(),t=new j(e,e);this._rawPxBounds&&(this._pxBounds=new G([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(e,t,n){var r,i,a=e[0]instanceof $,o=e.length;if(a){for(r=0,i=[];r<o;r++)i[r]=this._map.latLngToLayerPoint(e[r]),n.extend(i[r]);t.push(i)}else for(r=0;r<o;r++)this._projectLatlngs(e[r],t,n)},_clipPoints:function(){var e=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(e)){if(this.options.noClip){this._parts=this._rings;return}var t,n,r,i,a,o,s,l=this._parts;for(t=0,r=0,i=this._rings.length;t<i;t++)for(n=0,a=(s=this._rings[t]).length;n<a-1;n++)(o=tW(s[n],s[n+1],e,n,!0))&&(l[r]=l[r]||[],l[r].push(o[0]),(o[1]!==s[n+1]||n===a-2)&&(l[r].push(o[1]),r++))}},_simplifyPoints:function(){for(var e=this._parts,t=this.options.smoothFactor,n=0,r=e.length;n<r;n++)e[n]=tG(e[n],t)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(e,t){var n,r,i,a,o,s,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(n=0,a=this._parts.length;n<a;n++)for(r=0,i=(o=(s=this._parts[n]).length)-1;r<o;i=r++)if((t||0!==r)&&tV(e,s[i],s[r])<=l)return!0;return!1}});nr._flat=tY;var ni=nr.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw Error("Must add layer to map before using getCenter()");return tz(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(e){var t=nr.prototype._convertLatLngs.call(this,e),n=t.length;return n>=2&&t[0]instanceof $&&t[0].equals(t[n-1])&&t.pop(),t},_setLatLngs:function(e){nr.prototype._setLatLngs.call(this,e),tK(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return tK(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,t=this.options.weight,n=new j(t,t);if(e=new G(e.min.subtract(n),e.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(e)){if(this.options.noClip){this._parts=this._rings;return}for(var r,i=0,a=this._rings.length;i<a;i++)(r=tj(this._rings[i],e,!0)).length&&this._parts.push(r)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(e){var t,n,r,i,a,o,s,l,u=!1;if(!this._pxBounds||!this._pxBounds.contains(e))return!1;for(i=0,s=this._parts.length;i<s;i++)for(a=0,o=(l=(t=this._parts[i]).length)-1;a<l;o=a++)n=t[a],r=t[o],n.y>e.y!=r.y>e.y&&e.x<(r.x-n.x)*(e.y-n.y)/(r.y-n.y)+n.x&&(u=!u);return u||nr.prototype._containsPoint.call(this,e,!0)}}),na=t5.extend({initialize:function(e,t){w(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t,n,r,i=T(e)?e:e.features;if(i){for(t=0,n=i.length;t<n;t++)((r=i[t]).geometries||r.geometry||r.features||r.coordinates)&&this.addData(r);return this}var a=this.options;if(a.filter&&!a.filter(e))return this;var o=no(e,a);return o?(o.feature=np(e),o.defaultOptions=o.options,this.resetStyle(o),a.onEachFeature&&a.onEachFeature(e,o),this.addLayer(o)):this},resetStyle:function(e){return void 0===e?this.eachLayer(this.resetStyle,this):(e.options=t({},e.defaultOptions),this._setLayerStyle(e,this.options.style),this)},setStyle:function(e){return this.eachLayer(function(t){this._setLayerStyle(t,e)},this)},_setLayerStyle:function(e,t){e.setStyle&&("function"==typeof t&&(t=t(e.feature)),e.setStyle(t))}});function no(e,t){var n,r,i,a="Feature"===e.type?e.geometry:e,o=a?a.coordinates:null,s=[],l=t&&t.pointToLayer,u=t&&t.coordsToLatLng||nl;if(!o&&!a)return null;switch(a.type){case"Point":return ns(l,e,n=u(o),t);case"MultiPoint":for(r=0,i=o.length;r<i;r++)n=u(o[r]),s.push(ns(l,e,n,t));return new t5(s);case"LineString":case"MultiLineString":return new nr(nu(o,+("LineString"!==a.type),u),t);case"Polygon":case"MultiPolygon":return new ni(nu(o,"Polygon"===a.type?1:2,u),t);case"GeometryCollection":for(r=0,i=a.geometries.length;r<i;r++){var c=no({geometry:a.geometries[r],type:"Feature",properties:e.properties},t);c&&s.push(c)}return new t5(s);case"FeatureCollection":for(r=0,i=a.features.length;r<i;r++){var d=no(a.features[r],t);d&&s.push(d)}return new t5(s);default:throw Error("Invalid GeoJSON object.")}}function ns(e,t,n,r){return e?e(t,n):new t9(n,r&&r.markersInheritOptions&&r)}function nl(e){return new $(e[1],e[0],e[2])}function nu(e,t,n){for(var r=[],i=0,a=e.length;i<a;i++)r.push(t?nu(e[i],t-1,n):(n||nl)(e[i]));return r}function nc(e,t){return void 0!==(e=J(e)).alt?[b(e.lng,t),b(e.lat,t),b(e.alt,t)]:[b(e.lng,t),b(e.lat,t)]}function nd(e,t,n,r){for(var i=[],a=0,o=e.length;a<o;a++)i.push(t?nd(e[a],tK(e[a])?0:t-1,n,r):nc(e[a],r));return!t&&n&&i.length>0&&i.push(i[0].slice()),i}function nh(e,n){return e.feature?t({},e.feature,{geometry:n}):np(n)}function np(e){return"Feature"===e.type||"FeatureCollection"===e.type?e:{type:"Feature",properties:{},geometry:e}}var nm={toGeoJSON:function(e){return nh(this,{type:"Point",coordinates:nc(this.getLatLng(),e)})}};function nf(e,t){return new na(e,t)}t9.include(nm),nn.include(nm),nt.include(nm),nr.include({toGeoJSON:function(e){var t=!tK(this._latlngs),n=nd(this._latlngs,+!!t,!1,e);return nh(this,{type:(t?"Multi":"")+"LineString",coordinates:n})}}),ni.include({toGeoJSON:function(e){var t=!tK(this._latlngs),n=t&&!tK(this._latlngs[0]),r=nd(this._latlngs,n?2:+!!t,!0,e);return t||(r=[r]),nh(this,{type:(n?"Multi":"")+"Polygon",coordinates:r})}}),t4.include({toMultiPoint:function(e){var t=[];return this.eachLayer(function(n){t.push(n.toGeoJSON(e).geometry.coordinates)}),nh(this,{type:"MultiPoint",coordinates:t})},toGeoJSON:function(e){var t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===t)return this.toMultiPoint(e);var n="GeometryCollection"===t,r=[];return(this.eachLayer(function(t){if(t.toGeoJSON){var i=t.toGeoJSON(e);if(n)r.push(i.geometry);else{var a=np(i);"FeatureCollection"===a.type?r.push.apply(r,a.features):r.push(a)}}}),n)?nh(this,{geometries:r,type:"GeometryCollection"}):{type:"FeatureCollection",features:r}}});var ng=t3.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,t,n){this._url=e,this._bounds=q(t),w(this,n)},onAdd:function(){!this._image&&(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(e6(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){e1(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&e3(this._image),this},bringToBack:function(){return this._map&&e4(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=q(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e="IMG"===this._url.tagName,t=this._image=e?this._url:e0("img");if(e6(t,"leaflet-image-layer"),this._zoomAnimated&&e6(t,"leaflet-zoom-animated"),this.options.className&&e6(t,this.options.className),t.onselectstart=y,t.onmousemove=y,t.onload=p(this.fire,this,"load"),t.onerror=p(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(t.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e){this._url=t.src;return}t.src=this._url,t.alt=this.options.alt},_animateZoom:function(e){var t=this._map.getZoomScale(e.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;tn(this._image,n,t)},_reset:function(){var e=this._image,t=new G(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=t.getSize();tr(e,t.min),e.style.width=n.x+"px",e.style.height=n.y+"px"},_updateOpacity:function(){te(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),nv=ng.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e="VIDEO"===this._url.tagName,t=this._image=e?this._url:e0("video");if(e6(t,"leaflet-image-layer"),this._zoomAnimated&&e6(t,"leaflet-zoom-animated"),this.options.className&&e6(t,this.options.className),t.onselectstart=y,t.onmousemove=y,t.onloadeddata=p(this.fire,this,"load"),e){for(var n=t.getElementsByTagName("source"),r=[],i=0;i<n.length;i++)r.push(n[i].src);this._url=n.length>0?r:[t.src];return}T(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(t.style,"objectFit")&&(t.style.objectFit="fill"),t.autoplay=!!this.options.autoplay,t.loop=!!this.options.loop,t.muted=!!this.options.muted,t.playsInline=!!this.options.playsInline;for(var a=0;a<this._url.length;a++){var o=e0("source");o.src=this._url[a],t.appendChild(o)}}}),ny=ng.extend({_initImage:function(){var e=this._image=this._url;e6(e,"leaflet-image-layer"),this._zoomAnimated&&e6(e,"leaflet-zoom-animated"),this.options.className&&e6(e,this.options.className),e.onselectstart=y,e.onmousemove=y}}),nb=t3.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(e,t){e&&(e instanceof $||T(e))?(this._latlng=J(e),w(this,t)):(w(this,e),this._source=t),this.options.content&&(this._content=this.options.content)},openOn:function(e){return e=arguments.length?e:this._source._map,e.hasLayer(this)||e.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(e){return this._map?this.close():(arguments.length?this._source=e:e=this._source,this._prepareOpen(),this.openOn(e._map)),this},onAdd:function(e){this._zoomAnimated=e._zoomAnimated,this._container||this._initLayout(),e._fadeAnimated&&te(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),e._fadeAnimated&&te(this._container,1),this.bringToFront(),this.options.interactive&&(e6(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(e){e._fadeAnimated?(te(this._container,0),this._removeTimeout=setTimeout(p(e1,void 0,this._container),200)):e1(this._container),this.options.interactive&&(e8(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(e){return this._latlng=J(e),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(e){return this._content=e,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var e={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&e3(this._container),this},bringToBack:function(){return this._map&&e4(this._container),this},_prepareOpen:function(e){var t=this._source;if(!t._map)return!1;if(t instanceof t5){t=null;var n=this._source._layers;for(var r in n)if(n[r]._map){t=n[r];break}if(!t)return!1;this._source=t}if(!e)if(t.getCenter)e=t.getCenter();else if(t.getLatLng)e=t.getLatLng();else if(t.getBounds)e=t.getBounds().getCenter();else throw Error("Unable to get source layer LatLng.");return this.setLatLng(e),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var e=this._contentNode,t="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof t)e.innerHTML=t;else{for(;e.hasChildNodes();)e.removeChild(e.firstChild);e.appendChild(t)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var e=this._map.latLngToLayerPoint(this._latlng),t=H(this.options.offset),n=this._getAnchor();this._zoomAnimated?tr(this._container,e.add(n)):t=t.add(e).add(n);var r=this._containerBottom=-t.y,i=this._containerLeft=-Math.round(this._containerWidth/2)+t.x;this._container.style.bottom=r+"px",this._container.style.left=i+"px"}},_getAnchor:function(){return[0,0]}});tN.include({_initOverlay:function(e,t,n,r){var i=t;return i instanceof e||(i=new e(r).setContent(t)),n&&i.setLatLng(n),i}}),t3.include({_initOverlay:function(e,t,n,r){var i=n;return i instanceof e?(w(i,r),i._source=this):(i=t&&!r?t:new e(r,this)).setContent(n),i}});var n_=nb.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(e){return e=arguments.length?e:this._source._map,!e.hasLayer(this)&&e._popup&&e._popup.options.autoClose&&e.removeLayer(e._popup),e._popup=this,nb.prototype.openOn.call(this,e)},onAdd:function(e){nb.prototype.onAdd.call(this,e),e.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof ne||this._source.on("preclick",tb))},onRemove:function(e){nb.prototype.onRemove.call(this,e),e.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof ne||this._source.off("preclick",tb))},getEvents:function(){var e=nb.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(e.preclick=this.close),this.options.keepInView&&(e.moveend=this._adjustPan),e},_initLayout:function(){var e="leaflet-popup",t=this._container=e0("div",e+" "+(this.options.className||"")+" leaflet-zoom-animated"),n=this._wrapper=e0("div",e+"-content-wrapper",t);if(this._contentNode=e0("div",e+"-content",n),tx(t),t_(this._contentNode),th(t,"contextmenu",tb),this._tipContainer=e0("div",e+"-tip-container",t),this._tip=e0("div",e+"-tip",this._tipContainer),this.options.closeButton){var r=this._closeButton=e0("a",e+"-close-button",t);r.setAttribute("role","button"),r.setAttribute("aria-label","Close popup"),r.href="#close",r.innerHTML='<span aria-hidden="true">&#215;</span>',th(r,"click",function(e){tw(e),this.close()},this)}},_updateLayout:function(){var e=this._contentNode,t=e.style;t.width="",t.whiteSpace="nowrap";var n=e.offsetWidth;t.width=(n=Math.max(n=Math.min(n,this.options.maxWidth),this.options.minWidth))+1+"px",t.whiteSpace="",t.height="";var r=e.offsetHeight,i=this.options.maxHeight,a="leaflet-popup-scrolled";i&&r>i?(t.height=i+"px",e6(e,a)):e8(e,a),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),n=this._getAnchor();tr(this._container,t.add(n))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var e=this._map,t=parseInt(eQ(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+t,r=this._containerWidth,i=new j(this._containerLeft,-n-this._containerBottom);i._add(ti(this._container));var a=e.layerPointToContainerPoint(i),o=H(this.options.autoPanPadding),s=H(this.options.autoPanPaddingTopLeft||o),l=H(this.options.autoPanPaddingBottomRight||o),u=e.getSize(),c=0,d=0;a.x+r+l.x>u.x&&(c=a.x+r-u.x+l.x),a.x-c-s.x<0&&(c=a.x-s.x),a.y+n+l.y>u.y&&(d=a.y+n-u.y+l.y),a.y-d-s.y<0&&(d=a.y-s.y),(c||d)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([c,d]))}},_getAnchor:function(){return H(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});tN.mergeOptions({closePopupOnClick:!0}),tN.include({openPopup:function(e,t,n){return this._initOverlay(n_,e,t,n).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),t3.include({bindPopup:function(e,t){return this._popup=this._initOverlay(n_,this._popup,e,t),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(e){return this._popup&&(this instanceof t5||(this._popup._source=this),this._popup._prepareOpen(e||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(this._popup&&this._map){tS(e);var t=e.layer||e.target;if(this._popup._source===t&&!(t instanceof ne))return void(this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng));this._popup._source=t,this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){13===e.originalEvent.keyCode&&this._openPopup(e)}});var nx=nb.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){nb.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){nb.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=nb.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=e0("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+f(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var t,n,r=this._map,i=this._container,a=r.latLngToContainerPoint(r.getCenter()),o=r.layerPointToContainerPoint(e),s=this.options.direction,l=i.offsetWidth,u=i.offsetHeight,c=H(this.options.offset),d=this._getAnchor();"top"===s?(t=l/2,n=u):"bottom"===s?(t=l/2,n=0):("center"===s?t=l/2:"right"===s?t=0:"left"===s?t=l:o.x<a.x?(s="right",t=0):(s="left",t=l+(c.x+d.x)*2),n=u/2),e=e.subtract(H(t,n,!0)).add(c).add(d),e8(i,"leaflet-tooltip-right"),e8(i,"leaflet-tooltip-left"),e8(i,"leaflet-tooltip-top"),e8(i,"leaflet-tooltip-bottom"),e6(i,"leaflet-tooltip-"+s),tr(i,e)},_updatePosition:function(){var e=this._map.latLngToLayerPoint(this._latlng);this._setPosition(e)},setOpacity:function(e){this.options.opacity=e,this._container&&te(this._container,e)},_animateZoom:function(e){var t=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);this._setPosition(t)},_getAnchor:function(){return H(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}});tN.include({openTooltip:function(e,t,n){return this._initOverlay(nx,e,t,n).openOn(this),this},closeTooltip:function(e){return e.close(),this}}),t3.include({bindTooltip:function(e,t){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(nx,this._tooltip,e,t),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(e){if(e||!this._tooltipHandlersAdded){var t={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?t.add=this._openTooltip:(t.mouseover=this._openTooltip,t.mouseout=this.closeTooltip,t.click=this._openTooltip,this._map?this._addFocusListeners():t.add=this._addFocusListeners),this._tooltip.options.sticky&&(t.mousemove=this._moveTooltip),this[e?"off":"on"](t),this._tooltipHandlersAdded=!e}},openTooltip:function(e){return this._tooltip&&(this instanceof t5||(this._tooltip._source=this),this._tooltip._prepareOpen(e)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(e){return this._tooltip&&this._tooltip.setContent(e),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(e){var t="function"==typeof e.getElement&&e.getElement();t&&(th(t,"focus",function(){this._tooltip._source=e,this.openTooltip()},this),th(t,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(e){var t="function"==typeof e.getElement&&e.getElement();t&&t.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(e){if(this._tooltip&&this._map){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var t=this;this._map.once("moveend",function(){t._openOnceFlag=!1,t._openTooltip(e)});return}this._tooltip._source=e.layer||e.target,this.openTooltip(this._tooltip.options.sticky?e.latlng:void 0)}},_moveTooltip:function(e){var t,n,r=e.latlng;this._tooltip.options.sticky&&e.originalEvent&&(t=this._map.mouseEventToContainerPoint(e.originalEvent),n=this._map.containerPointToLayerPoint(t),r=this._map.layerPointToLatLng(n)),this._tooltip.setLatLng(r)}});var nw=t6.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(e){var t=e&&"DIV"===e.tagName?e:document.createElement("div"),n=this.options;if(n.html instanceof Element?(e2(t),t.appendChild(n.html)):t.innerHTML=!1!==n.html?n.html:"",n.bgPos){var r=H(n.bgPos);t.style.backgroundPosition=-r.x+"px "+-r.y+"px"}return this._setIconStyles(t,"icon"),t},createShadow:function(){return null}});t6.Default=t8;var nS=t3.extend({options:{tileSize:256,opacity:1,updateWhenIdle:eD.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(e){w(this,e)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(e){e._addZoomLimit(this)},onRemove:function(e){this._removeAllTiles(),e1(this._container),e._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(e3(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(e4(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(e){return this.options.opacity=e,this._updateOpacity(),this},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var e=this._clampZoom(this._map.getZoom());e!==this._tileZoom&&(this._tileZoom=e,this._updateLevels()),this._update()}return this},getEvents:function(){var e={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=g(this._onMoveEnd,this.options.updateInterval,this)),e.move=this._onMove),this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},createTile:function(){return document.createElement("div")},getTileSize:function(){var e=this.options.tileSize;return e instanceof j?e:new j(e,e)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(e){for(var t,n=this.getPane().children,r=-e(-1/0,1/0),i=0,a=n.length;i<a;i++)t=n[i].style.zIndex,n[i]!==this._container&&t&&(r=e(r,+t));isFinite(r)&&(this.options.zIndex=r+e(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!eD.ielt9){te(this._container,this.options.opacity);var e=+new Date,t=!1,n=!1;for(var r in this._tiles){var i=this._tiles[r];if(i.current&&i.loaded){var a=Math.min(1,(e-i.loaded)/200);te(i.el,a),a<1?t=!0:(i.active?n=!0:this._onOpaqueTile(i),i.active=!0)}}n&&!this._noPrune&&this._pruneTiles(),t&&(D(this._fadeFrame),this._fadeFrame=k(this._updateOpacity,this))}},_onOpaqueTile:y,_initContainer:function(){this._container||(this._container=e0("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var e=this._tileZoom,t=this.options.maxZoom;if(void 0!==e){for(var n in this._levels)n=Number(n),this._levels[n].el.children.length||n===e?(this._levels[n].el.style.zIndex=t-Math.abs(e-n),this._onUpdateLevel(n)):(e1(this._levels[n].el),this._removeTilesAtZoom(n),this._onRemoveLevel(n),delete this._levels[n]);var r=this._levels[e],i=this._map;return r||((r=this._levels[e]={}).el=e0("div","leaflet-tile-container leaflet-zoom-animated",this._container),r.el.style.zIndex=t,r.origin=i.project(i.unproject(i.getPixelOrigin()),e).round(),r.zoom=e,this._setZoomTransform(r,i.getCenter(),i.getZoom()),y(r.el.offsetWidth),this._onCreateLevel(r)),this._level=r,r}},_onUpdateLevel:y,_onRemoveLevel:y,_onCreateLevel:y,_pruneTiles:function(){if(this._map){var e,t,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)return void this._removeAllTiles();for(e in this._tiles)(t=this._tiles[e]).retain=t.current;for(e in this._tiles)if((t=this._tiles[e]).current&&!t.active){var r=t.coords;this._retainParent(r.x,r.y,r.z,r.z-5)||this._retainChildren(r.x,r.y,r.z,r.z+2)}for(e in this._tiles)this._tiles[e].retain||this._removeTile(e)}},_removeTilesAtZoom:function(e){for(var t in this._tiles)this._tiles[t].coords.z===e&&this._removeTile(t)},_removeAllTiles:function(){for(var e in this._tiles)this._removeTile(e)},_invalidateAll:function(){for(var e in this._levels)e1(this._levels[e].el),this._onRemoveLevel(Number(e)),delete this._levels[e];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(e,t,n,r){var i=Math.floor(e/2),a=Math.floor(t/2),o=n-1,s=new j(+i,+a);s.z=+o;var l=this._tileCoordsToKey(s),u=this._tiles[l];return u&&u.active?(u.retain=!0,!0):(u&&u.loaded&&(u.retain=!0),o>r&&this._retainParent(i,a,o,r))},_retainChildren:function(e,t,n,r){for(var i=2*e;i<2*e+2;i++)for(var a=2*t;a<2*t+2;a++){var o=new j(i,a);o.z=n+1;var s=this._tileCoordsToKey(o),l=this._tiles[s];if(l&&l.active){l.retain=!0;continue}l&&l.loaded&&(l.retain=!0),n+1<r&&this._retainChildren(i,a,n+1,r)}},_resetView:function(e){var t=e&&(e.pinch||e.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(e){this._setView(e.center,e.zoom,!0,e.noUpdate)},_clampZoom:function(e){var t=this.options;return void 0!==t.minNativeZoom&&e<t.minNativeZoom?t.minNativeZoom:void 0!==t.maxNativeZoom&&t.maxNativeZoom<e?t.maxNativeZoom:e},_setView:function(e,t,n,r){var i=Math.round(t);i=void 0!==this.options.maxZoom&&i>this.options.maxZoom||void 0!==this.options.minZoom&&i<this.options.minZoom?void 0:this._clampZoom(i);var a=this.options.updateWhenZooming&&i!==this._tileZoom;(!r||a)&&(this._tileZoom=i,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==i&&this._update(e),n||this._pruneTiles(),this._noPrune=!!n),this._setZoomTransforms(e,t)},_setZoomTransforms:function(e,t){for(var n in this._levels)this._setZoomTransform(this._levels[n],e,t)},_setZoomTransform:function(e,t,n){var r=this._map.getZoomScale(n,e.zoom),i=e.origin.multiplyBy(r).subtract(this._map._getNewPixelOrigin(t,n)).round();eD.any3d?tn(e.el,i,r):tr(e.el,i)},_resetGrid:function(){var e=this._map,t=e.options.crs,n=this._tileSize=this.getTileSize(),r=this._tileZoom,i=this._map.getPixelWorldBounds(this._tileZoom);i&&(this._globalTileRange=this._pxBoundsToTileRange(i)),this._wrapX=t.wrapLng&&!this.options.noWrap&&[Math.floor(e.project([0,t.wrapLng[0]],r).x/n.x),Math.ceil(e.project([0,t.wrapLng[1]],r).x/n.y)],this._wrapY=t.wrapLat&&!this.options.noWrap&&[Math.floor(e.project([t.wrapLat[0],0],r).y/n.x),Math.ceil(e.project([t.wrapLat[1],0],r).y/n.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(e){var t=this._map,n=t._animatingZoom?Math.max(t._animateToZoom,t.getZoom()):t.getZoom(),r=t.getZoomScale(n,this._tileZoom),i=t.project(e,this._tileZoom).floor(),a=t.getSize().divideBy(2*r);return new G(i.subtract(a),i.add(a))},_update:function(e){var t=this._map;if(t){var n=this._clampZoom(t.getZoom());if(void 0===e&&(e=t.getCenter()),void 0!==this._tileZoom){var r=this._getTiledPixelBounds(e),i=this._pxBoundsToTileRange(r),a=i.getCenter(),o=[],s=this.options.keepBuffer,l=new G(i.getBottomLeft().subtract([s,-s]),i.getTopRight().add([s,-s]));if(!(isFinite(i.min.x)&&isFinite(i.min.y)&&isFinite(i.max.x)&&isFinite(i.max.y)))throw Error("Attempted to load an infinite number of tiles");for(var u in this._tiles){var c=this._tiles[u].coords;c.z===this._tileZoom&&l.contains(new j(c.x,c.y))||(this._tiles[u].current=!1)}if(Math.abs(n-this._tileZoom)>1)return void this._setView(e,n);for(var d=i.min.y;d<=i.max.y;d++)for(var h=i.min.x;h<=i.max.x;h++){var p=new j(h,d);if(p.z=this._tileZoom,this._isValidTile(p)){var m=this._tiles[this._tileCoordsToKey(p)];m?m.current=!0:o.push(p)}}if(o.sort(function(e,t){return e.distanceTo(a)-t.distanceTo(a)}),0!==o.length){this._loading||(this._loading=!0,this.fire("loading"));var f=document.createDocumentFragment();for(h=0;h<o.length;h++)this._addTile(o[h],f);this._level.el.appendChild(f)}}}},_isValidTile:function(e){var t=this._map.options.crs;if(!t.infinite){var n=this._globalTileRange;if(!t.wrapLng&&(e.x<n.min.x||e.x>n.max.x)||!t.wrapLat&&(e.y<n.min.y||e.y>n.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(e);return q(this.options.bounds).overlaps(r)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var t=this._map,n=this.getTileSize(),r=e.scaleBy(n),i=r.add(n);return[t.unproject(r,e.z),t.unproject(i,e.z)]},_tileCoordsToBounds:function(e){var t=this._tileCoordsToNwSe(e),n=new W(t[0],t[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var t=e.split(":"),n=new j(+t[0],+t[1]);return n.z=+t[2],n},_removeTile:function(e){var t=this._tiles[e];t&&(e1(t.el),delete this._tiles[e],this.fire("tileunload",{tile:t.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){e6(e,"leaflet-tile");var t=this.getTileSize();e.style.width=t.x+"px",e.style.height=t.y+"px",e.onselectstart=y,e.onmousemove=y,eD.ielt9&&this.options.opacity<1&&te(e,this.options.opacity)},_addTile:function(e,t){var n=this._getTilePos(e),r=this._tileCoordsToKey(e),i=this.createTile(this._wrapCoords(e),p(this._tileReady,this,e));this._initTile(i),this.createTile.length<2&&k(p(this._tileReady,this,e,null,i)),tr(i,n),this._tiles[r]={el:i,coords:e,current:!0},t.appendChild(i),this.fire("tileloadstart",{tile:i,coords:e})},_tileReady:function(e,t,n){t&&this.fire("tileerror",{error:t,tile:n,coords:e});var r=this._tileCoordsToKey(e);(n=this._tiles[r])&&(n.loaded=+new Date,this._map._fadeAnimated?(te(n.el,0),D(this._fadeFrame),this._fadeFrame=k(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),t||(e6(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),eD.ielt9||!this._map._fadeAnimated?k(this._pruneTiles,this):setTimeout(p(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var t=new j(this._wrapX?v(e.x,this._wrapX):e.x,this._wrapY?v(e.y,this._wrapY):e.y);return t.z=e.z,t},_pxBoundsToTileRange:function(e){var t=this.getTileSize();return new G(e.min.unscaleBy(t).floor(),e.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}}),nE=nS.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,t){this._url=e,(t=w(this,t)).detectRetina&&eD.retina&&t.maxZoom>0?(t.tileSize=Math.floor(t.tileSize/2),t.zoomReverse?(t.zoomOffset--,t.minZoom=Math.min(t.maxZoom,t.minZoom+1)):(t.zoomOffset++,t.maxZoom=Math.max(t.minZoom,t.maxZoom-1)),t.minZoom=Math.max(0,t.minZoom)):t.zoomReverse?t.minZoom=Math.min(t.maxZoom,t.minZoom):t.maxZoom=Math.max(t.minZoom,t.maxZoom),"string"==typeof t.subdomains&&(t.subdomains=t.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(e,t){return this._url===e&&void 0===t&&(t=!0),this._url=e,t||this.redraw(),this},createTile:function(e,t){var n=document.createElement("img");return th(n,"load",p(this._tileOnLoad,this,t,n)),th(n,"error",p(this._tileOnError,this,t,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(n.referrerPolicy=this.options.referrerPolicy),n.alt="",n.src=this.getTileUrl(e),n},getTileUrl:function(e){var n={r:eD.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var r=this._globalTileRange.max.y-e.y;this.options.tms&&(n.y=r),n["-y"]=r}return A(this._url,t(n,this.options))},_tileOnLoad:function(e,t){eD.ielt9?setTimeout(p(e,this,null,t),0):e(null,t)},_tileOnError:function(e,t,n){var r=this.options.errorTileUrl;r&&t.getAttribute("src")!==r&&(t.src=r),e(n,t)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,t=this.options.maxZoom,n=this.options.zoomReverse,r=this.options.zoomOffset;return n&&(e=t-e),e+r},_getSubdomain:function(e){var t=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var e,t;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&((t=this._tiles[e].el).onload=y,t.onerror=y,!t.complete)){t.src=C;var n=this._tiles[e].coords;e1(t),delete this._tiles[e],this.fire("tileabort",{tile:t,coords:n})}},_removeTile:function(e){var t=this._tiles[e];if(t)return t.el.setAttribute("src",C),nS.prototype._removeTile.call(this,e)},_tileReady:function(e,t,n){if(this._map&&(!n||n.getAttribute("src")!==C))return nS.prototype._tileReady.call(this,e,t,n)}});function nA(e,t){return new nE(e,t)}var nT=nE.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,n){this._url=e;var r=t({},this.defaultWmsParams);for(var i in n)i in this.options||(r[i]=n[i]);var a=(n=w(this,n)).detectRetina&&eD.retina?2:1,o=this.getTileSize();r.width=o.x*a,r.height=o.y*a,this.wmsParams=r},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[t]=this._crs.code,nE.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._tileCoordsToNwSe(e),n=this._crs,r=V(n.project(t[0]),n.project(t[1])),i=r.min,a=r.max,o=(this._wmsVersion>=1.3&&this._crs===t1?[i.y,i.x,a.y,a.x]:[i.x,i.y,a.x,a.y]).join(","),s=nE.prototype.getTileUrl.call(this,e);return s+S(this.wmsParams,s,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+o},setParams:function(e,n){return t(this.wmsParams,e),n||this.redraw(),this}});nE.WMS=nT,nA.wms=function(e,t){return new nT(e,t)};var nI=t3.extend({options:{padding:.1},initialize:function(e){w(this,e),f(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),e6(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,t){var n=this._map.getZoomScale(t,this._zoom),r=this._map.getSize().multiplyBy(.5+this.options.padding),i=this._map.project(this._center,t),a=r.multiplyBy(-n).add(i).subtract(this._map._getNewPixelOrigin(e,t));eD.any3d?tn(this._container,a,n):tr(this._container,a)},_reset:function(){for(var e in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,t=this._map.getSize(),n=this._map.containerPointToLayerPoint(t.multiplyBy(-e)).round();this._bounds=new G(n,n.add(t.multiplyBy(1+2*e)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),nC=nI.extend({options:{tolerance:0},getEvents:function(){var e=nI.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){nI.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");th(e,"mousemove",this._onMouseMove,this),th(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),th(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){D(this._redrawRequest),delete this._ctx,e1(this._container),tm(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var e in this._redrawBounds=null,this._layers)this._layers[e]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){nI.prototype._update.call(this);var e=this._bounds,t=this._container,n=e.getSize(),r=eD.retina?2:1;tr(t,e.min),t.width=r*n.x,t.height=r*n.y,t.style.width=n.x+"px",t.style.height=n.y+"px",eD.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){nI.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[f(e)]=e;var t=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var t=e._order,n=t.next,r=t.prev;n?n.prev=r:this._drawLast=r,r?r.next=n:this._drawFirst=n,delete e._order,delete this._layers[f(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if("string"==typeof e.options.dashArray){var t,n,r=e.options.dashArray.split(/[, ]+/),i=[];for(n=0;n<r.length;n++){if(isNaN(t=Number(r[n])))return;i.push(t)}e.options._dashArray=i}else e.options._dashArray=e.options.dashArray},_requestRedraw:function(e){this._map&&(this._extendRedrawBounds(e),this._redrawRequest=this._redrawRequest||k(this._redraw,this))},_extendRedrawBounds:function(e){if(e._pxBounds){var t=(e.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new G,this._redrawBounds.extend(e._pxBounds.min.subtract([t,t])),this._redrawBounds.extend(e._pxBounds.max.add([t,t]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var e=this._redrawBounds;if(e){var t=e.getSize();this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var e,t=this._redrawBounds;if(this._ctx.save(),t){var n=t.getSize();this._ctx.beginPath(),this._ctx.rect(t.min.x,t.min.y,n.x,n.y),this._ctx.clip()}this._drawing=!0;for(var r=this._drawFirst;r;r=r.next)e=r.layer,(!t||e._pxBounds&&e._pxBounds.intersects(t))&&e._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(e,t){if(this._drawing){var n,r,i,a,o=e._parts,s=o.length,l=this._ctx;if(s){for(l.beginPath(),n=0;n<s;n++){for(r=0,i=o[n].length;r<i;r++)a=o[n][r],l[r?"lineTo":"moveTo"](a.x,a.y);t&&l.closePath()}this._fillStroke(l,e)}}},_updateCircle:function(e){if(!(!this._drawing||e._empty())){var t=e._point,n=this._ctx,r=Math.max(Math.round(e._radius),1),i=(Math.max(Math.round(e._radiusY),1)||r)/r;1!==i&&(n.save(),n.scale(1,i)),n.beginPath(),n.arc(t.x,t.y/i,r,0,2*Math.PI,!1),1!==i&&n.restore(),this._fillStroke(n,e)}},_fillStroke:function(e,t){var n=t.options;n.fill&&(e.globalAlpha=n.fillOpacity,e.fillStyle=n.fillColor||n.color,e.fill(n.fillRule||"evenodd")),n.stroke&&0!==n.weight&&(e.setLineDash&&e.setLineDash(t.options&&t.options._dashArray||[]),e.globalAlpha=n.opacity,e.lineWidth=n.weight,e.strokeStyle=n.color,e.lineCap=n.lineCap,e.lineJoin=n.lineJoin,e.stroke())},_onClick:function(e){for(var t,n,r=this._map.mouseEventToLayerPoint(e),i=this._drawFirst;i;i=i.next)(t=i.layer).options.interactive&&t._containsPoint(r)&&("click"!==e.type&&"preclick"!==e.type||!this._map._draggableMoved(t))&&(n=t);this._fireEvent(!!n&&[n],e)},_onMouseMove:function(e){if(!(!this._map||this._map.dragging.moving())&&!this._map._animatingZoom){var t=this._map.mouseEventToLayerPoint(e);this._handleMouseHover(e,t)}},_handleMouseOut:function(e){var t=this._hoveredLayer;t&&(e8(this._container,"leaflet-interactive"),this._fireEvent([t],e,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(e,t){if(!this._mouseHoverThrottled){for(var n,r,i=this._drawFirst;i;i=i.next)(n=i.layer).options.interactive&&n._containsPoint(t)&&(r=n);r!==this._hoveredLayer&&(this._handleMouseOut(e),r&&(e6(this._container,"leaflet-interactive"),this._fireEvent([r],e,"mouseover"),this._hoveredLayer=r)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],e),this._mouseHoverThrottled=!0,setTimeout(p(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(e,t,n){this._map._fireDOMEvent(t,n||t.type,e)},_bringToFront:function(e){var t=e._order;if(t){var n=t.next,r=t.prev;if(!n)return;n.prev=r,r?r.next=n:n&&(this._drawFirst=n),t.prev=this._drawLast,this._drawLast.next=t,t.next=null,this._drawLast=t,this._requestRedraw(e)}},_bringToBack:function(e){var t=e._order;if(t){var n=t.next,r=t.prev;if(!r)return;r.next=n,n?n.prev=r:r&&(this._drawLast=r),t.prev=null,t.next=this._drawFirst,this._drawFirst.prev=t,this._drawFirst=t,this._requestRedraw(e)}}});function nM(e){return eD.canvas?new nC(e):null}var nN=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(e){return document.createElement("<lvml:"+e+' class="lvml">')}}catch(e){}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),nR=eD.vml?nN:en,nO=nI.extend({_initContainer:function(){this._container=nR("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=nR("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){e1(this._container),tm(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){nI.prototype._update.call(this);var e=this._bounds,t=e.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(t)||(this._svgSize=t,n.setAttribute("width",t.x),n.setAttribute("height",t.y)),tr(n,e.min),n.setAttribute("viewBox",[e.min.x,e.min.y,t.x,t.y].join(" ")),this.fire("update")}},_initPath:function(e){var t=e._path=nR("path");e.options.className&&e6(t,e.options.className),e.options.interactive&&e6(t,"leaflet-interactive"),this._updateStyle(e),this._layers[f(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){e1(e._path),e.removeInteractiveTarget(e._path),delete this._layers[f(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var t=e._path,n=e.options;t&&(n.stroke?(t.setAttribute("stroke",n.color),t.setAttribute("stroke-opacity",n.opacity),t.setAttribute("stroke-width",n.weight),t.setAttribute("stroke-linecap",n.lineCap),t.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?t.setAttribute("stroke-dasharray",n.dashArray):t.removeAttribute("stroke-dasharray"),n.dashOffset?t.setAttribute("stroke-dashoffset",n.dashOffset):t.removeAttribute("stroke-dashoffset")):t.setAttribute("stroke","none"),n.fill?(t.setAttribute("fill",n.fillColor||n.color),t.setAttribute("fill-opacity",n.fillOpacity),t.setAttribute("fill-rule",n.fillRule||"evenodd")):t.setAttribute("fill","none"))},_updatePoly:function(e,t){this._setPath(e,er(e._parts,t))},_updateCircle:function(e){var t=e._point,n=Math.max(Math.round(e._radius),1),r=Math.max(Math.round(e._radiusY),1)||n,i="a"+n+","+r+" 0 1,0 ",a=e._empty()?"M0 0":"M"+(t.x-n)+","+t.y+i+2*n+",0 "+i+-(2*n)+",0 ";this._setPath(e,a)},_setPath:function(e,t){e._path.setAttribute("d",t)},_bringToFront:function(e){e3(e._path)},_bringToBack:function(e){e4(e._path)}});function nP(e){return eD.svg||eD.vml?new nO(e):null}eD.vml&&nO.include({_initContainer:function(){this._container=e0("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(nI.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var t=e._container=nN("shape");e6(t,"leaflet-vml-shape "+(this.options.className||"")),t.coordsize="1 1",e._path=nN("path"),t.appendChild(e._path),this._updateStyle(e),this._layers[f(e)]=e},_addPath:function(e){var t=e._container;this._container.appendChild(t),e.options.interactive&&e.addInteractiveTarget(t)},_removePath:function(e){var t=e._container;e1(t),e.removeInteractiveTarget(t),delete this._layers[f(e)]},_updateStyle:function(e){var t=e._stroke,n=e._fill,r=e.options,i=e._container;i.stroked=!!r.stroke,i.filled=!!r.fill,r.stroke?(t||(t=e._stroke=nN("stroke")),i.appendChild(t),t.weight=r.weight+"px",t.color=r.color,t.opacity=r.opacity,r.dashArray?t.dashStyle=T(r.dashArray)?r.dashArray.join(" "):r.dashArray.replace(/( *, *)/g," "):t.dashStyle="",t.endcap=r.lineCap.replace("butt","flat"),t.joinstyle=r.lineJoin):t&&(i.removeChild(t),e._stroke=null),r.fill?(n||(n=e._fill=nN("fill")),i.appendChild(n),n.color=r.fillColor||r.color,n.opacity=r.fillOpacity):n&&(i.removeChild(n),e._fill=null)},_updateCircle:function(e){var t=e._point.round(),n=Math.round(e._radius),r=Math.round(e._radiusY||n);this._setPath(e,e._empty()?"M0 0":"AL "+t.x+","+t.y+" "+n+","+r+" 0,23592600")},_setPath:function(e,t){e._path.v=t},_bringToFront:function(e){e3(e._container)},_bringToBack:function(e){e4(e._container)}}),tN.include({getRenderer:function(e){var t=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return t||(t=this._renderer=this._createRenderer()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(e){if("overlayPane"===e||void 0===e)return!1;var t=this._paneRenderers[e];return void 0===t&&(t=this._createRenderer({pane:e}),this._paneRenderers[e]=t),t},_createRenderer:function(e){return this.options.preferCanvas&&nM(e)||nP(e)}});var nk=ni.extend({initialize:function(e,t){ni.prototype.initialize.call(this,this._boundsToLatLngs(e),t)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return[(e=q(e)).getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});nO.create=nR,nO.pointsToPath=er,na.geometryToLayer=no,na.coordsToLatLng=nl,na.coordsToLatLngs=nu,na.latLngToCoords=nc,na.latLngsToCoords=nd,na.getFeature=nh,na.asFeature=np,tN.mergeOptions({boxZoom:!0});var nL=tB.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){th(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){tm(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){e1(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||1!==e.which&&1!==e.button)return!1;this._clearDeferredResetState(),this._resetState(),n(),to(),this._startPoint=this._map.mouseEventToContainerPoint(e),th(document,{contextmenu:tS,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=e0("div","leaflet-zoom-box",this._container),e6(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var t=new G(this._point,this._startPoint),n=t.getSize();tr(this._box,t.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(e1(this._box),e8(this._container,"leaflet-crosshair")),r(),ts(),tm(document,{contextmenu:tS,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if((1===e.which||1===e.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(p(this._resetState,this),0);var t=new W(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})}},_onKeyDown:function(e){27===e.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});tN.addInitHook("addHandler","boxZoom",nL),tN.mergeOptions({doubleClickZoom:!0});var nD=tB.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var t=this._map,n=t.getZoom(),r=t.options.zoomDelta,i=e.originalEvent.shiftKey?n-r:n+r;"center"===t.options.doubleClickZoom?t.setZoom(i):t.setZoomAround(e.containerPoint,i)}});tN.addInitHook("addHandler","doubleClickZoom",nD),tN.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var nB=tB.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new tU(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}e6(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){e8(this._map._container,"leaflet-grab"),e8(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var t=q(this._map.options.maxBounds);this._offsetLimit=V(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var t=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(t),this._prunePositions(t)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,t){return e-(e-t)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var e=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;e.x<t.min.x&&(e.x=this._viscousLimit(e.x,t.min.x)),e.y<t.min.y&&(e.y=this._viscousLimit(e.y,t.min.y)),e.x>t.max.x&&(e.x=this._viscousLimit(e.x,t.max.x)),e.y>t.max.y&&(e.y=this._viscousLimit(e.y,t.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,t=Math.round(e/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,i=(r-t+n)%e+t-n,a=(r+t+n)%e-t-n,o=Math.abs(i+n)<Math.abs(a+n)?i:a;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=o},_onDragEnd:function(e){var t=this._map,n=t.options,r=!n.inertia||e.noInertia||this._times.length<2;if(t.fire("dragend",e),r)t.fire("moveend");else{this._prunePositions(+new Date);var i=this._lastPos.subtract(this._positions[0]),a=(this._lastTime-this._times[0])/1e3,o=n.easeLinearity,s=i.multiplyBy(o/a),l=s.distanceTo([0,0]),u=Math.min(n.inertiaMaxSpeed,l),c=s.multiplyBy(u/l),d=u/(n.inertiaDeceleration*o),h=c.multiplyBy(-d/2).round();h.x||h.y?(h=t._limitOffset(h,t.options.maxBounds),k(function(){t.panBy(h,{duration:d,easeLinearity:o,noMoveStart:!0,animate:!0})})):t.fire("moveend")}}});tN.addInitHook("addHandler","dragging",nB),tN.mergeOptions({keyboard:!0,keyboardPanDelta:80});var nF=tB.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(e){this._map=e,this._setPanDelta(e.options.keyboardPanDelta),this._setZoomDelta(e.options.zoomDelta)},addHooks:function(){var e=this._map._container;e.tabIndex<=0&&(e.tabIndex="0"),th(e,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),tm(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var e=document.body,t=document.documentElement,n=e.scrollTop||t.scrollTop,r=e.scrollLeft||t.scrollLeft;this._map._container.focus(),window.scrollTo(r,n)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(e){var t,n,r=this._panKeys={},i=this.keyCodes;for(t=0,n=i.left.length;t<n;t++)r[i.left[t]]=[-1*e,0];for(t=0,n=i.right.length;t<n;t++)r[i.right[t]]=[e,0];for(t=0,n=i.down.length;t<n;t++)r[i.down[t]]=[0,e];for(t=0,n=i.up.length;t<n;t++)r[i.up[t]]=[0,-1*e]},_setZoomDelta:function(e){var t,n,r=this._zoomKeys={},i=this.keyCodes;for(t=0,n=i.zoomIn.length;t<n;t++)r[i.zoomIn[t]]=e;for(t=0,n=i.zoomOut.length;t<n;t++)r[i.zoomOut[t]]=-e},_addHooks:function(){th(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){tm(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(e){if(!e.altKey&&!e.ctrlKey&&!e.metaKey){var t,n=e.keyCode,r=this._map;if(n in this._panKeys){if(!r._panAnim||!r._panAnim._inProgress)if(t=this._panKeys[n],e.shiftKey&&(t=H(t).multiplyBy(3)),r.options.maxBounds&&(t=r._limitOffset(H(t),r.options.maxBounds)),r.options.worldCopyJump){var i=r.wrapLatLng(r.unproject(r.project(r.getCenter()).add(t)));r.panTo(i)}else r.panBy(t)}else if(n in this._zoomKeys)r.setZoom(r.getZoom()+(e.shiftKey?3:1)*this._zoomKeys[n]);else{if(27!==n||!r._popup||!r._popup.options.closeOnEscapeKey)return;r.closePopup()}tS(e)}}});tN.addInitHook("addHandler","keyboard",nF),tN.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var nU=tB.extend({addHooks:function(){th(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){tm(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(e){var t=tI(e),n=this._map.options.wheelDebounceTime;this._delta+=t,this._lastMousePos=this._map.mouseEventToContainerPoint(e),this._startTime||(this._startTime=+new Date);var r=Math.max(n-(new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(p(this._performZoom,this),r),tS(e)},_performZoom:function(){var e=this._map,t=e.getZoom(),n=this._map.options.zoomSnap||0;e._stop();var r=4*Math.log(2/(1+Math.exp(-Math.abs(this._delta/(4*this._map.options.wheelPxPerZoomLevel)))))/Math.LN2,i=n?Math.ceil(r/n)*n:r,a=e._limitZoom(t+(this._delta>0?i:-i))-t;this._delta=0,this._startTime=null,a&&("center"===e.options.scrollWheelZoom?e.setZoom(t+a):e.setZoomAround(this._lastMousePos,t+a))}});tN.addInitHook("addHandler","scrollWheelZoom",nU),tN.mergeOptions({tapHold:eD.touchNative&&eD.safari&&eD.mobile,tapTolerance:15});var nj=tB.extend({addHooks:function(){th(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){tm(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),1===e.touches.length){var t=e.touches[0];this._startPos=this._newPos=new j(t.clientX,t.clientY),this._holdTimeout=setTimeout(p(function(){this._cancel(),this._isTapValid()&&(th(document,"touchend",tw),th(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",t))},this),600),th(document,"touchend touchcancel contextmenu",this._cancel,this),th(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){tm(document,"touchend",tw),tm(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),tm(document,"touchend touchcancel contextmenu",this._cancel,this),tm(document,"touchmove",this._onMove,this)},_onMove:function(e){var t=e.touches[0];this._newPos=new j(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,t){var n=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY});n._simulated=!0,t.target.dispatchEvent(n)}});tN.addInitHook("addHandler","tapHold",nj),tN.mergeOptions({touchZoom:eD.touch,bounceAtZoomLimits:!0});var nz=tB.extend({addHooks:function(){e6(this._map._container,"leaflet-touch-zoom"),th(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){e8(this._map._container,"leaflet-touch-zoom"),tm(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var t=this._map;if(e.touches&&2===e.touches.length&&!t._animatingZoom&&!this._zooming){var n=t.mouseEventToContainerPoint(e.touches[0]),r=t.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=t.getSize()._divideBy(2),this._startLatLng=t.containerPointToLatLng(this._centerPoint),"center"!==t.options.touchZoom&&(this._pinchStartLatLng=t.containerPointToLatLng(n.add(r)._divideBy(2))),this._startDist=n.distanceTo(r),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),th(document,"touchmove",this._onTouchMove,this),th(document,"touchend touchcancel",this._onTouchEnd,this),tw(e)}},_onTouchMove:function(e){if(e.touches&&2===e.touches.length&&this._zooming){var t=this._map,n=t.mouseEventToContainerPoint(e.touches[0]),r=t.mouseEventToContainerPoint(e.touches[1]),i=n.distanceTo(r)/this._startDist;if(this._zoom=t.getScaleZoom(i,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoom<t.getMinZoom()&&i<1||this._zoom>t.getMaxZoom()&&i>1)&&(this._zoom=t._limitZoom(this._zoom)),"center"===t.options.touchZoom){if(this._center=this._startLatLng,1===i)return}else{var a=n._add(r)._divideBy(2)._subtract(this._centerPoint);if(1===i&&0===a.x&&0===a.y)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(a),this._zoom)}this._moved||(t._moveStart(!0,!1),this._moved=!0),D(this._animRequest);var o=p(t._move,t,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=k(o,this,!0),tw(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,D(this._animRequest),tm(document,"touchmove",this._onTouchMove,this),tm(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});tN.addInitHook("addHandler","touchZoom",nz),tN.BoxZoom=nL,tN.DoubleClickZoom=nD,tN.Drag=nB,tN.Keyboard=nF,tN.ScrollWheelZoom=nU,tN.TapHold=nj,tN.TouchZoom=nz,e.Bounds=G,e.Browser=eD,e.CRS=K,e.Canvas=nC,e.Circle=nn,e.CircleMarker=nt,e.Class=B,e.Control=tR,e.DivIcon=nw,e.DivOverlay=nb,e.DomEvent={__proto__:null,on:th,off:tm,stopPropagation:tb,disableScrollPropagation:t_,disableClickPropagation:tx,preventDefault:tw,stop:tS,getPropagationPath:tE,getMousePosition:tA,getWheelDelta:tI,isExternalTarget:tC,addListener:th,removeListener:tm},e.DomUtil={__proto__:null,TRANSFORM:eK,TRANSITION:eY,TRANSITION_END:eX,get:eZ,getStyle:eQ,create:e0,remove:e1,empty:e2,toFront:e3,toBack:e4,hasClass:e5,addClass:e6,removeClass:e8,setClass:e7,getClass:e9,setOpacity:te,testProp:tt,setTransform:tn,setPosition:tr,getPosition:ti,get disableTextSelection(){return n},get enableTextSelection(){return r},disableImageDrag:to,enableImageDrag:ts,preventOutline:tl,restoreOutline:tu,getSizedParentNode:tc,getScale:td},e.Draggable=tU,e.Evented=U,e.FeatureGroup=t5,e.GeoJSON=na,e.GridLayer=nS,e.Handler=tB,e.Icon=t6,e.ImageOverlay=ng,e.LatLng=$,e.LatLngBounds=W,e.Layer=t3,e.LayerGroup=t4,e.LineUtil={__proto__:null,simplify:tG,pointToSegmentDistance:tV,closestPointOnSegment:function(e,t,n){return tJ(e,t,n)},clipSegment:tW,_getEdgeIntersection:tq,_getBitCode:t$,_sqClosestPointOnSegment:tJ,isFlat:tK,_flat:tY,polylineCenter:tX},e.Map=tN,e.Marker=t9,e.Mixin={Events:F},e.Path=ne,e.Point=j,e.PolyUtil={__proto__:null,clipPolygon:tj,polygonCenter:tz,centroid:tH},e.Polygon=ni,e.Polyline=nr,e.Popup=n_,e.PosAnimation=tM,e.Projection={__proto__:null,LonLat:tZ,Mercator:tQ,SphericalMercator:X},e.Rectangle=nk,e.Renderer=nI,e.SVG=nO,e.SVGOverlay=ny,e.TileLayer=nE,e.Tooltip=nx,e.Transformation=Z,e.Util={__proto__:null,extend:t,create:h,bind:p,get lastId(){return m},stamp:f,throttle:g,wrapNum:v,falseFn:y,formatNum:b,trim:_,splitWords:x,setOptions:w,getParamString:S,template:A,isArray:T,indexOf:I,emptyImageUrl:C,requestFn:O,cancelFn:P,requestAnimFrame:k,cancelAnimFrame:D},e.VideoOverlay=nv,e.bind=p,e.bounds=V,e.canvas=nM,e.circle=function(e,t,n){return new nn(e,t,n)},e.circleMarker=function(e,t){return new nt(e,t)},e.control=tO,e.divIcon=function(e){return new nw(e)},e.extend=t,e.featureGroup=function(e,t){return new t5(e,t)},e.geoJSON=nf,e.geoJson=nf,e.gridLayer=function(e){return new nS(e)},e.icon=function(e){return new t6(e)},e.imageOverlay=function(e,t,n){return new ng(e,t,n)},e.latLng=J,e.latLngBounds=q,e.layerGroup=function(e,t){return new t4(e,t)},e.map=function(e,t){return new tN(e,t)},e.marker=function(e,t){return new t9(e,t)},e.point=H,e.polygon=function(e,t){return new ni(e,t)},e.polyline=function(e,t){return new nr(e,t)},e.popup=function(e,t){return new n_(e,t)},e.rectangle=function(e,t){return new nk(e,t)},e.setOptions=w,e.stamp=f,e.svg=nP,e.svgOverlay=function(e,t,n){return new ny(e,t,n)},e.tileLayer=nA,e.tooltip=function(e,t){return new nx(e,t)},e.transformation=Q,e.version="1.9.4",e.videoOverlay=function(e,t,n){return new nv(e,t,n)};var nH=window.L;e.noConflict=function(){return window.L=nH,this},window.L=e}($P);var em=ec("85Hg2");function $k(){return($k=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}).apply(this,arguments)}let $L=(0,em.forwardRef)(function({bounds:e,boundsOptions:t,center:n,children:r,className:i,id:a,placeholder:o,style:s,whenReady:l,zoom:u,...c},d){let[h]=(0,em.useState)({className:i,id:a,style:s}),[p,m]=(0,em.useState)(null);(0,em.useImperativeHandle)(d,()=>p?.map??null,[p]);let f=(0,em.useCallback)(r=>{if(null!==r&&null===p){let i=new(0,$P.Map)(r,c);null!=n&&null!=u?i.setView(n,u):null!=e&&i.fitBounds(e,t),null!=l&&i.whenReady(l),m(Object.freeze({__version:1,map:i}))}},[]);(0,em.useEffect)(()=>()=>{p?.map.remove()},[p]);let g=p?(b(em)).createElement($R,{value:p},r):o??null;return(b(em)).createElement("div",$k({},h,{ref:f}),g)});function $D(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function $B(e,t){return null==t?function(t,n){let r=(0,em.useRef)();return r.current||(r.current=e(t,n)),r}:function(n,r){let i=(0,em.useRef)();i.current||(i.current=e(n,r));let a=(0,em.useRef)(n),{instance:o}=i.current;return(0,em.useEffect)(function(){a.current!==n&&(t(o,n,a.current),a.current=n)},[o,n,r]),i}}function $F(e,t){let n=(0,em.useRef)(t);(0,em.useEffect)(function(){t!==n.current&&null!=e.attributionControl&&(null!=n.current&&e.attributionControl.removeAttribution(n.current),null!=t&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}function $U(e,t){let n=(0,em.useRef)();(0,em.useEffect)(function(){return null!=t&&e.instance.on(t),n.current=t,function(){null!=n.current&&e.instance.off(n.current),n.current=null}},[e,t])}function $j(e,t){let n=e.pane??t.pane;return n?{...e,pane:n}:e}function $z(e){return function(t){var n;let r=$O(),i=e($j(t,r),r);return $F(r.map,t.attribution),$U(i.current,t.eventHandlers),n=i.current,(0,em.useEffect)(function(){return(r.layerContainer??r.map).addLayer(n.instance),function(){r.layerContainer?.removeLayer(n.instance),r.map.removeLayer(n.instance)}},[r,n]),i}}var em=(ec("85Hg2"),ec("85Hg2"),ec("85Hg2"),ec("85Hg2"),ec("85Hg2"),ec("85Hg2"),ec("85Hg2"));let $H=(J=$z($B(function({url:e,...t},n){return $D(new(0,$P.TileLayer)(e,$j(t,n)),n)},function(e,t,n){!function(e,t,n){let{opacity:r,zIndex:i}=t;null!=r&&r!==n.opacity&&e.setOpacity(r),null!=i&&i!==n.zIndex&&e.setZIndex(i)}(e,t,n);let{url:r}=t;null!=r&&r!==n.url&&e.setUrl(r)})),(0,em.forwardRef)(function(e,t){let{instance:n}=J(e).current;return(0,em.useImperativeHandle)(t,()=>n),null})),$G=(K=$z($B(function({position:e,...t},n){var r;let i=new(0,$P.Marker)(e,t);return $D(i,(r={overlayContainer:i},Object.freeze({...n,...r})))},function(e,t,n){t.position!==n.position&&e.setLatLng(t.position),null!=t.icon&&t.icon!==n.icon&&e.setIcon(t.icon),null!=t.zIndexOffset&&t.zIndexOffset!==n.zIndexOffset&&e.setZIndexOffset(t.zIndexOffset),null!=t.opacity&&t.opacity!==n.opacity&&e.setOpacity(t.opacity),null!=e.dragging&&t.draggable!==n.draggable&&(!0===t.draggable?e.dragging.enable():e.dragging.disable())})),(0,em.forwardRef)(function(e,t){let{instance:n,context:r}=K(e).current;return(0,em.useImperativeHandle)(t,()=>n),null==e.children?null:(b(em)).createElement($R,{value:r},e.children)}));var em=ec("85Hg2");let $V=(Y=function(e,t){return $D(new(0,$P.Popup)(e,t.overlayContainer),t)},X=function(e,t,{position:n},r){(0,em.useEffect)(function(){let{instance:i}=e;function a(e){e.popup===i&&(i.update(),r(!0))}function o(e){e.popup===i&&r(!1)}return t.map.on({popupopen:a,popupclose:o}),null==t.overlayContainer?(null!=n&&i.setLatLng(n),i.openOn(t.map)):t.overlayContainer.bindPopup(i),function(){t.map.off({popupopen:a,popupclose:o}),t.overlayContainer?.unbindPopup(),t.map.removeLayer(i)}},[e,t,r,n])},Z=$B(Y),Q=function(e,t){let n=$O(),r=Z($j(e,n),n);return $F(n.map,e.attribution),$U(r.current,e.eventHandlers),X(r.current,n,e,t),r},(0,em.forwardRef)(function(e,t){let[n,r]=(0,em.useState)(!1),{instance:i}=Q(e,r).current;(0,em.useImperativeHandle)(t,()=>i),(0,em.useEffect)(function(){n&&i.update()},[i,n,e.children]);let a=i._contentNode;return a?(0,ep.createPortal)(e.children,a):null})),$W=({center:e,size:t})=>{let n=$O();return(0,em.useEffect)(()=>{let r=new(b($P)).Circle(e,t),i=n.layerContainer||n.map;return i.addLayer(r),()=>{i.removeLayer(r)}}),null},$q=({center:e,uncertainty:t})=>{let[n,r]=(0,em.useState)(!1),i=$O().map,a=(0,em.useCallback)(()=>{let n=void 0!==t?Math.round(Math.log2(1e7/t)):i.getZoom();i.setView(e,n)},[e,t,i]);return(0,em.useEffect)(()=>{n||(a(),r(!0))},[]),(0,em.useEffect)(()=>{a()},[e,t,a]),null},$$=(b($P)).icon({iconUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12.5,20.5],shadowAnchor:[12.5,20.5]});function $J(e){let t="Position";return(null==e?void 0:e.address)?t=[e.address.village||e.address.suburb,e.address.town||e.address.city||e.address.county||e.address.state,e.address.country].filter(Boolean).filter((e,t,n)=>n.indexOf(e)===t).join(", "):(null==e?void 0:e.display_name)&&(t=e.display_name),t}(b($P)).Marker.prototype.options.icon=$$;let $K=({venue:e,query:t,fetching:n,suggestions:r,onQueryChange:i,onChange:a,getPlaceName:o,t:s,autocompleteRootId:l="venue-widget-search",inputRef:u})=>{var c;let[d,h]=(0,em.useState)(!1),[p,m]=(0,em.useState)(!1),[f,g]=(0,em.useState)(!1),v=(0,em.useRef)(null),y=null!=u?u:v,b=(null==e?void 0:e.latitude)!=null?{place_id:0,lat:e.latitude,lon:e.longitude,display_name:null!=(c=e.placeName)?c:"",type:"",category:"",importance:0,place_rank:0,boundingbox:[0,0,0,0]}:void 0,_=b?o(b):"";(0,em.useLayoutEffect)(()=>{let e=y.current;if(!e)return;let n=()=>{m(!0),_&&""===t&&!f&&i(_,{skipSearch:!0})},r=()=>m(!1);return e.addEventListener("focus",n),e.addEventListener("blur",r),()=>{e.removeEventListener("focus",n),e.removeEventListener("blur",r)}},[d,t,_,i,f]);let x=p||d||""!==t||f?t:_,w=r.map(e=>({value:o(e)||e.display_name,label:e.display_name}));return(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("label",{htmlFor:l,className:"sr-only",children:s("searchVenue")}),(0,eh.jsx)(bS,{id:l,inputRef:y,className:"memori--venue-widget-search",options:w,mode:"none",filter:null,value:x,onChange:(e,t)=>{if("item-press"===t.reason){let t=r.find(t=>(o(t)||t.display_name)===e);t&&(g(!1),i(e,{skipSearch:!0}),a(t));return}g(""===e.trim()),i(e)},open:d,onOpenChange:e=>h(e),placeholder:s("searchVenue"),loading:n,loadingText:`${s("loading")}...`,emptyText:t.trim()?s("nothingFound"):"​",autoHighlight:!0,clearable:""!==x.trim()})]})},$Y=({venue:e})=>{var t,n;let[r,i]=(0,em.useState)(!1);return(0,em.useEffect)(()=>{i(!0)},[]),(0,em.useEffect)(()=>{let e=document.createElement("link");return e.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",e.rel="stylesheet",e.integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=",e.crossOrigin="",document.head.appendChild(e),()=>{document.head.removeChild(e)}},[]),(0,eh.jsx)("div",{className:"memori--venue-widget__map-container",role:"region","aria-label":"Location map",children:r&&(0,eh.jsxs)($L,{className:"memori--venue-widget__map",center:(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)?[e.latitude,e.longitude]:[44.66579,11.48823],zoom:13,scrollWheelZoom:!0,children:[(0,eh.jsx)($H,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),(0,eh.jsx)($q,{center:(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)?[e.latitude,e.longitude]:[44.66579,11.48823],uncertainty:(null!=(t=null==e?void 0:e.uncertainty)?t:0)*1e3}),(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)&&(0,eh.jsx)($G,{position:[e.latitude,e.longitude],icon:$$,children:(0,eh.jsx)($V,{children:null!=(n=e.placeName)?n:""})}),(null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)&&(null==e?void 0:e.uncertainty)!==void 0&&(0,eh.jsx)($W,{center:[e.latitude,e.longitude],size:1e3*e.uncertainty})]})})};function $X(e){return!!((null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude))}let $Z=({venue:e,setVenue:t,autoStartGeolocation:n=!1})=>{var r,i;let a,o,{t:s}=tA(),[l,u]=(0,em.useState)(!1),[c,d]=(0,em.useState)(!1),[h,p]=(0,em.useState)(null),[m,f]=(0,em.useState)(null),[g,v]=(0,em.useState)(!1),[y,_]=(0,em.useState)(""),[x,w]=(0,em.useState)([]),S=(0,em.useRef)(0),E=(0,em.useRef)(null),A=(0,em.useRef)(!1),T=l||$X(e),I=(i=async e=>{v(!0);try{let t=await fetch(`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(e)}&format=jsonv2&limit=5&addressdetails=1`),n=await t.json();w(n)}catch(e){f(String(s("widget.geocodingFailed")))}finally{v(!1)}},a=(0,em.useRef)(),o=(0,em.useRef)(null),(0,em.useEffect)(()=>(o.current=i,()=>{o.current=null}),[i]),(0,em.useEffect)(()=>()=>{clearTimeout(a.current)},[]),(0,em.useMemo)(()=>(...e)=>{clearTimeout(a.current),a.current=window.setTimeout(()=>{o.current&&o.current(...e)},1e3)},[1e3])),C=(0,em.useCallback)((e,t)=>{if(_(e),null==t||!t.skipSearch){if(!e.trim())return void w([]);I(e)}},[I]),M=(0,em.useCallback)(e=>{let n=$J(e);t({latitude:e.lat,longitude:e.lon,placeName:n,uncertainty:(null==e?void 0:e.boundingbox)?(e=>{let[t,n,r,i]="string"==typeof e[0]?e.map(parseFloat):e,a=t*$M,o=r*$M,s=n*$M,l=i*$M;return 6367.5*(2*Math.asin(Math.sqrt(Math.sin((s-a)/2)*Math.sin((s-a)/2)+Math.cos(a)*Math.cos(s)*Math.sin((l-o)/2)*Math.sin((l-o)/2))))})(e.boundingbox):2}),d(!1),_(""),w([]),f(null),p(null)},[t,s]),N=(0,em.useCallback)(()=>{let e=++S.current;if(p(null),f(null),!navigator.geolocation){u(!1),p(String(s("widget.positionUnavailableManual"))),d(!0);return}u(!0),navigator.geolocation.getCurrentPosition(n=>{if(e!==S.current)return;let r={latitude:n.coords.latitude,longitude:n.coords.longitude,placeName:"",uncertainty:n.coords.accuracy/1e3};t(r),u(!1);let i=new AbortController,a=window.setTimeout(()=>i.abort(),8e3);(async()=>{try{let a=await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${n.coords.latitude}&lon=${n.coords.longitude}&format=jsonv2&addressdetails=1`,{signal:i.signal});if(e!==S.current)return;let o=await a.json(),s=$J(o);t({...r,placeName:s})}catch(t){if(e!==S.current||"AbortError"===t.name)return;console.error("[PositionPopover] reverse geocode failed",t),f(String(s("widget.geocodingFailed")))}finally{window.clearTimeout(a)}})()},n=>{e!==S.current||(u(!1),t(void 0),1===n.code?(p(String(s("widget.positionUnavailableManual"))),d(!0)):f(String(s("widget.geocodingFailed"))))},{enableHighAccuracy:!0,timeout:15e3,maximumAge:0})},[t,s]),R=(0,em.useCallback)(()=>{if(p(null),f(null),T&&!l){S.current+=1,t({latitude:0,longitude:0,placeName:"",uncertainty:0}),d(!1),_(""),w([]);return}if(l){S.current+=1,u(!1),t(void 0);return}N()},[l,t,T,N]);(0,em.useEffect)(()=>{if(!n){A.current=!1;return}A.current||$X(e)||l||(A.current=!0,N())},[n,l,N,e]),(0,em.useEffect)(()=>{if(!c)return;let e=requestAnimationFrame(()=>{var e;null==(e=E.current)||e.focus()});return()=>cancelAnimationFrame(e)},[c]);let O=h||m,P=s("widget.shareLocationHint")||"Get answers tailored to where you are";return(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("div",{className:"memori-position-popover__row memori-position-popover__switch-row",children:(0,eh.jsxs)("button",{type:"button",className:"memori-dropdown--auth-row",onClick:()=>{R()},children:[(0,eh.jsx)("span",{className:"memori-dropdown--auth-icon-wrap",children:(0,eh.jsx)(VS,{size:16})}),(0,eh.jsxs)("span",{className:"memori-dropdown--auth-copy",children:[(0,eh.jsx)("span",{className:"memori-dropdown--auth-title",children:s("widget.shareLocation")||"Share my location"}),(0,eh.jsx)(_H,{title:P,placement:"top",children:(0,eh.jsx)("span",{className:"memori-dropdown--auth-subtitle",children:P})})]}),(0,eh.jsx)("span",{className:(b(tT))("memori-dropdown--switch",T&&"memori-dropdown--switch--on"),"aria-hidden":!0})]})}),(T||l||c)&&(0,eh.jsx)("div",{className:"memori-position-popover__tag-block",children:l?(0,eh.jsxs)("div",{className:"memori-position-popover__tag memori-position-popover__tag--loading","aria-busy":"true","aria-live":"polite",children:[(0,eh.jsx)("span",{className:"memori-position-popover__spinner","aria-hidden":!0}),(0,eh.jsx)("span",{className:"memori-position-popover__tag-skeleton"})]}):c?(0,eh.jsx)("div",{className:"memori-position-popover__autocomplete-wrap",children:(0,eh.jsx)($K,{venue:e,query:y,fetching:g,suggestions:x,onQueryChange:C,onChange:M,getPlaceName:$J,t:s,autocompleteRootId:"memori-position-popover-venue-search",inputRef:E})}):(0,eh.jsxs)("div",{className:"memori-position-popover__tag",children:[(0,eh.jsx)("span",{className:"memori-position-popover__tag-text",children:(null==(r=null==e?void 0:e.placeName)?void 0:r.trim())?e.placeName:s("widget.positionResolving")}),(0,eh.jsx)(yt,{type:"button",variant:"ghost",icon:(0,eh.jsx)(VF,{size:16,strokeWidth:2,"aria-hidden":!0}),size:"sm",className:"memori-position-popover__tag-edit","aria-label":String(s("widget.editPositionAria")),onClick:()=>{d(!0),p(null)}})]})}),O&&(0,eh.jsx)("p",{className:"memori-position-popover__error",role:"alert",children:O}),$X(e)&&!l&&(0,eh.jsx)("div",{className:"memori-position-popover__map",children:(0,eh.jsx)($Y,{venue:e})})]})};var $Q=({venue:e,setVenue:t,open:n,onOpenChange:r,triggerClassName:i,triggerButtonVariant:a="toolbar",triggerAriaLabel:o,positionerClassName:s,autoStartGeolocation:l=!1})=>{let u=$X(e);return(0,eh.jsx)(x2,{open:n,onOpenChange:r,modal:!1,closable:!1,placement:"bottom-end",sideOffset:8,contentClassName:"memori-position-popover__popup",slotProps:{trigger:{className:i,render:e=>(0,eh.jsx)(Gc,{...e,type:"button",variant:a,active:n,className:(b(tT))("memori-header--button","memori-header--button--position",u&&"memori-header--button--position--active",i),"aria-label":o,"aria-expanded":n,icon:(0,eh.jsx)(VS,{"aria-hidden":!0})})},positioner:{className:(b(tT))("memori-position-popover__positioner",s)}},content:(0,eh.jsx)($Z,{venue:e,setVenue:t,autoStartGeolocation:n&&l}),children:null})},$0=({className:e,title:t})=>(0,eh.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:800,height:800,fill:"none",viewBox:"0 0 24 24",className:e,"aria-label":t,children:[(0,eh.jsx)("path",{stroke:"currentColor",strokeWidth:1.5,d:"M16 22V8c0-2.828 0-4.243-.879-5.121C14.243 2 12.828 2 10 2H9c-2.828 0-4.243 0-5.121.879C3 3.757 3 5.172 3 8v14"}),(0,eh.jsx)("path",{stroke:"currentColor",strokeWidth:1.5,d:"M11 6H8c-.943 0-1.414 0-1.707.293C6 6.586 6 7.057 6 8c0 .943 0 1.414.293 1.707C6.586 10 7.057 10 8 10h3c.943 0 1.414 0 1.707-.293C13 9.414 13 8.943 13 8c0-.943 0-1.414-.293-1.707C12.414 6 11.943 6 11 6Z"}),(0,eh.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M7 17h5M17 22H2M19.5 4l1.233.986c.138.11.207.166.27.222a3 3 0 0 1 .992 2.066c.005.084.005.172.005.348V18.5a1.5 1.5 0 0 1-3 0v-.071c0-.79-.64-1.429-1.429-1.429H16"}),(0,eh.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M22 8h-1.5A1.5 1.5 0 0 0 19 9.5v2.419a1.5 1.5 0 0 0 1.026 1.423L22 14"})]}),em=ec("85Hg2");let $1=e=>{if("number"==typeof e&&Number.isFinite(e))return e;if(e&&"object"==typeof e){if("number"==typeof e.parsedValue&&Number.isFinite(e.parsedValue))return e.parsedValue;if("string"==typeof e.source){let t=Number(e.source);if(Number.isFinite(t))return t}}},$2=(e,t)=>new Intl.NumberFormat(t,{minimumFractionDigits:0,maximumFractionDigits:Math.abs(e)>=1?3:4}).format(e),$3=(e,t)=>new Intl.NumberFormat(t,{maximumFractionDigits:0}).format(e),$4=(e,t,n)=>{let r=Math.abs(e);if("energy"===t){if(r>=1)return`${$2(e,n)} kWh`;let t=1e3*e;return Math.abs(t)>=1?`${$2(t,n)} Wh`:`${$2(1e3*t,n)} mWh`}if("co2"===t){if(r>=1)return`${$2(e,n)} kg`;let t=1e3*e;return Math.abs(t)>=1?`${$2(t,n)} g`:`${$2(1e3*t,n)} mg`}if(r>=1)return`${$2(e,n)} L`;let i=1e3*e;return Math.abs(i)>=1?`${$2(i,n)} mL`:`${$2(1e3*i,n)} \u{3BC}L`},$5=({history:e,showTitle:t=!0,className:n})=>{let{t:r,i18n:i}=tA(),a=i.language||navigator.language||"en",o=(0,em.useMemo)(()=>({lines:e}),[e]),s=(0,em.useMemo)(()=>{var e;let t={totalInputTokens:0,totalOutputTokens:0,energy:0,gwp:0,wcf:0,models:new Set};return(null!=(e=null==o?void 0:o.lines)?e:[]).forEach(e=>{var n,r,i,a,o;let s=e.llmUsage;if(!s||(t.totalInputTokens+=null!=(n=s.totalInputTokens)?n:0,t.totalOutputTokens+=null!=(r=s.outputTokens)?r:0,(s.provider||s.model)&&t.models.add([s.provider,s.model].filter(Boolean).join(" · ")),!s.energyImpact))return;let l=s.energyImpact;t.energy+=null!=(i=$1(l.energy))?i:0,t.gwp+=null!=(a=$1(l.gwp))?a:0,t.wcf+=null!=(o=$1(l.wcf))?o:0}),t},[o]),l=(0,em.useMemo)(()=>Array.from(s.models),[s.models]);return(0,eh.jsxs)("div",{className:(b(tT))("memori-dropdown--sustainability",n),children:[t&&(0,eh.jsx)("h4",{className:"memori-dropdown--sustainability-title",children:r("chatLogs.totalChatConsumptionTitle")||"Consumo Totale Chat"}),(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-section",children:[(0,eh.jsx)("h5",{className:"memori-dropdown--sustainability-section-title",children:r("chatLogs.modelUsage")||"Model usage"}),(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-summary",children:[(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-stat",children:[(0,eh.jsx)("span",{className:"memori-dropdown--sustainability-stat-label",children:r("chatLogs.input")||"Input"}),(0,eh.jsx)("strong",{className:"memori-dropdown--sustainability-stat-value",children:$3(s.totalInputTokens,a)}),(0,eh.jsx)("span",{className:"memori-dropdown--sustainability-stat-meta",children:r("chatLogs.tokens")||"Tokens"})]}),(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-stat",children:[(0,eh.jsx)("span",{className:"memori-dropdown--sustainability-stat-label",children:r("chatLogs.output")||"Output"}),(0,eh.jsx)("strong",{className:"memori-dropdown--sustainability-stat-value",children:$3(s.totalOutputTokens,a)}),(0,eh.jsx)("span",{className:"memori-dropdown--sustainability-stat-meta",children:r("chatLogs.tokens")||"Tokens"})]})]}),l.length>0&&(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-row memori-dropdown--sustainability-row--stacked",children:[(0,eh.jsxs)("span",{className:"memori-dropdown--sustainability-label",children:[r("chatLogs.provider")||"Provider"," /"," ",r("chatLogs.model")||"Model"]}),(0,eh.jsx)("div",{className:"memori-dropdown--sustainability-tags",children:l.map(e=>(0,eh.jsx)("span",{className:"memori-dropdown--sustainability-tag",children:e},e))})]})]}),(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-metrics",children:[(0,eh.jsx)("h5",{className:"memori-dropdown--sustainability-section-title",children:r("chatLogs.environmentalImpact")||"Environmental impact"}),(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-row",children:[(0,eh.jsxs)("span",{className:"memori-dropdown--sustainability-label",children:[(0,eh.jsx)("span",{"aria-hidden":"true",children:Vd.energy})," ",r("chatLogs.energy")||"Energy"]}),(0,eh.jsx)("strong",{className:"memori-dropdown--sustainability-value",children:$4(s.energy,"energy",a)})]}),(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-row",children:[(0,eh.jsxs)("span",{className:"memori-dropdown--sustainability-label",children:[(0,eh.jsx)("span",{"aria-hidden":"true",children:Vd.co2})," ",r("chatLogs.co2")||"CO2"]}),(0,eh.jsx)("strong",{className:"memori-dropdown--sustainability-value",children:$4(s.gwp,"co2",a)})]}),(0,eh.jsxs)("div",{className:"memori-dropdown--sustainability-row",children:[(0,eh.jsxs)("span",{className:"memori-dropdown--sustainability-label",children:[(0,eh.jsx)("span",{"aria-hidden":"true",children:Vd.water})," ",r("chatLogs.water")||"Water"]}),(0,eh.jsx)("strong",{className:"memori-dropdown--sustainability-value",children:$4(s.wcf,"water",a)})]})]})]})};var $6=({history:e,triggerVariant:t="ghost",trigger:n,open:r,onOpenChange:i,hideTrigger:a=!1})=>{let{t:o}=tA(),[s,l]=(0,em.useState)(!1),u=void 0!==r,c=u?r:s,d=e=>{u||l(e),null==i||i(e)},h=(0,em.useMemo)(()=>(null!=e?e:[]).some(e=>!!e.llmUsage),[e]),p=o("write_and_speak.showMessageConsumptionLabel")||"Show chat consumption",m=o("chatLogs.totalChatConsumptionTitle")||"Consumo Totale Chat",f=e=>{var n;return(0,eh.jsx)(_H,{title:p,placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{...e,variant:t,shape:"default",active:c,disabled:null!=(n=e.disabled)?n:!h,className:(b(tT))("memori-header--button memori-header--button--sustainability",e.className),"aria-label":p,icon:(0,eh.jsx)($0,{className:"memori-header--button--sustainability-icon"})})})})};return h?(0,eh.jsxs)(eh.Fragment,{children:[!a&&(e=>{var t;if(!n)return f(e);if("function"==typeof n)return n(e,{open:c});if(!(b(em)).isValidElement(n))return f(e);let r=null!=(t=n.props)?t:{},i=(b(tT))(e.className,r.className);return(b(em)).cloneElement(n,{...r,...e,className:i||void 0,onClick:t=>{var n,i;null==(n=e.onClick)||n.call(e,t),null==(i=r.onClick)||i.call(r,t)}})})({onClick:e=>{h&&(d(!0),e.currentTarget.blur())}}),(0,eh.jsx)(__,{open:c,onClose:()=>d(!1),title:m,className:"memori-chat--usage-modal memori-chat--consumption-modal",width:"30rem",stacking:"stacked",closable:!0,children:(0,eh.jsx)($5,{history:e,showTitle:!1})})]}):a||n?null:f({disabled:!0})},$8=({className:e,buttonVariant:t="ghost",memori:n,tenant:r,history:i,position:a,setVenue:o,positionPopoverOpen:s,setPositionPopoverOpen:l,autoStartPositionGeolocation:u=!1,setShowSettingsDrawer:c,setShowChatHistoryDrawer:d,setShowKnownFactsDrawer:h,setShowExpertsDrawer:p,enableAudio:m=!0,speakerMuted:f,setSpeakerMuted:g,hasUserActivatedSpeak:v=!1,showShare:y=!0,showSettings:_=!0,showReload:x=!1,showClear:w=!1,showExperts:S=!1,showLogin:E=!0,setShowLoginDrawer:A,clearHistory:T,loginToken:I,user:C,sessionID:M,showChatHistory:N=!0,fullScreenHandler:R,baseUrl:O,onLogout:P,apiClient:k,layout:D,additionalSettings:B,showMessageConsumption:F=!1,showFullscreen:U=!0,extraActions:j})=>{var z;let H,G,{t:V,i18n:W}=tA(),q="dark"===v3()?"inverse":t,{add:$}=vZ(),{uploadAsset:J,pwlUpdateUser:K}=k.backend,[Y,X]=(0,em.useState)(!1),[Z,Q]=(0,em.useState)(!1),[ee,et]=(0,em.useState)(!1),[en,er]=(0,em.useState)(!1),[ei,ea]=(0,em.useState)(!1),eo=Lm(),es=e=>{if("number"==typeof e&&Number.isFinite(e))return e;if(e&&"object"==typeof e){if("number"==typeof e.parsedValue&&Number.isFinite(e.parsedValue))return e.parsedValue;if("string"==typeof e.source){let t=Number(e.source);if(Number.isFinite(t))return t}}},el=(e,t)=>new Intl.NumberFormat(t,{minimumFractionDigits:0,maximumFractionDigits:Math.abs(e)>=1?3:4}).format(e),eu=(e,t,n)=>{let r=Math.abs(e);if("energy"===t){if(r>=1)return`${el(e,n)} kWh`;let t=1e3*e;return Math.abs(t)>=1?`${el(t,n)} Wh`:`${el(1e3*t,n)} mWh`}if("co2"===t){if(r>=1)return`${el(e,n)} kg`;let t=1e3*e;return Math.abs(t)>=1?`${el(t,n)} g`:`${el(1e3*t,n)} mg`}if(r>=1)return`${el(e,n)} L`;let i=1e3*e;return Math.abs(i)>=1?`${el(i,n)} mL`:`${el(1e3*i,n)} \u{3BC}L`},ec=W.language||navigator.language||"en",ed=(0,em.useMemo)(()=>({lines:i}),[i]),ep=(0,em.useMemo)(()=>{var e;let t={energy:0,gwp:0,wcf:0};return(null!=(e=null==ed?void 0:ed.lines)?e:[]).forEach(e=>{var n,r,i,a;let o=null==(n=e.llmUsage)?void 0:n.energyImpact;o&&(t.energy+=null!=(r=es(o.energy))?r:0,t.gwp+=null!=(i=es(o.gwp))?i:0,t.wcf+=null!=(a=es(o.wcf))?a:0)}),t},[ed]),ef=(0,em.useMemo)(()=>{var e;return(null!=(e=null==ed?void 0:ed.lines)?e:[]).some(e=>{var t;return!!(null==(t=e.llmUsage)?void 0:t.energyImpact)})},[ed]),eg=(0,em.useMemo)(()=>{var e;return(null!=(e=null==ed?void 0:ed.lines)?e:[]).some(e=>!!e.llmUsage)},[ed]);(0,em.useEffect)(()=>{document.fullscreenEnabled&&X(!0)},[]),(0,em.useEffect)(()=>{let e=()=>{var e;let t=!!document.fullscreenElement;if(Q(t),!t){let t=document.querySelector(".memori-widget");(null==(e=null==t?void 0:t.dataset)?void 0:e.memoriPrevBgColor)!==void 0&&(t.style.backgroundColor=t.dataset.memoriPrevBgColor,delete t.dataset.memoriPrevBgColor)}};return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]);let[ev,ey]=(0,em.useState)(()=>"u"<typeof window||!window.matchMedia||!window.matchMedia("(max-width: 767px)").matches);(0,em.useEffect)(()=>{if(!window.matchMedia)return;let e=window.matchMedia("(max-width: 767px)"),t=()=>ey(!e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let eb=(0,em.useCallback)((e,t)=>"TOTEM"===e||t&&Object.keys(t).length>0||!1,[D,B]),e_=async e=>{if(e&&I){let t=new FileReader;t.onload=async t=>{var n,r,i;try{let{asset:a,...o}=await J(null!=(n=e.name)?n:"avatar",null==(r=t.target)?void 0:r.result,null!=I?I:"");if(0!==o.resultCode)console.error("[updateAvatar] Upload failed:",o),$(v9({description:V(Lx(o.resultCode)),severity:"error"}));else if(a){let e={userID:null==C?void 0:C.userID,avatarURL:a.assetURL},{user:t,...n}=await K(null!=I?I:"",null!=(i=null==C?void 0:C.userID)?i:"",e);0!==n.resultCode?$(v9({description:V(Lx(n.resultCode)),severity:"error"})):$(v9({description:V("login.avatarUploadSuccess"),severity:"success"}))}}catch(e){console.error("[updateAvatar] Error:",e),(null==e?void 0:e.message)&&$(v9({description:e.message,severity:"error"}))}},t.readAsDataURL(e)}else console.error("[updateAvatar] Missing avatar or login token",{avatar:e,loginToken:I}),$(v9({description:V("login.avatarUploadError"),severity:"error"}))},ex="FULLPAGE"===D||"CHAT"===D;(0,em.useEffect)(()=>{if(!ex)return;let e=document.querySelector(".memori-widget .memori-chat--history");if(!e)return;let t=()=>{let t=e.scrollTop>2;document.querySelectorAll(".memori-widget .memori-chat-layout--header, .memori-widget .memori-fullpage-top-header, .memori-widget .memori-fullpage-header-row").forEach(e=>{e.classList.toggle("memori-header--scrolled",t)})};return t(),e.addEventListener("scroll",t,{passive:!0}),()=>{e.removeEventListener("scroll",t),document.querySelectorAll(".memori-header--scrolled").forEach(e=>e.classList.remove("memori-header--scrolled"))}},[ex,M,v]);let ew="TOTEM"===D?void 0:V("widget.headerHistory")||"History",eS=V("widget.headerLogin")||V("login.login")||"Login",eE=V("widget.mobileSession.sessionInfo")||"Session info",eA=f?V("widget.soundOff",{defaultValue:"Audio off"}):V("widget.sound",{defaultValue:"Audio"}),eT=Z?V("fullscreenExit")||"Exit fullscreen":V("fullscreenEnter")||"Full screen",eI=!!I&&!!(null==C?void 0:C.userID),eC=(null==C?void 0:C.userName)||(null==C?void 0:C.eMail)||V("login.user"),eM=(G=(H=((null==C?void 0:C.userName)||(null==C?void 0:C.eMail)||"U").trim()).split(/[\s._@-]+/).filter(Boolean)).length>=2?`${G[0][0]}${G[1][0]}`.toUpperCase():H.slice(0,2).toUpperCase(),eN=!!(M&&v),eR=!!n.enableDeepThought&&!!I&&!!(null==C?void 0:C.pAndCUAccepted),eO=eN&&ev&&(eR||F),eP=(null==(z=null==n?void 0:n.name)?void 0:z.trim())||"",ek=(0,em.useMemo)(()=>{var e;let t=null==(e=null==n?void 0:n.description)?void 0:e.trim();return t?t.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim():""},[null==n?void 0:n.description]),eL=(0,em.useMemo)(()=>{if(ex&&n)return n.avatarURL&&n.avatarURL.length>0?La({type:"avatar",tenantID:null==r?void 0:r.name,resourceURI:n.avatarURL,baseURL:O,apiURL:""}):La({type:"avatar",tenantID:null==r?void 0:r.name,baseURL:O,apiURL:""})},[ex,n,r,O]),eD=N&&!!I,eB=!!(_&&eb(D,B)),eF=S&&!!n.enableBoardOfExperts,eU=!!n.needsPosition||x||w||F||U&&Y||eR&&eN||eF||m||eB||y,ej=eO||U&&Y||m||!!n.needsPosition||x||w||eF||eB||y,ez=ev&&eD&&(eI?ej||!!E:eU||!!E),eH=ev&&!!E&&(eI?ej:eU),eG=N&&!!I&&(0,eh.jsx)(_H,{title:V("write_and_speak.chatHistory")||"Chat history",placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-header--chat-history-button",disabled:!I,"aria-label":V("write_and_speak.chatHistory")||"Chat history",icon:(0,eh.jsx)($t,{}),onClick:()=>d(!0),children:ew?(0,eh.jsx)("span",{className:"memori-header--action-label",children:ew}):null})})}),eV=E&&(0,eh.jsx)(eh.Fragment,{children:I&&(null==C?void 0:C.userID)?(0,eh.jsx)(x2,{className:"memori-header--dropdown",open:ee,onOpenChange:e=>{et(e),e&&(er(!1),l(!1))},placement:"bottom-end",sideOffset:8,closable:!1,contentClassName:"memori-dropdown--menu",slotProps:{trigger:{className:(b(tT))("memori-dropdown--user-trigger","memori-dropdown--user-trigger--identity",ex&&"memori-dropdown--user-trigger--fullpage"),render:e=>(0,eh.jsx)(_H,{title:eC,placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsxs)(Gc,{...e,active:ee,variant:q,className:(b(tT))("memori-dropdown--user-trigger-button","memori-dropdown--user-trigger-button--identity"),"aria-label":String(eC),children:[(0,eh.jsx)("span",{className:"memori-dropdown--user-trigger-name",children:(null==C?void 0:C.userName)||V("login.welcomeUser")}),(null==C?void 0:C.avatarURL)?(0,eh.jsx)("img",{src:C.avatarURL,alt:"",className:"memori-dropdown--user-trigger-avatar"}):(0,eh.jsx)("span",{className:"memori-dropdown--user-trigger-initials","aria-hidden":!0,children:eM})]})})})}},content:(0,eh.jsxs)("div",{className:"memori-dropdown--content",children:[(0,eh.jsx)("div",{className:"memori-dropdown--user-item",children:(0,eh.jsxs)("div",{className:"memori-dropdown--user-info",children:[(0,eh.jsx)("div",{className:"memori-dropdown--avatar-wrap",children:C.avatarURL?(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("img",{src:C.avatarURL,alt:C.userName||C.eMail,className:"memori-dropdown--avatar"}),(0,eh.jsx)("span",{className:"memori-dropdown--avatar-overlay","aria-hidden":!0,children:(0,eh.jsx)($n,{size:20,strokeWidth:2})}),(0,eh.jsx)("label",{htmlFor:"avatar",className:"sr-only",children:V("login.avatarChange")}),(0,eh.jsx)("input",{type:"file",name:"avatar",id:"avatar",className:"memori-dropdown--avatar-input",onChange:e=>{var t,n;return e_(null!=(n=null==(t=e.target.files)?void 0:t[0])?n:null)},accept:Li.join(", ")})]}):(0,eh.jsx)(eh.Fragment,{children:(0,eh.jsxs)("div",{className:"memori-dropdown--avatar-placeholder",children:[(0,eh.jsx)("span",{className:"memori-dropdown--avatar-initial",children:(C.userName||C.eMail||"U").charAt(0).toUpperCase()}),(0,eh.jsx)("span",{className:"memori-dropdown--avatar-overlay","aria-hidden":!0,children:(0,eh.jsx)($n,{size:20,strokeWidth:2})}),(0,eh.jsx)("label",{htmlFor:"avatar",className:"sr-only",children:V("login.avatarChange")}),(0,eh.jsx)("input",{type:"file",name:"avatar",id:"avatar",className:"memori-dropdown--avatar-input",onChange:e=>{var t,n;return e_(null!=(n=null==(t=e.target.files)?void 0:t[0])?n:null)},accept:Li.join(", ")})]})})}),(0,eh.jsxs)("div",{className:"memori-dropdown--user-details",children:[(0,eh.jsx)("h3",{className:"memori-dropdown--user-name",children:C.userName||V("login.welcomeUser")}),(0,eh.jsx)("p",{className:"memori-dropdown--user-email",children:C.eMail}),(0,eh.jsx)("div",{className:"memori-dropdown--user-badge",children:C.birthDate?new Date(C.birthDate).toLocaleDateString():V("login.notSet")})]})]})}),(0,eh.jsx)("div",{className:"memori-dropdown--separator"}),(0,eh.jsx)(Gc,{type:"button",variant:q,onClick:P,className:"memori-dropdown--action-button memori-dropdown--action-button--logout",icon:(0,eh.jsx)($r,{size:18,strokeWidth:2,"aria-hidden":!0}),children:(0,eh.jsx)("span",{className:"memori-header--action-label",children:V("login.logout")||"Logout"})})]}),children:null}):ex?(0,eh.jsx)(_H,{title:V("login.login")||"Login",placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(yt,{variant:"primary",className:"memori-header--button memori-header--button-login",icon:(0,eh.jsx)(Lp,{}),title:V("login.login")||"Login","aria-label":V("login.login")||"Login",onClick:()=>A(!0),children:eS})})}):(0,eh.jsx)(_H,{title:V("login.login")||"Login",placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-header--button memori-header--button-login",icon:(0,eh.jsx)(Lp,{}),title:V("login.login")||"Login","aria-label":V("login.login")||"Login",onClick:()=>A(!0)})})})}),eW=(e,t="bottom")=>(0,eh.jsx)(_H,{title:V("reload")||"Reload",placement:t,children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:e,"aria-label":V("reload")||"Reload",icon:(0,eh.jsx)($i,{}),onClick:()=>{window.location.reload()}})})}),eq=(e,t="bottom")=>(0,eh.jsx)(_H,{title:V("clearHistory")||"Clear chat",placement:t,children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:e,"aria-label":V("clearHistory")||"Clear chat",icon:(0,eh.jsx)($a,{}),onClick:()=>{T(),$(v9({description:V("clearHistoryDone"),severity:"success"}))}})})}),e$=(e,t="bottom")=>(0,eh.jsx)(_H,{title:V("widget.showExpertsInTheBoard")||"Experts in this board",placement:t,children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:e,icon:(0,eh.jsx)(VA,{}),disabled:!v||!M,"aria-label":V("widget.showExpertsInTheBoard")||"Experts in this board",onClick:()=>p(!0)})})}),eJ=(e,t="bottom")=>(0,eh.jsx)(_H,{title:V("widget.settings")||"Settings",placement:t,children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:e,icon:(0,eh.jsx)($o,{}),"aria-label":V("widget.settings")||"Settings",onClick:()=>c(!0)})})}),eK=(0,eh.jsxs)(eh.Fragment,{children:[n.needsPosition&&(0,eh.jsx)("div",{className:"memori-header--position",children:(0,eh.jsx)(_H,{title:V("widget.position")||"Position",placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)($Q,{venue:a,setVenue:o,open:s,autoStartGeolocation:u,onOpenChange:e=>{l(e),e&&(er(!1),et(!1))},triggerButtonVariant:q,triggerAriaLabel:V("widget.position")||"Position",positionerClassName:"WEBSITE_ASSISTANT"===D?"memori-position-popover__positioner--website-assistant":void 0})})})}),x&&eW(),w&&eq()]}),eY=(0,eh.jsxs)(eh.Fragment,{children:[F&&(0,eh.jsx)($6,{history:i,triggerVariant:q}),U&&Y&&(0,eh.jsx)(_H,{title:eT,placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,title:eT,"aria-label":eT,icon:Z?(0,eh.jsx)($s,{}):(0,eh.jsx)($l,{}),onClick:R||(()=>{var e;if(document.fullscreenElement)document.exitFullscreen&&document.exitFullscreen().then(()=>{var e;Q(!1);let t=document.querySelector(".memori-widget");(null==(e=null==t?void 0:t.dataset)?void 0:e.memoriPrevBgColor)!==void 0&&(t.style.backgroundColor=t.dataset.memoriPrevBgColor,delete t.dataset.memoriPrevBgColor)}).catch(e=>{console.warn("Error attempting to exit fullscreen:",e)});else{let t="HIDDEN_CHAT"!==D&&"WEBSITE_ASSISTANT"!==D?document.body:document.querySelector(".memori-widget");if(t){let n=document.querySelector(".memori-widget");n&&(void 0===n.dataset.memoriPrevBgColor&&(n.dataset.memoriPrevBgColor=null!=(e=n.style.backgroundColor)?e:""),n.style.backgroundColor=""),t.requestFullscreen().then(()=>Q(!0)).catch(e=>{console.warn("Error attempting to enable fullscreen:",e)})}}})})})}),eR&&eN&&(0,eh.jsx)(_H,{title:V("knownFacts.title")||"Known facts",placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,icon:(0,eh.jsx)($u,{}),"aria-label":V("knownFacts.title")||"Known facts",onClick:()=>h(!0)})})}),eF&&e$(),m&&(0,eh.jsx)(_H,{title:eA,placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,icon:f?(0,eh.jsx)($c,{size:20,strokeWidth:2.35,"aria-hidden":!0}):(0,eh.jsx)(GL,{size:20,strokeWidth:2,"aria-hidden":!0}),title:eA,"aria-label":eA,onClick:()=>g(!f)})})}),eB&&eJ(),y&&(0,eh.jsx)($C,{title:n.name,memori:n,sessionID:M,tenant:r,showQrCode:!0,align:"left",baseUrl:O,history:i,triggerVariant:q})]}),eX=ef?`${eu(ep.energy,"energy",ec)} \u{2022} ${eu(ep.gwp,"co2",ec)}`:V("widget.noData",{defaultValue:"Nessun dato disponibile"}),eZ=(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsxs)("div",{className:"memori-header--auth-icon-controls",children:[eO&&(0,eh.jsx)(x2,{className:"memori-header--dropdown",open:en,onOpenChange:e=>{er(e),e&&(et(!1),l(!1))},placement:"bottom-end",sideOffset:8,closable:!1,contentClassName:"memori-dropdown--menu memori-dropdown--auth-menu",slotProps:{trigger:{render:e=>(0,eh.jsx)(_H,{title:eE,placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{...e,active:en,variant:q,className:"memori-header--auth-icon-button","aria-label":eE,icon:(0,eh.jsx)(H3,{})})})})}},content:(0,eh.jsxs)("div",{className:"memori-dropdown--auth-content",children:[eR&&(0,eh.jsxs)("button",{type:"button",className:"memori-dropdown--auth-row memori-dropdown--auth-row--navigable",onClick:()=>{h(!0),er(!1)},children:[(0,eh.jsx)("span",{className:"memori-dropdown--auth-icon-wrap",children:(0,eh.jsx)($u,{size:16})}),(0,eh.jsxs)("span",{className:"memori-dropdown--auth-copy",children:[(0,eh.jsx)("span",{className:"memori-dropdown--auth-title",children:V("knownFacts.title")||"Known facts"}),(0,eh.jsx)("span",{className:"memori-dropdown--auth-subtitle",children:V("widget.knownFactsHint")||"What I remember about you"})]})]}),F&&(eg?(0,eh.jsxs)("button",{type:"button",className:(b(tT))("memori-dropdown--auth-row","memori-dropdown--auth-row--navigable",ei&&"memori-dropdown--auth-row--active"),onClick:()=>{ea(!0),er(!1)},children:[(0,eh.jsx)("span",{className:"memori-dropdown--auth-icon-wrap",children:(0,eh.jsx)($0,{})}),(0,eh.jsxs)("span",{className:"memori-dropdown--auth-copy",children:[(0,eh.jsx)("span",{className:"memori-dropdown--auth-title",children:V("widget.aiConsumption")||"AI usage"}),(0,eh.jsx)("span",{className:"memori-dropdown--auth-subtitle",children:eX})]})]}):(0,eh.jsxs)("button",{type:"button",disabled:!0,className:"memori-dropdown--auth-row memori-dropdown--auth-row--navigable memori-dropdown--auth-row--disabled",children:[(0,eh.jsx)("span",{className:"memori-dropdown--auth-icon-wrap",children:(0,eh.jsx)($0,{})}),(0,eh.jsxs)("span",{className:"memori-dropdown--auth-copy",children:[(0,eh.jsx)("span",{className:"memori-dropdown--auth-title",children:V("widget.aiConsumption")||"AI usage"}),(0,eh.jsx)("span",{className:"memori-dropdown--auth-subtitle",children:eX})]})]}))]}),children:null}),U&&Y&&(0,eh.jsx)(_H,{title:eT,placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-header--auth-icon-button",title:eT,"aria-label":eT,icon:Z?(0,eh.jsx)($s,{}):(0,eh.jsx)($l,{}),onClick:R||(()=>{var e;if(document.fullscreenElement)document.exitFullscreen&&document.exitFullscreen().then(()=>{var e;Q(!1);let t=document.querySelector(".memori-widget");(null==(e=null==t?void 0:t.dataset)?void 0:e.memoriPrevBgColor)!==void 0&&(t.style.backgroundColor=t.dataset.memoriPrevBgColor,delete t.dataset.memoriPrevBgColor)}).catch(e=>{console.warn("Error attempting to exit fullscreen:",e)});else{let t="HIDDEN_CHAT"!==D&&"WEBSITE_ASSISTANT"!==D?document.body:document.querySelector(".memori-widget");if(t){let n=document.querySelector(".memori-widget");n&&(void 0===n.dataset.memoriPrevBgColor&&(n.dataset.memoriPrevBgColor=null!=(e=n.style.backgroundColor)?e:""),n.style.backgroundColor=""),t.requestFullscreen().then(()=>Q(!0)).catch(e=>{console.warn("Error attempting to enable fullscreen:",e)})}}})})})}),m&&(0,eh.jsx)(_H,{title:eA,placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-header--auth-icon-button",title:eA,"aria-label":eA,icon:f?(0,eh.jsx)($c,{size:20,strokeWidth:2.35,"aria-hidden":!0}):(0,eh.jsx)(GL,{size:20,strokeWidth:2,"aria-hidden":!0}),onClick:()=>g(!f)})})}),n.needsPosition&&(0,eh.jsx)(_H,{title:V("widget.position")||"Position",placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)($Q,{venue:a,setVenue:o,open:s,autoStartGeolocation:u,onOpenChange:e=>{l(e),e&&(er(!1),et(!1))},triggerButtonVariant:q,triggerClassName:"memori-header--auth-icon-button",triggerAriaLabel:V("widget.position")||"Position",positionerClassName:"WEBSITE_ASSISTANT"===D?"memori-position-popover__positioner--website-assistant":void 0})})}),x&&eW("memori-header--auth-icon-button"),w&&eq("memori-header--auth-icon-button"),eF&&e$("memori-header--auth-icon-button"),eB&&eJ("memori-header--auth-icon-button"),y&&(0,eh.jsx)("span",{className:"memori-header--auth-share-button-wrap",children:(0,eh.jsx)($C,{title:n.name,memori:n,sessionID:M,tenant:r,showQrCode:!0,align:"left",baseUrl:O,history:i,triggerVariant:q,className:"memori-header--auth-share-button"})})]}),F&&eg&&(0,eh.jsx)($6,{history:i,triggerVariant:q,hideTrigger:!0,open:ei,onOpenChange:ea})]}),eQ=V("login.user")||"Account",e0=V("reload")||"Restart conversation",e1=V("widget.settings")||"Settings",e2=V("knownFacts.title")||"Known facts",e3=V("write_and_speak.chatHistory")||"Chat history",e4=eR&&eN,e5=!!(E||e4),e6=(0,eh.jsxs)("div",{className:(b(tT))("memori-totem-rail",e),role:"toolbar","aria-label":String(V("widget.sessionControls",{defaultValue:"Controlli"})),"aria-orientation":"vertical",children:[(0,eh.jsxs)("div",{className:"memori-totem-rail--group",children:[m&&(0,eh.jsx)(_H,{title:eA,placement:"left",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-totem-rail--button",icon:f?(0,eh.jsx)($c,{size:20,strokeWidth:2.35,"aria-hidden":!0}):(0,eh.jsx)(GL,{size:20,strokeWidth:2,"aria-hidden":!0}),title:eA,"aria-label":eA,"aria-pressed":f,onClick:()=>g(!f)})})}),U&&Y&&(0,eh.jsx)(_H,{title:eT,placement:"left",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-totem-rail--button",icon:Z?(0,eh.jsx)($s,{}):(0,eh.jsx)($l,{}),title:eT,"aria-label":eT,"aria-pressed":Z,onClick:e=>{var t,n,r;R?R(e):document.fullscreenElement?null==(r=document.exitFullscreen)||r.call(document).then(()=>Q(!1)).catch(()=>{}):null==(n=(t=document.documentElement).requestFullscreen)||n.call(t).then(()=>Q(!0)).catch(()=>{})}})})}),y&&(0,eh.jsx)($C,{title:n.name,memori:n,sessionID:M,tenant:r,showQrCode:!0,align:"left",baseUrl:O,history:i,triggerVariant:q,className:"memori-totem-rail--button"}),x&&(0,eh.jsx)(_H,{title:e0,placement:"left",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-totem-rail--button",icon:(0,eh.jsx)($i,{}),title:e0,"aria-label":e0,onClick:()=>{window.location.reload()}})})}),w&&eq("memori-totem-rail--button","left"),eF&&e$("memori-totem-rail--button","left"),eB&&(0,eh.jsx)(_H,{title:e1,placement:"left",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-totem-rail--button",icon:(0,eh.jsx)($o,{}),title:e1,"aria-label":e1,onClick:()=>c(!0)})})}),N&&!!I&&(0,eh.jsx)(_H,{title:e3,placement:"left",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{variant:q,className:"memori-totem-rail--button",icon:(0,eh.jsx)($t,{}),title:e3,"aria-label":e3,onClick:()=>d(!0)})})})]}),e5&&(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("div",{className:"memori-totem-rail--divider","aria-hidden":"true"}),(0,eh.jsx)("div",{className:"memori-totem-rail--group",children:(0,eh.jsx)(x2,{className:"memori-header--dropdown",open:ee,onOpenChange:e=>{et(e),e&&(er(!1),l(!1))},placement:"left-start",sideOffset:8,closable:!1,contentClassName:"memori-dropdown--menu memori-totem-rail--menu",slotProps:{trigger:{render:e=>(0,eh.jsx)(_H,{title:eQ,placement:"left",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{...e,active:ee,variant:q,className:(b(tT))("memori-totem-rail--button","memori-totem-rail--account-trigger"),title:eQ,"aria-label":eQ,icon:(0,eh.jsx)(Lp,{})})})})}},content:(0,eh.jsxs)("div",{className:"memori-totem-rail--menu-content",children:[E&&eI&&(0,eh.jsxs)("div",{className:"memori-totem-rail--menu-identity",children:[(0,eh.jsx)("span",{className:"memori-totem-rail--menu-identity-name",children:(null==C?void 0:C.userName)||V("login.welcomeUser")}),(null==C?void 0:C.eMail)&&(0,eh.jsx)("span",{className:"memori-totem-rail--menu-identity-email",children:C.eMail})]}),e4&&(0,eh.jsx)(yt,{type:"button",variant:"ghost",className:"memori-totem-rail--menu-item",icon:(0,eh.jsx)($u,{size:18,"aria-hidden":!0}),title:e2,"aria-label":e2,onClick:()=>{et(!1),h(!0)},children:e2}),E&&(eI?(0,eh.jsx)(yt,{type:"button",variant:"ghost",className:"memori-totem-rail--menu-item memori-totem-rail--menu-item--logout",icon:(0,eh.jsx)($r,{size:18,"aria-hidden":!0}),title:V("login.logout")||"Logout","aria-label":V("login.logout")||"Logout",onClick:()=>{et(!1),null==P||P()},children:V("login.logout")||"Logout"}):(0,eh.jsx)(yt,{type:"button",variant:"ghost",className:"memori-totem-rail--menu-item",icon:(0,eh.jsx)(Lp,{size:18,"aria-hidden":!0}),title:V("login.login")||"Login","aria-label":V("login.login")||"Login",onClick:()=>{et(!1),A(!0)},children:V("login.login")||"Login"}))]}),children:null})})]})]}),e8=(0,eh.jsxs)("div",{className:(b(tT))("memori-header",e,ex&&"memori-header--fullpage","FULLPAGE"===D&&!I&&"memori-header--fullpage-guest"),children:[ex&&eI?(0,eh.jsxs)(eh.Fragment,{children:[eD&&(0,eh.jsx)("div",{className:"memori-header--fullpage-primary",children:eG}),ez&&(0,eh.jsx)("div",{className:"memori-header--fullpage-divider","aria-hidden":"true"}),ej&&(0,eh.jsx)("div",{className:"memori-header--fullpage-secondary",children:eZ}),eH&&(0,eh.jsx)("div",{className:"memori-header--fullpage-divider","aria-hidden":"true"}),eV]}):ex?(0,eh.jsxs)(eh.Fragment,{children:[eD&&(0,eh.jsx)("div",{className:"memori-header--fullpage-primary",children:eG}),ez&&(0,eh.jsx)("div",{className:"memori-header--fullpage-divider","aria-hidden":"true"}),eU&&(0,eh.jsxs)("div",{className:"memori-header--fullpage-secondary",children:[eK,eY]}),eH&&(0,eh.jsx)("div",{className:"memori-header--fullpage-divider","aria-hidden":"true"}),eV]}):(0,eh.jsxs)(eh.Fragment,{children:[eK,eG,eY,eV]}),j]});return"TOTEM"===D?e6:ex?(0,eh.jsxs)(eh.Fragment,{children:[eN&&n&&(0,eh.jsxs)("div",{className:"memori-fullpage-header-brand",children:[eL?(0,eh.jsx)("img",{className:"memori-fullpage-header-brand-icon memori-fullpage-header-brand-icon--avatar",src:eL,alt:"",role:"presentation"}):(0,eh.jsx)("span",{className:"memori-fullpage-header-brand-icon","aria-hidden":!0}),(eP||ek)&&(0,eh.jsxs)("div",{className:"memori-fullpage-header-brand-text",children:[eP?(0,eh.jsx)("span",{className:"memori-fullpage-header-brand-name",title:eP,children:eP}):null,ek?(0,eh.jsx)(_H,{title:ek,placement:"bottom",...eo.tooltipProps,slotProps:{positioner:eo.positionerProps,popup:{className:"memori-fullpage-header-brand-role-tooltip"}},children:(0,eh.jsx)("span",{ref:eo.anchorRef,className:"memori-fullpage-header-brand-role",...eo.pressTriggerProps,children:ek})}):null]})]}),(0,eh.jsx)("div",{className:"memori-fullpage-header-actions",children:e8})]}):e8},$7=e=>(0,eh.jsxs)("svg",{className:"memori-ai-logo",width:800,height:800,fill:"currentColor",viewBox:"0 0 670.70013 639.67999","aria-label":"Memori AI",...e,children:[(0,eh.jsxs)("defs",{children:[(0,eh.jsx)("style",{children:"\n .cls-1 {\n fill: url(#Sfumatura_senza_nome_6);\n }\n\n .cls-1,\n .cls-2 {\n stroke-width: 0px;\n }\n\n .cls-2 {\n fill: var(--memori-text-color, '#744c99');\n }\n "}),(0,eh.jsxs)("linearGradient",{id:"Sfumatura_senza_nome_6","data-name":"Sfumatura senza nome 6",x1:392.82999,y1:-13.83,x2:786.29999,y2:628.33002,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(-304.65445,-80.16)",children:[(0,eh.jsx)("stop",{offset:.18,stopColor:"#9ad2d5",id:"stop1"}),(0,eh.jsx)("stop",{offset:.32,stopColor:"#26b5cb",id:"stop2"}),(0,eh.jsx)("stop",{offset:.38,stopColor:"#379cbe",id:"stop3"}),(0,eh.jsx)("stop",{offset:.46,stopColor:"#4c7eb0",id:"stop4"}),(0,eh.jsx)("stop",{offset:.55,stopColor:"#5d66a4",id:"stop5"}),(0,eh.jsx)("stop",{offset:.65,stopColor:"#69569c",id:"stop6"}),(0,eh.jsx)("stop",{offset:.76,stopColor:"#704c97",id:"stop7"}),(0,eh.jsx)("stop",{offset:.89,stopColor:"#734996",id:"stop8"})]})]}),(0,eh.jsxs)("g",{id:"g13",transform:"translate(-304.65445,-80.16)",children:[(0,eh.jsx)("path",{className:"cls-2",d:"m 451.79,434.96 v -78.79 c 0,-15.73 8.09,-25.54 22.73,-25.54 7.01,0 12.93,3.11 16.82,8.41 3.9,-5.29 9.81,-8.41 16.82,-8.41 14.64,0 22.74,9.81 22.74,25.54 v 78.79 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 v -77.08 c 0,-11.21 -3.74,-16.35 -10.9,-16.35 -7.16,0 -10.9,5.14 -10.9,16.35 v 77.08 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 v -77.08 c 0,-11.21 -3.74,-16.35 -10.9,-16.35 -7.16,0 -10.9,5.14 -10.9,16.35 v 77.08 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 z",id:"path8"}),(0,eh.jsx)("path",{className:"cls-2",d:"m 588.37,435.12 c 0,3.11 -2.65,5.45 -5.76,5.45 h -23.98 c -6.7,0 -9.5,-2.81 -9.5,-9.34 v -90.31 c 0,-6.54 2.8,-9.34 9.5,-9.34 h 23.98 c 3.11,0 5.76,2.33 5.76,5.45 0,3.12 -2.65,5.45 -5.76,5.45 h -21.65 v 32.7 h 19.31 c 3.11,0 5.76,2.33 5.76,5.45 0,3.12 -2.65,5.45 -5.76,5.45 h -19.31 v 43.6 h 21.65 c 3.11,0 5.76,2.33 5.76,5.45 z",id:"path9"}),(0,eh.jsx)("path",{className:"cls-2",d:"m 599.59,434.96 v -78.79 c 0,-15.73 8.09,-25.54 22.73,-25.54 7.01,0 12.93,3.11 16.82,8.41 3.9,-5.29 9.81,-8.41 16.82,-8.41 14.64,0 22.74,9.81 22.74,25.54 v 78.79 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 v -77.08 c 0,-11.21 -3.74,-16.35 -10.9,-16.35 -7.16,0 -10.9,5.14 -10.9,16.35 v 77.08 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 v -77.08 c 0,-11.21 -3.74,-16.35 -10.9,-16.35 -7.16,0 -10.9,5.14 -10.9,16.35 v 77.08 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 z",id:"path10"}),(0,eh.jsx)("path",{className:"cls-2",d:"m 692.72,416.28 v -60.1 c 0,-15.73 8.09,-25.54 23.35,-25.54 15.26,0 23.36,9.81 23.36,25.54 v 60.1 c 0,15.73 -8.1,25.54 -23.36,25.54 -15.26,0 -23.35,-9.81 -23.35,-25.54 z m 34.88,-2.02 v -56.05 c 0,-11.68 -4.05,-16.35 -11.52,-16.35 -7.47,0 -11.52,4.67 -11.52,16.35 v 56.05 c 0,11.68 4.05,16.35 11.52,16.35 7.47,0 11.52,-4.67 11.52,-16.35 z",id:"path11"}),(0,eh.jsx)("path",{className:"cls-2",d:"m 789.27,391.52 c 4.36,2.49 8.88,8.88 8.88,18.07 v 25.38 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 v -22.11 c 0,-8.88 -4.67,-15.73 -12.3,-15.73 h -8.25 v 37.84 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 v -94.05 c 0,-6.54 2.8,-9.34 9.5,-9.34 h 10.43 c 15.57,0 24.6,10.27 24.6,29.11 v 7.32 c 0,10.75 -2.81,18.69 -9.19,23.51 z m -2.33,-26 v -2.34 c 0,-14.02 -4.2,-20.71 -14.17,-20.71 h -7.01 v 43.75 h 7.01 c 9.97,0 14.17,-6.7 14.17,-20.71 z",id:"path12"}),(0,eh.jsx)("path",{className:"cls-2",d:"m 812.95,434.96 v -98.1 c 0,-3.27 2.65,-5.92 5.92,-5.92 3.27,0 5.92,2.65 5.92,5.92 v 98.1 c 0,3.27 -2.65,5.92 -5.92,5.92 -3.27,0 -5.92,-2.65 -5.92,-5.92 z",id:"path13"})]}),(0,eh.jsx)("path",{className:"cls-1",d:"m 667.73555,242.64 c -6.38,-56.35 -42.43,-113.07 -98.9,-155.61 -49.7,-37.44 -109.37,-60.33 -170.6,-65.94 C 364.22555,7.6 328.15555,0 291.96555,0 c -69.91,0 -135.47,27.64 -189.6,79.93 C 82.235546,99.38 55.165546,139 38.215546,191.67 c -9.13,16.42 -16.91,33.67 -23.02,51.57 -33.85,99.22 -10.5500001,199.69 63.94,275.65 9.79,9.98 26.710004,23.27 49.530004,36.03 70.06,71.95 151.03,84.76 199.59,84.76 45.54,0 92.21,-11.24 124.84,-30.07 28.3,-16.34 52.64,-36.17 72.92,-59.28 108.74,-60.36 157.72,-166.32 141.72,-307.69 z m -73.68,9.57 c -8.31,-61.54 -42.48,-119.59 -90.75,-164.46 37.26,23.3 66.15,54.54 87.71,91.36 27.6,47.13 46.44,143.64 0.76,233.55 9.47,-47.57 10.27,-101.25 2.28,-160.44 z m -11.27,1.52 c 10.34,76.59 5.37,140.08 -11.29,192.23 -24.15,33.64 -58.84,65.28 -107.4,91.69 -31.3,17.03 -61.5,28.71 -90.28,36.23 -8.25,-0.19 -16.63,-0.69 -25.09,-1.54 22.94,-3.81 46.17,-10.56 69.46,-20.26 96.74,-40.31 136.66,-112.17 153.12,-165.35 20.63,-66.68 13.55,-131.72 1.21,-167.16 -36.47,-104.77 -118.35,-165.33 -237.85,-176.66 46.26,0.76 86.54,8.18 121.19,21.31 67.54,45.83 117.02,116.16 126.92,189.52 z m -78.06,294.93 c -21.61,10.54 -52.6,19.64 -88.2,23.43 17.75,-6.76 35.44,-14.89 53.01,-24.45 35,-19.04 64.77,-41.9 88.88,-67.95 -10.72,23.16 -24.08,43.65 -39.67,61.68 -4.6,2.51 -9.26,4.97 -14.02,7.29 z m -368.96,-2.75 c -19.71,-20.45 -38.150004,-45.4 -54.570004,-75.6 -59.13,-108.81 -54.64,-204.44 -32.59,-273.88 40.79,-72.66 110.320004,-128.92 184.840004,-145.21 -6.05,2.97 -12.04,6.12 -17.94,9.49 -48.68,23.3 -93.61,65.79 -123.390004,119.76 -51.8,93.85 -49.11,199.1 7.38,288.77 23.170004,36.78 95.600004,106.18 204.320004,106.77 10.31,2.55 20.33,4.47 29.9,5.87 -15.51,2.15 -30.53,3.16 -44.97,3.16 -63.65,0 -116.29,-18.88 -152.97,-39.14 z m 169.2,18.75 c -62.68,-15.85 -125.37,-53.95 -169.73,-129.36 -100.020004,-170.04 3.83,-303.77 44.43,-336.4 14.06,-11.3 28.49,-21 43.15,-29.29 24.09,-11.11 49.2,-17.27 73.97,-17.27 0.69,0 1.41,0 2.1,0.02 148.62,2.08 228.54,72.27 262.89,170.95 25.29,72.64 20.48,248.09 -147.96,318.27 -39.5,16.46 -75.82,23.09 -108.64,23.09 -0.07,0 -0.14,0 -0.21,0 z m -50.13,-5.41 c -78.55,-17.09 -129.59,-70.46 -145.73,-96.07 -63.580004,-100.94 -49.220004,-209.44 0.22,-289.59 -5.85,11.99 -11.140004,24.86 -15.460004,38.56 -23.54,74.64 -12.63,153.8 31.560004,228.92 36.33,61.76 83.37,97.63 129.41,118.18 z m 93.31,-527.42 c 6.92,-0.48 13.83,-0.76 20.7,-0.76 9.21,0 18.36,0.43 27.44,1.24 5.8,2.34 11.5,4.89 17.15,7.57 -20.54,-4.36 -42.3,-7.05 -65.28,-8.06 z m -237.88,56.28 c 56.12,-54.22 119.7,-76.74 181.69,-76.74 22.56,0 44.9,3.01 66.59,8.54 -27.97,0.93 -55.36,5.59 -81.73,13.89 -9.47,0.87 -19.03,1.9 -28.75,3.25 -66.39,9.19 -130.73,49.37 -177.320004,106.6 13.93,-26.25 28.93,-45.3 39.520004,-55.54 z M 87.255546,510.92 C 8.3455459,430.46 -2.7544541,333.8 25.095546,249.55 c -9.9,74.5 5.8,152.05 46.09,226.19 9.7,17.85 20.01,33.8 30.760004,48.04 -5.970004,-4.67 -10.990004,-9.07 -14.700004,-12.85 z m 360.150004,88.83 c -27.18,15.69 -70.3,28.55 -119.16,28.55 -52.11,0 -110.74,-14.68 -163.49,-56.16 34.18,13.85 76.16,24.27 123.97,24.27 28.75,0 57.59,-3.76 86.33,-11.13 2.13,0.04 4.2,0.06 6.22,0.06 40.23,0 81.61,-7.43 114.06,-20.19 -14.66,13.13 -30.69,24.65 -47.93,34.6 z m 98.55,-75.09 c 10.02,-14.65 18.69,-30.34 25.92,-47.11 3.74,-8.67 7.06,-17.66 10.05,-26.89 17.66,-24.96 30.8,-52.23 38.94,-81.46 22.51,-80.87 3.27,-156.05 -20.04,-195.85 -33.54,-57.28 -80.82,-97.29 -141.07,-119.95 -8.19,-5.44 -16.61,-10.57 -25.24,-15.28 116.19,24.92 211.36,112.54 221.92,205.8 15.48,136.7 -31.24,226.21 -110.47,280.75 z",id:"path14",style:{fill:"url(#Sfumatura_senza_nome_6)"}})]}),$9=({tenant:e,userLang:t="en",integrationID:n,memoriHash:r})=>{let i=`https://memori.ai/${(null==t?void 0:t.toLowerCase())==="it"?"it":"en"}${n?`?integrationID=${n}`:""}${r?`${n?"&":"?"}memori=${r}`:""}`;return(0,eh.jsxs)("div",{className:"memori--powered-by",children:[(0,eh.jsx)($7,{className:"memori--powered-by-icon","aria-hidden":!0}),(0,eh.jsxs)("p",{className:"memori--powered-by-label",children:[(0,eh.jsx)("span",{children:"Powered by "}),(0,eh.jsx)("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:"Memori.AI"})]})]})},em=ec("85Hg2");let Je=wv("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),Jt=(0,em.memo)(({defaultDate:e,onChange:t,disabled:n=!1,minAge:r=18})=>{let{t:i}=tA(),a=(0,em.useMemo)(()=>i5.now().minus({years:r}).startOf("day"),[r]),o=(0,em.useMemo)(()=>i5.fromObject({year:1900,month:1,day:1}),[]),[s,l]=(0,em.useState)(""),[u,c]=(0,em.useState)(""),[d,h]=(0,em.useState)("");(0,em.useEffect)(()=>{if(e){let t="string"==typeof e?i5.fromISO(e):i5.fromJSDate(e);t.isValid&&(l(t.day.toString()),c(t.month.toString()),h(t.year.toString()))}},[e]);let[p,m]=(0,em.useState)(!1),f=(0,em.useRef)(null),g=(0,em.useRef)(null),v=(0,em.useRef)(null);(0,em.useEffect)(()=>{let e=()=>{m(window.innerWidth<768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let y=(0,em.useRef)(t);y.current=t;let b=(0,em.useRef)(void 0);if((0,em.useEffect)(()=>{let e=e=>{let t=(null==e?void 0:e.isValid)?e.toISODate():null;t!==b.current&&(b.current=t,y.current(e))};if(!s||!u||!d)return void e(void 0);let t=parseInt(s),n=parseInt(u),r=parseInt(d);if(isNaN(t)||isNaN(n)||isNaN(r))return void e(void 0);let i=i5.fromObject({year:r,month:n,day:t});e(i.isValid&&i>=o&&i<=a?i:void 0)},[s,u,d,o,a]),p){let e=s&&u&&d?i5.fromObject({year:parseInt(d),month:parseInt(u),day:parseInt(s)}):null,t=(null==e?void 0:e.isValid)&&e.toISODate()||"",r=!t,p=i("login.birthDatePlaceholder")||"DD/MM/YYYY";return(0,eh.jsxs)("div",{className:"memori--date-selector memori--date-selector--mobile",children:[(0,eh.jsxs)("label",{htmlFor:"birth-date-mobile",className:"memori--date-selector__mobile-label",children:[i("birthDate")||"Birth Date",":"]}),(0,eh.jsxs)("div",{className:`memori--date-selector__mobile-input-wrap${r?" memori--date-selector__mobile-input-wrap--empty":""}`,children:[(0,eh.jsx)("input",{id:"birth-date-mobile",type:"date",className:"memori--date-selector__mobile-input",value:t,onChange:e=>{let t=e.target.value;if(t){let e=i5.fromISO(t);e.isValid&&(l(e.day.toString()),c(e.month.toString()),h(e.year.toString()))}else l(""),c(""),h("")},disabled:n,min:o.toISODate()||"1900-01-01",max:a.toISODate()||"","aria-label":String(i("birthDate")||i("date"))}),r&&(0,eh.jsx)("span",{className:"memori--date-selector__mobile-placeholder","aria-hidden":!0,children:p}),(0,eh.jsx)(Je,{className:"memori--date-selector__mobile-icon","aria-hidden":!0,size:20,strokeWidth:1.75})]})]})}return(0,eh.jsxs)("div",{className:"memori--date-selector memori--date-selector--desktop",children:[(0,eh.jsxs)("div",{className:"memori--date-selector__input-group",children:[(0,eh.jsx)("label",{htmlFor:"birth-day",className:"memori--date-selector__label",children:i("day")||"Day"}),(0,eh.jsx)("input",{id:"birth-day",ref:f,type:"number",inputMode:"numeric",className:"memori--date-selector__input",value:s,onChange:e=>{var t;let n=e.target.value;if(""===n||/^\d+$/.test(n)){if(n.length>2||parseInt(n)>31)return;l(n),n.length>=2&&(null==(t=g.current)||t.focus())}},placeholder:i("dayPlaceholder")||"DD",min:1,max:31,disabled:n})]}),(0,eh.jsxs)("div",{className:"memori--date-selector__input-group",children:[(0,eh.jsx)("label",{htmlFor:"birth-month",className:"memori--date-selector__label",children:i("month")||"Month"}),(0,eh.jsx)("input",{id:"birth-month",ref:g,type:"number",inputMode:"numeric",className:"memori--date-selector__input",value:u,onChange:e=>{var t;let n=e.target.value;if(""===n||/^\d+$/.test(n)){if(n.length>2||parseInt(n)>12)return;c(n),n.length>=2&&(null==(t=v.current)||t.focus())}},placeholder:i("monthPlaceholder")||"MM",min:1,max:12,disabled:n})]}),(0,eh.jsxs)("div",{className:"memori--date-selector__input-group memori--date-selector__input-group--year",children:[(0,eh.jsx)("label",{htmlFor:"birth-year",className:"memori--date-selector__label",children:i("year")||"Year"}),(0,eh.jsx)("input",{id:"birth-year",ref:v,type:"number",inputMode:"numeric",className:"memori--date-selector__input",value:d,onChange:e=>{let t=e.target.value;if(""===t||/^\d+$/.test(t)){if(t.length>4)return;h(t)}},placeholder:i("yearPlaceholder")||"YYYY",min:o.year,max:a.year,disabled:n})]})]})});Jt.displayName="DateSelector";var em=ec("85Hg2"),Jn=({visible:e=!1,onClose:t,minAge:n})=>{let{t:r}=tA(),{add:i}=vZ(),[a,o]=(0,em.useState)(),[s,l]=(0,em.useState)(),[u,c]=(0,em.useState)(!1),d=(0,em.useCallback)(()=>{if(c(!0),!a){i(v9({description:r("requiredField"),severity:"error"})),l(r("requiredField")||"Required field"),c(!1);return}if(i5.now().diff(a,"years").years<n){i(v9({description:r("underageTwinSession",{age:n}),severity:"error"})),l(r("underageTwinSession",{age:n})||`You must be at least ${n} years old to interact with this Agent`),c(!1);return}l(void 0),i(v9({description:r("ageVerificationSuccess"),severity:"success"})),t(a.toJSDate().toISOString()),c(!1)},[i,a,n,t,r]),h=(0,em.useCallback)(e=>{o(e)},[]);return(0,eh.jsxs)(__,{open:e,width:"600px",widthMd:"600px",stacking:"stacked",title:r("ageVerification"),className:"age-verification-modal",backdropClassName:"age-verification-modal-backdrop",closable:!1,children:[(0,eh.jsx)("p",{className:"age-verification-text",children:r("ageVerificationText",{minAge:n})}),(0,eh.jsxs)(xD,{name:"ageVerification",className:"age-verification-form",onSubmit:e=>{e.preventDefault(),d()},children:[(0,eh.jsx)(xk,{className:"age-verification-birth-field",helperText:r("birthDateHelper"),error:s,invalid:!!s,required:!0,children:(0,eh.jsx)(Jt,{minAge:n,onChange:e=>{h(e),l(void 0)}})}),(0,eh.jsx)(yt,{variant:"primary",type:"submit",size:"lg",loading:u,disabled:!a,style:{marginBottom:"0.25rem"},children:r("confirm")})]})]})},Jr=({open:e,layout:t="FULLPAGE",onClose:n,controlsPosition:r,setControlsPosition:i,hideEmissions:a,setHideEmissions:o,additionalSettings:s,avatarType:l,setAvatarType:u,enablePositionControls:c,setEnablePositionControls:d,isAvatar3d:h})=>{let{t:p}=tA();return(0,eh.jsxs)(xf,{className:"memori-settings-drawer",open:e,onClose:n,title:p("widget.settings")||"Settings",children:["TOTEM"===t&&(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,eh.jsxs)("label",{htmlFor:"#controlsPosition",children:[p("write_and_speak.controlsPosition")||"Controls",":"]}),(0,eh.jsxs)("div",{id:"controlsPosition",className:"memori-settings-drawer--controlsposition-radio",role:"radiogroup",children:[(0,eh.jsx)(yt,{role:"radio","aria-checked":"center"===r,variant:"center"===r?"primary":"outline",className:"memori-settings-drawer--controlsposition-radio-button",onClick:()=>{i("center"),qk("controlsPosition","center")},children:p("center")||"Center"}),(0,eh.jsx)(yt,{role:"radio","aria-checked":"bottom"===r,variant:"bottom"===r?"primary":"outline",className:"memori-settings-drawer--controlsposition-radio-button",onClick:()=>{i("bottom"),qk("controlsPosition","bottom")},children:p("bottom")||"Bottom"})]})]}),h&&(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsxs)("div",{className:"memori-settings-drawer--field controls",children:[(0,eh.jsxs)("label",{htmlFor:"avatarType",className:"memori-settings-drawer-label",children:[p("write_and_speak.avatarType")||"Avatar type",":"]}),(0,eh.jsxs)("div",{id:"avatarType",className:"memori-settings-drawer--avatarType-radio",role:"radiogroup",children:[(0,eh.jsx)(yt,{role:"radio","aria-checked":"blob"===l,variant:"blob"===l?"primary":"outline",className:"memori-settings-drawer--avatarType-radio-button",onClick:()=>{null==u||u("blob"),qk("avatarType","blob")},children:p("write_and_speak.blob")||"Blob"}),(0,eh.jsx)(yt,{role:"radio","aria-checked":"avatar3d"===l,variant:"avatar3d"===l?"primary":"outline",className:"memori-settings-drawer--avatarType-radio-button",onClick:()=>{null==u||u("avatar3d"),qk("avatarType","avatar3d")},children:p("write_and_speak.avatar3d")||"Avatar 3D"})]})]}),(0,eh.jsx)("div",{className:"memori-settings-drawer--field",children:(0,eh.jsx)(bq,{label:p("write_and_speak.enablePositionControls")||"Enable position controls",name:"enablePositionControls",checked:c,onChange:e=>{d(e)}})})]}),(0,eh.jsx)("div",{className:"memori-settings-drawer--field",children:(0,eh.jsx)(bq,{label:p("write_and_speak.hideEmissionsLabel")||"Hide emissions",name:"hideControls",checked:a,onChange:e=>{o(e),qk("hideEmissions",e)}})})]}),s&&(0,eh.jsx)("div",{className:"memori-settings-drawer--field controls",children:s})]})},em=ec("85Hg2");let Ji=wv("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),Ja=wv("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),Jo=e=>{if(!e)return null;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?null:t},Js=(e,t)=>{let n=t.trim().toLowerCase();return n?e.filter(e=>e.text.toLowerCase().includes(n)):e};var Jl=({apiClient:e,sessionID:t,memori:n,disableFetch:r=!1,visible:i=!0,initialKnownFacts:a=[],closeDrawer:o})=>{let{t:s,i18n:l}=tA(),{add:u}=vZ(),{getKnownFacts:c,getKnownFactsPaginated:d,deleteKnownFact:h}=e.knownFacts,p=(0,em.useRef)(a);p.current=a;let[m,f]=(0,em.useState)(a.slice(0,8)),[g,v]=(0,em.useState)(a.length),[y,_]=(0,em.useState)(Math.min(8,a.length)),[x,w]=(0,em.useState)(!1),[S,E]=(0,em.useState)(!1),[A,T]=(0,em.useState)(""),I=k2(A,300),[C,M]=(0,em.useState)(!1),[N,R]=(0,em.useState)([]),[O,P]=(0,em.useState)(!1),[k,D]=(0,em.useState)(!1),[B,F]=(0,em.useState)(),[U,j]=(0,em.useState)(!1),z=(0,em.useCallback)((e,t)=>{let n=Js(p.current,I),r=n.slice(0,e+8);f(r),v(n.length),_(r.length),t||R(e=>e.filter(e=>r.some(t=>t.knownFactID===e)))},[I]),H=(0,em.useCallback)(async({from:e=0,append:n=!1}={})=>{if(r)return void z(e,n);if(t){n?E(!0):w(!0);try{if(I.trim()){let{knownFacts:n,count:r,...i}=await c(t);0!==i.resultCode&&u(v9({description:s(Lx(i.resultCode)),severity:"error"}));let a=Js(Array.isArray(n)?n:[],I),o=a.slice(0,e+8);f(o),v(a.length||r||0),_(o.length)}else{let{knownFacts:r,count:i,...a}=await d(t,e,8);0!==a.resultCode&&u(v9({description:s(Lx(a.resultCode)),severity:"error"}));let o=Array.isArray(r)?r:[];f(e=>n?[...e,...o]:o),v(null!=i?i:0),_(e+o.length)}}catch(e){console.error("KNOWN_FACTS/FETCH",e),n||(f([]),v(0),_(0))}finally{w(!1),E(!1)}}},[u,z,r,c,d,I,t,s]);(0,em.useEffect)(()=>{H({from:0,append:!1})},[t,I,r]),(0,em.useEffect)(()=>{M(!1),R([])},[I]);let G=(0,em.useMemo)(()=>s("knownFacts.selected",{count:N.length,defaultValue:s("knownFacts.selectedRows",{count:N.length})}),[N.length,s]),V=g>0||m.length>0,W=y<g,q=!x&&!I.trim()&&0===m.length,$=!x&&!!I.trim()&&0===m.length,J=async e=>{if(0===e.length)return;if(r){let t=p.current.filter(t=>!e.includes(t.knownFactID));return p.current=t,z(0,!1),!0}let n=await Promise.all(e.map(e=>h(t,e)));if(n.every(e=>0===e.resultCode))return u(v9({description:s("knownFacts.deleteSuccess"),severity:"success"})),await H({from:0,append:!1}),!0;let i=n.find(e=>0!==e.resultCode);return(null==i?void 0:i.resultCode)!==void 0&&u(v9({description:s(Lx(i.resultCode)),severity:"error"})),!1},K=V&&!q?(0,eh.jsx)(Hf,{start:(0,eh.jsx)("span",{className:"memori-known-facts-count",children:s("knownFacts.shownOfTotal",{shown:m.length,total:g})}),end:W?(0,eh.jsx)(yt,{variant:"outline",loading:S,disabled:S,icon:(0,eh.jsx)(Hg,{"aria-hidden":!0}),iconPosition:"right",onClick:()=>void H({from:y,append:!0}),children:s("knownFacts.loadMore")}):void 0}):void 0;return(0,eh.jsxs)(Hm,{open:i,size:"md",className:"memori-known-facts-drawer",title:s("knownFacts.title"),description:s("knownFacts.description",{memoriName:n.name}),closeLabel:s("close")||"Close",footer:K,onClose:o,children:[!q&&(0,eh.jsxs)("div",{className:"memori-known-facts-toolbar",children:[(0,eh.jsxs)("div",{className:"memori-known-facts-search",children:[(0,eh.jsx)("label",{className:"memori-sr-only",htmlFor:"memori-known-facts-search",children:s("knownFacts.searchPlaceholder")}),(0,eh.jsx)(xM,{id:"memori-known-facts-search",fullWidth:!0,prefix:(0,eh.jsx)(Ji,{"aria-hidden":!0}),value:A,placeholder:s("knownFacts.searchPlaceholder")||"",onValueChange:T})]}),(0,eh.jsx)(yt,{variant:"outline",active:C,icon:(0,eh.jsx)(Ll,{"aria-hidden":!0}),onClick:()=>{M(e=>!e),R([])},children:s("knownFacts.select")})]}),C&&N.length>0&&(0,eh.jsxs)("div",{className:"memori-known-facts-selection-bar",role:"region","aria-label":G,children:[(0,eh.jsx)("span",{className:"memori-known-facts-selection-bar__count",children:G}),(0,eh.jsxs)("div",{className:"memori-known-facts-selection-bar__actions",children:[(0,eh.jsx)(yt,{variant:"danger",className:"memori-known-facts-selection-bar__delete",icon:(0,eh.jsx)($a,{"aria-hidden":!0}),onClick:()=>P(!0),children:s("delete")}),(0,eh.jsx)(yt,{variant:"ghost",onClick:()=>{R([]),M(!1)},children:s("cancel")})]})]}),q&&(0,eh.jsx)(Hp,{icon:(0,eh.jsx)(Ja,{}),title:s("knownFacts.emptyTitle"),description:s("knownFacts.emptyDescription")}),$&&(0,eh.jsx)(Hp,{icon:(0,eh.jsx)(Ji,{}),title:s("write_and_speak.noResultsFound",{searchText:I})}),!q&&!$&&(0,eh.jsx)("ul",{className:"memori-known-facts-list","aria-busy":x||void 0,children:m.map(e=>{var t,n;let r,i=N.includes(e.knownFactID),a=e.creationTimestamp?((e,t,n=new Date)=>{let r=Jo(e);if(!r)return"";let i=r.getTime()-n.getTime(),a=Math.abs(i),o=new Intl.RelativeTimeFormat(t,{numeric:"auto"});return a<6e4?o.format(Math.round(i/1e3),"second"):a<36e5?o.format(Math.round(i/6e4),"minute"):a<864e5?o.format(Math.round(i/36e5),"hour"):a<6048e5?o.format(Math.round(i/864e5),"day"):a<2592e6?o.format(Math.round(i/6048e5),"week"):a<31536e6?o.format(Math.round(i/2592e6),"month"):o.format(Math.round(i/31536e6),"year")})(e.creationTimestamp,l.language):"",o=e.creationTimestamp?(t=e.creationTimestamp,n=l.language,(r=Jo(t))?new Intl.DateTimeFormat(n,{dateStyle:"short",timeStyle:"short"}).format(r):""):"";return(0,eh.jsx)("li",{children:C?(0,eh.jsxs)("label",{className:(b(tT))("memori-known-facts-card",{"memori-known-facts-card--selected":i}),children:[(0,eh.jsx)(bq,{checked:i,onChange:()=>{var t;return t=e.knownFactID,void R(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},"aria-label":s("selected")||void 0}),(0,eh.jsx)("span",{className:"memori-known-facts-card__text",children:e.text})]}):(0,eh.jsxs)("article",{className:"memori-known-facts-card",children:[(0,eh.jsxs)("div",{className:"memori-known-facts-card__content",children:[(0,eh.jsx)("p",{className:"memori-known-facts-card__text",children:e.text}),a&&(0,eh.jsx)(_H,{title:o,placement:"bottom",children:(0,eh.jsx)("time",{className:"memori-known-facts-card__date",dateTime:e.creationTimestamp,children:a})})]}),(0,eh.jsx)("div",{className:"memori-known-facts-card__actions",children:(0,eh.jsx)(yt,{variant:"ghost",shape:"circle",size:"sm",className:"memori-known-facts-card__delete","aria-label":s("knownFacts.deleteLabel")||void 0,title:s("delete")||"",icon:(0,eh.jsx)($a,{"aria-hidden":!0}),onClick:()=>F(e.knownFactID)})})]})},e.knownFactID)})}),(0,eh.jsx)(__,{className:"memori-known-facts-modal",stacking:"stacked",open:O,closable:!0,title:N.length>1?s("knownFacts.deleteSelectedConfirmTitle"):s("knownFacts.deleteConfirmTitle"),description:`${G}. ${s("knownFacts.deleteSelectedConfirmMessage",{number:N.length})}`,onOpenChange:e=>{e||P(!1)},footer:(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)(yt,{variant:"ghost",onClick:()=>P(!1),children:s("cancel")}),(0,eh.jsx)(yt,{variant:"danger",loading:k,disabled:k,onClick:async()=>{D(!0);try{await J(N)&&(R([]),M(!1),P(!1))}finally{D(!1)}},children:s("confirm")})]})}),(0,eh.jsx)(__,{className:"memori-known-facts-modal",stacking:"stacked",open:void 0!==B,closable:!0,title:s("knownFacts.deleteConfirmTitle"),description:s("knownFacts.deleteConfirmMessage"),onOpenChange:e=>{e||F(void 0)},footer:(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)(yt,{variant:"ghost",onClick:()=>F(void 0),children:s("cancel")}),(0,eh.jsx)(yt,{variant:"danger",loading:U,disabled:U,onClick:async()=>{if(B){j(!0);try{await J([B])&&F(void 0)}finally{j(!1)}}},children:s("confirm")})]})})]})},Ju=({open:e=!1,baseUrl:t,apiUrl:n,tenant:r,experts:i,onClose:a})=>{let{t:o}=tA();return(0,eh.jsx)(xf,{open:e,onClose:a,className:"memori--experts-drawer",title:(0,eh.jsx)("h2",{className:"memori--experts-drawer--title",children:o("widget.expertsInTheBoard")}),children:(0,eh.jsx)("ul",{className:"memori--experts-drawer--list",children:i.map(e=>(0,eh.jsxs)("li",{className:"memori--experts-drawer--item",children:[(0,eh.jsx)("figure",{className:"memori--experts-drawer--avatar",children:(0,eh.jsx)("img",{src:`${new URL(n).origin}/api/v1/memoriai/memori/avatar/${e.expertMemoriID}`,alt:e.name,onError:e=>{e.currentTarget.src=La({tenantID:null==r?void 0:r.name,type:"avatar",baseURL:t}),e.currentTarget.onerror=null}})}),(0,eh.jsx)("div",{className:"memori--experts-drawer--content",children:(0,eh.jsx)("h3",{className:"memori--experts-drawer--name",children:e.name})})]},e.expertID))})})},em=ec("85Hg2"),Jc=({open:e=!1,onClose:t,onLogin:n,user:r,loginToken:i,setUser:a,tenant:o,apiClient:s,__TEST__signup:l=!1,__TEST__needMissingData:u=!1,modalClassName:c,memoriName:d,onLogout:h})=>{var p;let{t:m,i18n:f}=tA(),{add:g}=vZ(),v="it"===f.language?"it":"en",{pwlUpdateUser:y,loginWithOTP:_,validateOTPCode:x,pwlGetCurrentUser:w}=s.backend,[S,E]=(0,em.useState)(!1),[A,T]=(0,em.useState)(null),[I,C]=(0,em.useState)(""),[M,N]=(0,em.useState)(""),[R,O]=(0,em.useState)(null),[P,k]=(0,em.useState)(!1),[D,B]=(0,em.useState)(null),[F,U]=(0,em.useState)(!1),[j,z]=(0,em.useState)(!1),[H,G]=(0,em.useState)(0),[V,W]=(0,em.useState)(""),[q,$]=(0,em.useState)(!1),[J,K]=(0,em.useState)(!1),[Y,X]=(0,em.useState)(!1),[Z,Q]=(0,em.useState)(!1),ee=(0,em.useRef)([]),et=(0,em.useRef)(!1),[en,er]=(0,em.useState)(u?{token:"token",birthDate:!0,tnCAndPPAccepted:!0}:{});(0,em.useEffect)(()=>{let e;return null!=D&&D>0&&(e=setInterval(()=>{B(e=>null!=e&&e>0?e-1:0)},1e3)),()=>{e&&clearInterval(e)}},[D]),(0,em.useEffect)(()=>{0===D&&B(null)},[D]),(0,em.useEffect)(()=>{e||z(!1)},[e]),(0,em.useEffect)(()=>{let e=window.matchMedia("(max-width: 768px)"),t=()=>K(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let ei=async(e,t=!1)=>{let n=e.trim();if(!n)return void O(m("login.emailRequired"));if(!k1.test(n))return void O(m("login.emailInvalid"));t?U(!0):E(!0),O(null);try{let e=await _({tenant:o.name,eMail:n});0===e.resultCode?(N(n),k(!0),B(60),C(""),G(0)):O(e.resultMessage||m("login.otpSendError"))}catch(e){console.error("[OTP SEND]",e),O(m("login.otpSendError"))}finally{E(!1),U(!1)}},ea=async e=>{var t,r,i;if(!et.current){if(!e||4!==e.length)return void O(m("login.otpInvalidFormat"));if(!M||0===M.trim().length)return void O(m("login.emailRequired"));et.current=!0,E(!0),O(null);try{let s=await x(e,o.name,void 0,M.trim());if(0===s.resultCode)try{let{user:e}=await w(s.newSessionToken);e.age&&e.tnCAndPPAccepted?(z(!0),k(!1),C(""),N(""),n(e,s.newSessionToken)):(a(e),W(null!=(t=null==e?void 0:e.birthDate)?t:""),X(null!=(r=null==e?void 0:e.tnCAndPPAccepted)&&r),Q(null!=(i=null==e?void 0:e.pAndCUAccepted)&&i),er({token:s.newSessionToken,birthDate:!e.age,tnCAndPPAccepted:!e.tnCAndPPAccepted}),k(!1),C(""))}catch(e){console.error("[GET USER]",e),O(m("login.userFetchError"))}else -107===s.resultCode?O(m("login.otpNotFound")):-108===s.resultCode?(O(m("login.otpExpired")),B(null)):-109===s.resultCode?(O(m("login.otpInvalid")),C(""),G(0),window.setTimeout(()=>{var e;null==(e=ee.current[0])||e.focus()},50)):-110===s.resultCode?(O(m("login.otpAttemptsExceeded")),C(""),B(null),k(!1)):O(s.resultMessage||m("login.otpInvalid"))}catch(e){console.error("[OTP VALIDATION]",e),O(m("login.otpError"))}finally{E(!1),et.current=!1}}};(0,em.useEffect)(()=>{P&&!S&&window.setTimeout(()=>{var e;null==(e=ee.current[0])||e.focus()},50)},[P,S]);let eo=async e=>{if(e.preventDefault(),!(null==r?void 0:r.userID)||!(null==en?void 0:en.token))return void T(m("login.userNotFound"));if(!V||!Y)return void T(m("missingData"));let t={userID:r.userID,birthDate:(null==r?void 0:r.birthDate)||!en.birthDate?void 0:V,tnCAndPPAccepted:Y||(null==r?void 0:r.tnCAndPPAccepted),tnCAndPPAcceptanceDate:Y?new Date().toISOString():void 0,pAndCUAccepted:Z||(null==r?void 0:r.pAndCUAccepted),pAndCUAcceptanceDate:Z?new Date().toISOString():void 0},{user:i,...a}=await y(en.token,r.userID,t);0!==a.resultCode?(console.error(a),g(v9({description:m(Lx(a.resultCode)),severity:"error"})),T(a.resultMessage)):n(i||t,en.token)},es=(null==d?void 0:d.trim())||m("login.defaultAgentName")||"AI",el=m("login.login")||"Login",eu=4===I.length,ec=!!(null==(p=null==en?void 0:en.token)?void 0:p.length),ed=(0,eh.jsxs)("div",{className:"memori--login-modal--step",children:[(0,eh.jsx)("p",{className:"memori--login-modal--benefit",children:m("login.loginBenefitLine1",{memoriName:es})}),(0,eh.jsxs)(xN,{className:"memori--login-modal--field",children:[(0,eh.jsx)(xR,{htmlFor:"otp-email",children:m("login.email")}),(0,eh.jsx)(xM,{id:"otp-email",name:"email",type:"email",size:"lg",className:(b(tT))("memori--login-modal--email-input",{error:!!R}),value:M,onChange:e=>{N(e.target.value),O(null)},placeholder:m("login.emailPlaceholder")||"Enter your email…",autoComplete:"email",spellCheck:!1,required:!0,disabled:S,"aria-invalid":!!R,"aria-describedby":R?"otp-email-error":"email-help"}),R?(0,eh.jsx)(xP,{id:"otp-email-error",children:R}):(0,eh.jsx)("p",{id:"email-help",className:"sr-only",children:m("login.otpEmailDescription")})]}),(0,eh.jsx)(yt,{variant:"primary",className:"memori--login-modal--primary",onClick:()=>ei(M),disabled:S,loading:S,size:"lg",children:m("login.sendOtp")}),(0,eh.jsx)("p",{className:"memori--login-modal--footnote",children:m("login.passwordlessHint")})]}),ep=(0,eh.jsxs)("div",{className:"memori--login-modal--step",children:[(0,eh.jsx)("p",{className:"memori--login-modal--sent-copy",children:m("login.otpSentToPrefix")}),(0,eh.jsxs)("p",{className:"memori--login-modal--email-row",children:[(0,eh.jsx)("strong",{className:"memori--login-modal--email-value",children:M})," ",(0,eh.jsx)("button",{type:"button",className:"memori--login-modal--edit-link",onClick:()=>{k(!1),C(""),O(null),B(null)},disabled:S,children:m("login.editEmail")})]}),(0,eh.jsxs)("fieldset",{className:"memori--login-modal--otp-fieldset","aria-describedby":"otp-help",children:[(0,eh.jsx)("legend",{className:"memori--login-modal--otp-label",children:m("login.otpCodeShort")}),(0,eh.jsx)("div",{className:"memori--login-modal--otp-digits",children:[0,1,2,3].map(e=>(0,eh.jsx)(xM,{id:0===e?"otp-code":`otp-code-${e}`,name:`otp-code-${e}`,"aria-label":`${m("login.otpCode")} ${e+1} / 4`,type:"text",inputMode:"numeric",pattern:"[0-9]*",enterKeyHint:3===e?"done":"next",autoComplete:0===e?"one-time-code":"off",spellCheck:!1,className:(b(tT))("memori--login-modal--otp-digit",{active:H===e,error:!!R}),value:I[e]||"",onChange:t=>((e,t)=>{var n,r;let i=t.replace(/\D/g,""),a=I.padEnd(4," ").split("");if(!i.length){a[e]=" ",C(a.join("").replace(/\s/g,"")),O(null);return}if(i.length>1){let t=[...a];i.slice(0,4).split("").forEach((n,r)=>{e+r<4&&(t[e+r]=n)});let r=t.join("").replace(/\s/g,"").slice(0,4);C(r),O(null);let o=Math.min(e+i.length,3);null==(n=ee.current[o])||n.focus(),G(o),4===r.length&&M.trim().length>0&&ea(r);return}a[e]=i[0];let o=a.join("").replace(/\s/g,"").slice(0,4);C(o),O(null),4===o.length&&M.trim().length>0&&ea(o),e<3&&(null==(r=ee.current[e+1])||r.focus(),G(e+1))})(e,t.target.value),onFocus:()=>G(e),onKeyDown:t=>{var n,r,i;"Backspace"===t.key&&!I[e]&&e>0&&(null==(n=ee.current[e-1])||n.focus(),G(e-1)),"ArrowLeft"===t.key&&e>0&&(t.preventDefault(),null==(r=ee.current[e-1])||r.focus(),G(e-1)),"ArrowRight"===t.key&&e<3&&(t.preventDefault(),null==(i=ee.current[e+1])||i.focus(),G(e+1))},onPaste:t=>((e,t)=>{var n;let r=t.clipboardData.getData("text").replace(/\D/g,"").slice(0,4);if(!r.length)return;t.preventDefault();let i=I.padEnd(4," ").split("");r.split("").forEach((t,n)=>{e+n<4&&(i[e+n]=t)});let a=i.join("").replace(/\s/g,"").slice(0,4);C(a),O(null);let o=Math.min(e+r.length,3);null==(n=ee.current[o])||n.focus(),G(o),4===a.length&&M.trim().length>0&&ea(a)})(e,t),maxLength:1,required:!0,disabled:S,ref:t=>{ee.current[e]=t}},e))}),(0,eh.jsx)("p",{id:"otp-help",className:"sr-only",children:m("login.otpCodeDescription",{email:M})})]}),R&&(0,eh.jsx)("p",{role:"alert",className:"memori--login-modal--inline-error",children:R}),(0,eh.jsx)(yt,{variant:"primary",className:"memori--login-modal--primary",onClick:()=>ea(I),disabled:S||!eu,loading:S,size:"lg",children:el}),(0,eh.jsx)("p",{className:"memori--login-modal--resend",children:null!=D&&D>0?m("login.resendOtpPrompt",{seconds:D}):(0,eh.jsxs)(eh.Fragment,{children:[m("login.resendOtpQuestion")," ",(0,eh.jsx)("button",{type:"button",className:"memori--login-modal--edit-link",onClick:()=>{M&&k1.test(M)&&ei(M,!0)},disabled:S||F||!M,children:F?m("login.resending"):m("login.resendOtp")})]})})]}),ef=(0,eh.jsxs)("div",{className:"memori--login-modal--step memori--login-modal--logging-in",role:"status","aria-live":"polite",children:[(0,eh.jsx)("span",{className:"memori--login-modal--spinner","aria-hidden":"true"}),(0,eh.jsx)("p",{className:"memori--login-modal--logging-in-text",children:m("login.loggingIn")})]}),eg=(0,eh.jsxs)("div",{className:"memori--login-modal--missing-data",children:[(0,eh.jsx)("p",{className:"memori--login-modal--missing-helper",children:m("login.missingDataHelper")}),(0,eh.jsxs)(xD,{name:"updateMissingData",className:"memori--login-modal--form memori--login-modal--form--missing",onSubmit:eo,children:[(0,eh.jsxs)("div",{className:"memori--login-modal--form-body",children:[en.birthDate&&(0,eh.jsxs)(xN,{className:"memori--login-modal--field",children:[(0,eh.jsx)(xR,{htmlFor:"birthDate",children:m("login.birthDate")}),(0,eh.jsx)(xM,{id:"birthDate",name:"birthDate",type:!J||V||q?"date":"text",required:!0,onChange:e=>W(e.target.value),value:V,placeholder:J?m("login.birthDatePlaceholder")||"DD/MM/YYYY":void 0,onFocus:()=>$(!0),onBlur:()=>$(!1),autoComplete:"bday"}),(0,eh.jsx)(xO,{children:m("login.birthDateHelper")})]}),(null==en?void 0:en.tnCAndPPAccepted)&&(0,eh.jsxs)("div",{className:"memori--login-modal--consent-block",children:[(0,eh.jsx)(bq,{name:"tnCAndPPAccepted",className:"memori-login-modal--consent",checked:Y,onChange:e=>X(e),label:(0,eh.jsxs)(eh.Fragment,{children:[m("login.privacyLabel")," ",(0,eh.jsx)("a",{href:`https://memori.ai/${v}/privacy_and_cookie`,target:"_blank",rel:"noopener noreferrer",children:m("login.privacyAndCookiePolicy")})," ",m("login.and")," ",(0,eh.jsx)("a",{href:`https://memori.ai/${v}/tos`,target:"_blank",rel:"noopener noreferrer",children:m("login.termsOfService")})]})}),(0,eh.jsx)(bq,{name:"pAndCUAccepted",className:"memori-login-modal--consent",checked:Z,onChange:e=>Q(e),label:(0,eh.jsxs)(eh.Fragment,{children:[m("login.pAndCUAccepted")," ",(0,eh.jsx)("small",{children:(0,eh.jsxs)("em",{children:["(",m("login.optional"),")"]})})]})}),(0,eh.jsx)("p",{className:"memori--login-modal--consent-note",children:m("login.goToAccountToChangeYourPreferences")}),(0,eh.jsx)("p",{className:"memori--login-modal--consent-note memori--login-modal--deep-thought",children:m("login.deepThoughtExplaination")})]}),A&&(0,eh.jsx)("p",{className:"memori--login-modal--inline-error",children:A})]}),(0,eh.jsx)("div",{className:"memori--login-modal--form-footer",children:(0,eh.jsx)(yt,{type:"submit",variant:"primary",className:"memori--login-modal--primary",loading:S,children:m("login.save")})})]})]});return(0,eh.jsx)(__,{open:e,onClose:t,onOpenChange:e=>{e||t()},className:(b(tT))("memori--login-modal",{"memori--login-modal--missing":ec},c),contentClassName:"memori--login-modal--content",titleClassName:"memori--login-modal--title",title:ec?m("login.missingData"):el,size:"sm",width:ec?"480px":"420px",widthMd:ec?"480px":"420px",centered:!0,closable:!0,children:j?ef:ec?eg:P?ep:ed})},em=ec("85Hg2");let Jd=wv("Expand",[["path",{d:"m21 21-6-6m6 6v-4.8m0 4.8h-4.8",key:"1c15vz"}],["path",{d:"M3 16.2V21m0 0h4.8M3 21l6-6",key:"1fsnz2"}],["path",{d:"M21 7.8V3m0 0h-4.8M21 3l-6 6",key:"hawz9i"}],["path",{d:"M3 7.8V3m0 0h4.8M3 3l6 6",key:"u9ee12"}]]);var em=ec("85Hg2");let Jh=wv("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]),Jp=wv("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),Jm=e=>{if("number"==typeof e&&Number.isFinite(e))return e;if(e&&"object"==typeof e){if("number"==typeof e.parsedValue&&Number.isFinite(e.parsedValue))return e.parsedValue;if("string"==typeof e.source){let t=Number(e.source);if(Number.isFinite(t))return t}}},Jf=(e,t)=>new Intl.NumberFormat(t,{minimumFractionDigits:0,maximumFractionDigits:Math.abs(e)>=1?3:4}).format(e),Jg=(e,t,n)=>{let r=Math.abs(e);if("energy"===t){if(r>=1)return`${Jf(e,n)} kWh`;let t=1e3*e;return Math.abs(t)>=1?`${Jf(t,n)} Wh`:`${Jf(1e3*t,n)} mWh`}if("co2"===t){if(r>=1)return`${Jf(e,n)} kg`;let t=1e3*e;return Math.abs(t)>=1?`${Jf(t,n)} g`:`${Jf(1e3*t,n)} mg`}if(r>=1)return`${Jf(e,n)} L`;let i=1e3*e;return Math.abs(i)>=1?`${Jf(i,n)} mL`:`${Jf(1e3*i,n)} \u{3BC}L`},Jv=e=>e.some(e=>!!e.llmUsage),Jy=e=>e.filter(e=>{let t=e.key.toLowerCase(),n=e.title.toLowerCase(),r="knownFacts"===e.view,i=t.includes("audio")||n.includes("audio")||n.includes("sound");return!r&&!i}),Jb=({actions:e,loginToken:t,showChatHistory:n=!1,onChatHistoryOpen:r,showKnownFacts:i=!1,showMessageConsumption:a=!1,history:o=[],isLoggedIn:s=!1,showLogin:l=!1,aiUsageTitle:u})=>{let{t:c}=tA();return(0,em.useMemo)(()=>{let d=[];n&&t&&d.push({key:"chatHistory",icon:(0,eh.jsx)($t,{size:18}),title:c("write_and_speak.chatHistory")||"Chat history",onClick:r}),a&&d.push({key:"aiUsage",icon:(0,eh.jsx)($0,{}),title:u||c("widget.aiConsumption")||"AI usage",view:"aiUsage",disabled:!Jv(o)}),d.push(...Jy(e));let h=l||s&&i;return{hasContent:d.length>0||h,directAction:l||s||1!==d.length?void 0:d[0]}},[e,t,n,r,i,a,o,s,l,u,c])},J_=({entries:{hasContent:e,directAction:t},open:n,onToggle:r})=>{let{t:i}=tA();if(!e)return null;if(t){let e=!!t.view;return(0,eh.jsx)(_H,{title:t.title,placement:"bottom",children:(0,eh.jsx)("span",{style:{display:"inline-flex"},children:(0,eh.jsx)(Gc,{className:"memori-chat-layout--overflow-trigger",active:e&&n,"aria-label":t.title,icon:t.icon,disabled:t.disabled,onClick:e?r:t.onClick})})})}return(0,eh.jsx)(Gc,{className:"memori-chat-layout--overflow-trigger",active:n,"aria-label":i("widget.moreActions")||"More actions",icon:(0,eh.jsx)(H3,{}),onClick:r})};var Jx=({open:e,onClose:t,presentation:n="sheet",title:r,loginToken:i,userName:a,user:o,apiClient:s,userEmail:l,birthDate:u,avatarURL:c,actions:d,logoutLabel:h="Log out",onLogout:p,onKnownFactsOpen:m,onLocationEnable:f,onLocationDisable:g,knownFactsPageTitle:v="Known facts",sharePageTitle:y="Share",locationPageTitle:b="Location tracking",backLabel:_="Back",locationStatusLabel:x="Status",locationPlace:w,locationUnknownLabel:S="Unknown position",locationEnableLabel:E="Use current position",locationDisableLabel:A="Disable location sharing",knownFactsDescription:T,knownFactsCtaLabel:I="Open full known facts",knownFactsCountLabel:C,shareContent:M,knownFactsDisabled:N=!1,knownFactsHint:R,showKnownFacts:O=!1,showChatHistory:P=!1,onChatHistoryOpen:k,history:D=[],aiUsageTitle:B,showMessageConsumption:F=!1,isLoggedIn:U=!1,showLogin:j=!1,loginLabel:z="Log in",onLogin:H,venue:G,setVenue:V,initialView:W="session",autoStartGeolocation:q=!1})=>{let $=j&&U,J=(0,em.useRef)(null),K="mobile-session-panel-title",Y=(0,em.useRef)(0),[X,Z]=(0,em.useState)(0),[Q,ee]=(0,em.useState)("session"),{uploadAsset:et,pwlUpdateUser:en}=(null==s?void 0:s.backend)||{},{add:er}=vZ(),{t:ei,i18n:ea}=tA(),eo=ea.language||navigator.language||"en",es=(0,em.useMemo)(()=>{let e={energy:0,gwp:0,wcf:0};return D.forEach(t=>{var n,r,i,a;let o=null==(n=t.llmUsage)?void 0:n.energyImpact;o&&(e.energy+=null!=(r=Jm(o.energy))?r:0,e.gwp+=null!=(i=Jm(o.gwp))?i:0,e.wcf+=null!=(a=Jm(o.wcf))?a:0)}),e},[D]),el=(0,em.useMemo)(()=>D.some(e=>{var t;return!!(null==(t=e.llmUsage)?void 0:t.energyImpact)}),[D]),eu=(0,em.useMemo)(()=>Jv(D),[D]),{directAction:ec}=Jb({actions:d,loginToken:i,showChatHistory:P,onChatHistoryOpen:k,showKnownFacts:O,showMessageConsumption:F,history:D,isLoggedIn:U,showLogin:j,aiUsageTitle:B}),ed=(null==ec?void 0:ec.view)!==Q,ep=el?`${Jg(es.energy,"energy",eo)} \u{2022} ${Jg(es.gwp,"co2",eo)}`:ei("widget.noData",{defaultValue:"Nessun dato disponibile"}),ef=R||ei("widget.knownFactsHint")||"What I remember about you",eg=B||ei("widget.aiConsumption")||"AI usage",ev=ei("write_and_speak.chatHistory")||"Chat history",ey=ei("write_and_speak.chatHistoryDescription")||"Show chat history with this agent";(0,em.useEffect)(()=>{e&&ee(W)},[e,W]);let eb=async e=>{if(!et||!en)return void er(v9({description:ei("login.avatarUploadError"),severity:"error"}));if(e&&i){let t=new FileReader;t.onload=async t=>{var n,r,a,s;try{let{asset:l,...u}=await et(null!=(n=e.name)?n:"avatar",null==(r=t.target)?void 0:r.result,null!=i?i:"");if(0!==u.resultCode)console.error("[updateAvatar] Upload failed:",u),er(v9({description:ei(Lx(u.resultCode)),severity:"error"}));else if(l){let e={userID:null!=(a=null==o?void 0:o.userID)?a:"",avatarURL:l.assetURL},{...t}=await en(null!=i?i:"",null!=(s=null==o?void 0:o.userID)?s:"",e);0!==t.resultCode?er(v9({description:ei(Lx(t.resultCode)),severity:"error"})):er(v9({description:ei("login.avatarUploadSuccess"),severity:"success"}))}}catch(e){console.error("[updateAvatar] Error:",e),(null==e?void 0:e.message)&&er(v9({description:e.message,severity:"error"}))}},t.readAsDataURL(e)}else console.error("[updateAvatar] Missing avatar or login token",{avatar:e,loginToken:i}),er(v9({description:ei("login.avatarUploadError"),severity:"error"}))},e_="popover"===n,ex=!!(w&&w.trim().length>0&&w!==S),ew=Jy(d),eS=(0,eh.jsxs)("section",{ref:J,tabIndex:-1,className:`memori-mobile-session-panel ${e_?"memori-mobile-session-panel--popover":""}`,role:e_?"dialog":void 0,"aria-modal":!!e_||void 0,"aria-labelledby":K,onClick:e=>e.stopPropagation(),onTouchStart:e_?void 0:e=>{Y.current=e.touches[0].clientY,Z(0)},onTouchMove:e_?void 0:e=>{var t;let n=null==(t=J.current)?void 0:t.closest(".memori-drawer__body");if(n instanceof HTMLElement&&n.scrollTop>0)return;let r=e.touches[0].clientY-Y.current;r>0&&Z(r)},onTouchEnd:e_?void 0:()=>{X>90&&t(),Z(0)},style:{transform:X?`translateY(${X}px)`:void 0},children:[!e_&&(0,eh.jsx)("div",{className:"memori-mobile-session-panel--handle"}),"session"===Q?(0,eh.jsxs)(eh.Fragment,{children:[$&&(0,eh.jsxs)("div",{className:"memori-mobile-session-panel--user",children:[(0,eh.jsx)("div",{className:"memori-dropdown--avatar-wrap",children:c?(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("img",{src:c,alt:a||l,className:"memori-dropdown--avatar"}),(0,eh.jsx)("span",{className:"memori-dropdown--avatar-overlay","aria-hidden":!0,children:(0,eh.jsx)($n,{size:20,strokeWidth:2})}),(0,eh.jsx)("label",{htmlFor:"mobile-session-avatar-upload",className:"sr-only",children:ei("login.changeAvatar",{defaultValue:"Change profile picture"})}),(0,eh.jsx)("input",{type:"file",name:"avatar",id:"mobile-session-avatar-upload",className:"memori-dropdown--avatar-input",onChange:e=>{var t,n;return eb(null!=(n=null==(t=e.target.files)?void 0:t[0])?n:null)},accept:Li.join(", ")})]}):(0,eh.jsx)(eh.Fragment,{children:(0,eh.jsxs)("div",{className:"memori-dropdown--avatar-placeholder",children:[(0,eh.jsx)("span",{className:"memori-dropdown--avatar-initial",children:(a||l||"U").charAt(0).toUpperCase()}),(0,eh.jsx)("span",{className:"memori-dropdown--avatar-overlay","aria-hidden":!0,children:(0,eh.jsx)($n,{size:20,strokeWidth:2})}),(0,eh.jsx)("label",{htmlFor:"mobile-session-avatar-upload-placeholder",className:"sr-only",children:ei("login.changeAvatar",{defaultValue:"Change profile picture"})}),(0,eh.jsx)("input",{type:"file",name:"avatar",id:"mobile-session-avatar-upload-placeholder",className:"memori-dropdown--avatar-input",onChange:e=>{var t,n;return eb(null!=(n=null==(t=e.target.files)?void 0:t[0])?n:null)},accept:Li.join(", ")})]})})}),(0,eh.jsxs)("div",{className:"memori-dropdown--user-details",children:[(0,eh.jsx)("h3",{className:"memori-dropdown--user-name",children:a}),(0,eh.jsx)("p",{className:"memori-dropdown--user-email",children:l}),(0,eh.jsx)("div",{className:"memori-dropdown--user-badge",children:u?new Date(u).toLocaleDateString():"Not set"})]})]}),(0,eh.jsx)("h2",{id:K,className:"memori-mobile-session-panel--section-title",children:r}),(U&&O||F)&&(0,eh.jsxs)("ul",{className:"memori-mobile-session-panel--actions memori-mobile-session-panel--session-info",children:[U&&O&&(0,eh.jsx)("li",{children:(0,eh.jsxs)(yt,{variant:"toolbar",size:"sm",className:"memori-mobile-session-panel--action",disabled:N,onClick:()=>{N||null==m||m()},children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-icon",children:(0,eh.jsx)($u,{size:18})}),(0,eh.jsxs)("span",{className:"memori-mobile-session-panel--action-copy",children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-title",children:v}),(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-subtitle",children:ef})]})]})}),F&&(0,eh.jsx)("li",{children:(0,eh.jsxs)(yt,{variant:"toolbar",size:"sm",className:"memori-mobile-session-panel--action",disabled:!eu,onClick:()=>{eu&&ee("aiUsage")},children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-icon",children:(0,eh.jsx)($0,{})}),(0,eh.jsxs)("span",{className:"memori-mobile-session-panel--action-copy",children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-title",children:eg}),(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-subtitle",children:ep})]}),(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-trailing",children:(0,eh.jsx)(HM,{size:16})})]})})]}),(0,eh.jsxs)("ul",{className:"memori-mobile-session-panel--actions",children:[P&&!!i&&(0,eh.jsx)("li",{children:(0,eh.jsxs)(yt,{variant:"toolbar",size:"sm",className:"memori-mobile-session-panel--action memori-mobile-session-panel--chat-history",onClick:()=>null==k?void 0:k(),children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-icon",children:(0,eh.jsx)($t,{size:18})}),(0,eh.jsxs)("span",{className:"memori-mobile-session-panel--action-copy",children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-title",children:ev}),(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-subtitle",children:ey})]})]})}),ew.map(e=>{let t,n,r;return(0,eh.jsx)("li",{children:(t="knownFacts"===e.view,n="share"===e.view,r=e.disabled||t&&!U,(0,eh.jsxs)(yt,{variant:"toolbar",size:"sm",className:"memori-mobile-session-panel--action",disabled:r,onClick:()=>{var t;if(!r){if("knownFacts"===e.view&&m)return void m();if(e.view)return void ee(e.view);null==(t=e.onClick)||t.call(e)}},children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-icon",children:e.icon}),(0,eh.jsxs)("span",{className:"memori-mobile-session-panel--action-copy",children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-title",children:e.title}),e.subtitle&&(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-subtitle",children:e.subtitle})]}),(n||"location"===e.view)&&(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-trailing",children:(0,eh.jsx)(HM,{size:16})})]}))},e.key)})]}),$&&(0,eh.jsxs)(yt,{variant:"toolbar",size:"sm",shape:"default",className:"memori-mobile-session-panel--logout",onClick:p,children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-icon",children:(0,eh.jsx)($r,{size:18})}),(0,eh.jsx)("span",{className:"memori-mobile-session-panel--logout-label",children:h})]}),j&&!U&&(0,eh.jsx)("div",{className:"memori-mobile-session-panel--login-cta-wrap",children:(0,eh.jsxs)(yt,{variant:"toolbar",size:"sm",className:"memori-mobile-session-panel--login-cta",onClick:H,children:[(0,eh.jsx)("span",{className:"memori-mobile-session-panel--action-icon",children:(0,eh.jsx)(Jh,{size:18})}),z]})})]}):(0,eh.jsxs)("div",{className:"memori-mobile-session-panel--page",children:[(0,eh.jsxs)("div",{className:"memori-mobile-session-panel--page-header",children:[ed&&(0,eh.jsxs)(yt,{variant:"toolbar",size:"sm",className:"memori-mobile-session-panel--back",onClick:()=>ee("session"),children:[(0,eh.jsx)(Jp,{size:16}),_]}),(0,eh.jsx)("h3",{className:"memori-mobile-session-panel--page-title",children:"location"===Q?b:"share"===Q?y:"aiUsage"===Q?eg:v})]}),"location"===Q?(0,eh.jsx)("div",{className:"memori-mobile-session-panel--page-content memori-mobile-session-panel--location-content",children:V?(0,eh.jsx)($Z,{venue:G,setVenue:V,autoStartGeolocation:q}):(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("p",{className:"memori-mobile-session-panel--meta-label",children:x}),(0,eh.jsx)("p",{className:"memori-mobile-session-panel--meta-value",children:w||S}),(0,eh.jsxs)("div",{className:"memori-mobile-session-panel--page-actions",children:[(0,eh.jsx)(yt,{variant:"toolbar",size:"sm",className:`memori-mobile-session-panel--page-btn ${ex?"memori-mobile-session-panel--page-btn-active":""}`,onClick:f,children:(0,eh.jsx)("span",{children:E})}),(0,eh.jsx)(yt,{variant:"toolbar",size:"sm",className:"memori-mobile-session-panel--page-btn memori-mobile-session-panel--page-btn-secondary",onClick:g,children:A})]})]})}):"share"===Q?(0,eh.jsx)("div",{className:"memori-mobile-session-panel--page-content memori-mobile-session-panel--share-content",children:M}):"aiUsage"===Q?(0,eh.jsx)("div",{className:"memori-mobile-session-panel--page-content memori-mobile-session-panel--ai-usage-content",children:(0,eh.jsx)($5,{history:D,showTitle:!1,className:"memori-mobile-session-panel--ai-usage"})}):(0,eh.jsxs)("div",{className:"memori-mobile-session-panel--page-content",children:[T&&(0,eh.jsx)("p",{className:"memori-mobile-session-panel--known-facts-description",children:T}),C&&(0,eh.jsx)("p",{className:"memori-mobile-session-panel--known-facts-count",children:C}),(0,eh.jsx)(yt,{variant:"toolbar",size:"sm",className:"memori-mobile-session-panel--page-btn",disabled:N,onClick:m,children:I})]})]})]});return e_?e?(0,eh.jsx)("div",{className:"memori-mobile-session-panel--overlay memori-mobile-session-panel--overlay-popover",role:"presentation",children:eS}):null:(0,eh.jsx)(xf,{open:e,onClose:t,anchor:"bottom",size:"lg",className:"memori-mobile-session-panel-drawer",closable:!1,children:eS})},em=ec("85Hg2");function Jw(e){var t;let{t:n}=tA(),[r,i]=(0,em.useState)(!1),[a,o]=(0,em.useState)(720),[s,l]=(0,em.useState)(!1),u=(0,em.useRef)(null);(0,em.useEffect)(()=>{let e=window.matchMedia("(max-width: 1199px)"),t=()=>i(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let c=(0,em.useCallback)(e=>{var t;let n;return(n=Math.max(0,((null==(t=u.current)?void 0:t.getBoundingClientRect().width)||window.innerWidth)-400*!r))<=460?n:Math.min(Math.max(e,460),n)},[r]);(0,em.useEffect)(()=>{e&&o(e=>c(e))},[e,r,c]);let d=(0,em.useCallback)(e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),l(!0)},[]),h=(0,em.useCallback)(e=>{if(!s)return;let t=u.current;t&&o(c(t.getBoundingClientRect().right-e.clientX))},[c,s]),p=(0,em.useCallback)(()=>{l(!1)},[]),m=(0,em.useCallback)(e=>{let t=e.shiftKey?40:16;"ArrowLeft"===e.key?(e.preventDefault(),o(e=>c(e+t))):"ArrowRight"===e.key?(e.preventDefault(),o(e=>c(e-t))):"Home"===e.key?(e.preventDefault(),o(e=>c(e+200))):"End"===e.key&&(e.preventDefault(),o(e=>c(e-200)))},[c]),f=e?{"--memori-artifact-column-width":`${a}px`}:void 0,g={role:"separator","aria-orientation":"vertical","aria-label":n("artifact.resizeHandle")||"Resize artifact panel","aria-valuemin":460,"aria-valuemax":Math.round((null==(t=u.current)?void 0:t.getBoundingClientRect().width)||0)||void 0,"aria-valuenow":Math.round(a),tabIndex:0,onPointerDown:d,onPointerMove:h,onPointerUp:p,onPointerCancel:p,onKeyDown:m};return{contentRowRef:u,isArtifactOverlay:r,isResizingArtifact:s,columnWidthStyle:f,resizeHandleProps:g}}var JS=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:a,StartPanel:o,startPanelProps:s,integrationStyle:l,integrationBackground:u,sessionId:c,hasUserActivatedSpeak:d,loading:h=!1,poweredBy:p})=>{var m,f,g,v,y,b,_,x,w;let{t:S}=tA(),{state:E}=e9();E.currentArtifact;let A=E.isDrawerOpen&&!E.isChatLogPanelPresentation,[T,I]=(0,em.useState)(!1),[C,M]=(0,em.useState)(!1),{contentRowRef:N,isArtifactOverlay:R,isResizingArtifact:O,columnWidthStyle:P,resizeHandleProps:k}=Jw(A);(0,em.useEffect)(()=>{let e=window.matchMedia("(max-width: 768px)"),t=()=>I(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let D=null==t?void 0:t.memori;null==t||t.tenant,null==t||t.baseUrl;let B=(null==t?void 0:t.loginToken)&&(null==(m=null==t?void 0:t.user)?void 0:m.userID)?t.user:void 0,F=[null==B?void 0:B.name,null==B?void 0:B.surname].filter(Boolean).join(" ").trim()||(null==B?void 0:B.userName)||(null==B?void 0:B.eMail)||(null==D?void 0:D.name)||"User",U=F.charAt(0).toUpperCase(),j=!!(c&&d),z=(0,em.useMemo)(()=>(null==a?void 0:a.isPlayingAudio)?{key:"speaking",label:S("widget.agentStatusSpeaking",{defaultValue:"sta parlando"})}:(null==a?void 0:a.memoriTyping)?{key:"processing",label:S("widget.agentStatusProcessing",{defaultValue:"in elaborazione"})}:(null==a?void 0:a.listening)?{key:"listening",label:S("widget.agentStatusListening",{defaultValue:"in ascolto"})}:null,[null==a?void 0:a.isPlayingAudio,null==a?void 0:a.memoriTyping,null==a?void 0:a.listening,S]),H=(0,em.useCallback)(()=>{if(function(){if("u"<typeof document)return!1;if(!0===document.fullscreenEnabled)return!0;let e=document.querySelector('meta[name="memori-fullscreen-enabled"], meta[name="fullscreen-enabled"]');return(null==e?void 0:e.getAttribute("content"))==="true"}()){if(!document.fullscreenElement)return void document.documentElement.requestFullscreen().catch(()=>{});document.exitFullscreen().catch(()=>{})}},[]),G=(0,em.useMemo)(()=>{if(t)return T?{...t,showReload:!1,showClear:!1,showSettings:!1,showShare:!1,showLogin:!1,showFullscreen:!1,showMessageConsumption:!1,memori:{...t.memori,needsPosition:!1,enableDeepThought:!1},showChatHistory:!1}:t},[t,T]),V=(0,em.useMemo)(()=>{var e,n;if(!t)return[];let r=T&&!!t.loginToken&&!1!==t.showChatHistory,i=!T&&!1!==t.showFullscreen,a=!1!==t.showShare,o=!!(null==(e=t.memori)?void 0:e.needsPosition);return[...r?[{key:"chatHistory",icon:(0,eh.jsx)($t,{size:18}),title:S("widget.headerHistory")||S("write_and_speak.chatHistory")||"Chat history",onClick:()=>{t.setShowChatHistoryDrawer(!0),M(!1)}}]:[],...i?[{key:"fullscreen",icon:(0,eh.jsx)(Jd,{size:18}),title:S("fullscreenEnter")||"Full screen",subtitle:S("widget.expandToImmersive")||"Expand to immersive view",onClick:()=>{H(),M(!1)}}]:[],...a?[{key:"share",icon:(0,eh.jsx)($h,{size:18}),title:S("widget.share")||"Share chat",subtitle:S("widget.mobileSession.copyLinkOrDownload")||"Copy link or download",view:"share"}]:[],...o?[{key:"location",icon:(0,eh.jsx)(VS,{size:18}),title:S("widget.mobileSession.locationTracking")||"Location tracking",subtitle:(null==(n=t.position)?void 0:n.placeName)||S("widget.mobileSession.currentlyOff")||"Currently off",view:"location",trailing:(0,eh.jsx)("span",{className:"memori-mobile-session-panel--chevron",children:">"})}]:[]]},[t,T,j,S,H]),W=!!(null==(f=null==t?void 0:t.memori)?void 0:f.enableDeepThought)&&!!(null==t?void 0:t.loginToken)&&!!(null==(g=null==t?void 0:t.user)?void 0:g.pAndCUAccepted),q=Jb({actions:V,loginToken:null==t?void 0:t.loginToken,showKnownFacts:W,showMessageConsumption:!!(null==t?void 0:t.showMessageConsumption),history:null==t?void 0:t.history,isLoggedIn:!!B,showLogin:!!(null==t?void 0:t.showLogin)});return(0,eh.jsxs)(eh.Fragment,{children:[l,u,(0,eh.jsxs)(bV,{spinning:!!(h&&j),children:[e&&t&&G&&(0,eh.jsx)("div",{className:"memori-fullpage-top-header",children:(0,eh.jsx)("div",{className:"memori-chat-layout--header",children:(0,eh.jsx)("div",{className:"memori-fullpage-header-row",children:(0,eh.jsx)(e,{...G,layout:"FULLPAGE",buttonVariant:"outline",extraActions:T?(0,eh.jsx)(J_,{entries:q,open:C,onToggle:()=>M(e=>!e)}):void 0})})})}),t&&(0,eh.jsx)(Jx,{open:C,presentation:"popover",onClose:()=>M(!1),initialView:null!=(y=null==(v=q.directAction)?void 0:v.view)?y:"session",title:S("widget.mobileSession.session")||"Session",loginToken:t.loginToken,user:t.user,apiClient:t.apiClient,userName:F,userEmail:null==B?void 0:B.eMail,userInitial:U,avatarURL:null==B?void 0:B.avatarURL,birthDate:null==B?void 0:B.birthDate,actions:V,knownFactsPageTitle:S("knownFacts.title")||"Known facts",sharePageTitle:S("widget.share")||"Share",locationPageTitle:S("widget.mobileSession.locationTracking")||"Location tracking",backLabel:S("back")||"Back",locationStatusLabel:S("widget.mobileSession.locationStatus")||"Status",locationPlace:null==(b=t.position)?void 0:b.placeName,locationUnknownLabel:S("write_and_speak.unknownPosition")||"Unknown position",locationEnableLabel:S("widget.shareLocation")||"Share location",locationDisableLabel:S("widget.mobileSession.disableLocationSharing")||"Disable location sharing",knownFactsDescription:S("knownFacts.description",{memoriName:(null==D?void 0:D.name)||""})||"",knownFactsCtaLabel:S("widget.mobileSession.openKnownFacts")||"Open full known facts",knownFactsCountLabel:S("widget.mobileSession.knownFactsMessages",{count:(null==(_=t.history)?void 0:_.length)||0})||"",shareContent:(0,eh.jsx)($C,{tenant:null==t?void 0:t.tenant,memori:null==t?void 0:t.memori,sessionID:null==t?void 0:t.sessionID,title:null==(x=null==t?void 0:t.memori)?void 0:x.name,baseUrl:null==t?void 0:t.baseUrl,align:"left",history:null==t?void 0:t.history,renderMode:"inline"}),knownFactsDisabled:!j,showKnownFacts:W,showMessageConsumption:!!t.showMessageConsumption,history:null!=(w=t.history)?w:[],isLoggedIn:!!B,showLogin:!!t.showLogin,loginLabel:S("login.login")||"Log in",onLogin:()=>{t.setShowLoginDrawer(!0),M(!1)},onKnownFactsOpen:()=>{j&&(t.setShowKnownFactsDrawer(!0),M(!1))},onLocationEnable:()=>{if(t){if(!navigator.geolocation)return void t.setPositionPopoverOpen(!0);navigator.geolocation.getCurrentPosition(e=>{let n=e.coords.latitude,r=e.coords.longitude;t.setVenue({latitude:n,longitude:r,placeName:`${n.toFixed(5)}, ${r.toFixed(5)}`,uncertainty:e.coords.accuracy/1e3})},()=>{t.setPositionPopoverOpen(!0)},{enableHighAccuracy:!0,timeout:15e3,maximumAge:0})}},onLocationDisable:()=>{null==t||t.setVenue({latitude:0,longitude:0,placeName:"",uncertainty:0})},venue:t.position,setVenue:t.setVenue,logoutLabel:S("login.logout")||"Log out",onLogout:()=>{(()=>{if(t){if(B&&t.onLogout)return t.onLogout();t.setShowLoginDrawer(!0)}})(),M(!1)}}),(0,eh.jsxs)("div",{ref:N,className:`memori-fullpage-content-row${A&&R?" memori-fullpage-content-row--artifact-overlay":""}${O?" memori-fullpage-content-row--resizing":""}`,style:P,children:[(0,eh.jsxs)("div",{className:"memori--grid",children:[(0,eh.jsxs)("div",{className:"memori--grid-column memori--grid-column-left",hidden:A,children:[j&&z&&(0,eh.jsxs)("div",{className:"memori-fullpage-agent-status",role:"status","aria-live":"polite",children:[(0,eh.jsx)("span",{className:`memori-fullpage-agent-status--dot memori-fullpage-agent-status--dot-${z.key}`,"aria-hidden":"true"}),(0,eh.jsx)("span",{className:"memori-fullpage-agent-status--label",children:z.label})]}),n&&r&&(0,eh.jsx)(n,{chatProps:a,...r}),(0,eh.jsx)("div",{id:"extension"})]}),(0,eh.jsx)("div",{className:"memori-chat-layout--main",children:(0,eh.jsx)("div",{className:E.isFullscreen?"memori-chat-layout-controls-hide":"memori-chat-layout--controls",children:c&&d&&i&&a?(0,eh.jsx)(i,{...a,footerBrand:p,showAiGeneratedNote:!0}):s?(0,eh.jsx)("div",{className:"memori-conversation-column",children:(0,eh.jsx)(o,{...s,footerBrand:p})}):null})})]}),(0,eh.jsx)("div",{className:`memori--grid-column-artifact${A?" memori--grid-column-artifact--open":""}`,children:A&&(0,eh.jsxs)(eh.Fragment,{children:[!T&&(0,eh.jsx)("div",{className:"memori-artifact-resize-handle",...k}),(0,eh.jsx)(Gh,{isLayoutColumn:!0})]})})]})]})]})},JE=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:a,StartPanel:o,startPanelProps:s,integrationStyle:l,integrationBackground:u,sessionId:c,hasUserActivatedSpeak:d,loading:h=!1,poweredBy:p,totemContentMaxWidth:m})=>{let f=null!=m?{"--memori-totem-max-width":"number"==typeof m?`${m}px`:m}:void 0;return(0,eh.jsxs)(eh.Fragment,{children:[l,u,(0,eh.jsxs)(bV,{spinning:!!(h&&c&&d),className:"memori-totem-layout",style:f,children:[p,(0,eh.jsx)("div",{className:"memori-totem-layout--header",children:e&&t&&(0,eh.jsx)(e,{buttonVariant:"outline",...t})}),(0,eh.jsx)("div",{className:"memori-totem-layout--avatar",children:n&&r&&(0,eh.jsx)(n,{chatProps:a,...r,isTotem:!0})}),(0,eh.jsx)("div",{id:"extension"}),(0,eh.jsx)("div",{className:"memori-totem-layout--controls",children:c&&d&&i&&a?(0,eh.jsx)(i,{...a}):s?(0,eh.jsx)(o,{...s}):null})]})]})},em=ec("85Hg2"),JA=({Header:e,headerProps:t,Chat:n,chatProps:r,StartPanel:i,startPanelProps:a,integrationStyle:o,integrationBackground:s,sessionId:l,hasUserActivatedSpeak:u,loading:c=!1,poweredBy:d})=>{var h,p,m,f,g,v,y,b,_,x;let{t:w}=tA(),{state:S}=e9(),E=S.isDrawerOpen&&!S.isChatLogPanelPresentation,[A,T]=(0,em.useState)(!1),[I,C]=(0,em.useState)(!1),{contentRowRef:M,isResizingArtifact:N,columnWidthStyle:R,resizeHandleProps:O}=Jw(E);(0,em.useEffect)(()=>{let e=window.matchMedia("(max-width: 768px)"),t=()=>T(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let P=null==r?void 0:r.globalBackground,k=null==t?void 0:t.memori;null==t||t.tenant,null==t||t.baseUrl;let D=(null==t?void 0:t.loginToken)&&(null==(h=null==t?void 0:t.user)?void 0:h.userID)?t.user:void 0,B=[null==D?void 0:D.name,null==D?void 0:D.surname].filter(Boolean).join(" ").trim()||(null==D?void 0:D.userName)||(null==D?void 0:D.eMail)||(null==k?void 0:k.name)||"User",F=B.charAt(0).toUpperCase(),U=!!(l&&u),j=(0,em.useMemo)(()=>{if(t)return A?{...t,showReload:!1,showClear:!1,showSettings:!1,showShare:!1,showLogin:!1,showFullscreen:!1,showMessageConsumption:!1,memori:{...t.memori,needsPosition:!1,enableDeepThought:!1},showChatHistory:!1}:t},[t,A]),z=(0,em.useMemo)(()=>{var e,n;if(!t)return[];let r=A&&!!t.loginToken&&!1!==t.showChatHistory,i=!1!==t.showShare,a=!!(null==(e=t.memori)?void 0:e.needsPosition);return[...r?[{key:"chatHistory",icon:(0,eh.jsx)($t,{size:18}),title:w("widget.headerHistory")||w("write_and_speak.chatHistory")||"Chat history",onClick:()=>{t.setShowChatHistoryDrawer(!0),C(!1)}}]:[],...i?[{key:"share",icon:(0,eh.jsx)($h,{size:18}),title:w("widget.share")||"Share chat",subtitle:w("widget.mobileSession.copyLinkOrDownload")||"Copy link or download",view:"share"}]:[],...a?[{key:"location",icon:(0,eh.jsx)(VS,{size:18}),title:w("widget.mobileSession.locationTracking")||"Location tracking",subtitle:(null==(n=t.position)?void 0:n.placeName)||w("widget.mobileSession.currentlyOff")||"Currently off",view:"location",trailing:(0,eh.jsx)("span",{className:"memori-mobile-session-panel--chevron",children:">"})}]:[]]},[t,A,w]),H=!!(null==(p=null==t?void 0:t.memori)?void 0:p.enableDeepThought)&&!!(null==t?void 0:t.loginToken)&&!!(null==(m=null==t?void 0:t.user)?void 0:m.pAndCUAccepted),G=Jb({actions:z,loginToken:null==t?void 0:t.loginToken,showKnownFacts:H,showMessageConsumption:!!(null==t?void 0:t.showMessageConsumption),history:null==t?void 0:t.history,isLoggedIn:!!D,showLogin:!!(null==t?void 0:t.showLogin)});return(0,eh.jsxs)(eh.Fragment,{children:[o,s,(0,eh.jsxs)(bV,{spinning:!!(c&&U),className:"memori-chat-layout",children:[(0,eh.jsx)("div",{id:"extension"}),(0,eh.jsx)("div",{className:"memori-chat-layout--header",children:e&&t&&j&&(0,eh.jsx)("div",{className:"memori-fullpage-header-row",children:(0,eh.jsx)(e,{...j,buttonVariant:"outline",extraActions:A?(0,eh.jsx)(J_,{entries:G,open:I,onToggle:()=>C(e=>!e)}):void 0})})}),t&&(0,eh.jsx)(Jx,{open:I,presentation:"popover",onClose:()=>C(!1),initialView:null!=(g=null==(f=G.directAction)?void 0:f.view)?g:"session",title:w("widget.mobileSession.session")||"Session",loginToken:t.loginToken,user:t.user,apiClient:t.apiClient,userName:B,userEmail:null==D?void 0:D.eMail,userInitial:F,avatarURL:null==D?void 0:D.avatarURL,birthDate:null==D?void 0:D.birthDate,actions:z,knownFactsPageTitle:w("knownFacts.title")||"Known facts",sharePageTitle:w("widget.share")||"Share",locationPageTitle:w("widget.mobileSession.locationTracking")||"Location tracking",backLabel:w("back")||"Back",locationStatusLabel:w("widget.mobileSession.locationStatus")||"Status",locationPlace:null==(v=t.position)?void 0:v.placeName,locationUnknownLabel:w("write_and_speak.unknownPosition")||"Unknown position",locationEnableLabel:w("widget.shareLocation")||"Share location",locationDisableLabel:w("widget.mobileSession.disableLocationSharing")||"Disable location sharing",knownFactsDescription:w("knownFacts.description",{memoriName:(null==k?void 0:k.name)||""})||"",knownFactsCtaLabel:w("widget.mobileSession.openKnownFacts")||"Open full known facts",knownFactsCountLabel:w("widget.mobileSession.knownFactsMessages",{count:(null==(y=t.history)?void 0:y.length)||0})||"",shareContent:(0,eh.jsx)($C,{tenant:null==t?void 0:t.tenant,memori:null==t?void 0:t.memori,sessionID:null==t?void 0:t.sessionID,title:null==(b=null==t?void 0:t.memori)?void 0:b.name,baseUrl:null==t?void 0:t.baseUrl,align:"left",history:null==t?void 0:t.history,renderMode:"inline"}),knownFactsDisabled:!U,showKnownFacts:H,showMessageConsumption:!!t.showMessageConsumption,history:null!=(_=t.history)?_:[],isLoggedIn:!!D,showLogin:!!t.showLogin,loginLabel:w("login.login")||"Log in",onLogin:()=>{t.setShowLoginDrawer(!0),C(!1)},onKnownFactsOpen:()=>{U&&(t.setShowKnownFactsDrawer(!0),C(!1))},onLocationEnable:()=>{if(t){if(!navigator.geolocation)return void t.setPositionPopoverOpen(!0);navigator.geolocation.getCurrentPosition(e=>{let n=e.coords.latitude,r=e.coords.longitude;t.setVenue({latitude:n,longitude:r,placeName:`${n.toFixed(5)}, ${r.toFixed(5)}`,uncertainty:e.coords.accuracy/1e3})},()=>{t.setPositionPopoverOpen(!0)},{enableHighAccuracy:!0,timeout:15e3,maximumAge:0})}},onLocationDisable:()=>{null==t||t.setVenue({latitude:0,longitude:0,placeName:"",uncertainty:0})},venue:t.position,setVenue:t.setVenue,logoutLabel:w("login.logout")||"Log out",onLogout:()=>{(()=>{if(t){if(D&&t.onLogout)return t.onLogout();t.setShowLoginDrawer(!0)}})(),C(!1)}}),(0,eh.jsxs)("div",{ref:M,className:`memori-chat-layout--main${P?" memori-chat-layout--main--has-background":""}${N?" memori-chat-layout--main--resizing":""}`,style:{...P?{"--memori-chat-global-background":`url(${P})`}:{},...R},children:[(0,eh.jsx)("div",{className:S.isFullscreen?"memori-chat-layout-controls-hide":"memori-chat-layout--controls",children:(0,eh.jsxs)("div",{className:"memori-conversation-column",children:[(0,eh.jsx)("div",{className:"memori-chat-layout--body",children:l&&u&&n&&r?(0,eh.jsx)(n,{...r,showInputs:!1}):a?(0,eh.jsx)("div",{className:"memori-chat-layout--start-shell",id:"chat-wrapper",children:(0,eh.jsx)("div",{className:"memori-chat-layout--start-panel-wrap",children:(0,eh.jsx)(i,{...a})})}):null}),n&&r&&!1!==r.showInputs&&(0,eh.jsx)(Vo,{userMessage:r.userMessage,onChangeUserMessage:r.onChangeUserMessage,dialogState:r.dialogState,instruct:r.instruct,authToken:r.authToken,sendMessage:r.sendMessage,onMediumSelectedState:r.onMediumSelectedState,isTyping:r.memoriTyping,microphoneMode:r.microphoneMode,sendOnEnter:r.sendOnEnter,setSendOnEnter:r.setSendOnEnter,client:r.client,sessionID:U?r.sessionID:void 0,baseUrl:r.baseUrl,showUpload:r.showUpload,attachmentsMenuOpen:r.attachmentsMenuOpen,setAttachmentsMenuOpen:r.setAttachmentsMenuOpen,onTextareaFocus:()=>{var e;null==(e=r.stopListening)||e.call(r)},onTextareaBlur:()=>{},onTextareaExpanded:()=>{},startListening:r.startListening,stopListening:r.stopListening,audioStream:r.audioStream,transcribing:r.transcribing,stopAudio:r.stopAudio,listening:r.listening,isPlayingAudio:r.isPlayingAudio,showMicrophone:r.showMicrophone,memoriID:null==(x=r.memori)?void 0:x.memoriID,maxTextareaCharacters:r.maxTextareaCharacters,maxTotalMessagePayload:r.maxTotalMessagePayload,maxDocumentsPerMessage:kZ,maxDocumentContentLength:3e5,pasteAsCardLineThreshold:100,pasteAsCardCharThreshold:4200,showAiGeneratedNote:U,footerBrand:d})]})}),(0,eh.jsx)("div",{className:`memori--grid-column-artifact${E?" memori--grid-column-artifact--open":""}`,children:E&&(0,eh.jsxs)(eh.Fragment,{children:[!A&&(0,eh.jsx)("div",{className:"memori-artifact-resize-handle",...O}),(0,eh.jsx)(Gh,{isLayoutColumn:!0})]})})]})]})]})},em=ec("85Hg2");let JT="memori-widget--fullscreen";function JI(e){var t;return null!=(t=e.closest(".memori-widget"))?t:e}function JC(e,t){let n=JI(e);return n.classList.add(JT),"function"==typeof n.requestFullscreen&&n.requestFullscreen().catch(e=>{n.classList.remove(JT),null==t||t(e)}),n}function JM(e){JI(e).classList.remove(JT)}let JN="memori-website_assistant--fullscreen";var JR=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:a,StartPanel:o,startPanelProps:s,integrationStyle:l,sessionId:u,hasUserActivatedSpeak:c,loading:d=!1,show3dAvatar:h=!1,sideDrawerOpen:p=!1,onSidebarToggle:m})=>{var f,g,v,y,b,_,x,w;let{t:S}=tA(),{state:E}=e9(),A=E.isDrawerOpen&&!E.isChatLogPanelPresentation,T=A||p,[I,C]=(0,em.useState)(!0),[M,N]=(0,em.useState)(),[R,O]=(0,em.useState)(!1),P=(0,em.useRef)(null),k=(0,em.useRef)({left:"",right:"",width:"",maxWidth:"",height:"",backgroundColor:""}),D=(0,em.useMemo)(()=>null==a?void 0:a.stopAudio,[null==a?void 0:a.stopAudio]),B=null==t?void 0:t.memori,F=null==t?void 0:t.tenant,U=null==t?void 0:t.baseUrl,j=!!(u&&c),z=B?B.avatarURL&&B.avatarURL.length>0?La({type:"avatar",tenantID:null==F?void 0:F.name,resourceURI:B.avatarURL,baseURL:U,apiURL:""}):La({type:"avatar",tenantID:null==F?void 0:F.name,baseURL:U,apiURL:""}):void 0,{add:H}=vZ(),[G,V]=(0,em.useState)(!1),W=(null==t?void 0:t.loginToken)&&(null==(f=null==t?void 0:t.user)?void 0:f.userID)?t.user:void 0,q=(null==W?void 0:W.userName)||(null==W?void 0:W.eMail)||(null==B?void 0:B.name)||"User",$=!!(null==B?void 0:B.enableDeepThought)&&!!(null==t?void 0:t.loginToken)&&!!(null==(g=null==t?void 0:t.user)?void 0:g.pAndCUAccepted),J=!!(null==B?void 0:B.needsPosition)&&!!(null==t?void 0:t.positionPopoverOpen),K=()=>{V(!1),(null==t?void 0:t.positionPopoverOpen)&&t.setPositionPopoverOpen(!1)};(0,em.useEffect)(()=>{J&&V(!0)},[J]);let Y=(0,em.useMemo)(()=>{var e,n,r;return t?[...t.showShare?[{key:"share",icon:(0,eh.jsx)($h,{size:18}),title:S("widget.share")||"Share chat",subtitle:S("widget.mobileSession.copyLinkOrDownload")||"Copy link or download",view:"share"}]:[],...(null==(e=t.memori)?void 0:e.needsPosition)?[{key:"location",icon:(0,eh.jsx)(VS,{size:18}),title:S("widget.mobileSession.locationTracking")||"Location tracking",subtitle:(null==(n=t.position)?void 0:n.placeName)||S("widget.mobileSession.currentlyOff")||"Currently off",view:"location"}]:[],...t.showExperts&&(null==(r=t.memori)?void 0:r.enableBoardOfExperts)?[{key:"experts",icon:(0,eh.jsx)(VA,{size:18}),title:S("widget.showExpertsInTheBoard")||"Experts in this board",disabled:!j,onClick:()=>{t.setShowExpertsDrawer(!0),V(!1)}}]:[],...t.showClear?[{key:"clear",icon:(0,eh.jsx)($a,{size:18}),title:S("clearHistory")||"Clear chat",onClick:()=>{t.clearHistory(),H(v9({description:S("clearHistoryDone"),severity:"success"})),V(!1)}}]:[]]:[]},[t,j,S,H]),X=!!(null==t?void 0:t.showChatHistory)&&!!(null==t?void 0:t.loginToken),Z=()=>{null==t||t.setShowChatHistoryDrawer(!0),K()},Q=Jb({actions:Y,loginToken:null==t?void 0:t.loginToken,showChatHistory:X,onChatHistoryOpen:Z,showKnownFacts:$,showMessageConsumption:!!(null==t?void 0:t.showMessageConsumption),history:null==t?void 0:t.history,isLoggedIn:!!W,showLogin:!!(null==t?void 0:t.showLogin)}),ee=Q.hasContent,et=()=>{let e=P.current;e&&(e.style.left=k.current.left,e.style.right=k.current.right,e.style.width=k.current.width,e.style.maxWidth=k.current.maxWidth,e.style.height=k.current.height,e.style.backgroundColor=k.current.backgroundColor,e.classList.remove(JN),JM(e)),O(!1)};(0,em.useEffect)(()=>{let e=()=>{!document.fullscreenElement&&R&&et()};return document.addEventListener("fullscreenchange",e),()=>{document.removeEventListener("fullscreenchange",e)}},[R]);let en=e=>{e&&R&&(document.fullscreenElement&&document.exitFullscreen().catch(e=>{console.warn("[WebsiteAssistantLayout] Error exiting fullscreen:",e)}),et()),e&&K(),C(e),null==m||m(!e),N(e?void 0:new Date().toISOString());try{null==D||D()}catch(e){console.log(e)}};return(0,eh.jsxs)(eh.Fragment,{children:[I&&(0,eh.jsx)("div",{className:"memori-website_assistant--trigger",children:(0,eh.jsx)(yt,{className:"memori-website_assistant--trigger-button",variant:"ghost",shape:"circle",onClick:()=>en(!1),"aria-label":S("expand")||"Expand","aria-expanded":!1,title:S("expand")||"Expand",children:(0,eh.jsx)(VD,{avatar:null==r?void 0:r.memori.avatarURL})})}),(0,eh.jsx)("div",{ref:P,className:`memori-website_assistant--${I?"collapsed":"expanded"}${T?" memori-website_assistant--drawer-open memori-website_assistant--artifact-open":""}${R?` ${JN}`:""}`,children:!I&&(0,eh.jsxs)(eh.Fragment,{children:[l,(0,eh.jsxs)(bV,{spinning:!!(d&&j),className:"memori-website_assistant-layout",children:[(0,eh.jsxs)("div",{className:"memori-website_assistant-layout--header-row",children:[B&&z&&(0,eh.jsxs)("div",{className:"memori-chat-layout--brand",children:[(0,eh.jsx)("img",{className:"memori-chat-layout--brand-avatar",src:z,alt:"",role:"presentation"}),(0,eh.jsx)("div",{className:"memori-chat-layout--brand-text",children:j&&(0,eh.jsx)("span",{className:"memori-chat-layout--brand-name",title:B.name,children:B.name})})]}),(0,eh.jsxs)("div",{className:"memori-website_assistant-layout--header-actions",children:[e&&t&&(0,eh.jsx)(e,{...t,buttonVariant:"outline",memori:{...t.memori,needsPosition:!1,enableDeepThought:!1,enableBoardOfExperts:!1},showSettings:!1,showReload:!1,showChatHistory:!1,showShare:!1,showClear:!1,showLogin:!1,showMessageConsumption:!1,fullScreenHandler:()=>{if(document.fullscreenElement)document.exitFullscreen&&document.exitFullscreen().catch(e=>{console.warn("[WebsiteAssistantLayout] Error exiting fullscreen:",e)}),et();else{let e=P.current;e&&(k.current={left:e.style.left,right:e.style.right,width:e.style.width,maxWidth:e.style.maxWidth,height:e.style.height,backgroundColor:e.style.backgroundColor},e.style.left="0",e.style.right="0",e.style.width="100%",e.style.maxWidth="none",e.style.height="100%",e.style.backgroundColor="",e.classList.add(JN),JC(e,e=>{console.warn("[WebsiteAssistantLayout] Error enabling fullscreen:",e)})),O(!0)}},extraActions:ee?(0,eh.jsx)(J_,{entries:Q,open:G,onToggle:()=>G?K():V(!0)}):void 0}),(0,eh.jsx)("button",{type:"button",className:"memori-website_assistant--close-button",onClick:()=>en(!0),"aria-label":S("collapse")||"Close",title:S("collapse")||"Close",children:(0,eh.jsx)(H2,{className:"memori-icon-close","aria-hidden":!0})})]})]}),h&&(0,eh.jsx)("div",{className:"memori-website_assistant-layout--avatar",children:n&&r&&(0,em.createElement)(n,{...r,integrationConfig:r.integrationConfig?{...r.integrationConfig,avatarURL:(null==(v=r.integrationConfig)?void 0:v.avatarURL)?`${null==(y=r.integrationConfig)?void 0:y.avatarURL.split("#")[0]}#${M}`:void 0}:{},key:M})}),(0,eh.jsx)("div",{id:"extension"}),(0,eh.jsx)("div",{className:"memori-website_assistant-layout--controls",children:u&&c&&i&&a?(0,eh.jsx)(i,{...a}):s?(0,eh.jsx)(o,{...s,showFullDescriptionOnMobile:!0,showChatHistory:!1}):null})]}),t&&ee&&(0,eh.jsx)(Jx,{open:G,presentation:"popover",onClose:K,initialView:J?"location":null!=(_=null==(b=Q.directAction)?void 0:b.view)?_:"session",autoStartGeolocation:J&&!!t.autoStartPositionGeolocation,title:S("widget.mobileSession.session")||"Session",loginToken:t.loginToken,user:t.user,apiClient:t.apiClient,userName:q,userEmail:null==W?void 0:W.eMail,userInitial:q.charAt(0).toUpperCase(),avatarURL:null==W?void 0:W.avatarURL,birthDate:null==W?void 0:W.birthDate,actions:Y,showChatHistory:X,onChatHistoryOpen:Z,knownFactsPageTitle:S("knownFacts.title")||"Known facts",sharePageTitle:S("widget.share")||"Share",locationPageTitle:S("widget.mobileSession.locationTracking")||"Location tracking",backLabel:S("back")||"Back",shareContent:(0,eh.jsx)($C,{tenant:t.tenant,memori:t.memori,sessionID:t.sessionID,title:null==(x=t.memori)?void 0:x.name,baseUrl:t.baseUrl,align:"left",history:t.history,renderMode:"inline"}),knownFactsDisabled:!j,showKnownFacts:$,showMessageConsumption:!!t.showMessageConsumption,history:null!=(w=t.history)?w:[],isLoggedIn:!!W,showLogin:!!t.showLogin,loginLabel:S("login.login")||"Log in",onLogin:()=>{t.setShowLoginDrawer(!0),K()},onKnownFactsOpen:()=>{j&&(t.setShowKnownFactsDrawer(!0),K())},venue:t.position,setVenue:t.setVenue,logoutLabel:S("login.logout")||"Log out",onLogout:()=>{var e;null==(e=t.onLogout)||e.call(t),K()}})]})}),A&&(0,eh.jsx)(Gh,{})]})},em=ec("85Hg2"),JO=({Header:e,headerProps:t,Chat:n,chatProps:r,startPanelProps:i,sessionId:a,hasUserActivatedSpeak:o,StartPanel:s,onSidebarToggle:l})=>{var u,c;let{t:d}=tA(),[h,p]=(0,em.useState)(!1),[m,f]=(0,em.useState)(!1),g=(0,em.useRef)(null),{state:v,closeArtifact:y}=e9(),b=v.isDrawerOpen&&!v.isChatLogPanelPresentation,_=null==t?void 0:t.memori,x=null==t?void 0:t.tenant,w=null==t?void 0:t.baseUrl,S=(0,em.useMemo)(()=>{if(t)return{...t,showReload:!1,showClear:!1,showSettings:!1,showShare:!1,showLogin:!1,showMessageConsumption:!1,showFullscreen:!0,memori:{...t.memori,needsPosition:!1,enableDeepThought:!1},layout:"HIDDEN_CHAT",showChatHistory:!1}},[t]),E=!!(a&&o),A=_?_.avatarURL&&_.avatarURL.length>0?La({type:"avatar",tenantID:null==x?void 0:x.name,resourceURI:_.avatarURL,baseURL:w,apiURL:""}):La({type:"avatar",tenantID:null==x?void 0:x.name,baseURL:w,apiURL:""}):void 0,T=(0,em.useRef)({left:"",right:"",width:"",maxWidth:"",backgroundColor:""});(0,em.useEffect)(()=>{let e=()=>{!document.fullscreenElement&&m&&C()};return document.addEventListener("fullscreenchange",e),()=>{document.removeEventListener("fullscreenchange",e)}},[m]),(0,em.useEffect)(()=>{var e;let t=document.body,n=document.querySelector(".memori-widget"),r=n&&(null==(e=getComputedStyle(n).getPropertyValue("--memori-hidden-chat-width"))?void 0:e.trim())||"min(450px, 100vw)";h?m?(t.style.width="100%",t.style.marginLeft="0"):"u">typeof window&&window.matchMedia("(max-width: 768px)").matches?(t.style.width="100%",t.style.marginRight="0",t.style.marginLeft="0"):(t.style.width=`calc(100% - ${r})`,t.style.marginRight=r,t.style.transition="all 0.5s"):(t.style.width="100%",t.style.marginRight="0",t.style.marginLeft="0",y())},[h,m]);let I=()=>{m&&h&&(document.fullscreenElement&&document.exitFullscreen().catch(e=>{console.warn("[HiddenChatLayout] Error exiting fullscreen:",e)}),C());let e=!h;p(e),l&&l(e)},C=()=>{let e=g.current;e&&(e.style.left=T.current.left,e.style.right=T.current.right,e.style.width=T.current.width,e.style.maxWidth=T.current.maxWidth,e.style.backgroundColor=T.current.backgroundColor,e.classList.remove("memori-sidebar-fullscreen"),JM(e)),f(!1)};return(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsx)("input",{type:"checkbox",id:"memori-sidebar-toggle",className:`memori-sidebar-toggle ${b?"memori-sidebar-toggle-artifact":""}`,checked:h,onChange:I}),(0,eh.jsxs)("div",{className:"memori-sidebar-container",children:[(0,eh.jsx)("label",{htmlFor:"memori-sidebar-toggle",className:"memori-sidebar-toggle-label memori-open-label",children:(0,eh.jsx)(Ld,{className:"memori-icon","aria-label":null!=(u=d("expand"))?u:void 0})}),(0,eh.jsx)("aside",{ref:g,className:`memori-sidebar memori-chat-layout ${m?"memori-sidebar-fullscreen":""}`,children:(0,eh.jsxs)("div",{className:"memori-hidden-chat-layout--controls memori-chat-layout--controls",children:[(0,eh.jsx)("div",{className:"memori-chat-layout--header",children:e&&t&&(0,eh.jsxs)("div",{className:"memori-chat-layout--header-row",children:[_&&A&&(0,eh.jsxs)("div",{className:"memori-chat-layout--brand",children:[(0,eh.jsx)("img",{className:"memori-chat-layout--brand-avatar",src:A,alt:"",role:"presentation"}),(0,eh.jsx)("div",{className:"memori-chat-layout--brand-text",children:E&&(0,eh.jsx)("span",{className:"memori-chat-layout--brand-name",title:_.name,children:_.name})})]}),(0,eh.jsxs)("div",{className:"memori-hidden-chat-layout--header-actions",children:[S&&(0,eh.jsx)(e,{position:{latitude:0,longitude:0,placeName:""},...S,buttonVariant:"outline",fullScreenHandler:()=>{if(document.fullscreenElement)document.exitFullscreen&&document.exitFullscreen().catch(e=>{console.warn("[HiddenChatLayout] Error exiting fullscreen:",e)}),C();else{let e=g.current;e&&(T.current={left:e.style.left,right:e.style.right,width:e.style.width,maxWidth:e.style.maxWidth,backgroundColor:e.style.backgroundColor},e.style.left="0",e.style.right="0",e.style.width="100%",e.style.maxWidth="none",e.style.backgroundColor="",e.classList.add("memori-sidebar-fullscreen"),JC(e,e=>{console.warn("[HiddenChatLayout] Error enabling fullscreen:",e)})),f(!0)}}}),(0,eh.jsx)("button",{type:"button",className:"memori-website_assistant--close-button memori-hidden-chat-layout--header-close",onClick:I,"aria-label":d("collapse")||"Close",title:d("collapse")||"Close",children:(0,eh.jsx)(H2,{className:"memori-icon-close","aria-hidden":!0})})]})]})}),(0,eh.jsxs)("div",{className:"memori-chat-layout--body",children:[a&&o&&n&&r?(0,eh.jsx)(n,{...r}):i?(0,eh.jsxs)("div",{className:"memori-chat-layout--start-shell",children:[(0,eh.jsx)("div",{className:"memori-chat-layout--start-panel-wrap",children:(0,eh.jsx)(s,{...i})}),n&&r&&!1!==r.showInputs&&(0,eh.jsx)("div",{className:"memori-chat-layout--prechat-inputs",children:(0,eh.jsx)(Vo,{userMessage:r.userMessage,onChangeUserMessage:r.onChangeUserMessage,dialogState:r.dialogState,instruct:r.instruct,authToken:r.authToken,sendMessage:r.sendMessage,onMediumSelectedState:r.onMediumSelectedState,isTyping:r.memoriTyping,microphoneMode:r.microphoneMode,sendOnEnter:r.sendOnEnter,setSendOnEnter:r.setSendOnEnter,client:r.client,sessionID:E?r.sessionID:void 0,baseUrl:r.baseUrl,showUpload:r.showUpload,attachmentsMenuOpen:r.attachmentsMenuOpen,setAttachmentsMenuOpen:r.setAttachmentsMenuOpen,onTextareaFocus:()=>{var e;null==(e=r.stopListening)||e.call(r)},onTextareaBlur:()=>{},onTextareaExpanded:()=>{},startListening:r.startListening,stopListening:r.stopListening,audioStream:r.audioStream,transcribing:r.transcribing,stopAudio:r.stopAudio,listening:r.listening,isPlayingAudio:r.isPlayingAudio,showMicrophone:r.showMicrophone,memoriID:null==(c=r.memori)?void 0:c.memoriID,maxTextareaCharacters:r.maxTextareaCharacters,maxDocumentsPerMessage:kZ,maxDocumentContentLength:3e5,pasteAsCardLineThreshold:100,pasteAsCardCharThreshold:4200,showAiGeneratedNote:!1})})]}):(0,eh.jsx)("div",{className:"memori-loading",children:(0,eh.jsx)(bV,{spinning:!0})}),(0,eh.jsx)("div",{id:"extension"})]})]})})]}),b&&(0,eh.jsx)(Gh,{})]})},em=ec("85Hg2"),JP=({Header:e,headerProps:t,Avatar:n,avatarProps:r,Chat:i,chatProps:a,StartPanel:o,startPanelProps:s,integrationStyle:l,integrationBackground:u,sessionId:c,hasUserActivatedSpeak:d,loading:h=!1,poweredBy:p})=>{var m,f,g,v,y,b,_,x,w;let{t:S}=tA(),{state:E}=e9();E.currentArtifact;let A=E.isDrawerOpen&&!E.isChatLogPanelPresentation,[T,I]=(0,em.useState)(!1),[C,M]=(0,em.useState)(!1),{contentRowRef:N,isArtifactOverlay:R,isResizingArtifact:O,columnWidthStyle:P,resizeHandleProps:k}=Jw(A);(0,em.useEffect)(()=>{let e=window.matchMedia("(max-width: 768px)"),t=()=>I(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let D=null==t?void 0:t.memori;null==t||t.tenant,null==t||t.baseUrl;let B=(null==t?void 0:t.loginToken)&&(null==(m=null==t?void 0:t.user)?void 0:m.userID)?t.user:void 0,F=[null==B?void 0:B.name,null==B?void 0:B.surname].filter(Boolean).join(" ").trim()||(null==B?void 0:B.userName)||(null==B?void 0:B.eMail)||(null==D?void 0:D.name)||"User",U=F.charAt(0).toUpperCase(),j=!!(c&&d),z=(0,em.useMemo)(()=>(null==a?void 0:a.isPlayingAudio)?{key:"speaking",label:S("widget.agentStatusSpeaking",{defaultValue:"sta parlando"})}:(null==a?void 0:a.memoriTyping)?{key:"processing",label:S("widget.agentStatusProcessing",{defaultValue:"in elaborazione"})}:(null==a?void 0:a.listening)?{key:"listening",label:S("widget.agentStatusListening",{defaultValue:"in ascolto"})}:null,[null==a?void 0:a.isPlayingAudio,null==a?void 0:a.memoriTyping,null==a?void 0:a.listening,S]),H=(0,em.useCallback)(()=>{if(function(){if("u"<typeof document)return!1;if(!0===document.fullscreenEnabled)return!0;let e=document.querySelector('meta[name="memori-fullscreen-enabled"], meta[name="fullscreen-enabled"]');return(null==e?void 0:e.getAttribute("content"))==="true"}()){if(!document.fullscreenElement)return void document.documentElement.requestFullscreen().catch(()=>{});document.exitFullscreen().catch(()=>{})}},[]),G=(0,em.useMemo)(()=>{if(t)return T?{...t,showReload:!1,showClear:!1,showSettings:!1,showShare:!1,showLogin:!1,showFullscreen:!1,showMessageConsumption:!1,memori:{...t.memori,needsPosition:!1,enableDeepThought:!1},showChatHistory:!1}:t},[t,T]),V=(0,em.useMemo)(()=>{var e,n;if(!t)return[];let r=T&&!!t.loginToken&&!1!==t.showChatHistory,i=!T&&!1!==t.showFullscreen,a=!1!==t.showShare,o=!!(null==(e=t.memori)?void 0:e.needsPosition);return[...r?[{key:"chatHistory",icon:(0,eh.jsx)($t,{size:18}),title:S("widget.headerHistory")||S("write_and_speak.chatHistory")||"Chat history",onClick:()=>{t.setShowChatHistoryDrawer(!0),M(!1)}}]:[],...i?[{key:"fullscreen",icon:(0,eh.jsx)(Jd,{size:18}),title:S("fullscreenEnter")||"Full screen",subtitle:S("widget.expandToImmersive")||"Expand to immersive view",onClick:()=>{H(),M(!1)}}]:[],...a?[{key:"share",icon:(0,eh.jsx)($h,{size:18}),title:S("widget.share")||"Share chat",subtitle:S("widget.mobileSession.copyLinkOrDownload")||"Copy link or download",view:"share"}]:[],...o?[{key:"location",icon:(0,eh.jsx)(VS,{size:18}),title:S("widget.mobileSession.locationTracking")||"Location tracking",subtitle:(null==(n=t.position)?void 0:n.placeName)||S("widget.mobileSession.currentlyOff")||"Currently off",view:"location",trailing:(0,eh.jsx)("span",{className:"memori-mobile-session-panel--chevron",children:">"})}]:[]]},[t,T,j,S,H]),W=!!(null==(f=null==t?void 0:t.memori)?void 0:f.enableDeepThought)&&!!(null==t?void 0:t.loginToken)&&!!(null==(g=null==t?void 0:t.user)?void 0:g.pAndCUAccepted),q=Jb({actions:V,loginToken:null==t?void 0:t.loginToken,showKnownFacts:W,showMessageConsumption:!!(null==t?void 0:t.showMessageConsumption),history:null==t?void 0:t.history,isLoggedIn:!!B,showLogin:!!(null==t?void 0:t.showLogin)});return(0,eh.jsxs)(eh.Fragment,{children:[l,u,(0,eh.jsxs)(bV,{spinning:!!(h&&j),children:[e&&t&&G&&(0,eh.jsx)("div",{className:"memori-fullpage-top-header",children:(0,eh.jsx)("div",{className:"memori-chat-layout--header",children:(0,eh.jsx)("div",{className:"memori-fullpage-header-row",children:(0,eh.jsx)(e,{...G,layout:"FULLPAGE",buttonVariant:"outline",extraActions:T?(0,eh.jsx)(J_,{entries:q,open:C,onToggle:()=>M(e=>!e)}):void 0})})})}),t&&(0,eh.jsx)(Jx,{open:C,presentation:"popover",onClose:()=>M(!1),initialView:null!=(y=null==(v=q.directAction)?void 0:v.view)?y:"session",title:S("widget.mobileSession.session")||"Session",loginToken:t.loginToken,user:t.user,apiClient:t.apiClient,userName:F,userEmail:null==B?void 0:B.eMail,userInitial:U,avatarURL:null==B?void 0:B.avatarURL,birthDate:null==B?void 0:B.birthDate,actions:V,knownFactsPageTitle:S("knownFacts.title")||"Known facts",sharePageTitle:S("widget.share")||"Share",locationPageTitle:S("widget.mobileSession.locationTracking")||"Location tracking",backLabel:S("back")||"Back",locationStatusLabel:S("widget.mobileSession.locationStatus")||"Status",locationPlace:null==(b=t.position)?void 0:b.placeName,locationUnknownLabel:S("write_and_speak.unknownPosition")||"Unknown position",locationEnableLabel:S("widget.shareLocation")||"Share location",locationDisableLabel:S("widget.mobileSession.disableLocationSharing")||"Disable location sharing",knownFactsDescription:S("knownFacts.description",{memoriName:(null==D?void 0:D.name)||""})||"",knownFactsCtaLabel:S("widget.mobileSession.openKnownFacts")||"Open full known facts",knownFactsCountLabel:S("widget.mobileSession.knownFactsMessages",{count:(null==(_=t.history)?void 0:_.length)||0})||"",shareContent:(0,eh.jsx)($C,{tenant:null==t?void 0:t.tenant,memori:null==t?void 0:t.memori,sessionID:null==t?void 0:t.sessionID,title:null==(x=null==t?void 0:t.memori)?void 0:x.name,baseUrl:null==t?void 0:t.baseUrl,align:"left",history:null==t?void 0:t.history,renderMode:"inline"}),knownFactsDisabled:!j,showKnownFacts:W,showMessageConsumption:!!t.showMessageConsumption,history:null!=(w=t.history)?w:[],isLoggedIn:!!B,showLogin:!!t.showLogin,loginLabel:S("login.login")||"Log in",onLogin:()=>{t.setShowLoginDrawer(!0),M(!1)},onKnownFactsOpen:()=>{j&&(t.setShowKnownFactsDrawer(!0),M(!1))},onLocationEnable:()=>{if(t){if(!navigator.geolocation)return void t.setPositionPopoverOpen(!0);navigator.geolocation.getCurrentPosition(e=>{let n=e.coords.latitude,r=e.coords.longitude;t.setVenue({latitude:n,longitude:r,placeName:`${n.toFixed(5)}, ${r.toFixed(5)}`,uncertainty:e.coords.accuracy/1e3})},()=>{t.setPositionPopoverOpen(!0)},{enableHighAccuracy:!0,timeout:15e3,maximumAge:0})}},onLocationDisable:()=>{null==t||t.setVenue({latitude:0,longitude:0,placeName:"",uncertainty:0})},venue:t.position,setVenue:t.setVenue,logoutLabel:S("login.logout")||"Log out",onLogout:()=>{(()=>{if(t){if(B&&t.onLogout)return t.onLogout();t.setShowLoginDrawer(!0)}})(),M(!1)}}),(0,eh.jsxs)("div",{ref:N,className:`memori-fullpage-content-row${A&&R?" memori-fullpage-content-row--artifact-overlay":""}${O?" memori-fullpage-content-row--resizing":""}`,style:P,children:[(0,eh.jsxs)("div",{className:"memori--grid",children:[(0,eh.jsxs)("div",{className:"memori--grid-column memori--grid-column-left",hidden:A,children:[j&&z&&(0,eh.jsxs)("div",{className:"memori-fullpage-agent-status",role:"status","aria-live":"polite",children:[(0,eh.jsx)("span",{className:`memori-fullpage-agent-status--dot memori-fullpage-agent-status--dot-${z.key}`,"aria-hidden":"true"}),(0,eh.jsx)("span",{className:"memori-fullpage-agent-status--label",children:z.label})]}),n&&r&&(0,eh.jsx)(n,{chatProps:a,isZoomed:!0,...r}),(0,eh.jsx)("div",{id:"extension"})]}),(0,eh.jsx)("div",{className:"memori-chat-layout--main",children:(0,eh.jsx)("div",{className:E.isFullscreen?"memori-chat-layout-controls-hide":"memori-chat-layout--controls",children:c&&d&&i&&a?(0,eh.jsx)(i,{...a,footerBrand:p,showAiGeneratedNote:!0}):s?(0,eh.jsx)("div",{className:"memori-conversation-column",children:(0,eh.jsx)(o,{...s,footerBrand:p})}):null})})]}),(0,eh.jsx)("div",{className:`memori--grid-column-artifact${A?" memori--grid-column-artifact--open":""}`,children:A&&(0,eh.jsxs)(eh.Fragment,{children:[!T&&(0,eh.jsx)("div",{className:"memori-artifact-resize-handle",...k}),(0,eh.jsx)(Gh,{isLayoutColumn:!0})]})})]})]})]})};let Jk={IT:{MALE:"it-IT-DiegoNeural",FEMALE:"it-IT-ElsaNeural"},DE:{MALE:"de-DE-ConradNeural",FEMALE:"de-DE-KatjaNeural"},EN:{MALE:"en-GB-RyanNeural",FEMALE:"en-GB-SoniaNeural"},ES:{MALE:"es-ES-AlvaroNeural",FEMALE:"es-ES-ElviraNeural"},FR:{MALE:"fr-FR-HenriNeural",FEMALE:"fr-FR-DeniseNeural"},PT:{MALE:"pt-PT-DuarteNeural",FEMALE:"pt-PT-RaquelNeural"},UK:{MALE:"uk-UA-OstapNeural",FEMALE:"uk-UA-PolinaNeural"},RU:{MALE:"ru-RU-DmitryNeural",FEMALE:"ru-RU-SvetlanaNeural"},PL:{MALE:"pl-PL-MarekNeural",FEMALE:"pl-PL-AgnieszkaNeural"},FI:{MALE:"fi-FI-HarriNeural",FEMALE:"fi-FI-SelmaNeural"},EL:{MALE:"el-GR-NestorasNeural",FEMALE:"el-GR-AthinaNeural"},AR:{MALE:"ar-SA-HamedNeural",FEMALE:"ar-SA-ZariyahNeural"},ZH:{MALE:"zh-CN-YunxiNeural",FEMALE:"zh-CN-XiaoxiaoNeural"},JA:{MALE:"ja-JP-KeitaNeural",FEMALE:"ja-JP-NanamiNeural"}},JL={MALE:"en-US-GuyNeural",FEMALE:"en-US-JennyNeural"},JD={DEFAULT:{MALE:"onyx",FEMALE:"nova",NEUTRAL:"alloy"},IT:{MALE:"echo",FEMALE:"nova"},ES:{MALE:"echo",FEMALE:"shimmer"},FR:{MALE:"echo",FEMALE:"fable"},PT:{MALE:"onyx",FEMALE:"shimmer"},DE:{MALE:"onyx",FEMALE:"fable"},EN:{MALE:"echo",FEMALE:"nova"},ZH:{MALE:"echo",FEMALE:"shimmer"},JA:{MALE:"echo",FEMALE:"nova"},RU:{MALE:"onyx",FEMALE:"fable"}};JL.FEMALE;function JB({text:e,preview:t=!1,...n}){return!!(e&&e.trim()&&!t&&!function({defaultEnableAudio:e,defaultSpeakerActive:t,autoStart:n,speakerMuted:r,storedMute:i}){return!e||!!r||!0===i||!1!==i&&(!e||!t||n)}(n))}function JF(e,t){return 422===e&&/empty password/i.test(null!=t?t:"")}class JU extends Error{constructor(e,t){super(e),this.name="CreditsCheckError",this.status=t}}let Jj=async({operation:e="session_creation",baseUrl:t,userID:n,engineMemoriID:r,tenant:i,characters:a})=>{if(!n&&!r)throw new JU("Either userID or engineMemoriID must be provided");if("import_document"===e&&null==a)throw new JU("characters must be provided for import_document");let o=await fetch(`${t}/api/verify-tokens`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operation:e,...n?{userID:n}:{},...r?{engineMemoriID:r}:{},tenant:i,..."import_document"===e?{characters:a}:{}})});if(!o.ok)throw new JU("Failed to fetch credits",o.status);return o.json()};var em=ec("85Hg2");class Jz extends Error{constructor(e,t,n){super(e),this.name="SpeechRequestError",this.status=t,this.code=n}}function JH(e){let t=e.sessionIdRef?e.sessionIdRef.current:e.sessionId,n=null==t?void 0:t.trim();if(!n)throw new Jz("Missing required parameter: sessionId",401,"missing_session");return n}function JG(e,t,n){let r,i=t?t.trim().toLowerCase().replace(/^https?:\/\//,"").split("/")[0].split(":")[0]:"";if(!i)return;let a=null!=n?n:"u">typeof window?window.location.href:"http://localhost",o="";try{o=new URL(e,a).hostname.toLowerCase()}catch(e){return i}return!(r=o)||"localhost"===r||"127.0.0.1"===r||r.endsWith(".localhost")||i===o?i:void 0}async function JV(e){let t=await e.json().catch(()=>({})),n="string"==typeof t.error&&t.error.length>0?t.error:`API error: ${e.status}`,r="string"==typeof t.code?t.code:void 0;return new Jz(n,e.status,r)}let JW={missing_session:"errors.speechMissingSession",invalid_session:"errors.speechInvalidSession",tenant_mismatch:"errors.speechTenantMismatch",rate_limited:"errors.speechRateLimited"};var em=ec("85Hg2");let Jq=100,J$=["hello","hi","hey","good morning","good afternoon","good evening","thanks","thank you","thx","tnx","ty","thanks!","thank you!","ok","okay","k","yes","no","yep","nope","yeah","nah","good","great","nice","cool","awesome","perfect","excellent","bye","goodbye","see you","see ya","later","good night","how are you","how are you doing","what's up","sup","please","pls","sorry","excuse me","pardon","i see","i understand","got it","gotcha","understood","continue","go on","tell me more","more","next","start","begin","let's start","let's begin","help","can you help","i need help","test","testing","test message","?","??","???","!","!!","!!!","...","..",".","a","an","the","and","or","but","in","on","at","to","for","of","with","by","ciao","salve","buongiorno","buonasera","buonanotte","grazie","grazie mille","grazie!","grazie mille!","va bene","va bene così","perfetto","ottimo","bene","sì","si","certo","certamente","assolutamente","arrivederci","a presto","a dopo","ci vediamo","addio","come stai","come va","tutto bene","che succede","per favore","per piacere","scusa","scusami","mi dispiace","capisco","ho capito","capito","continua","vai avanti","dimmi di più","altro","altro ancora","inizia","iniziamo","comincia","cominciamo","aiuto","puoi aiutarmi","ho bisogno di aiuto","prova","messaggio di prova","un","una","il","la","gli","le","e","o","ma","su","per","di","con","da"],JJ=e=>{let t=new Date(e);return t.setHours(0,0,0,0),t},JK=e=>{let t=null;for(let n of e){let e=Jo(n.timestamp);e&&(!t||e.getTime()>t.getTime())&&(t=e)}return t},JY=(e,t=new Date)=>{let n,r;return e.getTime()>=(r=(n=JJ(t)).getDay(),n.setDate(n.getDate()-(r+6)%7),n).getTime()?{type:"thisWeek"}:{type:"month",year:e.getFullYear(),month:e.getMonth()}};var em=ec("85Hg2");let JX={memoriID:"chat-resume-drawer",name:"AI",culture:"it-IT",coverURL:"",avatarURL:"",enableBoardOfExperts:!1},JZ=()=>{};var JQ=({isOpen:e,onClose:t,embedded:n=!1,session:r,isLoading:i=!1,showFunctionCache:a=!1,showMessageConsumption:o=!1,memori:s=JX})=>{let l=(0,em.useMemo)(()=>r.messages.map(e=>{let t=e.attachment?`<document_attachment filename="${e.attachment.name.replaceAll('"',"&quot;")}" type="${e.attachment.type.replaceAll('"',"&quot;")}"></document_attachment>`:"",n="assistant"===e.role&&"interrupted"===e.status?"Risposta interrotta - sessione in pausa":e.content;return{fromUser:"user"===e.role,text:`${n}${t}`,timestamp:e.timestamp,media:e.media||[]}}),[r.messages]),u=(0,eh.jsxs)("div",{className:"memori-chat-resume-drawer--thread",children:[i&&(0,eh.jsx)("div",{className:"memori-chat-resume-drawer--skeletons",children:[0,1,2].map(e=>(0,eh.jsx)("div",{className:"memori-chat-resume-drawer--skeleton-bubble"},e))}),!i&&(0,eh.jsx)("div",{className:"memori-chat-resume-drawer--embedded-chat",children:(0,eh.jsx)(Vx,{memori:s,sessionID:"chat-resume-drawer",history:l,pushMessage:JZ,simulateUserPrompt:JZ,setSendOnEnter:JZ,setAttachmentsMenuOpen:JZ,onChangeUserMessage:JZ,sendMessage:JZ,setEnableFocusChatInput:JZ,stopAudio:JZ,startListening:JZ,stopListening:JZ,showInputs:!1,showAIicon:!0,showCopyButton:!0,isHistoryView:!0,isChatlogPanel:!0,showFunctionCache:a,showMessageConsumption:o})})]});return n?e?(0,eh.jsx)("div",{className:"memori-chat-resume-drawer--embedded-shell",children:u}):null:(0,eh.jsx)(xf,{open:e,onClose:t,className:"memori-chat-resume-drawer",anchor:"right",size:"md",showCloseButton:!1,title:Le(r.title),children:u})};let J0=e=>{let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),o=String(e.getSeconds()).padStart(2,"0"),s=String(e.getMilliseconds()).padStart(3,"0");return`${t}${n}${r}${i}${a}${o}${s}`},J1=e=>{var t,n,r,i;return!((null==(t=e.properties)?void 0:t.functionSignature)||(null==(n=e.properties)?void 0:n.functionCache))&&!(null!=(i=null==(r=e.mimeType)?void 0:r.startsWith("image/"))&&i)},J2=async(e,t,n,r)=>{try{return await Promise.all(e.map(async e=>({...e,lines:await Promise.all(e.lines.map(async e=>{if(!e.text)return e;try{let i=await GP(e.text,n,t,r);return{...e,originalText:e.text,text:i.text}}catch(t){return console.error("Error translating line:",t),e}}))})))}catch(t){return console.error("Error translating chat logs:",t),e}},J3=(e,t=!0)=>(({lines:e,truncate:t=!0})=>{let n=e.filter(e=>e.inbound);if(0===n.length)return"";let r=n.map((e,t)=>{let n=Le(Hl(e.text||""));return{text:n,score:(e=>{let t=e.toLowerCase().trim();if(J$.includes(t))return 0;let n=t.split(/\s+/).filter(e=>e.length>0).length;if(n<3||t.length<5)return .1;let r=/\?$/.test(t)||/^(what|how|why|when|where|who|which|can|could|would|will|do|does|did|is|are|was|were)/.test(t)||/^(cosa|come|perché|perche|quando|dove|chi|quale|quali|può|puo|potrebbe|vorrebbe|sarà|sara|fa|fai|fanno|è|e|sono|era|erano)/.test(t),i=.5;return r&&(i+=.3),n>5&&(i+=.2),n>10&&(i+=.2),n>20&&(i-=.1),/\d/.test(t)&&(i+=.1),/[A-ZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞŸ][a-zàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ]+/.test(e)&&(i+=.1),Math.min(i,1)})(n),index:t}});r.sort((e,t)=>.1>Math.abs(e.score-t.score)?e.index-t.index:t.score-e.score);let i=r[0];return t?((e,t=Jq)=>{if(e.length<=t)return e;let n=e.substring(0,t),r=n.lastIndexOf(" ");return r>.7*t?`${n.substring(0,r)}...`:`${n}...`})(i.text):i.text})({title:e.title,lines:e.lines,truncate:t});var J4=({open:e,onClose:t,apiClient:n,sessionId:r,memori:i,resumeSession:a,baseUrl:o,language:s,userLang:l,isMultilanguageEnabled:u=!1,showFunctionCache:c=!1,showMessageConsumption:d=!1,loginToken:h})=>{let{t:p,i18n:m}=tA(),{getUserChatLogsByTokenPaged:f}=n.chatLogs,[g,v]=(0,em.useState)([]),[y,_]=(0,em.useState)(null),[x,w]=(0,em.useState)(""),S=k2(x,300),[E,A]=(0,em.useState)(!1),[T,I]=(0,em.useState)("all"),[C,M]=(0,em.useState)(3),[N,R]=(0,em.useState)(1),[O,P]=(0,em.useState)(!1),[k,D]=(0,em.useState)(!1),[B,F]=(0,em.useState)(null),[U,j]=(0,em.useState)(0),z=(0,em.useMemo)(()=>{let e=0;return"all"!==T&&(e+=1),3!==C&&(e+=1),e},[T,C]),H=(0,em.useCallback)(async({from:e=0,append:t=!1}={})=>{var n,r;if(!h)return void F(p("errorFetchingSession")||"Login token required to fetch chat history");t?D(!0):P(!0),F(null);try{let a="all"===T?void 0:(e=>{let t=new Date;if("today"===e)return{dateFrom:J0(new Date(t.getFullYear(),t.getMonth(),t.getDate()-1)),dateTo:J0(t)};if("yesterday"===e){let e=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1);return{dateFrom:J0(new Date(e.getFullYear(),e.getMonth(),e.getDate()-2)),dateTo:J0(e)}}return"last_7_days"===e?{dateFrom:J0(new Date(t.getFullYear(),t.getMonth(),t.getDate()-7)),dateTo:J0(t)}:{dateFrom:J0(new Date(t.getFullYear(),t.getMonth(),t.getDate()-30)),dateTo:J0(t)}})(T),c=await f({loginToken:h,memoriID:i.engineMemoriID,from:e,howMany:8,filter:S,dateFrom:null==a?void 0:a.dateFrom,dateTo:null==a?void 0:a.dateTo,minimumMessagesPerChat:0===C?N:C}),d=c.chatLogs||[];s.toUpperCase()!==l.toUpperCase()&&u&&(d=await J2(d,s,l,o));let p=null!=(r=null!=(n=c.count)?n:c.totalItems)?r:d.length;j(p),v(e=>t?[...e,...d]:d)}catch(e){F(p("errorFetchingSession")||"Error loading chat history"),console.error("Error fetching chat logs:",e)}finally{P(!1),D(!1)}},[h,i.engineMemoriID,S,T,C,N,s,l,u,o,f]);(0,em.useEffect)(()=>{e||(_(null),w(""),A(!1),I("all"),M(3),R(1))},[e]),(0,em.useEffect)(()=>{e&&H({from:0})},[e,H]);let G=e=>{var t,n;let r,a,o;t=`${p("write_and_speak.conversationStartedLabel")} ${new Intl.DateTimeFormat(m.language,{dateStyle:"short",timeStyle:"short"}).format(new Date)}
1069
1069
 
1070
- `.concat(e.lines.map(e=>`${e.inbound?"YOU":i.name}: ${Hl(Le(e.text||""))}`).join("\n")),n=`${i.name.replace(/\W+/g,"-")}-chat-${e.chatLogID.substring(0,4)}.txt`,r=new Blob([t],{type:"text/plain"}),a=URL.createObjectURL(r),(o=document.createElement("a")).setAttribute("href",a),o.setAttribute("download",n),o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},V=()=>{y&&(a(y),t())},W=e=>{let t,n=JJ(e.lines);return[n?((e,t,n=new Date)=>{let r=Jo(e);if(!r)return"";let i=new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit"}).format(r),a=Math.round((J$(r).getTime()-J$(n).getTime())/864e5);if(0===a||-1===a){let e=new Intl.RelativeTimeFormat(t,{numeric:"auto"}).format(a,"day");return`${e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:e}, ${i}`}let o=new Intl.DateTimeFormat(t,{day:"numeric",month:"short",...r.getFullYear()===n.getFullYear()?{}:{year:"numeric"}}).format(r);return`${o}, ${i}`})(n,m.language):"",(t=e.lines.length,`${t} ${1===t?p("write_and_speak.message")||"message":p("write_and_speak.messages")||"messages"}`)].filter(Boolean).join(" · ")},q=y?J2(y,!1)||`Chat-${y.chatLogID.substring(0,4)}`:"",$=(0,em.useMemo)(()=>{if(!y)return null;let e=y.lines.some(e=>{var t;return!e.inbound&&!(null==(t=e.text)?void 0:t.trim())});return{title:q,subtitle:W(y),summary:"",messages:y.lines.map((t,n)=>{var r,i;let a,o,s=t.inbound?(t.media||[]).find(J0):void 0;return{id:`${y.chatLogID}-${n}`,role:t.inbound?"user":"assistant",content:t.text||"",timestamp:t.timestamp,media:(t.media||[]).map((e,t)=>({...e,mediumID:e.mediumID||`${y.chatLogID}-${n}-${t}`})),status:t.inbound||(null==(r=t.text)?void 0:r.trim())||!e?"completed":"interrupted",attachment:s?(o=HF(a=s.title||(null==(i=s.url)?void 0:i.split("/").pop())||"Attachment file",s.mimeType),{name:a,type:o,size:"2.4 KB",ext:HG(o,a,s.url)}):void 0}}),quickActions:[]}},[y,q,m.language,p]),J=(0,em.useMemo)(()=>((e,t,n=new Date)=>{let r=[];for(let i of e){let e=t(i);if(!e)continue;let a=JK(e,n),o=r[r.length-1];o&&("thisWeek"===a.type&&"thisWeek"===o.key.type||"month"===a.type&&"month"===o.key.type&&a.year===o.key.year&&a.month===o.key.month)?o.items.push(i):r.push({key:a,items:[i]})}return r})(g,e=>JJ(e.lines)),[g]),K=!O&&!B&&0===U&&!S,Y=!O&&!B&&!K&&0===g.length,X=g.length<U,Z=!!(y&&$),Q=Z||K||O?void 0:(0,eh.jsx)(Hf,{start:(0,eh.jsx)("span",{className:"memori-chat-history-drawer--count",children:p("write_and_speak.shownOfTotal",{shown:g.length,total:U})}),end:X?(0,eh.jsx)(yt,{variant:"outline",loading:k,disabled:k,icon:(0,eh.jsx)(Hg,{"aria-hidden":!0}),iconPosition:"right",onClick:()=>void H({from:g.length,append:!0}),children:p("write_and_speak.loadMore")||p("knownFacts.loadMore")}):void 0}),ee=Z?(0,eh.jsx)(Hf,{children:(0,eh.jsx)(yt,{className:"memori-chat-history-drawer--resume-cta",variant:"primary",onClick:V,children:p("chatResume.resume",{defaultValue:"Resume conversation"})})}):void 0,et=Z?(0,eh.jsxs)("span",{className:"memori-chat-history-drawer--heading",children:[(0,eh.jsx)(yt,{variant:"ghost",shape:"circle",size:"sm",type:"button",className:"memori-chat-history-drawer--heading-button","aria-label":p("write_and_speak.backToConversationList")||"Back to the list",title:p("write_and_speak.backToConversationList")||"Back to the list",icon:(0,eh.jsx)(Jp,{"aria-hidden":!0}),onClick:()=>_(null)}),(0,eh.jsxs)("span",{className:"memori-chat-history-drawer--heading-text",children:[(0,eh.jsx)(_H,{title:q,placement:"bottom-start",children:(0,eh.jsx)("span",{className:"memori-chat-history-drawer--heading-title",children:q})}),(0,eh.jsx)("span",{className:"memori-chat-history-drawer--heading-meta",children:null==$?void 0:$.subtitle})]}),(0,eh.jsx)(Gc,{type:"button",className:"memori-chat-history-drawer--heading-button","aria-label":p("write_and_speak.downloadThisConversation")||"Download this conversation",title:p("write_and_speak.downloadThisConversation")||"Download this conversation",icon:(0,eh.jsx)(H5,{"aria-hidden":!0}),onClick:()=>y&&G(y)})]}):p("write_and_speak.chatHistory")||"Chat history";return(0,eh.jsx)(Hm,{open:e,size:"md",width:"45rem",className:(b(tT))("memori-chat-history-drawer",{"memori-chat-history-drawer--detail":Z}),title:et,closeLabel:p("close")||"Close",footer:Z?ee:Q,onClose:t,children:Z&&$?(0,eh.jsx)(JZ,{embedded:!0,isOpen:!0,session:$,memori:i,onResume:V,onClose:()=>_(null),onExportChat:()=>y&&G(y),showFunctionCache:c,showMessageConsumption:d}):(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsxs)("div",{className:"memori-chat-history-drawer--toolbar",children:[(0,eh.jsx)("div",{className:"memori-chat-history-drawer--toolbar-row",children:(0,eh.jsxs)("div",{className:"memori-chat-history-drawer--search",children:[(0,eh.jsx)("label",{className:"sr-only",htmlFor:"memori-chat-history-search",children:p("write_and_speak.searchInChatHistory")}),(0,eh.jsx)(xM,{id:"memori-chat-history-search",fullWidth:!0,prefix:(0,eh.jsx)(Ji,{"aria-hidden":!0}),value:x,placeholder:p("write_and_speak.searchInChatHistory")||"",onValueChange:w})]})}),(0,eh.jsx)(yt,{variant:"ghost",type:"button",className:"memori-chat-history-drawer--filters-toggle","aria-expanded":E,icon:(0,eh.jsx)(Hg,{"aria-hidden":!0,className:(b(tT))("memori-chat-history-drawer--filters-chevron",E&&"memori-chat-history-drawer--filters-chevron--open")}),iconPosition:"right",onClick:()=>A(e=>!e),children:(0,eh.jsxs)("span",{className:"memori-chat-history-drawer--filters-toggle-label",children:[p("write_and_speak.filters"),z>0&&(0,eh.jsx)("span",{className:"memori-chat-history-drawer--filters-count","aria-label":String(z),children:z})]})}),E&&(0,eh.jsxs)("div",{className:"memori-chat-history-drawer--filters",children:[(0,eh.jsx)(x3,{className:"memori-chat-history-drawer--filters-select",value:T,displayValue:"all"===T?p("all")||"All":p(T),onChange:e=>{e&&I(e)},options:[{label:p("all")||"All",value:"all"},{label:p("today")||"Today",value:"today"},{label:p("yesterday")||"Yesterday",value:"yesterday"},{label:p("last_7_days")||"Last 7 days",value:"last_7_days"},{label:p("last_30_days")||"Last 30 days",value:"last_30_days"}]}),(0,eh.jsxs)("div",{className:"memori-chat-history-drawer--filters-messages",children:[(0,eh.jsx)(x3,{className:"memori-chat-history-drawer--filters-select",value:String(C),displayValue:0===C?p("chatLogs.customMinimumMessages")||"Customize the number of messages":p("chatLogs.atLeast"+C)||`At least ${C} messages`,onChange:e=>{M(e?Number(e):0)},options:[{value:"1",label:p("chatLogs.anyMessage")||"Any message"},{value:"2",label:p("chatLogs.atLeast2")||"At least 2 messages"},{value:"3",label:p("chatLogs.atLeast3")||"At least 3 messages"},{value:"5",label:p("chatLogs.atLeast5")||"At least 5 messages"},{value:"10",label:p("chatLogs.atLeast10")||"At least 10 messages"},{value:"15",label:p("chatLogs.atLeast15")||"At least 15 messages"},{value:"20",label:p("chatLogs.atLeast20")||"At least 20 messages"},{value:"0",label:p("chatLogs.customMinimumMessages")||"Customize the number of messages"}]}),0===C&&(0,eh.jsx)("input",{type:"number",min:1,value:N,onChange:e=>{R(parseInt(e.target.value,10)||1)},className:"memori-chat-history-drawer--filters-custom","aria-label":p("chatLogs.customMinimumMessages")||"Customize the number of messages"})]})]})]}),O&&(0,eh.jsxs)("div",{className:"memori-chat-history-drawer--loading",children:[(0,eh.jsx)(bV,{spinning:!0,primary:!0}),(0,eh.jsx)("p",{children:p("write_and_speak.loadingChatHistory")||"Loading chat history..."})]}),B&&(0,eh.jsx)("div",{className:"memori-chat-history-drawer--error",role:"alert",children:(0,eh.jsx)("p",{children:B})}),K&&(0,eh.jsx)(Hp,{icon:(0,eh.jsx)($t,{}),title:p("write_and_speak.noChatHistoryAvailable")||"No chat history available"}),Y&&(0,eh.jsx)(Hp,{icon:(0,eh.jsx)(Ji,{}),title:p("write_and_speak.noResultsFound",{searchText:S})}),!O&&!B&&J.length>0&&(0,eh.jsx)("div",{className:"memori-chat-history-drawer--groups",children:J.map(e=>(0,eh.jsxs)("section",{className:"memori-chat-history-drawer--group",children:[(0,eh.jsx)("h3",{className:"memori-chat-history-drawer--group-label",children:(e=>{if("thisWeek"===e.type)return p("write_and_speak.thisWeek")||"This week";let t=new Intl.DateTimeFormat(m.language,{month:"long",...e.year===new Date().getFullYear()?{}:{year:"numeric"}}).format(new Date(e.year,e.month,1));return t.charAt(0).toUpperCase()+t.slice(1)})(e.key)}),(0,eh.jsx)("ul",{className:"memori-chat-history-drawer--list","aria-label":p("write_and_speak.chatHistory")||"Chat history",children:e.items.map(e=>{let t=J2(e)||`Chat-${e.chatLogID.substring(0,4)}`,n=e.sessionID===r,i=W(e),a=JJ(e.lines);return(0,eh.jsx)("li",{children:(0,eh.jsxs)("div",{className:(b(tT))("memori-chat-history-drawer--list-item",{"memori-chat-history-drawer--list-item--disabled":n}),children:[(0,eh.jsx)("button",{type:"button",className:"memori-chat-history-drawer--list-item-main","aria-disabled":n||void 0,"aria-label":t,disabled:n,onClick:()=>{n||_(e)},children:(0,eh.jsxs)("span",{className:"memori-chat-history-drawer--list-item--content",children:[(0,eh.jsx)("span",{className:"memori-chat-history-drawer--list-item--title",title:t,children:t}),(0,eh.jsxs)("span",{className:"memori-chat-history-drawer--list-item--meta",children:[a&&(0,eh.jsx)("time",{dateTime:a.toISOString(),children:i}),!a&&i]})]})}),(0,eh.jsx)(HM,{"aria-hidden":!0,className:"memori-chat-history-drawer--list-item-chevron"})]})},e.chatLogID)})})]},"thisWeek"===e.key.type?"thisWeek":`${e.key.year}-${e.key.month}`))})]})})};async function J4(e){return new Promise((t,n)=>{let r=window.AudioContext||window.webkitAudioContext;if(!r)return void n(Error("AudioContext not supported in this browser"));let i=new r,a=new FileReader;a.onload=async()=>{try{let e=a.result;"suspended"===i.state&&await i.resume();let n=await i.decodeAudioData(e),r=function(e){let t=e.length,n=e.sampleRate,r=e.numberOfChannels,i=new ArrayBuffer(44+t*r*2),a=new DataView(i),o=(e,t)=>{for(let n=0;n<t.length;n++)a.setUint8(e+n,t.charCodeAt(n))};o(0,"RIFF"),a.setUint32(4,36+t*r*2,!0),o(8,"WAVE"),o(12,"fmt "),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,r,!0),a.setUint32(24,n,!0),a.setUint32(28,n*r*2,!0),a.setUint16(32,2*r,!0),a.setUint16(34,16,!0),o(36,"data"),a.setUint32(40,t*r*2,!0);let s=44;for(let n=0;n<t;n++)for(let t=0;t<r;t++){let r=Math.max(-1,Math.min(1,e.getChannelData(t)[n]));a.setInt16(s,r<0?32768*r:32767*r,!0),s+=2}return new Blob([i],{type:"audio/wav"})}(n);await i.close(),t(r)}catch(e){n(e)}},a.onerror=()=>{n(Error("Failed to read audio file"))},a.readAsArrayBuffer(e)})}var em=(ec("85Hg2"),ec("85Hg2"));function J5(e,...t){for(let n of t){let t=e[n];if("string"==typeof t&&t.length>0)return t}}async function J6(e,t,n){if(!t)throw Error("Missing sessionId for NATS config request");let r=await fetch(`${e}/api/nats?sessionId=${encodeURIComponent(t)}`,{signal:n});if(!r.ok){let e=await r.json().catch(()=>({}));switch(r.status){case 400:throw Error(e.error||"NATS config error: missing sessionId");case 404:throw Error(e.error||"NATS config error: invalid session");case 500:throw Error(e.error||"NATS config error: NATS configuration missing");default:throw Error(e.error||`NATS config error: ${r.status}`)}}return function(e){let t=J5(e,"url"),n=J5(e,"token");if(!t||!n)throw Error("Invalid response from NATS config service");let r=function(e,...t){for(let n of t){let t=e[n];if("boolean"==typeof t)return t}}(e,"useJetStream","use_jetstream"),i=J5(e,"stream","streamName","stream_name"),a=J5(e,"consumer","consumerName","consumer_name","durableName","durable_name"),o=J5(e,"subject","filterSubject","filter_subject");if(r&&!i)throw Error("Invalid response from NATS config service: JetStream enabled but stream missing");return{url:t,token:n,...i?{stream:i}:{},...a?{consumer:a}:{},...o?{subject:o}:{}}}(await r.json())}"use strict";"use strict";var em=ec("85Hg2"),J8={};Object.defineProperty(J8,"__esModule",{value:!0}),J8.wsconnect=J8.usernamePasswordAuthenticator=J8.UserAuthenticationExpiredError=J8.tokenAuthenticator=J8.TimeoutError=J8.syncIterator=J8.RequestError=J8.ProtocolError=J8.PermissionViolationError=J8.nuid=J8.Nuid=J8.NoRespondersError=J8.nkeys=J8.nkeyAuthenticator=J8.nanos=J8.MsgHdrsImpl=J8.millis=J8.Metric=J8.Match=J8.jwtAuthenticator=J8.InvalidSubjectError=J8.InvalidOperationError=J8.InvalidArgumentError=J8.headers=J8.hasWsProtocol=J8.errors=J8.Empty=J8.DrainingConnectionError=J8.delay=J8.deferred=J8.deadline=J8.credsAuthenticator=J8.createInbox=J8.ConnectionError=J8.ClosedConnectionError=J8.canonicalMIMEHeaderKey=J8.buildAuthenticator=J8.Bench=J8.backoff=J8.AuthorizationError=void 0;"use strict";var J7={},J9=J7&&J7.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),Ke=J7&&J7.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||J9(t,e,n)};Object.defineProperty(J7,"__esModule",{value:!0}),J7.Metric=J7.Bench=J7.writeAll=J7.readAll=J7.MAX_SIZE=J7.DenoBuffer=J7.State=J7.Parser=J7.Kind=J7.describe=J7.QueuedIteratorImpl=J7.usernamePasswordAuthenticator=J7.tokenAuthenticator=J7.nkeyAuthenticator=J7.jwtAuthenticator=J7.credsAuthenticator=J7.RequestOne=J7.parseOptions=J7.hasWsProtocol=J7.defaultOptions=J7.DEFAULT_MAX_RECONNECT_ATTEMPTS=J7.checkUnsupportedOption=J7.checkOptions=J7.buildAuthenticator=J7.DataBuffer=J7.MuxSubscription=J7.Heartbeat=J7.MsgHdrsImpl=J7.headers=J7.canonicalMIMEHeaderKey=J7.timeout=J7.SimpleMutex=J7.render=J7.nanos=J7.millis=J7.extend=J7.delay=J7.deferred=J7.deadline=J7.collect=J7.backoff=J7.ProtocolHandler=J7.INFO=J7.Connect=J7.setTransportFactory=J7.getResolveFn=J7.MsgImpl=J7.nuid=J7.Nuid=J7.NatsConnectionImpl=void 0,J7.UserAuthenticationExpiredError=J7.TimeoutError=J7.RequestError=J7.ProtocolError=J7.PermissionViolationError=J7.NoRespondersError=J7.InvalidSubjectError=J7.InvalidOperationError=J7.InvalidArgumentError=J7.errors=J7.DrainingConnectionError=J7.ConnectionError=J7.ClosedConnectionError=J7.AuthorizationError=J7.wsUrlParseFn=J7.wsconnect=J7.Servers=J7.isIPV4OrHostname=J7.IdleHeartbeatMonitor=J7.Subscriptions=J7.SubscriptionImpl=J7.syncIterator=J7.Match=J7.createInbox=J7.protoLen=J7.extractProtocolMessage=J7.Empty=J7.parseSemVer=J7.Features=J7.Feature=J7.compare=J7.parseIP=J7.isIP=J7.ipV4=J7.TE=J7.TD=void 0;"use strict";var Kt={};Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.NatsConnectionImpl=void 0;"use strict";var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.SimpleMutex=Kn.Perf=void 0,Kn.extend=function(e,...t){for(let n=0;n<t.length;n++){let r=t[n];Object.keys(r).forEach(function(t){e[t]=r[t]})}return e},Kn.render=function(e){return Kr.TD.decode(e).replace(/\n/g,"␊").replace(/\r/g,"␍")},Kn.timeout=function(e,t=!0){let n,r,i=t?new Ki.TimeoutError:null;return Object.assign(new Promise((t,a)=>{n={cancel:()=>{r&&clearTimeout(r)}},r=setTimeout(()=>{null===i?a(new Ki.TimeoutError):a(i)},e)}),n)},Kn.delay=function(e=0){let t;return Object.assign(new Promise(n=>{let r=setTimeout(()=>{n()},e);t={cancel:()=>{r&&(clearTimeout(r),n())}}}),t)},Kn.deadline=Ky,Kn.deferred=Kb,Kn.debugDeferred=function(){let e={};return Object.assign(new Promise((t,n)=>{e={resolve:e=>{console.trace("resolve",e),t(e)},reject:e=>{console.trace("reject"),n(e)}}}),e)},Kn.shuffle=function(e){for(let t=e.length-1;t>0;t--){let n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e},Kn.collect=K_,Kn.jitter=Kx,Kn.backoff=function(e=[0,250,250,500,500,3e3,5e3]){Array.isArray(e)||(e=[0,250,250,500,500,3e3,5e3]);let t=e.length-1;return{backoff:n=>Kx(n>t?e[t]:e[n])}},Kn.nanos=function(e){return 1e6*e},Kn.millis=function(e){return Math.floor(e/1e6)},Kn.randomToken=function(){let e=Math.floor(0xc694446f0100*Math.random()),t=e%62;return String.fromCharCode(Kw[t],Kw[t=(e=(e-t)/62)%62],Kw[t=(e=(e-t)/62)%62],Kw[t=(e=(e-t)/62)%62],Kw[t=(e=(e-t)/62)%62],Kw[t=(e=(e-t)/62)%62],Kw[t=(e=(e-t)/62)%62],Kw[e=(e-t)/62])};"use strict";var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.TD=Kr.TE=Kr.Empty=void 0,Kr.encode=function(...e){let t=[];for(let n=0;n<e.length;n++)t.push(Kr.TE.encode(e[n]));return 0===t.length?Kr.Empty:1===t.length?t[0]:function(...e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].length;let n=new Uint8Array(t),r=0;for(let t=0;t<e.length;t++)n.set(e[t],r),r+=e[t].length;return n}(...t)},Kr.decode=function(e){return e&&0!==e.length?Kr.TD.decode(e):""},Kr.Empty=new Uint8Array(0),Kr.TE=new TextEncoder,Kr.TD=new TextDecoder;var Ki={};Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.errors=Ki.PermissionViolationError=Ki.NoRespondersError=Ki.TimeoutError=Ki.RequestError=Ki.ProtocolError=Ki.ConnectionError=Ki.DrainingConnectionError=Ki.ClosedConnectionError=Ki.AuthorizationError=Ki.UserAuthenticationExpiredError=Ki.InvalidOperationError=Ki.InvalidArgumentError=Ki.InvalidSubjectError=void 0;class Ka extends Error{constructor(e,t){super(`illegal subject: '${e}'`,t),this.name="InvalidSubjectError"}}Ki.InvalidSubjectError=Ka;class Ko extends Error{constructor(e,t){super(e,t),this.name="InvalidArgumentError"}static format(e,t,n){return Array.isArray(t)&&t.length>1&&(t=t[0]),e=Array.isArray(e)?(e=e.map(e=>`'${e}'`)).join(","):`'${e}'`,new Ko(`${e} ${t}`,n)}}Ki.InvalidArgumentError=Ko;class Ks extends Error{constructor(e,t){super(e,t),this.name="InvalidOperationError"}}Ki.InvalidOperationError=Ks;class Kl extends Error{constructor(e,t){super(e,t),this.name="UserAuthenticationExpiredError"}static parse(e){return -1!==e.toLowerCase().indexOf("user authentication expired")?new Kl(e):null}}Ki.UserAuthenticationExpiredError=Kl;class Ku extends Error{constructor(e,t){super(e,t),this.name="AuthorizationError"}static parse(e){let t=["authorization violation","account authentication expired","authentication timeout"],n=e.toLowerCase();for(let r=0;r<t.length;r++)if(-1!==n.indexOf(t[r]))return new Ku(e);return null}}Ki.AuthorizationError=Ku;class Kc extends Error{constructor(){super("closed connection"),this.name="ClosedConnectionError"}}Ki.ClosedConnectionError=Kc;class Kd extends Error{constructor(){super("connection draining"),this.name="DrainingConnectionError"}}Ki.DrainingConnectionError=Kd;class Kh extends Error{constructor(e,t){super(e,t),this.name="ConnectionError"}}Ki.ConnectionError=Kh;class Kp extends Error{constructor(e,t){super(e,t),this.name="ProtocolError"}}Ki.ProtocolError=Kp;class Km extends Error{constructor(e="",t){super(e,t),this.name="RequestError"}isNoResponders(){return this.cause instanceof Kg}}Ki.RequestError=Km;class Kf extends Error{constructor(e){super("timeout",e),this.name="TimeoutError"}}Ki.TimeoutError=Kf;class Kg extends Error{subject;constructor(e,t){super(`no responders: '${e}'`,t),this.subject=e,this.name="NoResponders"}}Ki.NoRespondersError=Kg;class Kv extends Error{operation;subject;queue;constructor(e,t,n,r,i){super(e,i),this.name="PermissionViolationError",this.operation=t,this.subject=n,this.queue=r}static parse(e){let t;if(-1===(e?e.toLowerCase():"").indexOf("permissions violation"))return null;let n="publish",r="",i=e.match(/(Publish|Subscription) to "(\S+)"/);if(i&&(n=i[1].toLowerCase(),r=i[2],"subscription"===n)){let n=e.match(/using queue "(\S+)"/);n&&(t=n[1])}return new Kv(e,n,r,t)}}async function Ky(e,t=1e3){let n=Kb(),r=setTimeout(()=>{n.reject(new Ki.TimeoutError)},t);try{return await Promise.race([e,n])}finally{clearTimeout(r)}}function Kb(){let e={};return Object.assign(new Promise((t,n)=>{e={resolve:t,reject:n}}),e)}async function K_(e){let t=[];for await(let n of e)t.push(n);return t}function Kx(e){return 0===e?0:Math.floor(e/2+Math.random()*e)}Ki.PermissionViolationError=Kv,Ki.errors={AuthorizationError:Ku,ClosedConnectionError:Kc,ConnectionError:Kh,DrainingConnectionError:Kd,InvalidArgumentError:Ko,InvalidOperationError:Ks,InvalidSubjectError:Ka,NoRespondersError:Kg,PermissionViolationError:Kv,ProtocolError:Kp,RequestError:Km,TimeoutError:Kf,UserAuthenticationExpiredError:Kl},Kn.Perf=class{timers;measures;constructor(){this.timers=new Map,this.measures=new Map}mark(e){this.timers.set(e,performance.now())}measure(e,t,n){let r=this.timers.get(t);if(void 0===r)throw Error(`${t} is not defined`);let i=this.timers.get(n);if(void 0===i)throw Error(`${n} is not defined`);this.measures.set(e,i-r)}getEntries(){let e=[];return this.measures.forEach((t,n)=>{e.push({name:n,duration:t})}),e}},Kn.SimpleMutex=class{max;current;waiting;constructor(e=1){this.max=e,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let e=Kb();return this.waiting.push(e),e}unlock(){this.current--;let e=this.waiting.pop();e?.resolve()}};let Kw=new Uint8Array(62);for(let e=0;e<62;e++)Kw[e]="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".charCodeAt(e);"use strict";"use strict";var KS={};Object.defineProperty(KS,"__esModule",{value:!0}),KS.ProtocolHandler=KS.Subscriptions=KS.SubscriptionImpl=KS.Connect=KS.INFO=void 0;"use strict";var KE={};Object.defineProperty(KE,"__esModule",{value:!0}),KE.LF=KE.CR=KE.CRLF=KE.CR_LF_LEN=KE.CR_LF=void 0,KE.setTransportFactory=function(e){c=e},KE.defaultPort=function(){return void 0!==c&&void 0!==c.defaultPort?c.defaultPort:KA.DEFAULT_PORT},KE.getUrlParseFn=function(){return void 0!==c&&c.urlParseFn?c.urlParseFn:void 0},KE.newTransport=function(){if(!c||"function"!=typeof c.factory)throw Error("transport fn is not set");return c.factory()},KE.getResolveFn=function(){return void 0!==c&&c.dnsResolveFn?c.dnsResolveFn:void 0},KE.protoLen=KL,KE.extractProtocolMessage=function(e){let t=KL(e);if(t>0){let n=new Uint8Array(e).slice(0,t);return Kr.TD.decode(n)}return""};"use strict";var KA={};Object.defineProperty(KA,"__esModule",{value:!0}),KA.DEFAULT_HOST=KA.DEFAULT_PORT=KA.Match=void 0,KA.syncIterator=function(e){let t=e[Symbol.asyncIterator]();return{async next(){let e=await t.next();return e.done?Promise.resolve(null):Promise.resolve(e.value)}}},KA.createInbox=function(e=""){if("string"!=typeof(e=e||"_INBOX"))throw TypeError("prefix must be a string");return e.split(".").forEach(t=>{if("*"===t||">"===t)throw Ki.InvalidArgumentError.format("prefix",`cannot have wildcards ('${e}')`)}),`${e}.${KT.nuid.next()}`};"use strict";var KT={};Object.defineProperty(KT,"__esModule",{value:!0}),KT.nuid=KT.Nuid=void 0;"use strict";var KI={};Object.defineProperty(KI,"__esModule",{value:!0}),KI.nuid=KI.Nuid=void 0;var KC={};Object.defineProperty(KC,"__esModule",{value:!0}),KC.nuid=KC.NuidImpl=void 0;let KM=new Uint8Array(62);for(let e=0;e<62;e++)KM[e]="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".charCodeAt(e);let KN=BigInt(62)**BigInt(10),KR=Number(KN/(1n<<32n)),KO=Number(KN%(1n<<32n));class KP{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(22),this.cbuf=new Uint8Array(12),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let e=0;do this.seqHi=Math.floor(Math.random()*(KR+1)),this.seqLo=Math.floor(0x100000000*Math.random());while(e++<8&&this.seqHi===KR&&this.seqLo>=KO)this.seqHi===KR&&this.seqLo>=KO&&(this.seqLo=0),this.inc=300*Math.random()+33|0}setPre(){var e=this.cbuf;if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues(e);else for(let t=0;t<e.length;t++)e[t]=Math.floor(256*Math.random());for(let e=0;e<12;e++)this.buf[e]=KM[this.cbuf[e]%62]}fillSeq(){let e=this.seqHi,t=this.seqLo;for(let n=21;n>=12;n--){let r=Math.floor(e/62),i=(e-62*r)*0x100000000+t,a=Math.floor(i/62),o=i-62*a;this.buf[n]=KM[o],e=r,t=a}}next(){this.inited||this.init(),this.seqLo+=this.inc,this.seqLo>=0x100000000&&(this.seqLo-=0x100000000,this.seqHi+=1),(this.seqHi>KR||this.seqHi===KR&&this.seqLo>=KO)&&(this.setPre(),this.initSeqAndInc()),this.fillSeq();let e=this.buf;return String.fromCharCode(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15],e[16],e[17],e[18],e[19],e[20],e[21])}reset(){this.init()}}"use strict";KC.NuidImpl=KP,KC.nuid=new KP,KI.Nuid=KC.NuidImpl,KI.nuid=KC.nuid,Object.defineProperty(KT,"Nuid",{enumerable:!0,get:function(){return KI.Nuid}}),Object.defineProperty(KT,"nuid",{enumerable:!0,get:function(){return KI.nuid}}),KA.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"},KA.DEFAULT_PORT=4222,KA.DEFAULT_HOST="127.0.0.1";var Kk={};function KL(e){for(let t=0;t<e.length;t++){let n=t+1;if(e.byteLength>n&&e[t]===KE.CR&&e[n]===KE.LF)return n+1}return 0}"use strict";Object.defineProperty(Kk,"__esModule",{value:!0}),Kk.DataBuffer=void 0,Kk.DataBuffer=class{buffers;byteLength;constructor(){this.buffers=[],this.byteLength=0}static concat(...e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].length;let n=new Uint8Array(t),r=0;for(let t=0;t<e.length;t++)n.set(e[t],r),r+=e[t].length;return n}static fromAscii(e){return e||(e=""),Kr.TE.encode(e)}static toAscii(e){return Kr.TD.decode(e)}reset(){this.buffers.length=0,this.byteLength=0}pack(){if(this.buffers.length>1){let e=new Uint8Array(this.byteLength),t=0;for(let n=0;n<this.buffers.length;n++)e.set(this.buffers[n],t),t+=this.buffers[n].length;this.buffers.length=0,this.buffers.push(e)}}shift(){if(this.buffers.length){let e=this.buffers.shift();if(e)return this.byteLength-=e.length,e}return new Uint8Array(0)}drain(e){if(this.buffers.length){this.pack();let t=this.buffers.pop();if(t){let n=this.byteLength;(void 0===e||e>n)&&(e=n);let r=t.subarray(0,e);return n>e&&this.buffers.push(t.subarray(e)),this.byteLength=n-e,r}}return new Uint8Array(0)}fill(e,...t){e&&(this.buffers.push(e),this.byteLength+=e.length);for(let e=0;e<t.length;e++)t[e]&&t[e].length&&(this.buffers.push(t[e]),this.byteLength+=t[e].length)}peek(){return this.buffers.length?(this.pack(),this.buffers[0]):new Uint8Array(0)}size(){return this.byteLength}length(){return this.buffers.length}},KE.CR_LF="\r\n",KE.CR_LF_LEN=KE.CR_LF.length,KE.CRLF=Kk.DataBuffer.fromAscii(KE.CR_LF),KE.CR=new Uint8Array(KE.CRLF)[0],KE.LF=new Uint8Array(KE.CRLF)[1];"use strict";var KD={};Object.defineProperty(KD,"__esModule",{value:!0}),KD.Servers=KD.ServerImpl=void 0,KD.isIPV4OrHostname=Kz,KD.hostPort=KH;var KB={};function KF(e,t,n,r){let i=new Uint8Array(16);return[0,0,0,0,0,0,0,0,0,0,255,255].forEach((e,t)=>{i[t]=e}),i[12]=e,i[13]=t,i[14]=n,i[15]=r,i}function KU(e){for(let t=0;t<e.length;t++)switch(e[t]){case".":return Kj(e);case":":return function(e){let t=new Uint8Array(16),n=-1;if(e.length>=2&&":"===e[0]&&":"===e[1]&&(n=0,0===(e=e.substring(2)).length))return t;let r=0;for(;r<16;){let{n:i,c:a,ok:o}=function(e){let t=0,n=0;for(n=0;n<e.length;n++){if(48<=e.charCodeAt(n)&&57>=e.charCodeAt(n))t*=16,t+=e.charCodeAt(n)-48;else if(97<=e.charCodeAt(n)&&102>=e.charCodeAt(n))t*=16,t+=e.charCodeAt(n)-97+10;else if(65<=e.charCodeAt(n)&&70>=e.charCodeAt(n))t*=16,t+=e.charCodeAt(n)-65+10;else break;if(t>=0xffffff)return{n:0,c:n,ok:!1}}return 0===n?{n:0,c:n,ok:!1}:{n:t,c:n,ok:!0}}(e);if(!o||i>65535)return;if(a<e.length&&"."===e[a]){if(n<0&&12!=r||r+4>16)return;let i=Kj(e);if(void 0===i)return;t[r]=i[12],t[r+1]=i[13],t[r+2]=i[14],t[r+3]=i[15],e="",r+=4;break}if(t[r]=i>>8,t[r+1]=i,r+=2,0===(e=e.substring(a)).length)break;if(":"!==e[0]||1==e.length)return;if(":"===(e=e.substring(1))[0]){if(n>=0)return;if(n=r,0===(e=e.substring(1)).length)break}}if(0===e.length){if(r<16){if(n<0)return;let e=16-r;for(let i=r-1;i>=n;i--)t[i+e]=t[i];for(let r=n+e-1;r>=n;r--)t[r]=0}else if(n>=0)return;return t}}(e)}}function Kj(e){let t=new Uint8Array(4);for(let n=0;n<4;n++){if(0===e.length)return;if(n>0){if("."!==e[0])return;e=e.substring(1)}let{n:r,c:i,ok:a}=function(e){let t=0,n=0;for(t=0;t<e.length&&48<=e.charCodeAt(t)&&57>=e.charCodeAt(t);t++)if((n=10*n+(e.charCodeAt(t)-48))>=0xffffff)return{n:0xffffff,c:t,ok:!1};return 0===t?{n:0,c:0,ok:!1}:{n:n,c:t,ok:!0}}(e);if(!a||r>255)return;e=e.substring(i),t[n]=r}return KF(t[0],t[1],t[2],t[3])}function Kz(e){return -1===e.indexOf("[")&&-1===e.indexOf("::")&&(-1!==e.indexOf(".")||!!(e.split(":").length<=2))}Object.defineProperty(KB,"__esModule",{value:!0}),KB.ipV4=KF,KB.isIP=function(e){return void 0!==KU(e)},KB.parseIP=KU;function KH(e){(e=e.trim()).match(/^(.*:\/\/)(.*)/m)&&(e=e.replace(/^(.*:\/\/)(.*)/gm,"$2")),Kz(e=function(e){let t="::FFFF:",n=e.toUpperCase().indexOf(t);if(-1!==n&&-1!==e.indexOf(".")){let r=e.substring(n+t.length);return(r=r.replace("[","")).replace("]","")}return e}(e))||-1!==e.indexOf("[")||(e=`[${e}]`);let t=Kz(e)?e.match(/(:)(\d+)/):e.match(/(]:)(\d+)/),n=t&&3===t.length&&t[1]&&t[2]?parseInt(t[2]):KA.DEFAULT_PORT,r=new URL(`${80===n?"https":"http"}://${e}`);r.port=`${n}`;let i=r.hostname;return"["===i.charAt(0)&&(i=i.substring(1,i.length-1)),{listen:r.host,hostname:i,port:n}}class KG{src;listen;hostname;port;didConnect;reconnects;lastConnect;gossiped;tlsName;resolves;constructor(e,t=!1){this.src=e,this.tlsName="";let n=KH(e);this.listen=n.listen,this.hostname=n.hostname,this.port=n.port,this.didConnect=!1,this.reconnects=0,this.lastConnect=0,this.gossiped=t}toString(){return this.listen}async resolve(e){if(!e.fn||!1===e.resolve)return[this];let t=[];if((0,KB.isIP)(this.hostname))return[this];{let n=await e.fn(this.hostname);for(let r of(e.debug&&console.log(`resolve ${this.hostname} = ${n.join(",")}`),n)){let e=80===this.port?"https":"http",n=new URL(`${e}://${!Kz(r)?"["+r+"]":r}`);n.port=`${this.port}`;let i=new KG(n.host,!1);i.tlsName=this.hostname,t.push(i)}}return e.randomize&&(0,Kn.shuffle)(t),this.resolves=t,t}}"use strict";KD.ServerImpl=KG,KD.Servers=class e{firstSelect;servers;currentServer;tlsName;randomize;constructor(e={}){this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=e.randomize||!1}setServers(e){if(!Array.isArray(e)||0===e.length)throw Ki.InvalidArgumentError.format("servers","cannot be empty");let t=(0,KE.getUrlParseFn)(),n=new Map;for(let e of this.servers)n.set(e.listen,e);let r=[];for(let i of e){let{listen:e}=KH(i=t?t(i):i),a=n.get(e);a?(a.gossiped=!1,r.push(a)):r.push(new KG(i))}this.randomize&&(0,Kn.shuffle)(r),this.servers=r,void 0!==this.currentServer&&r.includes(this.currentServer)||(this.currentServer=r[0],this.firstSelect=!0)}clear(){this.servers.length=0}updateTLSName(){let e=this.getCurrentServer();(0,KB.isIP)(e.hostname)||(this.tlsName=e.hostname,this.servers.forEach(e=>{e.gossiped&&(e.tlsName=this.tlsName)}))}getCurrentServer(){return this.currentServer}addServer(e,t=!1){let n=(0,KE.getUrlParseFn)(),r=new KG(e=n?n(e):e,t);(0,KB.isIP)(r.hostname)&&(r.tlsName=this.tlsName),this.servers.push(r)}selectServer(){if(this.firstSelect)return this.firstSelect=!1,this.currentServer;let e=this.servers.shift();return e&&(this.servers.push(e),this.currentServer=e),e}removeCurrentServer(){this.removeServer(this.currentServer)}removeServer(e){if(e){let t=this.servers.indexOf(e);this.servers.splice(t,1)}}snapshot(){return e.freezeAll(this.servers)}snapshotForHandler(){let t=this.currentServer;if(!t)return this.snapshot();let n=this.servers.indexOf(t);return n<=0?this.snapshot():e.freezeAll([t,...this.servers.slice(0,n),...this.servers.slice(n+1)])}static freezeAll(e){return e.map(e=>Object.freeze({hostname:e.hostname,port:e.port,listen:e.listen,src:e.src,tlsName:e.tlsName,reconnects:e.reconnects,lastConnect:e.lastConnect,gossiped:e.gossiped,didConnect:e.didConnect}))}find(e){return this.servers.find(t=>t.listen===e.listen)}setCurrent(e){this.currentServer=e}length(){return this.servers.length}next(){return this.servers.length?this.servers[0]:void 0}getServers(){return this.servers}update(e,t){let n=[],r=[],i=(0,KE.getUrlParseFn)(),a=new Map;e.connect_urls&&e.connect_urls.length>0&&e.connect_urls.forEach(e=>{let n=new KG(e=i?i(e,t):e,!0);a.set(e,n)});let o=[];if(this.servers.forEach((e,t)=>{let n=e.listen;e.gossiped&&this.currentServer.listen!==n&&void 0===a.get(n)&&o.push(t),a.delete(n)}),o.reverse(),o.forEach(e=>{let t=this.servers.splice(e,1);r=r.concat(t[0].listen)}),a.forEach((e,t)=>{this.servers.push(e),n.push(t)}),this.randomize&&n.length>0){let e=this.currentServer,t=this.servers.filter(t=>t!==e);(0,Kn.shuffle)(t),this.servers=e?[e,...t]:t}return{added:n,deleted:r}}};var KV={};Object.defineProperty(KV,"__esModule",{value:!0}),KV.QueuedIteratorImpl=void 0;class KW{inflight;processed;received;noIterator;iterClosed;done;signal;yields;filtered;pendingFiltered;ctx;_data;err;time;profile;yielding;didBreak;constructor(){this.inflight=0,this.filtered=0,this.pendingFiltered=0,this.processed=0,this.received=0,this.noIterator=!1,this.done=!1,this.signal=(0,Kn.deferred)(),this.yields=[],this.iterClosed=(0,Kn.deferred)(),this.time=0,this.yielding=!1,this.didBreak=!1,this.profile=!1}[Symbol.asyncIterator](){return this.iterate()}push(e){if(!this.done){if(this.didBreak){if("function"==typeof e)try{e()}catch(e){}return}"function"==typeof e&&this.pendingFiltered++,this.yields.push(e),this.signal.resolve()}}async *iterate(){if(this.noIterator)throw new Ki.InvalidOperationError("iterator cannot be used when a callback is registered");if(this.yielding)throw new Ki.InvalidOperationError("iterator is already yielding");this.yielding=!0;try{for(;;){if(0===this.yields.length&&await this.signal,this.err)throw this.err;let e=this.yields;this.inflight=e.length,this.yields=[];for(let t=0;t<e.length;t++){if("function"==typeof e[t]){this.pendingFiltered--;let n=e[t];try{n()}catch(e){throw e}if(this.err)throw this.err;continue}this.processed++,this.inflight--;let n=this.profile?Date.now():0;yield e[t],this.time=this.profile?Date.now()-n:0}if(this.done)break;0===this.yields.length&&(e.length=0,this.yields=e,this.signal=(0,Kn.deferred)())}}finally{this.didBreak=!0,this.stop()}}stop(e){this.done||(this.err=e,this.done=!0,this.signal.resolve(),this.iterClosed.resolve(e))}getProcessed(){return this.noIterator?this.received:this.processed}getPending(){return this.yields.length+this.inflight-this.pendingFiltered}getReceived(){return this.received-this.filtered}}"use strict";KV.QueuedIteratorImpl=KW;"use strict";var Kq={};Object.defineProperty(Kq,"__esModule",{value:!0}),Kq.MuxSubscription=void 0,Kq.MuxSubscription=class{baseInbox;reqs;constructor(){this.reqs=new Map}size(){return this.reqs.size}init(e){return this.baseInbox=`${(0,KA.createInbox)(e)}.`,this.baseInbox}add(e){isNaN(e.received)||(e.received=0),this.reqs.set(e.token,e)}get(e){return this.reqs.get(e)}cancel(e){this.reqs.delete(e.token)}getToken(e){let t=e.subject||"";return 0===t.indexOf(this.baseInbox)?t.substring(this.baseInbox.length):null}all(){return Array.from(this.reqs.values())}handleError(e,t){if(e)return this.all().forEach(e=>{e.resolver(t,{})}),!0;if("publish"===t.operation){let e=this.all().find(e=>e.requestSubject===t.subject);if(e)return e.resolver(t,{}),!0}return!1}dispatcher(){return(e,t)=>{let n=this.getToken(t);if(n){let r=this.get(n);r&&(null===e&&(e=t?.data?.length===0&&t.headers?.code===503?new Ki.NoRespondersError(r.requestSubject):null),r.resolver(e,t))}}}close(){let e=new Ki.RequestError("connection closed");this.reqs.forEach(t=>{t.resolver(e,{})})}};"use strict";var K$={};Object.defineProperty(K$,"__esModule",{value:!0}),K$.Heartbeat=void 0,K$.Heartbeat=class{ph;interval;maxOut;timer;pendings;constructor(e,t,n){this.ph=e,this.interval=t,this.maxOut=n,this.pendings=[]}start(){this.cancel(),this._schedule()}cancel(e){this.timer&&(clearTimeout(this.timer),this.timer=void 0),this._reset(),e&&this.ph.disconnect()}_schedule(){this.timer=setTimeout(()=>{if(this.ph.dispatchStatus({type:"ping",pendingPings:this.pendings.length+1}),this.pendings.length===this.maxOut)return void this.cancel(!0);let e=(0,Kn.deferred)();this.ph.flush(e).then(()=>{this._reset()}).catch(()=>{this.cancel()}),this.pendings.push(e),this._schedule()},this.interval)}_reset(){this.pendings=this.pendings.filter(e=>(e.resolve(),!1))}};"use strict";var KJ={};Object.defineProperty(KJ,"__esModule",{value:!0}),KJ.cc=KJ.State=KJ.Parser=KJ.Kind=void 0,KJ.describe=function(e){let t,n="";switch(e.kind){case KJ.Kind.MSG:t="MSG";break;case KJ.Kind.OK:t="OK";break;case KJ.Kind.ERR:t="ERR",n=Kr.TD.decode(e.data);break;case KJ.Kind.PING:t="PING";break;case KJ.Kind.PONG:t="PONG";break;case KJ.Kind.INFO:t="INFO",n=Kr.TD.decode(e.data)}return`${t}: ${n}`};var KK={};Object.defineProperty(KK,"__esModule",{value:!0}),KK.DenoBuffer=KK.MAX_SIZE=KK.AssertionError=void 0,KK.assert=KX,KK.concat=KQ,KK.append=function(e,t){return KQ(e,Uint8Array.of(t))},KK.readAll=function(e){let t=new K0;return t.readFrom(e),t.bytes()},KK.writeAll=function(e,t){let n=0;for(;n<t.length;)n+=e.write(t.subarray(n))};class KY extends Error{constructor(e){super(e),this.name="AssertionError"}}function KX(e,t="Assertion failed."){if(!e)throw new KY(t)}function KZ(e,t,n=0){let r=t.byteLength-n;return e.byteLength>r&&(e=e.subarray(0,r)),t.set(e,n),e.byteLength}function KQ(e,t){if(void 0===e&&void 0===t)return new Uint8Array(0);if(void 0===e)return t;if(void 0===t)return e;let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}KK.AssertionError=KY,KK.MAX_SIZE=0xfffffffe;class K0{_buf;_off;constructor(e){if(this._off=0,null==e){this._buf=new Uint8Array(0);return}this._buf=new Uint8Array(e)}bytes(e={copy:!0}){return!1===e.copy?this._buf.subarray(this._off):this._buf.slice(this._off)}empty(){return this._buf.byteLength<=this._off}get length(){return this._buf.byteLength-this._off}get capacity(){return this._buf.buffer.byteLength}truncate(e){if(0===e)return void this.reset();if(e<0||e>this.length)throw Error("bytes.Buffer: truncation out of range");this._reslice(this._off+e)}reset(){this._reslice(0),this._off=0}_tryGrowByReslice(e){let t=this._buf.byteLength;return e<=this.capacity-t?(this._reslice(t+e),t):-1}_reslice(e){KX(e<=this._buf.buffer.byteLength),this._buf=new Uint8Array(this._buf.buffer,0,e)}readByte(){let e=new Uint8Array(1);return this.read(e)?e[0]:null}read(e){if(this.empty())return(this.reset(),0===e.byteLength)?0:null;let t=KZ(this._buf.subarray(this._off),e);return this._off+=t,t}writeByte(e){return this.write(Uint8Array.of(e))}writeString(e){return this.write(Kr.TE.encode(e))}write(e){let t=this._grow(e.byteLength);return KZ(e,this._buf,t)}_grow(e){let t=this.length;0===t&&0!==this._off&&this.reset();let n=this._tryGrowByReslice(e);if(n>=0)return n;let r=this.capacity;if(e<=Math.floor(r/2)-t)KZ(this._buf.subarray(this._off),this._buf);else if(r+e>KK.MAX_SIZE)throw Error("The buffer cannot be grown beyond the maximum size.");else{let t=new Uint8Array(Math.min(2*r+e,KK.MAX_SIZE));KZ(this._buf.subarray(this._off),t),this._buf=t}return this._off=0,this._reslice(Math.min(t+e,KK.MAX_SIZE)),t}grow(e){if(e<0)throw Error("Buffer._grow: negative count");let t=this._grow(e);this._reslice(t)}readFrom(e){let t=0,n=new Uint8Array(32768);for(;;){let r=this.capacity-this.length<32768,i=r?n:new Uint8Array(this._buf.buffer,this.length),a=e.read(i);if(null===a)return t;r?this.write(i.subarray(0,a)):this._reslice(this.length+a),t+=a}}}function K1(){let e={};return e.sid=-1,e.hdr=-1,e.size=-1,e}"use strict";KK.DenoBuffer=K0,KJ.Kind={OK:0,ERR:1,MSG:2,INFO:3,PING:4,PONG:5},KJ.Parser=class{dispatcher;state;as;drop;hdr;ma;argBuf;msgBuf;constructor(e){this.dispatcher=e,this.state=KJ.State.OP_START,this.as=0,this.drop=0,this.hdr=0}parse(e){let t;for(t=0;t<e.length;t++){let n=e[t];switch(this.state){case KJ.State.OP_START:switch(n){case KJ.cc.M:case KJ.cc.m:this.state=KJ.State.OP_M,this.hdr=-1,this.ma=K1();break;case KJ.cc.H:case KJ.cc.h:this.state=KJ.State.OP_H,this.hdr=0,this.ma=K1();break;case KJ.cc.P:case KJ.cc.p:this.state=KJ.State.OP_P;break;case KJ.cc.PLUS:this.state=KJ.State.OP_PLUS;break;case KJ.cc.MINUS:this.state=KJ.State.OP_MINUS;break;case KJ.cc.I:case KJ.cc.i:this.state=KJ.State.OP_I;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_H:switch(n){case KJ.cc.M:case KJ.cc.m:this.state=KJ.State.OP_M;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_M:switch(n){case KJ.cc.S:case KJ.cc.s:this.state=KJ.State.OP_MS;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_MS:switch(n){case KJ.cc.G:case KJ.cc.g:this.state=KJ.State.OP_MSG;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_MSG:switch(n){case KJ.cc.SPACE:case KJ.cc.TAB:this.state=KJ.State.OP_MSG_SPC;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_MSG_SPC:switch(n){case KJ.cc.SPACE:case KJ.cc.TAB:continue;default:this.state=KJ.State.MSG_ARG,this.as=t}break;case KJ.State.MSG_ARG:switch(n){case KJ.cc.CR:this.drop=1;break;case KJ.cc.NL:{let n=this.argBuf?this.argBuf.bytes():e.subarray(this.as,t-this.drop);this.processMsgArgs(n),this.drop=0,this.as=t+1,this.state=KJ.State.MSG_PAYLOAD,t=this.as+this.ma.size-1;break}default:this.argBuf&&this.argBuf.writeByte(n)}break;case KJ.State.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){let e=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:KJ.Kind.MSG,msg:this.ma,data:e}),this.argBuf=void 0,this.msgBuf=void 0,this.state=KJ.State.MSG_END}else{let r=this.ma.size-this.msgBuf.length,i=e.length-t;i<r&&(r=i),r>0?(this.msgBuf.write(e.subarray(t,t+r)),t=t+r-1):this.msgBuf.writeByte(n)}else t-this.as>=this.ma.size&&(this.dispatcher.push({kind:KJ.Kind.MSG,msg:this.ma,data:e.subarray(this.as,t)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=KJ.State.MSG_END);break;case KJ.State.MSG_END:if(n!==KJ.cc.NL)continue;this.drop=0,this.as=t+1,this.state=KJ.State.OP_START;break;case KJ.State.OP_PLUS:switch(n){case KJ.cc.O:case KJ.cc.o:this.state=KJ.State.OP_PLUS_O;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_PLUS_O:switch(n){case KJ.cc.K:case KJ.cc.k:this.state=KJ.State.OP_PLUS_OK;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_PLUS_OK:n===KJ.cc.NL&&(this.dispatcher.push({kind:KJ.Kind.OK}),this.drop=0,this.state=KJ.State.OP_START);break;case KJ.State.OP_MINUS:switch(n){case KJ.cc.E:case KJ.cc.e:this.state=KJ.State.OP_MINUS_E;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_MINUS_E:switch(n){case KJ.cc.R:case KJ.cc.r:this.state=KJ.State.OP_MINUS_ER;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_MINUS_ER:switch(n){case KJ.cc.R:case KJ.cc.r:this.state=KJ.State.OP_MINUS_ERR;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_MINUS_ERR:switch(n){case KJ.cc.SPACE:case KJ.cc.TAB:this.state=KJ.State.OP_MINUS_ERR_SPC;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_MINUS_ERR_SPC:switch(n){case KJ.cc.SPACE:case KJ.cc.TAB:continue;default:this.state=KJ.State.MINUS_ERR_ARG,this.as=t}break;case KJ.State.MINUS_ERR_ARG:switch(n){case KJ.cc.CR:this.drop=1;break;case KJ.cc.NL:{let n;this.argBuf?(n=this.argBuf.bytes(),this.argBuf=void 0):n=e.subarray(this.as,t-this.drop),this.dispatcher.push({kind:KJ.Kind.ERR,data:n}),this.drop=0,this.as=t+1,this.state=KJ.State.OP_START;break}default:this.argBuf&&this.argBuf.write(Uint8Array.of(n))}break;case KJ.State.OP_P:switch(n){case KJ.cc.I:case KJ.cc.i:this.state=KJ.State.OP_PI;break;case KJ.cc.O:case KJ.cc.o:this.state=KJ.State.OP_PO;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_PO:switch(n){case KJ.cc.N:case KJ.cc.n:this.state=KJ.State.OP_PON;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_PON:switch(n){case KJ.cc.G:case KJ.cc.g:this.state=KJ.State.OP_PONG;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_PONG:n===KJ.cc.NL&&(this.dispatcher.push({kind:KJ.Kind.PONG}),this.drop=0,this.state=KJ.State.OP_START);break;case KJ.State.OP_PI:switch(n){case KJ.cc.N:case KJ.cc.n:this.state=KJ.State.OP_PIN;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_PIN:switch(n){case KJ.cc.G:case KJ.cc.g:this.state=KJ.State.OP_PING;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_PING:n===KJ.cc.NL&&(this.dispatcher.push({kind:KJ.Kind.PING}),this.drop=0,this.state=KJ.State.OP_START);break;case KJ.State.OP_I:switch(n){case KJ.cc.N:case KJ.cc.n:this.state=KJ.State.OP_IN;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_IN:switch(n){case KJ.cc.F:case KJ.cc.f:this.state=KJ.State.OP_INF;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_INF:switch(n){case KJ.cc.O:case KJ.cc.o:this.state=KJ.State.OP_INFO;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_INFO:switch(n){case KJ.cc.SPACE:case KJ.cc.TAB:this.state=KJ.State.OP_INFO_SPC;break;default:throw this.fail(e.subarray(t))}break;case KJ.State.OP_INFO_SPC:switch(n){case KJ.cc.SPACE:case KJ.cc.TAB:continue;default:this.state=KJ.State.INFO_ARG,this.as=t}break;case KJ.State.INFO_ARG:switch(n){case KJ.cc.CR:this.drop=1;break;case KJ.cc.NL:{let n;this.argBuf?(n=this.argBuf.bytes(),this.argBuf=void 0):n=e.subarray(this.as,t-this.drop),this.dispatcher.push({kind:KJ.Kind.INFO,data:n}),this.drop=0,this.as=t+1,this.state=KJ.State.OP_START;break}default:this.argBuf&&this.argBuf.writeByte(n)}break;default:throw this.fail(e.subarray(t))}}this.state!==KJ.State.MSG_ARG&&this.state!==KJ.State.MINUS_ERR_ARG&&this.state!==KJ.State.INFO_ARG||this.argBuf||(this.argBuf=new KK.DenoBuffer(e.subarray(this.as,t-this.drop))),this.state!==KJ.State.MSG_PAYLOAD||this.msgBuf||(this.argBuf||this.cloneMsgArg(),this.msgBuf=new KK.DenoBuffer(e.subarray(this.as)))}cloneMsgArg(){let e=this.ma.subject.length,t=new Uint8Array(e+(this.ma.reply?this.ma.reply.length:0));t.set(this.ma.subject),this.ma.reply&&t.set(this.ma.reply,e),this.argBuf=new KK.DenoBuffer(t),this.ma.subject=t.subarray(0,e),this.ma.reply&&(this.ma.reply=t.subarray(e))}processMsgArgs(e){if(this.hdr>=0)return this.processHeaderMsgArgs(e);let t=[],n=-1;for(let r=0;r<e.length;r++)switch(e[r]){case KJ.cc.SPACE:case KJ.cc.TAB:case KJ.cc.CR:case KJ.cc.NL:n>=0&&(t.push(e.subarray(n,r)),n=-1);break;default:n<0&&(n=r)}switch(n>=0&&t.push(e.subarray(n)),t.length){case 3:this.ma.subject=t[0],this.ma.sid=this.protoParseInt(t[1]),this.ma.reply=void 0,this.ma.size=this.protoParseInt(t[2],0x4000000);break;case 4:this.ma.subject=t[0],this.ma.sid=this.protoParseInt(t[1]),this.ma.reply=t[2],this.ma.size=this.protoParseInt(t[3],0x4000000);break;default:throw this.fail(e,"processMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail(e,"processMsgArgs Bad or Missing Sid Error");if(this.ma.size<0)throw this.fail(e,"processMsgArgs Bad or Missing Size Error")}fail(e,t=""){return t=t?`${t} [${this.state}]`:`parse error [${this.state}]`,Error(`${t}: ${Kr.TD.decode(e)}`)}processHeaderMsgArgs(e){let t=[],n=-1;for(let r=0;r<e.length;r++)switch(e[r]){case KJ.cc.SPACE:case KJ.cc.TAB:case KJ.cc.CR:case KJ.cc.NL:n>=0&&(t.push(e.subarray(n,r)),n=-1);break;default:n<0&&(n=r)}switch(n>=0&&t.push(e.subarray(n)),t.length){case 4:this.ma.subject=t[0],this.ma.sid=this.protoParseInt(t[1]),this.ma.reply=void 0,this.ma.hdr=this.protoParseInt(t[2],0x4000000),this.ma.size=this.protoParseInt(t[3],0x4000000);break;case 5:this.ma.subject=t[0],this.ma.sid=this.protoParseInt(t[1]),this.ma.reply=t[2],this.ma.hdr=this.protoParseInt(t[3],0x4000000),this.ma.size=this.protoParseInt(t[4],0x4000000);break;default:throw this.fail(e,"processHeaderMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail(e,"processHeaderMsgArgs Bad or Missing Sid Error");if(this.ma.hdr<0||this.ma.hdr>this.ma.size)throw this.fail(e,"processHeaderMsgArgs Bad or Missing Header Size Error");if(this.ma.size<0)throw this.fail(e,"processHeaderMsgArgs Bad or Missing Size Error")}protoParseInt(e,t){if(0===e.length||e.length>15)return -1;let n=0;for(let t=0;t<e.length;t++){if(e[t]<48||e[t]>57)return -1;n=10*n+(e[t]-48)}return void 0!==t&&n>t?-1:n}},KJ.State={OP_START:0,OP_PLUS:1,OP_PLUS_O:2,OP_PLUS_OK:3,OP_MINUS:4,OP_MINUS_E:5,OP_MINUS_ER:6,OP_MINUS_ERR:7,OP_MINUS_ERR_SPC:8,MINUS_ERR_ARG:9,OP_M:10,OP_MS:11,OP_MSG:12,OP_MSG_SPC:13,MSG_ARG:14,MSG_PAYLOAD:15,MSG_END:16,OP_H:17,OP_P:18,OP_PI:19,OP_PIN:20,OP_PING:21,OP_PO:22,OP_PON:23,OP_PONG:24,OP_I:25,OP_IN:26,OP_INF:27,OP_INFO:28,OP_INFO_SPC:29,INFO_ARG:30},KJ.cc={CR:13,E:69,e:101,F:70,f:102,G:71,g:103,H:72,h:104,I:73,i:105,K:75,k:107,M:77,m:109,MINUS:45,N:78,n:110,NL:10,O:79,o:111,P:80,p:112,PLUS:43,R:82,r:114,S:83,s:115,SPACE:32,TAB:9};"use strict";var K2={};Object.defineProperty(K2,"__esModule",{value:!0}),K2.MsgImpl=void 0;var K3={};function K4(e){let t=!0,n=Array(e.length);for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(58===i||i<33||i>126)throw Ki.InvalidArgumentError.format("header",`'${e[r]}' is not a valid character in a header name`);t&&97<=i&&i<=122?i-=32:!t&&65<=i&&i<=90&&(i+=32),n[r]=i,t=45==i}return String.fromCharCode(...n)}Object.defineProperty(K3,"__esModule",{value:!0}),K3.MsgHdrsImpl=void 0,K3.canonicalMIMEHeaderKey=K4,K3.headers=function(e=0,t=""){if(0===e&&""!==t)throw Ki.InvalidArgumentError.format("code","is required");if(e>0&&""===t)throw Ki.InvalidArgumentError.format("description","is required");return new K6(e,t)};let K5="NATS/1.0";class K6{_code;headers;_description;constructor(e=0,t=""){this._code=e,this._description=t,this.headers=new Map}[Symbol.iterator](){return this.headers.entries()}size(){return this.headers.size}equals(e){if(e&&this.headers.size===e.headers.size&&this._code===e._code){for(let[t,n]of this.headers){let r=e.values(t);if(n.length!==r.length)return!1;let i=[...n].sort(),a=[...r].sort();for(let e=0;e<i.length;e++)if(i[e]!==a[e])return!1}return!0}return!1}static decode(e){let t=new K6,n=Kr.TD.decode(e).split("\r\n"),r=n[0];if(r!==K5){let e=r.replace(K5,"").trim();if(e.length>0){t._code=parseInt(e,10),isNaN(t._code)&&(t._code=0);let n=t._code.toString();t._description=(e=e.replace(n,"")).trim()}}return n.length>=1&&n.slice(1).map(e=>{if(e){let n=e.indexOf(":");if(n>-1){let r=e.slice(0,n),i=e.slice(n+1).trim();t.append(r,i)}}}),t}toString(){if(0===this.headers.size&&0===this._code)return"";let e=K5;for(let[t,n]of(this._code>0&&""!==this._description&&(e+=` ${this._code} ${this._description}`),this.headers))for(let r=0;r<n.length;r++)e=`${e}\r
1070
+ `.concat(e.lines.map(e=>`${e.inbound?"YOU":i.name}: ${Hl(Le(e.text||""))}`).join("\n")),n=`${i.name.replace(/\W+/g,"-")}-chat-${e.chatLogID.substring(0,4)}.txt`,r=new Blob([t],{type:"text/plain"}),a=URL.createObjectURL(r),(o=document.createElement("a")).setAttribute("href",a),o.setAttribute("download",n),o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},V=()=>{y&&(a(y),t())},W=e=>{let t,n=JK(e.lines);return[n?((e,t,n=new Date)=>{let r=Jo(e);if(!r)return"";let i=new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit"}).format(r),a=Math.round((JJ(r).getTime()-JJ(n).getTime())/864e5);if(0===a||-1===a){let e=new Intl.RelativeTimeFormat(t,{numeric:"auto"}).format(a,"day");return`${e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:e}, ${i}`}let o=new Intl.DateTimeFormat(t,{day:"numeric",month:"short",...r.getFullYear()===n.getFullYear()?{}:{year:"numeric"}}).format(r);return`${o}, ${i}`})(n,m.language):"",(t=e.lines.length,`${t} ${1===t?p("write_and_speak.message")||"message":p("write_and_speak.messages")||"messages"}`)].filter(Boolean).join(" · ")},q=y?J3(y,!1)||`Chat-${y.chatLogID.substring(0,4)}`:"",$=(0,em.useMemo)(()=>{if(!y)return null;let e=y.lines.some(e=>{var t;return!e.inbound&&!(null==(t=e.text)?void 0:t.trim())});return{title:q,subtitle:W(y),summary:"",messages:y.lines.map((t,n)=>{var r,i;let a,o,s=t.inbound?(t.media||[]).find(J1):void 0;return{id:`${y.chatLogID}-${n}`,role:t.inbound?"user":"assistant",content:t.text||"",timestamp:t.timestamp,media:(t.media||[]).map((e,t)=>({...e,mediumID:e.mediumID||`${y.chatLogID}-${n}-${t}`})),status:t.inbound||(null==(r=t.text)?void 0:r.trim())||!e?"completed":"interrupted",attachment:s?(o=HF(a=s.title||(null==(i=s.url)?void 0:i.split("/").pop())||"Attachment file",s.mimeType),{name:a,type:o,size:"2.4 KB",ext:HG(o,a,s.url)}):void 0}}),quickActions:[]}},[y,q,m.language,p]),J=(0,em.useMemo)(()=>((e,t,n=new Date)=>{let r=[];for(let i of e){let e=t(i);if(!e)continue;let a=JY(e,n),o=r[r.length-1];o&&("thisWeek"===a.type&&"thisWeek"===o.key.type||"month"===a.type&&"month"===o.key.type&&a.year===o.key.year&&a.month===o.key.month)?o.items.push(i):r.push({key:a,items:[i]})}return r})(g,e=>JK(e.lines)),[g]),K=!O&&!B&&0===U&&!S,Y=!O&&!B&&!K&&0===g.length,X=g.length<U,Z=!!(y&&$),Q=Z||K||O?void 0:(0,eh.jsx)(Hf,{start:(0,eh.jsx)("span",{className:"memori-chat-history-drawer--count",children:p("write_and_speak.shownOfTotal",{shown:g.length,total:U})}),end:X?(0,eh.jsx)(yt,{variant:"outline",loading:k,disabled:k,icon:(0,eh.jsx)(Hg,{"aria-hidden":!0}),iconPosition:"right",onClick:()=>void H({from:g.length,append:!0}),children:p("write_and_speak.loadMore")||p("knownFacts.loadMore")}):void 0}),ee=Z?(0,eh.jsx)(Hf,{children:(0,eh.jsx)(yt,{className:"memori-chat-history-drawer--resume-cta",variant:"primary",onClick:V,children:p("chatResume.resume",{defaultValue:"Resume conversation"})})}):void 0,et=Z?(0,eh.jsxs)("span",{className:"memori-chat-history-drawer--heading",children:[(0,eh.jsx)(yt,{variant:"ghost",shape:"circle",size:"sm",type:"button",className:"memori-chat-history-drawer--heading-button","aria-label":p("write_and_speak.backToConversationList")||"Back to the list",title:p("write_and_speak.backToConversationList")||"Back to the list",icon:(0,eh.jsx)(Jp,{"aria-hidden":!0}),onClick:()=>_(null)}),(0,eh.jsxs)("span",{className:"memori-chat-history-drawer--heading-text",children:[(0,eh.jsx)(_H,{title:q,placement:"bottom-start",children:(0,eh.jsx)("span",{className:"memori-chat-history-drawer--heading-title",children:q})}),(0,eh.jsx)("span",{className:"memori-chat-history-drawer--heading-meta",children:null==$?void 0:$.subtitle})]}),(0,eh.jsx)(Gc,{type:"button",className:"memori-chat-history-drawer--heading-button","aria-label":p("write_and_speak.downloadThisConversation")||"Download this conversation",title:p("write_and_speak.downloadThisConversation")||"Download this conversation",icon:(0,eh.jsx)(H5,{"aria-hidden":!0}),onClick:()=>y&&G(y)})]}):p("write_and_speak.chatHistory")||"Chat history";return(0,eh.jsx)(Hm,{open:e,size:"md",width:"45rem",className:(b(tT))("memori-chat-history-drawer",{"memori-chat-history-drawer--detail":Z}),title:et,closeLabel:p("close")||"Close",footer:Z?ee:Q,onClose:t,children:Z&&$?(0,eh.jsx)(JQ,{embedded:!0,isOpen:!0,session:$,memori:i,onResume:V,onClose:()=>_(null),onExportChat:()=>y&&G(y),showFunctionCache:c,showMessageConsumption:d}):(0,eh.jsxs)(eh.Fragment,{children:[(0,eh.jsxs)("div",{className:"memori-chat-history-drawer--toolbar",children:[(0,eh.jsx)("div",{className:"memori-chat-history-drawer--toolbar-row",children:(0,eh.jsxs)("div",{className:"memori-chat-history-drawer--search",children:[(0,eh.jsx)("label",{className:"sr-only",htmlFor:"memori-chat-history-search",children:p("write_and_speak.searchInChatHistory")}),(0,eh.jsx)(xM,{id:"memori-chat-history-search",fullWidth:!0,prefix:(0,eh.jsx)(Ji,{"aria-hidden":!0}),value:x,placeholder:p("write_and_speak.searchInChatHistory")||"",onValueChange:w})]})}),(0,eh.jsx)(yt,{variant:"ghost",type:"button",className:"memori-chat-history-drawer--filters-toggle","aria-expanded":E,icon:(0,eh.jsx)(Hg,{"aria-hidden":!0,className:(b(tT))("memori-chat-history-drawer--filters-chevron",E&&"memori-chat-history-drawer--filters-chevron--open")}),iconPosition:"right",onClick:()=>A(e=>!e),children:(0,eh.jsxs)("span",{className:"memori-chat-history-drawer--filters-toggle-label",children:[p("write_and_speak.filters"),z>0&&(0,eh.jsx)("span",{className:"memori-chat-history-drawer--filters-count","aria-label":String(z),children:z})]})}),E&&(0,eh.jsxs)("div",{className:"memori-chat-history-drawer--filters",children:[(0,eh.jsx)(x3,{className:"memori-chat-history-drawer--filters-select",value:T,displayValue:"all"===T?p("all")||"All":p(T),onChange:e=>{e&&I(e)},options:[{label:p("all")||"All",value:"all"},{label:p("today")||"Today",value:"today"},{label:p("yesterday")||"Yesterday",value:"yesterday"},{label:p("last_7_days")||"Last 7 days",value:"last_7_days"},{label:p("last_30_days")||"Last 30 days",value:"last_30_days"}]}),(0,eh.jsxs)("div",{className:"memori-chat-history-drawer--filters-messages",children:[(0,eh.jsx)(x3,{className:"memori-chat-history-drawer--filters-select",value:String(C),displayValue:0===C?p("chatLogs.customMinimumMessages")||"Customize the number of messages":p("chatLogs.atLeast"+C)||`At least ${C} messages`,onChange:e=>{M(e?Number(e):0)},options:[{value:"1",label:p("chatLogs.anyMessage")||"Any message"},{value:"2",label:p("chatLogs.atLeast2")||"At least 2 messages"},{value:"3",label:p("chatLogs.atLeast3")||"At least 3 messages"},{value:"5",label:p("chatLogs.atLeast5")||"At least 5 messages"},{value:"10",label:p("chatLogs.atLeast10")||"At least 10 messages"},{value:"15",label:p("chatLogs.atLeast15")||"At least 15 messages"},{value:"20",label:p("chatLogs.atLeast20")||"At least 20 messages"},{value:"0",label:p("chatLogs.customMinimumMessages")||"Customize the number of messages"}]}),0===C&&(0,eh.jsx)("input",{type:"number",min:1,value:N,onChange:e=>{R(parseInt(e.target.value,10)||1)},className:"memori-chat-history-drawer--filters-custom","aria-label":p("chatLogs.customMinimumMessages")||"Customize the number of messages"})]})]})]}),O&&(0,eh.jsxs)("div",{className:"memori-chat-history-drawer--loading",children:[(0,eh.jsx)(bV,{spinning:!0,primary:!0}),(0,eh.jsx)("p",{children:p("write_and_speak.loadingChatHistory")||"Loading chat history..."})]}),B&&(0,eh.jsx)("div",{className:"memori-chat-history-drawer--error",role:"alert",children:(0,eh.jsx)("p",{children:B})}),K&&(0,eh.jsx)(Hp,{icon:(0,eh.jsx)($t,{}),title:p("write_and_speak.noChatHistoryAvailable")||"No chat history available"}),Y&&(0,eh.jsx)(Hp,{icon:(0,eh.jsx)(Ji,{}),title:p("write_and_speak.noResultsFound",{searchText:S})}),!O&&!B&&J.length>0&&(0,eh.jsx)("div",{className:"memori-chat-history-drawer--groups",children:J.map(e=>(0,eh.jsxs)("section",{className:"memori-chat-history-drawer--group",children:[(0,eh.jsx)("h3",{className:"memori-chat-history-drawer--group-label",children:(e=>{if("thisWeek"===e.type)return p("write_and_speak.thisWeek")||"This week";let t=new Intl.DateTimeFormat(m.language,{month:"long",...e.year===new Date().getFullYear()?{}:{year:"numeric"}}).format(new Date(e.year,e.month,1));return t.charAt(0).toUpperCase()+t.slice(1)})(e.key)}),(0,eh.jsx)("ul",{className:"memori-chat-history-drawer--list","aria-label":p("write_and_speak.chatHistory")||"Chat history",children:e.items.map(e=>{let t=J3(e)||`Chat-${e.chatLogID.substring(0,4)}`,n=e.sessionID===r,i=W(e),a=JK(e.lines);return(0,eh.jsx)("li",{children:(0,eh.jsxs)("div",{className:(b(tT))("memori-chat-history-drawer--list-item",{"memori-chat-history-drawer--list-item--disabled":n}),children:[(0,eh.jsx)("button",{type:"button",className:"memori-chat-history-drawer--list-item-main","aria-disabled":n||void 0,"aria-label":t,disabled:n,onClick:()=>{n||_(e)},children:(0,eh.jsxs)("span",{className:"memori-chat-history-drawer--list-item--content",children:[(0,eh.jsx)("span",{className:"memori-chat-history-drawer--list-item--title",title:t,children:t}),(0,eh.jsxs)("span",{className:"memori-chat-history-drawer--list-item--meta",children:[a&&(0,eh.jsx)("time",{dateTime:a.toISOString(),children:i}),!a&&i]})]})}),(0,eh.jsx)(HM,{"aria-hidden":!0,className:"memori-chat-history-drawer--list-item-chevron"})]})},e.chatLogID)})})]},"thisWeek"===e.key.type?"thisWeek":`${e.key.year}-${e.key.month}`))})]})})};async function J5(e){return new Promise((t,n)=>{let r=window.AudioContext||window.webkitAudioContext;if(!r)return void n(Error("AudioContext not supported in this browser"));let i=new r,a=new FileReader;a.onload=async()=>{try{let e=a.result;"suspended"===i.state&&await i.resume();let n=await i.decodeAudioData(e),r=function(e){let t=e.length,n=e.sampleRate,r=e.numberOfChannels,i=new ArrayBuffer(44+t*r*2),a=new DataView(i),o=(e,t)=>{for(let n=0;n<t.length;n++)a.setUint8(e+n,t.charCodeAt(n))};o(0,"RIFF"),a.setUint32(4,36+t*r*2,!0),o(8,"WAVE"),o(12,"fmt "),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,r,!0),a.setUint32(24,n,!0),a.setUint32(28,n*r*2,!0),a.setUint16(32,2*r,!0),a.setUint16(34,16,!0),o(36,"data"),a.setUint32(40,t*r*2,!0);let s=44;for(let n=0;n<t;n++)for(let t=0;t<r;t++){let r=Math.max(-1,Math.min(1,e.getChannelData(t)[n]));a.setInt16(s,r<0?32768*r:32767*r,!0),s+=2}return new Blob([i],{type:"audio/wav"})}(n);await i.close(),t(r)}catch(e){n(e)}},a.onerror=()=>{n(Error("Failed to read audio file"))},a.readAsArrayBuffer(e)})}var em=(ec("85Hg2"),ec("85Hg2"));function J6(e,...t){for(let n of t){let t=e[n];if("string"==typeof t&&t.length>0)return t}}async function J8(e,t,n){if(!t)throw Error("Missing sessionId for NATS config request");let r=await fetch(`${e}/api/nats?sessionId=${encodeURIComponent(t)}`,{signal:n});if(!r.ok){let e=await r.json().catch(()=>({}));switch(r.status){case 400:throw Error(e.error||"NATS config error: missing sessionId");case 404:throw Error(e.error||"NATS config error: invalid session");case 500:throw Error(e.error||"NATS config error: NATS configuration missing");default:throw Error(e.error||`NATS config error: ${r.status}`)}}return function(e){let t=J6(e,"url"),n=J6(e,"token");if(!t||!n)throw Error("Invalid response from NATS config service");let r=function(e,...t){for(let n of t){let t=e[n];if("boolean"==typeof t)return t}}(e,"useJetStream","use_jetstream"),i=J6(e,"stream","streamName","stream_name"),a=J6(e,"consumer","consumerName","consumer_name","durableName","durable_name"),o=J6(e,"subject","filterSubject","filter_subject");if(r&&!i)throw Error("Invalid response from NATS config service: JetStream enabled but stream missing");return{url:t,token:n,...i?{stream:i}:{},...a?{consumer:a}:{},...o?{subject:o}:{}}}(await r.json())}"use strict";"use strict";var em=ec("85Hg2"),J7={};Object.defineProperty(J7,"__esModule",{value:!0}),J7.wsconnect=J7.usernamePasswordAuthenticator=J7.UserAuthenticationExpiredError=J7.tokenAuthenticator=J7.TimeoutError=J7.syncIterator=J7.RequestError=J7.ProtocolError=J7.PermissionViolationError=J7.nuid=J7.Nuid=J7.NoRespondersError=J7.nkeys=J7.nkeyAuthenticator=J7.nanos=J7.MsgHdrsImpl=J7.millis=J7.Metric=J7.Match=J7.jwtAuthenticator=J7.InvalidSubjectError=J7.InvalidOperationError=J7.InvalidArgumentError=J7.headers=J7.hasWsProtocol=J7.errors=J7.Empty=J7.DrainingConnectionError=J7.delay=J7.deferred=J7.deadline=J7.credsAuthenticator=J7.createInbox=J7.ConnectionError=J7.ClosedConnectionError=J7.canonicalMIMEHeaderKey=J7.buildAuthenticator=J7.Bench=J7.backoff=J7.AuthorizationError=void 0;"use strict";var J9={},Ke=J9&&J9.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),Kt=J9&&J9.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||Ke(t,e,n)};Object.defineProperty(J9,"__esModule",{value:!0}),J9.Metric=J9.Bench=J9.writeAll=J9.readAll=J9.MAX_SIZE=J9.DenoBuffer=J9.State=J9.Parser=J9.Kind=J9.describe=J9.QueuedIteratorImpl=J9.usernamePasswordAuthenticator=J9.tokenAuthenticator=J9.nkeyAuthenticator=J9.jwtAuthenticator=J9.credsAuthenticator=J9.RequestOne=J9.parseOptions=J9.hasWsProtocol=J9.defaultOptions=J9.DEFAULT_MAX_RECONNECT_ATTEMPTS=J9.checkUnsupportedOption=J9.checkOptions=J9.buildAuthenticator=J9.DataBuffer=J9.MuxSubscription=J9.Heartbeat=J9.MsgHdrsImpl=J9.headers=J9.canonicalMIMEHeaderKey=J9.timeout=J9.SimpleMutex=J9.render=J9.nanos=J9.millis=J9.extend=J9.delay=J9.deferred=J9.deadline=J9.collect=J9.backoff=J9.ProtocolHandler=J9.INFO=J9.Connect=J9.setTransportFactory=J9.getResolveFn=J9.MsgImpl=J9.nuid=J9.Nuid=J9.NatsConnectionImpl=void 0,J9.UserAuthenticationExpiredError=J9.TimeoutError=J9.RequestError=J9.ProtocolError=J9.PermissionViolationError=J9.NoRespondersError=J9.InvalidSubjectError=J9.InvalidOperationError=J9.InvalidArgumentError=J9.errors=J9.DrainingConnectionError=J9.ConnectionError=J9.ClosedConnectionError=J9.AuthorizationError=J9.wsUrlParseFn=J9.wsconnect=J9.Servers=J9.isIPV4OrHostname=J9.IdleHeartbeatMonitor=J9.Subscriptions=J9.SubscriptionImpl=J9.syncIterator=J9.Match=J9.createInbox=J9.protoLen=J9.extractProtocolMessage=J9.Empty=J9.parseSemVer=J9.Features=J9.Feature=J9.compare=J9.parseIP=J9.isIP=J9.ipV4=J9.TE=J9.TD=void 0;"use strict";var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.NatsConnectionImpl=void 0;"use strict";var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.SimpleMutex=Kr.Perf=void 0,Kr.extend=function(e,...t){for(let n=0;n<t.length;n++){let r=t[n];Object.keys(r).forEach(function(t){e[t]=r[t]})}return e},Kr.render=function(e){return Ki.TD.decode(e).replace(/\n/g,"␊").replace(/\r/g,"␍")},Kr.timeout=function(e,t=!0){let n,r,i=t?new Ka.TimeoutError:null;return Object.assign(new Promise((t,a)=>{n={cancel:()=>{r&&clearTimeout(r)}},r=setTimeout(()=>{null===i?a(new Ka.TimeoutError):a(i)},e)}),n)},Kr.delay=function(e=0){let t;return Object.assign(new Promise(n=>{let r=setTimeout(()=>{n()},e);t={cancel:()=>{r&&(clearTimeout(r),n())}}}),t)},Kr.deadline=Kb,Kr.deferred=K_,Kr.debugDeferred=function(){let e={};return Object.assign(new Promise((t,n)=>{e={resolve:e=>{console.trace("resolve",e),t(e)},reject:e=>{console.trace("reject"),n(e)}}}),e)},Kr.shuffle=function(e){for(let t=e.length-1;t>0;t--){let n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e},Kr.collect=Kx,Kr.jitter=Kw,Kr.backoff=function(e=[0,250,250,500,500,3e3,5e3]){Array.isArray(e)||(e=[0,250,250,500,500,3e3,5e3]);let t=e.length-1;return{backoff:n=>Kw(n>t?e[t]:e[n])}},Kr.nanos=function(e){return 1e6*e},Kr.millis=function(e){return Math.floor(e/1e6)},Kr.randomToken=function(){let e=Math.floor(0xc694446f0100*Math.random()),t=e%62;return String.fromCharCode(KS[t],KS[t=(e=(e-t)/62)%62],KS[t=(e=(e-t)/62)%62],KS[t=(e=(e-t)/62)%62],KS[t=(e=(e-t)/62)%62],KS[t=(e=(e-t)/62)%62],KS[t=(e=(e-t)/62)%62],KS[e=(e-t)/62])};"use strict";var Ki={};Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.TD=Ki.TE=Ki.Empty=void 0,Ki.encode=function(...e){let t=[];for(let n=0;n<e.length;n++)t.push(Ki.TE.encode(e[n]));return 0===t.length?Ki.Empty:1===t.length?t[0]:function(...e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].length;let n=new Uint8Array(t),r=0;for(let t=0;t<e.length;t++)n.set(e[t],r),r+=e[t].length;return n}(...t)},Ki.decode=function(e){return e&&0!==e.length?Ki.TD.decode(e):""},Ki.Empty=new Uint8Array(0),Ki.TE=new TextEncoder,Ki.TD=new TextDecoder;var Ka={};Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.errors=Ka.PermissionViolationError=Ka.NoRespondersError=Ka.TimeoutError=Ka.RequestError=Ka.ProtocolError=Ka.ConnectionError=Ka.DrainingConnectionError=Ka.ClosedConnectionError=Ka.AuthorizationError=Ka.UserAuthenticationExpiredError=Ka.InvalidOperationError=Ka.InvalidArgumentError=Ka.InvalidSubjectError=void 0;class Ko extends Error{constructor(e,t){super(`illegal subject: '${e}'`,t),this.name="InvalidSubjectError"}}Ka.InvalidSubjectError=Ko;class Ks extends Error{constructor(e,t){super(e,t),this.name="InvalidArgumentError"}static format(e,t,n){return Array.isArray(t)&&t.length>1&&(t=t[0]),e=Array.isArray(e)?(e=e.map(e=>`'${e}'`)).join(","):`'${e}'`,new Ks(`${e} ${t}`,n)}}Ka.InvalidArgumentError=Ks;class Kl extends Error{constructor(e,t){super(e,t),this.name="InvalidOperationError"}}Ka.InvalidOperationError=Kl;class Ku extends Error{constructor(e,t){super(e,t),this.name="UserAuthenticationExpiredError"}static parse(e){return -1!==e.toLowerCase().indexOf("user authentication expired")?new Ku(e):null}}Ka.UserAuthenticationExpiredError=Ku;class Kc extends Error{constructor(e,t){super(e,t),this.name="AuthorizationError"}static parse(e){let t=["authorization violation","account authentication expired","authentication timeout"],n=e.toLowerCase();for(let r=0;r<t.length;r++)if(-1!==n.indexOf(t[r]))return new Kc(e);return null}}Ka.AuthorizationError=Kc;class Kd extends Error{constructor(){super("closed connection"),this.name="ClosedConnectionError"}}Ka.ClosedConnectionError=Kd;class Kh extends Error{constructor(){super("connection draining"),this.name="DrainingConnectionError"}}Ka.DrainingConnectionError=Kh;class Kp extends Error{constructor(e,t){super(e,t),this.name="ConnectionError"}}Ka.ConnectionError=Kp;class Km extends Error{constructor(e,t){super(e,t),this.name="ProtocolError"}}Ka.ProtocolError=Km;class Kf extends Error{constructor(e="",t){super(e,t),this.name="RequestError"}isNoResponders(){return this.cause instanceof Kv}}Ka.RequestError=Kf;class Kg extends Error{constructor(e){super("timeout",e),this.name="TimeoutError"}}Ka.TimeoutError=Kg;class Kv extends Error{subject;constructor(e,t){super(`no responders: '${e}'`,t),this.subject=e,this.name="NoResponders"}}Ka.NoRespondersError=Kv;class Ky extends Error{operation;subject;queue;constructor(e,t,n,r,i){super(e,i),this.name="PermissionViolationError",this.operation=t,this.subject=n,this.queue=r}static parse(e){let t;if(-1===(e?e.toLowerCase():"").indexOf("permissions violation"))return null;let n="publish",r="",i=e.match(/(Publish|Subscription) to "(\S+)"/);if(i&&(n=i[1].toLowerCase(),r=i[2],"subscription"===n)){let n=e.match(/using queue "(\S+)"/);n&&(t=n[1])}return new Ky(e,n,r,t)}}async function Kb(e,t=1e3){let n=K_(),r=setTimeout(()=>{n.reject(new Ka.TimeoutError)},t);try{return await Promise.race([e,n])}finally{clearTimeout(r)}}function K_(){let e={};return Object.assign(new Promise((t,n)=>{e={resolve:t,reject:n}}),e)}async function Kx(e){let t=[];for await(let n of e)t.push(n);return t}function Kw(e){return 0===e?0:Math.floor(e/2+Math.random()*e)}Ka.PermissionViolationError=Ky,Ka.errors={AuthorizationError:Kc,ClosedConnectionError:Kd,ConnectionError:Kp,DrainingConnectionError:Kh,InvalidArgumentError:Ks,InvalidOperationError:Kl,InvalidSubjectError:Ko,NoRespondersError:Kv,PermissionViolationError:Ky,ProtocolError:Km,RequestError:Kf,TimeoutError:Kg,UserAuthenticationExpiredError:Ku},Kr.Perf=class{timers;measures;constructor(){this.timers=new Map,this.measures=new Map}mark(e){this.timers.set(e,performance.now())}measure(e,t,n){let r=this.timers.get(t);if(void 0===r)throw Error(`${t} is not defined`);let i=this.timers.get(n);if(void 0===i)throw Error(`${n} is not defined`);this.measures.set(e,i-r)}getEntries(){let e=[];return this.measures.forEach((t,n)=>{e.push({name:n,duration:t})}),e}},Kr.SimpleMutex=class{max;current;waiting;constructor(e=1){this.max=e,this.current=0,this.waiting=[]}lock(){if(this.current++,this.current<=this.max)return Promise.resolve();let e=K_();return this.waiting.push(e),e}unlock(){this.current--;let e=this.waiting.pop();e?.resolve()}};let KS=new Uint8Array(62);for(let e=0;e<62;e++)KS[e]="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".charCodeAt(e);"use strict";"use strict";var KE={};Object.defineProperty(KE,"__esModule",{value:!0}),KE.ProtocolHandler=KE.Subscriptions=KE.SubscriptionImpl=KE.Connect=KE.INFO=void 0;"use strict";var KA={};Object.defineProperty(KA,"__esModule",{value:!0}),KA.LF=KA.CR=KA.CRLF=KA.CR_LF_LEN=KA.CR_LF=void 0,KA.setTransportFactory=function(e){c=e},KA.defaultPort=function(){return void 0!==c&&void 0!==c.defaultPort?c.defaultPort:KT.DEFAULT_PORT},KA.getUrlParseFn=function(){return void 0!==c&&c.urlParseFn?c.urlParseFn:void 0},KA.newTransport=function(){if(!c||"function"!=typeof c.factory)throw Error("transport fn is not set");return c.factory()},KA.getResolveFn=function(){return void 0!==c&&c.dnsResolveFn?c.dnsResolveFn:void 0},KA.protoLen=KD,KA.extractProtocolMessage=function(e){let t=KD(e);if(t>0){let n=new Uint8Array(e).slice(0,t);return Ki.TD.decode(n)}return""};"use strict";var KT={};Object.defineProperty(KT,"__esModule",{value:!0}),KT.DEFAULT_HOST=KT.DEFAULT_PORT=KT.Match=void 0,KT.syncIterator=function(e){let t=e[Symbol.asyncIterator]();return{async next(){let e=await t.next();return e.done?Promise.resolve(null):Promise.resolve(e.value)}}},KT.createInbox=function(e=""){if("string"!=typeof(e=e||"_INBOX"))throw TypeError("prefix must be a string");return e.split(".").forEach(t=>{if("*"===t||">"===t)throw Ka.InvalidArgumentError.format("prefix",`cannot have wildcards ('${e}')`)}),`${e}.${KI.nuid.next()}`};"use strict";var KI={};Object.defineProperty(KI,"__esModule",{value:!0}),KI.nuid=KI.Nuid=void 0;"use strict";var KC={};Object.defineProperty(KC,"__esModule",{value:!0}),KC.nuid=KC.Nuid=void 0;var KM={};Object.defineProperty(KM,"__esModule",{value:!0}),KM.nuid=KM.NuidImpl=void 0;let KN=new Uint8Array(62);for(let e=0;e<62;e++)KN[e]="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".charCodeAt(e);let KR=BigInt(62)**BigInt(10),KO=Number(KR/(1n<<32n)),KP=Number(KR%(1n<<32n));class Kk{buf;cbuf;seqHi;seqLo;inc;inited;constructor(){this.buf=new Uint8Array(22),this.cbuf=new Uint8Array(12),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){let e=0;do this.seqHi=Math.floor(Math.random()*(KO+1)),this.seqLo=Math.floor(0x100000000*Math.random());while(e++<8&&this.seqHi===KO&&this.seqLo>=KP)this.seqHi===KO&&this.seqLo>=KP&&(this.seqLo=0),this.inc=300*Math.random()+33|0}setPre(){var e=this.cbuf;if(globalThis?.crypto?.getRandomValues)globalThis.crypto.getRandomValues(e);else for(let t=0;t<e.length;t++)e[t]=Math.floor(256*Math.random());for(let e=0;e<12;e++)this.buf[e]=KN[this.cbuf[e]%62]}fillSeq(){let e=this.seqHi,t=this.seqLo;for(let n=21;n>=12;n--){let r=Math.floor(e/62),i=(e-62*r)*0x100000000+t,a=Math.floor(i/62),o=i-62*a;this.buf[n]=KN[o],e=r,t=a}}next(){this.inited||this.init(),this.seqLo+=this.inc,this.seqLo>=0x100000000&&(this.seqLo-=0x100000000,this.seqHi+=1),(this.seqHi>KO||this.seqHi===KO&&this.seqLo>=KP)&&(this.setPre(),this.initSeqAndInc()),this.fillSeq();let e=this.buf;return String.fromCharCode(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15],e[16],e[17],e[18],e[19],e[20],e[21])}reset(){this.init()}}"use strict";KM.NuidImpl=Kk,KM.nuid=new Kk,KC.Nuid=KM.NuidImpl,KC.nuid=KM.nuid,Object.defineProperty(KI,"Nuid",{enumerable:!0,get:function(){return KC.Nuid}}),Object.defineProperty(KI,"nuid",{enumerable:!0,get:function(){return KC.nuid}}),KT.Match={Exact:"exact",CanonicalMIME:"canonical",IgnoreCase:"insensitive"},KT.DEFAULT_PORT=4222,KT.DEFAULT_HOST="127.0.0.1";var KL={};function KD(e){for(let t=0;t<e.length;t++){let n=t+1;if(e.byteLength>n&&e[t]===KA.CR&&e[n]===KA.LF)return n+1}return 0}"use strict";Object.defineProperty(KL,"__esModule",{value:!0}),KL.DataBuffer=void 0,KL.DataBuffer=class{buffers;byteLength;constructor(){this.buffers=[],this.byteLength=0}static concat(...e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].length;let n=new Uint8Array(t),r=0;for(let t=0;t<e.length;t++)n.set(e[t],r),r+=e[t].length;return n}static fromAscii(e){return e||(e=""),Ki.TE.encode(e)}static toAscii(e){return Ki.TD.decode(e)}reset(){this.buffers.length=0,this.byteLength=0}pack(){if(this.buffers.length>1){let e=new Uint8Array(this.byteLength),t=0;for(let n=0;n<this.buffers.length;n++)e.set(this.buffers[n],t),t+=this.buffers[n].length;this.buffers.length=0,this.buffers.push(e)}}shift(){if(this.buffers.length){let e=this.buffers.shift();if(e)return this.byteLength-=e.length,e}return new Uint8Array(0)}drain(e){if(this.buffers.length){this.pack();let t=this.buffers.pop();if(t){let n=this.byteLength;(void 0===e||e>n)&&(e=n);let r=t.subarray(0,e);return n>e&&this.buffers.push(t.subarray(e)),this.byteLength=n-e,r}}return new Uint8Array(0)}fill(e,...t){e&&(this.buffers.push(e),this.byteLength+=e.length);for(let e=0;e<t.length;e++)t[e]&&t[e].length&&(this.buffers.push(t[e]),this.byteLength+=t[e].length)}peek(){return this.buffers.length?(this.pack(),this.buffers[0]):new Uint8Array(0)}size(){return this.byteLength}length(){return this.buffers.length}},KA.CR_LF="\r\n",KA.CR_LF_LEN=KA.CR_LF.length,KA.CRLF=KL.DataBuffer.fromAscii(KA.CR_LF),KA.CR=new Uint8Array(KA.CRLF)[0],KA.LF=new Uint8Array(KA.CRLF)[1];"use strict";var KB={};Object.defineProperty(KB,"__esModule",{value:!0}),KB.Servers=KB.ServerImpl=void 0,KB.isIPV4OrHostname=KH,KB.hostPort=KG;var KF={};function KU(e,t,n,r){let i=new Uint8Array(16);return[0,0,0,0,0,0,0,0,0,0,255,255].forEach((e,t)=>{i[t]=e}),i[12]=e,i[13]=t,i[14]=n,i[15]=r,i}function Kj(e){for(let t=0;t<e.length;t++)switch(e[t]){case".":return Kz(e);case":":return function(e){let t=new Uint8Array(16),n=-1;if(e.length>=2&&":"===e[0]&&":"===e[1]&&(n=0,0===(e=e.substring(2)).length))return t;let r=0;for(;r<16;){let{n:i,c:a,ok:o}=function(e){let t=0,n=0;for(n=0;n<e.length;n++){if(48<=e.charCodeAt(n)&&57>=e.charCodeAt(n))t*=16,t+=e.charCodeAt(n)-48;else if(97<=e.charCodeAt(n)&&102>=e.charCodeAt(n))t*=16,t+=e.charCodeAt(n)-97+10;else if(65<=e.charCodeAt(n)&&70>=e.charCodeAt(n))t*=16,t+=e.charCodeAt(n)-65+10;else break;if(t>=0xffffff)return{n:0,c:n,ok:!1}}return 0===n?{n:0,c:n,ok:!1}:{n:t,c:n,ok:!0}}(e);if(!o||i>65535)return;if(a<e.length&&"."===e[a]){if(n<0&&12!=r||r+4>16)return;let i=Kz(e);if(void 0===i)return;t[r]=i[12],t[r+1]=i[13],t[r+2]=i[14],t[r+3]=i[15],e="",r+=4;break}if(t[r]=i>>8,t[r+1]=i,r+=2,0===(e=e.substring(a)).length)break;if(":"!==e[0]||1==e.length)return;if(":"===(e=e.substring(1))[0]){if(n>=0)return;if(n=r,0===(e=e.substring(1)).length)break}}if(0===e.length){if(r<16){if(n<0)return;let e=16-r;for(let i=r-1;i>=n;i--)t[i+e]=t[i];for(let r=n+e-1;r>=n;r--)t[r]=0}else if(n>=0)return;return t}}(e)}}function Kz(e){let t=new Uint8Array(4);for(let n=0;n<4;n++){if(0===e.length)return;if(n>0){if("."!==e[0])return;e=e.substring(1)}let{n:r,c:i,ok:a}=function(e){let t=0,n=0;for(t=0;t<e.length&&48<=e.charCodeAt(t)&&57>=e.charCodeAt(t);t++)if((n=10*n+(e.charCodeAt(t)-48))>=0xffffff)return{n:0xffffff,c:t,ok:!1};return 0===t?{n:0,c:0,ok:!1}:{n:n,c:t,ok:!0}}(e);if(!a||r>255)return;e=e.substring(i),t[n]=r}return KU(t[0],t[1],t[2],t[3])}function KH(e){return -1===e.indexOf("[")&&-1===e.indexOf("::")&&(-1!==e.indexOf(".")||!!(e.split(":").length<=2))}Object.defineProperty(KF,"__esModule",{value:!0}),KF.ipV4=KU,KF.isIP=function(e){return void 0!==Kj(e)},KF.parseIP=Kj;function KG(e){(e=e.trim()).match(/^(.*:\/\/)(.*)/m)&&(e=e.replace(/^(.*:\/\/)(.*)/gm,"$2")),KH(e=function(e){let t="::FFFF:",n=e.toUpperCase().indexOf(t);if(-1!==n&&-1!==e.indexOf(".")){let r=e.substring(n+t.length);return(r=r.replace("[","")).replace("]","")}return e}(e))||-1!==e.indexOf("[")||(e=`[${e}]`);let t=KH(e)?e.match(/(:)(\d+)/):e.match(/(]:)(\d+)/),n=t&&3===t.length&&t[1]&&t[2]?parseInt(t[2]):KT.DEFAULT_PORT,r=new URL(`${80===n?"https":"http"}://${e}`);r.port=`${n}`;let i=r.hostname;return"["===i.charAt(0)&&(i=i.substring(1,i.length-1)),{listen:r.host,hostname:i,port:n}}class KV{src;listen;hostname;port;didConnect;reconnects;lastConnect;gossiped;tlsName;resolves;constructor(e,t=!1){this.src=e,this.tlsName="";let n=KG(e);this.listen=n.listen,this.hostname=n.hostname,this.port=n.port,this.didConnect=!1,this.reconnects=0,this.lastConnect=0,this.gossiped=t}toString(){return this.listen}async resolve(e){if(!e.fn||!1===e.resolve)return[this];let t=[];if((0,KF.isIP)(this.hostname))return[this];{let n=await e.fn(this.hostname);for(let r of(e.debug&&console.log(`resolve ${this.hostname} = ${n.join(",")}`),n)){let e=80===this.port?"https":"http",n=new URL(`${e}://${!KH(r)?"["+r+"]":r}`);n.port=`${this.port}`;let i=new KV(n.host,!1);i.tlsName=this.hostname,t.push(i)}}return e.randomize&&(0,Kr.shuffle)(t),this.resolves=t,t}}"use strict";KB.ServerImpl=KV,KB.Servers=class e{firstSelect;servers;currentServer;tlsName;randomize;constructor(e={}){this.firstSelect=!0,this.servers=[],this.tlsName="",this.randomize=e.randomize||!1}setServers(e){if(!Array.isArray(e)||0===e.length)throw Ka.InvalidArgumentError.format("servers","cannot be empty");let t=(0,KA.getUrlParseFn)(),n=new Map;for(let e of this.servers)n.set(e.listen,e);let r=[];for(let i of e){let{listen:e}=KG(i=t?t(i):i),a=n.get(e);a?(a.gossiped=!1,r.push(a)):r.push(new KV(i))}this.randomize&&(0,Kr.shuffle)(r),this.servers=r,void 0!==this.currentServer&&r.includes(this.currentServer)||(this.currentServer=r[0],this.firstSelect=!0)}clear(){this.servers.length=0}updateTLSName(){let e=this.getCurrentServer();(0,KF.isIP)(e.hostname)||(this.tlsName=e.hostname,this.servers.forEach(e=>{e.gossiped&&(e.tlsName=this.tlsName)}))}getCurrentServer(){return this.currentServer}addServer(e,t=!1){let n=(0,KA.getUrlParseFn)(),r=new KV(e=n?n(e):e,t);(0,KF.isIP)(r.hostname)&&(r.tlsName=this.tlsName),this.servers.push(r)}selectServer(){if(this.firstSelect)return this.firstSelect=!1,this.currentServer;let e=this.servers.shift();return e&&(this.servers.push(e),this.currentServer=e),e}removeCurrentServer(){this.removeServer(this.currentServer)}removeServer(e){if(e){let t=this.servers.indexOf(e);this.servers.splice(t,1)}}snapshot(){return e.freezeAll(this.servers)}snapshotForHandler(){let t=this.currentServer;if(!t)return this.snapshot();let n=this.servers.indexOf(t);return n<=0?this.snapshot():e.freezeAll([t,...this.servers.slice(0,n),...this.servers.slice(n+1)])}static freezeAll(e){return e.map(e=>Object.freeze({hostname:e.hostname,port:e.port,listen:e.listen,src:e.src,tlsName:e.tlsName,reconnects:e.reconnects,lastConnect:e.lastConnect,gossiped:e.gossiped,didConnect:e.didConnect}))}find(e){return this.servers.find(t=>t.listen===e.listen)}setCurrent(e){this.currentServer=e}length(){return this.servers.length}next(){return this.servers.length?this.servers[0]:void 0}getServers(){return this.servers}update(e,t){let n=[],r=[],i=(0,KA.getUrlParseFn)(),a=new Map;e.connect_urls&&e.connect_urls.length>0&&e.connect_urls.forEach(e=>{let n=new KV(e=i?i(e,t):e,!0);a.set(e,n)});let o=[];if(this.servers.forEach((e,t)=>{let n=e.listen;e.gossiped&&this.currentServer.listen!==n&&void 0===a.get(n)&&o.push(t),a.delete(n)}),o.reverse(),o.forEach(e=>{let t=this.servers.splice(e,1);r=r.concat(t[0].listen)}),a.forEach((e,t)=>{this.servers.push(e),n.push(t)}),this.randomize&&n.length>0){let e=this.currentServer,t=this.servers.filter(t=>t!==e);(0,Kr.shuffle)(t),this.servers=e?[e,...t]:t}return{added:n,deleted:r}}};var KW={};Object.defineProperty(KW,"__esModule",{value:!0}),KW.QueuedIteratorImpl=void 0;class Kq{inflight;processed;received;noIterator;iterClosed;done;signal;yields;filtered;pendingFiltered;ctx;_data;err;time;profile;yielding;didBreak;constructor(){this.inflight=0,this.filtered=0,this.pendingFiltered=0,this.processed=0,this.received=0,this.noIterator=!1,this.done=!1,this.signal=(0,Kr.deferred)(),this.yields=[],this.iterClosed=(0,Kr.deferred)(),this.time=0,this.yielding=!1,this.didBreak=!1,this.profile=!1}[Symbol.asyncIterator](){return this.iterate()}push(e){if(!this.done){if(this.didBreak){if("function"==typeof e)try{e()}catch(e){}return}"function"==typeof e&&this.pendingFiltered++,this.yields.push(e),this.signal.resolve()}}async *iterate(){if(this.noIterator)throw new Ka.InvalidOperationError("iterator cannot be used when a callback is registered");if(this.yielding)throw new Ka.InvalidOperationError("iterator is already yielding");this.yielding=!0;try{for(;;){if(0===this.yields.length&&await this.signal,this.err)throw this.err;let e=this.yields;this.inflight=e.length,this.yields=[];for(let t=0;t<e.length;t++){if("function"==typeof e[t]){this.pendingFiltered--;let n=e[t];try{n()}catch(e){throw e}if(this.err)throw this.err;continue}this.processed++,this.inflight--;let n=this.profile?Date.now():0;yield e[t],this.time=this.profile?Date.now()-n:0}if(this.done)break;0===this.yields.length&&(e.length=0,this.yields=e,this.signal=(0,Kr.deferred)())}}finally{this.didBreak=!0,this.stop()}}stop(e){this.done||(this.err=e,this.done=!0,this.signal.resolve(),this.iterClosed.resolve(e))}getProcessed(){return this.noIterator?this.received:this.processed}getPending(){return this.yields.length+this.inflight-this.pendingFiltered}getReceived(){return this.received-this.filtered}}"use strict";KW.QueuedIteratorImpl=Kq;"use strict";var K$={};Object.defineProperty(K$,"__esModule",{value:!0}),K$.MuxSubscription=void 0,K$.MuxSubscription=class{baseInbox;reqs;constructor(){this.reqs=new Map}size(){return this.reqs.size}init(e){return this.baseInbox=`${(0,KT.createInbox)(e)}.`,this.baseInbox}add(e){isNaN(e.received)||(e.received=0),this.reqs.set(e.token,e)}get(e){return this.reqs.get(e)}cancel(e){this.reqs.delete(e.token)}getToken(e){let t=e.subject||"";return 0===t.indexOf(this.baseInbox)?t.substring(this.baseInbox.length):null}all(){return Array.from(this.reqs.values())}handleError(e,t){if(e)return this.all().forEach(e=>{e.resolver(t,{})}),!0;if("publish"===t.operation){let e=this.all().find(e=>e.requestSubject===t.subject);if(e)return e.resolver(t,{}),!0}return!1}dispatcher(){return(e,t)=>{let n=this.getToken(t);if(n){let r=this.get(n);r&&(null===e&&(e=t?.data?.length===0&&t.headers?.code===503?new Ka.NoRespondersError(r.requestSubject):null),r.resolver(e,t))}}}close(){let e=new Ka.RequestError("connection closed");this.reqs.forEach(t=>{t.resolver(e,{})})}};"use strict";var KJ={};Object.defineProperty(KJ,"__esModule",{value:!0}),KJ.Heartbeat=void 0,KJ.Heartbeat=class{ph;interval;maxOut;timer;pendings;constructor(e,t,n){this.ph=e,this.interval=t,this.maxOut=n,this.pendings=[]}start(){this.cancel(),this._schedule()}cancel(e){this.timer&&(clearTimeout(this.timer),this.timer=void 0),this._reset(),e&&this.ph.disconnect()}_schedule(){this.timer=setTimeout(()=>{if(this.ph.dispatchStatus({type:"ping",pendingPings:this.pendings.length+1}),this.pendings.length===this.maxOut)return void this.cancel(!0);let e=(0,Kr.deferred)();this.ph.flush(e).then(()=>{this._reset()}).catch(()=>{this.cancel()}),this.pendings.push(e),this._schedule()},this.interval)}_reset(){this.pendings=this.pendings.filter(e=>(e.resolve(),!1))}};"use strict";var KK={};Object.defineProperty(KK,"__esModule",{value:!0}),KK.cc=KK.State=KK.Parser=KK.Kind=void 0,KK.describe=function(e){let t,n="";switch(e.kind){case KK.Kind.MSG:t="MSG";break;case KK.Kind.OK:t="OK";break;case KK.Kind.ERR:t="ERR",n=Ki.TD.decode(e.data);break;case KK.Kind.PING:t="PING";break;case KK.Kind.PONG:t="PONG";break;case KK.Kind.INFO:t="INFO",n=Ki.TD.decode(e.data)}return`${t}: ${n}`};var KY={};Object.defineProperty(KY,"__esModule",{value:!0}),KY.DenoBuffer=KY.MAX_SIZE=KY.AssertionError=void 0,KY.assert=KZ,KY.concat=K0,KY.append=function(e,t){return K0(e,Uint8Array.of(t))},KY.readAll=function(e){let t=new K1;return t.readFrom(e),t.bytes()},KY.writeAll=function(e,t){let n=0;for(;n<t.length;)n+=e.write(t.subarray(n))};class KX extends Error{constructor(e){super(e),this.name="AssertionError"}}function KZ(e,t="Assertion failed."){if(!e)throw new KX(t)}function KQ(e,t,n=0){let r=t.byteLength-n;return e.byteLength>r&&(e=e.subarray(0,r)),t.set(e,n),e.byteLength}function K0(e,t){if(void 0===e&&void 0===t)return new Uint8Array(0);if(void 0===e)return t;if(void 0===t)return e;let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}KY.AssertionError=KX,KY.MAX_SIZE=0xfffffffe;class K1{_buf;_off;constructor(e){if(this._off=0,null==e){this._buf=new Uint8Array(0);return}this._buf=new Uint8Array(e)}bytes(e={copy:!0}){return!1===e.copy?this._buf.subarray(this._off):this._buf.slice(this._off)}empty(){return this._buf.byteLength<=this._off}get length(){return this._buf.byteLength-this._off}get capacity(){return this._buf.buffer.byteLength}truncate(e){if(0===e)return void this.reset();if(e<0||e>this.length)throw Error("bytes.Buffer: truncation out of range");this._reslice(this._off+e)}reset(){this._reslice(0),this._off=0}_tryGrowByReslice(e){let t=this._buf.byteLength;return e<=this.capacity-t?(this._reslice(t+e),t):-1}_reslice(e){KZ(e<=this._buf.buffer.byteLength),this._buf=new Uint8Array(this._buf.buffer,0,e)}readByte(){let e=new Uint8Array(1);return this.read(e)?e[0]:null}read(e){if(this.empty())return(this.reset(),0===e.byteLength)?0:null;let t=KQ(this._buf.subarray(this._off),e);return this._off+=t,t}writeByte(e){return this.write(Uint8Array.of(e))}writeString(e){return this.write(Ki.TE.encode(e))}write(e){let t=this._grow(e.byteLength);return KQ(e,this._buf,t)}_grow(e){let t=this.length;0===t&&0!==this._off&&this.reset();let n=this._tryGrowByReslice(e);if(n>=0)return n;let r=this.capacity;if(e<=Math.floor(r/2)-t)KQ(this._buf.subarray(this._off),this._buf);else if(r+e>KY.MAX_SIZE)throw Error("The buffer cannot be grown beyond the maximum size.");else{let t=new Uint8Array(Math.min(2*r+e,KY.MAX_SIZE));KQ(this._buf.subarray(this._off),t),this._buf=t}return this._off=0,this._reslice(Math.min(t+e,KY.MAX_SIZE)),t}grow(e){if(e<0)throw Error("Buffer._grow: negative count");let t=this._grow(e);this._reslice(t)}readFrom(e){let t=0,n=new Uint8Array(32768);for(;;){let r=this.capacity-this.length<32768,i=r?n:new Uint8Array(this._buf.buffer,this.length),a=e.read(i);if(null===a)return t;r?this.write(i.subarray(0,a)):this._reslice(this.length+a),t+=a}}}function K2(){let e={};return e.sid=-1,e.hdr=-1,e.size=-1,e}"use strict";KY.DenoBuffer=K1,KK.Kind={OK:0,ERR:1,MSG:2,INFO:3,PING:4,PONG:5},KK.Parser=class{dispatcher;state;as;drop;hdr;ma;argBuf;msgBuf;constructor(e){this.dispatcher=e,this.state=KK.State.OP_START,this.as=0,this.drop=0,this.hdr=0}parse(e){let t;for(t=0;t<e.length;t++){let n=e[t];switch(this.state){case KK.State.OP_START:switch(n){case KK.cc.M:case KK.cc.m:this.state=KK.State.OP_M,this.hdr=-1,this.ma=K2();break;case KK.cc.H:case KK.cc.h:this.state=KK.State.OP_H,this.hdr=0,this.ma=K2();break;case KK.cc.P:case KK.cc.p:this.state=KK.State.OP_P;break;case KK.cc.PLUS:this.state=KK.State.OP_PLUS;break;case KK.cc.MINUS:this.state=KK.State.OP_MINUS;break;case KK.cc.I:case KK.cc.i:this.state=KK.State.OP_I;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_H:switch(n){case KK.cc.M:case KK.cc.m:this.state=KK.State.OP_M;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_M:switch(n){case KK.cc.S:case KK.cc.s:this.state=KK.State.OP_MS;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_MS:switch(n){case KK.cc.G:case KK.cc.g:this.state=KK.State.OP_MSG;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_MSG:switch(n){case KK.cc.SPACE:case KK.cc.TAB:this.state=KK.State.OP_MSG_SPC;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_MSG_SPC:switch(n){case KK.cc.SPACE:case KK.cc.TAB:continue;default:this.state=KK.State.MSG_ARG,this.as=t}break;case KK.State.MSG_ARG:switch(n){case KK.cc.CR:this.drop=1;break;case KK.cc.NL:{let n=this.argBuf?this.argBuf.bytes():e.subarray(this.as,t-this.drop);this.processMsgArgs(n),this.drop=0,this.as=t+1,this.state=KK.State.MSG_PAYLOAD,t=this.as+this.ma.size-1;break}default:this.argBuf&&this.argBuf.writeByte(n)}break;case KK.State.MSG_PAYLOAD:if(this.msgBuf)if(this.msgBuf.length>=this.ma.size){let e=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:KK.Kind.MSG,msg:this.ma,data:e}),this.argBuf=void 0,this.msgBuf=void 0,this.state=KK.State.MSG_END}else{let r=this.ma.size-this.msgBuf.length,i=e.length-t;i<r&&(r=i),r>0?(this.msgBuf.write(e.subarray(t,t+r)),t=t+r-1):this.msgBuf.writeByte(n)}else t-this.as>=this.ma.size&&(this.dispatcher.push({kind:KK.Kind.MSG,msg:this.ma,data:e.subarray(this.as,t)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=KK.State.MSG_END);break;case KK.State.MSG_END:if(n!==KK.cc.NL)continue;this.drop=0,this.as=t+1,this.state=KK.State.OP_START;break;case KK.State.OP_PLUS:switch(n){case KK.cc.O:case KK.cc.o:this.state=KK.State.OP_PLUS_O;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_PLUS_O:switch(n){case KK.cc.K:case KK.cc.k:this.state=KK.State.OP_PLUS_OK;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_PLUS_OK:n===KK.cc.NL&&(this.dispatcher.push({kind:KK.Kind.OK}),this.drop=0,this.state=KK.State.OP_START);break;case KK.State.OP_MINUS:switch(n){case KK.cc.E:case KK.cc.e:this.state=KK.State.OP_MINUS_E;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_MINUS_E:switch(n){case KK.cc.R:case KK.cc.r:this.state=KK.State.OP_MINUS_ER;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_MINUS_ER:switch(n){case KK.cc.R:case KK.cc.r:this.state=KK.State.OP_MINUS_ERR;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_MINUS_ERR:switch(n){case KK.cc.SPACE:case KK.cc.TAB:this.state=KK.State.OP_MINUS_ERR_SPC;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_MINUS_ERR_SPC:switch(n){case KK.cc.SPACE:case KK.cc.TAB:continue;default:this.state=KK.State.MINUS_ERR_ARG,this.as=t}break;case KK.State.MINUS_ERR_ARG:switch(n){case KK.cc.CR:this.drop=1;break;case KK.cc.NL:{let n;this.argBuf?(n=this.argBuf.bytes(),this.argBuf=void 0):n=e.subarray(this.as,t-this.drop),this.dispatcher.push({kind:KK.Kind.ERR,data:n}),this.drop=0,this.as=t+1,this.state=KK.State.OP_START;break}default:this.argBuf&&this.argBuf.write(Uint8Array.of(n))}break;case KK.State.OP_P:switch(n){case KK.cc.I:case KK.cc.i:this.state=KK.State.OP_PI;break;case KK.cc.O:case KK.cc.o:this.state=KK.State.OP_PO;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_PO:switch(n){case KK.cc.N:case KK.cc.n:this.state=KK.State.OP_PON;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_PON:switch(n){case KK.cc.G:case KK.cc.g:this.state=KK.State.OP_PONG;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_PONG:n===KK.cc.NL&&(this.dispatcher.push({kind:KK.Kind.PONG}),this.drop=0,this.state=KK.State.OP_START);break;case KK.State.OP_PI:switch(n){case KK.cc.N:case KK.cc.n:this.state=KK.State.OP_PIN;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_PIN:switch(n){case KK.cc.G:case KK.cc.g:this.state=KK.State.OP_PING;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_PING:n===KK.cc.NL&&(this.dispatcher.push({kind:KK.Kind.PING}),this.drop=0,this.state=KK.State.OP_START);break;case KK.State.OP_I:switch(n){case KK.cc.N:case KK.cc.n:this.state=KK.State.OP_IN;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_IN:switch(n){case KK.cc.F:case KK.cc.f:this.state=KK.State.OP_INF;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_INF:switch(n){case KK.cc.O:case KK.cc.o:this.state=KK.State.OP_INFO;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_INFO:switch(n){case KK.cc.SPACE:case KK.cc.TAB:this.state=KK.State.OP_INFO_SPC;break;default:throw this.fail(e.subarray(t))}break;case KK.State.OP_INFO_SPC:switch(n){case KK.cc.SPACE:case KK.cc.TAB:continue;default:this.state=KK.State.INFO_ARG,this.as=t}break;case KK.State.INFO_ARG:switch(n){case KK.cc.CR:this.drop=1;break;case KK.cc.NL:{let n;this.argBuf?(n=this.argBuf.bytes(),this.argBuf=void 0):n=e.subarray(this.as,t-this.drop),this.dispatcher.push({kind:KK.Kind.INFO,data:n}),this.drop=0,this.as=t+1,this.state=KK.State.OP_START;break}default:this.argBuf&&this.argBuf.writeByte(n)}break;default:throw this.fail(e.subarray(t))}}this.state!==KK.State.MSG_ARG&&this.state!==KK.State.MINUS_ERR_ARG&&this.state!==KK.State.INFO_ARG||this.argBuf||(this.argBuf=new KY.DenoBuffer(e.subarray(this.as,t-this.drop))),this.state!==KK.State.MSG_PAYLOAD||this.msgBuf||(this.argBuf||this.cloneMsgArg(),this.msgBuf=new KY.DenoBuffer(e.subarray(this.as)))}cloneMsgArg(){let e=this.ma.subject.length,t=new Uint8Array(e+(this.ma.reply?this.ma.reply.length:0));t.set(this.ma.subject),this.ma.reply&&t.set(this.ma.reply,e),this.argBuf=new KY.DenoBuffer(t),this.ma.subject=t.subarray(0,e),this.ma.reply&&(this.ma.reply=t.subarray(e))}processMsgArgs(e){if(this.hdr>=0)return this.processHeaderMsgArgs(e);let t=[],n=-1;for(let r=0;r<e.length;r++)switch(e[r]){case KK.cc.SPACE:case KK.cc.TAB:case KK.cc.CR:case KK.cc.NL:n>=0&&(t.push(e.subarray(n,r)),n=-1);break;default:n<0&&(n=r)}switch(n>=0&&t.push(e.subarray(n)),t.length){case 3:this.ma.subject=t[0],this.ma.sid=this.protoParseInt(t[1]),this.ma.reply=void 0,this.ma.size=this.protoParseInt(t[2],0x4000000);break;case 4:this.ma.subject=t[0],this.ma.sid=this.protoParseInt(t[1]),this.ma.reply=t[2],this.ma.size=this.protoParseInt(t[3],0x4000000);break;default:throw this.fail(e,"processMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail(e,"processMsgArgs Bad or Missing Sid Error");if(this.ma.size<0)throw this.fail(e,"processMsgArgs Bad or Missing Size Error")}fail(e,t=""){return t=t?`${t} [${this.state}]`:`parse error [${this.state}]`,Error(`${t}: ${Ki.TD.decode(e)}`)}processHeaderMsgArgs(e){let t=[],n=-1;for(let r=0;r<e.length;r++)switch(e[r]){case KK.cc.SPACE:case KK.cc.TAB:case KK.cc.CR:case KK.cc.NL:n>=0&&(t.push(e.subarray(n,r)),n=-1);break;default:n<0&&(n=r)}switch(n>=0&&t.push(e.subarray(n)),t.length){case 4:this.ma.subject=t[0],this.ma.sid=this.protoParseInt(t[1]),this.ma.reply=void 0,this.ma.hdr=this.protoParseInt(t[2],0x4000000),this.ma.size=this.protoParseInt(t[3],0x4000000);break;case 5:this.ma.subject=t[0],this.ma.sid=this.protoParseInt(t[1]),this.ma.reply=t[2],this.ma.hdr=this.protoParseInt(t[3],0x4000000),this.ma.size=this.protoParseInt(t[4],0x4000000);break;default:throw this.fail(e,"processHeaderMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail(e,"processHeaderMsgArgs Bad or Missing Sid Error");if(this.ma.hdr<0||this.ma.hdr>this.ma.size)throw this.fail(e,"processHeaderMsgArgs Bad or Missing Header Size Error");if(this.ma.size<0)throw this.fail(e,"processHeaderMsgArgs Bad or Missing Size Error")}protoParseInt(e,t){if(0===e.length||e.length>15)return -1;let n=0;for(let t=0;t<e.length;t++){if(e[t]<48||e[t]>57)return -1;n=10*n+(e[t]-48)}return void 0!==t&&n>t?-1:n}},KK.State={OP_START:0,OP_PLUS:1,OP_PLUS_O:2,OP_PLUS_OK:3,OP_MINUS:4,OP_MINUS_E:5,OP_MINUS_ER:6,OP_MINUS_ERR:7,OP_MINUS_ERR_SPC:8,MINUS_ERR_ARG:9,OP_M:10,OP_MS:11,OP_MSG:12,OP_MSG_SPC:13,MSG_ARG:14,MSG_PAYLOAD:15,MSG_END:16,OP_H:17,OP_P:18,OP_PI:19,OP_PIN:20,OP_PING:21,OP_PO:22,OP_PON:23,OP_PONG:24,OP_I:25,OP_IN:26,OP_INF:27,OP_INFO:28,OP_INFO_SPC:29,INFO_ARG:30},KK.cc={CR:13,E:69,e:101,F:70,f:102,G:71,g:103,H:72,h:104,I:73,i:105,K:75,k:107,M:77,m:109,MINUS:45,N:78,n:110,NL:10,O:79,o:111,P:80,p:112,PLUS:43,R:82,r:114,S:83,s:115,SPACE:32,TAB:9};"use strict";var K3={};Object.defineProperty(K3,"__esModule",{value:!0}),K3.MsgImpl=void 0;var K4={};function K5(e){let t=!0,n=Array(e.length);for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(58===i||i<33||i>126)throw Ka.InvalidArgumentError.format("header",`'${e[r]}' is not a valid character in a header name`);t&&97<=i&&i<=122?i-=32:!t&&65<=i&&i<=90&&(i+=32),n[r]=i,t=45==i}return String.fromCharCode(...n)}Object.defineProperty(K4,"__esModule",{value:!0}),K4.MsgHdrsImpl=void 0,K4.canonicalMIMEHeaderKey=K5,K4.headers=function(e=0,t=""){if(0===e&&""!==t)throw Ka.InvalidArgumentError.format("code","is required");if(e>0&&""===t)throw Ka.InvalidArgumentError.format("description","is required");return new K8(e,t)};let K6="NATS/1.0";class K8{_code;headers;_description;constructor(e=0,t=""){this._code=e,this._description=t,this.headers=new Map}[Symbol.iterator](){return this.headers.entries()}size(){return this.headers.size}equals(e){if(e&&this.headers.size===e.headers.size&&this._code===e._code){for(let[t,n]of this.headers){let r=e.values(t);if(n.length!==r.length)return!1;let i=[...n].sort(),a=[...r].sort();for(let e=0;e<i.length;e++)if(i[e]!==a[e])return!1}return!0}return!1}static decode(e){let t=new K8,n=Ki.TD.decode(e).split("\r\n"),r=n[0];if(r!==K6){let e=r.replace(K6,"").trim();if(e.length>0){t._code=parseInt(e,10),isNaN(t._code)&&(t._code=0);let n=t._code.toString();t._description=(e=e.replace(n,"")).trim()}}return n.length>=1&&n.slice(1).map(e=>{if(e){let n=e.indexOf(":");if(n>-1){let r=e.slice(0,n),i=e.slice(n+1).trim();t.append(r,i)}}}),t}toString(){if(0===this.headers.size&&0===this._code)return"";let e=K6;for(let[t,n]of(this._code>0&&""!==this._description&&(e+=` ${this._code} ${this._description}`),this.headers))for(let r=0;r<n.length;r++)e=`${e}\r
1071
1071
  ${t}: ${n[r]}`;return`${e}\r
1072
1072
  \r
1073
- `}encode(){return Kr.TE.encode(this.toString())}static validHeaderValue(e){if(/[\r\n]/.test(e))throw Ki.InvalidArgumentError.format("header","values cannot contain \\r or \\n");return e.trim()}keys(){let e=[];for(let t of this.headers.keys())e.push(t);return e}findKeys(e,t=KA.Match.Exact){let n=this.keys();switch(t){case KA.Match.Exact:return n.filter(t=>t===e);case KA.Match.CanonicalMIME:return e=K4(e),n.filter(t=>t===e);default:{let t=e.toLowerCase();return n.filter(e=>t===e.toLowerCase())}}}get(e,t=KA.Match.Exact){let n=this.findKeys(e,t);if(n.length){let e=this.headers.get(n[0]);if(e)return Array.isArray(e)?e[0]:e}return""}last(e,t=KA.Match.Exact){let n=this.findKeys(e,t);if(n.length){let e=this.headers.get(n[0]);if(e)return Array.isArray(e)?e[e.length-1]:e}return""}has(e,t=KA.Match.Exact){return this.findKeys(e,t).length>0}set(e,t,n=KA.Match.Exact){this.delete(e,n),this.append(e,t,n)}append(e,t,n=KA.Match.Exact){let r=K4(e);n===KA.Match.CanonicalMIME&&(e=r);let i=this.findKeys(e,n);e=i.length>0?i[0]:e;let a=K6.validHeaderValue(t),o=this.headers.get(e);o||(o=[],this.headers.set(e,o)),o.push(a)}values(e,t=KA.Match.Exact){let n=[];return this.findKeys(e,t).forEach(e=>{let t=this.headers.get(e);t&&n.push(...t)}),n}delete(e,t=KA.Match.Exact){this.findKeys(e,t).forEach(e=>{this.headers.delete(e)})}get hasError(){return this._code>=300}get status(){return`${this._code} ${this._description}`.trim()}toRecord(){let e={};return this.keys().forEach(t=>{e[t]=this.values(t)}),e}get code(){return this._code}get description(){return this._description}static fromRecord(e){let t=new K6;for(let n in e){let r=e[n];t.headers.set(n,Array.isArray(r)?r:[`${r}`])}return t}}"use strict";K3.MsgHdrsImpl=K6,K2.MsgImpl=class{_headers;_msg;_rdata;_reply;_subject;publisher;constructor(e,t,n){this._msg=e,this._rdata=t,this.publisher=n}get subject(){return this._subject||(this._subject=Kr.TD.decode(this._msg.subject)),this._subject}get reply(){return this._reply||(this._reply=Kr.TD.decode(this._msg.reply)),this._reply}get sid(){return this._msg.sid}get headers(){if(this._msg.hdr>-1&&!this._headers){let e=this._rdata.subarray(0,this._msg.hdr);this._headers=K3.MsgHdrsImpl.decode(e)}return this._headers}get data(){return this._rdata?this._msg.hdr>-1?this._rdata.subarray(this._msg.hdr):this._rdata:new Uint8Array(0)}respond(e=Kr.Empty,t){return!!this.reply&&(this.publisher.publish(this.reply,e,t),!0)}size(){return this._msg.subject.length+(this._msg.reply?.length||0)+(-1===this._msg.size?0:this._msg.size)}json(e){return JSON.parse(this.string(),e)}string(){return Kr.TD.decode(this.data)}requestInfo(){let e=this.headers?.get("Nats-Request-Info");return e?JSON.parse(e,function(e,t){return("start"===e||"stop"===e)&&""!==t?new Date(Date.parse(t)):t}):null}};var K8={};function K7(e=""){let t=e.match(/(\d+).(\d+).(\d+)/);if(t)return{major:parseInt(t[1]),minor:parseInt(t[2]),micro:parseInt(t[3])};throw Error(`'${e}' is not a semver value`)}function K9(e,t){return e.major<t.major?-1:e.major>t.major?1:e.minor<t.minor?-1:e.minor>t.minor?1:e.micro<t.micro?-1:+(e.micro>t.micro)}"use strict";Object.defineProperty(K8,"__esModule",{value:!0}),K8.Features=K8.Feature=void 0,K8.parseSemVer=K7,K8.compare=K9,K8.Feature={JS_KV:"js_kv",JS_OBJECTSTORE:"js_objectstore",JS_PULL_MAX_BYTES:"js_pull_max_bytes",JS_NEW_CONSUMER_CREATE_API:"js_new_consumer_create",JS_ALLOW_DIRECT:"js_allow_direct",JS_MULTIPLE_CONSUMER_FILTER:"js_multiple_consumer_filter",JS_SIMPLIFICATION:"js_simplification",JS_STREAM_CONSUMER_METADATA:"js_stream_consumer_metadata",JS_CONSUMER_FILTER_SUBJECTS:"js_consumer_filter_subjects",JS_STREAM_FIRST_SEQ:"js_stream_first_seq",JS_STREAM_SUBJECT_TRANSFORM:"js_stream_subject_transform",JS_STREAM_SOURCE_SUBJECT_TRANSFORM:"js_stream_source_subject_transform",JS_STREAM_COMPRESSION:"js_stream_compression",JS_DEFAULT_CONSUMER_LIMITS:"js_default_consumer_limits",JS_BATCH_DIRECT_GET:"js_batch_direct_get",JS_PRIORITY_GROUPS:"js_priority_groups",JS_CONSUMER_RESET:"js_consumer_reset"},K8.Features=class{server;features;disabled;constructor(e){this.features=new Map,this.disabled=[],this.update(e)}resetDisabled(){this.disabled.length=0,this.update(this.server)}disable(e){this.disabled.push(e),this.update(this.server)}isDisabled(e){return -1!==this.disabled.indexOf(e)}update(e){"string"==typeof e&&(e=K7(e)),this.server=e,this.set(K8.Feature.JS_KV,"2.6.2"),this.set(K8.Feature.JS_OBJECTSTORE,"2.6.3"),this.set(K8.Feature.JS_PULL_MAX_BYTES,"2.8.3"),this.set(K8.Feature.JS_NEW_CONSUMER_CREATE_API,"2.9.0"),this.set(K8.Feature.JS_ALLOW_DIRECT,"2.9.0"),this.set(K8.Feature.JS_MULTIPLE_CONSUMER_FILTER,"2.10.0"),this.set(K8.Feature.JS_SIMPLIFICATION,"2.9.4"),this.set(K8.Feature.JS_STREAM_CONSUMER_METADATA,"2.10.0"),this.set(K8.Feature.JS_CONSUMER_FILTER_SUBJECTS,"2.10.0"),this.set(K8.Feature.JS_STREAM_FIRST_SEQ,"2.10.0"),this.set(K8.Feature.JS_STREAM_SUBJECT_TRANSFORM,"2.10.0"),this.set(K8.Feature.JS_STREAM_SOURCE_SUBJECT_TRANSFORM,"2.10.0"),this.set(K8.Feature.JS_STREAM_COMPRESSION,"2.10.0"),this.set(K8.Feature.JS_DEFAULT_CONSUMER_LIMITS,"2.10.0"),this.set(K8.Feature.JS_BATCH_DIRECT_GET,"2.11.0"),this.set(K8.Feature.JS_PRIORITY_GROUPS,"2.11.0"),this.set(K8.Feature.JS_CONSUMER_RESET,"2.14.0"),this.disabled.forEach(e=>{this.features.delete(e)})}set(e,t){this.features.set(e,{min:t,ok:K9(this.server,K7(t))>=0})}get(e){return this.features.get(e)||{min:"unknown",ok:!1}}supports(e){return this.get(e)?.ok||!1}require(e){return"string"==typeof e&&(e=K7(e)),K9(this.server,e)>=0}};"use strict";var Ye={};Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.DEFAULT_RECONNECT_TIME_WAIT=Ye.DEFAULT_MAX_PING_OUT=Ye.DEFAULT_PING_INTERVAL=Ye.DEFAULT_JITTER_TLS=Ye.DEFAULT_JITTER=Ye.DEFAULT_MAX_RECONNECT_ATTEMPTS=void 0,Ye.defaultOptions=Ya,Ye.hasWsProtocol=function(e){if(e){let{servers:t}=e;if("string"==typeof t&&(t=[t]),t)for(let e=0;e<t.length;e++){let n=t[e].toLowerCase();if(n.startsWith("ws://")||n.startsWith("wss://"))return!0}}return!1},Ye.buildAuthenticator=Yo,Ye.parseOptions=function(e){let t=`${KA.DEFAULT_HOST}:${(0,KE.defaultPort)()}`;if((e=e||{servers:[t]}).servers=e.servers||[],"string"==typeof e.servers&&(e.servers=[e.servers]),e.servers.length>0&&e.port)throw Ki.InvalidArgumentError.format(["servers","port"],"are mutually exclusive");0===e.servers.length&&e.port&&(e.servers=[`${KA.DEFAULT_HOST}:${e.port}`]),e.servers&&0===e.servers.length&&(e.servers=[t]);let n=(0,Kn.extend)(Ya(),e);if(n.authenticator=Yo(n),["reconnectDelayHandler","authenticator"].forEach(e=>{if(n[e]&&"function"!=typeof n[e])throw TypeError(`'${e}' must be a function`)}),n.reconnectDelayHandler||(n.reconnectDelayHandler=()=>{let e=n.tls?n.reconnectJitterTLS:n.reconnectJitter;return e&&(e=Math.floor(Math.random()*++e)),n.reconnectTimeWait+e}),n.inboxPrefix&&(0,KA.createInbox)(n.inboxPrefix),void 0===n.resolve&&(n.resolve="function"==typeof(0,KE.getResolveFn)()),n.resolve&&"function"!=typeof(0,KE.getResolveFn)())throw Ki.InvalidArgumentError.format("resolve","is not supported in the current runtime");return n},Ye.checkOptions=function(e,t){let{proto:n,tls_required:r,tls_available:i}=e;if((void 0===n||n<1)&&t.noEcho)throw new Ki.errors.ConnectionError("server does not support 'noEcho'");if(t.tls&&!(r||i))throw new Ki.errors.ConnectionError("server does not support 'tls'")},Ye.checkUnsupportedOption=function(e,t){if(t)throw Ki.InvalidArgumentError.format(e,"is not supported")};var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.multiAuthenticator=function(e){return t=>{let n={};return e.forEach(e=>{let r=e(t)||{};n=Object.assign(n,r)}),n}},Yt.noAuthFn=function(){return()=>{}},Yt.usernamePasswordAuthenticator=function(e,t){return()=>({user:"function"==typeof e?e():e,pass:"function"==typeof t?t():t})},Yt.tokenAuthenticator=function(e){return()=>({auth_token:"function"==typeof e?e():e})},Yt.nkeyAuthenticator=Yr,Yt.jwtAuthenticator=Yi,Yt.credsAuthenticator=function(e){let t="function"!=typeof e?()=>e:e,n=()=>{let e=/\s*(?:(?:[-]{3,}[^\n]*[-]{3,}\n)(.+)(?:\n\s*[-]{3,}[^\n]*[-]{3,}\n))/ig,n=Kr.TD.decode(t()),r=e.exec(n);if(!r)throw Error("unable to parse credentials");let i=r[1].trim();if(!(r=e.exec(n)))throw Error("unable to parse credentials");return{jwt:i,seed:Kr.TE.encode(r[1].trim())}};return Yi(()=>{let{jwt:e}=n();return e},()=>{let{seed:e}=n();return e})};var Yn=ec("k53No");function Yr(e){return t=>{let n="function"==typeof e?e():e,r=n?Yn.nkeys.fromSeed(n):void 0,i=r?r.getPublicKey():"",a=Kr.TE.encode(t||""),o=void 0!==r&&t?r.sign(a):void 0;return{nkey:i,sig:o?Yn.nkeys.encode(o):""}}}function Yi(e,t){return n=>{let r="function"==typeof e?e():e,{nkey:i,sig:a}=Yr(t)(n);return{jwt:r,nkey:i,sig:a}}}function Ya(){return{maxPingOut:Ye.DEFAULT_MAX_PING_OUT,maxReconnectAttempts:Ye.DEFAULT_MAX_RECONNECT_ATTEMPTS,noRandomize:!1,pedantic:!1,pingInterval:Ye.DEFAULT_PING_INTERVAL,reconnect:!0,reconnectJitter:Ye.DEFAULT_JITTER,reconnectJitterTLS:Ye.DEFAULT_JITTER_TLS,reconnectTimeWait:Ye.DEFAULT_RECONNECT_TIME_WAIT,tls:void 0,verbose:!1,waitOnFirstConnect:!1,ignoreAuthErrorAbort:!1}}function Yo(e){let t=[];return"function"==typeof e.authenticator&&t.push(e.authenticator),Array.isArray(e.authenticator)&&t.push(...e.authenticator),e.token&&t.push((0,Yt.tokenAuthenticator)(e.token)),e.user&&t.push((0,Yt.usernamePasswordAuthenticator)(e.user,e.pass)),0===t.length?(0,Yt.noAuthFn)():(0,Yt.multiAuthenticator)(t)}Ye.DEFAULT_MAX_RECONNECT_ATTEMPTS=10,Ye.DEFAULT_JITTER=100,Ye.DEFAULT_JITTER_TLS=1e3,Ye.DEFAULT_PING_INTERVAL=12e4,Ye.DEFAULT_MAX_PING_OUT=2,Ye.DEFAULT_RECONNECT_TIME_WAIT=2e3,KS.INFO=/^INFO\s+([^\r\n]+)\r\n/i;let Ys=(0,Kr.encode)("PONG\r\n"),Yl=(0,Kr.encode)("PING\r\n");class Yu{echo;no_responders;protocol;verbose;pedantic;jwt;nkey;sig;user;pass;auth_token;tls_required;name;lang;version;headers;constructor(e,t,n){this.protocol=1,this.version=e.version,this.lang=e.lang,this.echo=!t.noEcho&&void 0,this.verbose=t.verbose,this.pedantic=t.pedantic,this.tls_required=!!t.tls||void 0,this.name=t.name;let r=(t&&"function"==typeof t.authenticator?t.authenticator(n):{})||{};(0,Kn.extend)(this,r)}}KS.Connect=Yu;class Yc{slow;cb;notified;constructor(e,t){this.slow=e,this.cb=t,this.notified=!1}maybeNotify(e){e<=this.slow?this.notified=!1:this.notified||(this.cb(e),this.notified=!0)}}class Yd extends KV.QueuedIteratorImpl{sid;queue;draining;max;subject;drained;protocol;timer;info;cleanupFn;closed;requestSubject;slow;constructor(e,t,n={}){super(),(0,Kn.extend)(this,n),this.protocol=e,this.subject=t,this.draining=!1,this.noIterator="function"==typeof n.callback,this.closed=(0,Kn.deferred)();let r=!e.options?.noAsyncTraces;n.timeout&&(this.timer=(0,Kn.timeout)(n.timeout,r),this.timer.then(()=>{this.timer=void 0}).catch(e=>{this.stop(e),this.noIterator&&this.callback(e,{})})),this.noIterator||this.iterClosed.then(e=>{this.closed.resolve(e),this.unsubscribe()})}setSlowNotificationFn(e,t){if(this.slow=void 0,t){if(this.noIterator)throw Error("callbacks don't support slow notifications");this.slow=new Yc(e,t)}}callback(e,t){this.cancelTimeout(),e?this.stop(e):this.push(t),!e&&this.slow&&this.slow.maybeNotify(this.getPending())}close(e){if(!this.isClosed()){this.cancelTimeout();let t=()=>{if(this.stop(),this.cleanupFn)try{this.cleanupFn(this,this.info)}catch(e){}this.closed.resolve(e)};this.noIterator?t():this.push(t)}}unsubscribe(e){this.protocol.unsubscribe(this,e)}cancelTimeout(){this.timer&&(this.timer.cancel(),this.timer=void 0)}drain(){return this.protocol.isClosed()?Promise.reject(new Ki.errors.ClosedConnectionError):this.isClosed()?Promise.reject(new Ki.errors.InvalidOperationError("subscription is already closed")):(this.drained||(this.draining=!0,this.protocol.unsub(this),this.drained=this.protocol.flush((0,Kn.deferred)()).then(()=>{this.protocol.subscriptions.cancel(this)}).catch(()=>{this.protocol.subscriptions.cancel(this)})),this.drained)}async [Symbol.asyncDispose](){if(!(this.protocol.isClosed()||this.isClosed())){if(this.drained)return void await this.drained;await this.drain()}}isDraining(){return this.draining}isClosed(){return this.done}getSubject(){return this.subject}getMax(){return this.max}getID(){return this.sid}}KS.SubscriptionImpl=Yd;class Yh{mux;subs;sidCounter;constructor(){this.sidCounter=0,this.mux=null,this.subs=new Map}size(){return this.subs.size}add(e){return this.sidCounter++,e.sid=this.sidCounter,this.subs.set(e.sid,e),e}setMux(e){return this.mux=e,e}getMux(){return this.mux}get(e){return this.subs.get(e)}resub(e){return this.sidCounter++,this.subs.delete(e.sid),e.sid=this.sidCounter,this.subs.set(e.sid,e),e}all(){return Array.from(this.subs.values())}cancel(e){e&&(e.close(),this.subs.delete(e.sid))}handleError(e){let t,n=this.all();return"subscription"===e.operation?t=n.find(t=>t.subject===e.subject&&t.queue===e.queue):"publish"===e.operation&&(t=n.find(t=>t.requestSubject===e.subject)),!!t&&(t.callback(e,{}),t.close(e),this.subs.delete(t.sid),t!==this.mux)}close(){this.subs.forEach(e=>{e.close()})}}"use strict";KS.Subscriptions=Yh,KS.ProtocolHandler=class e{connected;connectedOnce;infoReceived;info;muxSubscriptions;options;outbound;pongs;subscriptions;transport;noMorePublishing;connectError;publisher;_closed;closed;listeners;heartbeats;parser;outMsgs;inMsgs;outBytes;inBytes;pendingLimit;lastError;abortReconnect;whyClosed;servers;server;features;connectPromise;dialDelay;raceTimer;constructor(e,t){this._closed=!1,this.connected=!1,this.connectedOnce=!1,this.infoReceived=!1,this.noMorePublishing=!1,this.abortReconnect=!1,this.listeners=[],this.pendingLimit=32768,this.outMsgs=0,this.inMsgs=0,this.outBytes=0,this.inBytes=0,this.options=e,this.publisher=t,this.subscriptions=new Yh,this.muxSubscriptions=new Kq.MuxSubscription,this.outbound=new Kk.DataBuffer,this.pongs=[],this.whyClosed="",this.pendingLimit=e.pendingLimit||this.pendingLimit,this.features=new K8.Features({major:0,minor:0,micro:0}),this.connectPromise=null,this.dialDelay=null;let n="string"==typeof e.servers?[e.servers]:e.servers;this.servers=new KD.Servers({randomize:!e.noRandomize}),this.servers.setServers(n),this.closed=(0,Kn.deferred)(),this.parser=new KJ.Parser(this),this.heartbeats=new K$.Heartbeat(this,this.options.pingInterval||Ye.DEFAULT_PING_INTERVAL,this.options.maxPingOut||Ye.DEFAULT_MAX_PING_OUT)}resetOutbound(){this.outbound.reset();let e=this.pongs;this.pongs=[];let t=new Ki.errors.RequestError("connection disconnected");t.stack="",e.forEach(e=>{e.reject(t)}),this.parser=new KJ.Parser(this),this.infoReceived=!1}dispatchStatus(e){this.listeners.forEach(t=>{t.push(e)})}prepare(){this.transport&&this.transport.discard(),this.info=void 0,this.resetOutbound();let e=(0,Kn.deferred)();return e.catch(()=>{}),this.pongs.unshift(e),this.connectError=t=>{e.reject(t)},this.transport=(0,KE.newTransport)(),this.transport.closed().then(async e=>{if(this.connected=!1,!this.isClosed())return void await this.disconnected(this.transport.closeError||this.lastError)}),e}disconnect(){this.dispatchStatus({type:"staleConnection"}),this.transport.disconnect()}reconnect(){return this.connected&&(this.dispatchStatus({type:"forceReconnect"}),this.transport.disconnect()),Promise.resolve()}async disconnected(e){this.dispatchStatus({type:"disconnect",server:this.servers.getCurrentServer().toString()}),this.options.reconnect?await this.dialLoop().then(()=>{this.dispatchStatus({type:"reconnect",server:this.servers.getCurrentServer().toString()}),this.lastError instanceof Ki.errors.UserAuthenticationExpiredError&&(this.lastError=void 0)}).catch(e=>{this.close(e).catch()}):await this.close(e).catch()}async dial(e){let t=this.prepare();try{this.raceTimer=(0,Kn.timeout)(this.options.timeout||2e4);let t=this.transport.connect(e,this.options);await Promise.race([t,this.raceTimer]),(async()=>{try{for await(let e of this.transport)this.parser.parse(e)}catch(e){console.log("reader closed",e)}})().then()}catch(e){t.reject(e)}try{await Promise.race([this.raceTimer,t]),this.raceTimer?.cancel(),this.connected=!0,this.connectError=void 0,this.sendSubscriptions(),this.connectedOnce=!0,this.server.didConnect=!0,this.server.reconnects=0,this.flushPending(),this.heartbeats.start()}catch(e){throw this.raceTimer?.cancel(),await this.transport.close(e),e}}async _doDial(e){let{resolve:t}=this.options,n=await e.resolve({fn:(0,KE.getResolveFn)(),debug:this.options.debug,randomize:!this.options.noRandomize,resolve:t}),r=null;for(let e of n)try{r=null,this.dispatchStatus({type:"reconnecting"}),await this.dial(e);return}catch(e){r=e}throw r}dialLoop(){return null===this.connectPromise&&(this.connectPromise=this.dodialLoop(),this.connectPromise.then(()=>{}).catch(()=>{}).finally(()=>{this.connectPromise=null})),this.connectPromise}async dodialLoop(){let e;for(;;){this._closed&&this.servers.clear();let t=this.options.reconnectDelayHandler?this.options.reconnectDelayHandler():Ye.DEFAULT_RECONNECT_TIME_WAIT,n=t,r=this.selectServer();if(!r||this.abortReconnect)if(e)throw e;else if(this.lastError)throw this.lastError;else throw new Ki.errors.ConnectionError("connection refused");let i=Date.now();if(0===r.lastConnect||r.lastConnect+t<=i){let t=r,n=0;if(this.options.reconnectToServer)try{let e,i=this.servers.snapshotForHandler(),a=this.options.reconnectToServer(i,this.info??null);if(null!==a&&"object"==typeof a&&"server"in a&&"delay"in a?(e=a.server,n=Number.isFinite(a.delay)&&a.delay>0?Math.floor(a.delay):0):e=a,null!==e){let n=this.servers.find(e);if(!n)throw Error("returned server is not in the pool");n!==r&&(t=n,this.servers.setCurrent(t),this.server=t)}}catch(t){let e=t instanceof Error?t:Error(String(t));throw new Ki.errors.ConnectionError(`client option reconnectToServer handler failed: ${e.message}`,{cause:e})}n>0&&(this.dialDelay=(0,Kn.delay)(n),await this.dialDelay),t.lastConnect=Date.now();try{await this._doDial(t);break}catch(r){if(e=r,!this.connectedOnce){if(this.options.waitOnFirstConnect)continue;this.servers.removeCurrentServer()}t.reconnects++;let n=this.options.maxReconnectAttempts||0;-1!==n&&t.reconnects>=n&&this.servers.removeCurrentServer()}}else n=Math.min(n,r.lastConnect+t-i),this.dialDelay=(0,Kn.delay)(n),await this.dialDelay}}static async connect(t,n){let r=new e(t,n);return await r.dialLoop(),r}static toError(e){let t=Ki.errors.PermissionViolationError.parse(e);return t||(t=Ki.errors.UserAuthenticationExpiredError.parse(e))||(t=Ki.errors.AuthorizationError.parse(e))?t:new Ki.errors.ProtocolError(e)}processMsg(e,t){if(this.inMsgs++,this.inBytes+=t.length,!this.subscriptions.sidCounter)return;let n=this.subscriptions.get(e.sid);n&&(n.received+=1,n.callback&&n.callback(null,new K2.MsgImpl(e,t,this)),void 0!==n.max&&n.received>=n.max&&n.unsubscribe())}processError(t){let n=(0,Kr.decode)(t);n.startsWith("'")&&n.endsWith("'")&&(n=n.slice(1,n.length-1));let r=e.toError(n);if(r.constructor===Ki.errors.PermissionViolationError){let e=this.subscriptions.getMux(),t=!!e&&r.subject===e.subject;this.subscriptions.handleError(r),this.muxSubscriptions.handleError(t,r),t&&this.subscriptions.setMux(null)}this.dispatchStatus({type:"error",error:r}),this.handleError(r)}handleError(e){(e instanceof Ki.errors.UserAuthenticationExpiredError||e instanceof Ki.errors.AuthorizationError)&&this.handleAuthError(e),e instanceof Ki.errors.PermissionViolationError||(this.lastError=e)}handleAuthError(e){(this.lastError instanceof Ki.errors.UserAuthenticationExpiredError||this.lastError instanceof Ki.errors.AuthorizationError)&&!1===this.options.ignoreAuthErrorAbort&&(this.abortReconnect=!0),this.connectError?this.connectError(e):this.disconnect()}processPing(){this.transport.send(Ys)}processPong(){let e=this.pongs.shift();e&&e.resolve()}processInfo(e){let t=JSON.parse((0,Kr.decode)(e));this.info=t;let n=this.options&&this.options.ignoreClusterUpdates?void 0:this.servers.update(t,this.transport.isEncrypted());if(!this.infoReceived){this.features.update((0,K8.parseSemVer)(t.version)),this.infoReceived=!0,this.transport.isEncrypted()&&this.servers.updateTLSName();let{version:e,lang:n}=this.transport;try{let r=new Yu({version:e,lang:n},this.options,t.nonce);t.headers&&(r.headers=!0,r.no_responders=!0);let i=JSON.stringify(r);this.transport.send((0,Kr.encode)(`CONNECT ${i}${KE.CR_LF}`)),this.transport.send(Yl)}catch(e){this.close(e).catch()}}if(n){let{added:e,deleted:t}=n;this.dispatchStatus({type:"update",added:e,deleted:t})}void 0!==t.ldm&&t.ldm&&this.dispatchStatus({type:"ldm",server:this.servers.getCurrentServer().toString()})}push(e){switch(e.kind){case KJ.Kind.MSG:{let{msg:t,data:n}=e;this.processMsg(t,n);break}case KJ.Kind.OK:break;case KJ.Kind.ERR:this.processError(e.data);break;case KJ.Kind.PING:this.processPing();break;case KJ.Kind.PONG:this.processPong();break;case KJ.Kind.INFO:this.processInfo(e.data)}}sendCommand(e,...t){let n,r=this.outbound.length();n="string"==typeof e?(0,Kr.encode)(e):e,this.outbound.fill(n,...t),0===r?queueMicrotask(()=>{this.flushPending()}):this.outbound.size()>=this.pendingLimit&&this.flushPending()}publish(e,t=Kr.Empty,n){let r,i;if(t instanceof Uint8Array)r=t;else if("string"==typeof t)r=Kr.TE.encode(t);else throw TypeError("payload types can be strings or Uint8Array");let a=r.length;(n=n||{}).reply=n.reply||"";let o=Kr.Empty,s=0;if(n.headers&&(this.info&&!this.info.headers&&Ki.InvalidArgumentError.format("headers","are not available on this server"),s=(o=n.headers.encode()).length,a=r.length+s),this.info&&a>this.info.max_payload)throw Ki.InvalidArgumentError.format("payload","max_payload size exceeded");this.outBytes+=a,this.outMsgs++,n.headers?(i=n.reply?`HPUB ${e} ${n.reply} ${s} ${a}\r
1073
+ `}encode(){return Ki.TE.encode(this.toString())}static validHeaderValue(e){if(/[\r\n]/.test(e))throw Ka.InvalidArgumentError.format("header","values cannot contain \\r or \\n");return e.trim()}keys(){let e=[];for(let t of this.headers.keys())e.push(t);return e}findKeys(e,t=KT.Match.Exact){let n=this.keys();switch(t){case KT.Match.Exact:return n.filter(t=>t===e);case KT.Match.CanonicalMIME:return e=K5(e),n.filter(t=>t===e);default:{let t=e.toLowerCase();return n.filter(e=>t===e.toLowerCase())}}}get(e,t=KT.Match.Exact){let n=this.findKeys(e,t);if(n.length){let e=this.headers.get(n[0]);if(e)return Array.isArray(e)?e[0]:e}return""}last(e,t=KT.Match.Exact){let n=this.findKeys(e,t);if(n.length){let e=this.headers.get(n[0]);if(e)return Array.isArray(e)?e[e.length-1]:e}return""}has(e,t=KT.Match.Exact){return this.findKeys(e,t).length>0}set(e,t,n=KT.Match.Exact){this.delete(e,n),this.append(e,t,n)}append(e,t,n=KT.Match.Exact){let r=K5(e);n===KT.Match.CanonicalMIME&&(e=r);let i=this.findKeys(e,n);e=i.length>0?i[0]:e;let a=K8.validHeaderValue(t),o=this.headers.get(e);o||(o=[],this.headers.set(e,o)),o.push(a)}values(e,t=KT.Match.Exact){let n=[];return this.findKeys(e,t).forEach(e=>{let t=this.headers.get(e);t&&n.push(...t)}),n}delete(e,t=KT.Match.Exact){this.findKeys(e,t).forEach(e=>{this.headers.delete(e)})}get hasError(){return this._code>=300}get status(){return`${this._code} ${this._description}`.trim()}toRecord(){let e={};return this.keys().forEach(t=>{e[t]=this.values(t)}),e}get code(){return this._code}get description(){return this._description}static fromRecord(e){let t=new K8;for(let n in e){let r=e[n];t.headers.set(n,Array.isArray(r)?r:[`${r}`])}return t}}"use strict";K4.MsgHdrsImpl=K8,K3.MsgImpl=class{_headers;_msg;_rdata;_reply;_subject;publisher;constructor(e,t,n){this._msg=e,this._rdata=t,this.publisher=n}get subject(){return this._subject||(this._subject=Ki.TD.decode(this._msg.subject)),this._subject}get reply(){return this._reply||(this._reply=Ki.TD.decode(this._msg.reply)),this._reply}get sid(){return this._msg.sid}get headers(){if(this._msg.hdr>-1&&!this._headers){let e=this._rdata.subarray(0,this._msg.hdr);this._headers=K4.MsgHdrsImpl.decode(e)}return this._headers}get data(){return this._rdata?this._msg.hdr>-1?this._rdata.subarray(this._msg.hdr):this._rdata:new Uint8Array(0)}respond(e=Ki.Empty,t){return!!this.reply&&(this.publisher.publish(this.reply,e,t),!0)}size(){return this._msg.subject.length+(this._msg.reply?.length||0)+(-1===this._msg.size?0:this._msg.size)}json(e){return JSON.parse(this.string(),e)}string(){return Ki.TD.decode(this.data)}requestInfo(){let e=this.headers?.get("Nats-Request-Info");return e?JSON.parse(e,function(e,t){return("start"===e||"stop"===e)&&""!==t?new Date(Date.parse(t)):t}):null}};var K7={};function K9(e=""){let t=e.match(/(\d+).(\d+).(\d+)/);if(t)return{major:parseInt(t[1]),minor:parseInt(t[2]),micro:parseInt(t[3])};throw Error(`'${e}' is not a semver value`)}function Ye(e,t){return e.major<t.major?-1:e.major>t.major?1:e.minor<t.minor?-1:e.minor>t.minor?1:e.micro<t.micro?-1:+(e.micro>t.micro)}"use strict";Object.defineProperty(K7,"__esModule",{value:!0}),K7.Features=K7.Feature=void 0,K7.parseSemVer=K9,K7.compare=Ye,K7.Feature={JS_KV:"js_kv",JS_OBJECTSTORE:"js_objectstore",JS_PULL_MAX_BYTES:"js_pull_max_bytes",JS_NEW_CONSUMER_CREATE_API:"js_new_consumer_create",JS_ALLOW_DIRECT:"js_allow_direct",JS_MULTIPLE_CONSUMER_FILTER:"js_multiple_consumer_filter",JS_SIMPLIFICATION:"js_simplification",JS_STREAM_CONSUMER_METADATA:"js_stream_consumer_metadata",JS_CONSUMER_FILTER_SUBJECTS:"js_consumer_filter_subjects",JS_STREAM_FIRST_SEQ:"js_stream_first_seq",JS_STREAM_SUBJECT_TRANSFORM:"js_stream_subject_transform",JS_STREAM_SOURCE_SUBJECT_TRANSFORM:"js_stream_source_subject_transform",JS_STREAM_COMPRESSION:"js_stream_compression",JS_DEFAULT_CONSUMER_LIMITS:"js_default_consumer_limits",JS_BATCH_DIRECT_GET:"js_batch_direct_get",JS_PRIORITY_GROUPS:"js_priority_groups",JS_CONSUMER_RESET:"js_consumer_reset"},K7.Features=class{server;features;disabled;constructor(e){this.features=new Map,this.disabled=[],this.update(e)}resetDisabled(){this.disabled.length=0,this.update(this.server)}disable(e){this.disabled.push(e),this.update(this.server)}isDisabled(e){return -1!==this.disabled.indexOf(e)}update(e){"string"==typeof e&&(e=K9(e)),this.server=e,this.set(K7.Feature.JS_KV,"2.6.2"),this.set(K7.Feature.JS_OBJECTSTORE,"2.6.3"),this.set(K7.Feature.JS_PULL_MAX_BYTES,"2.8.3"),this.set(K7.Feature.JS_NEW_CONSUMER_CREATE_API,"2.9.0"),this.set(K7.Feature.JS_ALLOW_DIRECT,"2.9.0"),this.set(K7.Feature.JS_MULTIPLE_CONSUMER_FILTER,"2.10.0"),this.set(K7.Feature.JS_SIMPLIFICATION,"2.9.4"),this.set(K7.Feature.JS_STREAM_CONSUMER_METADATA,"2.10.0"),this.set(K7.Feature.JS_CONSUMER_FILTER_SUBJECTS,"2.10.0"),this.set(K7.Feature.JS_STREAM_FIRST_SEQ,"2.10.0"),this.set(K7.Feature.JS_STREAM_SUBJECT_TRANSFORM,"2.10.0"),this.set(K7.Feature.JS_STREAM_SOURCE_SUBJECT_TRANSFORM,"2.10.0"),this.set(K7.Feature.JS_STREAM_COMPRESSION,"2.10.0"),this.set(K7.Feature.JS_DEFAULT_CONSUMER_LIMITS,"2.10.0"),this.set(K7.Feature.JS_BATCH_DIRECT_GET,"2.11.0"),this.set(K7.Feature.JS_PRIORITY_GROUPS,"2.11.0"),this.set(K7.Feature.JS_CONSUMER_RESET,"2.14.0"),this.disabled.forEach(e=>{this.features.delete(e)})}set(e,t){this.features.set(e,{min:t,ok:Ye(this.server,K9(t))>=0})}get(e){return this.features.get(e)||{min:"unknown",ok:!1}}supports(e){return this.get(e)?.ok||!1}require(e){return"string"==typeof e&&(e=K9(e)),Ye(this.server,e)>=0}};"use strict";var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.DEFAULT_RECONNECT_TIME_WAIT=Yt.DEFAULT_MAX_PING_OUT=Yt.DEFAULT_PING_INTERVAL=Yt.DEFAULT_JITTER_TLS=Yt.DEFAULT_JITTER=Yt.DEFAULT_MAX_RECONNECT_ATTEMPTS=void 0,Yt.defaultOptions=Yo,Yt.hasWsProtocol=function(e){if(e){let{servers:t}=e;if("string"==typeof t&&(t=[t]),t)for(let e=0;e<t.length;e++){let n=t[e].toLowerCase();if(n.startsWith("ws://")||n.startsWith("wss://"))return!0}}return!1},Yt.buildAuthenticator=Ys,Yt.parseOptions=function(e){let t=`${KT.DEFAULT_HOST}:${(0,KA.defaultPort)()}`;if((e=e||{servers:[t]}).servers=e.servers||[],"string"==typeof e.servers&&(e.servers=[e.servers]),e.servers.length>0&&e.port)throw Ka.InvalidArgumentError.format(["servers","port"],"are mutually exclusive");0===e.servers.length&&e.port&&(e.servers=[`${KT.DEFAULT_HOST}:${e.port}`]),e.servers&&0===e.servers.length&&(e.servers=[t]);let n=(0,Kr.extend)(Yo(),e);if(n.authenticator=Ys(n),["reconnectDelayHandler","authenticator"].forEach(e=>{if(n[e]&&"function"!=typeof n[e])throw TypeError(`'${e}' must be a function`)}),n.reconnectDelayHandler||(n.reconnectDelayHandler=()=>{let e=n.tls?n.reconnectJitterTLS:n.reconnectJitter;return e&&(e=Math.floor(Math.random()*++e)),n.reconnectTimeWait+e}),n.inboxPrefix&&(0,KT.createInbox)(n.inboxPrefix),void 0===n.resolve&&(n.resolve="function"==typeof(0,KA.getResolveFn)()),n.resolve&&"function"!=typeof(0,KA.getResolveFn)())throw Ka.InvalidArgumentError.format("resolve","is not supported in the current runtime");return n},Yt.checkOptions=function(e,t){let{proto:n,tls_required:r,tls_available:i}=e;if((void 0===n||n<1)&&t.noEcho)throw new Ka.errors.ConnectionError("server does not support 'noEcho'");if(t.tls&&!(r||i))throw new Ka.errors.ConnectionError("server does not support 'tls'")},Yt.checkUnsupportedOption=function(e,t){if(t)throw Ka.InvalidArgumentError.format(e,"is not supported")};var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.multiAuthenticator=function(e){return t=>{let n={};return e.forEach(e=>{let r=e(t)||{};n=Object.assign(n,r)}),n}},Yn.noAuthFn=function(){return()=>{}},Yn.usernamePasswordAuthenticator=function(e,t){return()=>({user:"function"==typeof e?e():e,pass:"function"==typeof t?t():t})},Yn.tokenAuthenticator=function(e){return()=>({auth_token:"function"==typeof e?e():e})},Yn.nkeyAuthenticator=Yi,Yn.jwtAuthenticator=Ya,Yn.credsAuthenticator=function(e){let t="function"!=typeof e?()=>e:e,n=()=>{let e=/\s*(?:(?:[-]{3,}[^\n]*[-]{3,}\n)(.+)(?:\n\s*[-]{3,}[^\n]*[-]{3,}\n))/ig,n=Ki.TD.decode(t()),r=e.exec(n);if(!r)throw Error("unable to parse credentials");let i=r[1].trim();if(!(r=e.exec(n)))throw Error("unable to parse credentials");return{jwt:i,seed:Ki.TE.encode(r[1].trim())}};return Ya(()=>{let{jwt:e}=n();return e},()=>{let{seed:e}=n();return e})};var Yr=ec("k53No");function Yi(e){return t=>{let n="function"==typeof e?e():e,r=n?Yr.nkeys.fromSeed(n):void 0,i=r?r.getPublicKey():"",a=Ki.TE.encode(t||""),o=void 0!==r&&t?r.sign(a):void 0;return{nkey:i,sig:o?Yr.nkeys.encode(o):""}}}function Ya(e,t){return n=>{let r="function"==typeof e?e():e,{nkey:i,sig:a}=Yi(t)(n);return{jwt:r,nkey:i,sig:a}}}function Yo(){return{maxPingOut:Yt.DEFAULT_MAX_PING_OUT,maxReconnectAttempts:Yt.DEFAULT_MAX_RECONNECT_ATTEMPTS,noRandomize:!1,pedantic:!1,pingInterval:Yt.DEFAULT_PING_INTERVAL,reconnect:!0,reconnectJitter:Yt.DEFAULT_JITTER,reconnectJitterTLS:Yt.DEFAULT_JITTER_TLS,reconnectTimeWait:Yt.DEFAULT_RECONNECT_TIME_WAIT,tls:void 0,verbose:!1,waitOnFirstConnect:!1,ignoreAuthErrorAbort:!1}}function Ys(e){let t=[];return"function"==typeof e.authenticator&&t.push(e.authenticator),Array.isArray(e.authenticator)&&t.push(...e.authenticator),e.token&&t.push((0,Yn.tokenAuthenticator)(e.token)),e.user&&t.push((0,Yn.usernamePasswordAuthenticator)(e.user,e.pass)),0===t.length?(0,Yn.noAuthFn)():(0,Yn.multiAuthenticator)(t)}Yt.DEFAULT_MAX_RECONNECT_ATTEMPTS=10,Yt.DEFAULT_JITTER=100,Yt.DEFAULT_JITTER_TLS=1e3,Yt.DEFAULT_PING_INTERVAL=12e4,Yt.DEFAULT_MAX_PING_OUT=2,Yt.DEFAULT_RECONNECT_TIME_WAIT=2e3,KE.INFO=/^INFO\s+([^\r\n]+)\r\n/i;let Yl=(0,Ki.encode)("PONG\r\n"),Yu=(0,Ki.encode)("PING\r\n");class Yc{echo;no_responders;protocol;verbose;pedantic;jwt;nkey;sig;user;pass;auth_token;tls_required;name;lang;version;headers;constructor(e,t,n){this.protocol=1,this.version=e.version,this.lang=e.lang,this.echo=!t.noEcho&&void 0,this.verbose=t.verbose,this.pedantic=t.pedantic,this.tls_required=!!t.tls||void 0,this.name=t.name;let r=(t&&"function"==typeof t.authenticator?t.authenticator(n):{})||{};(0,Kr.extend)(this,r)}}KE.Connect=Yc;class Yd{slow;cb;notified;constructor(e,t){this.slow=e,this.cb=t,this.notified=!1}maybeNotify(e){e<=this.slow?this.notified=!1:this.notified||(this.cb(e),this.notified=!0)}}class Yh extends KW.QueuedIteratorImpl{sid;queue;draining;max;subject;drained;protocol;timer;info;cleanupFn;closed;requestSubject;slow;constructor(e,t,n={}){super(),(0,Kr.extend)(this,n),this.protocol=e,this.subject=t,this.draining=!1,this.noIterator="function"==typeof n.callback,this.closed=(0,Kr.deferred)();let r=!e.options?.noAsyncTraces;n.timeout&&(this.timer=(0,Kr.timeout)(n.timeout,r),this.timer.then(()=>{this.timer=void 0}).catch(e=>{this.stop(e),this.noIterator&&this.callback(e,{})})),this.noIterator||this.iterClosed.then(e=>{this.closed.resolve(e),this.unsubscribe()})}setSlowNotificationFn(e,t){if(this.slow=void 0,t){if(this.noIterator)throw Error("callbacks don't support slow notifications");this.slow=new Yd(e,t)}}callback(e,t){this.cancelTimeout(),e?this.stop(e):this.push(t),!e&&this.slow&&this.slow.maybeNotify(this.getPending())}close(e){if(!this.isClosed()){this.cancelTimeout();let t=()=>{if(this.stop(),this.cleanupFn)try{this.cleanupFn(this,this.info)}catch(e){}this.closed.resolve(e)};this.noIterator?t():this.push(t)}}unsubscribe(e){this.protocol.unsubscribe(this,e)}cancelTimeout(){this.timer&&(this.timer.cancel(),this.timer=void 0)}drain(){return this.protocol.isClosed()?Promise.reject(new Ka.errors.ClosedConnectionError):this.isClosed()?Promise.reject(new Ka.errors.InvalidOperationError("subscription is already closed")):(this.drained||(this.draining=!0,this.protocol.unsub(this),this.drained=this.protocol.flush((0,Kr.deferred)()).then(()=>{this.protocol.subscriptions.cancel(this)}).catch(()=>{this.protocol.subscriptions.cancel(this)})),this.drained)}async [Symbol.asyncDispose](){if(!(this.protocol.isClosed()||this.isClosed())){if(this.drained)return void await this.drained;await this.drain()}}isDraining(){return this.draining}isClosed(){return this.done}getSubject(){return this.subject}getMax(){return this.max}getID(){return this.sid}}KE.SubscriptionImpl=Yh;class Yp{mux;subs;sidCounter;constructor(){this.sidCounter=0,this.mux=null,this.subs=new Map}size(){return this.subs.size}add(e){return this.sidCounter++,e.sid=this.sidCounter,this.subs.set(e.sid,e),e}setMux(e){return this.mux=e,e}getMux(){return this.mux}get(e){return this.subs.get(e)}resub(e){return this.sidCounter++,this.subs.delete(e.sid),e.sid=this.sidCounter,this.subs.set(e.sid,e),e}all(){return Array.from(this.subs.values())}cancel(e){e&&(e.close(),this.subs.delete(e.sid))}handleError(e){let t,n=this.all();return"subscription"===e.operation?t=n.find(t=>t.subject===e.subject&&t.queue===e.queue):"publish"===e.operation&&(t=n.find(t=>t.requestSubject===e.subject)),!!t&&(t.callback(e,{}),t.close(e),this.subs.delete(t.sid),t!==this.mux)}close(){this.subs.forEach(e=>{e.close()})}}"use strict";KE.Subscriptions=Yp,KE.ProtocolHandler=class e{connected;connectedOnce;infoReceived;info;muxSubscriptions;options;outbound;pongs;subscriptions;transport;noMorePublishing;connectError;publisher;_closed;closed;listeners;heartbeats;parser;outMsgs;inMsgs;outBytes;inBytes;pendingLimit;lastError;abortReconnect;whyClosed;servers;server;features;connectPromise;dialDelay;raceTimer;constructor(e,t){this._closed=!1,this.connected=!1,this.connectedOnce=!1,this.infoReceived=!1,this.noMorePublishing=!1,this.abortReconnect=!1,this.listeners=[],this.pendingLimit=32768,this.outMsgs=0,this.inMsgs=0,this.outBytes=0,this.inBytes=0,this.options=e,this.publisher=t,this.subscriptions=new Yp,this.muxSubscriptions=new K$.MuxSubscription,this.outbound=new KL.DataBuffer,this.pongs=[],this.whyClosed="",this.pendingLimit=e.pendingLimit||this.pendingLimit,this.features=new K7.Features({major:0,minor:0,micro:0}),this.connectPromise=null,this.dialDelay=null;let n="string"==typeof e.servers?[e.servers]:e.servers;this.servers=new KB.Servers({randomize:!e.noRandomize}),this.servers.setServers(n),this.closed=(0,Kr.deferred)(),this.parser=new KK.Parser(this),this.heartbeats=new KJ.Heartbeat(this,this.options.pingInterval||Yt.DEFAULT_PING_INTERVAL,this.options.maxPingOut||Yt.DEFAULT_MAX_PING_OUT)}resetOutbound(){this.outbound.reset();let e=this.pongs;this.pongs=[];let t=new Ka.errors.RequestError("connection disconnected");t.stack="",e.forEach(e=>{e.reject(t)}),this.parser=new KK.Parser(this),this.infoReceived=!1}dispatchStatus(e){this.listeners.forEach(t=>{t.push(e)})}prepare(){this.transport&&this.transport.discard(),this.info=void 0,this.resetOutbound();let e=(0,Kr.deferred)();return e.catch(()=>{}),this.pongs.unshift(e),this.connectError=t=>{e.reject(t)},this.transport=(0,KA.newTransport)(),this.transport.closed().then(async e=>{if(this.connected=!1,!this.isClosed())return void await this.disconnected(this.transport.closeError||this.lastError)}),e}disconnect(){this.dispatchStatus({type:"staleConnection"}),this.transport.disconnect()}reconnect(){return this.connected&&(this.dispatchStatus({type:"forceReconnect"}),this.transport.disconnect()),Promise.resolve()}async disconnected(e){this.dispatchStatus({type:"disconnect",server:this.servers.getCurrentServer().toString()}),this.options.reconnect?await this.dialLoop().then(()=>{this.dispatchStatus({type:"reconnect",server:this.servers.getCurrentServer().toString()}),this.lastError instanceof Ka.errors.UserAuthenticationExpiredError&&(this.lastError=void 0)}).catch(e=>{this.close(e).catch()}):await this.close(e).catch()}async dial(e){let t=this.prepare();try{this.raceTimer=(0,Kr.timeout)(this.options.timeout||2e4);let t=this.transport.connect(e,this.options);await Promise.race([t,this.raceTimer]),(async()=>{try{for await(let e of this.transport)this.parser.parse(e)}catch(e){console.log("reader closed",e)}})().then()}catch(e){t.reject(e)}try{await Promise.race([this.raceTimer,t]),this.raceTimer?.cancel(),this.connected=!0,this.connectError=void 0,this.sendSubscriptions(),this.connectedOnce=!0,this.server.didConnect=!0,this.server.reconnects=0,this.flushPending(),this.heartbeats.start()}catch(e){throw this.raceTimer?.cancel(),await this.transport.close(e),e}}async _doDial(e){let{resolve:t}=this.options,n=await e.resolve({fn:(0,KA.getResolveFn)(),debug:this.options.debug,randomize:!this.options.noRandomize,resolve:t}),r=null;for(let e of n)try{r=null,this.dispatchStatus({type:"reconnecting"}),await this.dial(e);return}catch(e){r=e}throw r}dialLoop(){return null===this.connectPromise&&(this.connectPromise=this.dodialLoop(),this.connectPromise.then(()=>{}).catch(()=>{}).finally(()=>{this.connectPromise=null})),this.connectPromise}async dodialLoop(){let e;for(;;){this._closed&&this.servers.clear();let t=this.options.reconnectDelayHandler?this.options.reconnectDelayHandler():Yt.DEFAULT_RECONNECT_TIME_WAIT,n=t,r=this.selectServer();if(!r||this.abortReconnect)if(e)throw e;else if(this.lastError)throw this.lastError;else throw new Ka.errors.ConnectionError("connection refused");let i=Date.now();if(0===r.lastConnect||r.lastConnect+t<=i){let t=r,n=0;if(this.options.reconnectToServer)try{let e,i=this.servers.snapshotForHandler(),a=this.options.reconnectToServer(i,this.info??null);if(null!==a&&"object"==typeof a&&"server"in a&&"delay"in a?(e=a.server,n=Number.isFinite(a.delay)&&a.delay>0?Math.floor(a.delay):0):e=a,null!==e){let n=this.servers.find(e);if(!n)throw Error("returned server is not in the pool");n!==r&&(t=n,this.servers.setCurrent(t),this.server=t)}}catch(t){let e=t instanceof Error?t:Error(String(t));throw new Ka.errors.ConnectionError(`client option reconnectToServer handler failed: ${e.message}`,{cause:e})}n>0&&(this.dialDelay=(0,Kr.delay)(n),await this.dialDelay),t.lastConnect=Date.now();try{await this._doDial(t);break}catch(r){if(e=r,!this.connectedOnce){if(this.options.waitOnFirstConnect)continue;this.servers.removeCurrentServer()}t.reconnects++;let n=this.options.maxReconnectAttempts||0;-1!==n&&t.reconnects>=n&&this.servers.removeCurrentServer()}}else n=Math.min(n,r.lastConnect+t-i),this.dialDelay=(0,Kr.delay)(n),await this.dialDelay}}static async connect(t,n){let r=new e(t,n);return await r.dialLoop(),r}static toError(e){let t=Ka.errors.PermissionViolationError.parse(e);return t||(t=Ka.errors.UserAuthenticationExpiredError.parse(e))||(t=Ka.errors.AuthorizationError.parse(e))?t:new Ka.errors.ProtocolError(e)}processMsg(e,t){if(this.inMsgs++,this.inBytes+=t.length,!this.subscriptions.sidCounter)return;let n=this.subscriptions.get(e.sid);n&&(n.received+=1,n.callback&&n.callback(null,new K3.MsgImpl(e,t,this)),void 0!==n.max&&n.received>=n.max&&n.unsubscribe())}processError(t){let n=(0,Ki.decode)(t);n.startsWith("'")&&n.endsWith("'")&&(n=n.slice(1,n.length-1));let r=e.toError(n);if(r.constructor===Ka.errors.PermissionViolationError){let e=this.subscriptions.getMux(),t=!!e&&r.subject===e.subject;this.subscriptions.handleError(r),this.muxSubscriptions.handleError(t,r),t&&this.subscriptions.setMux(null)}this.dispatchStatus({type:"error",error:r}),this.handleError(r)}handleError(e){(e instanceof Ka.errors.UserAuthenticationExpiredError||e instanceof Ka.errors.AuthorizationError)&&this.handleAuthError(e),e instanceof Ka.errors.PermissionViolationError||(this.lastError=e)}handleAuthError(e){(this.lastError instanceof Ka.errors.UserAuthenticationExpiredError||this.lastError instanceof Ka.errors.AuthorizationError)&&!1===this.options.ignoreAuthErrorAbort&&(this.abortReconnect=!0),this.connectError?this.connectError(e):this.disconnect()}processPing(){this.transport.send(Yl)}processPong(){let e=this.pongs.shift();e&&e.resolve()}processInfo(e){let t=JSON.parse((0,Ki.decode)(e));this.info=t;let n=this.options&&this.options.ignoreClusterUpdates?void 0:this.servers.update(t,this.transport.isEncrypted());if(!this.infoReceived){this.features.update((0,K7.parseSemVer)(t.version)),this.infoReceived=!0,this.transport.isEncrypted()&&this.servers.updateTLSName();let{version:e,lang:n}=this.transport;try{let r=new Yc({version:e,lang:n},this.options,t.nonce);t.headers&&(r.headers=!0,r.no_responders=!0);let i=JSON.stringify(r);this.transport.send((0,Ki.encode)(`CONNECT ${i}${KA.CR_LF}`)),this.transport.send(Yu)}catch(e){this.close(e).catch()}}if(n){let{added:e,deleted:t}=n;this.dispatchStatus({type:"update",added:e,deleted:t})}void 0!==t.ldm&&t.ldm&&this.dispatchStatus({type:"ldm",server:this.servers.getCurrentServer().toString()})}push(e){switch(e.kind){case KK.Kind.MSG:{let{msg:t,data:n}=e;this.processMsg(t,n);break}case KK.Kind.OK:break;case KK.Kind.ERR:this.processError(e.data);break;case KK.Kind.PING:this.processPing();break;case KK.Kind.PONG:this.processPong();break;case KK.Kind.INFO:this.processInfo(e.data)}}sendCommand(e,...t){let n,r=this.outbound.length();n="string"==typeof e?(0,Ki.encode)(e):e,this.outbound.fill(n,...t),0===r?queueMicrotask(()=>{this.flushPending()}):this.outbound.size()>=this.pendingLimit&&this.flushPending()}publish(e,t=Ki.Empty,n){let r,i;if(t instanceof Uint8Array)r=t;else if("string"==typeof t)r=Ki.TE.encode(t);else throw TypeError("payload types can be strings or Uint8Array");let a=r.length;(n=n||{}).reply=n.reply||"";let o=Ki.Empty,s=0;if(n.headers&&(this.info&&!this.info.headers&&Ka.InvalidArgumentError.format("headers","are not available on this server"),s=(o=n.headers.encode()).length,a=r.length+s),this.info&&a>this.info.max_payload)throw Ka.InvalidArgumentError.format("payload","max_payload size exceeded");this.outBytes+=a,this.outMsgs++,n.headers?(i=n.reply?`HPUB ${e} ${n.reply} ${s} ${a}\r
1074
1074
  `:`HPUB ${e} ${s} ${a}\r
1075
- `,this.sendCommand(i,o,r,KE.CRLF)):(i=n.reply?`PUB ${e} ${n.reply} ${a}\r
1075
+ `,this.sendCommand(i,o,r,KA.CRLF)):(i=n.reply?`PUB ${e} ${n.reply} ${a}\r
1076
1076
  `:`PUB ${e} ${a}\r
1077
- `,this.sendCommand(i,r,KE.CRLF))}request(e){return this.initMux(),this.muxSubscriptions.add(e),e}subscribe(e){return this.subscriptions.add(e),this._subunsub(e),e}_sub(e){e.queue?this.sendCommand(`SUB ${e.subject} ${e.queue} ${e.sid}\r
1077
+ `,this.sendCommand(i,r,KA.CRLF))}request(e){return this.initMux(),this.muxSubscriptions.add(e),e}subscribe(e){return this.subscriptions.add(e),this._subunsub(e),e}_sub(e){e.queue?this.sendCommand(`SUB ${e.subject} ${e.queue} ${e.sid}\r
1078
1078
  `):this.sendCommand(`SUB ${e.subject} ${e.sid}\r
1079
1079
  `)}_subunsub(e){return this._sub(e),e.max&&this.unsubscribe(e,e.max),e}unsubscribe(e,t){this.unsub(e,t),(void 0===e.max||e.received>=e.max)&&this.subscriptions.cancel(e)}unsub(e,t){!e||this.isClosed()||(t?this.sendCommand(`UNSUB ${e.sid} ${t}\r
1080
1080
  `):this.sendCommand(`UNSUB ${e.sid}\r
1081
- `),e.max=t)}resub(e,t){!e||this.isClosed()||(this.unsub(e),e.subject=t,this.subscriptions.resub(e),this._sub(e))}flush(e){return e||(e=(0,Kn.deferred)()),this.pongs.push(e),this.outbound.fill(Yl),this.flushPending(),e}sendSubscriptions(){let e=[];this.subscriptions.all().forEach(t=>{t.queue?e.push(`SUB ${t.subject} ${t.queue} ${t.sid}${KE.CR_LF}`):e.push(`SUB ${t.subject} ${t.sid}${KE.CR_LF}`)}),e.length&&this.transport.send((0,Kr.encode)(e.join("")))}async close(e){if(this._closed)return;this.whyClosed=Error("close trace").stack||"",this.heartbeats.cancel(),this.connectError&&(this.connectError(e),this.connectError=void 0),this.muxSubscriptions.close(),this.subscriptions.close();let t=[];for(let e=0;e<this.listeners.length;e++){let n=this.listeners[e];n&&(n.push({type:"close"}),n.stop(),t.push(n.iterClosed))}t.length&&await Promise.all(t),this._closed=!0,await this.transport.close(e),this.raceTimer?.cancel(),this.dialDelay?.cancel(),this.closed.resolve(e)}isClosed(){return this._closed}async drain(){let e=this.subscriptions.all(),t=[];e.forEach(e=>{t.push(e.drain())});try{await Promise.allSettled(t)}catch{}finally{this.noMorePublishing=!0,await this.flush()}return this.close()}flushPending(){if(this.infoReceived&&this.connected&&this.outbound.size()){let e=this.outbound.drain();this.transport.send(e)}}initMux(){if(!this.subscriptions.getMux()){let e=this.muxSubscriptions.init(this.options.inboxPrefix),t=new Yd(this,`${e}*`);t.callback=this.muxSubscriptions.dispatcher(),this.subscriptions.setMux(t),this.subscribe(t)}}selectServer(){let e=this.servers.selectServer();if(void 0!==e)return this.server=e,this.server}getServer(){return this.server}};var Yp={};Object.defineProperty(Yp,"__esModule",{value:!0}),Yp.RequestOne=Yp.RequestMany=Yp.BaseRequest=void 0;class Ym{token;received;ctx;requestSubject;mux;constructor(e,t,n=!0){this.mux=e,this.requestSubject=t,this.received=0,this.token=(0,Kn.randomToken)(),n&&(this.ctx=new Ki.RequestError)}}Yp.BaseRequest=Ym,Yp.RequestMany=class extends Ym{callback;done;timer;max;opts;constructor(e,t,n={maxWait:1e3}){if(super(e,t),this.opts=n,"function"!=typeof this.opts.callback)throw TypeError("callback must be a function");this.callback=this.opts.callback,this.max="number"==typeof n.maxMessages&&n.maxMessages>0?n.maxMessages:-1,this.done=(0,Kn.deferred)(),this.done.then(()=>{this.callback(null,null)}),this.timer=setTimeout(()=>{this.cancel()},n.maxWait)}cancel(e){e&&this.callback(e,null),clearTimeout(this.timer),this.mux.cancel(this),this.done.resolve()}resolver(e,t){e?(this.ctx&&(e.stack+=`
1081
+ `),e.max=t)}resub(e,t){!e||this.isClosed()||(this.unsub(e),e.subject=t,this.subscriptions.resub(e),this._sub(e))}flush(e){return e||(e=(0,Kr.deferred)()),this.pongs.push(e),this.outbound.fill(Yu),this.flushPending(),e}sendSubscriptions(){let e=[];this.subscriptions.all().forEach(t=>{t.queue?e.push(`SUB ${t.subject} ${t.queue} ${t.sid}${KA.CR_LF}`):e.push(`SUB ${t.subject} ${t.sid}${KA.CR_LF}`)}),e.length&&this.transport.send((0,Ki.encode)(e.join("")))}async close(e){if(this._closed)return;this.whyClosed=Error("close trace").stack||"",this.heartbeats.cancel(),this.connectError&&(this.connectError(e),this.connectError=void 0),this.muxSubscriptions.close(),this.subscriptions.close();let t=[];for(let e=0;e<this.listeners.length;e++){let n=this.listeners[e];n&&(n.push({type:"close"}),n.stop(),t.push(n.iterClosed))}t.length&&await Promise.all(t),this._closed=!0,await this.transport.close(e),this.raceTimer?.cancel(),this.dialDelay?.cancel(),this.closed.resolve(e)}isClosed(){return this._closed}async drain(){let e=this.subscriptions.all(),t=[];e.forEach(e=>{t.push(e.drain())});try{await Promise.allSettled(t)}catch{}finally{this.noMorePublishing=!0,await this.flush()}return this.close()}flushPending(){if(this.infoReceived&&this.connected&&this.outbound.size()){let e=this.outbound.drain();this.transport.send(e)}}initMux(){if(!this.subscriptions.getMux()){let e=this.muxSubscriptions.init(this.options.inboxPrefix),t=new Yh(this,`${e}*`);t.callback=this.muxSubscriptions.dispatcher(),this.subscriptions.setMux(t),this.subscribe(t)}}selectServer(){let e=this.servers.selectServer();if(void 0!==e)return this.server=e,this.server}getServer(){return this.server}};var Ym={};Object.defineProperty(Ym,"__esModule",{value:!0}),Ym.RequestOne=Ym.RequestMany=Ym.BaseRequest=void 0;class Yf{token;received;ctx;requestSubject;mux;constructor(e,t,n=!0){this.mux=e,this.requestSubject=t,this.received=0,this.token=(0,Kr.randomToken)(),n&&(this.ctx=new Ka.RequestError)}}Ym.BaseRequest=Yf,Ym.RequestMany=class extends Yf{callback;done;timer;max;opts;constructor(e,t,n={maxWait:1e3}){if(super(e,t),this.opts=n,"function"!=typeof this.opts.callback)throw TypeError("callback must be a function");this.callback=this.opts.callback,this.max="number"==typeof n.maxMessages&&n.maxMessages>0?n.maxMessages:-1,this.done=(0,Kr.deferred)(),this.done.then(()=>{this.callback(null,null)}),this.timer=setTimeout(()=>{this.cancel()},n.maxWait)}cancel(e){e&&this.callback(e,null),clearTimeout(this.timer),this.mux.cancel(this),this.done.resolve()}resolver(e,t){e?(this.ctx&&(e.stack+=`
1082
1082
 
1083
- ${this.ctx.stack}`),this.cancel(e)):(this.callback(null,t),"count"===this.opts.strategy&&(this.max--,0===this.max&&this.cancel()),"stall"===this.opts.strategy&&(clearTimeout(this.timer),this.timer=setTimeout(()=>{this.cancel()},this.opts.stall||300)),"sentinel"===this.opts.strategy&&t&&0===t.data.length&&this.cancel())}},Yp.RequestOne=class extends Ym{deferred;timer;constructor(e,t,n={timeout:1e3},r=!0){super(e,t,r),this.deferred=(0,Kn.deferred)(),this.timer=(0,Kn.timeout)(n.timeout,r)}resolver(e,t){this.timer&&this.timer.cancel(),e?(e instanceof Ki.TimeoutError||(this.ctx?(this.ctx.message=e.message,this.ctx.cause=e,e=this.ctx):e=new Ki.errors.RequestError(e.message,{cause:e})),this.deferred.reject(e)):this.deferred.resolve(t),this.cancel()}cancel(e){this.timer&&this.timer.cancel(),this.mux.cancel(this),this.deferred.reject(e||new Ki.RequestError("cancelled"))}};let Yf=/[ \n\r\t]/;class Yg{options;protocol;draining;closeListeners;constructor(e){this.draining=!1,this.options=(0,Ye.parseOptions)(e)}static connect(e={}){return new Promise((t,n)=>{let r=new Yg(e);KS.ProtocolHandler.connect(r.options,r).then(e=>{r.protocol=e,t(r)}).catch(e=>{n(e)})})}closed(){return this.protocol.closed}async close(){await this.protocol.close()}_check(e,t,n){if(this.isClosed())throw new Ki.errors.ClosedConnectionError;if(t&&this.isDraining()||n&&this.protocol.noMorePublishing)throw new Ki.errors.DrainingConnectionError;if(0===(e=e||"").length||Yf.test(e))throw new Ki.errors.InvalidSubjectError(e)}publish(e,t,n){if(this._check(e,!1,!0),n?.reply&&this._check(n.reply,!1,!0),"boolean"==typeof n?.traceOnly){let e=n.headers||(0,K3.headers)();e.set("Nats-Trace-Only","true"),n.headers=e}if("string"==typeof n?.traceDestination){let e=n.headers||(0,K3.headers)();e.set("Nats-Trace-Dest",n.traceDestination),n.headers=e}this.protocol.publish(e,t,n)}publishMessage(e){return this.publish(e.subject,e.data,{reply:e.reply,headers:e.headers})}respondMessage(e){return!!e.reply&&(this.publish(e.reply,e.data,{reply:e.reply,headers:e.headers}),!0)}subscribe(e,t={}){this._check(e,!0,!1);let n=new KS.SubscriptionImpl(this.protocol,e,t);return"function"!=typeof t.callback&&"number"==typeof t.slow&&n.setSlowNotificationFn(t.slow,e=>{this.protocol.dispatchStatus({type:"slowConsumer",sub:n,pending:e})}),this.protocol.subscribe(n),n}_resub(e,t,n){this._check(t,!0,!1),e.max=n,n&&(e.max=n+e.received),this.protocol.resub(e,t)}requestMany(e,t=Kr.Empty,n={maxWait:1e3,maxMessages:-1}){let r=!this.protocol.options.noAsyncTraces;try{this._check(e,!0,!0)}catch(e){return Promise.reject(e)}if(n.strategy=n.strategy||"timer",n.maxWait=n.maxWait||1e3,n.maxWait<1)return Promise.reject(Ki.InvalidArgumentError.format("timeout","must be greater than 0"));let i=new KV.QueuedIteratorImpl;function a(e){i.push(()=>{i.stop(e)})}function o(e,t){e||null===t?a(null===e?void 0:e):i.push(t)}if(n.noMux){let s=r?Error().stack:null,l="number"==typeof n.maxMessages&&n.maxMessages>0?n.maxMessages:-1,u=this.subscribe((0,KA.createInbox)(this.options.inboxPrefix),{callback:(t,r)=>{if(r?.data?.length===0&&r?.headers?.status==="503"&&(t=new Ki.errors.NoRespondersError(e)),t){s&&(t.stack+=`
1083
+ ${this.ctx.stack}`),this.cancel(e)):(this.callback(null,t),"count"===this.opts.strategy&&(this.max--,0===this.max&&this.cancel()),"stall"===this.opts.strategy&&(clearTimeout(this.timer),this.timer=setTimeout(()=>{this.cancel()},this.opts.stall||300)),"sentinel"===this.opts.strategy&&t&&0===t.data.length&&this.cancel())}},Ym.RequestOne=class extends Yf{deferred;timer;constructor(e,t,n={timeout:1e3},r=!0){super(e,t,r),this.deferred=(0,Kr.deferred)(),this.timer=(0,Kr.timeout)(n.timeout,r)}resolver(e,t){this.timer&&this.timer.cancel(),e?(e instanceof Ka.TimeoutError||(this.ctx?(this.ctx.message=e.message,this.ctx.cause=e,e=this.ctx):e=new Ka.errors.RequestError(e.message,{cause:e})),this.deferred.reject(e)):this.deferred.resolve(t),this.cancel()}cancel(e){this.timer&&this.timer.cancel(),this.mux.cancel(this),this.deferred.reject(e||new Ka.RequestError("cancelled"))}};let Yg=/[ \n\r\t]/;class Yv{options;protocol;draining;closeListeners;constructor(e){this.draining=!1,this.options=(0,Yt.parseOptions)(e)}static connect(e={}){return new Promise((t,n)=>{let r=new Yv(e);KE.ProtocolHandler.connect(r.options,r).then(e=>{r.protocol=e,t(r)}).catch(e=>{n(e)})})}closed(){return this.protocol.closed}async close(){await this.protocol.close()}_check(e,t,n){if(this.isClosed())throw new Ka.errors.ClosedConnectionError;if(t&&this.isDraining()||n&&this.protocol.noMorePublishing)throw new Ka.errors.DrainingConnectionError;if(0===(e=e||"").length||Yg.test(e))throw new Ka.errors.InvalidSubjectError(e)}publish(e,t,n){if(this._check(e,!1,!0),n?.reply&&this._check(n.reply,!1,!0),"boolean"==typeof n?.traceOnly){let e=n.headers||(0,K4.headers)();e.set("Nats-Trace-Only","true"),n.headers=e}if("string"==typeof n?.traceDestination){let e=n.headers||(0,K4.headers)();e.set("Nats-Trace-Dest",n.traceDestination),n.headers=e}this.protocol.publish(e,t,n)}publishMessage(e){return this.publish(e.subject,e.data,{reply:e.reply,headers:e.headers})}respondMessage(e){return!!e.reply&&(this.publish(e.reply,e.data,{reply:e.reply,headers:e.headers}),!0)}subscribe(e,t={}){this._check(e,!0,!1);let n=new KE.SubscriptionImpl(this.protocol,e,t);return"function"!=typeof t.callback&&"number"==typeof t.slow&&n.setSlowNotificationFn(t.slow,e=>{this.protocol.dispatchStatus({type:"slowConsumer",sub:n,pending:e})}),this.protocol.subscribe(n),n}_resub(e,t,n){this._check(t,!0,!1),e.max=n,n&&(e.max=n+e.received),this.protocol.resub(e,t)}requestMany(e,t=Ki.Empty,n={maxWait:1e3,maxMessages:-1}){let r=!this.protocol.options.noAsyncTraces;try{this._check(e,!0,!0)}catch(e){return Promise.reject(e)}if(n.strategy=n.strategy||"timer",n.maxWait=n.maxWait||1e3,n.maxWait<1)return Promise.reject(Ka.InvalidArgumentError.format("timeout","must be greater than 0"));let i=new KW.QueuedIteratorImpl;function a(e){i.push(()=>{i.stop(e)})}function o(e,t){e||null===t?a(null===e?void 0:e):i.push(t)}if(n.noMux){let s=r?Error().stack:null,l="number"==typeof n.maxMessages&&n.maxMessages>0?n.maxMessages:-1,u=this.subscribe((0,KT.createInbox)(this.options.inboxPrefix),{callback:(t,r)=>{if(r?.data?.length===0&&r?.headers?.status==="503"&&(t=new Ka.errors.NoRespondersError(e)),t){s&&(t.stack+=`
1084
1084
 
1085
- ${s}`),c(t);return}o(null,r),"count"===n.strategy&&0==--l&&c(),"stall"===n.strategy&&(f(),m=setTimeout(()=>{c()},300)),"sentinel"===n.strategy&&r&&0===r.data.length&&c()}});u.requestSubject=e,u.closed.then(()=>{a()}).catch(e=>{i.stop(e)});let c=e=>{e&&i.push(()=>{throw e}),f(),u.drain().then(()=>{a()}).catch(e=>{a()})};i.iterClosed.then(()=>{f(),u?.unsubscribe()}).catch(e=>{f(),u?.unsubscribe()});let{headers:d,traceDestination:h,traceOnly:p}=n;try{this.publish(e,t,{reply:u.getSubject(),headers:d,traceDestination:h,traceOnly:p})}catch(e){c(e)}let m=setTimeout(()=>{c()},n.maxWait),f=()=>{m&&clearTimeout(m)}}else{n.callback=o,i.iterClosed.then(()=>{r.cancel()}).catch(e=>{r.cancel(e)});let r=new Yp.RequestMany(this.protocol.muxSubscriptions,e,n);this.protocol.request(r);let{headers:a,traceDestination:s,traceOnly:l}=n;try{this.publish(e,t,{reply:`${this.protocol.muxSubscriptions.baseInbox}${r.token}`,headers:a,traceDestination:s,traceOnly:l})}catch(e){r.cancel(e)}}return Promise.resolve(i)}request(e,t,n={timeout:1e3,noMux:!1}){try{this._check(e,!0,!0)}catch(e){return Promise.reject(e)}let r=!this.protocol.options.noAsyncTraces;if(n.timeout=n.timeout||1e3,n.timeout<1)return Promise.reject(Ki.InvalidArgumentError.format("timeout","must be greater than 0"));if(!n.noMux&&n.reply)return Promise.reject(Ki.InvalidArgumentError.format(["reply","noMux"],"are mutually exclusive"));if(n.noMux){let i=n.reply?n.reply:(0,KA.createInbox)(this.options.inboxPrefix),a=(0,Kn.deferred)(),o=r?new Ki.errors.RequestError(""):null,s=this.subscribe(i,{max:1,timeout:n.timeout,callback:(t,n)=>{n&&n.data?.length===0&&n.headers?.code===503&&(t=new Ki.errors.NoRespondersError(e)),t?(t instanceof Ki.TimeoutError||(o?(o.message=t.message,o.cause=t,t=o):t=new Ki.errors.RequestError(t.message,{cause:t})),a.reject(t),s.unsubscribe()):a.resolve(n)}});return s.requestSubject=e,this.protocol.publish(e,t,{reply:i,headers:n.headers}),a}{let i=new Yp.RequestOne(this.protocol.muxSubscriptions,e,n,r);this.protocol.request(i);let{headers:a,traceDestination:o,traceOnly:s}=n;try{this.publish(e,t,{reply:`${this.protocol.muxSubscriptions.baseInbox}${i.token}`,headers:a,traceDestination:o,traceOnly:s})}catch(e){i.cancel(e)}let l=Promise.race([i.timer,i.deferred]);return l.catch(()=>{i.cancel()}),l}}flush(){return this.isClosed()?Promise.reject(new Ki.errors.ClosedConnectionError):this.protocol.flush()}drain(){return this.isClosed()?Promise.reject(new Ki.errors.ClosedConnectionError):this.isDraining()?Promise.reject(new Ki.errors.DrainingConnectionError):(this.draining=!0,this.protocol.drain())}async [Symbol.asyncDispose](){if(!this.isClosed()){if(this.isDraining())return void await this.closed();await this.drain()}}isClosed(){return this.protocol.isClosed()}isDraining(){return this.draining}getServer(){let e=this.protocol.getServer();return e?e.listen:""}setServers(e){this.protocol.servers.setServers(e)}getServers(){return this.protocol.servers.snapshot()}status(){let e=new KV.QueuedIteratorImpl;return e.iterClosed.then(()=>{let t=this.protocol.listeners.indexOf(e);t>-1&&this.protocol.listeners.splice(t,1)}),this.protocol.listeners.push(e),e}get info(){return this.protocol.isClosed()?void 0:this.protocol.info}async context(){return(await this.request("$SYS.REQ.USER.INFO")).json((e,t)=>"time"===e?new Date(Date.parse(t)):t)}stats(){return{inBytes:this.protocol.inBytes,outBytes:this.protocol.outBytes,inMsgs:this.protocol.inMsgs,outMsgs:this.protocol.outMsgs}}getServerVersion(){let e=this.info;return e?(0,K8.parseSemVer)(e.version):void 0}async rtt(){if(this.isClosed())throw new Ki.errors.ClosedConnectionError;if(!this.protocol.connected)throw new Ki.errors.RequestError("connection disconnected");let e=Date.now();return await this.flush(),Date.now()-e}get features(){return this.protocol.features}reconnect(){return this.isClosed()?Promise.reject(new Ki.errors.ClosedConnectionError):this.isDraining()?Promise.reject(new Ki.errors.DrainingConnectionError):this.protocol.reconnect()}addCloseListener(e){void 0===this.closeListeners&&(this.closeListeners=new Yv(this.closed())),this.closeListeners.add(e)}removeCloseListener(e){this.closeListeners&&this.closeListeners.remove(e)}}Kt.NatsConnectionImpl=Yg;class Yv{listeners;constructor(e){this.listeners=[],e.then(e=>{this.notify(e)})}add(e){this.listeners.push(e)}remove(e){this.listeners=this.listeners.filter(t=>t!==e)}notify(e){this.listeners.forEach(t=>{if("function"==typeof t.connectionClosedCallback)try{t.connectionClosedCallback(e)}catch(e){}}),this.listeners=[]}}"use strict";Object.defineProperty(J7,"NatsConnectionImpl",{enumerable:!0,get:function(){return Kt.NatsConnectionImpl}}),Object.defineProperty(J7,"Nuid",{enumerable:!0,get:function(){return KT.Nuid}}),Object.defineProperty(J7,"nuid",{enumerable:!0,get:function(){return KT.nuid}}),Object.defineProperty(J7,"MsgImpl",{enumerable:!0,get:function(){return K2.MsgImpl}}),Object.defineProperty(J7,"getResolveFn",{enumerable:!0,get:function(){return KE.getResolveFn}}),Object.defineProperty(J7,"setTransportFactory",{enumerable:!0,get:function(){return KE.setTransportFactory}}),Object.defineProperty(J7,"Connect",{enumerable:!0,get:function(){return KS.Connect}}),Object.defineProperty(J7,"INFO",{enumerable:!0,get:function(){return KS.INFO}}),Object.defineProperty(J7,"ProtocolHandler",{enumerable:!0,get:function(){return KS.ProtocolHandler}}),Object.defineProperty(J7,"backoff",{enumerable:!0,get:function(){return Kn.backoff}}),Object.defineProperty(J7,"collect",{enumerable:!0,get:function(){return Kn.collect}}),Object.defineProperty(J7,"deadline",{enumerable:!0,get:function(){return Kn.deadline}}),Object.defineProperty(J7,"deferred",{enumerable:!0,get:function(){return Kn.deferred}}),Object.defineProperty(J7,"delay",{enumerable:!0,get:function(){return Kn.delay}}),Object.defineProperty(J7,"extend",{enumerable:!0,get:function(){return Kn.extend}}),Object.defineProperty(J7,"millis",{enumerable:!0,get:function(){return Kn.millis}}),Object.defineProperty(J7,"nanos",{enumerable:!0,get:function(){return Kn.nanos}}),Object.defineProperty(J7,"render",{enumerable:!0,get:function(){return Kn.render}}),Object.defineProperty(J7,"SimpleMutex",{enumerable:!0,get:function(){return Kn.SimpleMutex}}),Object.defineProperty(J7,"timeout",{enumerable:!0,get:function(){return Kn.timeout}}),Object.defineProperty(J7,"canonicalMIMEHeaderKey",{enumerable:!0,get:function(){return K3.canonicalMIMEHeaderKey}}),Object.defineProperty(J7,"headers",{enumerable:!0,get:function(){return K3.headers}}),Object.defineProperty(J7,"MsgHdrsImpl",{enumerable:!0,get:function(){return K3.MsgHdrsImpl}}),Object.defineProperty(J7,"Heartbeat",{enumerable:!0,get:function(){return K$.Heartbeat}}),Object.defineProperty(J7,"MuxSubscription",{enumerable:!0,get:function(){return Kq.MuxSubscription}}),Object.defineProperty(J7,"DataBuffer",{enumerable:!0,get:function(){return Kk.DataBuffer}}),Object.defineProperty(J7,"buildAuthenticator",{enumerable:!0,get:function(){return Ye.buildAuthenticator}}),Object.defineProperty(J7,"checkOptions",{enumerable:!0,get:function(){return Ye.checkOptions}}),Object.defineProperty(J7,"checkUnsupportedOption",{enumerable:!0,get:function(){return Ye.checkUnsupportedOption}}),Object.defineProperty(J7,"DEFAULT_MAX_RECONNECT_ATTEMPTS",{enumerable:!0,get:function(){return Ye.DEFAULT_MAX_RECONNECT_ATTEMPTS}}),Object.defineProperty(J7,"defaultOptions",{enumerable:!0,get:function(){return Ye.defaultOptions}}),Object.defineProperty(J7,"hasWsProtocol",{enumerable:!0,get:function(){return Ye.hasWsProtocol}}),Object.defineProperty(J7,"parseOptions",{enumerable:!0,get:function(){return Ye.parseOptions}}),Object.defineProperty(J7,"RequestOne",{enumerable:!0,get:function(){return Yp.RequestOne}}),Object.defineProperty(J7,"credsAuthenticator",{enumerable:!0,get:function(){return Yt.credsAuthenticator}}),Object.defineProperty(J7,"jwtAuthenticator",{enumerable:!0,get:function(){return Yt.jwtAuthenticator}}),Object.defineProperty(J7,"nkeyAuthenticator",{enumerable:!0,get:function(){return Yt.nkeyAuthenticator}}),Object.defineProperty(J7,"tokenAuthenticator",{enumerable:!0,get:function(){return Yt.tokenAuthenticator}}),Object.defineProperty(J7,"usernamePasswordAuthenticator",{enumerable:!0,get:function(){return Yt.usernamePasswordAuthenticator}}),Ke(ec("k53No"),J7),Object.defineProperty(J7,"QueuedIteratorImpl",{enumerable:!0,get:function(){return KV.QueuedIteratorImpl}}),Object.defineProperty(J7,"describe",{enumerable:!0,get:function(){return KJ.describe}}),Object.defineProperty(J7,"Kind",{enumerable:!0,get:function(){return KJ.Kind}}),Object.defineProperty(J7,"Parser",{enumerable:!0,get:function(){return KJ.Parser}}),Object.defineProperty(J7,"State",{enumerable:!0,get:function(){return KJ.State}}),Object.defineProperty(J7,"DenoBuffer",{enumerable:!0,get:function(){return KK.DenoBuffer}}),Object.defineProperty(J7,"MAX_SIZE",{enumerable:!0,get:function(){return KK.MAX_SIZE}}),Object.defineProperty(J7,"readAll",{enumerable:!0,get:function(){return KK.readAll}}),Object.defineProperty(J7,"writeAll",{enumerable:!0,get:function(){return KK.writeAll}});"use strict";var Yy={};Object.defineProperty(Yy,"__esModule",{value:!0}),Yy.Bench=Yy.Metric=void 0,Yy.throughput=Yx,Yy.msgThroughput=function(e,t){return`${Math.floor(e/t)} msgs/sec`},Yy.humanizeBytes=Yw;var Yb={};Object.defineProperty(Yb,"__esModule",{value:!0}),Yb.Empty=void 0,Object.defineProperty(Yb,"Empty",{enumerable:!0,get:function(){return Kr.Empty}});class Y_{name;duration;date;payload;msgs;lang;version;bytes;asyncRequests;min;max;constructor(e,t){this.name=e,this.duration=t,this.date=Date.now(),this.payload=0,this.msgs=0,this.bytes=0}toString(){let e=this.duration/1e3,t=Math.round(this.msgs/e),n=this.asyncRequests?"asyncRequests":"",r="";return this.max&&(r=`${this.min}/${this.max}`),`${this.name}${n?" [asyncRequests]":""} ${t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")} msgs/sec - [${e.toFixed(2)} secs] ~ ${Yx(this.bytes,e)} ${r}`}toCsv(){return`"${this.name}",${new Date(this.date).toISOString()},${this.lang},${this.version},${this.msgs},${this.payload},${this.bytes},${this.duration},${!!this.asyncRequests&&this.asyncRequests}
1085
+ ${s}`),c(t);return}o(null,r),"count"===n.strategy&&0==--l&&c(),"stall"===n.strategy&&(f(),m=setTimeout(()=>{c()},300)),"sentinel"===n.strategy&&r&&0===r.data.length&&c()}});u.requestSubject=e,u.closed.then(()=>{a()}).catch(e=>{i.stop(e)});let c=e=>{e&&i.push(()=>{throw e}),f(),u.drain().then(()=>{a()}).catch(e=>{a()})};i.iterClosed.then(()=>{f(),u?.unsubscribe()}).catch(e=>{f(),u?.unsubscribe()});let{headers:d,traceDestination:h,traceOnly:p}=n;try{this.publish(e,t,{reply:u.getSubject(),headers:d,traceDestination:h,traceOnly:p})}catch(e){c(e)}let m=setTimeout(()=>{c()},n.maxWait),f=()=>{m&&clearTimeout(m)}}else{n.callback=o,i.iterClosed.then(()=>{r.cancel()}).catch(e=>{r.cancel(e)});let r=new Ym.RequestMany(this.protocol.muxSubscriptions,e,n);this.protocol.request(r);let{headers:a,traceDestination:s,traceOnly:l}=n;try{this.publish(e,t,{reply:`${this.protocol.muxSubscriptions.baseInbox}${r.token}`,headers:a,traceDestination:s,traceOnly:l})}catch(e){r.cancel(e)}}return Promise.resolve(i)}request(e,t,n={timeout:1e3,noMux:!1}){try{this._check(e,!0,!0)}catch(e){return Promise.reject(e)}let r=!this.protocol.options.noAsyncTraces;if(n.timeout=n.timeout||1e3,n.timeout<1)return Promise.reject(Ka.InvalidArgumentError.format("timeout","must be greater than 0"));if(!n.noMux&&n.reply)return Promise.reject(Ka.InvalidArgumentError.format(["reply","noMux"],"are mutually exclusive"));if(n.noMux){let i=n.reply?n.reply:(0,KT.createInbox)(this.options.inboxPrefix),a=(0,Kr.deferred)(),o=r?new Ka.errors.RequestError(""):null,s=this.subscribe(i,{max:1,timeout:n.timeout,callback:(t,n)=>{n&&n.data?.length===0&&n.headers?.code===503&&(t=new Ka.errors.NoRespondersError(e)),t?(t instanceof Ka.TimeoutError||(o?(o.message=t.message,o.cause=t,t=o):t=new Ka.errors.RequestError(t.message,{cause:t})),a.reject(t),s.unsubscribe()):a.resolve(n)}});return s.requestSubject=e,this.protocol.publish(e,t,{reply:i,headers:n.headers}),a}{let i=new Ym.RequestOne(this.protocol.muxSubscriptions,e,n,r);this.protocol.request(i);let{headers:a,traceDestination:o,traceOnly:s}=n;try{this.publish(e,t,{reply:`${this.protocol.muxSubscriptions.baseInbox}${i.token}`,headers:a,traceDestination:o,traceOnly:s})}catch(e){i.cancel(e)}let l=Promise.race([i.timer,i.deferred]);return l.catch(()=>{i.cancel()}),l}}flush(){return this.isClosed()?Promise.reject(new Ka.errors.ClosedConnectionError):this.protocol.flush()}drain(){return this.isClosed()?Promise.reject(new Ka.errors.ClosedConnectionError):this.isDraining()?Promise.reject(new Ka.errors.DrainingConnectionError):(this.draining=!0,this.protocol.drain())}async [Symbol.asyncDispose](){if(!this.isClosed()){if(this.isDraining())return void await this.closed();await this.drain()}}isClosed(){return this.protocol.isClosed()}isDraining(){return this.draining}getServer(){let e=this.protocol.getServer();return e?e.listen:""}setServers(e){this.protocol.servers.setServers(e)}getServers(){return this.protocol.servers.snapshot()}status(){let e=new KW.QueuedIteratorImpl;return e.iterClosed.then(()=>{let t=this.protocol.listeners.indexOf(e);t>-1&&this.protocol.listeners.splice(t,1)}),this.protocol.listeners.push(e),e}get info(){return this.protocol.isClosed()?void 0:this.protocol.info}async context(){return(await this.request("$SYS.REQ.USER.INFO")).json((e,t)=>"time"===e?new Date(Date.parse(t)):t)}stats(){return{inBytes:this.protocol.inBytes,outBytes:this.protocol.outBytes,inMsgs:this.protocol.inMsgs,outMsgs:this.protocol.outMsgs}}getServerVersion(){let e=this.info;return e?(0,K7.parseSemVer)(e.version):void 0}async rtt(){if(this.isClosed())throw new Ka.errors.ClosedConnectionError;if(!this.protocol.connected)throw new Ka.errors.RequestError("connection disconnected");let e=Date.now();return await this.flush(),Date.now()-e}get features(){return this.protocol.features}reconnect(){return this.isClosed()?Promise.reject(new Ka.errors.ClosedConnectionError):this.isDraining()?Promise.reject(new Ka.errors.DrainingConnectionError):this.protocol.reconnect()}addCloseListener(e){void 0===this.closeListeners&&(this.closeListeners=new Yy(this.closed())),this.closeListeners.add(e)}removeCloseListener(e){this.closeListeners&&this.closeListeners.remove(e)}}Kn.NatsConnectionImpl=Yv;class Yy{listeners;constructor(e){this.listeners=[],e.then(e=>{this.notify(e)})}add(e){this.listeners.push(e)}remove(e){this.listeners=this.listeners.filter(t=>t!==e)}notify(e){this.listeners.forEach(t=>{if("function"==typeof t.connectionClosedCallback)try{t.connectionClosedCallback(e)}catch(e){}}),this.listeners=[]}}"use strict";Object.defineProperty(J9,"NatsConnectionImpl",{enumerable:!0,get:function(){return Kn.NatsConnectionImpl}}),Object.defineProperty(J9,"Nuid",{enumerable:!0,get:function(){return KI.Nuid}}),Object.defineProperty(J9,"nuid",{enumerable:!0,get:function(){return KI.nuid}}),Object.defineProperty(J9,"MsgImpl",{enumerable:!0,get:function(){return K3.MsgImpl}}),Object.defineProperty(J9,"getResolveFn",{enumerable:!0,get:function(){return KA.getResolveFn}}),Object.defineProperty(J9,"setTransportFactory",{enumerable:!0,get:function(){return KA.setTransportFactory}}),Object.defineProperty(J9,"Connect",{enumerable:!0,get:function(){return KE.Connect}}),Object.defineProperty(J9,"INFO",{enumerable:!0,get:function(){return KE.INFO}}),Object.defineProperty(J9,"ProtocolHandler",{enumerable:!0,get:function(){return KE.ProtocolHandler}}),Object.defineProperty(J9,"backoff",{enumerable:!0,get:function(){return Kr.backoff}}),Object.defineProperty(J9,"collect",{enumerable:!0,get:function(){return Kr.collect}}),Object.defineProperty(J9,"deadline",{enumerable:!0,get:function(){return Kr.deadline}}),Object.defineProperty(J9,"deferred",{enumerable:!0,get:function(){return Kr.deferred}}),Object.defineProperty(J9,"delay",{enumerable:!0,get:function(){return Kr.delay}}),Object.defineProperty(J9,"extend",{enumerable:!0,get:function(){return Kr.extend}}),Object.defineProperty(J9,"millis",{enumerable:!0,get:function(){return Kr.millis}}),Object.defineProperty(J9,"nanos",{enumerable:!0,get:function(){return Kr.nanos}}),Object.defineProperty(J9,"render",{enumerable:!0,get:function(){return Kr.render}}),Object.defineProperty(J9,"SimpleMutex",{enumerable:!0,get:function(){return Kr.SimpleMutex}}),Object.defineProperty(J9,"timeout",{enumerable:!0,get:function(){return Kr.timeout}}),Object.defineProperty(J9,"canonicalMIMEHeaderKey",{enumerable:!0,get:function(){return K4.canonicalMIMEHeaderKey}}),Object.defineProperty(J9,"headers",{enumerable:!0,get:function(){return K4.headers}}),Object.defineProperty(J9,"MsgHdrsImpl",{enumerable:!0,get:function(){return K4.MsgHdrsImpl}}),Object.defineProperty(J9,"Heartbeat",{enumerable:!0,get:function(){return KJ.Heartbeat}}),Object.defineProperty(J9,"MuxSubscription",{enumerable:!0,get:function(){return K$.MuxSubscription}}),Object.defineProperty(J9,"DataBuffer",{enumerable:!0,get:function(){return KL.DataBuffer}}),Object.defineProperty(J9,"buildAuthenticator",{enumerable:!0,get:function(){return Yt.buildAuthenticator}}),Object.defineProperty(J9,"checkOptions",{enumerable:!0,get:function(){return Yt.checkOptions}}),Object.defineProperty(J9,"checkUnsupportedOption",{enumerable:!0,get:function(){return Yt.checkUnsupportedOption}}),Object.defineProperty(J9,"DEFAULT_MAX_RECONNECT_ATTEMPTS",{enumerable:!0,get:function(){return Yt.DEFAULT_MAX_RECONNECT_ATTEMPTS}}),Object.defineProperty(J9,"defaultOptions",{enumerable:!0,get:function(){return Yt.defaultOptions}}),Object.defineProperty(J9,"hasWsProtocol",{enumerable:!0,get:function(){return Yt.hasWsProtocol}}),Object.defineProperty(J9,"parseOptions",{enumerable:!0,get:function(){return Yt.parseOptions}}),Object.defineProperty(J9,"RequestOne",{enumerable:!0,get:function(){return Ym.RequestOne}}),Object.defineProperty(J9,"credsAuthenticator",{enumerable:!0,get:function(){return Yn.credsAuthenticator}}),Object.defineProperty(J9,"jwtAuthenticator",{enumerable:!0,get:function(){return Yn.jwtAuthenticator}}),Object.defineProperty(J9,"nkeyAuthenticator",{enumerable:!0,get:function(){return Yn.nkeyAuthenticator}}),Object.defineProperty(J9,"tokenAuthenticator",{enumerable:!0,get:function(){return Yn.tokenAuthenticator}}),Object.defineProperty(J9,"usernamePasswordAuthenticator",{enumerable:!0,get:function(){return Yn.usernamePasswordAuthenticator}}),Kt(ec("k53No"),J9),Object.defineProperty(J9,"QueuedIteratorImpl",{enumerable:!0,get:function(){return KW.QueuedIteratorImpl}}),Object.defineProperty(J9,"describe",{enumerable:!0,get:function(){return KK.describe}}),Object.defineProperty(J9,"Kind",{enumerable:!0,get:function(){return KK.Kind}}),Object.defineProperty(J9,"Parser",{enumerable:!0,get:function(){return KK.Parser}}),Object.defineProperty(J9,"State",{enumerable:!0,get:function(){return KK.State}}),Object.defineProperty(J9,"DenoBuffer",{enumerable:!0,get:function(){return KY.DenoBuffer}}),Object.defineProperty(J9,"MAX_SIZE",{enumerable:!0,get:function(){return KY.MAX_SIZE}}),Object.defineProperty(J9,"readAll",{enumerable:!0,get:function(){return KY.readAll}}),Object.defineProperty(J9,"writeAll",{enumerable:!0,get:function(){return KY.writeAll}});"use strict";var Yb={};Object.defineProperty(Yb,"__esModule",{value:!0}),Yb.Bench=Yb.Metric=void 0,Yb.throughput=Yw,Yb.msgThroughput=function(e,t){return`${Math.floor(e/t)} msgs/sec`},Yb.humanizeBytes=YS;var Y_={};Object.defineProperty(Y_,"__esModule",{value:!0}),Y_.Empty=void 0,Object.defineProperty(Y_,"Empty",{enumerable:!0,get:function(){return Ki.Empty}});class Yx{name;duration;date;payload;msgs;lang;version;bytes;asyncRequests;min;max;constructor(e,t){this.name=e,this.duration=t,this.date=Date.now(),this.payload=0,this.msgs=0,this.bytes=0}toString(){let e=this.duration/1e3,t=Math.round(this.msgs/e),n=this.asyncRequests?"asyncRequests":"",r="";return this.max&&(r=`${this.min}/${this.max}`),`${this.name}${n?" [asyncRequests]":""} ${t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")} msgs/sec - [${e.toFixed(2)} secs] ~ ${Yw(this.bytes,e)} ${r}`}toCsv(){return`"${this.name}",${new Date(this.date).toISOString()},${this.lang},${this.version},${this.msgs},${this.payload},${this.bytes},${this.duration},${!!this.asyncRequests&&this.asyncRequests}
1086
1086
  `}static header(){return`Test,Date,Lang,Version,Count,MsgPayload,Bytes,Millis,Async
1087
- `}}function Yx(e,t){return`${Yw(e/t)}/sec`}function Yw(e,t=!1){let n=t?1e3:1024,r=t?"iB":"B";if(e<n)return`${e.toFixed(2)} ${r}`;let i=parseInt(Math.log(e)/Math.log(n)+""),a=parseInt(i-1+"");return`${(e/Math.pow(n,i)).toFixed(2)} ${(t?["k","M","G","T","P","E"]:["K","M","G","T","P","E"])[a]}${r}`}"use strict";Yy.Metric=Y_,Yy.Bench=class{nc;callbacks;msgs;size;subject;asyncRequests;pub;sub;req;rep;perf;payload;constructor(e,t={msgs:1e5,size:128,subject:"",asyncRequests:!1,pub:!1,sub:!1,req:!1,rep:!1}){if(this.nc=e,this.callbacks=t.callbacks||!1,this.msgs=t.msgs||0,this.size=t.size||0,this.subject=t.subject||KT.nuid.next(),this.asyncRequests=t.asyncRequests||!1,this.pub=t.pub||!1,this.sub=t.sub||!1,this.req=t.req||!1,this.rep=t.rep||!1,this.perf=new Kn.Perf,this.payload=this.size?new Uint8Array(this.size):Yb.Empty,!this.pub&&!this.sub&&!this.req&&!this.rep)throw Error("no options selected")}async run(){return this.nc.closed().then(e=>{if(e)throw e}),this.callbacks?await this.runCallbacks():await this.runAsync(),this.processMetrics()}processMetrics(){let{lang:e,version:t}=this.nc.protocol.transport;this.pub&&this.sub&&this.perf.measure("pubsub","pubStart","subStop"),this.req&&this.rep&&this.perf.measure("reqrep","reqStart","reqStop");let n=this.perf.getEntries(),r=n.find(e=>"pubsub"===e.name),i=n.find(e=>"reqrep"===e.name),a=n.find(e=>"req"===e.name),o=n.find(e=>"rep"===e.name),s=n.find(e=>"pub"===e.name),l=n.find(e=>"sub"===e.name),u=this.nc.stats(),c=[];if(r){let{name:n,duration:i}=r,a=new Y_(n,i);a.msgs=2*this.msgs,a.bytes=u.inBytes+u.outBytes,a.lang=e,a.version=t,a.payload=this.payload.length,c.push(a)}if(i){let{name:n,duration:r}=i,a=new Y_(n,r);a.msgs=2*this.msgs,a.bytes=u.inBytes+u.outBytes,a.lang=e,a.version=t,a.payload=this.payload.length,c.push(a)}if(s){let{name:n,duration:r}=s,i=new Y_(n,r);i.msgs=this.msgs,i.bytes=u.outBytes,i.lang=e,i.version=t,i.payload=this.payload.length,c.push(i)}if(l){let{name:n,duration:r}=l,i=new Y_(n,r);i.msgs=this.msgs,i.bytes=u.inBytes,i.lang=e,i.version=t,i.payload=this.payload.length,c.push(i)}if(o){let{name:n,duration:r}=o,i=new Y_(n,r);i.msgs=this.msgs,i.bytes=u.inBytes+u.outBytes,i.lang=e,i.version=t,i.payload=this.payload.length,c.push(i)}if(a){let{name:n,duration:r}=a,i=new Y_(n,r);i.msgs=this.msgs,i.bytes=u.inBytes+u.outBytes,i.lang=e,i.version=t,i.payload=this.payload.length,c.push(i)}return c}async runCallbacks(){let e=[];if(this.sub){let t=(0,Kn.deferred)();e.push(t);let n=0;this.nc.subscribe(this.subject,{max:this.msgs,callback:()=>{1==++n&&this.perf.mark("subStart"),n===this.msgs&&(this.perf.mark("subStop"),this.perf.measure("sub","subStart","subStop"),t.resolve())}})}if(this.rep){let t=(0,Kn.deferred)();e.push(t);let n=0;this.nc.subscribe(this.subject,{max:this.msgs,callback:(e,r)=>{r.respond(this.payload),1==++n&&this.perf.mark("repStart"),n===this.msgs&&(this.perf.mark("repStop"),this.perf.measure("rep","repStart","repStop"),t.resolve())}})}if(this.pub){let t=(async()=>{this.perf.mark("pubStart");for(let e=0;e<this.msgs;e++)this.nc.publish(this.subject,this.payload);await this.nc.flush(),this.perf.mark("pubStop"),this.perf.measure("pub","pubStart","pubStop")})();e.push(t)}if(this.req){let t=(async()=>{if(this.asyncRequests){this.perf.mark("reqStart");let e=[];for(let t=0;t<this.msgs;t++)e.push(this.nc.request(this.subject,this.payload,{timeout:2e4}));await Promise.all(e),this.perf.mark("reqStop"),this.perf.measure("req","reqStart","reqStop")}else{this.perf.mark("reqStart");for(let e=0;e<this.msgs;e++)await this.nc.request(this.subject);this.perf.mark("reqStop"),this.perf.measure("req","reqStart","reqStop")}})();e.push(t)}await Promise.all(e)}async runAsync(){let e=[];if(this.rep){let t=!1,n=this.nc.subscribe(this.subject,{max:this.msgs}),r=(async()=>{for await(let e of n)t||(this.perf.mark("repStart"),t=!0),e.respond(this.payload);await this.nc.flush(),this.perf.mark("repStop"),this.perf.measure("rep","repStart","repStop")})();e.push(r)}if(this.sub){let t=!1,n=this.nc.subscribe(this.subject,{max:this.msgs}),r=(async()=>{for await(let e of n)t||(this.perf.mark("subStart"),t=!0);this.perf.mark("subStop"),this.perf.measure("sub","subStart","subStop")})();e.push(r)}if(this.pub){let t=(async()=>{this.perf.mark("pubStart");for(let e=0;e<this.msgs;e++)this.nc.publish(this.subject,this.payload);await this.nc.flush(),this.perf.mark("pubStop"),this.perf.measure("pub","pubStart","pubStop")})();e.push(t)}if(this.req){let t=(async()=>{if(this.asyncRequests){this.perf.mark("reqStart");let e=[];for(let t=0;t<this.msgs;t++)e.push(this.nc.request(this.subject,this.payload,{timeout:2e4}));await Promise.all(e),this.perf.mark("reqStop"),this.perf.measure("req","reqStart","reqStop")}else{this.perf.mark("reqStart");for(let e=0;e<this.msgs;e++)await this.nc.request(this.subject);this.perf.mark("reqStop"),this.perf.measure("req","reqStart","reqStop")}})();e.push(t)}await Promise.all(e)}},Object.defineProperty(J7,"Bench",{enumerable:!0,get:function(){return Yy.Bench}}),Object.defineProperty(J7,"Metric",{enumerable:!0,get:function(){return Yy.Metric}}),Object.defineProperty(J7,"TD",{enumerable:!0,get:function(){return Kr.TD}}),Object.defineProperty(J7,"TE",{enumerable:!0,get:function(){return Kr.TE}}),Object.defineProperty(J7,"ipV4",{enumerable:!0,get:function(){return KB.ipV4}}),Object.defineProperty(J7,"isIP",{enumerable:!0,get:function(){return KB.isIP}}),Object.defineProperty(J7,"parseIP",{enumerable:!0,get:function(){return KB.parseIP}}),Object.defineProperty(J7,"compare",{enumerable:!0,get:function(){return K8.compare}}),Object.defineProperty(J7,"Feature",{enumerable:!0,get:function(){return K8.Feature}}),Object.defineProperty(J7,"Features",{enumerable:!0,get:function(){return K8.Features}}),Object.defineProperty(J7,"parseSemVer",{enumerable:!0,get:function(){return K8.parseSemVer}}),Object.defineProperty(J7,"Empty",{enumerable:!0,get:function(){return Yb.Empty}}),Object.defineProperty(J7,"extractProtocolMessage",{enumerable:!0,get:function(){return KE.extractProtocolMessage}}),Object.defineProperty(J7,"protoLen",{enumerable:!0,get:function(){return KE.protoLen}}),Object.defineProperty(J7,"createInbox",{enumerable:!0,get:function(){return KA.createInbox}}),Object.defineProperty(J7,"Match",{enumerable:!0,get:function(){return KA.Match}}),Object.defineProperty(J7,"syncIterator",{enumerable:!0,get:function(){return KA.syncIterator}}),Object.defineProperty(J7,"SubscriptionImpl",{enumerable:!0,get:function(){return KS.SubscriptionImpl}}),Object.defineProperty(J7,"Subscriptions",{enumerable:!0,get:function(){return KS.Subscriptions}});"use strict";var YS={};Object.defineProperty(YS,"__esModule",{value:!0}),YS.IdleHeartbeatMonitor=void 0,YS.IdleHeartbeatMonitor=class{interval;maxOut;cancelAfter;timer;autoCancelTimer;last;missed;count;callback;constructor(e,t,n={maxOut:2}){this.interval=e,this.maxOut=n?.maxOut||2,this.cancelAfter=n?.cancelAfter||0,this.last=Date.now(),this.missed=0,this.count=0,this.callback=t,this._schedule()}cancel(){this.autoCancelTimer&&clearTimeout(this.autoCancelTimer),this.timer&&clearInterval(this.timer),this.timer=0,this.autoCancelTimer=0,this.missed=0}work(){this.last=Date.now(),this.missed=0}_change(e,t=0,n=2){this.interval=e,this.maxOut=n,this.cancelAfter=t,this.restart()}restart(){this.cancel(),this._schedule()}_schedule(){this.cancelAfter>0&&(this.autoCancelTimer=setTimeout(()=>{this.cancel()},this.cancelAfter)),this.timer=setInterval(()=>{if(this.count++,Date.now()-this.last>this.interval&&this.missed++,this.missed>=this.maxOut)try{!0===this.callback(this.missed)&&this.cancel()}catch(e){console.log(e)}},this.interval)}},Object.defineProperty(J7,"IdleHeartbeatMonitor",{enumerable:!0,get:function(){return YS.IdleHeartbeatMonitor}}),Object.defineProperty(J7,"isIPV4OrHostname",{enumerable:!0,get:function(){return KD.isIPV4OrHostname}}),Object.defineProperty(J7,"Servers",{enumerable:!0,get:function(){return KD.Servers}});"use strict";var YE={};Object.defineProperty(YE,"__esModule",{value:!0}),YE.WsTransport=void 0,YE.wsUrlParseFn=YC,YE.wsconnect=function(e={}){return(0,KE.setTransportFactory)({defaultPort:443,urlParseFn:YC,factory:()=>{if(e.tls)throw Ki.InvalidArgumentError.format("tls","is not configurable on w3c websocket connections");return new YI}}),Kt.NatsConnectionImpl.connect(e)};var YA={};Object.defineProperty(YA,"__esModule",{value:!0}),YA.version=void 0,YA.version="3.4.0";let YT=YA.version;class YI{version;lang;closeError;connected;done;socket;options;socketClosed;encrypted;peeked;yields;signal;closedNotification;constructor(){this.version=YT,this.lang="nats.ws",this.connected=!1,this.done=!1,this.socketClosed=!1,this.encrypted=!1,this.peeked=!1,this.yields=[],this.signal=(0,Kn.deferred)(),this.closedNotification=(0,Kn.deferred)()}async connect(e,t){let n=(0,Kn.deferred)();this.options=t;let r=e.src;if(t.wsFactory){let{socket:n,encrypted:r}=await t.wsFactory(e.src,t);this.socket=n,this.encrypted=r}else this.encrypted=0===r.indexOf("wss://"),this.socket=new WebSocket(r);return this.socket.binaryType="arraybuffer",this.socket.onopen=()=>{this.done&&this._closed(Error("aborted"))},this.socket.onmessage=e=>{if(this.done)return;if(this.yields.push(new Uint8Array(e.data)),this.peeked)return void this.signal.resolve();let r=Kk.DataBuffer.concat(...this.yields),i=(0,KE.extractProtocolMessage)(r);if(""!==i){let e=KS.INFO.exec(i);if(!e){t.debug&&console.error("!!!",(0,Kn.render)(r)),n.reject(Error("unexpected response from server"));return}try{let t=JSON.parse(e[1]);(0,Ye.checkOptions)(t,this.options),this.peeked=!0,this.connected=!0,this.signal.resolve(),n.resolve()}catch(e){n.reject(e);return}}},this.socket.onclose=e=>{let t;e.wasClean||""===e.reason||(t=Error(e.reason)),this._closed(t),this._cleanup()},this.socket.onerror=e=>{if(this.done)return;let t=new Ki.errors.ConnectionError(e.message);n.reject(t),this._cleanup()},n}_cleanup(){!1===this.socketClosed&&(this.socketClosed=!0,this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,this.closedNotification.resolve(this.closeError))}disconnect(){this._closed(void 0,!0)}async _closed(e,t=!0){if(this.done){try{this.socket.close()}catch(e){}return}if(this.closeError=e,!e)for(;!this.socketClosed&&this.socket.bufferedAmount>0;)await (0,Kn.delay)(100);this.done=!0;try{this.socket.close()}catch(e){}return this.closedNotification}get isClosed(){return this.done}[Symbol.asyncIterator](){return this.iterate()}async *iterate(){for(;;){if(this.done)return;0===this.yields.length&&await this.signal;let e=this.yields;this.yields=[];for(let t=0;t<e.length;t++)this.options.debug&&console.info(`> ${(0,Kn.render)(e[t])}`),yield e[t];if(this.done)break;0===this.yields.length&&(e.length=0,this.yields=e,this.signal=(0,Kn.deferred)())}}isEncrypted(){return this.connected&&this.encrypted}send(e){if(!this.done)try{this.socket.send(e.buffer),this.options.debug&&console.info(`< ${(0,Kn.render)(e)}`);return}catch(t){this.options.debug&&console.error(`!!! ${(0,Kn.render)(e)}: ${t}`)}}close(e){return this._closed(e,!1)}closed(){return this.closedNotification}discard(){this.socket?.close()}}function YC(e,t){let n,r;/^(.*:\/\/)(.*)/.test(e)||(e="boolean"==typeof t?`${!0===t?"https":"http"}://${e}`:`https://${e}`);let i=new URL(e),a=i.protocol.toLowerCase();"ws:"===a&&(t=!1),"wss:"===a&&(t=!0),"https:"!==a&&"http"!==a&&(e=e.replace(/^(.*:\/\/)(.*)/gm,"$2"),i=new URL(`http://${e}`));let o=i.hostname,s=i.pathname,l=i.search||"";switch(a){case"http:":case"ws:":case"nats:":r=i.port||"80",n="ws:";break;case"https:":case"wss:":case"tls:":r=i.port||"443",n="wss:";break;default:r=i.port||!0===t?"443":"80",n=!0===t?"wss:":"ws:"}return`${n}//${o}:${r}${s}${l}`}"use strict";YE.WsTransport=YI,Object.defineProperty(J7,"wsconnect",{enumerable:!0,get:function(){return YE.wsconnect}}),Object.defineProperty(J7,"wsUrlParseFn",{enumerable:!0,get:function(){return YE.wsUrlParseFn}}),Object.defineProperty(J7,"AuthorizationError",{enumerable:!0,get:function(){return Ki.AuthorizationError}}),Object.defineProperty(J7,"ClosedConnectionError",{enumerable:!0,get:function(){return Ki.ClosedConnectionError}}),Object.defineProperty(J7,"ConnectionError",{enumerable:!0,get:function(){return Ki.ConnectionError}}),Object.defineProperty(J7,"DrainingConnectionError",{enumerable:!0,get:function(){return Ki.DrainingConnectionError}}),Object.defineProperty(J7,"errors",{enumerable:!0,get:function(){return Ki.errors}}),Object.defineProperty(J7,"InvalidArgumentError",{enumerable:!0,get:function(){return Ki.InvalidArgumentError}}),Object.defineProperty(J7,"InvalidOperationError",{enumerable:!0,get:function(){return Ki.InvalidOperationError}}),Object.defineProperty(J7,"InvalidSubjectError",{enumerable:!0,get:function(){return Ki.InvalidSubjectError}}),Object.defineProperty(J7,"NoRespondersError",{enumerable:!0,get:function(){return Ki.NoRespondersError}}),Object.defineProperty(J7,"PermissionViolationError",{enumerable:!0,get:function(){return Ki.PermissionViolationError}}),Object.defineProperty(J7,"ProtocolError",{enumerable:!0,get:function(){return Ki.ProtocolError}}),Object.defineProperty(J7,"RequestError",{enumerable:!0,get:function(){return Ki.RequestError}}),Object.defineProperty(J7,"TimeoutError",{enumerable:!0,get:function(){return Ki.TimeoutError}}),Object.defineProperty(J7,"UserAuthenticationExpiredError",{enumerable:!0,get:function(){return Ki.UserAuthenticationExpiredError}}),Object.defineProperty(J8,"AuthorizationError",{enumerable:!0,get:function(){return J7.AuthorizationError}}),Object.defineProperty(J8,"backoff",{enumerable:!0,get:function(){return J7.backoff}}),Object.defineProperty(J8,"Bench",{enumerable:!0,get:function(){return J7.Bench}}),Object.defineProperty(J8,"buildAuthenticator",{enumerable:!0,get:function(){return J7.buildAuthenticator}}),Object.defineProperty(J8,"canonicalMIMEHeaderKey",{enumerable:!0,get:function(){return J7.canonicalMIMEHeaderKey}}),Object.defineProperty(J8,"ClosedConnectionError",{enumerable:!0,get:function(){return J7.ClosedConnectionError}}),Object.defineProperty(J8,"ConnectionError",{enumerable:!0,get:function(){return J7.ConnectionError}}),Object.defineProperty(J8,"createInbox",{enumerable:!0,get:function(){return J7.createInbox}}),Object.defineProperty(J8,"credsAuthenticator",{enumerable:!0,get:function(){return J7.credsAuthenticator}}),Object.defineProperty(J8,"deadline",{enumerable:!0,get:function(){return J7.deadline}}),Object.defineProperty(J8,"deferred",{enumerable:!0,get:function(){return J7.deferred}}),Object.defineProperty(J8,"delay",{enumerable:!0,get:function(){return J7.delay}}),Object.defineProperty(J8,"DrainingConnectionError",{enumerable:!0,get:function(){return J7.DrainingConnectionError}}),Object.defineProperty(J8,"Empty",{enumerable:!0,get:function(){return J7.Empty}}),Object.defineProperty(J8,"errors",{enumerable:!0,get:function(){return J7.errors}}),Object.defineProperty(J8,"hasWsProtocol",{enumerable:!0,get:function(){return J7.hasWsProtocol}}),Object.defineProperty(J8,"headers",{enumerable:!0,get:function(){return J7.headers}}),Object.defineProperty(J8,"InvalidArgumentError",{enumerable:!0,get:function(){return J7.InvalidArgumentError}}),Object.defineProperty(J8,"InvalidOperationError",{enumerable:!0,get:function(){return J7.InvalidOperationError}}),Object.defineProperty(J8,"InvalidSubjectError",{enumerable:!0,get:function(){return J7.InvalidSubjectError}}),Object.defineProperty(J8,"jwtAuthenticator",{enumerable:!0,get:function(){return J7.jwtAuthenticator}}),Object.defineProperty(J8,"Match",{enumerable:!0,get:function(){return J7.Match}}),Object.defineProperty(J8,"Metric",{enumerable:!0,get:function(){return J7.Metric}}),Object.defineProperty(J8,"millis",{enumerable:!0,get:function(){return J7.millis}}),Object.defineProperty(J8,"MsgHdrsImpl",{enumerable:!0,get:function(){return J7.MsgHdrsImpl}}),Object.defineProperty(J8,"nanos",{enumerable:!0,get:function(){return J7.nanos}}),Object.defineProperty(J8,"nkeyAuthenticator",{enumerable:!0,get:function(){return J7.nkeyAuthenticator}}),Object.defineProperty(J8,"nkeys",{enumerable:!0,get:function(){return J7.nkeys}}),Object.defineProperty(J8,"NoRespondersError",{enumerable:!0,get:function(){return J7.NoRespondersError}}),Object.defineProperty(J8,"Nuid",{enumerable:!0,get:function(){return J7.Nuid}}),Object.defineProperty(J8,"nuid",{enumerable:!0,get:function(){return J7.nuid}}),Object.defineProperty(J8,"PermissionViolationError",{enumerable:!0,get:function(){return J7.PermissionViolationError}}),Object.defineProperty(J8,"ProtocolError",{enumerable:!0,get:function(){return J7.ProtocolError}}),Object.defineProperty(J8,"RequestError",{enumerable:!0,get:function(){return J7.RequestError}}),Object.defineProperty(J8,"syncIterator",{enumerable:!0,get:function(){return J7.syncIterator}}),Object.defineProperty(J8,"TimeoutError",{enumerable:!0,get:function(){return J7.TimeoutError}}),Object.defineProperty(J8,"tokenAuthenticator",{enumerable:!0,get:function(){return J7.tokenAuthenticator}}),Object.defineProperty(J8,"UserAuthenticationExpiredError",{enumerable:!0,get:function(){return J7.UserAuthenticationExpiredError}}),Object.defineProperty(J8,"usernamePasswordAuthenticator",{enumerable:!0,get:function(){return J7.usernamePasswordAuthenticator}}),Object.defineProperty(J8,"wsconnect",{enumerable:!0,get:function(){return J7.wsconnect}});"use strict";var YM={};Object.defineProperty(YM,"__esModule",{value:!0}),YM.StoreCompression=YM.StorageType=YM.RetentionPolicy=YM.RepublishHeaders=YM.ReplayPolicy=YM.PubHeaders=YM.PersistMode=YM.JsHeaders=YM.JetStreamError=YM.JetStreamApiError=YM.JetStreamApiCodes=YM.isPushConsumer=YM.isPullConsumer=YM.DiscardPolicy=YM.DirectMsgHeaders=YM.DeliverPolicy=YM.AdvisoryKind=YM.AckPolicy=YM.jetstreamManager=YM.jetstream=void 0;"use strict";var YN={};Object.defineProperty(YN,"__esModule",{value:!0}),YN.validateStreamName=YN.jserrors=YN.JetStreamStatusError=YN.JetStreamStatus=YN.JetStreamError=YN.JetStreamApiError=YN.JetStreamApiCodes=YN.isMessageNotFound=YN.ListerImpl=YN.StoreCompression=YN.StorageType=YN.RetentionPolicy=YN.ReplayPolicy=YN.PubHeaders=YN.PersistMode=YN.DiscardPolicy=YN.DeliverPolicy=YN.AckPolicy=YN.DirectMsgImpl=YN.BaseApiClientImpl=YN.toJetStreamClient=YN.startFastIngest=YN.jetstreamManager=YN.JetStreamClientImpl=YN.jetstream=YN.RepublishHeaders=YN.JsHeaders=YN.isPushConsumer=YN.isPullConsumer=YN.isOrderedPushConsumerOptions=YN.isBoundPushConsumerOptions=YN.DirectMsgHeaders=YN.AdvisoryKind=void 0;"use strict";var YR={};Object.defineProperty(YR,"__esModule",{value:!0}),YR.RepublishHeaders=YR.DirectMsgHeaders=YR.JsHeaders=YR.AdvisoryKind=void 0,YR.isOrderedPushConsumerOptions=function(e){return!!e&&"object"==typeof e&&("name_prefix"in e||"deliver_subject_prefix"in e||"filter_subjects"in e||"filter_subject"in e||"deliver_policy"in e||"opt_start_seq"in e||"opt_start_time"in e||"replay_policy"in e||"inactive_threshold"in e||"headers_only"in e||"deliver_prefix"in e)},YR.isPullConsumer=function(e){return e.isPullConsumer()},YR.isPushConsumer=function(e){return e.isPushConsumer()},YR.isBoundPushConsumerOptions=function(e){return!!e&&"object"==typeof e&&("deliver_subject"in e||"deliver_group"in e||"idle_heartbeat"in e)},YR.AdvisoryKind={API:"api_audit",StreamAction:"stream_action",ConsumerAction:"consumer_action",SnapshotCreate:"snapshot_create",SnapshotComplete:"snapshot_complete",RestoreCreate:"restore_create",RestoreComplete:"restore_complete",MaxDeliver:"max_deliver",Terminated:"terminated",Ack:"consumer_ack",StreamLeaderElected:"stream_leader_elected",StreamQuorumLost:"stream_quorum_lost",ConsumerLeaderElected:"consumer_leader_elected",ConsumerQuorumLost:"consumer_quorum_lost"},YR.JsHeaders={StreamSourceHdr:"Nats-Stream-Source",LastConsumerSeqHdr:"Nats-Last-Consumer",LastStreamSeqHdr:"Nats-Last-Stream",ConsumerStalledHdr:"Nats-Consumer-Stalled",MessageSizeHdr:"Nats-Msg-Size",RollupHdr:"Nats-Rollup",RollupValueSubject:"sub",RollupValueAll:"all",PendingMessagesHdr:"Nats-Pending-Messages",PendingBytesHdr:"Nats-Pending-Bytes",RequiredApiLevel:"Nats-Required-Api-Level"},YR.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"},YR.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"},Object.defineProperty(YN,"AdvisoryKind",{enumerable:!0,get:function(){return YR.AdvisoryKind}}),Object.defineProperty(YN,"DirectMsgHeaders",{enumerable:!0,get:function(){return YR.DirectMsgHeaders}}),Object.defineProperty(YN,"isBoundPushConsumerOptions",{enumerable:!0,get:function(){return YR.isBoundPushConsumerOptions}}),Object.defineProperty(YN,"isOrderedPushConsumerOptions",{enumerable:!0,get:function(){return YR.isOrderedPushConsumerOptions}}),Object.defineProperty(YN,"isPullConsumer",{enumerable:!0,get:function(){return YR.isPullConsumer}}),Object.defineProperty(YN,"isPushConsumer",{enumerable:!0,get:function(){return YR.isPushConsumer}}),Object.defineProperty(YN,"JsHeaders",{enumerable:!0,get:function(){return YR.JsHeaders}}),Object.defineProperty(YN,"RepublishHeaders",{enumerable:!0,get:function(){return YR.RepublishHeaders}});"use strict";var YO={};Object.defineProperty(YO,"__esModule",{value:!0}),YO.BatchPublisherImpl=YO.JetStreamClientImpl=YO.JetStreamManagerImpl=void 0,YO.startFastIngest=function(e,t,n,r,i=5e3){let{ackInterval:a,allowGaps:o,inboxPrefix:s,maxOutstandingAcks:l,...u}=r,c=s??"_INBOX";if(!c||/\s/.test(c)||/[*>]/.test(c))return Promise.reject(Error(`inboxPrefix must be non-empty, no wildcards or whitespace (got "${c}")`));let d=new Xw(e,{ackInterval:a??10,allowGaps:o,inboxPrefix:c,maxOutstandingAcks:Math.min(3,Math.max(1,l??2))},t,i);return d.start(n,u).then(()=>d)},YO.toJetStreamClient=function(e){return void 0===e.nc?Xf(e):e},YO.jetstream=Xf,YO.jetstreamManager=Xg,YO.scheduleSpecToHeader=Xy;"use strict";var YP={};Object.defineProperty(YP,"__esModule",{value:!0}),YP.BaseApiClientImpl=void 0,YP.parseJsResponse=YH,YP.defaultJsOptions=YG;var Yk={};Object.defineProperty(Yk,"__esModule",{value:!0}),Yk.jserrors=Yk.StreamNotFoundError=Yk.ConsumerNotFoundError=Yk.JetStreamApiError=Yk.InvalidNameError=Yk.JetStreamApiCodes=Yk.JetStreamStatus=Yk.JetStreamStatusError=Yk.JetStreamError=Yk.JetStreamNotEnabled=void 0,Yk.isMessageNotFound=function(e){return e instanceof YU&&e.code===Yk.JetStreamApiCodes.NoMessageFound};class YL extends Error{constructor(e,t){super(e,t),this.name="JetStreamNotEnabled"}}Yk.JetStreamNotEnabled=YL;class YD extends Error{constructor(e,t){super(e,t),this.name="JetStreamError"}}Yk.JetStreamError=YD;class YB extends YD{code;constructor(e,t,n){super(e,n),this.code=t,this.name="JetStreamStatusError"}}Yk.JetStreamStatusError=YB,Yk.JetStreamStatus=class e{msg;_description;constructor(e){this.msg=e,this._description=""}static maybeParseStatus(t){let n=new e(t);return 0===n.code?null:n}toError(){return new YB(this.description,this.code)}debug(){console.log({subject:this.msg.subject,reply:this.msg.reply,description:this.description,status:this.code,headers:this.msg.headers})}get code(){return this.msg.headers?.code||0}get description(){return""===this._description&&(this._description=this.msg.headers?.description?.toLowerCase()||"",""===this._description&&(this._description=503===this.code?"no responders":"unknown")),this._description}isIdleHeartbeat(){return 100===this.code&&"idle heartbeat"===this.description}isFlowControlRequest(){return 100===this.code&&"flowcontrol request"===this.description}parseHeartbeat(){return this.isIdleHeartbeat()?{type:"heartbeat",lastConsumerSequence:parseInt(this.msg.headers?.get("Nats-Last-Consumer")||"0"),lastStreamSequence:parseInt(this.msg.headers?.get("Nats-Last-Stream")||"0")}:null}isRequestTimeout(){return 408===this.code&&"request timeout"===this.description}parseDiscard(){let e={msgsLeft:0,bytesLeft:0},t=this.msg.headers?.get(YR.JsHeaders.PendingMessagesHdr);t&&(e.msgsLeft=parseInt(t));let n=this.msg.headers?.get(YR.JsHeaders.PendingBytesHdr);return n&&(e.bytesLeft=parseInt(n)),e}isBadRequest(){return 400===this.code}isConsumerDeleted(){return 409===this.code&&"consumer deleted"===this.description}isStreamDeleted(){return 409===this.code&&"stream deleted"===this.description}isIdleHeartbeatMissed(){return 409===this.code&&"idle heartbeats missed"===this.description}isMaxWaitingExceeded(){return 409===this.code&&"exceeded maxwaiting"===this.description}isConsumerIsPushBased(){return 409===this.code&&"consumer is push based"===this.description}isExceededMaxWaiting(){return 409===this.code&&this.description.includes("exceeded maxwaiting")}isExceededMaxRequestBatch(){return 409===this.code&&this.description.includes("exceeded maxrequestbatch")}isExceededMaxExpires(){return 409===this.code&&this.description.includes("exceeded maxrequestexpires")}isExceededLimit(){return this.isExceededMaxExpires()||this.isExceededMaxWaiting()||this.isExceededMaxRequestBatch()||this.isMessageSizeExceedsMaxBytes()}isMessageNotFound(){return 404===this.code&&"message not found"===this.description}isNoResults(){return 404===this.code&&"no results"===this.description}isMessageSizeExceedsMaxBytes(){return 409===this.code&&"message size exceeds maxbytes"===this.description}isEndOfBatch(){return 204===this.code&&"eob"===this.description}},Yk.JetStreamApiCodes={ConsumerNotFound:10014,StreamNotFound:10059,JetStreamNotEnabledForAccount:10039,StreamWrongLastSequence:10071,StreamWrongLastSequenceUnknown:10164,NoMessageFound:10037};class YF extends Error{constructor(e="",t){super(e,t),this.name="InvalidNameError"}}Yk.InvalidNameError=YF;class YU extends Error{#e;constructor(e,t){super(e.description,t),this.#e=e,this.name="JetStreamApiError"}get code(){return this.#e.err_code}get status(){return this.#e.code}apiError(){return Object.assign({},this.#e)}}Yk.JetStreamApiError=YU;class Yj extends YU{constructor(e,t){super(e,t),this.name="ConsumerNotFoundError"}}Yk.ConsumerNotFoundError=Yj;class Yz extends YU{constructor(e,t){super(e,t),this.name="StreamNotFoundError"}static fromMessage(e){return new Yz({err_code:Yk.JetStreamApiCodes.StreamNotFound,description:e,code:404})}}function YH(e){let t=JSON.parse(new TextDecoder().decode(e.data));if(t.error)switch(t.error.err_code){case Yk.JetStreamApiCodes.ConsumerNotFound:throw new Yk.ConsumerNotFoundError(t.error);case Yk.JetStreamApiCodes.StreamNotFound:throw new Yk.StreamNotFoundError(t.error);case Yk.JetStreamApiCodes.JetStreamNotEnabledForAccount:{let e=new Yk.JetStreamApiError(t.error);throw new Yk.JetStreamNotEnabled(e.message,{cause:e})}default:throw new Yk.JetStreamApiError(t.error)}return t}function YG(e){return(e=e||{}).domain&&(e.apiPrefix=`$JS.${e.domain}.API`,delete e.domain),(0,J7.extend)({apiPrefix:"$JS.API",timeout:5e3},e)}"use strict";Yk.StreamNotFoundError=Yz,Yk.jserrors={InvalidNameError:YF,ConsumerNotFoundError:Yj,StreamNotFoundError:Yz,JetStreamError:YD,JetStreamApiError:YU,JetStreamNotEnabled:YL},YP.BaseApiClientImpl=class{nc;opts;prefix;timeout;constructor(e,t){this.nc=e,(t=t||{}).watcherPrefix=t.watcherPrefix||this.nc.options.inboxPrefix,this.opts=YG(t),this._parseOpts(),this.prefix=this.opts.apiPrefix,this.timeout=this.opts.timeout}getOptions(){return Object.assign({},this.opts)}sendRequiredApiLevel(){return!0===this.opts.sendRequiredApiLevel}_parseOpts(){let e=this.opts.apiPrefix;if(!e||0===e.length)throw J7.errors.InvalidArgumentError.format("prefix","cannot be empty");"."===e[e.length-1]&&(e=e.substr(0,e.length-1)),this.opts.apiPrefix=e,(0,J7.createInbox)(this.opts.watcherPrefix)}async _request(e,t=null,n){let{retries:r,minApiVersion:i,...a}=n??{},o={...a,timeout:this.timeout},s=J7.Empty;if(t&&(s=new TextEncoder().encode(JSON.stringify(t))),"number"==typeof i){let e=o.headers??(0,J7.headers)();e.set(YR.JsHeaders.RequiredApiLevel,i.toString()),o.headers=e}let l=r||1;l=-1===l?Number.MAX_SAFE_INTEGER:l;let u=(0,J7.backoff)();for(let t=0;t<l;t++)try{let t=await this.nc.request(e,s,o);return this.parseJsResponse(t)}catch(n){let e=n instanceof J7.RequestError?n:null;if((n instanceof J7.errors.TimeoutError||e?.isNoResponders())&&t+1<l)await (0,J7.delay)(u.backoff(t));else throw e?.isNoResponders()?new Yk.JetStreamNotEnabled("jetstream is not enabled",{cause:n}):n}}async findStream(e){let t=await this._request(`${this.prefix}.STREAM.NAMES`,{subject:e});if(!t.streams||1!==t.streams.length)throw Yk.StreamNotFoundError.fromMessage("no stream matches subject");return t.streams[0]}getConnection(){return this.nc}parseJsResponse(e){return YH(e)}};"use strict";var YV={};Object.defineProperty(YV,"__esModule",{value:!0}),YV.ConsumerAPIImpl=void 0;var YW={};Object.defineProperty(YW,"__esModule",{value:!0}),YW.ListerImpl=void 0;class Yq{err;offset;pageInfo;subject;jsm;filter;payload;constructor(e,t,n,r){if(!e)throw J7.errors.InvalidArgumentError.format("subject","is required");this.subject=e,this.jsm=n,this.offset=0,this.pageInfo={},this.filter=t,this.payload=r||{}}async next(){if(this.err||this.pageInfo&&this.offset>=this.pageInfo.total)return[];let e={offset:this.offset};this.payload&&Object.assign(e,this.payload);try{let t=await this.jsm._request(this.subject,e,{timeout:this.jsm.timeout});this.pageInfo=t;let n=this.countResponse(t);if(0===n)return[];return this.offset+=n,this.filter(t)}catch(e){throw this.err=e,e}}countResponse(e){switch(e?.type){case"io.nats.jetstream.api.v1.stream_names_response":case"io.nats.jetstream.api.v1.stream_list_response":return e.streams?.length||0;case"io.nats.jetstream.api.v1.consumer_list_response":return e.consumers?.length||0;default:return console.error(`jslister.ts: unknown API response for paged output: ${e?.type}`),e.streams?.length||0}}async *[Symbol.asyncIterator](){let e=await this.next();for(;e.length>0;){for(let t of e)yield t;e=await this.next()}}}"use strict";YW.ListerImpl=Yq;var Y$={};function YJ(e,t=""){if(""===t)throw Error(`${e} name required`);return[".","*",">","/","\\"," "," ","\n","\r"].forEach(n=>{if(-1!==t.indexOf(n)){switch(n){case"\n":n="\\n";break;case"\r":n="\\r";break;case" ":n="\\t"}throw new Yk.InvalidNameError(`${e} name ('${t}') cannot contain '${n}'`)}}),""}function YK(e=""){if(""===e)throw Error("name required");let t=/^[-\w]+$/g;if(null===e.match(t)){for(let n of e.split(""))if(null===n.match(t))return`cannot contain '${n}'`}return""}"use strict";Object.defineProperty(Y$,"__esModule",{value:!0}),Y$.validateDurableName=function(e){return YJ("durable",e)},Y$.validateStreamName=function(e){return YJ("stream",e)},Y$.minValidation=YJ,Y$.validateName=function(e,t=""){if(""===t)throw Error(`${e} name required`);let n=YK(t);if(n.length)throw Error(`invalid ${e} name - ${e} name ${n}`)},Y$.validName=YK;var YY={};Object.defineProperty(YY,"__esModule",{value:!0}),YY.PubHeaders=YY.PriorityPolicy=YY.ConsumerApiAction=YY.PersistMode=YY.StoreCompression=YY.ReplayPolicy=YY.AckPolicy=YY.DeliverPolicy=YY.StorageType=YY.DiscardPolicy=YY.RetentionPolicy=void 0,YY.defaultConsumer=function(e,t={}){return Object.assign({name:e,deliver_policy:YY.DeliverPolicy.All,ack_policy:YY.AckPolicy.Explicit,ack_wait:(0,J8.nanos)(3e4),replay_policy:YY.ReplayPolicy.Instant},t)},YY.RetentionPolicy={Limits:"limits",Interest:"interest",Workqueue:"workqueue"},YY.DiscardPolicy={Old:"old",New:"new"},YY.StorageType={File:"file",Memory:"memory"},YY.DeliverPolicy={All:"all",Last:"last",New:"new",StartSequence:"by_start_sequence",StartTime:"by_start_time",LastPerSubject:"last_per_subject"},YY.AckPolicy={None:"none",All:"all",Explicit:"explicit",FlowControl:"flow_control",NotSet:""},YY.ReplayPolicy={Instant:"instant",Original:"original"},YY.StoreCompression={None:"none",S2:"s2"},YY.PersistMode={Default:"default",Async:"async"},YY.ConsumerApiAction={CreateOrUpdate:"",Update:"update",Create:"create"},YY.PriorityPolicy={None:"none",Overflow:"overflow",PinnedClient:"pinned_client",Prioritized:"prioritized"},YY.PubHeaders={MsgIdHdr:"Nats-Msg-Id",ExpectedStreamHdr:"Nats-Expected-Stream",ExpectedLastSeqHdr:"Nats-Expected-Last-Sequence",ExpectedLastMsgIdHdr:"Nats-Expected-Last-Msg-Id",ExpectedLastSubjectSequenceHdr:"Nats-Expected-Last-Subject-Sequence",ExpectedLastSubjectSequenceSubjectHdr:"Nats-Expected-Last-Subject-Sequence-Subject",MessageTTL:"Nats-TTL",Schedule:"Nats-Schedule",ScheduleTarget:"Nats-Schedule-Target",ScheduleSource:"Nats-Schedule-Source",ScheduleTTL:"Nats-Schedule-TTL",ScheduleTimeZone:"Nats-Schedule-Time-Zone",ScheduleRollup:"Nats-Schedule-Rollup",Scheduler:"Nats-Scheduler",ScheduleNext:"Nats-Schedule-Next"};class YX extends YP.BaseApiClientImpl{constructor(e,t){super(e,t)}async addUpdate(e,t,n,r){let i;if((0,Y$.validateStreamName)(e),n=n||{},t.deliver_group&&t.flow_control)throw J7.InvalidArgumentError.format(["flow_control","deliver_group"],"are mutually exclusive");if(t.deliver_group&&t.idle_heartbeat)throw J7.InvalidArgumentError.format(["idle_heartbeat","deliver_group"],"are mutually exclusive");if(YZ(t)){let{min:e,ok:n}=this.nc.features.get(J7.Feature.JS_PRIORITY_GROUPS);if(!n)throw Error(`priority_groups require server ${e}`);if(t.deliver_subject)throw J7.InvalidArgumentError.format("deliver_subject","cannot be set when using priority groups");var a=t;if(YZ(a)){if(!Array.isArray(a.priority_groups))throw J7.InvalidArgumentError.format(["priority_groups"],"must be an array");if(0===a.priority_groups.length)throw J7.InvalidArgumentError.format(["priority_groups"],"must have at least one group");if(a.priority_groups.forEach(e=>{if((0,Y$.minValidation)("priority_group",e),e.length>16)throw J7.errors.InvalidArgumentError.format("group","must be 16 characters or less")}),a.priority_policy!==YY.PriorityPolicy.None&&a.priority_policy!==YY.PriorityPolicy.Overflow&&a.priority_policy!==YY.PriorityPolicy.PinnedClient&&a.priority_policy!==YY.PriorityPolicy.Prioritized)throw J7.InvalidArgumentError.format(["priority_policy"],"must be 'none', 'prioritized', 'overflow', or 'pinned_client'")}}let o={};o.config=t,o.stream_name=e,o.action=n.action||YY.ConsumerApiAction.Create,o.pedantic=n.pedantic||!1,o.config.durable_name&&(0,Y$.validateDurableName)(o.config.durable_name);let s=this.nc,{min:l,ok:u}=s.features.get(J7.Feature.JS_NEW_CONSUMER_CREATE_API),c=""===t.name?void 0:t.name;if(c&&!u)throw J7.InvalidArgumentError.format("name",`requires server ${l}`);if(c)try{(0,Y$.minValidation)("name",c)}catch(n){let e=n.message,t=e.indexOf("cannot contain");if(-1!==t)throw Error(`consumer 'name' ${e.substring(t)}`);throw n}let d="";if(Array.isArray(t.filter_subjects)){let{min:e,ok:t}=s.features.get(J7.Feature.JS_MULTIPLE_CONSUMER_FILTER);if(!t)throw J7.InvalidArgumentError.format("filter_subjects",`requires server ${e}`);u=!1}if(t.metadata){let{min:e,ok:t}=s.features.get(J7.Feature.JS_STREAM_CONSUMER_METADATA);if(!t)throw J7.InvalidArgumentError.format("metadata",`requires server ${e}`)}if(u&&(d=t.name??t.durable_name??""),""!==d){let n=t.filter_subject??void 0;">"===n&&(n=void 0),i=void 0!==n?`${this.prefix}.CONSUMER.CREATE.${e}.${d}.${n}`:`${this.prefix}.CONSUMER.CREATE.${e}.${d}`}else i=t.durable_name?`${this.prefix}.CONSUMER.DURABLE.CREATE.${e}.${t.durable_name}`:`${this.prefix}.CONSUMER.CREATE.${e}`;let h=r??o.config;return await this._request(i,o,{...n,...this.requiredApiOpts(h)})}minConsumerApi(e){return e.ack_policy===YY.AckPolicy.FlowControl?4:"string"==typeof e.pause_until&&""!==e.pause_until||void 0!==e.priority_policy&&e.priority_policy!==YY.PriorityPolicy.None||"number"==typeof e.priority_timeout&&e.priority_timeout>0||Array.isArray(e.priority_groups)&&e.priority_groups.length>0?1:0}requiredApiOpts(e){if(!this.sendRequiredApiLevel())return{};let t=this.minConsumerApi(e);return t>0?{minApiVersion:t}:{}}add(e,t,n){n=n||{};let r=YY.ConsumerApiAction.Create;"string"==typeof n&&(r=n,n={});let i=Object.assign({},{action:r},n);return this.addUpdate(e,t,i)}async update(e,t,n){let r=await this.info(e,t);return this.addUpdate(e,Object.assign(r.config,n),{action:YY.ConsumerApiAction.Update},n)}async info(e,t){return(0,Y$.validateStreamName)(e),(0,Y$.validateDurableName)(t),await this._request(`${this.prefix}.CONSUMER.INFO.${e}.${t}`)}async delete(e,t){return(0,Y$.validateStreamName)(e),(0,Y$.validateDurableName)(t),(await this._request(`${this.prefix}.CONSUMER.DELETE.${e}.${t}`)).success}list(e){(0,Y$.validateStreamName)(e);let t=`${this.prefix}.CONSUMER.LIST.${e}`;return new YW.ListerImpl(t,e=>e.consumers,this)}pause(e,t,n){let r=`${this.prefix}.CONSUMER.PAUSE.${e}.${t}`,i={pause_until:n.toISOString()};return this._request(r,i)}resume(e,t){return this.pause(e,t,new Date(0))}unpin(e,t,n){let r=`${this.prefix}.CONSUMER.UNPIN.${e}.${t}`;return this._request(r,{group:n})}async reset(e,t,n){(0,Y$.validateStreamName)(e),(0,Y$.validateDurableName)(t);let{min:r,ok:i}=this.nc.features.get(J7.Feature.JS_CONSUMER_RESET);if(!i)throw Error(`consumer reset requires server ${r}`);if("number"==typeof n&&(!Number.isInteger(n)||n<0))throw J7.InvalidArgumentError.format("seq","must be a non-negative integer");let a=`${this.prefix}.CONSUMER.RESET.${e}.${t}`;return await this._request(a,"number"==typeof n?{seq:n}:void 0)}}function YZ(e){return e&&void 0!==e.priority_groups||void 0!==e.priority_policy}"use strict";YV.ConsumerAPIImpl=YX;"use strict";var YQ={};Object.defineProperty(YQ,"__esModule",{value:!0}),YQ.StreamsImpl=YQ.StoredMsgImpl=YQ.StreamAPIImpl=YQ.StreamImpl=YQ.ConsumersImpl=void 0,YQ.convertStreamSourceDomain=Xo;"use strict";var Y0={};Object.defineProperty(Y0,"__esModule",{value:!0}),Y0.PullConsumerImpl=Y0.PullConsumerMessagesImpl=Y0.PullConsumerType=void 0,Y0.isOverflowOptions=Y9,Y0.isPrioritizedOptions=Xe,Y0.validateOverflowPullOptions=Xn,Y0.validatePrioritizedPullOptions=Xr;var Y1={};Object.defineProperty(Y1,"__esModule",{value:!0}),Y1.JsMsgImpl=Y1.ACK=void 0,Y1.toJsMsg=function(e,t=5e3){return new Y7(e,t)},Y1.parseInfo=Y8,Y1.ACK=Uint8Array.of(43,65,67,75);let Y2=Uint8Array.of(45,78,65,75),Y3=Uint8Array.of(43,87,80,73),Y4=Uint8Array.of(43,78,88,84),Y5=Uint8Array.of(43,84,69,82,77),Y6=Uint8Array.of(32);function Y8(e){let t=e.split(".");if(9===t.length&&t.splice(2,0,"_",""),t.length<11||"$JS"!==t[0]||"ACK"!==t[1])throw Error("unable to parse delivery info - not a jetstream message");let n={};return n.domain="_"===t[2]?"":t[2],n.account_hash=t[3],n.stream=t[4],n.consumer=t[5],n.deliveryCount=parseInt(t[6],10),n.redelivered=n.deliveryCount>1,n.streamSequence=parseInt(t[7],10),n.deliverySequence=parseInt(t[8],10),n.timestampNanos=parseInt(t[9],10),n.pending=parseInt(t[10],10),n}class Y7{msg;di;didAck;timeout;constructor(e,t){this.msg=e,this.didAck=!1,this.timeout=t}get subject(){return this.msg.subject}get sid(){return this.msg.sid}get data(){return this.msg.data}get headers(){return this.msg.headers}get info(){return this.di||(this.di=Y8(this.reply)),this.di}get redelivered(){return this.info.deliveryCount>1}get reply(){return this.msg.reply||""}get seq(){return this.info.streamSequence}get time(){return new Date((0,J7.millis)(this.info.timestampNanos))}get timestamp(){return this.time.toISOString()}get timestampNanos(){let e=this.reply.split(".");if(9===e.length&&e.splice(2,0,"_",""),e.length<11||"$JS"!==e[0]||"ACK"!==e[1])throw Error("unable to parse delivery info - not a jetstream message");return BigInt(e[9])}doAck(e){this.didAck||(this.didAck=!this.isWIP(e),this.msg.respond(e))}isWIP(e){return 4===e.length&&e[0]===Y3[0]&&e[1]===Y3[1]&&e[2]===Y3[2]&&e[3]===Y3[3]}async ackAck(e){let t=(0,J7.deferred)();if(this.didAck)t.resolve(!1);else if(this.didAck=!0,this.msg.reply){(e=e||{}).timeout=e.timeout||this.timeout;let n=this.msg.publisher,r=!n.options?.noAsyncTraces,i=new J7.RequestOne(n.muxSubscriptions,this.msg.reply,{timeout:e.timeout},r);n.request(i);try{n.publish(this.msg.reply,Y1.ACK,{reply:`${n.muxSubscriptions.baseInbox}${i.token}`})}catch(e){i.cancel(e)}try{await Promise.race([i.timer,i.deferred]),t.resolve(!0)}catch(e){i.cancel(e),t.reject(e)}}else t.resolve(!1);return t}ack(){this.doAck(Y1.ACK)}nak(e){let t=Y2;e&&(t=new TextEncoder().encode(`-NAK ${JSON.stringify({delay:(0,J7.nanos)(e)})}`)),this.doAck(t)}working(){this.doAck(Y3)}next(e,t={batch:1}){let n={};n.batch=t.batch||1,n.no_wait=t.no_wait||!1,t.expires&&t.expires>0&&(n.expires=(0,J7.nanos)(t.expires));let r=new TextEncoder().encode(JSON.stringify(n)),i=J7.DataBuffer.concat(Y4,Y6,r);this.msg.respond(i,e?{reply:e}:void 0)}term(e=""){let t=Y5;e?.length>0&&(t=new TextEncoder().encode(`+TERM ${e}`)),this.doAck(t)}json(){return this.msg.json()}string(){return this.msg.string()}}function Y9(e){return e&&"string"==typeof e.group||"number"==typeof e.min_pending||"number"==typeof e.min_ack_pending}function Xe(e){return e&&"string"==typeof e.group&&"number"==typeof e.priority}Y1.JsMsgImpl=Y7,Y0.PullConsumerType={Unset:"",Consume:"consume",Fetch:"fetch"};class Xt extends J7.QueuedIteratorImpl{consumer;opts;sub;monitor;pending;isConsume;callback;listeners;statusIterator;abortOnMissingResource;bind;inboxPrefix;inbox;cancelables;inReset;closeListener;isPinned;isPriority;natsPinId;constructor(e,t,n=!1){if(super(),this.consumer=e,this.isConsume=n,this.cancelables=[],this.inboxPrefix=(0,J7.createInbox)(this.consumer.api.nc.options.inboxPrefix),this.inbox=`${this.inboxPrefix}.${this.consumer.serial}`,this.inReset=!1,this.isPinned=!1,this.isPriority=!1,this.natsPinId="",this.consumer.ordered){if(Y9(t))throw J7.errors.InvalidArgumentError.format(["group","min_pending","min_ack_pending"],"cannot be specified for ordered consumers");if(void 0===this.consumer.orderedConsumerState){let t={},n=e.opts;t.namePrefix=n.name_prefix??`oc_${J7.nuid.next()}`,t.opts=n,t.cursor={stream_seq:1,deliver_seq:0};let r=e._info.config.opt_start_seq||0;t.cursor.stream_seq=r>0?r-1:0,t.createFails=0,this.consumer.orderedConsumerState=t}}if(this.opts=this.parseOptions(t,this.isConsume),this.callback=t.callback||null,this.noIterator="function"==typeof this.callback,this.monitor=null,this.pending={msgs:0,bytes:0,requests:0},this.listeners=[],this.abortOnMissingResource=!0===t.abort_on_missing_resource,this.bind=!0===t.bind,t.group){let{min_pending:e,min_ack_pending:n}=t;this.isPinned=void 0===e&&void 0===n;let{priority:r}=t;this.isPriority="number"==typeof r}this.closeListener={connectionClosedCallback:()=>{this._push(()=>{this.stop()})}},this.consumer.api.nc.addCloseListener(this.closeListener),this.start()}start(){let{max_messages:e,max_bytes:t,idle_heartbeat:n,threshold_bytes:r,threshold_messages:i}=this.opts;this.sub=this.consumer.api.nc.subscribe(this.inbox,{callback:(n,a)=>{if(n)return void this.stop(n);if(this.monitor?.work(),this.consumer.ordered?0===a.subject.indexOf(this?.inboxPrefix):a.subject===this.inbox){if(a.subject!==this.sub.getSubject())return;let e=new Yk.JetStreamStatus(a),t=e.parseHeartbeat();if(t)return void this.notify(t);let n=e.code,r=e.description,{msgsLeft:i,bytesLeft:o}=e.parseDiscard();switch((i&&i>0||o&&o>0)&&(this.pending.msgs-=i,this.pending.bytes-=o,this.pending.requests--,this.notify({type:"discard",messagesLeft:i,bytesLeft:o})),n){case 400:this.stop(e.toError());return;case 409:{let t=this.handle409(e);if(t)return void this.stop(t);if(e.isMessageSizeExceedsMaxBytes()&&this.yields.length>0)break;return}case 423:this.natsPinId="",this.notify({type:"consumer_unpinned"});break;case 503:if(this.notify({type:"no_responders",code:n}),this.consumer.ordered&&(this.consumer.orderedConsumerState.needsReset=!0),!this.isConsume)return void this.stop(e.toError());break;default:this.notify({type:"debug",code:n,description:r})}}else{let e=(0,Y1.toJsMsg)(a,this.consumer.api.timeout);if(this.isPinned){let t=e?.headers?.get("Nats-Pin-Id");t&&""===this.natsPinId&&(this.natsPinId=t,this.notify({type:"consumer_pinned",id:t}))}if(this.consumer.ordered){let t=this.consumer.orderedConsumerState.cursor,n=e.info.deliverySequence,r=e.info.streamSequence;if(n!==t.deliver_seq+1)return void this.reset();t.deliver_seq=n,t.stream_seq=r}this._push(e),this.received++,this.pending.msgs&&this.pending.msgs--,this.pending.bytes&&(this.pending.bytes-=a.size())}if(0===this.pending.msgs&&0===this.pending.bytes&&(this.pending.requests=0),this.isConsume){if(e&&this.pending.msgs<=i||t&&this.pending.bytes<=r){let e=this.pullOptions();this.pull(e)}}else 0===this.pending.requests&&this._push(()=>{this.stop()})}}),n&&(this.monitor=new J7.IdleHeartbeatMonitor(n,e=>(this.notify({type:"heartbeats_missed",count:e}),this.isConsume||this.consumer.ordered)?(this.resetPending().then(()=>{}).catch(()=>{}),!1):(this.stop(new Yk.JetStreamError("heartbeats missed")),!0),{maxOut:2})),(async()=>{let e=this.consumer.api.nc.status();for await(let t of(this.statusIterator=e,e))switch(t.type){case"disconnect":this.monitor?.cancel();break;case"reconnect":this.resetPending().then(e=>{e&&this.monitor?.restart()}).catch(()=>{})}})(),this.sub.closed.then(()=>{this.sub.isDraining()&&this._push(()=>{this.stop()})}),this.pull(this.pullOptions())}handle409(e){let{code:t,description:n}=e;return(e.isConsumerDeleted()?this.notify({type:"consumer_deleted",code:t,description:n}):e.isExceededLimit()&&this.notify({type:"exceeded_limits",code:t,description:n}),!this.isConsume||e.isConsumerDeleted()&&this.abortOnMissingResource)?e.toError():null}reset(){this.monitor?.cancel();let e=this.consumer.orderedConsumerState,{name:t}=this.consumer._info?.config;t&&(this.notify({type:"reset",name:t}),this.consumer.api.delete(this.consumer.stream,t).catch(()=>{}));let n=this.consumer.getConsumerOpts();this.inbox=`${this.inboxPrefix}.${this.consumer.serial}`,e.cursor.deliver_seq=0,this.consumer.name=n.name,this.consumer.api.nc._resub(this.sub,this.inbox),this.consumer.api.add(this.consumer.stream,n).then(t=>{e.createFails=0,this.consumer._info=t,this.notify({type:"ordered_consumer_recreated",name:t.name}),this.monitor?.restart(),this.pull(this.pullOptions())}).catch(t=>{if(e.createFails++,"stream not found"===t.message&&(this.notify({type:"stream_not_found",consumerCreateFails:e.createFails,name:this.consumer.stream}),this.abortOnMissingResource))return void this.stop(t);e.createFails>=30&&0===this.received&&this.stop(t);let n=(0,J7.backoff)(),r=(0,J7.delay)(n.backoff(e.createFails));r.then(()=>{let e=this.cancelables.indexOf(r);-1!==e&&(this.cancelables=this.cancelables.splice(e,e)),this.done||this.reset()}).catch(e=>{}),this.cancelables.push(r)})}_push(e){if(this.callback){let t="function"==typeof e?e:null;try{t?t():this.callback(e)}catch(e){this.stop(e)}}else super.push(e)}notify(e){this.listeners.length>0&&this.listeners.forEach(t=>{t.done||t.push(e)})}async resetPending(){if(this.inReset)return Promise.resolve(!0);this.inReset=!0;let e=this.bind?this.resetPendingNoInfo():this.resetPendingWithInfo(),t=await e;return this.inReset=!1,t}resetPendingNoInfo(){return this.pending.msgs=0,this.pending.bytes=0,this.pending.requests=0,this.pull(this.pullOptions()),Promise.resolve(!0)}async resetPendingWithInfo(){let e=0,t=(0,J7.backoff)([this.opts.expires||3e4]),n=0;for(;;){if(this.done||this.consumer.api.nc.isClosed())return!1;try{return await this.consumer.info(),e=0,this.pending.msgs=0,this.pending.bytes=0,this.pending.requests=0,this.pull(this.pullOptions()),!0}catch(a){if(a instanceof J7.errors.ClosedConnectionError)return this.stop(a),!1;if("stream not found"===a.message){if(this.notify({type:"stream_not_found",name:this.consumer.stream}),!this.isConsume||this.abortOnMissingResource)return this.stop(a),!1}else if("consumer not found"===a.message){if(e++,this.notify({type:"consumer_not_found",name:this.consumer.name,stream:this.consumer.stream,count:e}),!this.isConsume||this.abortOnMissingResource)return this.consumer.ordered&&(this.consumer.orderedConsumerState.needsReset=!0),this.stop(a),!1;if(this.consumer.ordered)return this.reset(),!1}else e=0;let r=t.backoff(n),i=(0,J7.delay)(r);await Promise.race([i,this.consumer.api.nc.closed()]),i.cancel(),n++}}}pull(e){this.pending.bytes+=e.max_bytes??0,this.pending.msgs+=e.batch??0,this.pending.requests++;let t=this.consumer.api.nc,n=`${this.consumer.api.prefix}.CONSUMER.MSG.NEXT.${this.consumer.stream}.${this.consumer._info.name}`;this._push(()=>{t.publish(n,JSON.stringify(e),{reply:this.inbox}),this.notify({type:"next",options:e})})}pullOptions(){let e={batch:this.opts.max_messages-this.pending.msgs,max_bytes:this.opts.max_bytes-this.pending.bytes,idle_heartbeat:(0,J7.nanos)(this.opts.idle_heartbeat),expires:(0,J7.nanos)(this.opts.expires)};return this.isPinned&&""!==this.natsPinId&&(e.id=this.natsPinId),Y9(this.opts)&&(e.group=this.opts.group,this.opts.min_pending&&(e.min_pending=this.opts.min_pending),this.opts.min_ack_pending&&(e.min_ack_pending=this.opts.min_ack_pending)),Xe(this.opts)&&(e.group=this.opts.group,e.priority=this.opts.priority),e}close(){return this.stop(),this.iterClosed}closed(){return this.iterClosed}clearTimers(){this.monitor?.cancel(),this.monitor=null}stop(e){this.done||(this.consumer.api.nc.removeCloseListener(this.closeListener),this.sub?.unsubscribe(),this.clearTimers(),this.statusIterator?.stop(),this._push(()=>{super.stop(e),this.listeners.forEach(e=>{e.stop()})}))}parseOptions(e,t=!1){let n=e||{};if(n.max_messages=n.max_messages||0,n.max_bytes=n.max_bytes||0,0!==n.max_messages&&0!==n.max_bytes)throw J7.errors.InvalidArgumentError.format(["max_messages","max_bytes"],"are mutually exclusive");if(0===n.max_messages&&(n.max_messages=100),n.expires=n.expires||3e4,n.expires<1e3)throw J7.errors.InvalidArgumentError.format("expires","must be at least 1000ms");if(n.idle_heartbeat=n.idle_heartbeat||n.expires/2,n.idle_heartbeat=n.idle_heartbeat>3e4?3e4:n.idle_heartbeat,n.idle_heartbeat<500&&(n.idle_heartbeat=500),t){let e=Math.round(.75*n.max_messages)||1;n.threshold_messages=n.threshold_messages||e;let t=Math.round(.75*n.max_bytes)||1;n.threshold_bytes=n.threshold_bytes||t}if(Y9(e)){let{min:t,ok:r}=this.consumer.api.nc.features.get(J7.Feature.JS_PRIORITY_GROUPS);if(!r)throw Error(`priority_groups require server ${t}`);Xn(e),e.group&&(n.group=e.group),e.min_ack_pending&&(n.min_ack_pending=e.min_ack_pending),e.min_pending&&(n.min_pending=e.min_pending)}else Xe(e)&&(Xr(e),e.group&&(n.group=e.group),"number"==typeof e.priority&&(n.priority=e.priority));return n}status(){let e=new J7.QueuedIteratorImpl;return this.listeners.push(e),e}}function Xn(e){if(Y9(e)){if((0,Y$.minValidation)("group",e.group),e.group.length>16)throw J7.errors.InvalidArgumentError.format("group","must be 16 characters or less");let{min_pending:t,min_ack_pending:n}=e;if(t&&"number"!=typeof t)throw J7.errors.InvalidArgumentError.format(["min_pending"],"must be a number");if(n&&"number"!=typeof n)throw J7.errors.InvalidArgumentError.format(["min_ack_pending"],"must be a number")}}function Xr(e){if(Xe(e)){if((0,Y$.minValidation)("group",e.group),e.group.length>16)throw J7.errors.InvalidArgumentError.format("group","must be 16 characters or less");let{priority:t}=e;if(t&&"number"!=typeof t)throw J7.errors.InvalidArgumentError.format(["priority"],"must be a number")}}"use strict";Y0.PullConsumerMessagesImpl=Xt,Y0.PullConsumerImpl=class{api;_info;stream;name;opts;type;messages;ordered;serial;orderedConsumerState;constructor(e,t,n=null){this.api=e,this._info=t,this.name=t.name,this.stream=t.stream_name,this.ordered=null!==n,this.opts=n||{},this.serial=1,this.type=Y0.PullConsumerType.Unset}debug(){console.log({serial:this.serial,cursor:this.orderedConsumerState?.cursor})}isPullConsumer(){return!0}isPushConsumer(){return!1}consume(e={max_messages:100,expires:3e4}){if(e={...e},this.ordered){if(e.bind)return Promise.reject(J7.errors.InvalidArgumentError.format("bind","is not supported"));if(this.type===Y0.PullConsumerType.Fetch)return Promise.reject(new J7.errors.InvalidOperationError("ordered consumer initialized as fetch"));if(this.type===Y0.PullConsumerType.Consume)return Promise.reject(new J7.errors.InvalidOperationError("ordered consumer doesn't support concurrent consume"));this.type=Y0.PullConsumerType.Consume}return Promise.resolve(new Xt(this,e,!0))}async fetch(e={max_messages:100,expires:3e4}){if(e={...e},this.ordered){if(e.group)return Promise.reject(J7.errors.InvalidArgumentError.format("group","ordered consumers don't support priority groups"));if(e.bind)return Promise.reject(J7.errors.InvalidArgumentError.format("bind","is not supported"));if(this.type===Y0.PullConsumerType.Consume)return Promise.reject(new J7.errors.InvalidOperationError("ordered consumer already initialized as consume"));if(this.messages?.done===!1)return Promise.reject(new J7.errors.InvalidOperationError("ordered consumer doesn't support concurrent fetch"));this.ordered&&(this.orderedConsumerState?.cursor?.deliver_seq&&(this._info.config.opt_start_seq=this.orderedConsumerState?.cursor.stream_seq+1),this.orderedConsumerState?.needsReset===!0&&await this._reset()),this.type=Y0.PullConsumerType.Fetch}let t=new Xt(this,e);return this.ordered&&(this.messages=t),Promise.resolve(t)}async next(e={expires:3e4}){let t=e={...e};t.max_messages=1;let n=await this.fetch(t);try{for await(let e of n)return e}catch(e){return Promise.reject(e)}return null}delete(){let{stream_name:e,name:t}=this._info;return this.api.delete(e,t)}getConsumerOpts(){let e=this.orderedConsumerState;this.serial++,this.name=`${e.namePrefix}_${this.serial}`;let t=Object.assign({},this._info.config,{name:this.name,deliver_policy:YY.DeliverPolicy.StartSequence,opt_start_seq:e.cursor.stream_seq+1,ack_policy:YY.AckPolicy.None,inactive_threshold:(0,J7.nanos)(3e5),num_replicas:1});return delete t.metadata,t}async _reset(){if(void 0===this.messages)throw Error("not possible to reset");this.delete().catch(()=>{});let e=this.getConsumerOpts(),t=await this.api.add(this.stream,e);return this._info=t,t}async info(e=!1){if(e)return Promise.resolve(this._info);let{stream_name:t,name:n}=this._info;return this._info=await this.api.info(t,n),this._info}};var Xi={};Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.PushConsumerImpl=Xi.PushConsumerMessagesImpl=void 0;class Xa extends J7.QueuedIteratorImpl{consumer;sub;monitor;listeners;abortOnMissingResource;callback;ordered;cursor;namePrefix;deliverPrefix;serial;createFails;statusIterator;cancelables;constructor(e,t={},n={}){if(super(),this.consumer=e,this.monitor=null,this.listeners=[],this.cancelables=[],this.abortOnMissingResource=!0===t.abort_on_missing_resource,this.callback=t.callback||null,this.noIterator=null!==this.callback,this.namePrefix=null,this.deliverPrefix=null,this.ordered=!0===n.ordered,this.serial=1,this.ordered){this.namePrefix=n.name_prefix??`oc_${J7.nuid.next()}`,this.deliverPrefix=n.deliver_prefix??(0,J7.createInbox)(this.consumer.api.nc.options.inboxPrefix),this.cursor={stream_seq:1,deliver_seq:0};let t=e._info.config.opt_start_seq||0;this.cursor.stream_seq=t>0?t-1:0,this.createFails=0}this.start()}reset(){let{name:e}=this.consumer._info?.config;e&&this.consumer.api.delete(this.consumer.stream,e).catch(()=>{});let t=this.getConsumerOpts();this.cursor.deliver_seq=0,this.consumer.name=t.name,this.consumer.serial=this.serial,this.consumer.api.nc._resub(this.sub,t.deliver_subject),this.consumer.api.add(this.consumer.stream,t).then(e=>{this.createFails=0,this.consumer._info=e,this.notify({type:"ordered_consumer_recreated",name:e.name})}).catch(e=>{if(this.createFails++,"stream not found"===e.message&&(this.notify({type:"stream_not_found",name:this.consumer.stream,consumerCreateFails:this.createFails}),this.abortOnMissingResource))return void this.stop(e);this.createFails>=30&&0===this.received&&this.stop(e);let t=(0,J7.backoff)(),n=(0,J7.delay)(t.backoff(this.createFails));n.then(()=>{this.done||this.reset()}).catch(()=>{}).finally(()=>{let e=this.cancelables.indexOf(n);-1!==e&&(this.cancelables=this.cancelables.splice(e,e))}),this.cancelables.push(n)})}getConsumerOpts(){let e=Object.assign({},this.consumer._info.config);return this.serial++,Object.assign(e,{name:`${this.namePrefix}_${this.serial}`,deliver_policy:YY.DeliverPolicy.StartSequence,opt_start_seq:this.cursor.stream_seq+1,ack_policy:YY.AckPolicy.None,inactive_threshold:(0,J7.nanos)(3e5),num_replicas:1,flow_control:!0,idle_heartbeat:(0,J7.nanos)(3e4),deliver_subject:`${this.deliverPrefix}.${this.serial}`})}closed(){return this.iterClosed}close(){return this.stop(),this.iterClosed}stop(e){this.done||(this.statusIterator?.stop(),this.monitor?.cancel(),this.monitor=null,this.cancelables.forEach(e=>{e.cancel()}),Promise.all(this.cancelables).then(()=>{this.cancelables=[]}).catch(()=>{}).finally(()=>{this._push(()=>{super.stop(e),this.listeners.forEach(e=>{e.stop()})})}))}_push(e){if(this.callback){let t="function"==typeof e?e:null;try{t?t():(this.received++,this.callback(e),this.processed++)}catch(e){this.stop(e)}}else super.push(e)}status(){let e=new J7.QueuedIteratorImpl;return this.listeners.push(e),e}start(){let{deliver_subject:e,deliver_group:t,idle_heartbeat:n}=this.consumer._info.config;if(!e)throw Error("bad consumer info");if(n){let e=(0,J7.millis)(n);this.monitor=new J7.IdleHeartbeatMonitor(e,e=>(this.notify({type:"heartbeats_missed",count:e}),this.ordered&&this.reset(),!1),{maxOut:2}),(async()=>{for await(let e of(this.statusIterator=this.consumer.api.nc.status(),this.statusIterator))switch(e.type){case"disconnect":this.monitor?.cancel();break;case"reconnect":this.monitor?.restart()}})()}this.sub=this.consumer.api.nc.subscribe(e,{queue:t,callback:(t,n)=>{if(t)return void this.stop(t);if(this.monitor?.work(),this.ordered?0===n.subject.indexOf(this?.deliverPrefix):n.subject===e){if(n.subject!==this.sub.getSubject())return;let e=new Yk.JetStreamStatus(n);if(e.isFlowControlRequest())return void this._push(()=>{n.respond(),this.notify({type:"flow_control"})});if(e.isIdleHeartbeat()){let e=parseInt(n.headers?.get(YR.JsHeaders.LastConsumerSeqHdr)||"0"),t=parseInt(n.headers?.get(YR.JsHeaders.LastStreamSeqHdr)??"0");this.notify({type:"heartbeat",lastStreamSequence:t,lastConsumerSequence:e});let r=n.headers?.get(YR.JsHeaders.ConsumerStalledHdr);"string"==typeof r&&""!==r&&n.publisher.publish(r,J7.Empty);return}let t=e.code,r=e.description;if(e.isConsumerDeleted()&&this.notify({type:"consumer_deleted",code:t,description:r}),this.abortOnMissingResource)return void this._push(()=>{this.stop(e.toError())})}else{let e=(0,Y1.toJsMsg)(n);if(this.ordered){let t=e.info.deliverySequence;if(t!==this.cursor.deliver_seq+1)return void this.reset();this.cursor.deliver_seq=t,this.cursor.stream_seq=e.info.streamSequence}this._push(e)}}}),this.sub.closed.then(()=>{this._push(()=>{this.stop()})}),this.closed().then(()=>{this.sub?.unsubscribe()})}notify(e){this.listeners.length>0&&this.listeners.forEach(t=>{t.done||t.push(e)})}}function Xo(e){if(void 0===e)return;let{domain:t}=e;if(void 0===t)return e;let n=Object.assign({},e);if(delete n.domain,""===t)return n;if(n.external)throw J7.InvalidArgumentError.format(["domain","external"],"are mutually exclusive");return n.external={api:`$JS.${t}.API`},n}Xi.PushConsumerMessagesImpl=Xa,Xi.PushConsumerImpl=class{api;_info;stream;name;bound;ordered;started;serial;opts;constructor(e,t,n={}){this.api=e,this._info=t,this.stream=t.stream_name,this.name=t.name,this.bound=!0===n.bound,this.started=!1,this.opts=n,this.serial=0,this.ordered=n.ordered||!1,this.ordered&&(this.serial=1)}consume(e={}){if(e={...e},this.started)return Promise.reject(new J7.errors.InvalidOperationError("consumer already started"));if(!this._info.config.deliver_subject)return Promise.reject(Error("deliver_subject is not set, not a push consumer"));if(!this._info.config.deliver_group&&this._info.push_bound)return Promise.reject(new J7.errors.InvalidOperationError("consumer is already bound"));let t=new Xa(this,e,this.opts);return this.started=!0,t.closed().then(()=>{this.started=!1}),Promise.resolve(t)}delete(){if(this.bound)return Promise.reject(new J7.errors.InvalidOperationError("bound consumers cannot delete"));let{stream_name:e,name:t}=this._info;return this.api.delete(e,t)}async info(e){if(this.bound)return Promise.reject(new J7.errors.InvalidOperationError("bound consumers cannot info"));if(e)return Promise.resolve(this._info);let t=await this.api.info(this.stream,this.name);return this._info=t,t}isPullConsumer(){return!1}isPushConsumer(){return!0}};class Xs{api;notified;constructor(e){this.api=e,this.notified=!1}checkVersion(){let e=this.api.nc.features.get(J7.Feature.JS_SIMPLIFICATION);return e.ok?Promise.resolve():Promise.reject(Error(`consumers framework is only supported on servers ${e.min} or better`))}async getPushConsumer(e,t){if(await this.checkVersion(),(0,Y$.minValidation)("stream",e),"string"==typeof t){(0,Y$.minValidation)("name",t);let n=await this.api.info(e,t);return"string"!=typeof n.config.deliver_subject?Promise.reject(Error("not a push consumer")):new Xi.PushConsumerImpl(this.api,n)}return void 0===t?this.getOrderedPushConsumer(e):(0,YR.isOrderedPushConsumerOptions)(t)?this.getOrderedPushConsumer(e,t):Promise.reject(Error("unsupported push consumer type"))}async getOrderedPushConsumer(e,t={}){let{name_prefix:n,deliver_prefix:r,filter_subjects:i}=t=Object.assign({},t);delete t.deliver_prefix,delete t.name_prefix,delete t.filter_subjects,"number"==typeof t.opt_start_seq&&(t.deliver_policy=YY.DeliverPolicy.StartSequence),"string"==typeof t.opt_start_time&&(t.deliver_policy=YY.DeliverPolicy.StartTime),n=n||`oc_${J7.nuid.next()}`,(0,Y$.minValidation)("name_prefix",n),r=r||(0,J7.createInbox)(this.api.getOptions().watcherPrefix);let a=Object.assign({},t);a.ack_policy=YY.AckPolicy.None,a.inactive_threshold=(0,J7.nanos)(3e5),a.num_replicas=1,a.max_deliver=1,a.flow_control=!0,a.idle_heartbeat=(0,J7.nanos)(3e4),Array.isArray(i)&&(a.filter_subjects=i),"string"==typeof i&&(a.filter_subject=i),void 0===a.filter_subjects&&void 0===a.filter_subject&&(a.filter_subject=">"),a.name=`${n}_1`,a.deliver_subject=`${r}.1`;let o=await this.api.add(e,a),s={name_prefix:n,deliver_prefix:r,ordered:!0};return new Xi.PushConsumerImpl(this.api,o,s)}getBoundPushConsumer(e){return(0,YR.isBoundPushConsumerOptions)(e)?Promise.resolve(new Xi.PushConsumerImpl(this.api,{config:e},{bound:!0})):Promise.reject(J7.errors.InvalidArgumentError.format("deliver_subject","is required"))}async get(e,t){if(await this.checkVersion(),"string"!=typeof t)return this.ordered(e,t);{let n=await this.api.info(e,t);return"string"==typeof n.config.deliver_subject?Promise.reject(Error("not a pull consumer")):new Y0.PullConsumerImpl(this.api,n)}}getConsumerFromInfo(e){if("string"==typeof e.config.deliver_subject)throw Error("not a pull consumer");return new Y0.PullConsumerImpl(this.api,e)}async ordered(e,t={}){await this.checkVersion();let n=this.api,r=new Xu(n.nc,n.opts);await r.info(e),"string"==typeof t.name_prefix&&(0,Y$.minValidation)("name_prefix",t.name_prefix),t.name_prefix=t.name_prefix||J7.nuid.next();let i={name:`${t.name_prefix}_1`,deliver_policy:YY.DeliverPolicy.StartSequence,opt_start_seq:t.opt_start_seq||1,ack_policy:YY.AckPolicy.None,inactive_threshold:(0,J7.nanos)(3e5),num_replicas:1,max_deliver:1,mem_storage:!0};!0===t.headers_only&&(i.headers_only=!0),Array.isArray(t.filter_subjects)&&(i.filter_subjects=t.filter_subjects),"string"==typeof t.filter_subjects&&(i.filter_subject=t.filter_subjects),t.replay_policy&&(i.replay_policy=t.replay_policy),i.deliver_policy=t.deliver_policy||YY.DeliverPolicy.StartSequence,(t.deliver_policy===YY.DeliverPolicy.All||t.deliver_policy===YY.DeliverPolicy.LastPerSubject||t.deliver_policy===YY.DeliverPolicy.New||t.deliver_policy===YY.DeliverPolicy.Last)&&(delete i.opt_start_seq,i.deliver_policy=t.deliver_policy),i.deliver_policy===YY.DeliverPolicy.LastPerSubject&&void 0===i.filter_subjects&&void 0===i.filter_subject&&(i.filter_subject=">"),t.opt_start_time&&(delete i.opt_start_seq,i.deliver_policy=YY.DeliverPolicy.StartTime,i.opt_start_time=t.opt_start_time),t.inactive_threshold&&(i.inactive_threshold=(0,J7.nanos)(t.inactive_threshold));let a=await this.api.add(e,i);return Promise.resolve(new Y0.PullConsumerImpl(this.api,a,t))}}YQ.ConsumersImpl=Xs;class Xl{api;_info;constructor(e,t){this.api=e,this._info=t}get name(){return this._info.config.name}alternates(){return this.info().then(e=>e.alternates?e.alternates:[])}async best(){if(await this.info(),!this._info.alternates)return this;{let e=await this.api.info(this._info.alternates[0].name);return new Xl(this.api,e)}}info(e=!1,t){return e?Promise.resolve(this._info):this.api.info(this.name,t).then(e=>(this._info=e,this._info))}getConsumer(e){return new Xs(new YV.ConsumerAPIImpl(this.api.nc,this.api.opts)).get(this.name,e)}getPushConsumer(e){return new Xs(new YV.ConsumerAPIImpl(this.api.nc,this.api.opts)).getPushConsumer(this.name,e)}getMessage(e){return this.api.getMessage(this.name,e)}deleteMessage(e,t=!0){return this.api.deleteMessage(this.name,e,t)}resetConsumer(e,t){return new YV.ConsumerAPIImpl(this.api.nc,this.api.opts).reset(this.name,e,t)}}YQ.StreamImpl=Xl;class Xu extends YP.BaseApiClientImpl{constructor(e,t){super(e,t)}checkStreamConfigVersions(e){let t=this.nc;if(e.metadata){let{min:e,ok:n}=t.features.get(J7.Feature.JS_STREAM_CONSUMER_METADATA);if(!n)throw Error(`stream 'metadata' requires server ${e}`)}if(e.first_seq){let{min:e,ok:n}=t.features.get(J7.Feature.JS_STREAM_FIRST_SEQ);if(!n)throw Error(`stream 'first_seq' requires server ${e}`)}if(e.subject_transform){let{min:e,ok:n}=t.features.get(J7.Feature.JS_STREAM_SUBJECT_TRANSFORM);if(!n)throw Error(`stream 'subject_transform' requires server ${e}`)}if(e.compression){let{min:e,ok:n}=t.features.get(J7.Feature.JS_STREAM_COMPRESSION);if(!n)throw Error(`stream 'compression' requires server ${e}`)}if(e.consumer_limits){let{min:e,ok:n}=t.features.get(J7.Feature.JS_DEFAULT_CONSUMER_LIMITS);if(!n)throw Error(`stream 'consumer_limits' requires server ${e}`)}function n(e,n){if((n?.subject_transforms?.length||0)>0){let{min:n,ok:r}=t.features.get(J7.Feature.JS_STREAM_SOURCE_SUBJECT_TRANSFORM);if(!r)throw Error(`${e} 'subject_transforms' requires server ${n}`)}}e.sources&&e.sources.forEach(e=>{n("stream sources",e)}),e.mirror&&n("stream mirror",e.mirror)}minStreamApi(e){return!0===e.allow_batched||e.mirror?.consumer||e.sources?.some(e=>e.consumer)?4:!0===e.allow_msg_counter||!0===e.allow_atomic||!0===e.allow_msg_schedules||e.persist_mode===YY.PersistMode.Async?2:+(!0===e.allow_msg_ttl||"number"==typeof e.subject_delete_marker_ttl&&e.subject_delete_marker_ttl>0)}requiredApiOpts(e){if(!this.sendRequiredApiLevel())return{};let t=this.minStreamApi(e);return t>0?{minApiVersion:t}:{}}async add(e){this.checkStreamConfigVersions(e),(0,Y$.validateStreamName)(e.name),e.mirror=Xo(e.mirror),e.sources=e.sources?.map(Xo);let t=await this._request(`${this.prefix}.STREAM.CREATE.${e.name}`,e,this.requiredApiOpts(e));return this._fixInfo(t),t}async delete(e){return(0,Y$.validateStreamName)(e),(await this._request(`${this.prefix}.STREAM.DELETE.${e}`)).success}async update(e,t={}){if("object"==typeof e){let n=e;e=n.name,t=n,console.trace("\x1b[33m >> streams.update(config: StreamConfig) api changed to streams.update(name: string, config: StreamUpdateConfig) - this shim will be removed - update your code. \x1b[0m")}this.checkStreamConfigVersions(t),(0,Y$.validateStreamName)(e);let n=Object.assign((await this.info(e)).config,t);n.mirror=Xo(n.mirror),n.sources=n.sources?.map(Xo);let r=await this._request(`${this.prefix}.STREAM.UPDATE.${e}`,n,this.requiredApiOpts(t));return this._fixInfo(r),r}async info(e,t){(0,Y$.validateStreamName)(e);let n=`${this.prefix}.STREAM.INFO.${e}`,r=await this._request(n,t),{total:i,limit:a}=r,o=r.state.subjects?Object.getOwnPropertyNames(r.state.subjects).length:1;if(i&&i>o){let e=[r],s=t||{},l=0;for(;i>o;){s.offset=a*++l;let t=await this._request(n,s);i=t.total,e.push(t);let r=Object.getOwnPropertyNames(t.state.subjects).length;if(o+=r,r<a)break}let u={};for(let t=0;t<e.length;t++)(r=e[t]).state.subjects&&(u=Object.assign(u,r.state.subjects));r.offset=0,r.total=0,r.limit=0,r.state.subjects=u}return this._fixInfo(r),r}list(e=""){let t=e?.length?{subject:e}:{},n=e=>(e.streams.forEach(e=>{this._fixInfo(e)}),e.streams),r=`${this.prefix}.STREAM.LIST`;return new YW.ListerImpl(r,n,this,t)}_fixInfo(e){e.config.sealed=e.config.sealed||!1,e.config.deny_delete=e.config.deny_delete||!1,e.config.deny_purge=e.config.deny_purge||!1,e.config.allow_rollup_hdrs=e.config.allow_rollup_hdrs||!1}async purge(e,t){if(t){let{keep:e,seq:n}=t;if("number"==typeof e&&"number"==typeof n)throw J7.InvalidArgumentError.format(["keep","seq"],"are mutually exclusive")}return(0,Y$.validateStreamName)(e),await this._request(`${this.prefix}.STREAM.PURGE.${e}`,t)}async deleteMessage(e,t,n=!0){(0,Y$.validateStreamName)(e);let r={seq:t};return n||(r.no_erase=!0),(await this._request(`${this.prefix}.STREAM.MSG.DELETE.${e}`,r)).success}async getMessage(e,t){(0,Y$.validateStreamName)(e);try{let n=await this._request(`${this.prefix}.STREAM.MSG.GET.${e}`,t);return new Xc(n)}catch(e){if(e instanceof Yk.JetStreamApiError&&e.code===Yk.JetStreamApiCodes.NoMessageFound)return null;return Promise.reject(e)}}find(e){return this.findStream(e)}names(e=""){let t=e?.length?{subject:e}:{},n=`${this.prefix}.STREAM.NAMES`;return new YW.ListerImpl(n,e=>e.streams,this,t)}async get(e){return Promise.resolve(new Xl(this,await this.info(e)))}}YQ.StreamAPIImpl=Xu;class Xc{_header;smr;static jc;constructor(e){this.smr=e}get pending(){return 0}get lastSequence(){return 0}get subject(){return this.smr.message.subject}get seq(){return this.smr.message.seq}get timestamp(){return this.smr.message.time}get time(){return new Date(Date.parse(this.timestamp))}get data(){return this.smr.message.data?this._parse(this.smr.message.data):J7.Empty}get header(){if(!this._header)if(this.smr.message.hdrs){let e=this._parse(this.smr.message.hdrs);this._header=J7.MsgHdrsImpl.decode(e)}else this._header=(0,J7.headers)();return this._header}_parse(e){let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r}json(e){return JSON.parse(new TextDecoder().decode(this.data),e)}string(){return J7.TD.decode(this.data)}}"use strict";YQ.StoredMsgImpl=Xc,YQ.StreamsImpl=class{api;constructor(e){this.api=e}get(e){return this.api.info(e).then(e=>new Xl(this.api,e))}};var Xd={};Object.defineProperty(Xd,"__esModule",{value:!0}),Xd.DirectConsumer=Xd.DirectMsgImpl=Xd.DirectStreamAPIImpl=void 0;class Xh extends YP.BaseApiClientImpl{constructor(e,t){super(e,t)}async getMessage(e,t){if((0,Y$.validateStreamName)(e),"start_time"in t){let{min:e,ok:t}=this.nc.features.get(J7.Feature.JS_BATCH_DIRECT_GET);if(!t)throw Error(`start_time direct option require server ${e}`)}let n=t,{last_by_subj:r}=n;r&&(n=null);let i=n?JSON.stringify(n):J7.Empty,a=this.opts.apiPrefix||"$JS.API",o=r?`${a}.DIRECT.GET.${e}.${r}`:`${a}.DIRECT.GET.${e}`,s=await this.nc.request(o,i,{timeout:this.timeout});if(s.headers?.code!==0){let e=new Yk.JetStreamStatus(s);return e.isMessageNotFound()?Promise.resolve(null):Promise.reject(e.toError())}return Promise.resolve(new Xp(s))}getBatch(e,t){return t.batch=t.batch||1024,this.get(e,t)}getLastMessagesFor(e,t){return this.get(e,t)}get(e,t){t={...t};let{min:n,ok:r}=this.nc.features.get(J7.Feature.JS_BATCH_DIRECT_GET);if(!r)return Promise.reject(Error(`batch direct require server ${n}`));(0,Y$.validateStreamName)(e);let i="function"==typeof t.callback?t.callback:null,a=new J7.QueuedIteratorImpl;i&&a.iterClosed.then(e=>{o({err:e||void 0},{}),u.unsubscribe()});let o=i?function(e,t){"function"==typeof t?t():i(e,t)}:function(e,t){e?a.push(()=>{e.err?a.stop(e.err):a.stop()}):a.push(t)},s=(0,J7.createInbox)(this.nc.options.inboxPrefix),l=!1,u=this.nc.subscribe(s,{timeout:5e3,callback:(e,t)=>{if(e){a.stop(e),u.unsubscribe();return}let n=Yk.JetStreamStatus.maybeParseStatus(t);if(n){if(n.isNoResults()&&o({},()=>{a.stop()}),n.isEndOfBatch())o({},()=>{a.stop()});else{let e=n.toError();o({err:e},()=>{a.stop(e)})}return}l||("string"!=typeof t.headers?.get("Nats-Num-Pending")?(u.unsubscribe(),o({},()=>{a.stop()})):l=!0),o(null,new Xp(t))}}),c=this.opts.apiPrefix||"$JS.API",d=`${c}.DIRECT.GET.${e}`,h=JSON.stringify(t,(e,t)=>("up_to_time"===e||"start_time"===e)&&t instanceof Date?t.toISOString():t);return this.nc.publish(d,h,{reply:s}),Promise.resolve(a)}}Xd.DirectStreamAPIImpl=Xh;class Xp{data;header;constructor(e){if(!e.headers)throw Error("headers expected");this.data=e.data,this.header=e.headers}get subject(){return this.header.last(YR.DirectMsgHeaders.Subject)}get seq(){let e=this.header.last(YR.DirectMsgHeaders.Sequence);return"string"==typeof e?parseInt(e):0}get time(){return new Date(Date.parse(this.timestamp))}get timestamp(){return this.header.last(YR.DirectMsgHeaders.TimeStamp)}get stream(){return this.header.last(YR.DirectMsgHeaders.Stream)}get lastSequence(){let e=this.header.last(YR.DirectMsgHeaders.LastSequence);return"string"==typeof e?parseInt(e):0}get pending(){let e=this.header.last(YR.DirectMsgHeaders.NumPending);return"string"==typeof e?parseInt(e):-1}json(e){return JSON.parse(new TextDecoder().decode(this.data),e)}string(){return J7.TD.decode(this.data)}}function Xm(e){let t=e.expect||{},n=e.headers||(0,J7.headers)();if(e.msgID&&n.set(YY.PubHeaders.MsgIdHdr,e.msgID),t.lastMsgID&&n.set(YY.PubHeaders.ExpectedLastMsgIdHdr,t.lastMsgID),t.streamName&&n.set(YY.PubHeaders.ExpectedStreamHdr,t.streamName),"number"==typeof t.lastSequence&&n.set(YY.PubHeaders.ExpectedLastSeqHdr,`${t.lastSequence}`),"number"==typeof t.lastSubjectSequence&&n.set(YY.PubHeaders.ExpectedLastSubjectSequenceHdr,`${t.lastSubjectSequence}`),t.lastSubjectSequenceSubject&&n.set(YY.PubHeaders.ExpectedLastSubjectSequenceSubjectHdr,t.lastSubjectSequenceSubject),e.ttl&&n.set(YY.PubHeaders.MessageTTL,`${e.ttl}`),e.schedule&&e.cancelSchedule)throw Error("schedule and cancelSchedule are mutually exclusive");if(e.schedule){let t=e.schedule;t.specification&&n.set(YY.PubHeaders.Schedule,Xy(t.specification)),t.target&&n.set(YY.PubHeaders.ScheduleTarget,t.target),t.source&&n.set(YY.PubHeaders.ScheduleSource,t.source),t.ttl&&n.set(YY.PubHeaders.ScheduleTTL,t.ttl),t.timezone&&n.set(YY.PubHeaders.ScheduleTimeZone,t.timezone),t.rollup&&n.set(YY.PubHeaders.ScheduleRollup,t.rollup)}return e.cancelSchedule&&(n.set(YY.PubHeaders.Scheduler,e.cancelSchedule.scheduleSubject),n.set(YY.PubHeaders.ScheduleNext,"purge")),n}function Xf(e,t={}){return new Xb(e,t)}async function Xg(e,t={}){let n=new Xv(e,t);if(!1!==t.checkAPI)try{await n.getAccountInfo()}catch(e){throw e}return n}Xd.DirectMsgImpl=Xp,Xd.DirectConsumer=class{stream;api;cursor;listeners;start;constructor(e,t,n){this.stream=e,this.api=t,this.cursor={last:0},this.listeners=[],this.start=n}getOptions(e){var t,n;e=e||{};let r={};return 0===this.cursor.last?"object"==typeof(t=this.start)&&"start_time"in t?r.start_time=this.start.start_time:r.seq=this.start.seq||1:r.seq=this.cursor.last+1,"object"==typeof(n=e)&&"max_bytes"in n?r.max_bytes=e.max_bytes:r.batch=e.batch??100,r}status(){let e=new J7.QueuedIteratorImpl;return this.listeners.push(e),e}notify(e){let t;this.listeners.length>0&&(t=[],this.listeners.forEach(n=>{n.done?t.push(n):n.push(e)}),this.listeners=this.listeners.filter(e=>!t.includes(e)))}debug(){console.log(this.cursor)}consume(e){let t,n,r=new J7.QueuedIteratorImpl;return(async()=>{for(;0===this.cursor.pending&&(this.notify({type:"debug",code:0,description:"sleeping for 2500"}),t=(0,J7.delay)(2500),await t),!r.done;){n=(0,J7.deferred)();let i=this.getOptions(e);this.notify({type:"next",options:Object.assign({},e)}),i.callback=(e,t)=>{e?(e.err&&(e.err instanceof Yk.JetStreamStatusError?this.notify({type:"debug",code:e.err.code,description:e.err.message}):this.notify({type:"debug",code:0,description:e.err.message})),n.resolve()):t.lastSequence>0&&t.lastSequence!==this.cursor.last?(a.stop(),n.resolve(),this.notify({type:"reset",name:"direct"})):(r.push(t),r.received++,this.cursor.last=t.seq,this.cursor.pending=t.pending)};let a=await this.api.getBatch(this.stream,i);r.iterClosed.then(()=>{a.stop(),t?.cancel(),n?.resolve()}),await n}})().catch(e=>{r.stop(e)}),Promise.resolve(r)}async fetch(e){let t=this.getOptions(e),n=new J7.QueuedIteratorImpl,r=await this.api.get(this.stream,Object.assign({callback:(e,t)=>{e?n.push(()=>{e.err?n.stop(e.err):n.stop()}):t.lastSequence>0&&t.lastSequence!==this.cursor.last?(n.push(()=>{n.stop()}),r.stop()):(n.push(t),n.received++,this.cursor.last=t.seq,this.cursor.pending=t.pending)}},t));return n.iterClosed.then(()=>{r.stop()}),n}async next(){let e=await this.api.getMessage(this.stream,{seq:this.cursor.last+1}),t=e?.seq;return t&&(this.cursor.last=t),e}};class Xv extends YP.BaseApiClientImpl{streams;consumers;direct;constructor(e,t){super(e,t),this.streams=new YQ.StreamAPIImpl(e,t),this.consumers=new YV.ConsumerAPIImpl(e,t),this.direct=new Xd.DirectStreamAPIImpl(e,t)}async getAccountInfo(){return await this._request(`${this.prefix}.INFO`)}jetstream(){return Xf(this.nc,this.getOptions())}advisories(){let e=new J7.QueuedIteratorImpl;return this.nc.subscribe("$JS.EVENT.ADVISORY.>",{callback:(t,n)=>{if(t)throw t;try{let t=this.parseJsResponse(n),r=t.type.split("."),i=r[r.length-1];e.push({kind:i,data:t})}catch(t){e.stop(t)}}}),e}}function Xy(e){if("string"==typeof e)return e;if(e instanceof Date)return`@at ${e.toISOString()}`;if("at"in e){let t=e.at instanceof Date?e.at.toISOString():e.at;return`@at ${t}`}if("every"in e)return function(e){let t,n=e.trim(),r=/(\d+(?:\.\d+)?)(ns|us|µs|ms|s|m|h)/g,i=0,a=0;for(;null!==(t=r.exec(n))&&t.index===a;){a+=t[0].length;let e=parseFloat(t[1]),n=t[2];i+="ns"===n?e/1e6:"us"===n||"µs"===n?e/1e3:"ms"===n?e:"s"===n?1e3*e:"m"===n?6e4*e:36e5*e}if(""===n||a!==n.length)throw Error(`@every: unrecognized duration format: "${e}"`);if(i<1e3)throw Error("@every interval must be at least 1s")}(e.every),`@every ${e.every}`;if("cron"in e)return e.cron;if("predefined"in e)return e.predefined;throw Error("invalid schedule specification")}YO.JetStreamManagerImpl=Xv;class Xb extends YP.BaseApiClientImpl{consumers;streams;consumerAPI;streamAPI;constructor(e,t){super(e,t),this.consumerAPI=new YV.ConsumerAPIImpl(e,t),this.streamAPI=new YQ.StreamAPIImpl(e,t),this.consumers=new YQ.ConsumersImpl(this.consumerAPI),this.streams=new YQ.StreamsImpl(this.streamAPI)}jetstreamManager(e){void 0===e&&(e=this.opts.checkAPI);let t=Object.assign({},this.opts,{checkAPI:e});try{(0,J7.createInbox)(t.watcherPrefix)}catch(e){return Promise.reject(e)}return Xg(this.nc,t)}get apiPrefix(){return this.prefix}startBatch(e,t,n){let r=(0,J7.deferred)(),i=new X_(this);return i.first(e,t,n).then(()=>{r.resolve(i)}).catch(e=>{r.reject(e)}),r}async _publish(e,t=J7.Empty,n){if((n={...n=n||{}}).cancelSchedule&&n.cancelSchedule.scheduleSubject===e)throw Error("cancelSchedule.scheduleSubject must not equal the publish subject");let r=Xm(n),i=n.timeout||this.timeout,a={};i&&(a.timeout=i),n&&(a.headers=r);let{retries:o}=n;o=o||1;let s=(0,J7.backoff)(),l=null;for(let n=0;n<o;n++)try{l=await this.nc.request(e,t,a);break}catch(t){let e=t instanceof J7.RequestError?t:null;if((t instanceof J7.errors.TimeoutError||e?.isNoResponders())&&n+1<o)await (0,J7.delay)(s.backoff(n));else throw e?.isNoResponders()?new Yk.JetStreamNotEnabled("jetstream is not enabled",{cause:t}):t}return l}async publish(e,t=J7.Empty,n){let r=await this._publish(e,t,n),i=this.parseJsResponse(r);if(""===i.stream)throw new Yk.JetStreamError("invalid ack response");return i.duplicate=!!i.duplicate&&i.duplicate,i}}YO.JetStreamClientImpl=Xb;class X_{nc;js;id;count;done;constructor(e){this.count=0,this.id=J7.nuid.next(),this.js=e,this.nc=this.js.nc,this.done=!1}async first(e,t,n){(n=n||{}).headers=n?.headers||(0,J7.headers)(),n.headers.set("Nats-Batch-Id",this.id),this.count++,n.headers.set("Nats-Batch-Sequence",this.count.toString());let r=await this.js._publish(e,t,n);r.data.length>0&&this.js.parseJsResponse(r)}add(e,t,n={ack:!1}){if(this.done)throw Error("batch publisher is done");if(n.headers=n?.headers||(0,J7.headers)(),n.headers.set("Nats-Batch-Id",this.id),this.count++,n.headers.set("Nats-Batch-Sequence",this.count.toString()),!("ack"in n&&!0===n.ack))return this.nc.publish(e,t,{headers:n.headers});{let r=(0,J7.deferred)();return this.js._publish(e,t,{headers:n.headers,timeout:n.timeout}).then(e=>{e.data.length>0&&this.js.parseJsResponse(e),r.resolve()}).catch(e=>{this.done=!0,r.reject(e)}),r}}async commit(e,t,n={}){if(this.done)throw Error("batch publisher is done");this.done=!0,n.headers=n?.headers||(0,J7.headers)(),n.headers.set("Nats-Batch-Id",this.id),this.count++,n.headers.set("Nats-Batch-Sequence",this.count.toString()),n.headers.set("Nats-Batch-Commit","1");let r=(await this.js._publish(e,t,{headers:n.headers,timeout:n.timeout||0})).json();if(r.count!==this.count)throw Error("batch didn't contain number of published messages");return r}}YO.BatchPublisherImpl=X_;let Xx="batch closed";class Xw{batch;nc;batchSubj;gapMode;initialFlow;seq;acked;ackInterval;inboxPrefix;maxOutstandingAcks;defaultTimeout;gapIter;sub;pending;closed;closeErr;startDeferred;closedDeferred;constructor(e,t,n,r){this.nc=e,this.batchSubj=n,this.gapMode=t.allowGaps?"ok":"fail",this.initialFlow=t.ackInterval,this.inboxPrefix=t.inboxPrefix,this.maxOutstandingAcks=t.maxOutstandingAcks,this.defaultTimeout=r,this.batch=J7.nuid.next(),this.seq=0,this.acked=0,this.ackInterval=t.ackInterval,this.pending=new Map,this.closed=!1,this.startDeferred=(0,J7.deferred)(),this.closedDeferred=(0,J7.deferred)(),this.closedDeferred.catch(()=>{}),this.startDeferred.catch(()=>{});let i=`${this.inboxPrefix}.${this.batch}.>`;this.sub=this.nc.subscribe(i,{callback:(e,t)=>this.route(e,t)})}replyFor(e,t){return`${this.inboxPrefix}.${this.batch}.${this.initialFlow}.${this.gapMode}.${t}.${e}.$FI`}start(e,t){this.seq=1;let n=this.replyFor(0,1),r=t?Xm(t):void 0;return this.nc.publish(this.batchSubj,e,{reply:n,headers:r}),this.deadlineOrClose(this.startDeferred,t?.timeout??this.defaultTimeout)}deadlineOrClose(e,t){return(0,J7.deadline)(e,t).catch(e=>{throw this.closed||this.close(e),e})}route(e,t){let n;if(e)return void this.close(e);try{n=(0,YP.parseJsResponse)(t)}catch(e){this.close(e);return}if("batch"in n&&"string"==typeof n.batch){let e=n,r=this.pending.get(t.subject);for(let[,n]of(r&&(2===r.op||3===r.op)&&(r.deferred.resolve(e),this.pending.delete(t.subject)),this.pending))1===n.op||4===n.op?n.deferred.resolve({batchSeq:n.seq,ackSeq:this.acked}):n.deferred.reject(Error(Xx));this.pending.clear(),this.resolveStart(),this.closedDeferred.resolve(e),this.closed=!0,this.gapIter?.stop(),this.sub.unsubscribe();return}if("gap"===n.type){if(this.gapIter){let e=n;this.gapIter.push({lastSeq:e.last_seq,seq:e.seq})}return}let r=n;"number"==typeof r.msgs&&(this.ackInterval=r.msgs),"number"==typeof r.seq&&r.seq>this.acked&&(this.acked=r.seq),this.resolveStart();let i=this.pending.get(t.subject);for(let[e,n]of(i&&(1===i.op||4===i.op)&&(i.deferred.resolve({batchSeq:i.seq,ackSeq:this.acked}),this.pending.delete(t.subject)),this.pending))1===n.op&&n.seq-this.acked<this.ackInterval*this.maxOutstandingAcks&&(n.deferred.resolve({batchSeq:n.seq,ackSeq:this.acked}),this.pending.delete(e))}resolveStart(){this.startDeferred.resolve()}close(e){for(let[,t]of(this.closed=!0,this.closeErr=e,this.pending))t.deferred.reject(e);this.pending.clear(),this.startDeferred.reject(e),this.closedDeferred.reject(e),this.gapIter?.stop(),this.sub.unsubscribe()}add(e,t,n){if(this.closed)return Promise.reject(Error(Xx));let r=++this.seq,i=this.replyFor(1,r),a=n?Xm(n):void 0;if(this.nc.publish(e,t,{reply:i,headers:a}),r-this.acked<this.ackInterval*this.maxOutstandingAcks)return Promise.resolve({batchSeq:r,ackSeq:this.acked});let o=(0,J7.deferred)();return this.pending.set(i,{seq:r,op:1,deferred:o}),this.deadlineOrClose(o,n?.timeout??this.defaultTimeout)}last(e,t,n){if(this.closed)return Promise.reject(Error(Xx));let r=++this.seq,i=this.replyFor(2,r),a=(0,J7.deferred)();this.pending.set(i,{seq:r,op:2,deferred:a});let o=n?Xm(n):void 0;return this.nc.publish(e,t,{reply:i,headers:o}),this.deadlineOrClose(a,n?.timeout??this.defaultTimeout)}end(e){if(this.closed)return Promise.reject(Error(Xx));let t=++this.seq,n=this.replyFor(3,t),r=(0,J7.deferred)();this.pending.set(n,{seq:t,op:3,deferred:r});let i=e?Xm(e):void 0;return this.nc.publish(this.batchSubj,J7.Empty,{reply:n,headers:i}),this.deadlineOrClose(r,e?.timeout??this.defaultTimeout)}ping(e=this.defaultTimeout){if(this.closed)return Promise.reject(Error(Xx));let t=this.replyFor(4,this.seq),n=this.pending.get(t);if(n&&4===n.op)return(0,J7.deadline)(n.deferred,e);let r=(0,J7.deferred)();return this.pending.set(t,{seq:this.seq,op:4,deferred:r}),this.nc.publish(this.batchSubj,J7.Empty,{reply:t}),this.deadlineOrClose(r,e)}done(){return this.closedDeferred}gaps(){return this.gapIter||(this.gapIter=new J7.QueuedIteratorImpl),this.gapIter}}function XS(e){return e instanceof J8.AuthorizationError||e instanceof J8.UserAuthenticationExpiredError||e instanceof Error&&/authorization violation|authentication expired|user authentication expired/i.test(e.message)}function XE(e,t,n){var r;let i=null!=(r=e[t])?r:e[n];return"string"==typeof i?i:void 0}function XA(e,t,n){var r;let i=null!=(r=e[t])?r:e[n];return"number"==typeof i?i:void 0}function XT(e,t,n,r){var i,a,o,s,l;let u,c,d=(u=null!=(a=XE(i=n,"eventType","event_type"))?a:"unknown",c=null!=(o=XE(i,"correlationID","correlation_id"))?o:XE(i,"correlationId","correlation_id"),"progress"===u?{eventType:"progress",jobId:XE(i,"jobId","job_id"),currentStep:XA(i,"currentStep","current_step"),finalStep:XA(i,"finalStep","final_step"),message:"string"==typeof i.message?i.message:void 0,startingTime:XE(i,"startingTime","starting_time"),correlationID:c}:"dialog_text_entered_response"===u?{eventType:"dialog_text_entered_response",requestID:"string"==typeof i.requestID?i.requestID:void 0,resultCode:"number"==typeof i.resultCode?i.resultCode:void 0,resultMessage:"string"==typeof i.resultMessage?i.resultMessage:void 0,currentState:(l=i.currentState)&&"object"==typeof l&&"currentState"in l?l.currentState:l,correlationID:c}:"error"===u?{eventType:"error",errorCode:null!=(s=i.errorCode)?s:i.error_code,errorMessage:XE(i,"errorMessage","error_message"),backtrace:"string"==typeof i.backtrace?i.backtrace:void 0,correlationID:c}:{eventType:u,correlationID:c});console.debug(`[NATS] message #${t} on ${e} (eventType=${d.eventType})`,d),r(d)}async function XI(e,t,n,r){let i=e.subscribe(t);console.info("[NATS] subscribed to subject",t),r();let a=0;for await(let e of i){a+=1;try{XT(t,a,e.json(),n)}catch(e){console.error("[NATS] message decode error",e)}}console.info(`[NATS] subscription on ${t} closed (received ${a} messages)`)}async function XC(e,t,n,r,i,a,o){let s=(0,YM.jetstream)(e),l=t.consumer?await s.consumers.get(t.stream,t.consumer):await s.consumers.get(t.stream,{filter_subjects:[n],deliver_policy:"catch-up"===r?YM.DeliverPolicy.LastPerSubject:YM.DeliverPolicy.New});console.info("[NATS] JetStream consumer ready",t.consumer?{stream:t.stream,consumer:t.consumer,subject:n,mode:r}:{stream:t.stream,subject:n,mode:r});let u=await l.consume();a(u),o();let c=0;for await(let e of u){c+=1;try{XT(n,c,e.json(),i)}catch(e){console.error("[NATS] message decode error",e)}}console.info(`[NATS] JetStream consumer on ${n} closed (received ${c} messages)`)}Object.defineProperty(YN,"jetstream",{enumerable:!0,get:function(){return YO.jetstream}}),Object.defineProperty(YN,"JetStreamClientImpl",{enumerable:!0,get:function(){return YO.JetStreamClientImpl}}),Object.defineProperty(YN,"jetstreamManager",{enumerable:!0,get:function(){return YO.jetstreamManager}}),Object.defineProperty(YN,"startFastIngest",{enumerable:!0,get:function(){return YO.startFastIngest}}),Object.defineProperty(YN,"toJetStreamClient",{enumerable:!0,get:function(){return YO.toJetStreamClient}}),Object.defineProperty(YN,"BaseApiClientImpl",{enumerable:!0,get:function(){return YP.BaseApiClientImpl}}),Object.defineProperty(YN,"DirectMsgImpl",{enumerable:!0,get:function(){return Xd.DirectMsgImpl}}),Object.defineProperty(YN,"AckPolicy",{enumerable:!0,get:function(){return YY.AckPolicy}}),Object.defineProperty(YN,"DeliverPolicy",{enumerable:!0,get:function(){return YY.DeliverPolicy}}),Object.defineProperty(YN,"DiscardPolicy",{enumerable:!0,get:function(){return YY.DiscardPolicy}}),Object.defineProperty(YN,"PersistMode",{enumerable:!0,get:function(){return YY.PersistMode}}),Object.defineProperty(YN,"PubHeaders",{enumerable:!0,get:function(){return YY.PubHeaders}}),Object.defineProperty(YN,"ReplayPolicy",{enumerable:!0,get:function(){return YY.ReplayPolicy}}),Object.defineProperty(YN,"RetentionPolicy",{enumerable:!0,get:function(){return YY.RetentionPolicy}}),Object.defineProperty(YN,"StorageType",{enumerable:!0,get:function(){return YY.StorageType}}),Object.defineProperty(YN,"StoreCompression",{enumerable:!0,get:function(){return YY.StoreCompression}}),Object.defineProperty(YN,"ListerImpl",{enumerable:!0,get:function(){return YW.ListerImpl}}),Object.defineProperty(YN,"isMessageNotFound",{enumerable:!0,get:function(){return Yk.isMessageNotFound}}),Object.defineProperty(YN,"JetStreamApiCodes",{enumerable:!0,get:function(){return Yk.JetStreamApiCodes}}),Object.defineProperty(YN,"JetStreamApiError",{enumerable:!0,get:function(){return Yk.JetStreamApiError}}),Object.defineProperty(YN,"JetStreamError",{enumerable:!0,get:function(){return Yk.JetStreamError}}),Object.defineProperty(YN,"JetStreamStatus",{enumerable:!0,get:function(){return Yk.JetStreamStatus}}),Object.defineProperty(YN,"JetStreamStatusError",{enumerable:!0,get:function(){return Yk.JetStreamStatusError}}),Object.defineProperty(YN,"jserrors",{enumerable:!0,get:function(){return Yk.jserrors}}),Object.defineProperty(YN,"validateStreamName",{enumerable:!0,get:function(){return Y$.validateStreamName}}),Object.defineProperty(YM,"jetstream",{enumerable:!0,get:function(){return YN.jetstream}}),Object.defineProperty(YM,"jetstreamManager",{enumerable:!0,get:function(){return YN.jetstreamManager}}),Object.defineProperty(YM,"AckPolicy",{enumerable:!0,get:function(){return YN.AckPolicy}}),Object.defineProperty(YM,"AdvisoryKind",{enumerable:!0,get:function(){return YN.AdvisoryKind}}),Object.defineProperty(YM,"DeliverPolicy",{enumerable:!0,get:function(){return YN.DeliverPolicy}}),Object.defineProperty(YM,"DirectMsgHeaders",{enumerable:!0,get:function(){return YN.DirectMsgHeaders}}),Object.defineProperty(YM,"DiscardPolicy",{enumerable:!0,get:function(){return YN.DiscardPolicy}}),Object.defineProperty(YM,"isPullConsumer",{enumerable:!0,get:function(){return YN.isPullConsumer}}),Object.defineProperty(YM,"isPushConsumer",{enumerable:!0,get:function(){return YN.isPushConsumer}}),Object.defineProperty(YM,"JetStreamApiCodes",{enumerable:!0,get:function(){return YN.JetStreamApiCodes}}),Object.defineProperty(YM,"JetStreamApiError",{enumerable:!0,get:function(){return YN.JetStreamApiError}}),Object.defineProperty(YM,"JetStreamError",{enumerable:!0,get:function(){return YN.JetStreamError}}),Object.defineProperty(YM,"JsHeaders",{enumerable:!0,get:function(){return YN.JsHeaders}}),Object.defineProperty(YM,"PersistMode",{enumerable:!0,get:function(){return YN.PersistMode}}),Object.defineProperty(YM,"PubHeaders",{enumerable:!0,get:function(){return YN.PubHeaders}}),Object.defineProperty(YM,"ReplayPolicy",{enumerable:!0,get:function(){return YN.ReplayPolicy}}),Object.defineProperty(YM,"RepublishHeaders",{enumerable:!0,get:function(){return YN.RepublishHeaders}}),Object.defineProperty(YM,"RetentionPolicy",{enumerable:!0,get:function(){return YN.RetentionPolicy}}),Object.defineProperty(YM,"StorageType",{enumerable:!0,get:function(){return YN.StorageType}}),Object.defineProperty(YM,"StoreCompression",{enumerable:!0,get:function(){return YN.StoreCompression}});let XM=/session\s+with\s+id\s+["']?[^"']+["']?\s+not\s+found/i;function XN(e){return 404===e||-103===e||-101===e}function XR(e){return!!e&&XM.test(e)}function XO(e){return e?JSON.stringify({state:e.state,previousState:e.previousState,emission:e.emission,emitter:e.emitter,lastMatchedMemoryID:e.lastMatchedMemoryID,currentDate:e.currentDate,currentMemoryID:e.currentMemoryID,contextVars:e.contextVars,emittedMedia:e.emittedMedia}):""}let XP={placeName:null,latitude:null,longitude:null,uncertaintyKm:null},Xk=(e,t)=>{console.error(`[MemoriWidget] ${e}`,null!=t?t:"")};function XL(e){let t=e.correlationID;return"string"==typeof t&&t.length>0?t:void 0}let XD=(e,t=!0,n=!1,r,i=!1,a=!1)=>{let o=new CustomEvent("MemoriTextEntered",{detail:{text:e,waitForPrevious:t,hidden:n,typingText:r,useLoaderTextAsMsg:i,hasBatchQueued:a}});document.dispatchEvent(o),window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&setTimeout(()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak"))},300)};window.getMemoriState=e=>{var t,n,r,i,a;let o=e?document.querySelector(`.memori-widget[data-memori-integration="${e}"]`)||(null==(n=null==(t=document.querySelector("memori-client"))?void 0:t.shadowRoot)?void 0:n.querySelector(".memori-widget[data-memori-integration]")):document.querySelector(".memori-widget")||(null==(i=null==(r=document.querySelector("memori-client"))?void 0:r.shadowRoot)?void 0:i.querySelector(".memori-widget"));if(!o)return null;let s=null==(a=o.dataset)?void 0:a.memoriEngineState;if(!s)return null;let l=JSON.parse(s),u=qP("loginToken",void 0);return{...l,loginToken:u}},window.typeMessage=XD,window.typeMessageHidden=(e,t=!0,n,r=!1,i=!1)=>XD(e,t,!0,n,r,i),window.typeBatchMessages=e=>{function t(){var e,t,n,r;null==(e=document.querySelector("fieldset#chat-fieldset"))||e.setAttribute("disabled","");let i="opacity: 0.5; touch-action: none; pointer-events: none;";null==(t=document.querySelector("textarea.memori-chat-textarea--input"))||t.setAttribute("style",i),null==(n=document.querySelector("button.memori-chat-inputs--send"))||n.setAttribute("style",i),null==(r=document.querySelector("button.memori-chat-inputs--mic"))||r.setAttribute("style",i)}function n(){var e,t,n,r;null==(e=document.querySelector("fieldset#chat-fieldset"))||e.removeAttribute("disabled"),null==(t=document.querySelector("textarea.memori-chat-textarea--input"))||t.removeAttribute("style"),null==(n=document.querySelector("button.memori-chat-inputs--send"))||n.removeAttribute("style"),null==(r=document.querySelector("button.memori-chat-inputs--mic"))||r.removeAttribute("style")}function r(){var e;return!!(null==(e=document.querySelector("fieldset#chat-fieldset"))?void 0:e.hasAttribute("disabled"))}let i=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent),a=function*(){yield*e}();t();let o=()=>{let e=a.next(),s=e.value;if(s){r()||t();let a=s.waitForPrevious;i&&(a=!1),XD(s.message,a,s.hidden,s.typingText,s.useLoaderTextAsMsg,!e.done),i&&setTimeout(()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak")),n()},3e3)}else r()&&n();if(e.done){document.removeEventListener("MemoriEndSpeak",o),r()&&n();return}};document.addEventListener("MemoriEndSpeak",o),o()};var XB=({memori:e,memoriConfigs:t,ownerUserID:n,tenantID:r,memoriLang:i,uiLang:a,spokenLang:o,multilingual:s,integration:l,layout:u,customLayout:c,showShare:h,preview:p=!1,embed:m=!1,showCopyButton:f,showTranslationOriginal:g,showInputs:v=!0,showDates:y=!1,showContextPerLine:_=!1,showMessageConsumption:x,showSettings:w,showTypingText:S,showClear:E,showExperts:A,showLogin:T,showUpload:I,showOnlyLastMessages:C,showChatHistory:M,showReasoning:N,show3dAvatar:R,avatar3dHidden:O,height:P,secret:k,baseUrl:D="https://aisuru-staging.aclambda.online",apiURL:B="https://backend-staging.memori.ai",engineURL:F="https://engine-staging.memori.ai",initialContextVars:U,initialQuestion:j,ttsProvider:z,ogImage:H,sessionID:G,tenant:V,personification:W,authToken:q,enableAudio:$,defaultSpeakerActive:J=!0,disableTextEnteredEvents:K=!1,onStateChange:Y,additionalInfo:X,additionalSettings:Z,customMediaRenderer:Q,userAvatar:ee,__WEBCOMPONENT__:et=!1,useMathFormatting:en=!1,autoStart:er=!1,applyVarsToRoot:ei=!1,showFunctionCache:ea=!1,maxTotalMessagePayload:eo,maxTextareaCharacters:es})=>{var el,eu,ec,ed,ep,ef,eg,ev,ey,eb,e_,ex,ew,eS,eE,eA,eT,eI,eC,eM,eN,eR,eO,eP,ek,eL,eD,eB,eF,eU,ej,ez,eH,eG,eV,eW,eq,e$,eJ,eK,eY,eX,eZ,eQ,e0,e1,e2,e4;let e5,e6,{t:e8,i18n:e7}=tA(),{add:e9,close:te}=vZ(),[tt,tr]=(0,em.useState)(!1);(0,em.useEffect)(()=>{tr(!0)},[]);let ta=e3(B,F),{initSession:to,deleteSession:ts,postEnterTextAsync:tl,postTextEnteredEvent:tu,postPlaceChangedEvent:tc,postDateChangedEvent:td,postTagChangedEvent:th,getSession:tp,getExpertReferences:tm,getSessionChatLogs:tf}=ta,[tg,tv]=(0,em.useState)(!1),[ty,tb]=(0,em.useState)(!0),[t_,tx]=(0,em.useState)(null),[tw,tS]=(0,em.useState)(null),[tE,tI]=(0,em.useState)(null!=(el=null==X?void 0:X.loginToken)?el:q),tC=(0,em.useRef)(null!=(eu=null==X?void 0:X.loginToken)?eu:q),tM=(0,em.useRef)(null!=(ec=null==X?void 0:X.loginToken)?ec:q),[tN,tR]=(0,em.useState)({avatarURL:"string"==typeof ee?ee:void 0}),tO=(0,em.useCallback)(e=>{var t,n,r,i,a;return t=tC.current,n=null==X?void 0:X.loginToken,null!=(a=null!=(i=null!=(r=null!=tE?tE:t)?r:e)?i:n)?a:q},[tE,null==X?void 0:X.loginToken,q]);(0,em.useEffect)(()=>{var e;let t=null!=(e=null==X?void 0:X.loginToken)?e:q,n=tM.current;tM.current=t,t!==n&&(tI(t),tC.current=t,t||(qL("loginToken"),tR(void 0)))},[null==X?void 0:X.loginToken,q]);let tP=(null==l?void 0:l.customData)?JSON.parse(l.customData):null,tk=null!=O?O:null==tP?void 0:tP.avatar_3d_hidden,tL=null!=R?R:void 0!==tk&&!0!==tk&&"true"!==tk,tD=!!(null!=(ed=null!=T?T:null==tP?void 0:tP.showLogin)?ed:e.requireLoginToken);(0,em.useEffect)(()=>{if(!tE||!(tD||e.requireLoginToken))return;let t=!1;return ta.backend.pwlGetCurrentUser(tE).then(({user:e,resultCode:n})=>{t||(e&&0===n?(tR(e),qk("loginToken",tE),tC.current=tE,!n8&&e.birthDate&&(n7(e.birthDate),qk("birthDate",e.birthDate))):(tI(void 0),tC.current=void 0,tR(void 0),qL("loginToken")))}),()=>{t=!0}},[tE,tD,e.requireLoginToken]);let tB=!!tE&&!!(null==tN?void 0:tN.userID),tF=(0,em.useRef)(!1),tU=(0,em.useRef)(!1);eZ=!!e.requireLoginToken,tU.current=!!eZ&&!tB;let[tj,tz]=(0,em.useState)(!1),[tH,tG]=(0,em.useState)(!1),[tV,tW]=(0,em.useState)(!1),tq=(0,em.useRef)(!1),t$=null==V?void 0:V.billingDelegation,[tJ,tK]=(0,em.useState)(!0),[tY,tX]=(0,em.useState)(!1),tZ=!!t$&&(!tJ||tY),tQ=(null==(eg=null==(ef=null==(ep=e.culture)?void 0:ep.split("-"))?void 0:ef[0])?void 0:eg.toUpperCase())||(null==(e_=null==(eb=null==(ey=null==(ev=null==t?void 0:t.find(t=>t.memoriConfigID===e.memoriConfigurationID))?void 0:ev.culture)?void 0:ey.split("-"))?void 0:eb[0])?void 0:e_.toUpperCase()),t0=void 0!==s?s:!!(null==tP?void 0:tP.multilanguage);null==tP||tP.forcedTimeout;let[t1,t2]=(0,em.useState)(null!=(eA=null!=(eE=null!=(eS=null!=(ew=null!=(ex=null!=o?o:i)?ex:null==tP?void 0:tP.lang)?ew:tQ)?eS:null==tP?void 0:tP.uiLang)?eE:e7.language)?eA:"IT");(0,em.useEffect)(()=>{null!=o&&t2(o)},[o]);let t3=void 0!==en?en:!!(null==tP?void 0:tP.useMathFormatting);(0,em.useEffect)(()=>{t3&&Ln()},[t3]),(0,em.useEffect)(()=>{let e=a&&kH.includes(a.toLowerCase())?a.toLowerCase():t1&&kH.includes(t1.toLowerCase())?t1.toLowerCase():null;e&&"function"==typeof(null==e7?void 0:e7.changeLanguage)&&e7.changeLanguage(e)},[a,t1]);let[t4,t5]=(0,em.useState)(!1),[t6,t8]=(0,em.useState)(!1),[t7,t9]=(0,em.useState)(),ne=(0,em.useRef)(new Map),nt=(0,em.useRef)(new Map),nn="string"==typeof u?u:u&&"object"==typeof u&&null!==u&&"name"in u&&"string"==typeof u.name?u.name:"string"==typeof(null==tP?void 0:tP.layout)?tP.layout:null==(eT=null==tP?void 0:tP.layout)?void 0:eT.name,nr=(()=>{if("string"==typeof nn){let e=nn.toLowerCase();return"fullpage"===e||"fullscreen"===e||"2"===e?"FULLPAGE":"totem"===e?"TOTEM":"chat"===e?"CHAT":"website_assistant"===e?"WEBSITE_ASSISTANT":"hidden_chat"===e?"HIDDEN_CHAT":"zoomed_full_body"===e?"ZOOMED_FULL_BODY":"default"===e?"DEFAULT":nn}return"FULLPAGE"})(),ni=u&&"object"==typeof u&&null!==u&&"piiDetection"in u&&(null==(eI=u.piiDetection)?void 0:eI.enabled)?u.piiDetection:"object"==typeof(null==tP?void 0:tP.layout)&&(null==tP?void 0:tP.layout)!==null&&(null==(eM=null==(eC=null==tP?void 0:tP.layout)?void 0:eC.piiDetection)?void 0:eM.enabled)?tP.layout.piiDetection:void 0,na=null==(eN=null!=$?$:null==tP?void 0:tP.enableAudio)||eN,[no,ns]=(0,em.useState)(!1),[nl,nu]=(0,em.useState)(!1),[nc,nd]=(0,em.useState)(!1),[nh,np]=(0,em.useState)(!1),[nm,nf]=(0,em.useState)(!1),[ng,nv]=(0,em.useState)(!1);(0,em.useEffect)(()=>{tE||nv(!1)},[tE]);let[ny,nb]=(0,em.useState)(!1),[n_,nx]=(0,em.useState)(!1),[nw,nS]=(0,em.useState)(!1),[nE,nA]=(0,em.useState)(2),[nT,nI]=(0,em.useState)("center"),[nC,nM]=(0,em.useState)(!1),[nN,nR]=(0,em.useState)(null),[nO,nP]=(0,em.useState)(!1),nk=(0,em.useRef)(null),[nL,nD]=(0,em.useState)(!1);(0,em.useEffect)(()=>{nD(!!nk.current)},[nk.current]),(0,em.useEffect)(()=>{var e;let t="bottom",n=qP("microphoneMode","HOLD_TO_TALK");window.innerWidth<=768?(t="bottom",n="HOLD_TO_TALK"):t=window.matchMedia("(orientation: portrait)").matches||window.innerHeight>window.innerWidth?"center":"bottom",nS(!rT&&"CONTINUOUS"===n),nA(qP("continuousSpeechTimeout",2)),nI(qP("controlsPosition",t)),nR(qP("avatarType","avatar3d")),nP(qP("hideEmissions",!1)),(null==X?void 0:X.loginToken)||q||(tI(qP("loginToken",void 0)),tC.current=qP("loginToken",void 0),n7(qP("birthDate",void 0))),null==(e=null!=$?$:null==tP?void 0:tP.enableAudio)||e||qk("muteSpeaker",!0)},[]),(0,em.useEffect)(()=>{var e;null==(e=null!=$?$:null==tP?void 0:tP.enableAudio)||e||qk("muteSpeaker",!0)},[$,null==tP?void 0:tP.enableAudio]);let[nB,nF]=(0,em.useState)(k),[nU,nj]=(0,em.useState)(),[nz,nH]=(0,em.useState)(null),[nG,nV]=(0,em.useState)(),nW=(0,em.useCallback)(e=>{var t,n;if(!e)return!1;let r=0===Number(e.latitude)&&0===Number(e.longitude),i=!(null==(t=e.placeName)?void 0:t.trim()),a="Position"===e.placeName,o=0===Number(null!=(n=e.uncertainty)?n:0);return!r||!i&&!a||!o},[]),nq=(0,em.useCallback)(e=>{if(!e)return;let t={};return null!=e.latitude&&null!=e.longitude?(t.latitude=e.latitude,t.longitude=e.longitude,e.placeName&&(t.placeName=e.placeName),null!=e.uncertainty&&e.uncertainty>0&&(t.uncertaintyKm=e.uncertainty)):e.placeName&&(t.placeName=e.placeName),Object.keys(t).length>0?t:void 0},[]),n$=(0,em.useCallback)(t=>{if(e.needsPosition)return nW(t)?nq(t):XP},[e.needsPosition,nW,nq]),nJ=t=>{nV(t),t&&e.needsPosition?qk("position",JSON.stringify(t)):t||qL("position")};(0,em.useEffect)(()=>{if(e.needsPosition){let e=qP("position",void 0);e&&nV(e)}},[e.needsPosition]);let[nK,nY]=(0,em.useState)(""),[nX,nZ]=(0,em.useState)(!1),[nQ,n0]=(0,em.useState)([]),n1=e=>{n0(t=>{var n,r;return[...t,{...e,media:null!=(r=null==(n=e.media)?void 0:n.filter(e=>{var t;return!("text/javascript"===e.mimeType&&(null==(t=e.properties)?void 0:t.executable))}))?r:[]}]})},[n2,n3]=(0,em.useState)(void 0),n4=async(t,n,r,i=!0,a,o=!1,s,l=!1,u=!1,c=!1)=>{var d,h;if(tU.current)return;let p=r||rt||(null==(d=window.getMemoriState())?void 0:d.sessionID);if(!p||!(null==t?void 0:t.length))return;let m=t;!o&&i&&t0&&t1.toUpperCase()!==tQ.toUpperCase()&&(m=(await GP(t,tQ,t1,D)).text);let f=null==n?void 0:n.filter(e=>{var t;return"document"===e.type&&(null==(t=e.properties)?void 0:t.isAttachedFile)});if(f&&f.length>0&&(m=m+" "+f.map(e=>e.content).join(" ")),null==ni?void 0:ni.enabled){let e=function(e,t,n){if(!(null==t?void 0:t.enabled)||!Array.isArray(t.rules)||0===t.rules.length)return{matched:!1};let r=(null==n?void 0:n.toLowerCase())||"en",i=new Map;for(let n of t.rules)if(n.pattern&&n.pattern.trim())try{new RegExp(n.pattern).test(e)&&!i.has(n.id)&&i.set(n.id,n)}catch(e){console.warn("[PII] Invalid regex for rule:",n.id,n.pattern,e)}return 0===i.size?{matched:!1}:{matched:!0,errorText:[ti(t.errorMessage,r,"The message contains personal or sensitive data."),...Array.from(i.values()).map(e=>{let t=ti(e.label,r,e.id);return ti(e.message,r,t)})].join("\n")}}(m,ni,(null==t1?void 0:t1.toLowerCase())||"en");if(e.matched&&e.errorText){o||n1({text:t,translatedText:a,fromUser:!0,media:null!=n?n:[],initial:rt?!!r&&r!==rt:!!r}),n1({text:e.errorText,emitter:"system",fromUser:!1,initial:!1,contextVars:{},date:new Date().toISOString()});return}}o||c||n1({text:t,translatedText:a,fromUser:!0,media:null!=n?n:[],initial:rt?!!r&&r!==rt:!!r});try{let r=n$(nG),c=await tl({sessionId:p,text:m,...e.needsDateTime&&{dateUTC:null!=(h=i5.utc().toISO())?h:void 0},...void 0!==r&&{place:r}}),d=XL(c);if(0===c.resultCode&&d)rW(d,{msg:m,stateBeforeRequest:rs.current,text:t,media:n,translate:i,translatedText:a,hidden:o,typingText:s,useLoaderTextAsMsg:l,hasBatchQueued:u}),t8(!0),t9(s);else if(0===c.resultCode)Xk("enter-text missing correlationID",c);else if(404===c.resultCode)rd.current({text:t,media:n,translate:i,translatedText:a,hidden:o,typingText:s,useLoaderTextAsMsg:l,hasBatchQueued:u,expiredSessionID:p,continueFromChatLogID:n2});else{if(500!==c.resultCode||!c.resultMessage)return Promise.reject(c);n0(e=>[...e,{text:"Error: "+c.resultMessage,emitter:"system",fromUser:!1,initial:!1,contextVars:{},date:new Date().toISOString()}])}}catch(e){Xk("sendMessage failed",e),t9(void 0),t8(!1)}},n5=async(e,t,n,r=!1,i=e)=>{var a,o,s,l,u,c;let d=null!=(a=null==e?void 0:e.emission)?a:null==ra?void 0:ra.emission,h={...e},p=null;if(d&&tQ.toUpperCase()!==t.toUpperCase()&&t0&&!r)try{let r=await GP(d,t,tQ,D);if(e.hints&&e.hints.length>0){let n=await Promise.all((null!=(s=e.hints)?s:[]).map(async e=>{var n;let r=await GP(e,t,tQ,D);return{text:null!=(n=null==r?void 0:r.text)?n:e,originalText:e}}));h={...e,emission:r.text,translatedHints:n}}else h={...e,emission:d,translatedEmission:r.text,hints:null!=(l=e.hints)?l:"G1"===e.state?null==ra?void 0:ra.hints:[]};r.text.length>0&&(p={text:d,translatedText:r.text,emitter:e.emitter,media:null!=(u=e.emittedMedia)?u:e.media,llmUsage:e.llmUsage,fromUser:!1,questionAnswered:n,generatedByAI:!!e.completion,contextVars:e.contextVars,date:e.currentDate,placeName:e.currentPlaceName,placeLatitude:e.currentLatitude,placeLongitude:e.currentLongitude,placeUncertaintyKm:e.currentUncertaintyKm,tag:e.currentTag,memoryTags:e.memoryTags})}catch(t){h={...e,emission:d},p={text:d,emitter:e.emitter,media:null!=(c=e.emittedMedia)?c:e.media,llmUsage:e.llmUsage,fromUser:!1,questionAnswered:n,contextVars:e.contextVars,date:e.currentDate,placeName:e.currentPlaceName,placeLatitude:e.currentLatitude,placeLongitude:e.currentLongitude,placeUncertaintyKm:e.currentUncertaintyKm,tag:e.currentTag,memoryTags:e.memoryTags}}else h={...e,emission:d},d&&(p={text:d,emitter:e.emitter,media:null!=(o=e.emittedMedia)?o:e.media,llmUsage:e.llmUsage,fromUser:!1,questionAnswered:n,contextVars:e.contextVars,date:e.currentDate,placeName:e.currentPlaceName,placeLatitude:e.currentLatitude,placeLongitude:e.currentLongitude,placeUncertaintyKm:e.currentUncertaintyKm,tag:e.currentTag,memoryTags:e.memoryTags});return rl(h,i),!r&&p&&n1(p),h},n6=void 0!==e.ageRestriction?e.ageRestriction:e.nsfw?18:14*!!e.enableCompletions,[n8,n7]=(0,em.useState)(),[n9,re]=(0,em.useState)(!1),[rt,rn]=(0,em.useState)(G),rr=(0,em.useRef)(G),ri=e=>{rr.current=e,rn(e)},[ra,ro]=(0,em.useState)(),rs=(0,em.useRef)(""),rl=(e,t=e)=>{var n,r;rs.current=XO(t),ro(e),Y&&Y(e);let i=new CustomEvent("MemoriNewDialogState",{detail:e});document.dispatchEvent(i);let a=null==(r=null!=(n=null==e?void 0:e.emittedMedia)?n:null==e?void 0:e.media)?void 0:r.filter(e=>{var t;return"text/javascript"===e.mimeType&&!!(null==(t=e.properties)?void 0:t.executable)});null==a||a.forEach(e=>{try{setTimeout(()=>{var t;Function(null!=(t=e.content)?t:"")(),setTimeout(()=>{var e,t,n;null==(e=document.querySelector(".memori-chat--content"))||e.scrollTo(0,null!=(n=null==(t=document.querySelector(".memori-chat--content"))?void 0:t.scrollHeight)?n:0)},400)},1e3)}catch(e){}})};(0,em.useEffect)(()=>{G&&(ri(G),ia(void 0,!1,void 0,G))},[G]);let ru=async t=>{var n,r,i,a,o,s,l,u,c;let d=qP("birthDate",void 0),h=null!=(n=null!=n8?n8:t.birthDate)?n:d;if(!h&&n6)return void re(!0);if("PUBLIC"!==e.privacyType&&!t.password&&!e.secretToken&&!nB&&!(null==(r=t.recoveryTokens)?void 0:r.length)&&!nU)return void nH("password");if(await i_({notify:!0})){t5(!0);try{let n;try{n=window.location.href}catch(e){}let r=await to({...t,birthDate:h,tag:null!=(i=t.tag)?i:null==W?void 0:W.tag,pin:null!=(a=t.pin)?a:null==W?void 0:W.pin,additionalInfo:{...t.additionalInfo||X||{},loginToken:tO(null==(o=t.additionalInfo)?void 0:o.loginToken),language:(null!=(u=null!=t1?t1:null==(l=null==(s=e.culture)?void 0:s.split("-"))?void 0:l[0])?u:"IT").toLowerCase(),referral:n,timeZoneOffset:new Date().getTimezoneOffset().toString()}});if((null==r?void 0:r.sessionID)&&(null==r?void 0:r.currentState)&&0===r.resultCode)return ri(r.sessionID),(null==ra?void 0:ra.currentTag)&&e.giverTag?tv((null==ra?void 0:ra.currentTag)===e.giverTag):tv(!1),t5(!1),{dialogState:r.currentState,sessionID:r.sessionID};if(/aged? ?-?restricted/i.test(null!=(c=null==r?void 0:r.resultMessage)?c:""))console.warn(r),e9(v9({description:e8("underageTwinSession",{age:n6}),severity:"error"})),tW(!0);else{if((null==r?void 0:r.resultCode)===403&&"PUBLIC"!==e.privacyType)return nF(void 0),nH("password"),r;console.warn(r);let t=e9(v9({description:(0,eh.jsxs)("div",{children:[(0,eh.jsx)("p",{children:e8(Lx(null==r?void 0:r.resultCode))}),(0,eh.jsx)(yt,{variant:"outline",onClick:()=>te(t),"aria-label":String(e8("close",{defaultValue:"Close"})),icon:(0,eh.jsx)(H2,{"aria-hidden":!0})})]}),severity:"error",duration:0}));return r}}catch(e){Xk("fetchSession failed",e)}}},rc=async(t=!1,n,r,i,a,o,s,l,u,c,d,h,p)=>{var m,f,g,v,y,b,_,x;t5(!0);let w=qP("birthDate",void 0),S=null!=l?l:w;try{let l;if(!S&&n6){re(!0),t5(!1);return}if("PUBLIC"!==e.privacyType&&!n&&!e.secretToken&&!nB&&!(null==r?void 0:r.length)&&!nU){nH("password"),t5(!1);return}if(!await i_({notify:!0}))return t5(!1),null;try{l=window.location.href}catch(e){}let{sessionID:w,currentState:E,...A}=await to({memoriID:null!=(m=e.engineMemoriID)?m:"",password:n||nB||e.secretToken,recoveryTokens:r||nU,tag:null!=i?i:null==W?void 0:W.tag,pin:null!=a?a:null==W?void 0:W.pin,continueFromChatLogID:c,continueFromSessionID:d,initialContextVars:{LANG:t1,PATHNAME:window.location.pathname,ROUTE:(null==(g=null==(f=window.location.pathname)?void 0:f.split("/"))?void 0:g.pop())||"",...o||{}},initialQuestion:s,birthDate:S,additionalInfo:{...u||X||{},loginToken:tO(null==u?void 0:u.loginToken),language:(null!=(b=null!=t1?t1:null==(y=null==(v=e.culture)?void 0:v.split("-"))?void 0:y[0])?b:"IT").toLowerCase(),referral:l,timeZoneOffset:new Date().getTimezoneOffset().toString()}});if(w&&E&&0===A.resultCode){if(ri(w),t){rl(E);let e=h&&nQ.length>1?e8("sessionExpiredReopening"):null;if(e&&p&&n1({text:"",emitter:"system",fromUser:!1,initial:e,contextVars:{},date:new Date().toISOString()}),E.emission&&!p){let t=e||nQ.length<=1||void 0;nQ.length<=1?n0([{text:E.emission,emitter:E.emitter,media:null!=(_=E.emittedMedia)?_:E.media,fromUser:!1,initial:!0===t||t||void 0,contextVars:E.contextVars,date:E.currentDate,placeName:E.currentPlaceName,placeLatitude:E.currentLatitude,placeLongitude:E.currentLongitude,placeUncertaintyKm:E.currentUncertaintyKm,tag:E.currentTag,memoryTags:E.memoryTags}]):n1({text:E.emission,emitter:E.emitter,media:null!=(x=E.emittedMedia)?x:E.media,fromUser:!1,initial:!0===t||t||void 0,contextVars:E.contextVars,date:E.currentDate,placeName:E.currentPlaceName,placeLatitude:E.currentLatitude,placeLongitude:E.currentLongitude,placeUncertaintyKm:E.currentUncertaintyKm,tag:E.currentTag,memoryTags:E.memoryTags})}}return t5(!1),{dialogState:E,sessionID:w}}(null==A?void 0:A.resultMessage.startsWith("This Memori is aged restricted"))?(console.error("[REOPEN_SESSION] Age restriction error:",A),e9(v9({description:e8("underageTwinSession",{age:n6}),severity:"error"})),tW(!0)):(null==A?void 0:A.resultCode)===403&&"PUBLIC"!==e.privacyType?(nF(void 0),nH("password")):(console.error("[REOPEN_SESSION] Other error:",A),e9(v9({description:e8(Lx(A.resultCode)),severity:"error"})),tW(!0))}catch(e){Xk("reopenSession failed",e)}return t5(!1),null},rd=(0,em.useRef)(()=>Promise.resolve(null));rd.current=t=>{let{text:n,media:r,translate:i=!0,translatedText:a,hidden:o=!1,typingText:s,useLoaderTextAsMsg:l=!1,hasBatchQueued:u=!1,expiredSessionID:c,continueFromChatLogID:d}=t,h=null!=c?c:rt,p=null!=d?d:n2,m=()=>{var t,n;return rc(!0,nB||e.secretToken,nU,void 0,void 0,{LANG:t1,PATHNAME:window.location.pathname,ROUTE:(null==(n=null==(t=window.location.pathname)?void 0:t.split("/"))?void 0:n.pop())||"",...U||{}},j,void 0,void 0,p,h,!0,!0)},f=e=>{t8(!1),t9(void 0),null===e&&n&&!o&&e9(v9({description:e8("errors.SESSION_EXPIRED"),severity:"error"}))};return n?m().then(e=>{if(null==e?void 0:e.sessionID){var t;t=e.sessionID,setTimeout(()=>{n4(n,r,t,i,a,o,s,l,u,!0)},500)}else f(e);return e}):m().then(e=>((null==e?void 0:e.sessionID)||f(e),e))};let rh=async(t,n,r,i)=>{var a,o,s,l,u,c,d;if(!t||!n)return Promise.reject("Session not found");try{let{currentState:t,resultCode:h}=await th(n,null!=r?r:kK);if(0===h){let p=0;if(r!==kK&&i&&("X1a"===t.state||"X1b"===t.state)){let t=n$(nG),{resultCode:r}=await tu({sessionId:n,text:null!=i?i:"",...e.needsDateTime&&{dateUTC:null!=(a=i5.utc().toISO())?a:void 0},...void 0!==t&&{place:t}});p=r}if(0===p){let{currentState:e,...t}=await tp(n);if(0===t.resultCode&&e)return{currentState:e,sessionId:n,...t}}else if([400,401,403,404,500].includes(h)){let t,n=qP("birthDate",void 0);try{t=window.location.href}catch(e){}ru({memoriID:null!=(o=e.engineMemoriID)?o:"",password:k||nB||e.secretToken,tag:null!=r?r:null==W?void 0:W.tag,pin:null!=i?i:null==W?void 0:W.pin,initialContextVars:{LANG:t1,PATHNAME:window.location.pathname,ROUTE:(null==(l=null==(s=window.location.pathname)?void 0:s.split("/"))?void 0:l.pop())||"",...U||{}},initialQuestion:j,birthDate:n8||n||void 0,additionalInfo:{...X||{},loginToken:tO(),language:(null!=(d=null!=t1?t1:null==(c=null==(u=e.culture)?void 0:u.split("-"))?void 0:c[0])?d:"IT").toLowerCase(),referral:t,timeZoneOffset:new Date().getTimezoneOffset().toString()}})}else if(t)return{currentState:t,sessionId:n,resultCode:h}}}catch(e){return Promise.reject(e)}return null},[rp,rm]=(0,em.useState)(),rf=(0,em.useRef)(),rg=()=>{rp&&(clearTimeout(rp),rm(void 0)),(null==rf?void 0:rf.current)&&(clearTimeout(rf.current),rf.current=void 0)};(0,em.useEffect)(()=>()=>{rM(!1),tG(!1),tq.current=!1,rg(),rf.current=void 0},[]);let[rv,ry]=(0,em.useState)(!1);(0,em.useRef)(null);let rb=(0,em.useMemo)(()=>{var t,n;return{provider:z,voice:function(e,t="azure",n="FEMALE"){let r=(e||"EN").toUpperCase();if("openai"===t.toLowerCase())return(JD[r]||JD.DEFAULT)[n]||JD.DEFAULT[n]||"alloy";{let e=Jk[r]||JL;return e[n]||e.FEMALE||JL.FEMALE}}(t1||(null==(n=null==(t=e.culture)?void 0:t.split("-"))?void 0:n[0])||"EN",z,e.voiceType),tenant:r,sessionId:rt,sessionIdRef:rr,region:"westeurope",voiceType:e.voiceType,layout:nr}},[z,t1,e.culture,e.voiceType,nr,r,rt,rr]),r_=(0,em.useMemo)(()=>({provider:z,language:(t=>{var n,r;let i="";switch((t||(null==(r=null==(n=e.culture)?void 0:n.split("-"))?void 0:r[0])||e7.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";break;case"EL":i="el-GR";break;case"AR":i="ar-SA";break;case"ZH":i="zh-CN";break;case"JA":i="ja-JP"}return i})(t1),tenant:r,sessionId:rt,sessionIdRef:rr}),[z,t1,r,rt,rr]),rx=(0,em.useCallback)(e=>{let t=function(e){if(e instanceof Jj&&e.code)return JV[e.code]}(e);e9(v9({description:t?e8(t):e.message,severity:e instanceof Jj&&"rate_limited"===e.code?"warning":"error"}))},[e9,e8]),rw=null==(eR=null!=J?J:null==tP?void 0:tP.defaultSpeakerActive)||eR,{speak:rS,stop:rE,isPlaying:rA,speakerMuted:rT,toggleMute:rI,hasUserActivatedSpeak:rC,setHasUserActivatedSpeak:rM}=function(e,t={},n=!1,r=!0,i=!0){let a=!r||!i||n,[o,s]=(0,em.useState)(!1),[l,u]=(0,em.useState)(()=>!r||qP("muteSpeaker",a)),{addViseme:c,resetVisemeQueue:d,startProcessing:h,stopProcessing:p}=q9(),[m,f]=(0,em.useState)(!1),g=e=>JB({text:e,preview:t.preview,defaultEnableAudio:r,defaultSpeakerActive:i,autoStart:n,speakerMuted:l,storedMute:qP("muteSpeaker",a)}),v=(0,em.useRef)(null),y=(0,em.useRef)(null),b=(0,em.useRef)(null),_=(0,em.useRef)(!1),x=(0,em.useRef)(!1),w=(0,em.useRef)(null),S=(0,em.useRef)(!0),E=(0,em.useRef)(null),A=t.apiUrl||"/api/tts",T=(0,em.useRef)(t.onError);T.current=t.onError;let I=(0,em.useCallback)(e=>(d(),_.current=!1,!!e&&e.length>0&&(e.forEach(e=>{c(e.visemeId,e.audioOffset)}),_.current=!0,!0)),[c,d]),C=(0,em.useCallback)(()=>{if(!v.current)return null;let e={state:"running",onstatechange:null,get currentTime(){return v.current?v.current.currentTime:0}},t=()=>{e.state="suspended",e.onstatechange&&e.onstatechange.call(null,new Event("statechange"))},n=()=>{e.state="running",e.onstatechange&&e.onstatechange.call(null,new Event("statechange"))},r=()=>{e.state="closed",e.onstatechange&&e.onstatechange.call(null,new Event("statechange"))};return v.current.addEventListener("pause",t),v.current.addEventListener("play",n),v.current.addEventListener("ended",r),e.cleanup=()=>{v.current&&(v.current.removeEventListener("pause",t),v.current.removeEventListener("play",n),v.current.removeEventListener("ended",r))},e},[]),M=(0,em.useCallback)(()=>{var e;w.current&&(clearTimeout(w.current),w.current=null),y.current&&y.current.cleanup&&y.current.cleanup(),y.current=null,p(),d(),(null==(e=v.current)?void 0:e.src)&&(URL.revokeObjectURL(v.current.src),v.current=null),E.current&&(E.current=null),_.current=!1},[p,d]),N=(0,em.useCallback)(()=>{v.current&&(v.current.pause(),v.current.currentTime=0),E.current&&(E.current.pause(),E.current.currentTime=0,E.current=null),s(!1),M(),x.current=!1;let e=new CustomEvent("MemoriAudioEnded");document.dispatchEvent(e)},[M]),R=(0,em.useCallback)(()=>{let e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e),t.continuousSpeech&&t.onEndSpeakStartListen&&t.onEndSpeakStartListen()},[t.continuousSpeech,t.onEndSpeakStartListen]),O=(0,em.useCallback)((e,t=800)=>{if(e.length<=t)return[e];let n=e.split(/[.!?]+/).filter(e=>e.trim().length>0),r=[],i="";for(let e of n){let n=e.trim()+".";(i+n).length>t&&i.length>0?(r.push(i.trim()),i=n):i+=n+" "}return i.trim().length>0&&r.push(i.trim()),r},[]),P=(0,em.useCallback)(async t=>{let n=Jz(e),r=JH(A,e.tenant),i=await fetch(A,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:t,...r?{tenant:r}:{},sessionId:n,voice:e.voice,model:e.model||"tts-1",region:e.region,provider:e.provider,includeVisemes:"ZOOMED_FULL_BODY"===e.layout||"FULLPAGE"===e.layout||"DEFAULT"===e.layout||"TOTEM"===e.layout})});if(!i.ok)throw await JG(i);let a=await i.blob(),o=URL.createObjectURL(a);if(!g(t)||!x.current||!S.current)return void URL.revokeObjectURL(o);let s=!1,l=i.headers.get("X-Viseme-Data");if(l)try{let e=JSON.parse(l);s=I(e)}catch(e){console.error("[useTTS] Error parsing viseme data:",e)}if(!x.current||!S.current)return void URL.revokeObjectURL(o);let u=new Audio;return u.preload="auto",u.src=o,v.current=u,E.current=u,y.current&&y.current.cleanup&&(y.current.cleanup(),y.current=null),s&&(y.current=C()),new Promise((e,t)=>{var n;if(!v.current)return void t(Error("Audio element not found"));let r=async()=>{var n,r;try{if(!x.current||!S.current){URL.revokeObjectURL(o),e();return}try{s&&y.current&&h(y.current),await (null==(n=v.current)?void 0:n.play())}catch(e){await new Promise(e=>setTimeout(e,100)),s&&y.current&&h(y.current),await (null==(r=v.current)?void 0:r.play())}}catch(e){URL.revokeObjectURL(o),t(e)}};v.current.addEventListener("canplaythrough",r,{once:!0}),v.current.onended=()=>{URL.revokeObjectURL(o),E.current===u&&(E.current=null),e()},v.current.onerror=()=>{URL.revokeObjectURL(o),E.current===u&&(E.current=null),t(Error("Audio playback failed"))},null==(n=v.current)||n.load()})},[e,t,A,I,C,h,x,S,l,r,i,n]),k=(0,em.useCallback)(async e=>{var t;if(S.current){if(!g(e)){m||f(!0),R();return}if(o&&N(),!x.current){x.current=!0,m||f(!0);try{s(!0);let t=O(e,500);for(let e=0;e<t.length&&x.current&&S.current;e++)await P(t[e]),e<t.length-1&&x.current&&S.current&&await new Promise(e=>setTimeout(e,300));s(!1),x.current=!1,R();let n=new CustomEvent("MemoriAudioEnded");document.dispatchEvent(n)}catch(n){console.error("[speak] Error during playback:",n),null==(t=T.current)||t.call(T,n instanceof Error?n:Error(String(n))),s(!1),x.current=!1,w.current&&(clearTimeout(w.current),w.current=null),M(),R();let e=new CustomEvent("MemoriAudioEnded");document.dispatchEvent(e)}}}},[e,l,t.preview,m,N,M,O,P,R,o,r,i,n]),D=(0,em.useCallback)(e=>{let t=void 0!==e?e:!l;u(t),qk("muteSpeaker",t),t&&o&&N()},[l,o,N,d,p]);return(0,em.useEffect)(()=>{"u">typeof window&&(window.memoriSpeaking=o)},[o]),(0,em.useEffect)(()=>{if("u">typeof window)return b.current=window.speak,window.speak=k,()=>{window.speak=b.current}},[k]),(0,em.useEffect)(()=>()=>{x.current=!1,S.current=!1,N()},[N]),{speak:k,stop:N,isPlaying:o,speakerMuted:l,toggleMute:D,hasUserActivatedSpeak:m,setHasUserActivatedSpeak:f}}(rb,{apiUrl:`${D}/api/tts`,continuousSpeech:nw,preview:p,onError:rx},er,na,rw),rN=!na||!rw||er,rR=e=>JB({text:e,preview:p,defaultEnableAudio:na,defaultSpeakerActive:rw,autoStart:er,speakerMuted:rT,storedMute:qP("muteSpeaker",rN)}),rO=(0,em.useRef)(null),rP=(0,em.useRef)(v);rP.current=v;let{isListening:rk,audioStream:rL,recordingState:rD,startRecording:rB,stopRecording:rF}=function(e,t,n={},r=!0){let[i,a]=(0,em.useState)("idle"),[o,s]=(0,em.useState)(qP("muteMicrophone",!r)),[l,u]=(0,em.useState)(!1),[c,d]=(0,em.useState)(null),[h,p]=(0,em.useState)(!1),[m,f]=(0,em.useState)(null),g=(0,em.useRef)(null),v=(0,em.useRef)(null),y=(0,em.useRef)([]),b=(0,em.useRef)(!1),_=(0,em.useRef)(!0),x=n.apiUrl||"/api/stt",w=(0,em.useRef)(n.onError);w.current=n.onError;let S=(0,em.useCallback)(async()=>{try{if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw Error("Media recording is not supported in this browser");let r=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,sampleRate:16e3}});v.current=r,f(r);let i="";for(let e of["audio/mp4","audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/wav"])if(MediaRecorder.isTypeSupported(e)){i=e;break}let o=new MediaRecorder(r,i?{mimeType:i}:{});return o.ondataavailable=e=>{e.data.size>0&&y.current.push(e.data)},o.onstop=async()=>{a("processing"),p(!1);try{if(0===y.current.length)throw Error("No audio data recorded");let r=new Blob(y.current,{type:o.mimeType});if(0===r.size)throw Error("Recorded audio is empty");if("azure"===e.provider)try{r=await J4(r)}catch(e){throw Error("Failed to convert audio to WAV format for Azure")}let i=await E(r);i.text&&i.text.trim().length>0&&(t&&t(i.text),d(i),n.onTranscriptionComplete&&n.onTranscriptionComplete(i)),a("idle")}catch(t){let e=t instanceof Error?t:Error(String(t));a("error"),w.current&&w.current(e)}finally{y.current=[],b.current=!1}},o.onerror=()=>{let e=Error("Recording failed");a("error"),b.current=!1,w.current&&w.current(e)},g.current=o,!0}catch(t){let e=t instanceof Error?t:Error("Failed to access microphone");return a("error"),w.current&&w.current(e),!1}},[e.provider,n]),E=(0,em.useCallback)(async t=>{var n;let r=Jz(e),i=JH(x,e.tenant),a=new FormData,o="webm";"azure"===e.provider?o="wav":(null==(n=g.current)?void 0:n.mimeType)&&(g.current.mimeType.includes("webm")?o="webm":g.current.mimeType.includes("mp4")?o="mp4":g.current.mimeType.includes("ogg")&&(o="ogg")),a.append("audio",t,`recording.${o}`),a.append("provider",e.provider),a.append("sessionId",r),i&&a.append("tenant",i),e.language&&a.append("language",e.language),e.model&&a.append("model",e.model),e.region&&a.append("region",e.region);let s=await fetch(x,{method:"POST",body:a});if(!s.ok)throw await JG(s);let l=await s.json();if(!l.success||!l.result)throw Error("Invalid response from transcription service");return l.result},[e,x]),A=(0,em.useCallback)(async()=>{if(o)return!1;if("recording"===i)return!0;l||u(!0);try{if(a("recording"),!g.current&&!await S())return!1;return y.current=[],b.current=!0,g.current&&"inactive"===g.current.state&&(g.current.start(),p(!0)),!0}catch(t){let e=t instanceof Error?t:Error("Failed to start recording");return a("error"),b.current=!1,w.current&&w.current(e),!1}},[o,i,l,S,n]),T=(0,em.useCallback)(()=>{if(b.current)try{p(!1),g.current&&"recording"===g.current.state&&g.current.stop()}catch(t){let e=t instanceof Error?t:Error("Failed to stop recording");a("error"),b.current=!1,w.current&&w.current(e)}},[i,n]),I=(0,em.useCallback)(async()=>{"recording"===i?T():"idle"===i&&await A()},[i,A,T]),C=(0,em.useCallback)(e=>{let t=void 0!==e?e:!o;s(t),t&&"recording"===i&&T()},[o,i,T]),M=(0,em.useCallback)(()=>{b.current=!1,g.current&&("recording"===g.current.state&&g.current.stop(),g.current=null),v.current&&(v.current.getTracks().forEach(e=>e.stop()),v.current=null),f(null),y.current=[],p(!1),a("idle")},[]);return(0,em.useEffect)(()=>()=>{_.current=!1,M()},[M]),(0,em.useEffect)(()=>{"u">typeof window&&(window.memoriListening=h)},[h]),{recordingState:i,microphoneMuted:o,hasUserActivatedRecord:l,lastTranscription:c,isListening:h,audioStream:m,startRecording:A,stopRecording:T,toggleRecording:I,toggleMute:C,transcribeAudio:E,setHasUserActivatedRecord:u,cleanup:M}}(r_,e=>{if(e&&0!==e.trim().length)try{let t=e.slice(0,e.length/2).trim().toLowerCase()===e.slice(e.length/2+1).trim().toLowerCase()?e.slice(0,e.length/2):e,n=rO.current;rO.current=null,n?t.length>0&&n(t):t.length>0&&rP.current?nY(e=>[e.trim(),t].filter(Boolean).join(" ")):t.length>0&&(nY(""),n4(t))}catch(e){}},{apiUrl:`${D}/api/stt`,onError:rx},na);(0,em.useEffect)(()=>{var t,n;let r=tF.current;if(tB){tF.current=!0;return}t=!!e.requireLoginToken,n=!!rr.current,t&&r&&!tB&&n&&(rE(),rF(),rg(),t8(!1),t9(void 0),rM(!1),tG(!1),nY(""),n0([]),rl(void 0),ri(void 0)),tF.current=!1},[tB,e.requireLoginToken,rt]),(0,em.useEffect)(()=>{rk&&(rO.current=null)},[rk]);let rU=async e=>{var t;let n;if(!rR(e)){let e=new CustomEvent("MemoriEndSpeak");return document.dispatchEvent(e),Promise.resolve()}return"function"==typeof rF&&rF(),nu(!1),rS((t=Le(k9(k7(e))).replaceAll(/[^\p{L}\p{N}\p{P}\p{Z}^$\n]/gu,"").trim().replaceAll(/```*?```/g,"").replaceAll(/```[\s\S]*?```/g,"").replaceAll(/`[^`]*`/g,"").replaceAll(/!\[[^\]]*\]\([^)]*\)/g,"").replaceAll(/\[([^\]]*)\]\([^)]*\)/g,"$1").replaceAll(/^> /gm,"").replaceAll(/^#+ /gm,"").replaceAll(/[*_]/g,"").replaceAll(/---/g,"").replaceAll(/~~/g,"").replaceAll(/^\s*[-*+] /gm,"").replaceAll(/^\s*\d+\.\s+/gm,"").replaceAll(/^\|.*\|$/gm,"").replaceAll(/\$\$[\s\S]*?\$\$/g,"").replaceAll(/\$[\s\S]*?\$/g,"").replaceAll(/\\\([\s\S]*?\\\)/g,"").replaceAll(/\\\[[\s\S]*?\\\]/g,"").replaceAll(/\s+/g," ").trim(),(n=document.createElement("textarea")).textContent=t,n.innerHTML))},rj=(0,em.useCallback)(async(e,t,n,r=!1)=>{try{if(!e)return null;let i=await n5(e,t,n,r),a=i.translatedEmission||i.emission;return rC||rM(!0),a&&!r&&rR(a)&&await rU(a),i}catch(t){return rC||rM(!0),e}},[n5,rU,rC,rM,rT]),rz=(0,em.useCallback)((e,t)=>{var n,r;let{msg:i,typingText:a,useLoaderTextAsMsg:o}=t,s=e.currentState;if(0!==e.resultCode||!s){if((XN(e.resultCode)||XR(e.resultMessage))&&t.text){t8(!1),t9(void 0),rd.current({text:t.text,media:t.media,translate:t.translate,translatedText:t.translatedText,hidden:t.hidden,typingText:t.typingText,useLoaderTextAsMsg:t.useLoaderTextAsMsg,hasBatchQueued:t.hasBatchQueued,expiredSessionID:rt,continueFromChatLogID:n2});return}500===e.resultCode&&e.resultMessage&&n0(t=>[...t,{text:"Error: "+e.resultMessage,emitter:"system",fromUser:!1,initial:!1,contextVars:{},date:new Date().toISOString()}]);return}if(!i)return;n3(void 0);let l=o&&a?a:null!=(n=s.emission)?n:null==ra?void 0:ra.emission;t1.toLowerCase()!==tQ.toLowerCase()&&l&&t0?n5({...s,emission:l},t1,i,!1,s).then(e=>{let t=e.translatedEmission||e.emission;t&&rR(t)&&rU(t)}):(rl({...s,emission:l},s),l&&(n1({text:l,emitter:s.emitter,media:null!=(r=s.emittedMedia)?r:s.media,llmUsage:s.llmUsage,fromUser:!1,questionAnswered:i,generatedByAI:!!s.completion,contextVars:s.contextVars,date:s.currentDate,placeName:s.currentPlaceName,placeLatitude:s.currentLatitude,placeLongitude:s.currentLongitude,placeUncertaintyKm:s.currentUncertaintyKm,tag:s.currentTag,memoryTags:s.memoryTags}),l&&rR(l)&&rU(l)))},[t1,tQ,t0,null==ra?void 0:ra.emission,n5,rU,rR]),rH=(0,em.useCallback)((e,t)=>{var n;(null==(n=t.waitForResponse)?void 0:n.timeoutId)&&clearTimeout(t.waitForResponse.timeoutId),ne.current.delete(e)},[]),rG=(0,em.useCallback)(e=>{var t,n,r;let i,a=e.correlationID;if(a&&(i=ne.current.get(a))&&(rH(a,i),null==(t=i.waitForResponse)||t.reject(Error(null!=(n=e.errorMessage)?n:String(null!=(r=e.errorCode)?r:"NATS error")))),function(e){if(XN(e.errorCode))return!0;if("string"==typeof e.errorCode){let t=e.errorCode.toUpperCase();if(t.includes("SESSION_EXPIRED")||t.includes("SESSION_NOT_FOUND"))return!0}return XR(e.errorMessage)}(e)&&(null==i?void 0:i.text)){t8(!1),t9(void 0),rd.current({text:i.text,media:i.media,translate:i.translate,translatedText:i.translatedText,hidden:i.hidden,typingText:i.typingText,useLoaderTextAsMsg:i.useLoaderTextAsMsg,hasBatchQueued:i.hasBatchQueued,expiredSessionID:rt,continueFromChatLogID:n2});return}n1({text:e.errorMessage?`Error: ${e.errorMessage}`:e.errorCode?`Error: ${e.errorCode}`:"Error: An unexpected error occurred",emitter:"system",fromUser:!1,initial:!1,contextVars:{},date:new Date().toISOString()}),t8(!1),t9(void 0)},[rH]),rV=(0,em.useCallback)((e,t)=>{let n=ne.current.get(e);if(!n)return void nt.current.set(e,t);if(rH(e,n),n.waitForResponse){n.waitForResponse.resolve(t),t8(!1),t9(void 0);return}rz(t,n),n.hasBatchQueued||(t8(!1),t9(void 0))},[rz,rH]),rW=(0,em.useCallback)((e,t)=>{let n=nt.current.get(e);if(n){nt.current.delete(e),ne.current.set(e,t),rV(e,n);return}ne.current.set(e,t)},[rV]),rq=(0,em.useCallback)((e,t=12e4)=>new Promise((n,r)=>{let i=setTimeout(()=>{let n=ne.current.get(e);n&&rH(e,n),Xk("NATS timeout",{correlationID:e,timeoutMs:t}),r(Error("NATS enter-text response timeout"))},t);rW(e,{stateBeforeRequest:rs.current,waitForResponse:{resolve:e=>{clearTimeout(i),n(e)},reject:e=>{clearTimeout(i),r(e)},timeoutId:i}})}),[rW,rH]),r$=(0,em.useCallback)(async()=>{if(!rt||0===ne.current.size)return;let e=Array.from(ne.current.entries()).pop();if(!e)return;let[t,n]=e;try{let{currentState:e,resultCode:r,resultMessage:i,requestID:a}=await tp(rt);if(0!==r||!e)return void rV(t,{eventType:"dialog_text_entered_response",correlationID:t,requestID:a,resultCode:r,resultMessage:i,currentState:e});if(!function(e,t){if(XO(t)===(null!=e?e:""))return!1;try{let n=e?JSON.parse(e):{};if(void 0!==n.emission&&n.emission===t.emission&&!0!==t.completion)return!1}catch(e){}return!0}(n.stateBeforeRequest,e)||XO(e)===rs.current)return void console.info("[NATS] catch-up: pending turn has not completed yet");console.info("[NATS] catch-up: applying current engine session state"),rV(t,{eventType:"dialog_text_entered_response",correlationID:t,requestID:a,resultCode:r,resultMessage:i,currentState:e})}catch(e){Xk("NATS catch-up failed",e)}},[rt,rV]);!function({baseUrl:e,sessionId:t,onProgress:n,onDialogResponse:r,onError:i,onCatchUp:a}){let[o,s]=(0,em.useState)(null),[l,u]=(0,em.useState)(null),c=(0,em.useRef)(n),d=(0,em.useRef)(r),h=(0,em.useRef)(i),p=(0,em.useRef)(a),m=(0,em.useRef)(null),f=(0,em.useRef)(!1),g=(0,em.useRef)(!1),v=(0,em.useRef)(0);(0,em.useEffect)(()=>{c.current=n,d.current=r,h.current=i,p.current=a},[n,r,i,a]);let y=(0,em.useCallback)(async n=>{var r;if(!t||g.current||"auth"===n&&Date.now()-v.current<5e3)return;g.current=!0,"auth"===n&&(v.current=Date.now()),null==(r=m.current)||r.abort();let i=new AbortController;m.current=i,console.info("[NATS] fetching config from",`${e}/api/nats`,"for session",t,`(${n})`);try{let r=await J6(e,t,i.signal);i.signal.aborted||(f.current="initial"!==n,console.info("[NATS] config received",{url:r.url,jetStream:!!r.stream,stream:r.stream}),s(r),u(null))}catch(e){i.signal.aborted||(null==e?void 0:e.name)==="AbortError"||(console.error("[NATS] config error",e),s(null),u(e instanceof Error?e:Error(String(e))))}finally{m.current===i&&(m.current=null,g.current=!1)}},[e,t]);(0,em.useEffect)(()=>{if(!t){console.debug("[NATS] no sessionId, skipping config fetch"),s(null),u(null);return}return y("initial"),()=>{var e;null==(e=m.current)||e.abort(),m.current=null,g.current=!1}},[t,y]),(0,em.useEffect)(()=>{if(!t)return;let e=()=>{"visible"===document.visibilityState&&y("resume")},n=()=>{"visible"===document.visibilityState&&e()},r=t=>{t.persisted&&e()};return document.addEventListener("visibilitychange",n),window.addEventListener("online",e),window.addEventListener("pageshow",r),()=>{document.removeEventListener("visibilitychange",n),window.removeEventListener("online",e),window.removeEventListener("pageshow",r)}},[t,y]),!function(e,t,n,r={}){let i=(0,em.useRef)(null),a=(0,em.useRef)(null),o=(0,em.useRef)(n),s=(0,em.useRef)(r),l=(0,em.useRef)(!1),[u,c]=(0,em.useState)(0);(0,em.useEffect)(()=>{o.current=n},[n]),(0,em.useEffect)(()=>{s.current=r},[r]),(0,em.useEffect)(()=>{if(!e||!(null==t?void 0:t.stream))return;let n=()=>{"visible"===document.visibilityState&&(console.info("[NATS] resuming JetStream after visibility/network change"),c(e=>e+1))},r=()=>{if("hidden"===document.visibilityState){l.current=!0;return}l.current&&(l.current=!1,n())},i=e=>{e.persisted&&n()};return document.addEventListener("visibilitychange",r),window.addEventListener("online",n),window.addEventListener("pageshow",i),()=>{document.removeEventListener("visibilitychange",r),window.removeEventListener("online",n),window.removeEventListener("pageshow",i)}},[e,null==t?void 0:t.stream]),(0,em.useEffect)(()=>{var n;if(!e||!(null==t?void 0:t.url)||!t.token)return void console.debug("[NATS] subscription skipped (missing sessionId/url/token)",{sessionId:e,hasUrl:!!(null==t?void 0:t.url),hasToken:!!(null==t?void 0:t.token)});let r=!1,l=null!=(n=t.subject)?n:`sessions.${e}`,c=!!t.stream,d=c&&u>0?"catch-up":"live";return(async()=>{console.info("[NATS] connecting to",t.url,"for session",e,c?`(JetStream/${d})`:"(core)");let n=await (0,J8.wsconnect)({servers:[t.url],authenticator:(0,J8.jwtAuthenticator)(t.token)});if(r){console.debug("[NATS] connection established after cleanup, closing immediately"),await n.close();return}i.current=n,console.info("[NATS] connected to",n.getServer());let u=e=>{o.current(e)},h=()=>{var e,t;return null==(t=(e=s.current).onConnected)?void 0:t.call(e)},p=!1,m=e=>{var t,n;r||p||(p=!0,null==(n=(t=s.current).onAuthError)||n.call(t,e))};(async()=>{for await(let e of n.status())if("error"===e.type&&XS(e.error))return void m(e.error)})(),n.closed().then(e=>{e&&XS(e)&&m(e)}),c?await XC(n,t,l,d,u,e=>{a.current=e},h):await XI(n,l,u,h)})().catch(e=>{var t,n;console.error("[NATS] connection error",e),!r&&XS(e)&&(null==(n=(t=s.current).onAuthError)||n.call(t,e))}),()=>{var e,t;console.info("[NATS] cleanup: closing connection for subject",l),r=!0,null==(e=a.current)||e.stop(),a.current=null,null==(t=i.current)||t.close(),i.current=null}},[e,t,u]),(0,em.useEffect)(()=>{c(0)},[e])}(t,null!=o?o:void 0,(0,em.useCallback)(e=>{var t,n,r;switch(console.debug("[NATS] dispatching event",{eventType:e.eventType}),e.eventType){case"progress":null==(t=c.current)||t.call(c,e);break;case"dialog_text_entered_response":null==(n=d.current)||n.call(d,e);break;case"error":null==(r=h.current)||r.call(h,e);break;default:console.warn("Unknown NATS event",e)}},[]),{onConnected:(0,em.useCallback)(()=>{var e;f.current&&(f.current=!1,null==(e=p.current)||e.call(p))},[]),onAuthError:(0,em.useCallback)(e=>{console.warn("[NATS] JWT rejected or expired; refreshing credentials",e),y("auth")},[y])})}({baseUrl:D,sessionId:rt,onProgress:(0,em.useCallback)(e=>{e.message&&t9(e.message)},[]),onDialogResponse:(0,em.useCallback)(e=>{let t=e.correlationID;if(!t){Xk("NATS dialog response missing correlationID",e),t8(!1),t9(void 0);return}rV(t,e)},[rV]),onError:rG,onCatchUp:r$}),(0,em.useEffect)(()=>{let e;"TOTEM"!==nr&&((e=document.querySelector("#chat-fieldset textarea"))&&ty?e.focus():null==e||e.blur())},[null==ra?void 0:ra.emission]);let rJ=()=>{try{rg(),tG(!1),rf.current=void 0,rE()}catch(e){}};(0,em.useEffect)(()=>()=>{rJ()},[]),(0,em.useEffect)(()=>(document.addEventListener("MemoriResetUIEffects",rJ),()=>{document.removeEventListener("MemoriResetUIEffects",rJ)}),[]),(0,em.useEffect)(()=>{var t;let n=(t=!!e.requireLoginToken,!!t&&!tB);n||rA||t6||!nw||!no&&rv||!rt||nl?((rA||t6)&&rk||n&&rk)&&rF():rB()},[rA,no,nl,t6,tB,e.requireLoginToken,rt]),(0,em.useEffect)(()=>{rF()},[tQ]);let[rK,rY]=(0,em.useState)("keypress");(0,em.useEffect)(()=>{window.innerWidth<=768&&kQ()?rY("click"):rY("keypress")},[]);let[rX,rZ]=(0,em.useState)(),rQ=null==tP?void 0:tP.globalBackground,r0=l&&(e5=null==tP?void 0:tP.buttonBgColor)?{"--memori-primary-color":e5,"--memori-primary-content":null!=(eQ=null==tP?void 0:tP.buttonTextColor)?eQ:"#ffffff","--memori-icon-active-bg":"color-mix(in oklch, var(--memori-primary) 12%, transparent)","--memori-icon-recording-bg":"color-mix(in oklch, var(--memori-error) 12%, transparent)"}:{},r1=[p?"#preview":null,ei?":root":null,l?"body":null,".memori-client",".memori-widget",".memori-drawer",".memori-modal",".memori-header",".memori-dropdown",".memori-select"].filter(Boolean).join(", "),r2=Object.entries(r0).map(([e,t])=>`${e}: ${t};`).join("\n "),r3=[];r2&&(r3.push(`${r1} {
1088
- ${r2}
1089
- }`),r3.push(`[data-theme="dark"] .memori-widget,
1087
+ `}}function Yw(e,t){return`${YS(e/t)}/sec`}function YS(e,t=!1){let n=t?1e3:1024,r=t?"iB":"B";if(e<n)return`${e.toFixed(2)} ${r}`;let i=parseInt(Math.log(e)/Math.log(n)+""),a=parseInt(i-1+"");return`${(e/Math.pow(n,i)).toFixed(2)} ${(t?["k","M","G","T","P","E"]:["K","M","G","T","P","E"])[a]}${r}`}"use strict";Yb.Metric=Yx,Yb.Bench=class{nc;callbacks;msgs;size;subject;asyncRequests;pub;sub;req;rep;perf;payload;constructor(e,t={msgs:1e5,size:128,subject:"",asyncRequests:!1,pub:!1,sub:!1,req:!1,rep:!1}){if(this.nc=e,this.callbacks=t.callbacks||!1,this.msgs=t.msgs||0,this.size=t.size||0,this.subject=t.subject||KI.nuid.next(),this.asyncRequests=t.asyncRequests||!1,this.pub=t.pub||!1,this.sub=t.sub||!1,this.req=t.req||!1,this.rep=t.rep||!1,this.perf=new Kr.Perf,this.payload=this.size?new Uint8Array(this.size):Y_.Empty,!this.pub&&!this.sub&&!this.req&&!this.rep)throw Error("no options selected")}async run(){return this.nc.closed().then(e=>{if(e)throw e}),this.callbacks?await this.runCallbacks():await this.runAsync(),this.processMetrics()}processMetrics(){let{lang:e,version:t}=this.nc.protocol.transport;this.pub&&this.sub&&this.perf.measure("pubsub","pubStart","subStop"),this.req&&this.rep&&this.perf.measure("reqrep","reqStart","reqStop");let n=this.perf.getEntries(),r=n.find(e=>"pubsub"===e.name),i=n.find(e=>"reqrep"===e.name),a=n.find(e=>"req"===e.name),o=n.find(e=>"rep"===e.name),s=n.find(e=>"pub"===e.name),l=n.find(e=>"sub"===e.name),u=this.nc.stats(),c=[];if(r){let{name:n,duration:i}=r,a=new Yx(n,i);a.msgs=2*this.msgs,a.bytes=u.inBytes+u.outBytes,a.lang=e,a.version=t,a.payload=this.payload.length,c.push(a)}if(i){let{name:n,duration:r}=i,a=new Yx(n,r);a.msgs=2*this.msgs,a.bytes=u.inBytes+u.outBytes,a.lang=e,a.version=t,a.payload=this.payload.length,c.push(a)}if(s){let{name:n,duration:r}=s,i=new Yx(n,r);i.msgs=this.msgs,i.bytes=u.outBytes,i.lang=e,i.version=t,i.payload=this.payload.length,c.push(i)}if(l){let{name:n,duration:r}=l,i=new Yx(n,r);i.msgs=this.msgs,i.bytes=u.inBytes,i.lang=e,i.version=t,i.payload=this.payload.length,c.push(i)}if(o){let{name:n,duration:r}=o,i=new Yx(n,r);i.msgs=this.msgs,i.bytes=u.inBytes+u.outBytes,i.lang=e,i.version=t,i.payload=this.payload.length,c.push(i)}if(a){let{name:n,duration:r}=a,i=new Yx(n,r);i.msgs=this.msgs,i.bytes=u.inBytes+u.outBytes,i.lang=e,i.version=t,i.payload=this.payload.length,c.push(i)}return c}async runCallbacks(){let e=[];if(this.sub){let t=(0,Kr.deferred)();e.push(t);let n=0;this.nc.subscribe(this.subject,{max:this.msgs,callback:()=>{1==++n&&this.perf.mark("subStart"),n===this.msgs&&(this.perf.mark("subStop"),this.perf.measure("sub","subStart","subStop"),t.resolve())}})}if(this.rep){let t=(0,Kr.deferred)();e.push(t);let n=0;this.nc.subscribe(this.subject,{max:this.msgs,callback:(e,r)=>{r.respond(this.payload),1==++n&&this.perf.mark("repStart"),n===this.msgs&&(this.perf.mark("repStop"),this.perf.measure("rep","repStart","repStop"),t.resolve())}})}if(this.pub){let t=(async()=>{this.perf.mark("pubStart");for(let e=0;e<this.msgs;e++)this.nc.publish(this.subject,this.payload);await this.nc.flush(),this.perf.mark("pubStop"),this.perf.measure("pub","pubStart","pubStop")})();e.push(t)}if(this.req){let t=(async()=>{if(this.asyncRequests){this.perf.mark("reqStart");let e=[];for(let t=0;t<this.msgs;t++)e.push(this.nc.request(this.subject,this.payload,{timeout:2e4}));await Promise.all(e),this.perf.mark("reqStop"),this.perf.measure("req","reqStart","reqStop")}else{this.perf.mark("reqStart");for(let e=0;e<this.msgs;e++)await this.nc.request(this.subject);this.perf.mark("reqStop"),this.perf.measure("req","reqStart","reqStop")}})();e.push(t)}await Promise.all(e)}async runAsync(){let e=[];if(this.rep){let t=!1,n=this.nc.subscribe(this.subject,{max:this.msgs}),r=(async()=>{for await(let e of n)t||(this.perf.mark("repStart"),t=!0),e.respond(this.payload);await this.nc.flush(),this.perf.mark("repStop"),this.perf.measure("rep","repStart","repStop")})();e.push(r)}if(this.sub){let t=!1,n=this.nc.subscribe(this.subject,{max:this.msgs}),r=(async()=>{for await(let e of n)t||(this.perf.mark("subStart"),t=!0);this.perf.mark("subStop"),this.perf.measure("sub","subStart","subStop")})();e.push(r)}if(this.pub){let t=(async()=>{this.perf.mark("pubStart");for(let e=0;e<this.msgs;e++)this.nc.publish(this.subject,this.payload);await this.nc.flush(),this.perf.mark("pubStop"),this.perf.measure("pub","pubStart","pubStop")})();e.push(t)}if(this.req){let t=(async()=>{if(this.asyncRequests){this.perf.mark("reqStart");let e=[];for(let t=0;t<this.msgs;t++)e.push(this.nc.request(this.subject,this.payload,{timeout:2e4}));await Promise.all(e),this.perf.mark("reqStop"),this.perf.measure("req","reqStart","reqStop")}else{this.perf.mark("reqStart");for(let e=0;e<this.msgs;e++)await this.nc.request(this.subject);this.perf.mark("reqStop"),this.perf.measure("req","reqStart","reqStop")}})();e.push(t)}await Promise.all(e)}},Object.defineProperty(J9,"Bench",{enumerable:!0,get:function(){return Yb.Bench}}),Object.defineProperty(J9,"Metric",{enumerable:!0,get:function(){return Yb.Metric}}),Object.defineProperty(J9,"TD",{enumerable:!0,get:function(){return Ki.TD}}),Object.defineProperty(J9,"TE",{enumerable:!0,get:function(){return Ki.TE}}),Object.defineProperty(J9,"ipV4",{enumerable:!0,get:function(){return KF.ipV4}}),Object.defineProperty(J9,"isIP",{enumerable:!0,get:function(){return KF.isIP}}),Object.defineProperty(J9,"parseIP",{enumerable:!0,get:function(){return KF.parseIP}}),Object.defineProperty(J9,"compare",{enumerable:!0,get:function(){return K7.compare}}),Object.defineProperty(J9,"Feature",{enumerable:!0,get:function(){return K7.Feature}}),Object.defineProperty(J9,"Features",{enumerable:!0,get:function(){return K7.Features}}),Object.defineProperty(J9,"parseSemVer",{enumerable:!0,get:function(){return K7.parseSemVer}}),Object.defineProperty(J9,"Empty",{enumerable:!0,get:function(){return Y_.Empty}}),Object.defineProperty(J9,"extractProtocolMessage",{enumerable:!0,get:function(){return KA.extractProtocolMessage}}),Object.defineProperty(J9,"protoLen",{enumerable:!0,get:function(){return KA.protoLen}}),Object.defineProperty(J9,"createInbox",{enumerable:!0,get:function(){return KT.createInbox}}),Object.defineProperty(J9,"Match",{enumerable:!0,get:function(){return KT.Match}}),Object.defineProperty(J9,"syncIterator",{enumerable:!0,get:function(){return KT.syncIterator}}),Object.defineProperty(J9,"SubscriptionImpl",{enumerable:!0,get:function(){return KE.SubscriptionImpl}}),Object.defineProperty(J9,"Subscriptions",{enumerable:!0,get:function(){return KE.Subscriptions}});"use strict";var YE={};Object.defineProperty(YE,"__esModule",{value:!0}),YE.IdleHeartbeatMonitor=void 0,YE.IdleHeartbeatMonitor=class{interval;maxOut;cancelAfter;timer;autoCancelTimer;last;missed;count;callback;constructor(e,t,n={maxOut:2}){this.interval=e,this.maxOut=n?.maxOut||2,this.cancelAfter=n?.cancelAfter||0,this.last=Date.now(),this.missed=0,this.count=0,this.callback=t,this._schedule()}cancel(){this.autoCancelTimer&&clearTimeout(this.autoCancelTimer),this.timer&&clearInterval(this.timer),this.timer=0,this.autoCancelTimer=0,this.missed=0}work(){this.last=Date.now(),this.missed=0}_change(e,t=0,n=2){this.interval=e,this.maxOut=n,this.cancelAfter=t,this.restart()}restart(){this.cancel(),this._schedule()}_schedule(){this.cancelAfter>0&&(this.autoCancelTimer=setTimeout(()=>{this.cancel()},this.cancelAfter)),this.timer=setInterval(()=>{if(this.count++,Date.now()-this.last>this.interval&&this.missed++,this.missed>=this.maxOut)try{!0===this.callback(this.missed)&&this.cancel()}catch(e){console.log(e)}},this.interval)}},Object.defineProperty(J9,"IdleHeartbeatMonitor",{enumerable:!0,get:function(){return YE.IdleHeartbeatMonitor}}),Object.defineProperty(J9,"isIPV4OrHostname",{enumerable:!0,get:function(){return KB.isIPV4OrHostname}}),Object.defineProperty(J9,"Servers",{enumerable:!0,get:function(){return KB.Servers}});"use strict";var YA={};Object.defineProperty(YA,"__esModule",{value:!0}),YA.WsTransport=void 0,YA.wsUrlParseFn=YM,YA.wsconnect=function(e={}){return(0,KA.setTransportFactory)({defaultPort:443,urlParseFn:YM,factory:()=>{if(e.tls)throw Ka.InvalidArgumentError.format("tls","is not configurable on w3c websocket connections");return new YC}}),Kn.NatsConnectionImpl.connect(e)};var YT={};Object.defineProperty(YT,"__esModule",{value:!0}),YT.version=void 0,YT.version="3.4.0";let YI=YT.version;class YC{version;lang;closeError;connected;done;socket;options;socketClosed;encrypted;peeked;yields;signal;closedNotification;constructor(){this.version=YI,this.lang="nats.ws",this.connected=!1,this.done=!1,this.socketClosed=!1,this.encrypted=!1,this.peeked=!1,this.yields=[],this.signal=(0,Kr.deferred)(),this.closedNotification=(0,Kr.deferred)()}async connect(e,t){let n=(0,Kr.deferred)();this.options=t;let r=e.src;if(t.wsFactory){let{socket:n,encrypted:r}=await t.wsFactory(e.src,t);this.socket=n,this.encrypted=r}else this.encrypted=0===r.indexOf("wss://"),this.socket=new WebSocket(r);return this.socket.binaryType="arraybuffer",this.socket.onopen=()=>{this.done&&this._closed(Error("aborted"))},this.socket.onmessage=e=>{if(this.done)return;if(this.yields.push(new Uint8Array(e.data)),this.peeked)return void this.signal.resolve();let r=KL.DataBuffer.concat(...this.yields),i=(0,KA.extractProtocolMessage)(r);if(""!==i){let e=KE.INFO.exec(i);if(!e){t.debug&&console.error("!!!",(0,Kr.render)(r)),n.reject(Error("unexpected response from server"));return}try{let t=JSON.parse(e[1]);(0,Yt.checkOptions)(t,this.options),this.peeked=!0,this.connected=!0,this.signal.resolve(),n.resolve()}catch(e){n.reject(e);return}}},this.socket.onclose=e=>{let t;e.wasClean||""===e.reason||(t=Error(e.reason)),this._closed(t),this._cleanup()},this.socket.onerror=e=>{if(this.done)return;let t=new Ka.errors.ConnectionError(e.message);n.reject(t),this._cleanup()},n}_cleanup(){!1===this.socketClosed&&(this.socketClosed=!0,this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,this.closedNotification.resolve(this.closeError))}disconnect(){this._closed(void 0,!0)}async _closed(e,t=!0){if(this.done){try{this.socket.close()}catch(e){}return}if(this.closeError=e,!e)for(;!this.socketClosed&&this.socket.bufferedAmount>0;)await (0,Kr.delay)(100);this.done=!0;try{this.socket.close()}catch(e){}return this.closedNotification}get isClosed(){return this.done}[Symbol.asyncIterator](){return this.iterate()}async *iterate(){for(;;){if(this.done)return;0===this.yields.length&&await this.signal;let e=this.yields;this.yields=[];for(let t=0;t<e.length;t++)this.options.debug&&console.info(`> ${(0,Kr.render)(e[t])}`),yield e[t];if(this.done)break;0===this.yields.length&&(e.length=0,this.yields=e,this.signal=(0,Kr.deferred)())}}isEncrypted(){return this.connected&&this.encrypted}send(e){if(!this.done)try{this.socket.send(e.buffer),this.options.debug&&console.info(`< ${(0,Kr.render)(e)}`);return}catch(t){this.options.debug&&console.error(`!!! ${(0,Kr.render)(e)}: ${t}`)}}close(e){return this._closed(e,!1)}closed(){return this.closedNotification}discard(){this.socket?.close()}}function YM(e,t){let n,r;/^(.*:\/\/)(.*)/.test(e)||(e="boolean"==typeof t?`${!0===t?"https":"http"}://${e}`:`https://${e}`);let i=new URL(e),a=i.protocol.toLowerCase();"ws:"===a&&(t=!1),"wss:"===a&&(t=!0),"https:"!==a&&"http"!==a&&(e=e.replace(/^(.*:\/\/)(.*)/gm,"$2"),i=new URL(`http://${e}`));let o=i.hostname,s=i.pathname,l=i.search||"";switch(a){case"http:":case"ws:":case"nats:":r=i.port||"80",n="ws:";break;case"https:":case"wss:":case"tls:":r=i.port||"443",n="wss:";break;default:r=i.port||!0===t?"443":"80",n=!0===t?"wss:":"ws:"}return`${n}//${o}:${r}${s}${l}`}"use strict";YA.WsTransport=YC,Object.defineProperty(J9,"wsconnect",{enumerable:!0,get:function(){return YA.wsconnect}}),Object.defineProperty(J9,"wsUrlParseFn",{enumerable:!0,get:function(){return YA.wsUrlParseFn}}),Object.defineProperty(J9,"AuthorizationError",{enumerable:!0,get:function(){return Ka.AuthorizationError}}),Object.defineProperty(J9,"ClosedConnectionError",{enumerable:!0,get:function(){return Ka.ClosedConnectionError}}),Object.defineProperty(J9,"ConnectionError",{enumerable:!0,get:function(){return Ka.ConnectionError}}),Object.defineProperty(J9,"DrainingConnectionError",{enumerable:!0,get:function(){return Ka.DrainingConnectionError}}),Object.defineProperty(J9,"errors",{enumerable:!0,get:function(){return Ka.errors}}),Object.defineProperty(J9,"InvalidArgumentError",{enumerable:!0,get:function(){return Ka.InvalidArgumentError}}),Object.defineProperty(J9,"InvalidOperationError",{enumerable:!0,get:function(){return Ka.InvalidOperationError}}),Object.defineProperty(J9,"InvalidSubjectError",{enumerable:!0,get:function(){return Ka.InvalidSubjectError}}),Object.defineProperty(J9,"NoRespondersError",{enumerable:!0,get:function(){return Ka.NoRespondersError}}),Object.defineProperty(J9,"PermissionViolationError",{enumerable:!0,get:function(){return Ka.PermissionViolationError}}),Object.defineProperty(J9,"ProtocolError",{enumerable:!0,get:function(){return Ka.ProtocolError}}),Object.defineProperty(J9,"RequestError",{enumerable:!0,get:function(){return Ka.RequestError}}),Object.defineProperty(J9,"TimeoutError",{enumerable:!0,get:function(){return Ka.TimeoutError}}),Object.defineProperty(J9,"UserAuthenticationExpiredError",{enumerable:!0,get:function(){return Ka.UserAuthenticationExpiredError}}),Object.defineProperty(J7,"AuthorizationError",{enumerable:!0,get:function(){return J9.AuthorizationError}}),Object.defineProperty(J7,"backoff",{enumerable:!0,get:function(){return J9.backoff}}),Object.defineProperty(J7,"Bench",{enumerable:!0,get:function(){return J9.Bench}}),Object.defineProperty(J7,"buildAuthenticator",{enumerable:!0,get:function(){return J9.buildAuthenticator}}),Object.defineProperty(J7,"canonicalMIMEHeaderKey",{enumerable:!0,get:function(){return J9.canonicalMIMEHeaderKey}}),Object.defineProperty(J7,"ClosedConnectionError",{enumerable:!0,get:function(){return J9.ClosedConnectionError}}),Object.defineProperty(J7,"ConnectionError",{enumerable:!0,get:function(){return J9.ConnectionError}}),Object.defineProperty(J7,"createInbox",{enumerable:!0,get:function(){return J9.createInbox}}),Object.defineProperty(J7,"credsAuthenticator",{enumerable:!0,get:function(){return J9.credsAuthenticator}}),Object.defineProperty(J7,"deadline",{enumerable:!0,get:function(){return J9.deadline}}),Object.defineProperty(J7,"deferred",{enumerable:!0,get:function(){return J9.deferred}}),Object.defineProperty(J7,"delay",{enumerable:!0,get:function(){return J9.delay}}),Object.defineProperty(J7,"DrainingConnectionError",{enumerable:!0,get:function(){return J9.DrainingConnectionError}}),Object.defineProperty(J7,"Empty",{enumerable:!0,get:function(){return J9.Empty}}),Object.defineProperty(J7,"errors",{enumerable:!0,get:function(){return J9.errors}}),Object.defineProperty(J7,"hasWsProtocol",{enumerable:!0,get:function(){return J9.hasWsProtocol}}),Object.defineProperty(J7,"headers",{enumerable:!0,get:function(){return J9.headers}}),Object.defineProperty(J7,"InvalidArgumentError",{enumerable:!0,get:function(){return J9.InvalidArgumentError}}),Object.defineProperty(J7,"InvalidOperationError",{enumerable:!0,get:function(){return J9.InvalidOperationError}}),Object.defineProperty(J7,"InvalidSubjectError",{enumerable:!0,get:function(){return J9.InvalidSubjectError}}),Object.defineProperty(J7,"jwtAuthenticator",{enumerable:!0,get:function(){return J9.jwtAuthenticator}}),Object.defineProperty(J7,"Match",{enumerable:!0,get:function(){return J9.Match}}),Object.defineProperty(J7,"Metric",{enumerable:!0,get:function(){return J9.Metric}}),Object.defineProperty(J7,"millis",{enumerable:!0,get:function(){return J9.millis}}),Object.defineProperty(J7,"MsgHdrsImpl",{enumerable:!0,get:function(){return J9.MsgHdrsImpl}}),Object.defineProperty(J7,"nanos",{enumerable:!0,get:function(){return J9.nanos}}),Object.defineProperty(J7,"nkeyAuthenticator",{enumerable:!0,get:function(){return J9.nkeyAuthenticator}}),Object.defineProperty(J7,"nkeys",{enumerable:!0,get:function(){return J9.nkeys}}),Object.defineProperty(J7,"NoRespondersError",{enumerable:!0,get:function(){return J9.NoRespondersError}}),Object.defineProperty(J7,"Nuid",{enumerable:!0,get:function(){return J9.Nuid}}),Object.defineProperty(J7,"nuid",{enumerable:!0,get:function(){return J9.nuid}}),Object.defineProperty(J7,"PermissionViolationError",{enumerable:!0,get:function(){return J9.PermissionViolationError}}),Object.defineProperty(J7,"ProtocolError",{enumerable:!0,get:function(){return J9.ProtocolError}}),Object.defineProperty(J7,"RequestError",{enumerable:!0,get:function(){return J9.RequestError}}),Object.defineProperty(J7,"syncIterator",{enumerable:!0,get:function(){return J9.syncIterator}}),Object.defineProperty(J7,"TimeoutError",{enumerable:!0,get:function(){return J9.TimeoutError}}),Object.defineProperty(J7,"tokenAuthenticator",{enumerable:!0,get:function(){return J9.tokenAuthenticator}}),Object.defineProperty(J7,"UserAuthenticationExpiredError",{enumerable:!0,get:function(){return J9.UserAuthenticationExpiredError}}),Object.defineProperty(J7,"usernamePasswordAuthenticator",{enumerable:!0,get:function(){return J9.usernamePasswordAuthenticator}}),Object.defineProperty(J7,"wsconnect",{enumerable:!0,get:function(){return J9.wsconnect}});"use strict";var YN={};Object.defineProperty(YN,"__esModule",{value:!0}),YN.StoreCompression=YN.StorageType=YN.RetentionPolicy=YN.RepublishHeaders=YN.ReplayPolicy=YN.PubHeaders=YN.PersistMode=YN.JsHeaders=YN.JetStreamError=YN.JetStreamApiError=YN.JetStreamApiCodes=YN.isPushConsumer=YN.isPullConsumer=YN.DiscardPolicy=YN.DirectMsgHeaders=YN.DeliverPolicy=YN.AdvisoryKind=YN.AckPolicy=YN.jetstreamManager=YN.jetstream=void 0;"use strict";var YR={};Object.defineProperty(YR,"__esModule",{value:!0}),YR.validateStreamName=YR.jserrors=YR.JetStreamStatusError=YR.JetStreamStatus=YR.JetStreamError=YR.JetStreamApiError=YR.JetStreamApiCodes=YR.isMessageNotFound=YR.ListerImpl=YR.StoreCompression=YR.StorageType=YR.RetentionPolicy=YR.ReplayPolicy=YR.PubHeaders=YR.PersistMode=YR.DiscardPolicy=YR.DeliverPolicy=YR.AckPolicy=YR.DirectMsgImpl=YR.BaseApiClientImpl=YR.toJetStreamClient=YR.startFastIngest=YR.jetstreamManager=YR.JetStreamClientImpl=YR.jetstream=YR.RepublishHeaders=YR.JsHeaders=YR.isPushConsumer=YR.isPullConsumer=YR.isOrderedPushConsumerOptions=YR.isBoundPushConsumerOptions=YR.DirectMsgHeaders=YR.AdvisoryKind=void 0;"use strict";var YO={};Object.defineProperty(YO,"__esModule",{value:!0}),YO.RepublishHeaders=YO.DirectMsgHeaders=YO.JsHeaders=YO.AdvisoryKind=void 0,YO.isOrderedPushConsumerOptions=function(e){return!!e&&"object"==typeof e&&("name_prefix"in e||"deliver_subject_prefix"in e||"filter_subjects"in e||"filter_subject"in e||"deliver_policy"in e||"opt_start_seq"in e||"opt_start_time"in e||"replay_policy"in e||"inactive_threshold"in e||"headers_only"in e||"deliver_prefix"in e)},YO.isPullConsumer=function(e){return e.isPullConsumer()},YO.isPushConsumer=function(e){return e.isPushConsumer()},YO.isBoundPushConsumerOptions=function(e){return!!e&&"object"==typeof e&&("deliver_subject"in e||"deliver_group"in e||"idle_heartbeat"in e)},YO.AdvisoryKind={API:"api_audit",StreamAction:"stream_action",ConsumerAction:"consumer_action",SnapshotCreate:"snapshot_create",SnapshotComplete:"snapshot_complete",RestoreCreate:"restore_create",RestoreComplete:"restore_complete",MaxDeliver:"max_deliver",Terminated:"terminated",Ack:"consumer_ack",StreamLeaderElected:"stream_leader_elected",StreamQuorumLost:"stream_quorum_lost",ConsumerLeaderElected:"consumer_leader_elected",ConsumerQuorumLost:"consumer_quorum_lost"},YO.JsHeaders={StreamSourceHdr:"Nats-Stream-Source",LastConsumerSeqHdr:"Nats-Last-Consumer",LastStreamSeqHdr:"Nats-Last-Stream",ConsumerStalledHdr:"Nats-Consumer-Stalled",MessageSizeHdr:"Nats-Msg-Size",RollupHdr:"Nats-Rollup",RollupValueSubject:"sub",RollupValueAll:"all",PendingMessagesHdr:"Nats-Pending-Messages",PendingBytesHdr:"Nats-Pending-Bytes",RequiredApiLevel:"Nats-Required-Api-Level"},YO.DirectMsgHeaders={Stream:"Nats-Stream",Sequence:"Nats-Sequence",TimeStamp:"Nats-Time-Stamp",Subject:"Nats-Subject",LastSequence:"Nats-Last-Sequence",NumPending:"Nats-Num-Pending"},YO.RepublishHeaders={Stream:"Nats-Stream",Subject:"Nats-Subject",Sequence:"Nats-Sequence",LastSequence:"Nats-Last-Sequence",Size:"Nats-Msg-Size"},Object.defineProperty(YR,"AdvisoryKind",{enumerable:!0,get:function(){return YO.AdvisoryKind}}),Object.defineProperty(YR,"DirectMsgHeaders",{enumerable:!0,get:function(){return YO.DirectMsgHeaders}}),Object.defineProperty(YR,"isBoundPushConsumerOptions",{enumerable:!0,get:function(){return YO.isBoundPushConsumerOptions}}),Object.defineProperty(YR,"isOrderedPushConsumerOptions",{enumerable:!0,get:function(){return YO.isOrderedPushConsumerOptions}}),Object.defineProperty(YR,"isPullConsumer",{enumerable:!0,get:function(){return YO.isPullConsumer}}),Object.defineProperty(YR,"isPushConsumer",{enumerable:!0,get:function(){return YO.isPushConsumer}}),Object.defineProperty(YR,"JsHeaders",{enumerable:!0,get:function(){return YO.JsHeaders}}),Object.defineProperty(YR,"RepublishHeaders",{enumerable:!0,get:function(){return YO.RepublishHeaders}});"use strict";var YP={};Object.defineProperty(YP,"__esModule",{value:!0}),YP.BatchPublisherImpl=YP.JetStreamClientImpl=YP.JetStreamManagerImpl=void 0,YP.startFastIngest=function(e,t,n,r,i=5e3){let{ackInterval:a,allowGaps:o,inboxPrefix:s,maxOutstandingAcks:l,...u}=r,c=s??"_INBOX";if(!c||/\s/.test(c)||/[*>]/.test(c))return Promise.reject(Error(`inboxPrefix must be non-empty, no wildcards or whitespace (got "${c}")`));let d=new XS(e,{ackInterval:a??10,allowGaps:o,inboxPrefix:c,maxOutstandingAcks:Math.min(3,Math.max(1,l??2))},t,i);return d.start(n,u).then(()=>d)},YP.toJetStreamClient=function(e){return void 0===e.nc?Xg(e):e},YP.jetstream=Xg,YP.jetstreamManager=Xv,YP.scheduleSpecToHeader=Xb;"use strict";var Yk={};Object.defineProperty(Yk,"__esModule",{value:!0}),Yk.BaseApiClientImpl=void 0,Yk.parseJsResponse=YG,Yk.defaultJsOptions=YV;var YL={};Object.defineProperty(YL,"__esModule",{value:!0}),YL.jserrors=YL.StreamNotFoundError=YL.ConsumerNotFoundError=YL.JetStreamApiError=YL.InvalidNameError=YL.JetStreamApiCodes=YL.JetStreamStatus=YL.JetStreamStatusError=YL.JetStreamError=YL.JetStreamNotEnabled=void 0,YL.isMessageNotFound=function(e){return e instanceof Yj&&e.code===YL.JetStreamApiCodes.NoMessageFound};class YD extends Error{constructor(e,t){super(e,t),this.name="JetStreamNotEnabled"}}YL.JetStreamNotEnabled=YD;class YB extends Error{constructor(e,t){super(e,t),this.name="JetStreamError"}}YL.JetStreamError=YB;class YF extends YB{code;constructor(e,t,n){super(e,n),this.code=t,this.name="JetStreamStatusError"}}YL.JetStreamStatusError=YF,YL.JetStreamStatus=class e{msg;_description;constructor(e){this.msg=e,this._description=""}static maybeParseStatus(t){let n=new e(t);return 0===n.code?null:n}toError(){return new YF(this.description,this.code)}debug(){console.log({subject:this.msg.subject,reply:this.msg.reply,description:this.description,status:this.code,headers:this.msg.headers})}get code(){return this.msg.headers?.code||0}get description(){return""===this._description&&(this._description=this.msg.headers?.description?.toLowerCase()||"",""===this._description&&(this._description=503===this.code?"no responders":"unknown")),this._description}isIdleHeartbeat(){return 100===this.code&&"idle heartbeat"===this.description}isFlowControlRequest(){return 100===this.code&&"flowcontrol request"===this.description}parseHeartbeat(){return this.isIdleHeartbeat()?{type:"heartbeat",lastConsumerSequence:parseInt(this.msg.headers?.get("Nats-Last-Consumer")||"0"),lastStreamSequence:parseInt(this.msg.headers?.get("Nats-Last-Stream")||"0")}:null}isRequestTimeout(){return 408===this.code&&"request timeout"===this.description}parseDiscard(){let e={msgsLeft:0,bytesLeft:0},t=this.msg.headers?.get(YO.JsHeaders.PendingMessagesHdr);t&&(e.msgsLeft=parseInt(t));let n=this.msg.headers?.get(YO.JsHeaders.PendingBytesHdr);return n&&(e.bytesLeft=parseInt(n)),e}isBadRequest(){return 400===this.code}isConsumerDeleted(){return 409===this.code&&"consumer deleted"===this.description}isStreamDeleted(){return 409===this.code&&"stream deleted"===this.description}isIdleHeartbeatMissed(){return 409===this.code&&"idle heartbeats missed"===this.description}isMaxWaitingExceeded(){return 409===this.code&&"exceeded maxwaiting"===this.description}isConsumerIsPushBased(){return 409===this.code&&"consumer is push based"===this.description}isExceededMaxWaiting(){return 409===this.code&&this.description.includes("exceeded maxwaiting")}isExceededMaxRequestBatch(){return 409===this.code&&this.description.includes("exceeded maxrequestbatch")}isExceededMaxExpires(){return 409===this.code&&this.description.includes("exceeded maxrequestexpires")}isExceededLimit(){return this.isExceededMaxExpires()||this.isExceededMaxWaiting()||this.isExceededMaxRequestBatch()||this.isMessageSizeExceedsMaxBytes()}isMessageNotFound(){return 404===this.code&&"message not found"===this.description}isNoResults(){return 404===this.code&&"no results"===this.description}isMessageSizeExceedsMaxBytes(){return 409===this.code&&"message size exceeds maxbytes"===this.description}isEndOfBatch(){return 204===this.code&&"eob"===this.description}},YL.JetStreamApiCodes={ConsumerNotFound:10014,StreamNotFound:10059,JetStreamNotEnabledForAccount:10039,StreamWrongLastSequence:10071,StreamWrongLastSequenceUnknown:10164,NoMessageFound:10037};class YU extends Error{constructor(e="",t){super(e,t),this.name="InvalidNameError"}}YL.InvalidNameError=YU;class Yj extends Error{#e;constructor(e,t){super(e.description,t),this.#e=e,this.name="JetStreamApiError"}get code(){return this.#e.err_code}get status(){return this.#e.code}apiError(){return Object.assign({},this.#e)}}YL.JetStreamApiError=Yj;class Yz extends Yj{constructor(e,t){super(e,t),this.name="ConsumerNotFoundError"}}YL.ConsumerNotFoundError=Yz;class YH extends Yj{constructor(e,t){super(e,t),this.name="StreamNotFoundError"}static fromMessage(e){return new YH({err_code:YL.JetStreamApiCodes.StreamNotFound,description:e,code:404})}}function YG(e){let t=JSON.parse(new TextDecoder().decode(e.data));if(t.error)switch(t.error.err_code){case YL.JetStreamApiCodes.ConsumerNotFound:throw new YL.ConsumerNotFoundError(t.error);case YL.JetStreamApiCodes.StreamNotFound:throw new YL.StreamNotFoundError(t.error);case YL.JetStreamApiCodes.JetStreamNotEnabledForAccount:{let e=new YL.JetStreamApiError(t.error);throw new YL.JetStreamNotEnabled(e.message,{cause:e})}default:throw new YL.JetStreamApiError(t.error)}return t}function YV(e){return(e=e||{}).domain&&(e.apiPrefix=`$JS.${e.domain}.API`,delete e.domain),(0,J9.extend)({apiPrefix:"$JS.API",timeout:5e3},e)}"use strict";YL.StreamNotFoundError=YH,YL.jserrors={InvalidNameError:YU,ConsumerNotFoundError:Yz,StreamNotFoundError:YH,JetStreamError:YB,JetStreamApiError:Yj,JetStreamNotEnabled:YD},Yk.BaseApiClientImpl=class{nc;opts;prefix;timeout;constructor(e,t){this.nc=e,(t=t||{}).watcherPrefix=t.watcherPrefix||this.nc.options.inboxPrefix,this.opts=YV(t),this._parseOpts(),this.prefix=this.opts.apiPrefix,this.timeout=this.opts.timeout}getOptions(){return Object.assign({},this.opts)}sendRequiredApiLevel(){return!0===this.opts.sendRequiredApiLevel}_parseOpts(){let e=this.opts.apiPrefix;if(!e||0===e.length)throw J9.errors.InvalidArgumentError.format("prefix","cannot be empty");"."===e[e.length-1]&&(e=e.substr(0,e.length-1)),this.opts.apiPrefix=e,(0,J9.createInbox)(this.opts.watcherPrefix)}async _request(e,t=null,n){let{retries:r,minApiVersion:i,...a}=n??{},o={...a,timeout:this.timeout},s=J9.Empty;if(t&&(s=new TextEncoder().encode(JSON.stringify(t))),"number"==typeof i){let e=o.headers??(0,J9.headers)();e.set(YO.JsHeaders.RequiredApiLevel,i.toString()),o.headers=e}let l=r||1;l=-1===l?Number.MAX_SAFE_INTEGER:l;let u=(0,J9.backoff)();for(let t=0;t<l;t++)try{let t=await this.nc.request(e,s,o);return this.parseJsResponse(t)}catch(n){let e=n instanceof J9.RequestError?n:null;if((n instanceof J9.errors.TimeoutError||e?.isNoResponders())&&t+1<l)await (0,J9.delay)(u.backoff(t));else throw e?.isNoResponders()?new YL.JetStreamNotEnabled("jetstream is not enabled",{cause:n}):n}}async findStream(e){let t=await this._request(`${this.prefix}.STREAM.NAMES`,{subject:e});if(!t.streams||1!==t.streams.length)throw YL.StreamNotFoundError.fromMessage("no stream matches subject");return t.streams[0]}getConnection(){return this.nc}parseJsResponse(e){return YG(e)}};"use strict";var YW={};Object.defineProperty(YW,"__esModule",{value:!0}),YW.ConsumerAPIImpl=void 0;var Yq={};Object.defineProperty(Yq,"__esModule",{value:!0}),Yq.ListerImpl=void 0;class Y${err;offset;pageInfo;subject;jsm;filter;payload;constructor(e,t,n,r){if(!e)throw J9.errors.InvalidArgumentError.format("subject","is required");this.subject=e,this.jsm=n,this.offset=0,this.pageInfo={},this.filter=t,this.payload=r||{}}async next(){if(this.err||this.pageInfo&&this.offset>=this.pageInfo.total)return[];let e={offset:this.offset};this.payload&&Object.assign(e,this.payload);try{let t=await this.jsm._request(this.subject,e,{timeout:this.jsm.timeout});this.pageInfo=t;let n=this.countResponse(t);if(0===n)return[];return this.offset+=n,this.filter(t)}catch(e){throw this.err=e,e}}countResponse(e){switch(e?.type){case"io.nats.jetstream.api.v1.stream_names_response":case"io.nats.jetstream.api.v1.stream_list_response":return e.streams?.length||0;case"io.nats.jetstream.api.v1.consumer_list_response":return e.consumers?.length||0;default:return console.error(`jslister.ts: unknown API response for paged output: ${e?.type}`),e.streams?.length||0}}async *[Symbol.asyncIterator](){let e=await this.next();for(;e.length>0;){for(let t of e)yield t;e=await this.next()}}}"use strict";Yq.ListerImpl=Y$;var YJ={};function YK(e,t=""){if(""===t)throw Error(`${e} name required`);return[".","*",">","/","\\"," "," ","\n","\r"].forEach(n=>{if(-1!==t.indexOf(n)){switch(n){case"\n":n="\\n";break;case"\r":n="\\r";break;case" ":n="\\t"}throw new YL.InvalidNameError(`${e} name ('${t}') cannot contain '${n}'`)}}),""}function YY(e=""){if(""===e)throw Error("name required");let t=/^[-\w]+$/g;if(null===e.match(t)){for(let n of e.split(""))if(null===n.match(t))return`cannot contain '${n}'`}return""}"use strict";Object.defineProperty(YJ,"__esModule",{value:!0}),YJ.validateDurableName=function(e){return YK("durable",e)},YJ.validateStreamName=function(e){return YK("stream",e)},YJ.minValidation=YK,YJ.validateName=function(e,t=""){if(""===t)throw Error(`${e} name required`);let n=YY(t);if(n.length)throw Error(`invalid ${e} name - ${e} name ${n}`)},YJ.validName=YY;var YX={};Object.defineProperty(YX,"__esModule",{value:!0}),YX.PubHeaders=YX.PriorityPolicy=YX.ConsumerApiAction=YX.PersistMode=YX.StoreCompression=YX.ReplayPolicy=YX.AckPolicy=YX.DeliverPolicy=YX.StorageType=YX.DiscardPolicy=YX.RetentionPolicy=void 0,YX.defaultConsumer=function(e,t={}){return Object.assign({name:e,deliver_policy:YX.DeliverPolicy.All,ack_policy:YX.AckPolicy.Explicit,ack_wait:(0,J7.nanos)(3e4),replay_policy:YX.ReplayPolicy.Instant},t)},YX.RetentionPolicy={Limits:"limits",Interest:"interest",Workqueue:"workqueue"},YX.DiscardPolicy={Old:"old",New:"new"},YX.StorageType={File:"file",Memory:"memory"},YX.DeliverPolicy={All:"all",Last:"last",New:"new",StartSequence:"by_start_sequence",StartTime:"by_start_time",LastPerSubject:"last_per_subject"},YX.AckPolicy={None:"none",All:"all",Explicit:"explicit",FlowControl:"flow_control",NotSet:""},YX.ReplayPolicy={Instant:"instant",Original:"original"},YX.StoreCompression={None:"none",S2:"s2"},YX.PersistMode={Default:"default",Async:"async"},YX.ConsumerApiAction={CreateOrUpdate:"",Update:"update",Create:"create"},YX.PriorityPolicy={None:"none",Overflow:"overflow",PinnedClient:"pinned_client",Prioritized:"prioritized"},YX.PubHeaders={MsgIdHdr:"Nats-Msg-Id",ExpectedStreamHdr:"Nats-Expected-Stream",ExpectedLastSeqHdr:"Nats-Expected-Last-Sequence",ExpectedLastMsgIdHdr:"Nats-Expected-Last-Msg-Id",ExpectedLastSubjectSequenceHdr:"Nats-Expected-Last-Subject-Sequence",ExpectedLastSubjectSequenceSubjectHdr:"Nats-Expected-Last-Subject-Sequence-Subject",MessageTTL:"Nats-TTL",Schedule:"Nats-Schedule",ScheduleTarget:"Nats-Schedule-Target",ScheduleSource:"Nats-Schedule-Source",ScheduleTTL:"Nats-Schedule-TTL",ScheduleTimeZone:"Nats-Schedule-Time-Zone",ScheduleRollup:"Nats-Schedule-Rollup",Scheduler:"Nats-Scheduler",ScheduleNext:"Nats-Schedule-Next"};class YZ extends Yk.BaseApiClientImpl{constructor(e,t){super(e,t)}async addUpdate(e,t,n,r){let i;if((0,YJ.validateStreamName)(e),n=n||{},t.deliver_group&&t.flow_control)throw J9.InvalidArgumentError.format(["flow_control","deliver_group"],"are mutually exclusive");if(t.deliver_group&&t.idle_heartbeat)throw J9.InvalidArgumentError.format(["idle_heartbeat","deliver_group"],"are mutually exclusive");if(YQ(t)){let{min:e,ok:n}=this.nc.features.get(J9.Feature.JS_PRIORITY_GROUPS);if(!n)throw Error(`priority_groups require server ${e}`);if(t.deliver_subject)throw J9.InvalidArgumentError.format("deliver_subject","cannot be set when using priority groups");var a=t;if(YQ(a)){if(!Array.isArray(a.priority_groups))throw J9.InvalidArgumentError.format(["priority_groups"],"must be an array");if(0===a.priority_groups.length)throw J9.InvalidArgumentError.format(["priority_groups"],"must have at least one group");if(a.priority_groups.forEach(e=>{if((0,YJ.minValidation)("priority_group",e),e.length>16)throw J9.errors.InvalidArgumentError.format("group","must be 16 characters or less")}),a.priority_policy!==YX.PriorityPolicy.None&&a.priority_policy!==YX.PriorityPolicy.Overflow&&a.priority_policy!==YX.PriorityPolicy.PinnedClient&&a.priority_policy!==YX.PriorityPolicy.Prioritized)throw J9.InvalidArgumentError.format(["priority_policy"],"must be 'none', 'prioritized', 'overflow', or 'pinned_client'")}}let o={};o.config=t,o.stream_name=e,o.action=n.action||YX.ConsumerApiAction.Create,o.pedantic=n.pedantic||!1,o.config.durable_name&&(0,YJ.validateDurableName)(o.config.durable_name);let s=this.nc,{min:l,ok:u}=s.features.get(J9.Feature.JS_NEW_CONSUMER_CREATE_API),c=""===t.name?void 0:t.name;if(c&&!u)throw J9.InvalidArgumentError.format("name",`requires server ${l}`);if(c)try{(0,YJ.minValidation)("name",c)}catch(n){let e=n.message,t=e.indexOf("cannot contain");if(-1!==t)throw Error(`consumer 'name' ${e.substring(t)}`);throw n}let d="";if(Array.isArray(t.filter_subjects)){let{min:e,ok:t}=s.features.get(J9.Feature.JS_MULTIPLE_CONSUMER_FILTER);if(!t)throw J9.InvalidArgumentError.format("filter_subjects",`requires server ${e}`);u=!1}if(t.metadata){let{min:e,ok:t}=s.features.get(J9.Feature.JS_STREAM_CONSUMER_METADATA);if(!t)throw J9.InvalidArgumentError.format("metadata",`requires server ${e}`)}if(u&&(d=t.name??t.durable_name??""),""!==d){let n=t.filter_subject??void 0;">"===n&&(n=void 0),i=void 0!==n?`${this.prefix}.CONSUMER.CREATE.${e}.${d}.${n}`:`${this.prefix}.CONSUMER.CREATE.${e}.${d}`}else i=t.durable_name?`${this.prefix}.CONSUMER.DURABLE.CREATE.${e}.${t.durable_name}`:`${this.prefix}.CONSUMER.CREATE.${e}`;let h=r??o.config;return await this._request(i,o,{...n,...this.requiredApiOpts(h)})}minConsumerApi(e){return e.ack_policy===YX.AckPolicy.FlowControl?4:"string"==typeof e.pause_until&&""!==e.pause_until||void 0!==e.priority_policy&&e.priority_policy!==YX.PriorityPolicy.None||"number"==typeof e.priority_timeout&&e.priority_timeout>0||Array.isArray(e.priority_groups)&&e.priority_groups.length>0?1:0}requiredApiOpts(e){if(!this.sendRequiredApiLevel())return{};let t=this.minConsumerApi(e);return t>0?{minApiVersion:t}:{}}add(e,t,n){n=n||{};let r=YX.ConsumerApiAction.Create;"string"==typeof n&&(r=n,n={});let i=Object.assign({},{action:r},n);return this.addUpdate(e,t,i)}async update(e,t,n){let r=await this.info(e,t);return this.addUpdate(e,Object.assign(r.config,n),{action:YX.ConsumerApiAction.Update},n)}async info(e,t){return(0,YJ.validateStreamName)(e),(0,YJ.validateDurableName)(t),await this._request(`${this.prefix}.CONSUMER.INFO.${e}.${t}`)}async delete(e,t){return(0,YJ.validateStreamName)(e),(0,YJ.validateDurableName)(t),(await this._request(`${this.prefix}.CONSUMER.DELETE.${e}.${t}`)).success}list(e){(0,YJ.validateStreamName)(e);let t=`${this.prefix}.CONSUMER.LIST.${e}`;return new Yq.ListerImpl(t,e=>e.consumers,this)}pause(e,t,n){let r=`${this.prefix}.CONSUMER.PAUSE.${e}.${t}`,i={pause_until:n.toISOString()};return this._request(r,i)}resume(e,t){return this.pause(e,t,new Date(0))}unpin(e,t,n){let r=`${this.prefix}.CONSUMER.UNPIN.${e}.${t}`;return this._request(r,{group:n})}async reset(e,t,n){(0,YJ.validateStreamName)(e),(0,YJ.validateDurableName)(t);let{min:r,ok:i}=this.nc.features.get(J9.Feature.JS_CONSUMER_RESET);if(!i)throw Error(`consumer reset requires server ${r}`);if("number"==typeof n&&(!Number.isInteger(n)||n<0))throw J9.InvalidArgumentError.format("seq","must be a non-negative integer");let a=`${this.prefix}.CONSUMER.RESET.${e}.${t}`;return await this._request(a,"number"==typeof n?{seq:n}:void 0)}}function YQ(e){return e&&void 0!==e.priority_groups||void 0!==e.priority_policy}"use strict";YW.ConsumerAPIImpl=YZ;"use strict";var Y0={};Object.defineProperty(Y0,"__esModule",{value:!0}),Y0.StreamsImpl=Y0.StoredMsgImpl=Y0.StreamAPIImpl=Y0.StreamImpl=Y0.ConsumersImpl=void 0,Y0.convertStreamSourceDomain=Xs;"use strict";var Y1={};Object.defineProperty(Y1,"__esModule",{value:!0}),Y1.PullConsumerImpl=Y1.PullConsumerMessagesImpl=Y1.PullConsumerType=void 0,Y1.isOverflowOptions=Xe,Y1.isPrioritizedOptions=Xt,Y1.validateOverflowPullOptions=Xr,Y1.validatePrioritizedPullOptions=Xi;var Y2={};Object.defineProperty(Y2,"__esModule",{value:!0}),Y2.JsMsgImpl=Y2.ACK=void 0,Y2.toJsMsg=function(e,t=5e3){return new Y9(e,t)},Y2.parseInfo=Y7,Y2.ACK=Uint8Array.of(43,65,67,75);let Y3=Uint8Array.of(45,78,65,75),Y4=Uint8Array.of(43,87,80,73),Y5=Uint8Array.of(43,78,88,84),Y6=Uint8Array.of(43,84,69,82,77),Y8=Uint8Array.of(32);function Y7(e){let t=e.split(".");if(9===t.length&&t.splice(2,0,"_",""),t.length<11||"$JS"!==t[0]||"ACK"!==t[1])throw Error("unable to parse delivery info - not a jetstream message");let n={};return n.domain="_"===t[2]?"":t[2],n.account_hash=t[3],n.stream=t[4],n.consumer=t[5],n.deliveryCount=parseInt(t[6],10),n.redelivered=n.deliveryCount>1,n.streamSequence=parseInt(t[7],10),n.deliverySequence=parseInt(t[8],10),n.timestampNanos=parseInt(t[9],10),n.pending=parseInt(t[10],10),n}class Y9{msg;di;didAck;timeout;constructor(e,t){this.msg=e,this.didAck=!1,this.timeout=t}get subject(){return this.msg.subject}get sid(){return this.msg.sid}get data(){return this.msg.data}get headers(){return this.msg.headers}get info(){return this.di||(this.di=Y7(this.reply)),this.di}get redelivered(){return this.info.deliveryCount>1}get reply(){return this.msg.reply||""}get seq(){return this.info.streamSequence}get time(){return new Date((0,J9.millis)(this.info.timestampNanos))}get timestamp(){return this.time.toISOString()}get timestampNanos(){let e=this.reply.split(".");if(9===e.length&&e.splice(2,0,"_",""),e.length<11||"$JS"!==e[0]||"ACK"!==e[1])throw Error("unable to parse delivery info - not a jetstream message");return BigInt(e[9])}doAck(e){this.didAck||(this.didAck=!this.isWIP(e),this.msg.respond(e))}isWIP(e){return 4===e.length&&e[0]===Y4[0]&&e[1]===Y4[1]&&e[2]===Y4[2]&&e[3]===Y4[3]}async ackAck(e){let t=(0,J9.deferred)();if(this.didAck)t.resolve(!1);else if(this.didAck=!0,this.msg.reply){(e=e||{}).timeout=e.timeout||this.timeout;let n=this.msg.publisher,r=!n.options?.noAsyncTraces,i=new J9.RequestOne(n.muxSubscriptions,this.msg.reply,{timeout:e.timeout},r);n.request(i);try{n.publish(this.msg.reply,Y2.ACK,{reply:`${n.muxSubscriptions.baseInbox}${i.token}`})}catch(e){i.cancel(e)}try{await Promise.race([i.timer,i.deferred]),t.resolve(!0)}catch(e){i.cancel(e),t.reject(e)}}else t.resolve(!1);return t}ack(){this.doAck(Y2.ACK)}nak(e){let t=Y3;e&&(t=new TextEncoder().encode(`-NAK ${JSON.stringify({delay:(0,J9.nanos)(e)})}`)),this.doAck(t)}working(){this.doAck(Y4)}next(e,t={batch:1}){let n={};n.batch=t.batch||1,n.no_wait=t.no_wait||!1,t.expires&&t.expires>0&&(n.expires=(0,J9.nanos)(t.expires));let r=new TextEncoder().encode(JSON.stringify(n)),i=J9.DataBuffer.concat(Y5,Y8,r);this.msg.respond(i,e?{reply:e}:void 0)}term(e=""){let t=Y6;e?.length>0&&(t=new TextEncoder().encode(`+TERM ${e}`)),this.doAck(t)}json(){return this.msg.json()}string(){return this.msg.string()}}function Xe(e){return e&&"string"==typeof e.group||"number"==typeof e.min_pending||"number"==typeof e.min_ack_pending}function Xt(e){return e&&"string"==typeof e.group&&"number"==typeof e.priority}Y2.JsMsgImpl=Y9,Y1.PullConsumerType={Unset:"",Consume:"consume",Fetch:"fetch"};class Xn extends J9.QueuedIteratorImpl{consumer;opts;sub;monitor;pending;isConsume;callback;listeners;statusIterator;abortOnMissingResource;bind;inboxPrefix;inbox;cancelables;inReset;closeListener;isPinned;isPriority;natsPinId;constructor(e,t,n=!1){if(super(),this.consumer=e,this.isConsume=n,this.cancelables=[],this.inboxPrefix=(0,J9.createInbox)(this.consumer.api.nc.options.inboxPrefix),this.inbox=`${this.inboxPrefix}.${this.consumer.serial}`,this.inReset=!1,this.isPinned=!1,this.isPriority=!1,this.natsPinId="",this.consumer.ordered){if(Xe(t))throw J9.errors.InvalidArgumentError.format(["group","min_pending","min_ack_pending"],"cannot be specified for ordered consumers");if(void 0===this.consumer.orderedConsumerState){let t={},n=e.opts;t.namePrefix=n.name_prefix??`oc_${J9.nuid.next()}`,t.opts=n,t.cursor={stream_seq:1,deliver_seq:0};let r=e._info.config.opt_start_seq||0;t.cursor.stream_seq=r>0?r-1:0,t.createFails=0,this.consumer.orderedConsumerState=t}}if(this.opts=this.parseOptions(t,this.isConsume),this.callback=t.callback||null,this.noIterator="function"==typeof this.callback,this.monitor=null,this.pending={msgs:0,bytes:0,requests:0},this.listeners=[],this.abortOnMissingResource=!0===t.abort_on_missing_resource,this.bind=!0===t.bind,t.group){let{min_pending:e,min_ack_pending:n}=t;this.isPinned=void 0===e&&void 0===n;let{priority:r}=t;this.isPriority="number"==typeof r}this.closeListener={connectionClosedCallback:()=>{this._push(()=>{this.stop()})}},this.consumer.api.nc.addCloseListener(this.closeListener),this.start()}start(){let{max_messages:e,max_bytes:t,idle_heartbeat:n,threshold_bytes:r,threshold_messages:i}=this.opts;this.sub=this.consumer.api.nc.subscribe(this.inbox,{callback:(n,a)=>{if(n)return void this.stop(n);if(this.monitor?.work(),this.consumer.ordered?0===a.subject.indexOf(this?.inboxPrefix):a.subject===this.inbox){if(a.subject!==this.sub.getSubject())return;let e=new YL.JetStreamStatus(a),t=e.parseHeartbeat();if(t)return void this.notify(t);let n=e.code,r=e.description,{msgsLeft:i,bytesLeft:o}=e.parseDiscard();switch((i&&i>0||o&&o>0)&&(this.pending.msgs-=i,this.pending.bytes-=o,this.pending.requests--,this.notify({type:"discard",messagesLeft:i,bytesLeft:o})),n){case 400:this.stop(e.toError());return;case 409:{let t=this.handle409(e);if(t)return void this.stop(t);if(e.isMessageSizeExceedsMaxBytes()&&this.yields.length>0)break;return}case 423:this.natsPinId="",this.notify({type:"consumer_unpinned"});break;case 503:if(this.notify({type:"no_responders",code:n}),this.consumer.ordered&&(this.consumer.orderedConsumerState.needsReset=!0),!this.isConsume)return void this.stop(e.toError());break;default:this.notify({type:"debug",code:n,description:r})}}else{let e=(0,Y2.toJsMsg)(a,this.consumer.api.timeout);if(this.isPinned){let t=e?.headers?.get("Nats-Pin-Id");t&&""===this.natsPinId&&(this.natsPinId=t,this.notify({type:"consumer_pinned",id:t}))}if(this.consumer.ordered){let t=this.consumer.orderedConsumerState.cursor,n=e.info.deliverySequence,r=e.info.streamSequence;if(n!==t.deliver_seq+1)return void this.reset();t.deliver_seq=n,t.stream_seq=r}this._push(e),this.received++,this.pending.msgs&&this.pending.msgs--,this.pending.bytes&&(this.pending.bytes-=a.size())}if(0===this.pending.msgs&&0===this.pending.bytes&&(this.pending.requests=0),this.isConsume){if(e&&this.pending.msgs<=i||t&&this.pending.bytes<=r){let e=this.pullOptions();this.pull(e)}}else 0===this.pending.requests&&this._push(()=>{this.stop()})}}),n&&(this.monitor=new J9.IdleHeartbeatMonitor(n,e=>(this.notify({type:"heartbeats_missed",count:e}),this.isConsume||this.consumer.ordered)?(this.resetPending().then(()=>{}).catch(()=>{}),!1):(this.stop(new YL.JetStreamError("heartbeats missed")),!0),{maxOut:2})),(async()=>{let e=this.consumer.api.nc.status();for await(let t of(this.statusIterator=e,e))switch(t.type){case"disconnect":this.monitor?.cancel();break;case"reconnect":this.resetPending().then(e=>{e&&this.monitor?.restart()}).catch(()=>{})}})(),this.sub.closed.then(()=>{this.sub.isDraining()&&this._push(()=>{this.stop()})}),this.pull(this.pullOptions())}handle409(e){let{code:t,description:n}=e;return(e.isConsumerDeleted()?this.notify({type:"consumer_deleted",code:t,description:n}):e.isExceededLimit()&&this.notify({type:"exceeded_limits",code:t,description:n}),!this.isConsume||e.isConsumerDeleted()&&this.abortOnMissingResource)?e.toError():null}reset(){this.monitor?.cancel();let e=this.consumer.orderedConsumerState,{name:t}=this.consumer._info?.config;t&&(this.notify({type:"reset",name:t}),this.consumer.api.delete(this.consumer.stream,t).catch(()=>{}));let n=this.consumer.getConsumerOpts();this.inbox=`${this.inboxPrefix}.${this.consumer.serial}`,e.cursor.deliver_seq=0,this.consumer.name=n.name,this.consumer.api.nc._resub(this.sub,this.inbox),this.consumer.api.add(this.consumer.stream,n).then(t=>{e.createFails=0,this.consumer._info=t,this.notify({type:"ordered_consumer_recreated",name:t.name}),this.monitor?.restart(),this.pull(this.pullOptions())}).catch(t=>{if(e.createFails++,"stream not found"===t.message&&(this.notify({type:"stream_not_found",consumerCreateFails:e.createFails,name:this.consumer.stream}),this.abortOnMissingResource))return void this.stop(t);e.createFails>=30&&0===this.received&&this.stop(t);let n=(0,J9.backoff)(),r=(0,J9.delay)(n.backoff(e.createFails));r.then(()=>{let e=this.cancelables.indexOf(r);-1!==e&&(this.cancelables=this.cancelables.splice(e,e)),this.done||this.reset()}).catch(e=>{}),this.cancelables.push(r)})}_push(e){if(this.callback){let t="function"==typeof e?e:null;try{t?t():this.callback(e)}catch(e){this.stop(e)}}else super.push(e)}notify(e){this.listeners.length>0&&this.listeners.forEach(t=>{t.done||t.push(e)})}async resetPending(){if(this.inReset)return Promise.resolve(!0);this.inReset=!0;let e=this.bind?this.resetPendingNoInfo():this.resetPendingWithInfo(),t=await e;return this.inReset=!1,t}resetPendingNoInfo(){return this.pending.msgs=0,this.pending.bytes=0,this.pending.requests=0,this.pull(this.pullOptions()),Promise.resolve(!0)}async resetPendingWithInfo(){let e=0,t=(0,J9.backoff)([this.opts.expires||3e4]),n=0;for(;;){if(this.done||this.consumer.api.nc.isClosed())return!1;try{return await this.consumer.info(),e=0,this.pending.msgs=0,this.pending.bytes=0,this.pending.requests=0,this.pull(this.pullOptions()),!0}catch(a){if(a instanceof J9.errors.ClosedConnectionError)return this.stop(a),!1;if("stream not found"===a.message){if(this.notify({type:"stream_not_found",name:this.consumer.stream}),!this.isConsume||this.abortOnMissingResource)return this.stop(a),!1}else if("consumer not found"===a.message){if(e++,this.notify({type:"consumer_not_found",name:this.consumer.name,stream:this.consumer.stream,count:e}),!this.isConsume||this.abortOnMissingResource)return this.consumer.ordered&&(this.consumer.orderedConsumerState.needsReset=!0),this.stop(a),!1;if(this.consumer.ordered)return this.reset(),!1}else e=0;let r=t.backoff(n),i=(0,J9.delay)(r);await Promise.race([i,this.consumer.api.nc.closed()]),i.cancel(),n++}}}pull(e){this.pending.bytes+=e.max_bytes??0,this.pending.msgs+=e.batch??0,this.pending.requests++;let t=this.consumer.api.nc,n=`${this.consumer.api.prefix}.CONSUMER.MSG.NEXT.${this.consumer.stream}.${this.consumer._info.name}`;this._push(()=>{t.publish(n,JSON.stringify(e),{reply:this.inbox}),this.notify({type:"next",options:e})})}pullOptions(){let e={batch:this.opts.max_messages-this.pending.msgs,max_bytes:this.opts.max_bytes-this.pending.bytes,idle_heartbeat:(0,J9.nanos)(this.opts.idle_heartbeat),expires:(0,J9.nanos)(this.opts.expires)};return this.isPinned&&""!==this.natsPinId&&(e.id=this.natsPinId),Xe(this.opts)&&(e.group=this.opts.group,this.opts.min_pending&&(e.min_pending=this.opts.min_pending),this.opts.min_ack_pending&&(e.min_ack_pending=this.opts.min_ack_pending)),Xt(this.opts)&&(e.group=this.opts.group,e.priority=this.opts.priority),e}close(){return this.stop(),this.iterClosed}closed(){return this.iterClosed}clearTimers(){this.monitor?.cancel(),this.monitor=null}stop(e){this.done||(this.consumer.api.nc.removeCloseListener(this.closeListener),this.sub?.unsubscribe(),this.clearTimers(),this.statusIterator?.stop(),this._push(()=>{super.stop(e),this.listeners.forEach(e=>{e.stop()})}))}parseOptions(e,t=!1){let n=e||{};if(n.max_messages=n.max_messages||0,n.max_bytes=n.max_bytes||0,0!==n.max_messages&&0!==n.max_bytes)throw J9.errors.InvalidArgumentError.format(["max_messages","max_bytes"],"are mutually exclusive");if(0===n.max_messages&&(n.max_messages=100),n.expires=n.expires||3e4,n.expires<1e3)throw J9.errors.InvalidArgumentError.format("expires","must be at least 1000ms");if(n.idle_heartbeat=n.idle_heartbeat||n.expires/2,n.idle_heartbeat=n.idle_heartbeat>3e4?3e4:n.idle_heartbeat,n.idle_heartbeat<500&&(n.idle_heartbeat=500),t){let e=Math.round(.75*n.max_messages)||1;n.threshold_messages=n.threshold_messages||e;let t=Math.round(.75*n.max_bytes)||1;n.threshold_bytes=n.threshold_bytes||t}if(Xe(e)){let{min:t,ok:r}=this.consumer.api.nc.features.get(J9.Feature.JS_PRIORITY_GROUPS);if(!r)throw Error(`priority_groups require server ${t}`);Xr(e),e.group&&(n.group=e.group),e.min_ack_pending&&(n.min_ack_pending=e.min_ack_pending),e.min_pending&&(n.min_pending=e.min_pending)}else Xt(e)&&(Xi(e),e.group&&(n.group=e.group),"number"==typeof e.priority&&(n.priority=e.priority));return n}status(){let e=new J9.QueuedIteratorImpl;return this.listeners.push(e),e}}function Xr(e){if(Xe(e)){if((0,YJ.minValidation)("group",e.group),e.group.length>16)throw J9.errors.InvalidArgumentError.format("group","must be 16 characters or less");let{min_pending:t,min_ack_pending:n}=e;if(t&&"number"!=typeof t)throw J9.errors.InvalidArgumentError.format(["min_pending"],"must be a number");if(n&&"number"!=typeof n)throw J9.errors.InvalidArgumentError.format(["min_ack_pending"],"must be a number")}}function Xi(e){if(Xt(e)){if((0,YJ.minValidation)("group",e.group),e.group.length>16)throw J9.errors.InvalidArgumentError.format("group","must be 16 characters or less");let{priority:t}=e;if(t&&"number"!=typeof t)throw J9.errors.InvalidArgumentError.format(["priority"],"must be a number")}}"use strict";Y1.PullConsumerMessagesImpl=Xn,Y1.PullConsumerImpl=class{api;_info;stream;name;opts;type;messages;ordered;serial;orderedConsumerState;constructor(e,t,n=null){this.api=e,this._info=t,this.name=t.name,this.stream=t.stream_name,this.ordered=null!==n,this.opts=n||{},this.serial=1,this.type=Y1.PullConsumerType.Unset}debug(){console.log({serial:this.serial,cursor:this.orderedConsumerState?.cursor})}isPullConsumer(){return!0}isPushConsumer(){return!1}consume(e={max_messages:100,expires:3e4}){if(e={...e},this.ordered){if(e.bind)return Promise.reject(J9.errors.InvalidArgumentError.format("bind","is not supported"));if(this.type===Y1.PullConsumerType.Fetch)return Promise.reject(new J9.errors.InvalidOperationError("ordered consumer initialized as fetch"));if(this.type===Y1.PullConsumerType.Consume)return Promise.reject(new J9.errors.InvalidOperationError("ordered consumer doesn't support concurrent consume"));this.type=Y1.PullConsumerType.Consume}return Promise.resolve(new Xn(this,e,!0))}async fetch(e={max_messages:100,expires:3e4}){if(e={...e},this.ordered){if(e.group)return Promise.reject(J9.errors.InvalidArgumentError.format("group","ordered consumers don't support priority groups"));if(e.bind)return Promise.reject(J9.errors.InvalidArgumentError.format("bind","is not supported"));if(this.type===Y1.PullConsumerType.Consume)return Promise.reject(new J9.errors.InvalidOperationError("ordered consumer already initialized as consume"));if(this.messages?.done===!1)return Promise.reject(new J9.errors.InvalidOperationError("ordered consumer doesn't support concurrent fetch"));this.ordered&&(this.orderedConsumerState?.cursor?.deliver_seq&&(this._info.config.opt_start_seq=this.orderedConsumerState?.cursor.stream_seq+1),this.orderedConsumerState?.needsReset===!0&&await this._reset()),this.type=Y1.PullConsumerType.Fetch}let t=new Xn(this,e);return this.ordered&&(this.messages=t),Promise.resolve(t)}async next(e={expires:3e4}){let t=e={...e};t.max_messages=1;let n=await this.fetch(t);try{for await(let e of n)return e}catch(e){return Promise.reject(e)}return null}delete(){let{stream_name:e,name:t}=this._info;return this.api.delete(e,t)}getConsumerOpts(){let e=this.orderedConsumerState;this.serial++,this.name=`${e.namePrefix}_${this.serial}`;let t=Object.assign({},this._info.config,{name:this.name,deliver_policy:YX.DeliverPolicy.StartSequence,opt_start_seq:e.cursor.stream_seq+1,ack_policy:YX.AckPolicy.None,inactive_threshold:(0,J9.nanos)(3e5),num_replicas:1});return delete t.metadata,t}async _reset(){if(void 0===this.messages)throw Error("not possible to reset");this.delete().catch(()=>{});let e=this.getConsumerOpts(),t=await this.api.add(this.stream,e);return this._info=t,t}async info(e=!1){if(e)return Promise.resolve(this._info);let{stream_name:t,name:n}=this._info;return this._info=await this.api.info(t,n),this._info}};var Xa={};Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.PushConsumerImpl=Xa.PushConsumerMessagesImpl=void 0;class Xo extends J9.QueuedIteratorImpl{consumer;sub;monitor;listeners;abortOnMissingResource;callback;ordered;cursor;namePrefix;deliverPrefix;serial;createFails;statusIterator;cancelables;constructor(e,t={},n={}){if(super(),this.consumer=e,this.monitor=null,this.listeners=[],this.cancelables=[],this.abortOnMissingResource=!0===t.abort_on_missing_resource,this.callback=t.callback||null,this.noIterator=null!==this.callback,this.namePrefix=null,this.deliverPrefix=null,this.ordered=!0===n.ordered,this.serial=1,this.ordered){this.namePrefix=n.name_prefix??`oc_${J9.nuid.next()}`,this.deliverPrefix=n.deliver_prefix??(0,J9.createInbox)(this.consumer.api.nc.options.inboxPrefix),this.cursor={stream_seq:1,deliver_seq:0};let t=e._info.config.opt_start_seq||0;this.cursor.stream_seq=t>0?t-1:0,this.createFails=0}this.start()}reset(){let{name:e}=this.consumer._info?.config;e&&this.consumer.api.delete(this.consumer.stream,e).catch(()=>{});let t=this.getConsumerOpts();this.cursor.deliver_seq=0,this.consumer.name=t.name,this.consumer.serial=this.serial,this.consumer.api.nc._resub(this.sub,t.deliver_subject),this.consumer.api.add(this.consumer.stream,t).then(e=>{this.createFails=0,this.consumer._info=e,this.notify({type:"ordered_consumer_recreated",name:e.name})}).catch(e=>{if(this.createFails++,"stream not found"===e.message&&(this.notify({type:"stream_not_found",name:this.consumer.stream,consumerCreateFails:this.createFails}),this.abortOnMissingResource))return void this.stop(e);this.createFails>=30&&0===this.received&&this.stop(e);let t=(0,J9.backoff)(),n=(0,J9.delay)(t.backoff(this.createFails));n.then(()=>{this.done||this.reset()}).catch(()=>{}).finally(()=>{let e=this.cancelables.indexOf(n);-1!==e&&(this.cancelables=this.cancelables.splice(e,e))}),this.cancelables.push(n)})}getConsumerOpts(){let e=Object.assign({},this.consumer._info.config);return this.serial++,Object.assign(e,{name:`${this.namePrefix}_${this.serial}`,deliver_policy:YX.DeliverPolicy.StartSequence,opt_start_seq:this.cursor.stream_seq+1,ack_policy:YX.AckPolicy.None,inactive_threshold:(0,J9.nanos)(3e5),num_replicas:1,flow_control:!0,idle_heartbeat:(0,J9.nanos)(3e4),deliver_subject:`${this.deliverPrefix}.${this.serial}`})}closed(){return this.iterClosed}close(){return this.stop(),this.iterClosed}stop(e){this.done||(this.statusIterator?.stop(),this.monitor?.cancel(),this.monitor=null,this.cancelables.forEach(e=>{e.cancel()}),Promise.all(this.cancelables).then(()=>{this.cancelables=[]}).catch(()=>{}).finally(()=>{this._push(()=>{super.stop(e),this.listeners.forEach(e=>{e.stop()})})}))}_push(e){if(this.callback){let t="function"==typeof e?e:null;try{t?t():(this.received++,this.callback(e),this.processed++)}catch(e){this.stop(e)}}else super.push(e)}status(){let e=new J9.QueuedIteratorImpl;return this.listeners.push(e),e}start(){let{deliver_subject:e,deliver_group:t,idle_heartbeat:n}=this.consumer._info.config;if(!e)throw Error("bad consumer info");if(n){let e=(0,J9.millis)(n);this.monitor=new J9.IdleHeartbeatMonitor(e,e=>(this.notify({type:"heartbeats_missed",count:e}),this.ordered&&this.reset(),!1),{maxOut:2}),(async()=>{for await(let e of(this.statusIterator=this.consumer.api.nc.status(),this.statusIterator))switch(e.type){case"disconnect":this.monitor?.cancel();break;case"reconnect":this.monitor?.restart()}})()}this.sub=this.consumer.api.nc.subscribe(e,{queue:t,callback:(t,n)=>{if(t)return void this.stop(t);if(this.monitor?.work(),this.ordered?0===n.subject.indexOf(this?.deliverPrefix):n.subject===e){if(n.subject!==this.sub.getSubject())return;let e=new YL.JetStreamStatus(n);if(e.isFlowControlRequest())return void this._push(()=>{n.respond(),this.notify({type:"flow_control"})});if(e.isIdleHeartbeat()){let e=parseInt(n.headers?.get(YO.JsHeaders.LastConsumerSeqHdr)||"0"),t=parseInt(n.headers?.get(YO.JsHeaders.LastStreamSeqHdr)??"0");this.notify({type:"heartbeat",lastStreamSequence:t,lastConsumerSequence:e});let r=n.headers?.get(YO.JsHeaders.ConsumerStalledHdr);"string"==typeof r&&""!==r&&n.publisher.publish(r,J9.Empty);return}let t=e.code,r=e.description;if(e.isConsumerDeleted()&&this.notify({type:"consumer_deleted",code:t,description:r}),this.abortOnMissingResource)return void this._push(()=>{this.stop(e.toError())})}else{let e=(0,Y2.toJsMsg)(n);if(this.ordered){let t=e.info.deliverySequence;if(t!==this.cursor.deliver_seq+1)return void this.reset();this.cursor.deliver_seq=t,this.cursor.stream_seq=e.info.streamSequence}this._push(e)}}}),this.sub.closed.then(()=>{this._push(()=>{this.stop()})}),this.closed().then(()=>{this.sub?.unsubscribe()})}notify(e){this.listeners.length>0&&this.listeners.forEach(t=>{t.done||t.push(e)})}}function Xs(e){if(void 0===e)return;let{domain:t}=e;if(void 0===t)return e;let n=Object.assign({},e);if(delete n.domain,""===t)return n;if(n.external)throw J9.InvalidArgumentError.format(["domain","external"],"are mutually exclusive");return n.external={api:`$JS.${t}.API`},n}Xa.PushConsumerMessagesImpl=Xo,Xa.PushConsumerImpl=class{api;_info;stream;name;bound;ordered;started;serial;opts;constructor(e,t,n={}){this.api=e,this._info=t,this.stream=t.stream_name,this.name=t.name,this.bound=!0===n.bound,this.started=!1,this.opts=n,this.serial=0,this.ordered=n.ordered||!1,this.ordered&&(this.serial=1)}consume(e={}){if(e={...e},this.started)return Promise.reject(new J9.errors.InvalidOperationError("consumer already started"));if(!this._info.config.deliver_subject)return Promise.reject(Error("deliver_subject is not set, not a push consumer"));if(!this._info.config.deliver_group&&this._info.push_bound)return Promise.reject(new J9.errors.InvalidOperationError("consumer is already bound"));let t=new Xo(this,e,this.opts);return this.started=!0,t.closed().then(()=>{this.started=!1}),Promise.resolve(t)}delete(){if(this.bound)return Promise.reject(new J9.errors.InvalidOperationError("bound consumers cannot delete"));let{stream_name:e,name:t}=this._info;return this.api.delete(e,t)}async info(e){if(this.bound)return Promise.reject(new J9.errors.InvalidOperationError("bound consumers cannot info"));if(e)return Promise.resolve(this._info);let t=await this.api.info(this.stream,this.name);return this._info=t,t}isPullConsumer(){return!1}isPushConsumer(){return!0}};class Xl{api;notified;constructor(e){this.api=e,this.notified=!1}checkVersion(){let e=this.api.nc.features.get(J9.Feature.JS_SIMPLIFICATION);return e.ok?Promise.resolve():Promise.reject(Error(`consumers framework is only supported on servers ${e.min} or better`))}async getPushConsumer(e,t){if(await this.checkVersion(),(0,YJ.minValidation)("stream",e),"string"==typeof t){(0,YJ.minValidation)("name",t);let n=await this.api.info(e,t);return"string"!=typeof n.config.deliver_subject?Promise.reject(Error("not a push consumer")):new Xa.PushConsumerImpl(this.api,n)}return void 0===t?this.getOrderedPushConsumer(e):(0,YO.isOrderedPushConsumerOptions)(t)?this.getOrderedPushConsumer(e,t):Promise.reject(Error("unsupported push consumer type"))}async getOrderedPushConsumer(e,t={}){let{name_prefix:n,deliver_prefix:r,filter_subjects:i}=t=Object.assign({},t);delete t.deliver_prefix,delete t.name_prefix,delete t.filter_subjects,"number"==typeof t.opt_start_seq&&(t.deliver_policy=YX.DeliverPolicy.StartSequence),"string"==typeof t.opt_start_time&&(t.deliver_policy=YX.DeliverPolicy.StartTime),n=n||`oc_${J9.nuid.next()}`,(0,YJ.minValidation)("name_prefix",n),r=r||(0,J9.createInbox)(this.api.getOptions().watcherPrefix);let a=Object.assign({},t);a.ack_policy=YX.AckPolicy.None,a.inactive_threshold=(0,J9.nanos)(3e5),a.num_replicas=1,a.max_deliver=1,a.flow_control=!0,a.idle_heartbeat=(0,J9.nanos)(3e4),Array.isArray(i)&&(a.filter_subjects=i),"string"==typeof i&&(a.filter_subject=i),void 0===a.filter_subjects&&void 0===a.filter_subject&&(a.filter_subject=">"),a.name=`${n}_1`,a.deliver_subject=`${r}.1`;let o=await this.api.add(e,a),s={name_prefix:n,deliver_prefix:r,ordered:!0};return new Xa.PushConsumerImpl(this.api,o,s)}getBoundPushConsumer(e){return(0,YO.isBoundPushConsumerOptions)(e)?Promise.resolve(new Xa.PushConsumerImpl(this.api,{config:e},{bound:!0})):Promise.reject(J9.errors.InvalidArgumentError.format("deliver_subject","is required"))}async get(e,t){if(await this.checkVersion(),"string"!=typeof t)return this.ordered(e,t);{let n=await this.api.info(e,t);return"string"==typeof n.config.deliver_subject?Promise.reject(Error("not a pull consumer")):new Y1.PullConsumerImpl(this.api,n)}}getConsumerFromInfo(e){if("string"==typeof e.config.deliver_subject)throw Error("not a pull consumer");return new Y1.PullConsumerImpl(this.api,e)}async ordered(e,t={}){await this.checkVersion();let n=this.api,r=new Xc(n.nc,n.opts);await r.info(e),"string"==typeof t.name_prefix&&(0,YJ.minValidation)("name_prefix",t.name_prefix),t.name_prefix=t.name_prefix||J9.nuid.next();let i={name:`${t.name_prefix}_1`,deliver_policy:YX.DeliverPolicy.StartSequence,opt_start_seq:t.opt_start_seq||1,ack_policy:YX.AckPolicy.None,inactive_threshold:(0,J9.nanos)(3e5),num_replicas:1,max_deliver:1,mem_storage:!0};!0===t.headers_only&&(i.headers_only=!0),Array.isArray(t.filter_subjects)&&(i.filter_subjects=t.filter_subjects),"string"==typeof t.filter_subjects&&(i.filter_subject=t.filter_subjects),t.replay_policy&&(i.replay_policy=t.replay_policy),i.deliver_policy=t.deliver_policy||YX.DeliverPolicy.StartSequence,(t.deliver_policy===YX.DeliverPolicy.All||t.deliver_policy===YX.DeliverPolicy.LastPerSubject||t.deliver_policy===YX.DeliverPolicy.New||t.deliver_policy===YX.DeliverPolicy.Last)&&(delete i.opt_start_seq,i.deliver_policy=t.deliver_policy),i.deliver_policy===YX.DeliverPolicy.LastPerSubject&&void 0===i.filter_subjects&&void 0===i.filter_subject&&(i.filter_subject=">"),t.opt_start_time&&(delete i.opt_start_seq,i.deliver_policy=YX.DeliverPolicy.StartTime,i.opt_start_time=t.opt_start_time),t.inactive_threshold&&(i.inactive_threshold=(0,J9.nanos)(t.inactive_threshold));let a=await this.api.add(e,i);return Promise.resolve(new Y1.PullConsumerImpl(this.api,a,t))}}Y0.ConsumersImpl=Xl;class Xu{api;_info;constructor(e,t){this.api=e,this._info=t}get name(){return this._info.config.name}alternates(){return this.info().then(e=>e.alternates?e.alternates:[])}async best(){if(await this.info(),!this._info.alternates)return this;{let e=await this.api.info(this._info.alternates[0].name);return new Xu(this.api,e)}}info(e=!1,t){return e?Promise.resolve(this._info):this.api.info(this.name,t).then(e=>(this._info=e,this._info))}getConsumer(e){return new Xl(new YW.ConsumerAPIImpl(this.api.nc,this.api.opts)).get(this.name,e)}getPushConsumer(e){return new Xl(new YW.ConsumerAPIImpl(this.api.nc,this.api.opts)).getPushConsumer(this.name,e)}getMessage(e){return this.api.getMessage(this.name,e)}deleteMessage(e,t=!0){return this.api.deleteMessage(this.name,e,t)}resetConsumer(e,t){return new YW.ConsumerAPIImpl(this.api.nc,this.api.opts).reset(this.name,e,t)}}Y0.StreamImpl=Xu;class Xc extends Yk.BaseApiClientImpl{constructor(e,t){super(e,t)}checkStreamConfigVersions(e){let t=this.nc;if(e.metadata){let{min:e,ok:n}=t.features.get(J9.Feature.JS_STREAM_CONSUMER_METADATA);if(!n)throw Error(`stream 'metadata' requires server ${e}`)}if(e.first_seq){let{min:e,ok:n}=t.features.get(J9.Feature.JS_STREAM_FIRST_SEQ);if(!n)throw Error(`stream 'first_seq' requires server ${e}`)}if(e.subject_transform){let{min:e,ok:n}=t.features.get(J9.Feature.JS_STREAM_SUBJECT_TRANSFORM);if(!n)throw Error(`stream 'subject_transform' requires server ${e}`)}if(e.compression){let{min:e,ok:n}=t.features.get(J9.Feature.JS_STREAM_COMPRESSION);if(!n)throw Error(`stream 'compression' requires server ${e}`)}if(e.consumer_limits){let{min:e,ok:n}=t.features.get(J9.Feature.JS_DEFAULT_CONSUMER_LIMITS);if(!n)throw Error(`stream 'consumer_limits' requires server ${e}`)}function n(e,n){if((n?.subject_transforms?.length||0)>0){let{min:n,ok:r}=t.features.get(J9.Feature.JS_STREAM_SOURCE_SUBJECT_TRANSFORM);if(!r)throw Error(`${e} 'subject_transforms' requires server ${n}`)}}e.sources&&e.sources.forEach(e=>{n("stream sources",e)}),e.mirror&&n("stream mirror",e.mirror)}minStreamApi(e){return!0===e.allow_batched||e.mirror?.consumer||e.sources?.some(e=>e.consumer)?4:!0===e.allow_msg_counter||!0===e.allow_atomic||!0===e.allow_msg_schedules||e.persist_mode===YX.PersistMode.Async?2:+(!0===e.allow_msg_ttl||"number"==typeof e.subject_delete_marker_ttl&&e.subject_delete_marker_ttl>0)}requiredApiOpts(e){if(!this.sendRequiredApiLevel())return{};let t=this.minStreamApi(e);return t>0?{minApiVersion:t}:{}}async add(e){this.checkStreamConfigVersions(e),(0,YJ.validateStreamName)(e.name),e.mirror=Xs(e.mirror),e.sources=e.sources?.map(Xs);let t=await this._request(`${this.prefix}.STREAM.CREATE.${e.name}`,e,this.requiredApiOpts(e));return this._fixInfo(t),t}async delete(e){return(0,YJ.validateStreamName)(e),(await this._request(`${this.prefix}.STREAM.DELETE.${e}`)).success}async update(e,t={}){if("object"==typeof e){let n=e;e=n.name,t=n,console.trace("\x1b[33m >> streams.update(config: StreamConfig) api changed to streams.update(name: string, config: StreamUpdateConfig) - this shim will be removed - update your code. \x1b[0m")}this.checkStreamConfigVersions(t),(0,YJ.validateStreamName)(e);let n=Object.assign((await this.info(e)).config,t);n.mirror=Xs(n.mirror),n.sources=n.sources?.map(Xs);let r=await this._request(`${this.prefix}.STREAM.UPDATE.${e}`,n,this.requiredApiOpts(t));return this._fixInfo(r),r}async info(e,t){(0,YJ.validateStreamName)(e);let n=`${this.prefix}.STREAM.INFO.${e}`,r=await this._request(n,t),{total:i,limit:a}=r,o=r.state.subjects?Object.getOwnPropertyNames(r.state.subjects).length:1;if(i&&i>o){let e=[r],s=t||{},l=0;for(;i>o;){s.offset=a*++l;let t=await this._request(n,s);i=t.total,e.push(t);let r=Object.getOwnPropertyNames(t.state.subjects).length;if(o+=r,r<a)break}let u={};for(let t=0;t<e.length;t++)(r=e[t]).state.subjects&&(u=Object.assign(u,r.state.subjects));r.offset=0,r.total=0,r.limit=0,r.state.subjects=u}return this._fixInfo(r),r}list(e=""){let t=e?.length?{subject:e}:{},n=e=>(e.streams.forEach(e=>{this._fixInfo(e)}),e.streams),r=`${this.prefix}.STREAM.LIST`;return new Yq.ListerImpl(r,n,this,t)}_fixInfo(e){e.config.sealed=e.config.sealed||!1,e.config.deny_delete=e.config.deny_delete||!1,e.config.deny_purge=e.config.deny_purge||!1,e.config.allow_rollup_hdrs=e.config.allow_rollup_hdrs||!1}async purge(e,t){if(t){let{keep:e,seq:n}=t;if("number"==typeof e&&"number"==typeof n)throw J9.InvalidArgumentError.format(["keep","seq"],"are mutually exclusive")}return(0,YJ.validateStreamName)(e),await this._request(`${this.prefix}.STREAM.PURGE.${e}`,t)}async deleteMessage(e,t,n=!0){(0,YJ.validateStreamName)(e);let r={seq:t};return n||(r.no_erase=!0),(await this._request(`${this.prefix}.STREAM.MSG.DELETE.${e}`,r)).success}async getMessage(e,t){(0,YJ.validateStreamName)(e);try{let n=await this._request(`${this.prefix}.STREAM.MSG.GET.${e}`,t);return new Xd(n)}catch(e){if(e instanceof YL.JetStreamApiError&&e.code===YL.JetStreamApiCodes.NoMessageFound)return null;return Promise.reject(e)}}find(e){return this.findStream(e)}names(e=""){let t=e?.length?{subject:e}:{},n=`${this.prefix}.STREAM.NAMES`;return new Yq.ListerImpl(n,e=>e.streams,this,t)}async get(e){return Promise.resolve(new Xu(this,await this.info(e)))}}Y0.StreamAPIImpl=Xc;class Xd{_header;smr;static jc;constructor(e){this.smr=e}get pending(){return 0}get lastSequence(){return 0}get subject(){return this.smr.message.subject}get seq(){return this.smr.message.seq}get timestamp(){return this.smr.message.time}get time(){return new Date(Date.parse(this.timestamp))}get data(){return this.smr.message.data?this._parse(this.smr.message.data):J9.Empty}get header(){if(!this._header)if(this.smr.message.hdrs){let e=this._parse(this.smr.message.hdrs);this._header=J9.MsgHdrsImpl.decode(e)}else this._header=(0,J9.headers)();return this._header}_parse(e){let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r}json(e){return JSON.parse(new TextDecoder().decode(this.data),e)}string(){return J9.TD.decode(this.data)}}"use strict";Y0.StoredMsgImpl=Xd,Y0.StreamsImpl=class{api;constructor(e){this.api=e}get(e){return this.api.info(e).then(e=>new Xu(this.api,e))}};var Xh={};Object.defineProperty(Xh,"__esModule",{value:!0}),Xh.DirectConsumer=Xh.DirectMsgImpl=Xh.DirectStreamAPIImpl=void 0;class Xp extends Yk.BaseApiClientImpl{constructor(e,t){super(e,t)}async getMessage(e,t){if((0,YJ.validateStreamName)(e),"start_time"in t){let{min:e,ok:t}=this.nc.features.get(J9.Feature.JS_BATCH_DIRECT_GET);if(!t)throw Error(`start_time direct option require server ${e}`)}let n=t,{last_by_subj:r}=n;r&&(n=null);let i=n?JSON.stringify(n):J9.Empty,a=this.opts.apiPrefix||"$JS.API",o=r?`${a}.DIRECT.GET.${e}.${r}`:`${a}.DIRECT.GET.${e}`,s=await this.nc.request(o,i,{timeout:this.timeout});if(s.headers?.code!==0){let e=new YL.JetStreamStatus(s);return e.isMessageNotFound()?Promise.resolve(null):Promise.reject(e.toError())}return Promise.resolve(new Xm(s))}getBatch(e,t){return t.batch=t.batch||1024,this.get(e,t)}getLastMessagesFor(e,t){return this.get(e,t)}get(e,t){t={...t};let{min:n,ok:r}=this.nc.features.get(J9.Feature.JS_BATCH_DIRECT_GET);if(!r)return Promise.reject(Error(`batch direct require server ${n}`));(0,YJ.validateStreamName)(e);let i="function"==typeof t.callback?t.callback:null,a=new J9.QueuedIteratorImpl;i&&a.iterClosed.then(e=>{o({err:e||void 0},{}),u.unsubscribe()});let o=i?function(e,t){"function"==typeof t?t():i(e,t)}:function(e,t){e?a.push(()=>{e.err?a.stop(e.err):a.stop()}):a.push(t)},s=(0,J9.createInbox)(this.nc.options.inboxPrefix),l=!1,u=this.nc.subscribe(s,{timeout:5e3,callback:(e,t)=>{if(e){a.stop(e),u.unsubscribe();return}let n=YL.JetStreamStatus.maybeParseStatus(t);if(n){if(n.isNoResults()&&o({},()=>{a.stop()}),n.isEndOfBatch())o({},()=>{a.stop()});else{let e=n.toError();o({err:e},()=>{a.stop(e)})}return}l||("string"!=typeof t.headers?.get("Nats-Num-Pending")?(u.unsubscribe(),o({},()=>{a.stop()})):l=!0),o(null,new Xm(t))}}),c=this.opts.apiPrefix||"$JS.API",d=`${c}.DIRECT.GET.${e}`,h=JSON.stringify(t,(e,t)=>("up_to_time"===e||"start_time"===e)&&t instanceof Date?t.toISOString():t);return this.nc.publish(d,h,{reply:s}),Promise.resolve(a)}}Xh.DirectStreamAPIImpl=Xp;class Xm{data;header;constructor(e){if(!e.headers)throw Error("headers expected");this.data=e.data,this.header=e.headers}get subject(){return this.header.last(YO.DirectMsgHeaders.Subject)}get seq(){let e=this.header.last(YO.DirectMsgHeaders.Sequence);return"string"==typeof e?parseInt(e):0}get time(){return new Date(Date.parse(this.timestamp))}get timestamp(){return this.header.last(YO.DirectMsgHeaders.TimeStamp)}get stream(){return this.header.last(YO.DirectMsgHeaders.Stream)}get lastSequence(){let e=this.header.last(YO.DirectMsgHeaders.LastSequence);return"string"==typeof e?parseInt(e):0}get pending(){let e=this.header.last(YO.DirectMsgHeaders.NumPending);return"string"==typeof e?parseInt(e):-1}json(e){return JSON.parse(new TextDecoder().decode(this.data),e)}string(){return J9.TD.decode(this.data)}}function Xf(e){let t=e.expect||{},n=e.headers||(0,J9.headers)();if(e.msgID&&n.set(YX.PubHeaders.MsgIdHdr,e.msgID),t.lastMsgID&&n.set(YX.PubHeaders.ExpectedLastMsgIdHdr,t.lastMsgID),t.streamName&&n.set(YX.PubHeaders.ExpectedStreamHdr,t.streamName),"number"==typeof t.lastSequence&&n.set(YX.PubHeaders.ExpectedLastSeqHdr,`${t.lastSequence}`),"number"==typeof t.lastSubjectSequence&&n.set(YX.PubHeaders.ExpectedLastSubjectSequenceHdr,`${t.lastSubjectSequence}`),t.lastSubjectSequenceSubject&&n.set(YX.PubHeaders.ExpectedLastSubjectSequenceSubjectHdr,t.lastSubjectSequenceSubject),e.ttl&&n.set(YX.PubHeaders.MessageTTL,`${e.ttl}`),e.schedule&&e.cancelSchedule)throw Error("schedule and cancelSchedule are mutually exclusive");if(e.schedule){let t=e.schedule;t.specification&&n.set(YX.PubHeaders.Schedule,Xb(t.specification)),t.target&&n.set(YX.PubHeaders.ScheduleTarget,t.target),t.source&&n.set(YX.PubHeaders.ScheduleSource,t.source),t.ttl&&n.set(YX.PubHeaders.ScheduleTTL,t.ttl),t.timezone&&n.set(YX.PubHeaders.ScheduleTimeZone,t.timezone),t.rollup&&n.set(YX.PubHeaders.ScheduleRollup,t.rollup)}return e.cancelSchedule&&(n.set(YX.PubHeaders.Scheduler,e.cancelSchedule.scheduleSubject),n.set(YX.PubHeaders.ScheduleNext,"purge")),n}function Xg(e,t={}){return new X_(e,t)}async function Xv(e,t={}){let n=new Xy(e,t);if(!1!==t.checkAPI)try{await n.getAccountInfo()}catch(e){throw e}return n}Xh.DirectMsgImpl=Xm,Xh.DirectConsumer=class{stream;api;cursor;listeners;start;constructor(e,t,n){this.stream=e,this.api=t,this.cursor={last:0},this.listeners=[],this.start=n}getOptions(e){var t,n;e=e||{};let r={};return 0===this.cursor.last?"object"==typeof(t=this.start)&&"start_time"in t?r.start_time=this.start.start_time:r.seq=this.start.seq||1:r.seq=this.cursor.last+1,"object"==typeof(n=e)&&"max_bytes"in n?r.max_bytes=e.max_bytes:r.batch=e.batch??100,r}status(){let e=new J9.QueuedIteratorImpl;return this.listeners.push(e),e}notify(e){let t;this.listeners.length>0&&(t=[],this.listeners.forEach(n=>{n.done?t.push(n):n.push(e)}),this.listeners=this.listeners.filter(e=>!t.includes(e)))}debug(){console.log(this.cursor)}consume(e){let t,n,r=new J9.QueuedIteratorImpl;return(async()=>{for(;0===this.cursor.pending&&(this.notify({type:"debug",code:0,description:"sleeping for 2500"}),t=(0,J9.delay)(2500),await t),!r.done;){n=(0,J9.deferred)();let i=this.getOptions(e);this.notify({type:"next",options:Object.assign({},e)}),i.callback=(e,t)=>{e?(e.err&&(e.err instanceof YL.JetStreamStatusError?this.notify({type:"debug",code:e.err.code,description:e.err.message}):this.notify({type:"debug",code:0,description:e.err.message})),n.resolve()):t.lastSequence>0&&t.lastSequence!==this.cursor.last?(a.stop(),n.resolve(),this.notify({type:"reset",name:"direct"})):(r.push(t),r.received++,this.cursor.last=t.seq,this.cursor.pending=t.pending)};let a=await this.api.getBatch(this.stream,i);r.iterClosed.then(()=>{a.stop(),t?.cancel(),n?.resolve()}),await n}})().catch(e=>{r.stop(e)}),Promise.resolve(r)}async fetch(e){let t=this.getOptions(e),n=new J9.QueuedIteratorImpl,r=await this.api.get(this.stream,Object.assign({callback:(e,t)=>{e?n.push(()=>{e.err?n.stop(e.err):n.stop()}):t.lastSequence>0&&t.lastSequence!==this.cursor.last?(n.push(()=>{n.stop()}),r.stop()):(n.push(t),n.received++,this.cursor.last=t.seq,this.cursor.pending=t.pending)}},t));return n.iterClosed.then(()=>{r.stop()}),n}async next(){let e=await this.api.getMessage(this.stream,{seq:this.cursor.last+1}),t=e?.seq;return t&&(this.cursor.last=t),e}};class Xy extends Yk.BaseApiClientImpl{streams;consumers;direct;constructor(e,t){super(e,t),this.streams=new Y0.StreamAPIImpl(e,t),this.consumers=new YW.ConsumerAPIImpl(e,t),this.direct=new Xh.DirectStreamAPIImpl(e,t)}async getAccountInfo(){return await this._request(`${this.prefix}.INFO`)}jetstream(){return Xg(this.nc,this.getOptions())}advisories(){let e=new J9.QueuedIteratorImpl;return this.nc.subscribe("$JS.EVENT.ADVISORY.>",{callback:(t,n)=>{if(t)throw t;try{let t=this.parseJsResponse(n),r=t.type.split("."),i=r[r.length-1];e.push({kind:i,data:t})}catch(t){e.stop(t)}}}),e}}function Xb(e){if("string"==typeof e)return e;if(e instanceof Date)return`@at ${e.toISOString()}`;if("at"in e){let t=e.at instanceof Date?e.at.toISOString():e.at;return`@at ${t}`}if("every"in e)return function(e){let t,n=e.trim(),r=/(\d+(?:\.\d+)?)(ns|us|µs|ms|s|m|h)/g,i=0,a=0;for(;null!==(t=r.exec(n))&&t.index===a;){a+=t[0].length;let e=parseFloat(t[1]),n=t[2];i+="ns"===n?e/1e6:"us"===n||"µs"===n?e/1e3:"ms"===n?e:"s"===n?1e3*e:"m"===n?6e4*e:36e5*e}if(""===n||a!==n.length)throw Error(`@every: unrecognized duration format: "${e}"`);if(i<1e3)throw Error("@every interval must be at least 1s")}(e.every),`@every ${e.every}`;if("cron"in e)return e.cron;if("predefined"in e)return e.predefined;throw Error("invalid schedule specification")}YP.JetStreamManagerImpl=Xy;class X_ extends Yk.BaseApiClientImpl{consumers;streams;consumerAPI;streamAPI;constructor(e,t){super(e,t),this.consumerAPI=new YW.ConsumerAPIImpl(e,t),this.streamAPI=new Y0.StreamAPIImpl(e,t),this.consumers=new Y0.ConsumersImpl(this.consumerAPI),this.streams=new Y0.StreamsImpl(this.streamAPI)}jetstreamManager(e){void 0===e&&(e=this.opts.checkAPI);let t=Object.assign({},this.opts,{checkAPI:e});try{(0,J9.createInbox)(t.watcherPrefix)}catch(e){return Promise.reject(e)}return Xv(this.nc,t)}get apiPrefix(){return this.prefix}startBatch(e,t,n){let r=(0,J9.deferred)(),i=new Xx(this);return i.first(e,t,n).then(()=>{r.resolve(i)}).catch(e=>{r.reject(e)}),r}async _publish(e,t=J9.Empty,n){if((n={...n=n||{}}).cancelSchedule&&n.cancelSchedule.scheduleSubject===e)throw Error("cancelSchedule.scheduleSubject must not equal the publish subject");let r=Xf(n),i=n.timeout||this.timeout,a={};i&&(a.timeout=i),n&&(a.headers=r);let{retries:o}=n;o=o||1;let s=(0,J9.backoff)(),l=null;for(let n=0;n<o;n++)try{l=await this.nc.request(e,t,a);break}catch(t){let e=t instanceof J9.RequestError?t:null;if((t instanceof J9.errors.TimeoutError||e?.isNoResponders())&&n+1<o)await (0,J9.delay)(s.backoff(n));else throw e?.isNoResponders()?new YL.JetStreamNotEnabled("jetstream is not enabled",{cause:t}):t}return l}async publish(e,t=J9.Empty,n){let r=await this._publish(e,t,n),i=this.parseJsResponse(r);if(""===i.stream)throw new YL.JetStreamError("invalid ack response");return i.duplicate=!!i.duplicate&&i.duplicate,i}}YP.JetStreamClientImpl=X_;class Xx{nc;js;id;count;done;constructor(e){this.count=0,this.id=J9.nuid.next(),this.js=e,this.nc=this.js.nc,this.done=!1}async first(e,t,n){(n=n||{}).headers=n?.headers||(0,J9.headers)(),n.headers.set("Nats-Batch-Id",this.id),this.count++,n.headers.set("Nats-Batch-Sequence",this.count.toString());let r=await this.js._publish(e,t,n);r.data.length>0&&this.js.parseJsResponse(r)}add(e,t,n={ack:!1}){if(this.done)throw Error("batch publisher is done");if(n.headers=n?.headers||(0,J9.headers)(),n.headers.set("Nats-Batch-Id",this.id),this.count++,n.headers.set("Nats-Batch-Sequence",this.count.toString()),!("ack"in n&&!0===n.ack))return this.nc.publish(e,t,{headers:n.headers});{let r=(0,J9.deferred)();return this.js._publish(e,t,{headers:n.headers,timeout:n.timeout}).then(e=>{e.data.length>0&&this.js.parseJsResponse(e),r.resolve()}).catch(e=>{this.done=!0,r.reject(e)}),r}}async commit(e,t,n={}){if(this.done)throw Error("batch publisher is done");this.done=!0,n.headers=n?.headers||(0,J9.headers)(),n.headers.set("Nats-Batch-Id",this.id),this.count++,n.headers.set("Nats-Batch-Sequence",this.count.toString()),n.headers.set("Nats-Batch-Commit","1");let r=(await this.js._publish(e,t,{headers:n.headers,timeout:n.timeout||0})).json();if(r.count!==this.count)throw Error("batch didn't contain number of published messages");return r}}YP.BatchPublisherImpl=Xx;let Xw="batch closed";class XS{batch;nc;batchSubj;gapMode;initialFlow;seq;acked;ackInterval;inboxPrefix;maxOutstandingAcks;defaultTimeout;gapIter;sub;pending;closed;closeErr;startDeferred;closedDeferred;constructor(e,t,n,r){this.nc=e,this.batchSubj=n,this.gapMode=t.allowGaps?"ok":"fail",this.initialFlow=t.ackInterval,this.inboxPrefix=t.inboxPrefix,this.maxOutstandingAcks=t.maxOutstandingAcks,this.defaultTimeout=r,this.batch=J9.nuid.next(),this.seq=0,this.acked=0,this.ackInterval=t.ackInterval,this.pending=new Map,this.closed=!1,this.startDeferred=(0,J9.deferred)(),this.closedDeferred=(0,J9.deferred)(),this.closedDeferred.catch(()=>{}),this.startDeferred.catch(()=>{});let i=`${this.inboxPrefix}.${this.batch}.>`;this.sub=this.nc.subscribe(i,{callback:(e,t)=>this.route(e,t)})}replyFor(e,t){return`${this.inboxPrefix}.${this.batch}.${this.initialFlow}.${this.gapMode}.${t}.${e}.$FI`}start(e,t){this.seq=1;let n=this.replyFor(0,1),r=t?Xf(t):void 0;return this.nc.publish(this.batchSubj,e,{reply:n,headers:r}),this.deadlineOrClose(this.startDeferred,t?.timeout??this.defaultTimeout)}deadlineOrClose(e,t){return(0,J9.deadline)(e,t).catch(e=>{throw this.closed||this.close(e),e})}route(e,t){let n;if(e)return void this.close(e);try{n=(0,Yk.parseJsResponse)(t)}catch(e){this.close(e);return}if("batch"in n&&"string"==typeof n.batch){let e=n,r=this.pending.get(t.subject);for(let[,n]of(r&&(2===r.op||3===r.op)&&(r.deferred.resolve(e),this.pending.delete(t.subject)),this.pending))1===n.op||4===n.op?n.deferred.resolve({batchSeq:n.seq,ackSeq:this.acked}):n.deferred.reject(Error(Xw));this.pending.clear(),this.resolveStart(),this.closedDeferred.resolve(e),this.closed=!0,this.gapIter?.stop(),this.sub.unsubscribe();return}if("gap"===n.type){if(this.gapIter){let e=n;this.gapIter.push({lastSeq:e.last_seq,seq:e.seq})}return}let r=n;"number"==typeof r.msgs&&(this.ackInterval=r.msgs),"number"==typeof r.seq&&r.seq>this.acked&&(this.acked=r.seq),this.resolveStart();let i=this.pending.get(t.subject);for(let[e,n]of(i&&(1===i.op||4===i.op)&&(i.deferred.resolve({batchSeq:i.seq,ackSeq:this.acked}),this.pending.delete(t.subject)),this.pending))1===n.op&&n.seq-this.acked<this.ackInterval*this.maxOutstandingAcks&&(n.deferred.resolve({batchSeq:n.seq,ackSeq:this.acked}),this.pending.delete(e))}resolveStart(){this.startDeferred.resolve()}close(e){for(let[,t]of(this.closed=!0,this.closeErr=e,this.pending))t.deferred.reject(e);this.pending.clear(),this.startDeferred.reject(e),this.closedDeferred.reject(e),this.gapIter?.stop(),this.sub.unsubscribe()}add(e,t,n){if(this.closed)return Promise.reject(Error(Xw));let r=++this.seq,i=this.replyFor(1,r),a=n?Xf(n):void 0;if(this.nc.publish(e,t,{reply:i,headers:a}),r-this.acked<this.ackInterval*this.maxOutstandingAcks)return Promise.resolve({batchSeq:r,ackSeq:this.acked});let o=(0,J9.deferred)();return this.pending.set(i,{seq:r,op:1,deferred:o}),this.deadlineOrClose(o,n?.timeout??this.defaultTimeout)}last(e,t,n){if(this.closed)return Promise.reject(Error(Xw));let r=++this.seq,i=this.replyFor(2,r),a=(0,J9.deferred)();this.pending.set(i,{seq:r,op:2,deferred:a});let o=n?Xf(n):void 0;return this.nc.publish(e,t,{reply:i,headers:o}),this.deadlineOrClose(a,n?.timeout??this.defaultTimeout)}end(e){if(this.closed)return Promise.reject(Error(Xw));let t=++this.seq,n=this.replyFor(3,t),r=(0,J9.deferred)();this.pending.set(n,{seq:t,op:3,deferred:r});let i=e?Xf(e):void 0;return this.nc.publish(this.batchSubj,J9.Empty,{reply:n,headers:i}),this.deadlineOrClose(r,e?.timeout??this.defaultTimeout)}ping(e=this.defaultTimeout){if(this.closed)return Promise.reject(Error(Xw));let t=this.replyFor(4,this.seq),n=this.pending.get(t);if(n&&4===n.op)return(0,J9.deadline)(n.deferred,e);let r=(0,J9.deferred)();return this.pending.set(t,{seq:this.seq,op:4,deferred:r}),this.nc.publish(this.batchSubj,J9.Empty,{reply:t}),this.deadlineOrClose(r,e)}done(){return this.closedDeferred}gaps(){return this.gapIter||(this.gapIter=new J9.QueuedIteratorImpl),this.gapIter}}function XE(e){return e instanceof J7.AuthorizationError||e instanceof J7.UserAuthenticationExpiredError||e instanceof Error&&/authorization violation|authentication expired|user authentication expired/i.test(e.message)}function XA(e,t,n){var r;let i=null!=(r=e[t])?r:e[n];return"string"==typeof i?i:void 0}function XT(e,t,n){var r;let i=null!=(r=e[t])?r:e[n];return"number"==typeof i?i:void 0}function XI(e,t,n,r){var i,a,o,s,l;let u,c,d=(u=null!=(a=XA(i=n,"eventType","event_type"))?a:"unknown",c=null!=(o=XA(i,"correlationID","correlation_id"))?o:XA(i,"correlationId","correlation_id"),"progress"===u?{eventType:"progress",jobId:XA(i,"jobId","job_id"),currentStep:XT(i,"currentStep","current_step"),finalStep:XT(i,"finalStep","final_step"),message:"string"==typeof i.message?i.message:void 0,startingTime:XA(i,"startingTime","starting_time"),correlationID:c}:"dialog_text_entered_response"===u?{eventType:"dialog_text_entered_response",requestID:"string"==typeof i.requestID?i.requestID:void 0,resultCode:"number"==typeof i.resultCode?i.resultCode:void 0,resultMessage:"string"==typeof i.resultMessage?i.resultMessage:void 0,currentState:(l=i.currentState)&&"object"==typeof l&&"currentState"in l?l.currentState:l,correlationID:c}:"error"===u?{eventType:"error",errorCode:null!=(s=i.errorCode)?s:i.error_code,errorMessage:XA(i,"errorMessage","error_message"),backtrace:"string"==typeof i.backtrace?i.backtrace:void 0,correlationID:c}:{eventType:u,correlationID:c});console.debug(`[NATS] message #${t} on ${e} (eventType=${d.eventType})`,d),r(d)}async function XC(e,t,n,r){let i=e.subscribe(t);console.info("[NATS] subscribed to subject",t),r();let a=0;for await(let e of i){a+=1;try{XI(t,a,e.json(),n)}catch(e){console.error("[NATS] message decode error",e)}}console.info(`[NATS] subscription on ${t} closed (received ${a} messages)`)}async function XM(e,t,n,r,i,a,o){let s=(0,YN.jetstream)(e),l=t.consumer?await s.consumers.get(t.stream,t.consumer):await s.consumers.get(t.stream,{filter_subjects:[n],deliver_policy:"catch-up"===r?YN.DeliverPolicy.LastPerSubject:YN.DeliverPolicy.New});console.info("[NATS] JetStream consumer ready",t.consumer?{stream:t.stream,consumer:t.consumer,subject:n,mode:r}:{stream:t.stream,subject:n,mode:r});let u=await l.consume();a(u),o();let c=0;for await(let e of u){c+=1;try{XI(n,c,e.json(),i)}catch(e){console.error("[NATS] message decode error",e)}}console.info(`[NATS] JetStream consumer on ${n} closed (received ${c} messages)`)}Object.defineProperty(YR,"jetstream",{enumerable:!0,get:function(){return YP.jetstream}}),Object.defineProperty(YR,"JetStreamClientImpl",{enumerable:!0,get:function(){return YP.JetStreamClientImpl}}),Object.defineProperty(YR,"jetstreamManager",{enumerable:!0,get:function(){return YP.jetstreamManager}}),Object.defineProperty(YR,"startFastIngest",{enumerable:!0,get:function(){return YP.startFastIngest}}),Object.defineProperty(YR,"toJetStreamClient",{enumerable:!0,get:function(){return YP.toJetStreamClient}}),Object.defineProperty(YR,"BaseApiClientImpl",{enumerable:!0,get:function(){return Yk.BaseApiClientImpl}}),Object.defineProperty(YR,"DirectMsgImpl",{enumerable:!0,get:function(){return Xh.DirectMsgImpl}}),Object.defineProperty(YR,"AckPolicy",{enumerable:!0,get:function(){return YX.AckPolicy}}),Object.defineProperty(YR,"DeliverPolicy",{enumerable:!0,get:function(){return YX.DeliverPolicy}}),Object.defineProperty(YR,"DiscardPolicy",{enumerable:!0,get:function(){return YX.DiscardPolicy}}),Object.defineProperty(YR,"PersistMode",{enumerable:!0,get:function(){return YX.PersistMode}}),Object.defineProperty(YR,"PubHeaders",{enumerable:!0,get:function(){return YX.PubHeaders}}),Object.defineProperty(YR,"ReplayPolicy",{enumerable:!0,get:function(){return YX.ReplayPolicy}}),Object.defineProperty(YR,"RetentionPolicy",{enumerable:!0,get:function(){return YX.RetentionPolicy}}),Object.defineProperty(YR,"StorageType",{enumerable:!0,get:function(){return YX.StorageType}}),Object.defineProperty(YR,"StoreCompression",{enumerable:!0,get:function(){return YX.StoreCompression}}),Object.defineProperty(YR,"ListerImpl",{enumerable:!0,get:function(){return Yq.ListerImpl}}),Object.defineProperty(YR,"isMessageNotFound",{enumerable:!0,get:function(){return YL.isMessageNotFound}}),Object.defineProperty(YR,"JetStreamApiCodes",{enumerable:!0,get:function(){return YL.JetStreamApiCodes}}),Object.defineProperty(YR,"JetStreamApiError",{enumerable:!0,get:function(){return YL.JetStreamApiError}}),Object.defineProperty(YR,"JetStreamError",{enumerable:!0,get:function(){return YL.JetStreamError}}),Object.defineProperty(YR,"JetStreamStatus",{enumerable:!0,get:function(){return YL.JetStreamStatus}}),Object.defineProperty(YR,"JetStreamStatusError",{enumerable:!0,get:function(){return YL.JetStreamStatusError}}),Object.defineProperty(YR,"jserrors",{enumerable:!0,get:function(){return YL.jserrors}}),Object.defineProperty(YR,"validateStreamName",{enumerable:!0,get:function(){return YJ.validateStreamName}}),Object.defineProperty(YN,"jetstream",{enumerable:!0,get:function(){return YR.jetstream}}),Object.defineProperty(YN,"jetstreamManager",{enumerable:!0,get:function(){return YR.jetstreamManager}}),Object.defineProperty(YN,"AckPolicy",{enumerable:!0,get:function(){return YR.AckPolicy}}),Object.defineProperty(YN,"AdvisoryKind",{enumerable:!0,get:function(){return YR.AdvisoryKind}}),Object.defineProperty(YN,"DeliverPolicy",{enumerable:!0,get:function(){return YR.DeliverPolicy}}),Object.defineProperty(YN,"DirectMsgHeaders",{enumerable:!0,get:function(){return YR.DirectMsgHeaders}}),Object.defineProperty(YN,"DiscardPolicy",{enumerable:!0,get:function(){return YR.DiscardPolicy}}),Object.defineProperty(YN,"isPullConsumer",{enumerable:!0,get:function(){return YR.isPullConsumer}}),Object.defineProperty(YN,"isPushConsumer",{enumerable:!0,get:function(){return YR.isPushConsumer}}),Object.defineProperty(YN,"JetStreamApiCodes",{enumerable:!0,get:function(){return YR.JetStreamApiCodes}}),Object.defineProperty(YN,"JetStreamApiError",{enumerable:!0,get:function(){return YR.JetStreamApiError}}),Object.defineProperty(YN,"JetStreamError",{enumerable:!0,get:function(){return YR.JetStreamError}}),Object.defineProperty(YN,"JsHeaders",{enumerable:!0,get:function(){return YR.JsHeaders}}),Object.defineProperty(YN,"PersistMode",{enumerable:!0,get:function(){return YR.PersistMode}}),Object.defineProperty(YN,"PubHeaders",{enumerable:!0,get:function(){return YR.PubHeaders}}),Object.defineProperty(YN,"ReplayPolicy",{enumerable:!0,get:function(){return YR.ReplayPolicy}}),Object.defineProperty(YN,"RepublishHeaders",{enumerable:!0,get:function(){return YR.RepublishHeaders}}),Object.defineProperty(YN,"RetentionPolicy",{enumerable:!0,get:function(){return YR.RetentionPolicy}}),Object.defineProperty(YN,"StorageType",{enumerable:!0,get:function(){return YR.StorageType}}),Object.defineProperty(YN,"StoreCompression",{enumerable:!0,get:function(){return YR.StoreCompression}});let XN=/session\s+with\s+id\s+["']?[^"']+["']?\s+not\s+found/i;function XR(e){return 404===e||-103===e||-101===e}function XO(e){return!!e&&XN.test(e)}function XP(e){return e?JSON.stringify({state:e.state,previousState:e.previousState,emission:e.emission,emitter:e.emitter,lastMatchedMemoryID:e.lastMatchedMemoryID,currentDate:e.currentDate,currentMemoryID:e.currentMemoryID,contextVars:e.contextVars,emittedMedia:e.emittedMedia}):""}let Xk={placeName:null,latitude:null,longitude:null,uncertaintyKm:null},XL=(e,t)=>{console.error(`[MemoriWidget] ${e}`,null!=t?t:"")};function XD(e){let t=e.correlationID;return"string"==typeof t&&t.length>0?t:void 0}let XB=(e,t=!0,n=!1,r,i=!1,a=!1)=>{let o=new CustomEvent("MemoriTextEntered",{detail:{text:e,waitForPrevious:t,hidden:n,typingText:r,useLoaderTextAsMsg:i,hasBatchQueued:a}});document.dispatchEvent(o),window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&setTimeout(()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak"))},300)};window.getMemoriState=e=>{var t,n,r,i,a;let o=e?document.querySelector(`.memori-widget[data-memori-integration="${e}"]`)||(null==(n=null==(t=document.querySelector("memori-client"))?void 0:t.shadowRoot)?void 0:n.querySelector(".memori-widget[data-memori-integration]")):document.querySelector(".memori-widget")||(null==(i=null==(r=document.querySelector("memori-client"))?void 0:r.shadowRoot)?void 0:i.querySelector(".memori-widget"));if(!o)return null;let s=null==(a=o.dataset)?void 0:a.memoriEngineState;if(!s)return null;let l=JSON.parse(s),u=qP("loginToken",void 0);return{...l,loginToken:u}},window.typeMessage=XB,window.typeMessageHidden=(e,t=!0,n,r=!1,i=!1)=>XB(e,t,!0,n,r,i),window.typeBatchMessages=e=>{function t(){var e,t,n,r;null==(e=document.querySelector("fieldset#chat-fieldset"))||e.setAttribute("disabled","");let i="opacity: 0.5; touch-action: none; pointer-events: none;";null==(t=document.querySelector("textarea.memori-chat-textarea--input"))||t.setAttribute("style",i),null==(n=document.querySelector("button.memori-chat-inputs--send"))||n.setAttribute("style",i),null==(r=document.querySelector("button.memori-chat-inputs--mic"))||r.setAttribute("style",i)}function n(){var e,t,n,r;null==(e=document.querySelector("fieldset#chat-fieldset"))||e.removeAttribute("disabled"),null==(t=document.querySelector("textarea.memori-chat-textarea--input"))||t.removeAttribute("style"),null==(n=document.querySelector("button.memori-chat-inputs--send"))||n.removeAttribute("style"),null==(r=document.querySelector("button.memori-chat-inputs--mic"))||r.removeAttribute("style")}function r(){var e;return!!(null==(e=document.querySelector("fieldset#chat-fieldset"))?void 0:e.hasAttribute("disabled"))}let i=window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&/iPad|iPhone|iPod/.test(navigator.userAgent),a=function*(){yield*e}();t();let o=()=>{let e=a.next(),s=e.value;if(s){r()||t();let a=s.waitForPrevious;i&&(a=!1),XB(s.message,a,s.hidden,s.typingText,s.useLoaderTextAsMsg,!e.done),i&&setTimeout(()=>{document.dispatchEvent(new CustomEvent("MemoriEndSpeak")),n()},3e3)}else r()&&n();if(e.done){document.removeEventListener("MemoriEndSpeak",o),r()&&n();return}};document.addEventListener("MemoriEndSpeak",o),o()};var XF=({memori:e,memoriConfigs:t,ownerUserID:n,tenantID:r,memoriLang:i,uiLang:a,spokenLang:o,multilingual:s,integration:l,layout:u,customLayout:c,showShare:h,preview:p=!1,embed:m=!1,showCopyButton:f,showTranslationOriginal:g,showInputs:v=!0,showDates:y=!1,showContextPerLine:_=!1,showMessageConsumption:x,showSettings:w,showTypingText:S,showClear:E,showExperts:A,showLogin:T,showUpload:I,showOnlyLastMessages:C,showChatHistory:M,showReasoning:N,show3dAvatar:R,avatar3dHidden:O,height:P,secret:k,baseUrl:D="https://aisuru-staging.aclambda.online",apiURL:B="https://backend-staging.memori.ai",engineURL:F="https://engine-staging.memori.ai",initialContextVars:U,initialQuestion:j,ttsProvider:z,ogImage:H,sessionID:G,tenant:V,personification:W,authToken:q,enableAudio:$,defaultSpeakerActive:J=!0,disableTextEnteredEvents:K=!1,onStateChange:Y,additionalInfo:X,additionalSettings:Z,customMediaRenderer:Q,userAvatar:ee,__WEBCOMPONENT__:et=!1,useMathFormatting:en=!1,autoStart:er=!1,applyVarsToRoot:ei=!1,showFunctionCache:ea=!1,maxTotalMessagePayload:eo,maxTextareaCharacters:es})=>{var el,eu,ec,ed,ep,ef,eg,ev,ey,eb,e_,ex,ew,eS,eE,eA,eT,eI,eC,eM,eN,eR,eO,eP,ek,eL,eD,eB,eF,eU,ej,ez,eH,eG,eV,eW,eq,e$,eJ,eK,eY,eX,eZ,eQ,e0,e1,e2,e4;let e5,e6,{t:e8,i18n:e7}=tA(),{add:e9,close:te}=vZ(),[tt,tr]=(0,em.useState)(!1);(0,em.useEffect)(()=>{tr(!0)},[]);let ta=e3(B,F),{initSession:to,deleteSession:ts,postEnterTextAsync:tl,postTextEnteredEvent:tu,postPlaceChangedEvent:tc,postDateChangedEvent:td,postTagChangedEvent:th,getSession:tp,getExpertReferences:tm,getSessionChatLogs:tf}=ta,[tg,tv]=(0,em.useState)(!1),[ty,tb]=(0,em.useState)(!0),[t_,tx]=(0,em.useState)(null),[tw,tS]=(0,em.useState)(null),[tE,tI]=(0,em.useState)(null!=(el=null==X?void 0:X.loginToken)?el:q),tC=(0,em.useRef)(null!=(eu=null==X?void 0:X.loginToken)?eu:q),tM=(0,em.useRef)(null!=(ec=null==X?void 0:X.loginToken)?ec:q),[tN,tR]=(0,em.useState)({avatarURL:"string"==typeof ee?ee:void 0}),tO=(0,em.useCallback)(e=>{var t,n,r,i,a;return t=tC.current,n=null==X?void 0:X.loginToken,null!=(a=null!=(i=null!=(r=null!=tE?tE:t)?r:e)?i:n)?a:q},[tE,null==X?void 0:X.loginToken,q]);(0,em.useEffect)(()=>{var e;let t=null!=(e=null==X?void 0:X.loginToken)?e:q,n=tM.current;tM.current=t,t!==n&&(tI(t),tC.current=t,t||(qL("loginToken"),tR(void 0)))},[null==X?void 0:X.loginToken,q]);let tP=(null==l?void 0:l.customData)?JSON.parse(l.customData):null,tk=null!=O?O:null==tP?void 0:tP.avatar_3d_hidden,tL=null!=R?R:void 0!==tk&&!0!==tk&&"true"!==tk,tD=!!(null!=(ed=null!=T?T:null==tP?void 0:tP.showLogin)?ed:e.requireLoginToken);(0,em.useEffect)(()=>{if(!tE||!(tD||e.requireLoginToken))return;let t=!1;return ta.backend.pwlGetCurrentUser(tE).then(({user:e,resultCode:n})=>{t||(e&&0===n?(tR(e),qk("loginToken",tE),tC.current=tE,!n7&&e.birthDate&&(n9(e.birthDate),qk("birthDate",e.birthDate))):(tI(void 0),tC.current=void 0,tR(void 0),qL("loginToken")))}),()=>{t=!0}},[tE,tD,e.requireLoginToken]);let tB=!!tE&&!!(null==tN?void 0:tN.userID),tF=(0,em.useRef)(!1),tU=(0,em.useRef)(!1);eZ=!!e.requireLoginToken,tU.current=!!eZ&&!tB;let[tj,tz]=(0,em.useState)(!1),[tH,tG]=(0,em.useState)(!1),[tV,tW]=(0,em.useState)(!1),tq=(0,em.useRef)(!1),t$=null==V?void 0:V.billingDelegation,[tJ,tK]=(0,em.useState)(!0),[tY,tX]=(0,em.useState)(!1),tZ=!!t$&&(!tJ||tY),tQ=(null==(eg=null==(ef=null==(ep=e.culture)?void 0:ep.split("-"))?void 0:ef[0])?void 0:eg.toUpperCase())||(null==(e_=null==(eb=null==(ey=null==(ev=null==t?void 0:t.find(t=>t.memoriConfigID===e.memoriConfigurationID))?void 0:ev.culture)?void 0:ey.split("-"))?void 0:eb[0])?void 0:e_.toUpperCase()),t0=void 0!==s?s:!!(null==tP?void 0:tP.multilanguage);null==tP||tP.forcedTimeout;let[t1,t2]=(0,em.useState)(null!=(eA=null!=(eE=null!=(eS=null!=(ew=null!=(ex=null!=o?o:i)?ex:null==tP?void 0:tP.lang)?ew:tQ)?eS:null==tP?void 0:tP.uiLang)?eE:e7.language)?eA:"IT");(0,em.useEffect)(()=>{null!=o&&t2(o)},[o]);let t3=void 0!==en?en:!!(null==tP?void 0:tP.useMathFormatting);(0,em.useEffect)(()=>{t3&&Ln()},[t3]),(0,em.useEffect)(()=>{let e=a&&kH.includes(a.toLowerCase())?a.toLowerCase():t1&&kH.includes(t1.toLowerCase())?t1.toLowerCase():null;e&&"function"==typeof(null==e7?void 0:e7.changeLanguage)&&e7.changeLanguage(e)},[a,t1]);let[t4,t5]=(0,em.useState)(!1),[t6,t8]=(0,em.useState)(!1),[t7,t9]=(0,em.useState)(),ne=(0,em.useRef)(new Map),nt=(0,em.useRef)(new Map),nn="string"==typeof u?u:u&&"object"==typeof u&&null!==u&&"name"in u&&"string"==typeof u.name?u.name:"string"==typeof(null==tP?void 0:tP.layout)?tP.layout:null==(eT=null==tP?void 0:tP.layout)?void 0:eT.name,nr=(()=>{if("string"==typeof nn){let e=nn.toLowerCase();return"fullpage"===e||"fullscreen"===e||"2"===e?"FULLPAGE":"totem"===e?"TOTEM":"chat"===e?"CHAT":"website_assistant"===e?"WEBSITE_ASSISTANT":"hidden_chat"===e?"HIDDEN_CHAT":"zoomed_full_body"===e?"ZOOMED_FULL_BODY":"default"===e?"DEFAULT":nn}return"FULLPAGE"})(),ni=u&&"object"==typeof u&&null!==u&&"piiDetection"in u&&(null==(eI=u.piiDetection)?void 0:eI.enabled)?u.piiDetection:"object"==typeof(null==tP?void 0:tP.layout)&&(null==tP?void 0:tP.layout)!==null&&(null==(eM=null==(eC=null==tP?void 0:tP.layout)?void 0:eC.piiDetection)?void 0:eM.enabled)?tP.layout.piiDetection:void 0,na=null==(eN=null!=$?$:null==tP?void 0:tP.enableAudio)||eN,[no,ns]=(0,em.useState)(!1),[nl,nu]=(0,em.useState)(!1),[nc,nd]=(0,em.useState)(!1),[nh,np]=(0,em.useState)(!1),[nm,nf]=(0,em.useState)(!1),[ng,nv]=(0,em.useState)(!1);(0,em.useEffect)(()=>{tE||nv(!1)},[tE]);let[ny,nb]=(0,em.useState)(!1),[n_,nx]=(0,em.useState)(!1),[nw,nS]=(0,em.useState)(!1),[nE,nA]=(0,em.useState)(2),[nT,nI]=(0,em.useState)("center"),[nC,nM]=(0,em.useState)(!1),[nN,nR]=(0,em.useState)(null),[nO,nP]=(0,em.useState)(!1),nk=(0,em.useRef)(null),[nL,nD]=(0,em.useState)(!1);(0,em.useEffect)(()=>{nD(!!nk.current)},[nk.current]),(0,em.useEffect)(()=>{var e;let t="bottom",n=qP("microphoneMode","HOLD_TO_TALK");window.innerWidth<=768?(t="bottom",n="HOLD_TO_TALK"):t=window.matchMedia("(orientation: portrait)").matches||window.innerHeight>window.innerWidth?"center":"bottom",nS(!rI&&"CONTINUOUS"===n),nA(qP("continuousSpeechTimeout",2)),nI(qP("controlsPosition",t)),nR(qP("avatarType","avatar3d")),nP(qP("hideEmissions",!1)),(null==X?void 0:X.loginToken)||q||(tI(qP("loginToken",void 0)),tC.current=qP("loginToken",void 0),n9(qP("birthDate",void 0))),null==(e=null!=$?$:null==tP?void 0:tP.enableAudio)||e||qk("muteSpeaker",!0)},[]),(0,em.useEffect)(()=>{var e;null==(e=null!=$?$:null==tP?void 0:tP.enableAudio)||e||qk("muteSpeaker",!0)},[$,null==tP?void 0:tP.enableAudio]);let[nB,nF]=(0,em.useState)(k),[nU,nj]=(0,em.useState)(),nz=(...t)=>(function(...e){for(let t of e)if("string"==typeof t&&t.trim().length>0)return t})(...t,k,nB,d,e.secretToken,e.password),[nH,nG]=(0,em.useState)(null),[nV,nW]=(0,em.useState)(),nq=(0,em.useCallback)(e=>{var t,n;if(!e)return!1;let r=0===Number(e.latitude)&&0===Number(e.longitude),i=!(null==(t=e.placeName)?void 0:t.trim()),a="Position"===e.placeName,o=0===Number(null!=(n=e.uncertainty)?n:0);return!r||!i&&!a||!o},[]),n$=(0,em.useCallback)(e=>{if(!e)return;let t={};return null!=e.latitude&&null!=e.longitude?(t.latitude=e.latitude,t.longitude=e.longitude,e.placeName&&(t.placeName=e.placeName),null!=e.uncertainty&&e.uncertainty>0&&(t.uncertaintyKm=e.uncertainty)):e.placeName&&(t.placeName=e.placeName),Object.keys(t).length>0?t:void 0},[]),nJ=(0,em.useCallback)(t=>{if(e.needsPosition)return nq(t)?n$(t):Xk},[e.needsPosition,nq,n$]),nK=t=>{nW(t),t&&e.needsPosition?qk("position",JSON.stringify(t)):t||qL("position")};(0,em.useEffect)(()=>{if(e.needsPosition){let e=qP("position",void 0);e&&nW(e)}},[e.needsPosition]);let[nY,nX]=(0,em.useState)(""),[nZ,nQ]=(0,em.useState)(!1),[n0,n1]=(0,em.useState)([]),n2=e=>{n1(t=>{var n,r;return[...t,{...e,media:null!=(r=null==(n=e.media)?void 0:n.filter(e=>{var t;return!("text/javascript"===e.mimeType&&(null==(t=e.properties)?void 0:t.executable))}))?r:[]}]})},[n3,n4]=(0,em.useState)(void 0),n5=async(t,n,r,i=!0,a,o=!1,s,l=!1,u=!1,c=!1)=>{var d,h;if(tU.current)return;let p=r||rn||(null==(d=window.getMemoriState())?void 0:d.sessionID);if(!p||!(null==t?void 0:t.length))return;let m=t;!o&&i&&t0&&t1.toUpperCase()!==tQ.toUpperCase()&&(m=(await GP(t,tQ,t1,D)).text);let f=null==n?void 0:n.filter(e=>{var t;return"document"===e.type&&(null==(t=e.properties)?void 0:t.isAttachedFile)});if(f&&f.length>0&&(m=m+" "+f.map(e=>e.content).join(" ")),null==ni?void 0:ni.enabled){let e=function(e,t,n){if(!(null==t?void 0:t.enabled)||!Array.isArray(t.rules)||0===t.rules.length)return{matched:!1};let r=(null==n?void 0:n.toLowerCase())||"en",i=new Map;for(let n of t.rules)if(n.pattern&&n.pattern.trim())try{new RegExp(n.pattern).test(e)&&!i.has(n.id)&&i.set(n.id,n)}catch(e){console.warn("[PII] Invalid regex for rule:",n.id,n.pattern,e)}return 0===i.size?{matched:!1}:{matched:!0,errorText:[ti(t.errorMessage,r,"The message contains personal or sensitive data."),...Array.from(i.values()).map(e=>{let t=ti(e.label,r,e.id);return ti(e.message,r,t)})].join("\n")}}(m,ni,(null==t1?void 0:t1.toLowerCase())||"en");if(e.matched&&e.errorText){o||n2({text:t,translatedText:a,fromUser:!0,media:null!=n?n:[],initial:rn?!!r&&r!==rn:!!r}),n2({text:e.errorText,emitter:"system",fromUser:!1,initial:!1,contextVars:{},date:new Date().toISOString()});return}}o||c||n2({text:t,translatedText:a,fromUser:!0,media:null!=n?n:[],initial:rn?!!r&&r!==rn:!!r});try{let r=nJ(nV),c=await tl({sessionId:p,text:m,...e.needsDateTime&&{dateUTC:null!=(h=i5.utc().toISO())?h:void 0},...void 0!==r&&{place:r}}),d=XD(c);if(0===c.resultCode&&d)rq(d,{msg:m,stateBeforeRequest:rl.current,text:t,media:n,translate:i,translatedText:a,hidden:o,typingText:s,useLoaderTextAsMsg:l,hasBatchQueued:u}),t8(!0),t9(s);else if(0===c.resultCode)XL("enter-text missing correlationID",c);else if(404===c.resultCode)rh.current({text:t,media:n,translate:i,translatedText:a,hidden:o,typingText:s,useLoaderTextAsMsg:l,hasBatchQueued:u,expiredSessionID:p,continueFromChatLogID:n3});else{if(500!==c.resultCode||!c.resultMessage)return Promise.reject(c);n1(e=>[...e,{text:"Error: "+c.resultMessage,emitter:"system",fromUser:!1,initial:!1,contextVars:{},date:new Date().toISOString()}])}}catch(e){XL("sendMessage failed",e),t9(void 0),t8(!1)}},n6=async(e,t,n,r=!1,i=e)=>{var a,o,s,l,u,c;let d=null!=(a=null==e?void 0:e.emission)?a:null==ro?void 0:ro.emission,h={...e},p=null;if(d&&tQ.toUpperCase()!==t.toUpperCase()&&t0&&!r)try{let r=await GP(d,t,tQ,D);if(e.hints&&e.hints.length>0){let n=await Promise.all((null!=(s=e.hints)?s:[]).map(async e=>{var n;let r=await GP(e,t,tQ,D);return{text:null!=(n=null==r?void 0:r.text)?n:e,originalText:e}}));h={...e,emission:r.text,translatedHints:n}}else h={...e,emission:d,translatedEmission:r.text,hints:null!=(l=e.hints)?l:"G1"===e.state?null==ro?void 0:ro.hints:[]};r.text.length>0&&(p={text:d,translatedText:r.text,emitter:e.emitter,media:null!=(u=e.emittedMedia)?u:e.media,llmUsage:e.llmUsage,fromUser:!1,questionAnswered:n,generatedByAI:!!e.completion,contextVars:e.contextVars,date:e.currentDate,placeName:e.currentPlaceName,placeLatitude:e.currentLatitude,placeLongitude:e.currentLongitude,placeUncertaintyKm:e.currentUncertaintyKm,tag:e.currentTag,memoryTags:e.memoryTags})}catch(t){h={...e,emission:d},p={text:d,emitter:e.emitter,media:null!=(c=e.emittedMedia)?c:e.media,llmUsage:e.llmUsage,fromUser:!1,questionAnswered:n,contextVars:e.contextVars,date:e.currentDate,placeName:e.currentPlaceName,placeLatitude:e.currentLatitude,placeLongitude:e.currentLongitude,placeUncertaintyKm:e.currentUncertaintyKm,tag:e.currentTag,memoryTags:e.memoryTags}}else h={...e,emission:d},d&&(p={text:d,emitter:e.emitter,media:null!=(o=e.emittedMedia)?o:e.media,llmUsage:e.llmUsage,fromUser:!1,questionAnswered:n,contextVars:e.contextVars,date:e.currentDate,placeName:e.currentPlaceName,placeLatitude:e.currentLatitude,placeLongitude:e.currentLongitude,placeUncertaintyKm:e.currentUncertaintyKm,tag:e.currentTag,memoryTags:e.memoryTags});return ru(h,i),!r&&p&&n2(p),h},n8=void 0!==e.ageRestriction?e.ageRestriction:e.nsfw?18:14*!!e.enableCompletions,[n7,n9]=(0,em.useState)(),[re,rt]=(0,em.useState)(!1),[rn,rr]=(0,em.useState)(G),ri=(0,em.useRef)(G),ra=e=>{ri.current=e,rr(e)},[ro,rs]=(0,em.useState)(),rl=(0,em.useRef)(""),ru=(e,t=e)=>{var n,r;rl.current=XP(t),rs(e),Y&&Y(e);let i=new CustomEvent("MemoriNewDialogState",{detail:e});document.dispatchEvent(i);let a=null==(r=null!=(n=null==e?void 0:e.emittedMedia)?n:null==e?void 0:e.media)?void 0:r.filter(e=>{var t;return"text/javascript"===e.mimeType&&!!(null==(t=e.properties)?void 0:t.executable)});null==a||a.forEach(e=>{try{setTimeout(()=>{var t;Function(null!=(t=e.content)?t:"")(),setTimeout(()=>{var e,t,n;null==(e=document.querySelector(".memori-chat--content"))||e.scrollTo(0,null!=(n=null==(t=document.querySelector(".memori-chat--content"))?void 0:t.scrollHeight)?n:0)},400)},1e3)}catch(e){}})};(0,em.useEffect)(()=>{G&&(ra(G),io(void 0,!1,void 0,G))},[G]);let rc=async t=>{var n,r,i,a,o,s,l,u,c;let h=qP("birthDate",void 0),p=null!=(n=null!=n7?n7:t.birthDate)?n:h;if(!p&&n8)return void rt(!0);let m=nz(t.password);if("PUBLIC"!==e.privacyType&&!m&&!(null==(r=t.recoveryTokens)?void 0:r.length)&&!nU)return void nG("password");if(await ix({notify:!0})){t5(!0);try{let n;try{n=window.location.href}catch(e){}let r=await to({...t,password:m,birthDate:p,tag:null!=(i=t.tag)?i:null==W?void 0:W.tag,pin:null!=(a=t.pin)?a:null==W?void 0:W.pin,additionalInfo:{...t.additionalInfo||X||{},loginToken:tO(null==(o=t.additionalInfo)?void 0:o.loginToken),language:(null!=(u=null!=t1?t1:null==(l=null==(s=e.culture)?void 0:s.split("-"))?void 0:l[0])?u:"IT").toLowerCase(),referral:n,timeZoneOffset:new Date().getTimezoneOffset().toString()}});if((null==r?void 0:r.sessionID)&&(null==r?void 0:r.currentState)&&0===r.resultCode)return ra(r.sessionID),(null==ro?void 0:ro.currentTag)&&e.giverTag?tv((null==ro?void 0:ro.currentTag)===e.giverTag):tv(!1),t5(!1),{dialogState:r.currentState,sessionID:r.sessionID};if(/aged? ?-?restricted/i.test(null!=(c=null==r?void 0:r.resultMessage)?c:""))console.warn(r),e9(v9({description:e8("underageTwinSession",{age:n8}),severity:"error"})),tW(!0);else{if("PUBLIC"!==e.privacyType&&((null==r?void 0:r.resultCode)===403||JF(null==r?void 0:r.resultCode,null==r?void 0:r.resultMessage)))return nF(void 0),d=void 0,nG("password"),t5(!1),r;if(JF(null==r?void 0:r.resultCode,null==r?void 0:r.resultMessage))return e9(v9({description:e8("error.emptyPasswordPublic"),severity:"error"})),t5(!1),r;console.warn(r);let t=e9(v9({description:(0,eh.jsxs)("div",{children:[(0,eh.jsx)("p",{children:e8(Lx(null==r?void 0:r.resultCode))}),(0,eh.jsx)(yt,{variant:"outline",onClick:()=>te(t),"aria-label":String(e8("close",{defaultValue:"Close"})),icon:(0,eh.jsx)(H2,{"aria-hidden":!0})})]}),severity:"error",duration:0}));return r}}catch(e){XL("fetchSession failed",e)}}},rd=async(t=!1,n,r,i,a,o,s,l,u,c,h,p,m)=>{var f,g,v,y,b,_,x,w;t5(!0);let S=qP("birthDate",void 0),E=null!=l?l:S;try{let l;if(!E&&n8){rt(!0),t5(!1);return}let S=nz(n);if("PUBLIC"!==e.privacyType&&!S&&!(null==r?void 0:r.length)&&!nU){nG("password"),t5(!1);return}if(!await ix({notify:!0}))return t5(!1),null;try{l=window.location.href}catch(e){}let{sessionID:A,currentState:T,...I}=await to({memoriID:null!=(f=e.engineMemoriID)?f:"",password:S,recoveryTokens:r||nU,tag:null!=i?i:null==W?void 0:W.tag,pin:null!=a?a:null==W?void 0:W.pin,continueFromChatLogID:c,continueFromSessionID:h,initialContextVars:{LANG:t1,PATHNAME:window.location.pathname,ROUTE:(null==(v=null==(g=window.location.pathname)?void 0:g.split("/"))?void 0:v.pop())||"",...o||{}},initialQuestion:s,birthDate:E,additionalInfo:{...u||X||{},loginToken:tO(null==u?void 0:u.loginToken),language:(null!=(_=null!=t1?t1:null==(b=null==(y=e.culture)?void 0:y.split("-"))?void 0:b[0])?_:"IT").toLowerCase(),referral:l,timeZoneOffset:new Date().getTimezoneOffset().toString()}});if(A&&T&&0===I.resultCode){if(ra(A),t){ru(T);let e=p&&n0.length>1?e8("sessionExpiredReopening"):null;if(e&&m&&n2({text:"",emitter:"system",fromUser:!1,initial:e,contextVars:{},date:new Date().toISOString()}),T.emission&&!m){let t=e||n0.length<=1||void 0;n0.length<=1?n1([{text:T.emission,emitter:T.emitter,media:null!=(x=T.emittedMedia)?x:T.media,fromUser:!1,initial:!0===t||t||void 0,contextVars:T.contextVars,date:T.currentDate,placeName:T.currentPlaceName,placeLatitude:T.currentLatitude,placeLongitude:T.currentLongitude,placeUncertaintyKm:T.currentUncertaintyKm,tag:T.currentTag,memoryTags:T.memoryTags}]):n2({text:T.emission,emitter:T.emitter,media:null!=(w=T.emittedMedia)?w:T.media,fromUser:!1,initial:!0===t||t||void 0,contextVars:T.contextVars,date:T.currentDate,placeName:T.currentPlaceName,placeLatitude:T.currentLatitude,placeLongitude:T.currentLongitude,placeUncertaintyKm:T.currentUncertaintyKm,tag:T.currentTag,memoryTags:T.memoryTags})}}return t5(!1),{dialogState:T,sessionID:A}}(null==I?void 0:I.resultMessage.startsWith("This Memori is aged restricted"))?(console.error("[REOPEN_SESSION] Age restriction error:",I),e9(v9({description:e8("underageTwinSession",{age:n8}),severity:"error"})),tW(!0)):"PUBLIC"!==e.privacyType&&((null==I?void 0:I.resultCode)===403||JF(null==I?void 0:I.resultCode,null==I?void 0:I.resultMessage))?(nF(void 0),d=void 0,nG("password")):JF(null==I?void 0:I.resultCode,null==I?void 0:I.resultMessage)?e9(v9({description:e8("error.emptyPasswordPublic"),severity:"error"})):(console.error("[REOPEN_SESSION] Other error:",I),e9(v9({description:e8(Lx(I.resultCode)),severity:"error"})),tW(!0))}catch(e){XL("reopenSession failed",e)}return t5(!1),null},rh=(0,em.useRef)(()=>Promise.resolve(null));rh.current=e=>{let{text:t,media:n,translate:r=!0,translatedText:i,hidden:a=!1,typingText:o,useLoaderTextAsMsg:s=!1,hasBatchQueued:l=!1,expiredSessionID:u,continueFromChatLogID:c}=e,d=null!=u?u:rn,h=null!=c?c:n3,p=()=>{var e,t;return rd(!0,nz(),nU,void 0,void 0,{LANG:t1,PATHNAME:window.location.pathname,ROUTE:(null==(t=null==(e=window.location.pathname)?void 0:e.split("/"))?void 0:t.pop())||"",...U||{}},j,void 0,void 0,h,d,!0,!0)},m=e=>{t8(!1),t9(void 0),null===e&&t&&!a&&e9(v9({description:e8("errors.SESSION_EXPIRED"),severity:"error"}))};return t?p().then(e=>{if(null==e?void 0:e.sessionID){var u;u=e.sessionID,setTimeout(()=>{n5(t,n,u,r,i,a,o,s,l,!0)},500)}else m(e);return e}):p().then(e=>((null==e?void 0:e.sessionID)||m(e),e))};let rp=async(t,n,r,i)=>{var a,o,s,l,u,c,d;if(!t||!n)return Promise.reject("Session not found");try{let{currentState:t,resultCode:h}=await th(n,null!=r?r:kK);if(0===h){let p=0;if(r!==kK&&i&&("X1a"===t.state||"X1b"===t.state)){let t=nJ(nV),{resultCode:r}=await tu({sessionId:n,text:null!=i?i:"",...e.needsDateTime&&{dateUTC:null!=(a=i5.utc().toISO())?a:void 0},...void 0!==t&&{place:t}});p=r}if(0===p){let{currentState:e,...t}=await tp(n);if(0===t.resultCode&&e)return{currentState:e,sessionId:n,...t}}else if([400,401,403,404,500].includes(h)){let t,n=qP("birthDate",void 0);try{t=window.location.href}catch(e){}rc({memoriID:null!=(o=e.engineMemoriID)?o:"",password:nz(),tag:null!=r?r:null==W?void 0:W.tag,pin:null!=i?i:null==W?void 0:W.pin,initialContextVars:{LANG:t1,PATHNAME:window.location.pathname,ROUTE:(null==(l=null==(s=window.location.pathname)?void 0:s.split("/"))?void 0:l.pop())||"",...U||{}},initialQuestion:j,birthDate:n7||n||void 0,additionalInfo:{...X||{},loginToken:tO(),language:(null!=(d=null!=t1?t1:null==(c=null==(u=e.culture)?void 0:u.split("-"))?void 0:c[0])?d:"IT").toLowerCase(),referral:t,timeZoneOffset:new Date().getTimezoneOffset().toString()}})}else if(t)return{currentState:t,sessionId:n,resultCode:h}}}catch(e){return Promise.reject(e)}return null},[rm,rf]=(0,em.useState)(),rg=(0,em.useRef)(),rv=()=>{rm&&(clearTimeout(rm),rf(void 0)),(null==rg?void 0:rg.current)&&(clearTimeout(rg.current),rg.current=void 0)};(0,em.useEffect)(()=>()=>{rN(!1),tG(!1),tq.current=!1,rv(),rg.current=void 0},[]);let[ry,rb]=(0,em.useState)(!1);(0,em.useRef)(null);let r_=(0,em.useMemo)(()=>{var t,n;return{provider:z,voice:function(e,t="azure",n="FEMALE"){let r=(e||"EN").toUpperCase();if("openai"===t.toLowerCase())return(JD[r]||JD.DEFAULT)[n]||JD.DEFAULT[n]||"alloy";{let e=Jk[r]||JL;return e[n]||e.FEMALE||JL.FEMALE}}(t1||(null==(n=null==(t=e.culture)?void 0:t.split("-"))?void 0:n[0])||"EN",z,e.voiceType),tenant:r,sessionId:rn,sessionIdRef:ri,region:"westeurope",voiceType:e.voiceType,layout:nr}},[z,t1,e.culture,e.voiceType,nr,r,rn,ri]),rx=(0,em.useMemo)(()=>({provider:z,language:(t=>{var n,r;let i="";switch((t||(null==(r=null==(n=e.culture)?void 0:n.split("-"))?void 0:r[0])||e7.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";break;case"EL":i="el-GR";break;case"AR":i="ar-SA";break;case"ZH":i="zh-CN";break;case"JA":i="ja-JP"}return i})(t1),tenant:r,sessionId:rn,sessionIdRef:ri}),[z,t1,r,rn,ri]),rw=(0,em.useCallback)(e=>{let t=function(e){if(e instanceof Jz&&e.code)return JW[e.code]}(e);e9(v9({description:t?e8(t):e.message,severity:e instanceof Jz&&"rate_limited"===e.code?"warning":"error"}))},[e9,e8]),rS=null==(eR=null!=J?J:null==tP?void 0:tP.defaultSpeakerActive)||eR,{speak:rE,stop:rA,isPlaying:rT,speakerMuted:rI,toggleMute:rC,hasUserActivatedSpeak:rM,setHasUserActivatedSpeak:rN}=function(e,t={},n=!1,r=!0,i=!0){let a=!r||!i||n,[o,s]=(0,em.useState)(!1),[l,u]=(0,em.useState)(()=>!r||qP("muteSpeaker",a)),{addViseme:c,resetVisemeQueue:d,startProcessing:h,stopProcessing:p}=q9(),[m,f]=(0,em.useState)(!1),g=e=>JB({text:e,preview:t.preview,defaultEnableAudio:r,defaultSpeakerActive:i,autoStart:n,speakerMuted:l,storedMute:qP("muteSpeaker",a)}),v=(0,em.useRef)(null),y=(0,em.useRef)(null),b=(0,em.useRef)(null),_=(0,em.useRef)(!1),x=(0,em.useRef)(!1),w=(0,em.useRef)(null),S=(0,em.useRef)(!0),E=(0,em.useRef)(null),A=t.apiUrl||"/api/tts",T=(0,em.useRef)(t.onError);T.current=t.onError;let I=(0,em.useCallback)(e=>(d(),_.current=!1,!!e&&e.length>0&&(e.forEach(e=>{c(e.visemeId,e.audioOffset)}),_.current=!0,!0)),[c,d]),C=(0,em.useCallback)(()=>{if(!v.current)return null;let e={state:"running",onstatechange:null,get currentTime(){return v.current?v.current.currentTime:0}},t=()=>{e.state="suspended",e.onstatechange&&e.onstatechange.call(null,new Event("statechange"))},n=()=>{e.state="running",e.onstatechange&&e.onstatechange.call(null,new Event("statechange"))},r=()=>{e.state="closed",e.onstatechange&&e.onstatechange.call(null,new Event("statechange"))};return v.current.addEventListener("pause",t),v.current.addEventListener("play",n),v.current.addEventListener("ended",r),e.cleanup=()=>{v.current&&(v.current.removeEventListener("pause",t),v.current.removeEventListener("play",n),v.current.removeEventListener("ended",r))},e},[]),M=(0,em.useCallback)(()=>{var e;w.current&&(clearTimeout(w.current),w.current=null),y.current&&y.current.cleanup&&y.current.cleanup(),y.current=null,p(),d(),(null==(e=v.current)?void 0:e.src)&&(URL.revokeObjectURL(v.current.src),v.current=null),E.current&&(E.current=null),_.current=!1},[p,d]),N=(0,em.useCallback)(()=>{v.current&&(v.current.pause(),v.current.currentTime=0),E.current&&(E.current.pause(),E.current.currentTime=0,E.current=null),s(!1),M(),x.current=!1;let e=new CustomEvent("MemoriAudioEnded");document.dispatchEvent(e)},[M]),R=(0,em.useCallback)(()=>{let e=new CustomEvent("MemoriEndSpeak");document.dispatchEvent(e),t.continuousSpeech&&t.onEndSpeakStartListen&&t.onEndSpeakStartListen()},[t.continuousSpeech,t.onEndSpeakStartListen]),O=(0,em.useCallback)((e,t=800)=>{if(e.length<=t)return[e];let n=e.split(/[.!?]+/).filter(e=>e.trim().length>0),r=[],i="";for(let e of n){let n=e.trim()+".";(i+n).length>t&&i.length>0?(r.push(i.trim()),i=n):i+=n+" "}return i.trim().length>0&&r.push(i.trim()),r},[]),P=(0,em.useCallback)(async t=>{let n=JH(e),r=JG(A,e.tenant),i=await fetch(A,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:t,...r?{tenant:r}:{},sessionId:n,voice:e.voice,model:e.model||"tts-1",region:e.region,provider:e.provider,includeVisemes:"ZOOMED_FULL_BODY"===e.layout||"FULLPAGE"===e.layout||"DEFAULT"===e.layout||"TOTEM"===e.layout})});if(!i.ok)throw await JV(i);let a=await i.blob(),o=URL.createObjectURL(a);if(!g(t)||!x.current||!S.current)return void URL.revokeObjectURL(o);let s=!1,l=i.headers.get("X-Viseme-Data");if(l)try{let e=JSON.parse(l);s=I(e)}catch(e){console.error("[useTTS] Error parsing viseme data:",e)}if(!x.current||!S.current)return void URL.revokeObjectURL(o);let u=new Audio;return u.preload="auto",u.src=o,v.current=u,E.current=u,y.current&&y.current.cleanup&&(y.current.cleanup(),y.current=null),s&&(y.current=C()),new Promise((e,t)=>{var n;if(!v.current)return void t(Error("Audio element not found"));let r=async()=>{var n,r;try{if(!x.current||!S.current){URL.revokeObjectURL(o),e();return}try{s&&y.current&&h(y.current),await (null==(n=v.current)?void 0:n.play())}catch(e){await new Promise(e=>setTimeout(e,100)),s&&y.current&&h(y.current),await (null==(r=v.current)?void 0:r.play())}}catch(e){URL.revokeObjectURL(o),t(e)}};v.current.addEventListener("canplaythrough",r,{once:!0}),v.current.onended=()=>{URL.revokeObjectURL(o),E.current===u&&(E.current=null),e()},v.current.onerror=()=>{URL.revokeObjectURL(o),E.current===u&&(E.current=null),t(Error("Audio playback failed"))},null==(n=v.current)||n.load()})},[e,t,A,I,C,h,x,S,l,r,i,n]),k=(0,em.useCallback)(async e=>{var t;if(S.current){if(!g(e)){m||f(!0),R();return}if(o&&N(),!x.current){x.current=!0,m||f(!0);try{s(!0);let t=O(e,500);for(let e=0;e<t.length&&x.current&&S.current;e++)await P(t[e]),e<t.length-1&&x.current&&S.current&&await new Promise(e=>setTimeout(e,300));s(!1),x.current=!1,R();let n=new CustomEvent("MemoriAudioEnded");document.dispatchEvent(n)}catch(n){console.error("[speak] Error during playback:",n),null==(t=T.current)||t.call(T,n instanceof Error?n:Error(String(n))),s(!1),x.current=!1,w.current&&(clearTimeout(w.current),w.current=null),M(),R();let e=new CustomEvent("MemoriAudioEnded");document.dispatchEvent(e)}}}},[e,l,t.preview,m,N,M,O,P,R,o,r,i,n]),D=(0,em.useCallback)(e=>{let t=void 0!==e?e:!l;u(t),qk("muteSpeaker",t),t&&o&&N()},[l,o,N,d,p]);return(0,em.useEffect)(()=>{"u">typeof window&&(window.memoriSpeaking=o)},[o]),(0,em.useEffect)(()=>{if("u">typeof window)return b.current=window.speak,window.speak=k,()=>{window.speak=b.current}},[k]),(0,em.useEffect)(()=>()=>{x.current=!1,S.current=!1,N()},[N]),{speak:k,stop:N,isPlaying:o,speakerMuted:l,toggleMute:D,hasUserActivatedSpeak:m,setHasUserActivatedSpeak:f}}(r_,{apiUrl:`${D}/api/tts`,continuousSpeech:nw,preview:p,onError:rw},er,na,rS),rR=!na||!rS||er,rO=e=>JB({text:e,preview:p,defaultEnableAudio:na,defaultSpeakerActive:rS,autoStart:er,speakerMuted:rI,storedMute:qP("muteSpeaker",rR)}),rP=(0,em.useRef)(null),rk=(0,em.useRef)(v);rk.current=v;let{isListening:rL,audioStream:rD,recordingState:rB,startRecording:rF,stopRecording:rU}=function(e,t,n={},r=!0){let[i,a]=(0,em.useState)("idle"),[o,s]=(0,em.useState)(qP("muteMicrophone",!r)),[l,u]=(0,em.useState)(!1),[c,d]=(0,em.useState)(null),[h,p]=(0,em.useState)(!1),[m,f]=(0,em.useState)(null),g=(0,em.useRef)(null),v=(0,em.useRef)(null),y=(0,em.useRef)([]),b=(0,em.useRef)(!1),_=(0,em.useRef)(!0),x=n.apiUrl||"/api/stt",w=(0,em.useRef)(n.onError);w.current=n.onError;let S=(0,em.useCallback)(async()=>{try{if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw Error("Media recording is not supported in this browser");let r=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,sampleRate:16e3}});v.current=r,f(r);let i="";for(let e of["audio/mp4","audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/wav"])if(MediaRecorder.isTypeSupported(e)){i=e;break}let o=new MediaRecorder(r,i?{mimeType:i}:{});return o.ondataavailable=e=>{e.data.size>0&&y.current.push(e.data)},o.onstop=async()=>{a("processing"),p(!1);try{if(0===y.current.length)throw Error("No audio data recorded");let r=new Blob(y.current,{type:o.mimeType});if(0===r.size)throw Error("Recorded audio is empty");if("azure"===e.provider)try{r=await J5(r)}catch(e){throw Error("Failed to convert audio to WAV format for Azure")}let i=await E(r);i.text&&i.text.trim().length>0&&(t&&t(i.text),d(i),n.onTranscriptionComplete&&n.onTranscriptionComplete(i)),a("idle")}catch(t){let e=t instanceof Error?t:Error(String(t));a("error"),w.current&&w.current(e)}finally{y.current=[],b.current=!1}},o.onerror=()=>{let e=Error("Recording failed");a("error"),b.current=!1,w.current&&w.current(e)},g.current=o,!0}catch(t){let e=t instanceof Error?t:Error("Failed to access microphone");return a("error"),w.current&&w.current(e),!1}},[e.provider,n]),E=(0,em.useCallback)(async t=>{var n;let r=JH(e),i=JG(x,e.tenant),a=new FormData,o="webm";"azure"===e.provider?o="wav":(null==(n=g.current)?void 0:n.mimeType)&&(g.current.mimeType.includes("webm")?o="webm":g.current.mimeType.includes("mp4")?o="mp4":g.current.mimeType.includes("ogg")&&(o="ogg")),a.append("audio",t,`recording.${o}`),a.append("provider",e.provider),a.append("sessionId",r),i&&a.append("tenant",i),e.language&&a.append("language",e.language),e.model&&a.append("model",e.model),e.region&&a.append("region",e.region);let s=await fetch(x,{method:"POST",body:a});if(!s.ok)throw await JV(s);let l=await s.json();if(!l.success||!l.result)throw Error("Invalid response from transcription service");return l.result},[e,x]),A=(0,em.useCallback)(async()=>{if(o)return!1;if("recording"===i)return!0;l||u(!0);try{if(a("recording"),!g.current&&!await S())return!1;return y.current=[],b.current=!0,g.current&&"inactive"===g.current.state&&(g.current.start(),p(!0)),!0}catch(t){let e=t instanceof Error?t:Error("Failed to start recording");return a("error"),b.current=!1,w.current&&w.current(e),!1}},[o,i,l,S,n]),T=(0,em.useCallback)(()=>{if(b.current)try{p(!1),g.current&&"recording"===g.current.state&&g.current.stop()}catch(t){let e=t instanceof Error?t:Error("Failed to stop recording");a("error"),b.current=!1,w.current&&w.current(e)}},[i,n]),I=(0,em.useCallback)(async()=>{"recording"===i?T():"idle"===i&&await A()},[i,A,T]),C=(0,em.useCallback)(e=>{let t=void 0!==e?e:!o;s(t),t&&"recording"===i&&T()},[o,i,T]),M=(0,em.useCallback)(()=>{b.current=!1,g.current&&("recording"===g.current.state&&g.current.stop(),g.current=null),v.current&&(v.current.getTracks().forEach(e=>e.stop()),v.current=null),f(null),y.current=[],p(!1),a("idle")},[]);return(0,em.useEffect)(()=>()=>{_.current=!1,M()},[M]),(0,em.useEffect)(()=>{"u">typeof window&&(window.memoriListening=h)},[h]),{recordingState:i,microphoneMuted:o,hasUserActivatedRecord:l,lastTranscription:c,isListening:h,audioStream:m,startRecording:A,stopRecording:T,toggleRecording:I,toggleMute:C,transcribeAudio:E,setHasUserActivatedRecord:u,cleanup:M}}(rx,e=>{if(e&&0!==e.trim().length)try{let t=e.slice(0,e.length/2).trim().toLowerCase()===e.slice(e.length/2+1).trim().toLowerCase()?e.slice(0,e.length/2):e,n=rP.current;rP.current=null,n?t.length>0&&n(t):t.length>0&&rk.current?nX(e=>[e.trim(),t].filter(Boolean).join(" ")):t.length>0&&(nX(""),n5(t))}catch(e){}},{apiUrl:`${D}/api/stt`,onError:rw},na);(0,em.useEffect)(()=>{var t,n;let r=tF.current;if(tB){tF.current=!0;return}t=!!e.requireLoginToken,n=!!ri.current,t&&r&&!tB&&n&&(rA(),rU(),rv(),t8(!1),t9(void 0),rN(!1),tG(!1),nX(""),n1([]),ru(void 0),ra(void 0)),tF.current=!1},[tB,e.requireLoginToken,rn]),(0,em.useEffect)(()=>{rL&&(rP.current=null)},[rL]);let rj=async e=>{var t;let n;if(!rO(e)){let e=new CustomEvent("MemoriEndSpeak");return document.dispatchEvent(e),Promise.resolve()}return"function"==typeof rU&&rU(),nu(!1),rE((t=Le(k9(k7(e))).replaceAll(/[^\p{L}\p{N}\p{P}\p{Z}^$\n]/gu,"").trim().replaceAll(/```*?```/g,"").replaceAll(/```[\s\S]*?```/g,"").replaceAll(/`[^`]*`/g,"").replaceAll(/!\[[^\]]*\]\([^)]*\)/g,"").replaceAll(/\[([^\]]*)\]\([^)]*\)/g,"$1").replaceAll(/^> /gm,"").replaceAll(/^#+ /gm,"").replaceAll(/[*_]/g,"").replaceAll(/---/g,"").replaceAll(/~~/g,"").replaceAll(/^\s*[-*+] /gm,"").replaceAll(/^\s*\d+\.\s+/gm,"").replaceAll(/^\|.*\|$/gm,"").replaceAll(/\$\$[\s\S]*?\$\$/g,"").replaceAll(/\$[\s\S]*?\$/g,"").replaceAll(/\\\([\s\S]*?\\\)/g,"").replaceAll(/\\\[[\s\S]*?\\\]/g,"").replaceAll(/\s+/g," ").trim(),(n=document.createElement("textarea")).textContent=t,n.innerHTML))},rz=(0,em.useCallback)(async(e,t,n,r=!1)=>{try{if(!e)return null;let i=await n6(e,t,n,r),a=i.translatedEmission||i.emission;return rM||rN(!0),a&&!r&&rO(a)&&await rj(a),i}catch(t){return rM||rN(!0),e}},[n6,rj,rM,rN,rI]),rH=(0,em.useCallback)((e,t)=>{var n;let{msg:r,typingText:i,useLoaderTextAsMsg:a}=t,o=e.currentState;if(0!==e.resultCode||!o){if((XR(e.resultCode)||XO(e.resultMessage))&&t.text){t8(!1),t9(void 0),rh.current({text:t.text,media:t.media,translate:t.translate,translatedText:t.translatedText,hidden:t.hidden,typingText:t.typingText,useLoaderTextAsMsg:t.useLoaderTextAsMsg,hasBatchQueued:t.hasBatchQueued,expiredSessionID:rn,continueFromChatLogID:n3});return}500===e.resultCode&&e.resultMessage&&n1(t=>[...t,{text:"Error: "+e.resultMessage,emitter:"system",fromUser:!1,initial:!1,contextVars:{},date:new Date().toISOString()}]);return}if(!r)return;n4(void 0);let s=a&&i?i:o.emission;t1.toLowerCase()!==tQ.toLowerCase()&&s&&t0?n6({...o,emission:s},t1,r,!1,o).then(e=>{let t=e.translatedEmission||e.emission;t&&rO(t)&&rj(t)}):(ru({...o,emission:s},o),s&&(n2({text:s,emitter:o.emitter,media:null!=(n=o.emittedMedia)?n:o.media,llmUsage:o.llmUsage,fromUser:!1,questionAnswered:r,generatedByAI:!!o.completion,contextVars:o.contextVars,date:o.currentDate,placeName:o.currentPlaceName,placeLatitude:o.currentLatitude,placeLongitude:o.currentLongitude,placeUncertaintyKm:o.currentUncertaintyKm,tag:o.currentTag,memoryTags:o.memoryTags}),s&&rO(s)&&rj(s)))},[t1,tQ,t0,n6,rj,rO]),rG=(0,em.useCallback)((e,t)=>{var n;(null==(n=t.waitForResponse)?void 0:n.timeoutId)&&clearTimeout(t.waitForResponse.timeoutId),ne.current.delete(e)},[]),rV=(0,em.useCallback)(e=>{var t,n,r;let i,a=e.correlationID;if(a&&(i=ne.current.get(a))&&(rG(a,i),null==(t=i.waitForResponse)||t.reject(Error(null!=(n=e.errorMessage)?n:String(null!=(r=e.errorCode)?r:"NATS error")))),function(e){if(XR(e.errorCode))return!0;if("string"==typeof e.errorCode){let t=e.errorCode.toUpperCase();if(t.includes("SESSION_EXPIRED")||t.includes("SESSION_NOT_FOUND"))return!0}return XO(e.errorMessage)}(e)&&(null==i?void 0:i.text)){t8(!1),t9(void 0),rh.current({text:i.text,media:i.media,translate:i.translate,translatedText:i.translatedText,hidden:i.hidden,typingText:i.typingText,useLoaderTextAsMsg:i.useLoaderTextAsMsg,hasBatchQueued:i.hasBatchQueued,expiredSessionID:rn,continueFromChatLogID:n3});return}n2({text:e.errorMessage?`Error: ${e.errorMessage}`:e.errorCode?`Error: ${e.errorCode}`:"Error: An unexpected error occurred",emitter:"system",fromUser:!1,initial:!1,contextVars:{},date:new Date().toISOString()}),t8(!1),t9(void 0)},[rG]),rW=(0,em.useCallback)((e,t)=>{let n=ne.current.get(e);if(!n)return void nt.current.set(e,t);if(rG(e,n),n.waitForResponse){n.waitForResponse.resolve(t),t8(!1),t9(void 0);return}rH(t,n),n.hasBatchQueued||(t8(!1),t9(void 0))},[rH,rG]),rq=(0,em.useCallback)((e,t)=>{let n=nt.current.get(e);if(n){nt.current.delete(e),ne.current.set(e,t),rW(e,n);return}ne.current.set(e,t)},[rW]),r$=(0,em.useCallback)((e,t=12e4)=>new Promise((n,r)=>{let i=setTimeout(()=>{let n=ne.current.get(e);n&&rG(e,n),XL("NATS timeout",{correlationID:e,timeoutMs:t}),r(Error("NATS enter-text response timeout"))},t);rq(e,{stateBeforeRequest:rl.current,waitForResponse:{resolve:e=>{clearTimeout(i),n(e)},reject:e=>{clearTimeout(i),r(e)},timeoutId:i}})}),[rq,rG]),rJ=(0,em.useCallback)(async()=>{if(!rn||0===ne.current.size)return;let e=Array.from(ne.current.entries()).pop();if(!e)return;let[t,n]=e;try{let{currentState:e,resultCode:r,resultMessage:i,requestID:a}=await tp(rn);if(0!==r||!e)return void rW(t,{eventType:"dialog_text_entered_response",correlationID:t,requestID:a,resultCode:r,resultMessage:i,currentState:e});if(!function(e,t){if(XP(t)===(null!=e?e:""))return!1;try{let n=e?JSON.parse(e):{};if(void 0!==n.emission&&n.emission===t.emission&&!0!==t.completion)return!1}catch(e){}return!0}(n.stateBeforeRequest,e)||XP(e)===rl.current)return void console.info("[NATS] catch-up: pending turn has not completed yet");console.info("[NATS] catch-up: applying current engine session state"),rW(t,{eventType:"dialog_text_entered_response",correlationID:t,requestID:a,resultCode:r,resultMessage:i,currentState:e})}catch(e){XL("NATS catch-up failed",e)}},[rn,rW]);!function({baseUrl:e,sessionId:t,onProgress:n,onDialogResponse:r,onError:i,onCatchUp:a}){let[o,s]=(0,em.useState)(null),[l,u]=(0,em.useState)(null),c=(0,em.useRef)(n),d=(0,em.useRef)(r),h=(0,em.useRef)(i),p=(0,em.useRef)(a),m=(0,em.useRef)(null),f=(0,em.useRef)(!1),g=(0,em.useRef)(!1),v=(0,em.useRef)(0);(0,em.useEffect)(()=>{c.current=n,d.current=r,h.current=i,p.current=a},[n,r,i,a]);let y=(0,em.useCallback)(async n=>{var r;if(!t||g.current||"auth"===n&&Date.now()-v.current<5e3)return;g.current=!0,"auth"===n&&(v.current=Date.now()),null==(r=m.current)||r.abort();let i=new AbortController;m.current=i,console.info("[NATS] fetching config from",`${e}/api/nats`,"for session",t,`(${n})`);try{let r=await J8(e,t,i.signal);i.signal.aborted||(f.current="initial"!==n,console.info("[NATS] config received",{url:r.url,jetStream:!!r.stream,stream:r.stream}),s(r),u(null))}catch(e){i.signal.aborted||(null==e?void 0:e.name)==="AbortError"||(console.error("[NATS] config error",e),s(null),u(e instanceof Error?e:Error(String(e))))}finally{m.current===i&&(m.current=null,g.current=!1)}},[e,t]);(0,em.useEffect)(()=>{if(!t){console.debug("[NATS] no sessionId, skipping config fetch"),s(null),u(null);return}return y("initial"),()=>{var e;null==(e=m.current)||e.abort(),m.current=null,g.current=!1}},[t,y]),(0,em.useEffect)(()=>{if(!t)return;let e=()=>{"visible"===document.visibilityState&&y("resume")},n=()=>{"visible"===document.visibilityState&&e()},r=t=>{t.persisted&&e()};return document.addEventListener("visibilitychange",n),window.addEventListener("online",e),window.addEventListener("pageshow",r),()=>{document.removeEventListener("visibilitychange",n),window.removeEventListener("online",e),window.removeEventListener("pageshow",r)}},[t,y]),!function(e,t,n,r={}){let i=(0,em.useRef)(null),a=(0,em.useRef)(null),o=(0,em.useRef)(n),s=(0,em.useRef)(r),l=(0,em.useRef)(!1),[u,c]=(0,em.useState)(0);(0,em.useEffect)(()=>{o.current=n},[n]),(0,em.useEffect)(()=>{s.current=r},[r]),(0,em.useEffect)(()=>{if(!e||!(null==t?void 0:t.stream))return;let n=()=>{"visible"===document.visibilityState&&(console.info("[NATS] resuming JetStream after visibility/network change"),c(e=>e+1))},r=()=>{if("hidden"===document.visibilityState){l.current=!0;return}l.current&&(l.current=!1,n())},i=e=>{e.persisted&&n()};return document.addEventListener("visibilitychange",r),window.addEventListener("online",n),window.addEventListener("pageshow",i),()=>{document.removeEventListener("visibilitychange",r),window.removeEventListener("online",n),window.removeEventListener("pageshow",i)}},[e,null==t?void 0:t.stream]),(0,em.useEffect)(()=>{var n;if(!e||!(null==t?void 0:t.url)||!t.token)return void console.debug("[NATS] subscription skipped (missing sessionId/url/token)",{sessionId:e,hasUrl:!!(null==t?void 0:t.url),hasToken:!!(null==t?void 0:t.token)});let r=!1,l=null!=(n=t.subject)?n:`sessions.${e}`,c=!!t.stream,d=c&&u>0?"catch-up":"live";return(async()=>{console.info("[NATS] connecting to",t.url,"for session",e,c?`(JetStream/${d})`:"(core)");let n=await (0,J7.wsconnect)({servers:[t.url],authenticator:(0,J7.jwtAuthenticator)(t.token)});if(r){console.debug("[NATS] connection established after cleanup, closing immediately"),await n.close();return}i.current=n,console.info("[NATS] connected to",n.getServer());let u=e=>{o.current(e)},h=()=>{var e,t;return null==(t=(e=s.current).onConnected)?void 0:t.call(e)},p=!1,m=e=>{var t,n;r||p||(p=!0,null==(n=(t=s.current).onAuthError)||n.call(t,e))};(async()=>{for await(let e of n.status())if("error"===e.type&&XE(e.error))return void m(e.error)})(),n.closed().then(e=>{e&&XE(e)&&m(e)}),c?await XM(n,t,l,d,u,e=>{a.current=e},h):await XC(n,l,u,h)})().catch(e=>{var t,n;console.error("[NATS] connection error",e),!r&&XE(e)&&(null==(n=(t=s.current).onAuthError)||n.call(t,e))}),()=>{var e,t;console.info("[NATS] cleanup: closing connection for subject",l),r=!0,null==(e=a.current)||e.stop(),a.current=null,null==(t=i.current)||t.close(),i.current=null}},[e,t,u]),(0,em.useEffect)(()=>{c(0)},[e])}(t,null!=o?o:void 0,(0,em.useCallback)(e=>{var t,n,r;switch(console.debug("[NATS] dispatching event",{eventType:e.eventType}),e.eventType){case"progress":null==(t=c.current)||t.call(c,e);break;case"dialog_text_entered_response":null==(n=d.current)||n.call(d,e);break;case"error":null==(r=h.current)||r.call(h,e);break;default:console.warn("Unknown NATS event",e)}},[]),{onConnected:(0,em.useCallback)(()=>{var e;f.current&&(f.current=!1,null==(e=p.current)||e.call(p))},[]),onAuthError:(0,em.useCallback)(e=>{console.warn("[NATS] JWT rejected or expired; refreshing credentials",e),y("auth")},[y])})}({baseUrl:D,sessionId:rn,onProgress:(0,em.useCallback)(e=>{e.message&&t9(e.message)},[]),onDialogResponse:(0,em.useCallback)(e=>{let t=e.correlationID;if(!t){XL("NATS dialog response missing correlationID",e),t8(!1),t9(void 0);return}rW(t,e)},[rW]),onError:rV,onCatchUp:rJ}),(0,em.useEffect)(()=>{let e;"TOTEM"!==nr&&((e=document.querySelector("#chat-fieldset textarea"))&&ty?e.focus():null==e||e.blur())},[null==ro?void 0:ro.emission]);let rK=()=>{try{rv(),tG(!1),rg.current=void 0,rA()}catch(e){}};(0,em.useEffect)(()=>()=>{rK()},[]),(0,em.useEffect)(()=>(document.addEventListener("MemoriResetUIEffects",rK),()=>{document.removeEventListener("MemoriResetUIEffects",rK)}),[]),(0,em.useEffect)(()=>{var t;let n=(t=!!e.requireLoginToken,!!t&&!tB);n||rT||t6||!nw||!no&&ry||!rn||nl?((rT||t6)&&rL||n&&rL)&&rU():rF()},[rT,no,nl,t6,tB,e.requireLoginToken,rn]),(0,em.useEffect)(()=>{rU()},[tQ]);let[rY,rX]=(0,em.useState)("keypress");(0,em.useEffect)(()=>{window.innerWidth<=768&&kQ()?rX("click"):rX("keypress")},[]);let[rZ,rQ]=(0,em.useState)(),r0=null==tP?void 0:tP.globalBackground,r1=l&&(e5=null==tP?void 0:tP.buttonBgColor)?{"--memori-primary-color":e5,"--memori-primary-content":null!=(eQ=null==tP?void 0:tP.buttonTextColor)?eQ:"#ffffff","--memori-icon-active-bg":"color-mix(in oklch, var(--memori-primary) 12%, transparent)","--memori-icon-recording-bg":"color-mix(in oklch, var(--memori-error) 12%, transparent)"}:{},r2=[p?"#preview":null,ei?":root":null,l?"body":null,".memori-client",".memori-widget",".memori-drawer",".memori-modal",".memori-header",".memori-dropdown",".memori-select"].filter(Boolean).join(", "),r3=Object.entries(r1).map(([e,t])=>`${e}: ${t};`).join("\n "),r4=[];r3&&(r4.push(`${r2} {
1088
+ ${r3}
1089
+ }`),r4.push(`[data-theme="dark"] .memori-widget,
1090
1090
  .memori-widget[data-theme="dark"],
1091
1091
  [data-theme="dark"] memori-client .memori-widget,
1092
1092
  memori-client[data-theme="dark"] .memori-widget {
1093
- ${r2}
1094
- }`)),(null==tP?void 0:tP.blurBackground)===!1&&r3.push(`.memori-widget .memori-chat--history--has-global-background::before,
1093
+ ${r3}
1094
+ }`)),(null==tP?void 0:tP.blurBackground)===!1&&r4.push(`.memori-widget .memori-chat--history--has-global-background::before,
1095
1095
  .memori-widget .memori-chat-layout--main--has-background::before {
1096
1096
  filter: none;
1097
1097
  transform: none;
1098
- }`);let r4=`@layer memori.overrides {
1099
- ${r3.join("\n ")}
1098
+ }`);let r5=`@layer memori.overrides {
1099
+ ${r4.join("\n ")}
1100
1100
  }
1101
- `,r5=(null==tP?void 0:tP.showAIicon)===void 0||(null==tP?void 0:tP.showAIicon),r6=!!(null!=I?I:null==tP?void 0:tP.showUpload),r8=!!(null!=N?N:null==tP?void 0:tP.showReasoning),r7=(e6=null==tP?void 0:tP.showMessageConsumption,!!(null!=x?x:e6)),r9=(null==tP?void 0:tP.showWhyThisAnswer)===void 0||(null==tP?void 0:tP.showWhyThisAnswer),[ie,it]=(0,em.useState)(!1);(0,em.useEffect)(()=>{(window.innerWidth>=768&&"FULLPAGE"===nr||"FULLPAGE"!==nr)&&it(!0)},[]),(0,em.useEffect)(()=>{if(null==tP?void 0:tP.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",tP.seoTitle),document.head.append(e)}if(null==tP?void 0:tP.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",tP.seoDescription),document.head.append(e)}if(null==tP?void 0:tP.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",tP.seoUrl),document.head.append(e)}let t=H||e.avatarURL;if((null==tP?void 0:tP.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}},[tP,e.avatarURL,H]);let ir=(e,t=0)=>{if(K)return;let{text:n,waitForPrevious:r,hidden:i,typingText:a,useLoaderTextAsMsg:o,hasBatchQueued:s}=e.detail;n&&(r&&!rT&&(nL||ne.current.size>0)&&t<30?setTimeout(()=>{ii.current(e,t+1)},1e3):(rE(),n4(n,void 0,void 0,void 0,void 0,i,a,o,s)))},ii=(0,em.useRef)(ir);ii.current=ir,(0,em.useEffect)(()=>{if(K)return;let e=e=>ii.current(e);return document.addEventListener("MemoriTextEntered",e),()=>{document.removeEventListener("MemoriTextEntered",e)}},[K]);let ia=(0,em.useCallback)(async(t,n=!1,r,i)=>{var a,o,s,l,u,c,d,h,p,m,f,g,v,y,b,_,x,w,S,E;let A=r?void 0:(null==t?void 0:t.sessionID)||rt,T=r?void 0:(null==t?void 0:t.dialogState)||ra;tG(!0),nu(!1);let I=[],C=qP("birthDate",void 0),M=n8||C||(null==tN?void 0:tN.birthDate);!M&&er&&(G||i)&&(M="1970-01-01T10:24:03.845Z");let N=qP("position",void 0);if(er&&(w=!!e.needsPosition,S=!!(nG||N),w&&!S||(E=!!e.requireLoginToken,E&&!tB)))return void tG(!1);if(!await i_({notify:!0})){tG(!1),t5(!1);return}if(A||!n6||M)if((A||"PUBLIC"===e.privacyType||e.secretToken||nB||nU)&&(A||!tV))if(!A||n){if(tW(!1),tq.current)return;tq.current=!0;try{let t=await ru({memoriID:e.engineMemoriID,password:k||nB||e.secretToken,tag:null==W?void 0:W.tag,pin:null==W?void 0:W.pin,continueFromChatLogID:null==r?void 0:r.chatLogID,initialContextVars:{LANG:t1,PATHNAME:null==(a=window.location.pathname)?void 0:a.toUpperCase(),ROUTE:(null==(l=null==(s=null==(o=window.location.pathname)?void 0:o.split("/"))?void 0:s.pop())?void 0:l.toUpperCase())||"",...(!r?U:r.lines[r.lines.length-1].contextVars)||{}},initialQuestion:r?void 0:j,birthDate:M,additionalInfo:{...X||{},loginToken:tO(),language:(null!=(d=null!=t1?t1:null==(c=null==(u=e.culture)?void 0:u.split("-"))?void 0:c[0])?d:"IT").toLowerCase(),timeZoneOffset:new Date().getTimezoneOffset().toString()}});if((null==t?void 0:t.sessionID)&&tU.current){ts(t.sessionID),ri(void 0),t5(!1),tG(!1);return}if(null==t?void 0:t.dialogState)if(r){let e=r.lines.map((e,t)=>{var n,r;return{text:e.text,media:null==(r=null==(n=e.media)?void 0:n.filter(e=>kq.includes(e.mimeType)))?void 0:r.map(e=>({mediumID:`${t}-${e.mimeType}`,...e})),fromUser:e.inbound,llmUsage:e.llmUsage,timestamp:e.timestamp,emitter:e.emitter}});if(I=null!=e?e:[],tQ.toUpperCase()!==t1.toUpperCase()&&t0)try{I=await Promise.all(e.map(async e=>"originalText"in e&&e.originalText?e:{...e,originalText:e.text,text:(await GP(e.text,t1,tQ,D)).text}))}catch(e){}n0(I),n5(t.dialogState,t1,void 0,!0).finally(()=>{rM(!0),tG(!1)})}else n0([]),await rj(t.dialogState,t1),rM(!0),tG(!1);else(null==t?void 0:t.resultCode)===0?(tq.current=!1,await ia(t||void 0)):(t5(!1),tG(!1))}finally{tq.current=!1}return}else if(G||i){let t=null!=i?i:G,{currentState:n,...r}=await tp(t);if(0!==r.resultCode||!n){let{chatLogs:e}=await tf(t,t);ri(void 0),await ia(void 0,!0,null==e?void 0:e[0]);return}if(n0([]),W&&n.currentTag!==W.tag)try{await rh(e.engineMemoriID,t,"-");let n=await rh(e.engineMemoriID,t,W.tag,W.pin);if(n&&0===n.resultCode)await rj(n.currentState,t1),tG(!1);else throw Error("No session")}catch(t){rc(!0,null==e?void 0:e.secretToken,void 0,W.tag,W.pin,{LANG:t1,PATHNAME:null==(h=window.location.pathname)?void 0:h.toUpperCase(),ROUTE:(null==(f=null==(m=null==(p=window.location.pathname)?void 0:p.split("/"))?void 0:m.pop())?void 0:f.toUpperCase())||"",...U||{}},j,M).then(()=>{rM(!0),tG(!1)})}else if(!W&&(null==n?void 0:n.currentTag)&&(null==n?void 0:n.currentTag)!==kK&&(null==n?void 0:n.currentTag)!=="-")try{await rh(e.engineMemoriID,t,"-");let n=await rh(e.engineMemoriID,t,kK);if(n&&0===n.resultCode)await rj(n.currentState,t1),tG(!1);else throw Error("No session")}catch(t){rc(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,{LANG:t1,PATHNAME:null==(g=window.location.pathname)?void 0:g.toUpperCase(),ROUTE:(null==(b=null==(y=null==(v=window.location.pathname)?void 0:v.split("/"))?void 0:y.pop())?void 0:b.toUpperCase())||"",...U||{}},j,M).then(()=>{rM(!0),tG(!1)})}else{try{let{chatLogs:e}=await tf(t,t),n=null==(_=null==e?void 0:e[0])?void 0:_.lines.map((e,t)=>{var n,r;return{text:e.text,media:null==(r=null==(n=e.media)?void 0:n.filter(e=>kq.includes(e.mimeType)))?void 0:r.map(e=>({mediumID:`${t}-${e.mimeType}`,...e})),fromUser:e.inbound,llmUsage:e.llmUsage,timestamp:e.timestamp,emitter:e.emitter}});if(I=null!=n?n:[],tQ.toUpperCase()!==t1.toUpperCase()&&t0)try{I=await Promise.all(n.map(async e=>({...e,originalText:e.text,text:(await GP(e.text,t1,tQ,D)).text})))}catch(e){}n0(I)}catch(e){}if((null==I?void 0:I.length)&&I.length>1||!j)rM(!0),tG(!1),await rj(n,t1,void 0,!!(null==I?void 0:I.length));else{I=[],n0([]);let n=n$(nG),r=await tl({sessionId:t,text:j,...e.needsDateTime&&{dateUTC:null!=(x=i5.utc().toISO())?x:void 0},...void 0!==n&&{place:n}});if(500===r.resultCode&&r.resultMessage)return void n0(e=>[...e,{text:"Error: "+r.resultMessage,emitter:"system",fromUser:!1,initial:!1,contextVars:{},date:new Date().toISOString()}]);let i=XL(r);if(0===r.resultCode&&i){t8(!0);try{let e=await rq(i);0===e.resultCode&&e.currentState&&(await rj(e.currentState,t1,void 0,!1),tG(!1))}catch(e){Xk("onClickStart NATS wait failed",e),t8(!1),t9(void 0)}}else 0===r.resultCode&&Xk("onClickStart enter-text missing correlationID",r)}}}else n0([]),await rj(T,t1),tG(!1);else{nH("password"),tG(!1);return}else{re(!0),tG(!1);return}},[nB,e,nU,n8,rt,t1,nG,tB]),io=(0,em.useCallback)(e=>{let t=!!(rt&&rC),n=!!(nG||qP("position",void 0));nd(r=>((function(e,t,n,r=!1,i=!0){return e&&!t&&!!n&&!r&&i})(r,e,er,t,n)&&queueMicrotask(()=>{ia()}),e||queueMicrotask(()=>{np(!1)}),e))},[er,ia,rt,rC,nG]),[is,il]=(0,em.useState)(!1),iu="WEBSITE_ASSISTANT"===nr||"HIDDEN_CHAT"===nr,ic=(0,em.useRef)(!1);(0,em.useEffect)(()=>{var t,n;let r=qP("position",void 0),i=!!(nG||r);ic.current||tH||tq.current||rt||!er||iu&&!is||tZ||(t=!!e.needsPosition,t&&!i)||(n=!!e.requireLoginToken,n&&!tB)||(ic.current=!0,ia())},[tH,er,iu,is,rt,tZ,nG,e.needsPosition,e.requireLoginToken,tB]),(0,em.useEffect)(()=>{var t;let n=document.querySelector(`memori-client[memoriname="${e.name}"]`)||document.querySelector(`memori-client[memoriid="${e.memoriID}"]`)||document.querySelector("memori-client");if(!n)return;let r=null!=(t=null==X?void 0:X.loginToken)?t:q,i=n.getAttribute("authtoken")||void 0;i&&!r&&(tI(i),tC.current=i);let a=e=>{var t;let n="MEMORI-CLIENT"===e.nodeName?e:null!=(t=e.closest("memori-client"))?t:e.parentElement,r=(null==n?void 0:n.getAttribute("authtoken"))||void 0;tI(r),tC.current=r},o=new MutationObserver(e=>{var t;for(let n of e)"attributes"===n.type&&(null==(t=n.attributeName)?void 0:t.toLowerCase())==="authtoken"&&a(n.target)});return o.observe(n,{attributes:!0,childList:!1,subtree:!1}),()=>{o.disconnect()}},[e.name,e.memoriID,null==X?void 0:X.loginToken,q]);let[id,ih]=(0,em.useState)(),ip=(0,em.useCallback)(async()=>{if(rt&&(null==e?void 0:e.enableBoardOfExperts))try{let{experts:e,count:t,...n}=await tm(rt);0===n.resultCode&&ih(e)}catch(e){}},[rt,null==e?void 0:e.enableBoardOfExperts]);(0,em.useEffect)(()=>{ip()},[rt,ip]);let im=e.enableDeepThought&&!!tE&&!!(null==tN?void 0:tN.userID)&&(null==tN?void 0:tN.pAndCUAccepted),ig=(0,em.useCallback)(()=>{tK(!1),nH(null),e9(v9({description:e8("notEnoughCredits"),severity:"error"}))},[e9,e8]),iv=(0,em.useCallback)(()=>{nH(null),e9(v9({description:e8("creditsCheckFailed"),severity:"error"}))},[e9,e8]),iy=null!=n?n:e.ownerUserID,ib=e.engineMemoriID,i_=(0,em.useCallback)(async e=>{if(!(null==V?void 0:V.billingDelegation))return!0;try{let t=await JU({operation:im?"dt_session_creation":"session_creation",baseUrl:D,userID:iy,engineMemoriID:ib,tenant:r});if(tX(!1),t.enough)return tK(!0),!0;return(null==e?void 0:e.notify)?ig():tK(!1),!1}catch(t){if(Xk("checkCredits failed",t),!(t instanceof JF&&(void 0===t.status||t.status>=400&&t.status<500)))return!0;return tX(!0),(null==e?void 0:e.notify)&&iv(),!1}},[D,im,ig,iv,iy,ib,null==V?void 0:V.billingDelegation,r]);(0,em.useEffect)(()=>{(null==V?void 0:V.billingDelegation)&&i_()},[null==V?void 0:V.billingDelegation,im,i_]),(0,em.useEffect)(()=>{if(et)return;let e=()=>{rt&&ts(rt)};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e),e()}},[rt]);let ix=void 0===C?!("WEBSITE_ASSISTANT"===nr&&tL):!C,iw=!(null==V?void 0:V.ssoLogin)&&tD,iS={memori:{...e,ownerUserID:null!=(eP=null!=(eO=e.ownerUserID)?eO:n)?eP:void 0},apiClient:ta,tenant:V,history:nQ,showShare:null!=(ek=null!=h?h:null==tP?void 0:tP.showShare)?ek:"WEBSITE_ASSISTANT"!==nr,position:nG,layout:nr,additionalSettings:Z,setVenue:nJ,positionPopoverOpen:nc,setPositionPopoverOpen:io,autoStartPositionGeolocation:nh,setShowSettingsDrawer:nf,setShowKnownFactsDrawer:nb,setShowExpertsDrawer:nx,enableAudio:!!z&&(null==(eL=null!=$?$:null==tP?void 0:tP.enableAudio)||eL),speakerMuted:null!=rT&&rT,setSpeakerMuted:e=>{rI(e)},setShowChatHistoryDrawer:nv,showSettings:null==(eD=null!=w?w:null==tP?void 0:tP.showSettings)||eD,showChatHistory:null==(eB=null!=M?M:null==tP?void 0:tP.showChatHistory)||eB,showMessageConsumption:r7,hasUserActivatedSpeak:rC,showReload:"TOTEM"===nr,showClear:null!=(eF=null!=E?E:null==tP?void 0:tP.showClear)&&eF,showExperts:null!=(eU=null!=A?A:null==tP?void 0:tP.showExperts)&&eU,clearHistory:()=>n0(e=>e.slice(-1)),showLogin:iw,setShowLoginDrawer:tz,loginToken:tE,user:tN,sessionID:rt,baseUrl:D,onLogout:()=>{tE&&ta.backend.pwlUserLogout(tE).then(()=>{tz(!1),tR(void 0),tI(void 0),tC.current=void 0,qL("loginToken")})}},iE={memori:e,integration:l,integrationConfig:tP,tenant:V,instruct:tg,avatar3dVisible:ie,setAvatar3dVisible:it,hasUserActivatedSpeak:rC,isPlayingAudio:rA&&!rT&&(null==(ej=null!=$?$:null==tP?void 0:tP.enableAudio)||ej),loading:!!t6,baseUrl:D,apiUrl:ta.constants.BACKEND_URL,enablePositionControls:nC,setEnablePositionControls:nM,avatarType:nN},iA={memori:e,tenant:V,language:tQ,userLang:t1,setUserLang:t2,baseUrl:D,apiUrl:ta.constants.BACKEND_URL,position:nG,setVenue:nJ,openPositionPopover:()=>{io(!0)},integrationConfig:tP,instruct:tg,sessionId:rt,clickedStart:tH,isMultilanguageEnabled:t0,onClickStart:ia,isUserLoggedIn:tB,hasInitialSession:!!G,notEnoughCredits:t$&&!tJ,creditsCheckFailed:t$&&tY,showLogin:iw,setShowLoginDrawer:tz,showChatHistory:"WEBSITE_ASSISTANT"!==nr&&(null==(ez=null!=M?M:null==tP?void 0:tP.showChatHistory)||ez),setShowChatHistoryDrawer:nv,user:tN},iT={memori:e,sessionID:rt||"",tenant:V,translateTo:t0&&t1.toUpperCase()!==(null==(eq=null!=(eW=null!=(eV=null==(eG=null==(eH=e.culture)?void 0:eH.split("-"))?void 0:eG[0])?eV:e7.language)?eW:"IT")?void 0:eq.toUpperCase())?t1:void 0,baseUrl:D,apiUrl:ta.constants.BACKEND_URL,layout:u,memoriTyping:t6,typingText:t7,showTypingText:null!=(e$=null!=S?S:null==tP?void 0:tP.showTypingText)&&e$,history:ix?nQ:nQ.slice(-2),authToken:tO(),dialogState:ra,pushMessage:n1,simulateUserPrompt:(e,t)=>{rE(),n4(e,void 0,void 0,!1,t)},showDates:y,showContextPerLine:_,showMessageConsumption:r7,showAIicon:r5,showUpload:r6,showReasoning:r8,showWhyThisAnswer:r9,showCopyButton:null==(eJ=null!=f?f:null==tP?void 0:tP.showCopyButton)||eJ,showTranslationOriginal:null!=(eK=null!=g?g:null==tP?void 0:tP.showTranslationOriginal)&&eK,client:ta,instruct:tg,preview:p,sendOnEnter:rK,setSendOnEnter:rY,microphoneMode:nw?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen:rX,setAttachmentsMenuOpen:rZ,showInputs:v&&(e0=!!e.requireLoginToken,!e0||!!tB),showMicrophone:!!z&&(null==(eY=null!=$?$:null==tP?void 0:tP.enableAudio)||eY),showFunctionCache:ea,userMessage:nK,onChangeUserMessage:e=>{e&&"\n"!==e&&""!==e.trim()?(nY(e),rg()):nY("")},sendMessage:(e,t)=>{rE(),rF(),nu(!0),n4(e,t),nY("")},onMediumSelectedState:e=>{n5(e,t1,void 0,!0)},stopListening:e=>{e&&rk&&(rO.current=e),rF()},audioStream:rL,startListening:()=>(nu(!1),rB()),stopAudio:rE,listening:rk,transcribing:"processing"===rD,setEnableFocusChatInput:tb,isPlayingAudio:rA,customMediaRenderer:Q,user:tN,userAvatar:ee,experts:id,useMathFormatting:t3,maxTotalMessagePayload:eo,maxTextareaCharacters:es,isChatlogPanel:(null==tP?void 0:tP.artifactChatLogPanel)===!0,globalBackground:rQ||void 0},iI=(0,eh.jsx)("div",{className:"memori--global-background no-background-image"}),iC=l&&(Object.keys(r0).length>0||(null==tP?void 0:tP.blurBackground)===!1)?(0,eh.jsx)("style",{dangerouslySetInnerHTML:{__html:r4}}):null,iM=(0,eh.jsx)($9,{tenant:V,userLang:t1,integrationID:null==l?void 0:l.integrationID,memoriHash:`${e.ownerTenantName}-${e.ownerUserName}-${e.name}`}),iN=c||("TOTEM"===nr?JE:"CHAT"===nr?JA:"FULLPAGE"===nr?JS:"WEBSITE_ASSISTANT"===nr?JR:"HIDDEN_CHAT"===nr?JO:"ZOOMED_FULL_BODY"===nr?JP:JS),iR=(null==tP?void 0:tP.theme)==="light"||(null==tP?void 0:tP.theme)==="dark"?tP.theme:"light";return(0,eh.jsx)("div",{ref:tx,className:(b(tT))("memori","memori-widget",`memori-layout-${String(nr).toLowerCase()}`,`memori-controls-${String(nT).toLowerCase()}`,`memori--avatar-${(null==tP?void 0:tP.avatar)||"default"}`,{"memori--auto-start":er&&!tZ&&(e1=!!e.needsPosition,e2=!!nG,!e1||!!e2)&&(e4=!!e.requireLoginToken,!e4||!!tB),"memori--preview":p,"memori--embed":m,"memori--with-integration":l,"memori--with-speechkey":!!z,"memori--active":rC,"memori--hide-emissions":nO,"memori--has-active-session":!!rt}),"data-theme":iR,"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":rt,"data-memori-integration":null==l?void 0:l.integrationID,"data-memori-engine-state":JSON.stringify({...ra,sessionID:rt}),style:{height:null!=P?P:"100%"},children:(0,eh.jsxs)(v5,{container:t_,clipContainer:tw,theme:iR,zIndexBase:1e4*("WEBSITE_ASSISTANT"===nr),children:[(0,eh.jsx)(v8,{placement:"top-end"}),(0,eh.jsxs)("div",{ref:tS,className:"memori-widget__surface",children:[(0,eh.jsx)(iN,{Header:$8,headerProps:iS,Avatar:$e,avatarProps:iE,Chat:Vx,chatProps:iT,StartPanel:VN,startPanelProps:iA,integrationStyle:iC,integrationBackground:iI,poweredBy:iM,autoStart:er,onSidebarToggle:il,sessionId:rt,hasUserActivatedSpeak:rC,loading:t4,show3dAvatar:tL,avatar3dHidden:!tL,totemContentMaxWidth:null==tP?void 0:tP.totemContentMaxWidth,sideDrawerOpen:!!ng||!!ny||!!n_}),(0,eh.jsx)(tn,{pushMessage:e=>{n0(t=>{if(!t.length)return t;let n=t[t.length-1];if(!n||n.fromUser)return t;let r={...n,text:n.text+e.text};return[...t.slice(0,-1),r]})}}),(0,eh.jsx)("audio",{id:"memori-audio",style:{display:"none"},src:"https://aisuru.com/intro.mp3"}),tt&&(0,eh.jsx)(wb,{withModal:!0,pwdOrTokens:nz,openModal:!!nz,setPwdOrTokens:nH,showTokens:"SECRET"===e.privacyType,onFinish:e=>{var t,n,r,i;return e.password&&nF(e.password),e.password&&(d=e.password),e.tokens&&nj(e.tokens),rc(!rt,e.password,e.tokens,null==W?void 0:W.tag,null==W?void 0:W.pin,{LANG:t1,PATHNAME:null==(t=window.location.pathname)?void 0:t.toUpperCase(),ROUTE:(null==(i=null==(r=null==(n=window.location.pathname)?void 0:n.split("/"))?void 0:r.pop())?void 0:i.toUpperCase())||"",...U||{}},j,n8).then(e=>{if(!(null==e?void 0:e.sessionID))throw Error("AUTH_FAILED");nH(null),(null==e?void 0:e.dialogState)?rM(!0):ia(e)}).catch(e=>{throw e instanceof Error&&"AUTH_FAILED"===e.message||tW(!0),e})},minimumNumberOfRecoveryTokens:null!=(eX=null==e?void 0:e.minimumNumberOfRecoveryTokens)?eX:1}),tt&&(0,eh.jsx)(Jn,{visible:n9,minAge:n6,onClose:t=>{var n,r,i,a;t?(n7(t),qk("birthDate",t),rc(!rt,d||nB||(null==e?void 0:e.secretToken),nU,null==W?void 0:W.tag,null==W?void 0:W.pin,{LANG:t1,PATHNAME:null==(n=window.location.pathname)?void 0:n.toUpperCase(),ROUTE:(null==(a=null==(i=null==(r=window.location.pathname)?void 0:r.split("/"))?void 0:i.pop())?void 0:a.toUpperCase())||"",...U||{}},j,t).then(e=>{re(!1),nH(null),ia(e||void 0)}).catch(()=>{re(!1),tW(!0)})):(re(!1),tG(!1))}}),nm&&(0,eh.jsx)(Jr,{layout:nr,open:!!nm,onClose:()=>nf(!1),microphoneMode:nw?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout:nE,setMicrophoneMode:e=>nS("CONTINUOUS"===e),setContinuousSpeechTimeout:nA,controlsPosition:nT,setControlsPosition:nI,hideEmissions:nO,setHideEmissions:nP,avatarType:nN,setAvatarType:nR,enablePositionControls:nC,setEnablePositionControls:nM,isAvatar3d:!!(null==tP?void 0:tP.avatarURL),additionalSettings:Z,speakerMuted:rT}),ng&&(0,eh.jsx)(J3,{open:!!ng,onClose:()=>nv(!1),resumeSession:e=>{n3(e.chatLogID),ia(void 0,!1,e),nv(!1)},apiClient:ta,sessionId:rt||"",memori:e,baseUrl:D,history:nQ,apiUrl:ta.constants.BACKEND_URL,loginToken:tE,language:tQ,userLang:t1,isMultilanguageEnabled:t0,showFunctionCache:ea,showMessageConsumption:r7}),ny&&rt&&(0,eh.jsx)(Jl,{apiClient:ta,memori:e,sessionID:rt,visible:ny,closeDrawer:()=>nb(!1)}),n_&&!!id&&(0,eh.jsx)(Ju,{apiUrl:ta.constants.BACKEND_URL,baseUrl:D,tenant:V,experts:id,open:n_,onClose:()=>nx(!1)}),tj&&(null==V?void 0:V.name)&&(0,eh.jsx)(Jc,{tenant:V,apiClient:ta,open:!!tj,user:tN,loginToken:tE,memoriName:null==e?void 0:e.name,onClose:()=>tz(!1),modalClassName:"WEBSITE_ASSISTANT"===nr?"memori-modal--above-website-assistant":void 0,onLogin:(t,n)=>{var r,i,a,o;rc(!1,d||nB||(null==e?void 0:e.secretToken),[],null==W?void 0:W.tag,null==W?void 0:W.pin,{LANG:t1,PATHNAME:null==(r=window.location.pathname)?void 0:r.toUpperCase(),ROUTE:(null==(o=null==(a=null==(i=window.location.pathname)?void 0:i.split("/"))?void 0:a.pop())?void 0:o.toUpperCase())||"",...U||{}},void 0,n8,{loginToken:n},void 0,rt).then(e=>{var r,i;if(tz(!1),tR(t),tI(n),tC.current=n,qk("loginToken",n),(null==e?void 0:e.sessionID)&&e.sessionID!==rt&&(null==e?void 0:e.dialogState)){let n=(null==t?void 0:t.userName)||e8("login.user");n1({text:"",emitter:e.dialogState.emitter,media:null!=(i=null!=(r=e.dialogState.emittedMedia)?r:e.dialogState.media)?i:[],fromUser:!1,initial:e8("login.successfullyLoggedIn",{username:n}),contextVars:{...e.dialogState.contextVars||{},LOGIN_STATUS:"success"},date:e.dialogState.currentDate,placeName:e.dialogState.currentPlaceName,placeLatitude:e.dialogState.currentLatitude,placeLongitude:e.dialogState.currentLongitude,placeUncertaintyKm:e.dialogState.currentUncertaintyKm,tag:e.dialogState.currentTag,memoryTags:e.dialogState.memoryTags}),rl(e.dialogState)}})},setUser:tR,onLogout:()=>{tE&&ta.backend.pwlUserLogout(tE).then(()=>{tz(!1),tR(void 0),tI(void 0),tC.current=void 0,qL("loginToken")})}})]})]})})},ap=ec("HPg7A"),XF={};XF=JSON.parse('{"yes":"Si","no":"No","confirm":"Conferma","apply":"Applica","cancel":"Annulla","show":"Mostra","hide":"Nascondi","send":"Invia","scrollToLatest":"Vai all\'ultimo messaggio","scrollToContinueReading":"Scorri per continuare a leggere","close":"Chiudi","clearHistory":"Cancella chat","clearHistoryDone":"Chat cancellata.","moreInfo":"Ulteriori informazioni","back":"Indietro","edit":"Modifica","delete":"Elimina","loading":"Caricamento","expand":"Espandi","collapse":"Riduci","expandable":{"expand":"Espandi"},"fullscreenEnter":"Passa a schermo intero","fullscreenExit":"Esci da schermo intero","center":"Centro","bottom":"In basso","hidden":"Nascosto","day":"Giorno","month":"Mese","year":"Anno","dayPlaceholder":"GG","monthPlaceholder":"MM","yearPlaceholder":"AAAA","createdAt":"Data creazione","selected":"Selezionati","page":"pagina","actions":"Azioni","next":"Successivo","all":"Tutti","copied":"Copiato!","today":"Oggi","yesterday":"Ieri","date":"Data di nascita","last_7_days":"Ultimi 7 giorni","last_30_days":"Ultimi 30 giorni","previous":"Precedente","placeholder":"Fai una domanda","copy":"Copia","copyRawCode":"Copia codice sorgente","feedback":"Feedback","feedbackThankYou":"Grazie per il feedback.","copyFailed":"Impossibile copiare","functionCache":"Cache delle funzioni","copyToClipboard":"Copia negli appunti","showOriginalText":"Mostra originale","showTranslatedText":"Mostra traduzione","exactPosition":"Posizione esatta","uncertain":"Incertezza","question":"Domanda","nothingFound":"Nessun risultato","venue":"Luogo","searchVenue":"Cerca un luogo…","privacyPolicy":"Informativa sulla privacy","popularLanguages":"Popolari","allLanguages":"Tutte le lingue","memoriBlockedTitle":"Bloccato","memoriBlockedUntil":"Agente 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","aiGeneratedNote":"L\'agente può commettere errori. Assicurati di verificare le informazioni importanti.","reasoning":"Ragionamento...","thinking":"Sto ragionando","thought":"Ragionamento","thoughtFor":"Ragionato per {{count}}s","whyThisAnswer":"Da dove viene questa risposta","whyThisAnswerHelper":"Questa risposta è stata generata automaticamente da un\'intelligenza artificiale sulla base di questi contenuti verificati.","whyThisAnswerDescription":"I contenuti della base di conoscenza che l\'agente ha consultato per rispondere.","whyThisAnswerYouAsked":"Hai chiesto","whyThisAnswerUserAsked":"Domanda dell\'utente","whyThisAnswerAgentReplied":"L\'agente ha risposto","whyThisAnswerShowFull":"Mostra la risposta completa","whyThisAnswerContentsUsed":"Contenuti usati","whyThisAnswerOpen":"Apri","whyThisAnswerDisclaimer":"La risposta è stata scritta dall\'agente a partire da questi contenuti: può contenere errori o riformulazioni. Verifica le informazioni importanti alla fonte.","whyThisAnswerEmptyTitle":"Nessun contenuto consultato","whyThisAnswerEmptyDescription":"Per questa domanda l\'agente non ha trovato corrispondenze nella base di conoscenza: ha risposto solo in base alle proprie istruzioni.","whyThisAnswerEmptyAuthorDescription":"La domanda non ha prodotto corrispondenze. Se dovrebbe averne, aggiungi un contenuto che la copra.","whyThisAnswerAddContent":"Aggiungi alla base di conoscenza","whyThisAnswerConfidenceHigh":"Corrispondenza alta","whyThisAnswerConfidenceMedium":"Corrispondenza parziale","whyThisAnswerConfidenceLow":"Corrispondenza debole","whyThisAnswerTypeQuestion":"Domanda e risposta","whyThisAnswerTypeDocument":"Documento","whyThisAnswerTypeWebsite":"Sito web","whyThisAnswerTypeStory":"Racconto","whyThisAnswerSourcesCount_one":"{{count}} fonte","whyThisAnswerSourcesCount_other":"{{count}} fonti","whyThisAnswerNoSources":"Nessuna fonte","receiverLabel":"Assegnato a","missingData":"Informazioni mancanti","completionsEnabled":"IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette","completionProviderDown":"Questo agente è integrato con una IA generativa di {{provider}}, ma al momento non è disponibile. Riprova più tardi.","completionProviderMajorOutage":"Questo agente è integrato con una IA generativa di {{provider}}, ma al momento non è disponibile. Non sarà possibile utilizzare questa funzionalità finché il servizio non viene ripristinato.","completionProviderPartialOutage":"Questo agente è integrato con una IA generativa di {{provider}}, ma sta riscontrando interruzioni parziali. Alcune funzionalità potrebbero non essere disponibili o funzionare in modo non ottimale.","completionProviderDegraded":"Questo agente è integrato con una IA generativa di {{provider}}, ma sta funzionando più lentamente del normale. Le risposte potrebbero richiedere più tempo o essere meno precise.","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 agente.","errorFetchingSession":"Errore durante il caricamento della sessione","errorGettingReferralURL":"Errore durante il caricamento del riferimento","errorReopeningSession":"Errore durante il riapertura della sessione","sessionExpiredReopening":"Sessione scaduta, riapertura in corso","ageVerification":"Verifica dell\'età","ageVerificationText":"Per interagire con questo agente, devi aver almeno {{minAge}} anni.","ageVerificationSuccess":"Età verificata con successo.","nsfw":"NSFW: Questo agente contiene contenuti per adulti","deepThought":"Pensiero profondo","deepThoughtWhatIs":"Cos\'è 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.","notEnoughCredits":"L\'autore di questo agente non ha abbastanza crediti per rispondere alla tua domanda.","creditsCheckFailed":"Non è stato possibile verificare i crediti di questo agente. Riprova più tardi o contatta il suo autore.","confirmDialog":{"title":"Confermi di voler lasciare questa pagina?","message":"Le modifiche non salvate andranno perse."},"knownFacts":{"title":"Fatti noti","description":"Quello che {{memoriName}} ricorda di te. Puoi eliminare ogni voce.","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","searchPlaceholder":"Cerca fra i fatti","select":"Seleziona","loadMore":"Carica altri","factsCount_one":"{{count}} fatto","factsCount_other":"{{count}} fatti","shownOfTotal":"Mostrati {{shown}} di {{total}}","emptyTitle":"Nessun fatto ancora","emptyDescription":"Man mano che parlate, l\'agente annota qui quello che impara su di te. Potrai cancellarlo in qualsiasi momento.","deleteLabel":"Elimina questo fatto","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?","selected_one":"{{count}} fatto selezionato","selected_other":"{{count}} fatti selezionati","selectedRows_one":"{{count}} riga selezionata","selectedRows_other":"{{count}} righe selezionate"},"auth":{"title":"Autenticazione","description":"Questo agente è protetto. Inserisci la password per continuare.","useRecoveryTokens":"Utilizza i token di recupero","tokens":"Token","addToken":"Aggiungi token","usePassword":"Utilizza la password","invalidCredentials":"Credenziali non valide","atLeast":"Almeno"},"widget":{"instruct":"Istruisci","test":"Prova","sound":"Audio","soundOff":"Audio disattivato","position":"Preferenze posizione","settings":"Impostazioni","share":"Condividi","shareChat":"Condividi chat","sendOnKeypress":"Premi Invio per inviare","sendOnClick":"Clicca su Invia","boardOfExperts":"Board di esperti","showExpertsInTheBoard":"Mostra esperti in questa board","expertsInTheBoard":"Esperti in questa board","goToIntegrationsToCustomizeAvatar":"Per personalizzare l\'avatar, vai a Condividimi e configura la pagina pubblica","chatAssistantStatus":"Attiva • Risponde in pochi secondi","agentStatusListening":"in ascolto","agentStatusSpeaking":"sta parlando","agentStatusProcessing":"in elaborazione","shareLocation":"Condividi posizione","shareLocationHint":"Ricevi risposte in base a dove ti trovi","shareLocationAria":"Condividi la posizione con l\'assistente","knownFactsHint":"Le informazioni che ricordo su di te","aiConsumption":"Consumi AI","editPositionAria":"Modifica posizione","positionResolving":"Ricerca indirizzo…","geocodingFailed":"Impossibile ottenere l\'indirizzo. Riprova o cerca manualmente.","positionUnavailableManual":"Posizione non disponibile. Inseriscila manualmente.","positionSharingEnabled":"Posizione condivisa.","headerHistory":"Cronologia","headerProfile":"Profilo","headerLogin":"Accedi","downloadQrCode":"Scarica QR Code","expandToImmersive":"Espandi per vista immersiva","moreActions":"Altre azioni","mobileSession":{"session":"Sessione","sessionInfo":"Info sessione","copyLinkOrDownload":"Copia link o scarica","currentlyOff":"Attualmente disattivato","whatIKnowAboutYou":"Dettagli delle informazioni condivise tra te e {{memoriName}}","locationTracking":"Tracciamento posizione","locationStatus":"Stato","useCurrentPosition":"Usa posizione attuale","disableLocationSharing":"Disattiva condivisione posizione","openKnownFacts":"Apri tutti i fatti noti","knownFactsMessages":"{{count}} messaggi nella sessione corrente"}},"exportChatHistory":{"exportPDF":"Esporta chat come PDF","exporting":"Esportazione in corso...","empty":"Nessuna cronologia chat da esportare","pdfNotSupported":"L\'esportazione PDF non è supportata in questo browser","success":"Chat esportata in PDF con successo","error":"Impossibile esportare la chat in PDF. Riprova."},"write_and_speak":{"micButtonPopover":"Premi il pulsante per parlare","micButtonPopoverListening":"Premi il pulsante per smettere di parlare","stopRecording":"Interrompi registrazione","sendRecording":"Invia messaggio vocale","recordingInProgress":"Registrazione in corso","pageInstructExplanation":"Per insegnarmi nuove cose clicca sul pulsante ISTRUISCIMI per cominciare","pageTryMeExplanation":"Per iniziare a conversare clicca sul pulsante INIZIAMO","pagePrivacyExplanation":"Le conversazioni sono visibili all\'autore dell\'agente","aiDisclaimer":"L\'agente può commettere errori. Assicurati di verificare le risposte.","downloadChat":"Scarica chat","pagePrivacyExplanationList":{"allConversations":"Tutte le conversazioni con questo agente sono visibili all\'autore dell\'agente","anonymousUser":"Per utenti anonimi: l\'autore vedrà il contenuto e l\'indirizzo IP","registeredUser":"Per utenti registrati: l\'autore vedrà il contenuto e il nome utente","contentAndUsername":"L\'autore può vedere il contenuto, il tuo nome utente e il tuo indirizzo IP","contentAndIpAddress":"L\'autore può vedere il contenuto e il tuo indirizzo IP","authorUsesInfo":"L\'autore utilizza queste informazioni per migliorare le funzionalità dell\'agente."},"instructButton":"ISTRUISCIMI","tryMeButton":"INIZIAMO","resumeButton":"RIPRENDI","chatHistory":"Cronologia chat","chatHistoryDescription":"Mostra la cronologia chat con questo agente","loadingChatHistory":"Caricamento cronologia chat...","noChatHistoryAvailable":"Nessuna cronologia chat disponibile","noResultsFound":"Nessun risultato trovato per \\"{{searchText}}\\"","searchInChatHistory":"Cerca nelle conversazioni","filters":"Filtri","latestFirst":"Più recenti prima","oldestFirst":"Più vecchi prima","exportChat":"Esporta 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 se vuoi impostare una conversazione continua. Setta i secondi di silenzio prima dell\'invio.","continuousSpeechLabel":"Conversazione continua","continuousSpeechDisabled":"Conversazione continua disabilitata poichè l\'agente è in modalità muta","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 dall\'agente","showMessageConsumptionLabel":"Mostra consumo per messaggio","secondsLabel":"Secondi","controlsPosition":"Posizione dei controlli","avatarControls":"Controlli Avatar","height":"Altezza","depth":"Profondità","avatarType":"Tipo Avatar","blob":"Blob","avatar3d":"Avatar 3D","zoomed":"Vicino","normal":"Normale","far":"Lontano","suggestions":"Usa le frecce per regolare l\'altezza dell\'avatar\\nUsa +/- per regolare la profondità dell\'avatar","enablePositionControls":"Abilita controlli posizione","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!","requirePositionHelp":"Per parlare con {{name}} devi decidere se fornire o meno la tua posizione. Questo perchè diverse risposte che potrà fornirti potrebbero dipendere da dove ti trovi.","dontWantToProvidePosition":"Continua senza posizione","requireLoginHelp":"Per parlare con {{name}} devi prima accedere con il tuo account.","skipLocationTitle":"Non verrà salvata alcuna posizione sulla mappa.","locationSaved":"La tua posizione è stata salvata.","locationSavedWithPlace":"La tua posizione è stata salvata: {{place}}","locationSkippedConfirm":"Continuerai senza condividere la posizione.","placeSelected":"Luogo selezionato: {{place}}","locationPermissionDenied":"Accesso alla posizione negato. Abilitalo nelle impostazioni del browser oppure scegli un luogo sulla mappa.","locationUnavailable":"Non è stato possibile rilevare la tua posizione. Riprova o cerca un luogo.","locationRequestTimedOut":"Richiesta di posizione scaduta. Riprova o cerca un luogo.","locationErrorGeneric":"Si è verificato un problema durante il recupero della posizione.","attachmentsLabel":"Arricchisci il tuo messaggio","image":"immagine","images":"immagini","file":"file","files":"file","function":"funzione","functions":"funzioni","iWantToTalkToIn":"Voglio parlare con {{name}} in","chatLanguageLabel":"Scegli la lingua della conversazione","chatResumed":"Chat ripresa con successo.","message":"messaggio","messages":"messaggi","page":"Pagina {{current}} di {{total}}","downloadThisConversation":"Scarica questa conversazione","downloadAllConversations":"Scarica tutte le conversazioni","conversationsCount_one":"{{count}} conversazione","conversationsCount_other":"{{count}} conversazioni","shownOfTotal":"Mostrate {{shown}} di {{total}}","loadMore":"Carica altre","backToConversationList":"Torna all\'elenco delle conversazioni","thisWeek":"Questa settimana"},"chatResume":{"resume":"Riprendi la conversazione"},"artifact":{"close":"Chiudi","size":"Dimensione","updated":"aggiornato","updateFailed":"Aggiornamento non applicato","updateFailedHint":"Il patch non corrisponde al contenuto attuale. Chiedi di riscrivere l\'artifact.","generated":"Generato","download":"Scarica","print":"Stampa","external":"Apri in una nuova finestra","type":"Tipo","fullscreen":"Schermo intero","exitFullscreen":"Esci da schermo intero","copy":"Copia","generatedAt":"Generato il","open":"Apri","code":"Codice","source":"Sorgente","preview":"Anteprima","resizeHandle":"Ridimensiona il pannello artifact","copied":"Copiato!","error":"Errore","generatingPdf":"Generazione PDF...","copying":"Copia in corso...","moreCopyOptions":"Altre opzioni di copia","copyAs":"Copia come","downloadAsMarkdown":"Scarica come Markdown","downloadRawMarkdownText":"Scarica testo markdown grezzo","downloadAsPdf":"Scarica come PDF","exportAsPdfDocument":"Esporta come documento PDF","downloadAsHtml":"Scarica come HTML","downloadFormattedHtml":"Scarica HTML formattato","viewMode":"Modalità Visualizzazione","codeMode":"Modalità Codice","refresh":"Aggiorna","share":"Condividi","downloadAsJson":"Scarica come JSON","downloadJsonData":"Scarica dati JSON","downloadAsPng":"Scarica come PNG","downloadPngImage":"Scarica immagine PNG","downloadAsJpeg":"Scarica come JPEG","downloadJpegImage":"Scarica immagine JPEG","downloadAsGif":"Scarica come GIF","downloadGifImage":"Scarica immagine GIF","downloadAsWebp":"Scarica come WebP","downloadWebpImage":"Scarica immagine WebP","copyAsSvg":"Copia come SVG","copySvgSourceCode":"Copia codice sorgente SVG","copyAsPlainText":"Copia come testo normale","copyAsText":"Copia come testo","copyAsLanguage":"Copia come {{language}}","copyLanguageCode":"Copia codice {{language}}","copyWithoutSyntaxHighlighting":"Copia senza evidenziazione sintassi","copyTextContent":"Copia contenuto testo","pdfExportNotSupported":"L\'esportazione PDF non è supportata in questo browser","popupBlocked":"Popup bloccato! Abilita i popup per stampare.","safariPdfInstructions":"Esportazione PDF aperta in una nuova finestra. Usa Cmd+P (Mac) o Ctrl+P (Windows) per stampare e salvare come PDF."},"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 Agente 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}}"},"upload":{"loginRequired":"Login richiesto","pastedText":"testo-copiato","uploadNotification":"Upload Fallito","loginRequiredDescription":"Per caricare immagini, devi prima accedere","uploadFiles":"Carica file (drag and drop)","uploadFilesOrImages":"Carica file o immagini","uploadFilesWithShortcut":"{{shortcut}}+O per aprire il selettore file","uploadImages":"Carica immagini","lastDocumentSlot":"Carica ultimo documento","uploadDocuments":"Carica documenti","maxDocumentsReached":"Puoi caricare fino a {{max}} documenti","replace":"Sostituisci documento","maxImagesReached":"Puoi caricare fino a {{max}} immagini","apiClientNotConfigured":"Client API non configurato correttamente per il caricamento di media","fileReadingFailed":"Lettura del file fallita","uploadFailed":"Caricamento fallito","uploadSuccess":"Caricamento riuscito","remaining":"rimanenti","maxReached":"Limite raggiunto","titleImage":"Aggiungi un titolo all\'immagine","titleImageUpload":"Carica immagini","titleHelp":"Aggiungi un titolo descrittivo per aiutare l\'AI a fornire risposte più appropriate.","titlePlaceholder":"Inserisci il titolo dell\'immagine","uploadSuccessDescription":"Il file è stato caricato con successo","partialUpload":"Solo {{uploaded}} immagini su {{total}} immagini saranno caricate. Massimo {{max}} immagini consentite.","cancel":"Annulla","dragAndDropFiles":"Trascina qui i file per aggiungerli alla chat","pasteMaxAttachmentsReached":"Massimo {{max}} allegati. Rimuovine uno per aggiungere questo come file.","pasteContentTooLong":"Il testo incollato è troppo lungo (max {{size}}KB). Accorcialo o dividilo.","pasteContentExceedsLimit":"Il contenuto incollato supera il limite di dimensione. Prova ad accorciare il testo o a dividerlo in parti più piccole.","pasteAddedAsAttachment":"Testo incollato aggiunto come allegato","filesNotAddedMaxAllowed":"{{count}} file non aggiunto/i (massimo {{max}} file consentiti).","documentsNotAddedMaxAllowed":"{{count}} documento/i non aggiunto/i (massimo {{max}} file consentiti).","imagesNotAddedMaxAllowed":"{{count}} immagine/i non aggiunta/e (massimo {{max}} file consentiti).","documentsNotAddedContextSize":"{{count}} documento/i non aggiunto/i (limite dimensione contesto).","partialAssetUploadWarning":"Alcuni link del file non sono stati caricati, ma il documento è stato aggiunto comunque.","anonymousRetentionNotice":"Nota: i file caricati vengono conservati per massimo 24 ore."},"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 agente è diventato più evoluto con {{points}} punti, guarda le","statistics":"statistiche"},"login":{"login":"Accedi","title":"Accedi al tuo account","loggingIn":"Accesso in corso…","logout":"Esci","userNameRequired":"Il nome utente è obbligatorio","userName":"Nome utente","userNamePlaceholder":"Inserisci il nome utente","user":"Utente","loggedDrawerTitle":"Ciao, {{name}}!","loginDrawerTitle":"Accedi","signupDrawerTitle":"Registrati","newUserSignUp":"Sei un nuovo utente?","signUp":"Registrati!","alreadyHaveAnAccount":"Hai già un account?","backToLogin":"Torna al login","registrationDisabled":"La registrazione è disabilitata.","contactAdmin":"Contatta l\'amministratore per richiedere l\'accesso","userNameOrEmail":"Nome utente o email","email":"Email","emailFormatError":"Per favore, inserisci una mail valida","username":"Nome utente","usernameContainsReservedWord":"Il nome utente contiene una parola riservata, per favore cambia il nome utente","usernameFormatError":"Il nome utente deve essere lungo almeno 3 caratteri e può contenere solo lettere, numeri e _","otpCode":"Codice di verifica","resendVerificationCode":"Invia di nuovo","resentVerificationCode":"Codice di verifica inviato! Controlla la tua mail.","welcomeTitle":"Bentornato","welcomeDescription":"Inserisci il tuo codice di verifica a 4 cifre per continuare al tuo account","otpTitle":"Inserisci il codice di verifica","otpDescription":"Inserisci il codice a 4 cifre che hai generato nel tuo account","otpStep1":"Clicca il pulsante qui sotto per aprire il tuo account","otpStep2":"Genera un codice di verifica a 4 cifre (valido per 5 minuti)","otpStep3":"Torna qui e inserisci il codice","startOtpLogin":"Inizia verifica","generateOtp":"Genera codice","otpTimer":"Il codice scade tra {{time}}","otpInvalidFormat":"Inserisci un codice valido a 4 cifre","otpInvalid":"Codice di verifica non valido","otpError":"Errore nella validazione del codice. Riprova.","otpSuccess":"Login effettuato con successo!","otpEmailTitle":"Inserisci la tua email","otpEmailDescription":"Inserisci il tuo indirizzo email per ricevere un codice di verifica","otpCodeDescription":"Inserisci il codice a 4 cifre inviato a {{email}}","emailPlaceholder":"Inserisci la tua email","sendOtp":"Invia il codice","resendOtp":"Reinvia","resendOtpIn":"Reinvia tra {{seconds}}s","resendOtpPrompt":"Non è arrivato? Reinvia tra {{seconds}} s","resendOtpQuestion":"Non è arrivato?","resending":"Invio in corso...","backToEmail":"Torna all\'email","editEmail":"Modifica","otpSentToPrefix":"Abbiamo mandato un codice di 4 cifre a","otpCodeShort":"Codice","loginBenefitLine1":"{{memoriName}} ti mostra la cronologia delle chat, che puoi riprendere in qualsiasi momento.","loginBenefit":"{{memoriName}} ti mostra la cronologia delle chat, che puoi riprendere in qualsiasi momento.","passwordlessHint":"Ti mandiamo un codice di 4 cifre. Nessuna password da ricordare.","defaultAgentName":"l\'agente","otpSent":"Codice di verifica inviato!","otpResent":"Codice reinviato con successo!","otpSendError":"Errore nell\'invio del codice. Riprova.","emailRequired":"Email richiesta","emailInvalid":"Inserisci un indirizzo email valido","userNotFound":"Utente non trovato","otpNotFound":"Codice di verifica non trovato","otpExpired":"Il codice di verifica è scaduto","otpMissing":"Il codice di verifica è richiesto","otpAttemptsExceeded":"Troppi tentativi. Richiedi un nuovo codice di verifica.","otpSuccessMessage":"Verifica completata! Reindirizzamento...","otpSuccessDescription":"Il tuo account è stato verificato con successo. Sarai reindirizzato a breve.","otpHelp":"Inserisci il codice a 4 cifre dalla tua email","emailHelp":"Ti invieremo un codice di verifica","userFetchError":"Errore nel caricamento dei dati utente. Riprova.","otpStep1Title":"Inserisci Email","otpStep2Title":"Controlla Email","otpStep3Title":"Inserisci Codice","featureFast":"Veloce","featureSecure":"Sicuro","featureMobile":"Mobile","quickActions":"Azioni rapide","verified":"Verificato","termsStatus":"Stato dei termini","enabled":"Abilitato","disabled":"Disabilitato","advancedFeatures":"Funzionalità avanzate","help":"Aiuto","editProfile":"Modifica profilo","notifications":"Notifiche","logoutConfirm":"Sei sicuro di voler uscire?","comingSoon":"Presto disponibile!","accountOverview":"Panoramica account","notSet":"Non impostato","accepted":"Accettato","password":"Password","newPassword":"Nuova password","confirmPassword":"Conferma la password","currentPassword":"Password attuale","passwordMatchingError":"Le password non coincidono.","passwordFormatError":"La password deve essere lunga almeno 8 caratteri e contenere almeno un numero, una lettera maiuscola, una minuscola e un simbolo","pwdWeak":"Debole","pwdAcceptable":"Accettabile","pwdStrong":"Forte","mustChangePassword":"Devi cambiare la password","passwordChange":"Cambio password","emailChange":"Cambio email","avatarChange":"Cambio avatar","avatarUploadSuccess":"Immagine del profilo aggiornata.","underage":"Devi avere almeno {{age}} anni per registrarti.","optional":"opzionale","birthDate":"Data di nascita","birthDatePlaceholder":"GG/MM/AAAA","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 dell\'agente 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","editAccount":"Modifica account","save":"Salva","successfullyLoggedIn":"{{username}} ha effettuato l\'accesso con successo"},"chatLogs":{"llm":"LLM","model":"Modello","provider":"Provider","tokens":"Token","input":"Input","output":"Output","cacheRead":"Cache read","cacheWrite":"Cache write","duration":"Durata","energy":"Energia","co2":"CO2","water":"Acqua","usageBadgesHint":"Clicca uno di questi pulsanti per mostrare maggiori informazioni","totalChatConsumptionTitle":"Consumo Totale Chat","modelUsage":"Utilizzo del modello","environmentalImpact":"Impatto ambientale","impactComparisonUnavailable":"Confronto indicativo non disponibile.","impactComparisonEnergy":"Confronto indicativo: circa quanto tenere accesa una lampadina LED da 10 W per {{duration}}.","impactComparisonCo2":"Confronto indicativo: circa {{distance}} percorsi in auto a benzina media.","impactComparisonWater":"Confronto indicativo: circa {{count}} gocce d\'acqua.","energyImpactDescription":"Questo valore stima l\'energia elettrica necessaria per generare la risposta del modello. Serve a confrontare prompt, modelli e strategie diverse anche quando il singolo messaggio ha un impatto molto piccolo.","co2ImpactDescription":"La CO2 equivalente rappresenta l\'impatto climatico stimato del messaggio. Tradurre il consumo in emissioni aiuta a capire quanto una risposta AI pesa sull\'ambiente in termini comparabili.","waterImpactDescription":"Questo indicatore mostra l\'impronta idrica stimata associata all\'elaborazione del messaggio. Include l\'acqua impiegata indirettamente nell\'energia e nell\'infrastruttura che supportano il calcolo.","approximateValuesTooltip":"Questi valori sono approssimativi.","atLeast":"Almeno {{count}} messaggi","anyMessage":"Qualunque messaggio","atLeast1":"Almeno 1 messaggio","atLeast2":"Almeno 2 messaggi","atLeast3":"Almeno 3 messaggi","atLeast5":"Almeno 5 messaggi","atLeast10":"Almeno 10 messaggi","atLeast15":"Almeno 15 messaggi","atLeast20":"Almeno 20 messaggi","customMinimumMessages":"Personalizza il numero di messaggi"},"success":"Operazione andata a buon fine","Error":"Errore","internal server error":"Ops, scusa... qualcosa è andato storto nel server","error":"Errore","error.loading":"Errore durante il caricamento dei contenuti.","error.notFound":"Ops, non abbiamo trovato ciò che cercavi.","error.generic":"Ops, qualcosa è andato storto.","error.serverNotResponding":"Stiamo facendo manutenzione o rilasciando aggiornamenti. Riprova più tardi.","error.unprocessableEntity":"Errore durante il salvataggio dei dati. Ricontrolla i dati inseriti.","error.goBackTo":"Prova a tornare alla","error.reloadPage":"Ricarica la pagina","error.tryAgain":"Riprova","error.unauthorized":"Non sei autorizzato a visualizzare questo contenuto.","errors":{"TENANT_NOT_FOUND":"Tenant non trovato","TENANT_REGISTRATION_DISABLED":"La registrazione su questa piattaforma è disabilitata","TENANT_MISSING_NAME":"Tenant: nome mancante","TENANT_MAX_USERS_REACHED":"Numero massimo di utenti raggiunto","TENANT_MAX_ADMINS_REACHED":"Numero massimo di utenti amministratori raggiunto","TENANT_ALREADY_EXISTS":"Tenant già esistente","TENANT_MISSING_DESCRIPTION":"Tenant: descrizione mancante","TENANT_CANT_SET_COMPLETION_PROVIDER":"Tenant: non abilitato a gestire il provider di completamento","TENANT_INVALID_TYPE":"Tenant: tipo non valido","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ù Agenti","USER_MISSING_NEW_PASSWORD":"Utente: nuova password mancante","USER_NOTHING_TO_DO":"Niente da fare","USER_CANT_CREATE_MEMORI":"Utente non abilitato a creare Agenti","USER_MAX_MEMORI_REACHED":"Massimo numero di Agenti raggiunto","USER_TOO_MANY_ATTEMPTS":"Troppi tentativi","USER_MUST_ACCEPT_TNC_AND_PP":"Devi accettare i termini e le condizioni","USER_BIRTH_DATE_CANT_BE_CHANGED":"Data di nascita non può essere cambiata","USER_CANT_SET_COMPLETION_PROVIDER":"Utente: non abilitato a gestire il provider di completamento","USER_CANT_ENABLE_DEEP_THOUGHT":"Utente: non abilitato a gestire Pensiero Profondo","USER_CANT_ENABLE_DCM_INTEGRATION":"Utente: non abilitato a gestire l\'integrazione con DCM","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"Utente: non abilitato a gestire la concatenazione o il gruppo di esperti","USER_CREATION_BILLING_DENIED_PERMISSION":"Non hai crediti sufficienti per creare un agente","USER_HAS_ONE_OR_MORE_COMPLETION_CONFIGS":"L\'utente ha una o più configurazioni completions","USER_CANT_BE_DELETED":"Utente non può essere cancellato","USER_ORDER_BY_INVALID":"Ordine non valido","MEMORI_NOT_FOUND":"Agente non trovato","MEMORI_NOT_ACCESSIBLE":"Agente non accessibile","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Solo il proprietario può cambiare il tag e il pin","SESSION_NOT_FOUND":"Sessione non trovata","SESSION_IS_NOT_ADMINISTRATIVE":"Sessione non amministrativa","SESSION_EXPIRED":"Sessione scaduta","speechMissingSession":"La voce richiede una sessione attiva","speechInvalidSession":"Sessione non valida","speechTenantMismatch":"La voce non è disponibile su questo sito","speechRateLimited":"Troppe richieste vocali. Attendi un momento e riprova.","SESSION_OTP_NOT_FOUND":"Codice di verifica non trovato","SESSION_OTP_EXPIRED":"Il codice di verifica è scaduto","SESSION_OTP_INVALID":"Codice di verifica non valido","SESSION_OTP_ATTEMPTS_EXCEEDED":"Troppi tentativi. Richiedi un nuovo codice di verifica.","MEMORI_MISSING_CONFIGURATION":"Agente: configurazione mancante","MEMORI_CONFIGURATION_NOT_FOUND":"Agente: configurazione non trovata","MEMORI_INVALID_PRIVACY_TYPE":"Agente: tipo di privacy non valido","MEMORI_MISSING_PASSWORD":"Agente: password mancante","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Agente: numero totale di token di recupero non valido","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Agente: numero minimo di token di recupero non valido","MEMORI_INVALID_VOICE_TYPE":"Agente: tipo di voce non valido","MEMORI_MISSING_NAME":"Agente: nome mancante","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Agente: password o token di recupero mancanti","MEMORI_INVALID_ID":"Agente: ID non valido","MEMORI_NAME_ALREADY_USED":"Nome Agente già in uso","MEMORI_INVALID_PIN":"Agente: PIN non valido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Agente: cambio TAG e PIN richiedono operazioni separate","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Agente: password non richiesta su agente pubblico","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Pensiero Profondo richiede l\'abilitazione delle completions","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"Il gruppo di esperti richiede l\'abilitazione delle completions","MEMORI_INVALID_COMPLETION_CONFIG":"Agente: configurazione completions non valida","MEMORI_MACRO_FUNCTIONS_REQUIRES_COMPLETIONS":"Macro funzioni richiede l\'abilitazione delle completions","MEMORI_BLOCKING_DATE_MISSING_OR_WRONG":"Agente: data di blocco mancante o non valida","MEMORI_LIST_FILTER_NOT_SPECIFIED":"Agente: filtro non specificato","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":"Agente: la configurazione non può essere modificata","MEMORI_MISSING_NEW_PASSWORD":"Agente: nuova password mancante","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","MEMORI_SESSION_NOT_FOUND":"Sessione non trovata","MEMORI_SESSION_DOESNT_ACCEPT_MEDIA":"Sessione non accetta media","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Agente: funzionalità richiede un abbonamento","INTEGRATION_NOT_FOUND":"Integrazione non trovata","INTEGRATION_INVALID_TYPE":"Tipo integrazione non valido","INTEGRATION_ALREADY_EXISTS":"Integrazione già esistente","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Agenti 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":"Agenti 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","ASSET_MALWARE_SCAN_THREATS_FOUND":"Asset: la scansione ha trovato minaccia malware","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 agente non valido","CONSUMPTIONLOG_INVALID_TYPE":"Tipo di log non valido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","CONSUMPTIONLOG_INVALID_USER_ID":"ID utente non valido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Memori ID non valido","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifiche: Periodo di estrazione chatlog non valido","BROADCAST_NOT_ALLOWED":"Broadcast non consentito","INVALID_NOTIFICATION_TYPE":"Tipo notifica non valido","NOTIFICATION_NOT_FOUND":"Notifica non trovata","INVALID_NOTIFICATION_FILTER":"Filtro notifica non valido","INVALID_NOTIFICATION_PERIOD":"Periodo notifica non valido","PROCESS_INVALID_TYPE":"Tipo di processo non valido","PROCESS_ALREADY_RUNNING":"Processo già in esecuzione","PROCESS_NOT_FOUND":"Processo non trovato","IMPORTCSV_MISSING_ROWS":"Importazione CSV: righe mancanti","IMPORTCSV_MISSING_CSV":"Importazione CSV: CSV mancante","IMPORTCSV_MISSING_SEPARATOR":"Importazione CSV: separatore mancante","IMPORTCSV_INVALID_SEPARATOR":"Importazione CSV: separatore non valido","IMPORTCSV_MISSING_HEADERS":"Importazione CSV: intestazioni mancanti","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Importazione CSV: separatore varianti titolo mancante","IMPORTCSV_INVALID_RECEIVER_ID":"Importazione CSV: ID receiver non valido","IMPORTCSV_INVALID_MEDIA_LINK":"Importazione CSV: link media non valido","IMPORTCSV_INVALID_LINK_TITLE_HANDLING":"Importazione CSV: titolo link non valido","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"Importazione CSV: encoding caratteri non rilevabile","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione CSV: impossibile importare in agenti segreti","IMPORTTXT_MISSING_ROWS":"Importazione TXT: righe mancanti","IMPORTTXT_INVALID_GRANULARITY":"Importazione TXT: granularità non valida","IMPORTTXT_INVALID_RECEIVER_ID":"Importazione TXT: ID receiver non valido","IMPORTTXT_INVALID_MEDIA_LINK":"Importazione TXT: link media non valido","IMPORTTXT_INVALID_LINK_TITLE_HANDLING":"Importazione TXT: titolo link non valido","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"Importazione TXT: encoding caratteri non rilevabile","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione TXT: impossibile importare in agenti segreti","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Importazione TXT: limite importazione superato","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Importazione TXT: importazione su GPT-4 richiede API key","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Importazione TXT: importazione richiede un piano a pagamento","IMPORTTXT_BILLING_DENIED_PERMISSION":"Importazione TXT: non hai crediti sufficienti per l\'operazione","IMPORT_MISSING_ROWS":"Importazione: righe mancanti","IMPORT_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione: impossibile importare in agenti segreti","IMPORTMEMORI_INVALID_MEMORI_SPECS":"Importazione MEMORI: specifiche agente non valide","IMPORT_MISSING_JSONL":"Importazione MEMORI: JSONL mancante","IMPORTMEMORI_INVALID_SPECS":"Importazione MEMORI: specifiche non valide","EXPORT_MISSING_PASSWORD":"Esportazione: password mancante","EXPORTCSV_MISSING_CSV_SPECS":"Esportazione CSV: specifiche CSV mancanti","EXPORTCSV_MISSING_SEPARATOR":"Esportazione CSV: separatore mancante","EXPORTCSV_INVALID_SEPARATOR":"Esportazione CSV: separatore non valido","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Esportazione CSV: separatore varianti titolo mancante","EXPORTCSV_MISSING_NEW_LINE_CHAR":"Esportazione CSV: carattere di nuova riga mancante","EXPORTCSV_INVALID_NEW_LINE_CHAR":"Esportazione CSV: carattere di nuova riga non valido","EXPORTCSV_MISSING_PASSWORD":"Esportazione CSV: password mancante","EXPORTJSONL_MISSING_JSONL_SPECS":"Esportazione JSONL: specifiche JSONL mancanti","EXPORTJSONL_MISSING_PLATFORM":"Esportazione JSONL: piattaforma mancante","EXPORTJSONL_INVALID_PLATFORM":"Esportazione JSONL: piattaforma non valida","EXPORTJSONL_MISSING_PASSWORD":"Esportazione JSONL: password mancante","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"Esportazione JSONL: esportazione richiede un piano a pagamento","ANALYSIS_MISSING_QUERY":"Analisi: query mancante","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analisi: impossibile analizzare agenti segreti","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analisi: corrispondenza query utente richiede Pensiero Profondo","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Assegnazione badge: credenziali errate o mancanti","BADGE_ASSIGNMENT_MISSING_REF_ID":"Assegnazione badge: ID ref mancante","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Assegnazione badge: esito non trovato","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Assegnazione badge: URL di asserzione mancante","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Assegnazione badge: URL badge mancante","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Assegnazione badge: URL issuer mancante","BADGE_ASSIGNMENT_INVALID_URL":"Assegnazione badge: URL non valido","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Assegnazione badge: destinatario mancante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Assegnazione badge: tipo destinatario sconosciuto","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Assegnazione badge: identità destinatario mancante","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Assegnazione badge: tipo hash destinatario mancante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Assegnazione badge: tipo hash destinatario sconosciuto","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Assegnazione badge: identità destinatario errata","BADGE_NOT_FOUND":"Badge non trovato","OUTCOME_NO_DCM_CONFIGURED":"Outcome: nessun DCM configurato","OUTCOME_USER_BADGES_DISABLED":"Outcome: badge utente disabilitati","COMPLETION_CONFIG_MISSING_NAME":"Configurazione completions: nome mancante","COMPLETION_CONFIG_MISSING_PROVIDER":"Configurazione completions: provider mancante","COMPLETION_CONFIG_MISSING_ENDPOINT":"Configurazione completions: endpoint mancante","COMPLETION_CONFIG_MISSING_API_KEY":"Configurazione completions: API key mancante","COMPLETION_CONFIG_MISSING_MODEL":"Configurazione completions: modello mancante","COMPLETION_CONFIG_NO_PURPOSE_SPECIFIED":"Configurazione completions: almeno un tipo di completions deve essere specificato","COMPLETION_CONFIG_INVALID_NAME":"Configurazione completions: nome non valido","COMPLETION_CONFIG_INVALID_PURPOSE":"Configurazione completions: tipo di completions non valido","COMPLETION_CONFIG_INVALID_ENDPOINT":"Configurazione completions: endpoint non valido","COMPLETION_CONFIG_INCONSISTENT_ENDPOINT":"Configurazione completions: endpoint incoerente","COMPLETION_CONFIG_INVALID_PROVIDER":"Configurazione completions: provider non valido","COMPLETION_CONFIG_NOT_FOUND":"Configurazione completions: non trovata","COMPLETION_CONFIG_NOT_ACCESSIBLE":"Configurazione completions: non accessibile","COMPLETION_CONFIG_NAME_RESERVED":"Configurazione completions: nome riservato","COMPLETION_CONFIG_NAME_ALREADY_EXISTS":"Configurazione completions: nome già esistente","COMPLETION_CONFIG_VISIBILITY_CHANGE_NOT_ALLOWED":"Configurazione completions: cambiamento visibilità non consentito","COMPLETION_CONFIG_MISSING_MANDATORY_PREFIX":"Configurazione completions: prefisso obbligatorio mancante","COMPLETION_CONFIG_VISIBILITY_NOT_PERMITTED":"Configurazione completions: visibilità non consentita","COMPLETION_CONFIG_USE_AS_DEFAULT_NOT_PERMITTED":"Configurazione completions: uso come default non consentito","COMPLETION_CONFIG_USE_AS_DEFAULT_REQUIRES_TENANT_VISIBILITY":"Configurazione completions: uso come default richiede visibilità tenant","COMPLETION_CONFIG_CHARGEABLE_NOT_PERMITTED":"Configurazione completions: chargeable non consentito","COMPLETION_CONFIG_INVALID_APPLY_TO":"Configurazione completions: apply to non valido","COMPLETION_CONFIG_APPLY_TO_TENANT_NOT_ALLOWED":"Configurazione completions: apply to tenant non consentito","TRUSTED_APPLICATION_NOT_FOUND":"Applicazione trusted non trovata","TRUSTED_APPLICATION_NOT_ACCESSIBLE":"Applicazione trusted non accessibile","TRUSTED_APPLICATION_NAME_REQUIRED":"Applicazione trusted: nome richiesto","TRUSTED_APPLICATION_TOKEN_REQUIRED":"Applicazione trusted: token richiesto","TRUSTED_APPLICATION_NAME_ALREADY_EXISTS":"Applicazione trusted: nome già esistente","TRUSTED_APPLICATION_INVALID_TOKEN":"Applicazione trusted: token non valido"}}');var XU={};XU=JSON.parse('{"yes":"Yes","no":"No","confirm":"Confirm","apply":"Apply","cancel":"Cancel","show":"Show","hide":"Hide","send":"Send","scrollToLatest":"Scroll to latest","scrollToContinueReading":"Scroll to continue reading","close":"Close","clearHistory":"Clear chat","clearHistoryDone":"Chat cleared.","moreInfo":"More info","back":"Back","edit":"Edit","delete":"Delete","loading":"Loading","expand":"Expand","collapse":"Collapse","expandable":{"expand":"Expand"},"fullscreenEnter":"Enter fullscreen","fullscreenExit":"Exit fullscreen","center":"Center","bottom":"Bottom","hidden":"Hidden","day":"Day","all":"All","today":"Today","yesterday":"Yesterday","placeholder":"Ask a question","last_7_days":"Last 7 days","last_30_days":"Last 30 days","month":"Month","copied":"Copied!","year":"Year","dayPlaceholder":"DD","monthPlaceholder":"MM","yearPlaceholder":"YYYY","createdAt":"Creation date","date":"Birth date","selected":"Selected","page":"page","actions":"Actions","next":"Next","previous":"Previous","copy":"Copy","copyRawCode":"Copy raw code","feedback":"Feedback","feedbackThankYou":"Thank you for your feedback.","copyFailed":"Could not copy","functionCache":"Function cache","copyToClipboard":"Copy to clipboard","showOriginalText":"Show original","showTranslatedText":"Show translation","exactPosition":"Exact position","uncertain":"Uncertain","question":"Question","nothingFound":"Nothing found","venue":"Venue","searchVenue":"Search for a place…","privacyPolicy":"Privacy policy","popularLanguages":"Popular","allLanguages":"All Languages","memoriBlockedTitle":"Blocked","memoriBlockedUntil":"Agent 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","aiGeneratedNote":"The agent may make mistakes. Make sure to verify important information.","reasoning":"Reasoning...","thinking":"Thinking","thought":"Thought","thoughtFor":"Thought for {{count}}s","whyThisAnswer":"Where this answer comes from","whyThisAnswerHelper":"This answer was generated automatically by an artificial intelligence based on these verified contents.","whyThisAnswerDescription":"Knowledge-base contents the agent consulted to reply.","whyThisAnswerYouAsked":"You asked","whyThisAnswerUserAsked":"The user asked","whyThisAnswerAgentReplied":"The agent replied","whyThisAnswerShowFull":"Show the full answer","whyThisAnswerContentsUsed":"Contents used","whyThisAnswerOpen":"Open","whyThisAnswerDisclaimer":"The agent wrote this answer from these contents: it may contain errors or rephrasings. Check important information at the source.","whyThisAnswerEmptyTitle":"No contents consulted","whyThisAnswerEmptyDescription":"For this question the agent found no matches in the knowledge base: it replied from its instructions only.","whyThisAnswerEmptyAuthorDescription":"The question produced no matches. If it should have, add a content that covers it.","whyThisAnswerAddContent":"Add to the knowledge base","whyThisAnswerConfidenceHigh":"Strong match","whyThisAnswerConfidenceMedium":"Partial match","whyThisAnswerConfidenceLow":"Weak match","whyThisAnswerTypeQuestion":"Question and answer","whyThisAnswerTypeDocument":"Document","whyThisAnswerTypeWebsite":"Website","whyThisAnswerTypeStory":"Story","whyThisAnswerSourcesCount_one":"{{count}} source","whyThisAnswerSourcesCount_other":"{{count}} sources","whyThisAnswerNoSources":"No sources","receiverLabel":"Assigned to","completionsEnabled":"Advanced AI, can respond with automatically generated answers that may sometimes contain incorrect information","completionProviderDown":"This agent is integrated with a generative AI from {{provider}}, but it is currently unavailable. Try again later.","completionProviderMajorOutage":"This agent is integrated with a generative AI from {{provider}}, but it is completely down. This feature will not be available until the service is restored.","completionProviderPartialOutage":"This agent is integrated with a generative AI from {{provider}}, but it is experiencing partial outages. Some features may be unavailable or perform poorly.","completionProviderDegraded":"This agent is integrated with a generative AI from {{provider}}, but it is performing slower than usual. Responses may take longer or be less accurate.","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 agent.","errorFetchingSession":"Error during session loading","errorGettingReferralURL":"Error during referral loading","errorReopeningSession":"Error during session reopening","sessionExpiredReopening":"Session expired, reopening session","ageVerification":"Age verification","ageVerificationText":"To interact with this agent, you must be at least {{minAge}} years old.","ageVerificationSuccess":"Age verified with success.","nsfw":"NSFW: This agent contains adult contents","deepThought":"Deep Thought","deepThoughtWhatIs":"What is 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 agent\'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.","notEnoughCredits":"The author of this agent does not have enough credits to answer your question.","creditsCheckFailed":"We couldn\'t verify the credits for this agent. Please try again later or contact its author.","confirmDialog":{"title":"Do you want to leave this page?","message":"The changes you made will be lost."},"knownFacts":{"title":"Known facts","description":"What {{memoriName}} remembers about you. You can delete each entry.","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","searchPlaceholder":"Search known facts","select":"Select","loadMore":"Load more","factsCount_one":"{{count}} fact","factsCount_other":"{{count}} facts","shownOfTotal":"Showing {{shown}} of {{total}}","emptyTitle":"No facts yet","emptyDescription":"As you talk, the agent notes here what it learns about you. You can delete it at any time.","deleteLabel":"Delete this fact","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?","selected_one":"{{count}} fact selected","selected_other":"{{count}} facts selected","selectedRows_one":"{{count}} row selected","selectedRows_other":"{{count}} rows selected"},"auth":{"title":"Authentication","description":"This agent is protected. Enter the password to continue.","useRecoveryTokens":"Use recovery tokens","tokens":"Tokens","addToken":"Add token","usePassword":"Use password","passwordRequired":"Password required","invalidCredentials":"Invalid credentials","atLeast":"At least"},"widget":{"instruct":"Instruct","test":"Test","sound":"Audio","soundOff":"Audio off","position":"Position preferences","settings":"Settings","share":"Share","shareChat":"Share chat","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","chatAssistantStatus":"Active • Replies in a few seconds","agentStatusListening":"listening","agentStatusSpeaking":"speaking","agentStatusProcessing":"processing","shareLocation":"Share location","shareLocationHint":"Get answers tailored to where you are","shareLocationAria":"Share location with the assistant","knownFactsHint":"What I remember about you","aiConsumption":"AI usage","editPositionAria":"Edit location","positionResolving":"Resolving address…","geocodingFailed":"Could not resolve the address. Try again or search manually.","positionUnavailableManual":"Location unavailable. Please enter it manually.","positionSharingEnabled":"Location shared.","headerHistory":"History","headerProfile":"Profile","headerLogin":"Log in","downloadQrCode":"Download QR Code","expandToImmersive":"Expand to immersive view","moreActions":"More actions","mobileSession":{"session":"Session","sessionInfo":"Session info","copyLinkOrDownload":"Copy link or download","currentlyOff":"Currently off","whatIKnowAboutYou":"Details of the information shared between you and {{memoriName}}","locationTracking":"Location tracking","locationStatus":"Status","useCurrentPosition":"Use current position","disableLocationSharing":"Disable location sharing","openKnownFacts":"Open full known facts","knownFactsMessages":"{{count}} messages in current session"}},"exportChatHistory":{"exportPDF":"Export chat as PDF","exporting":"Exporting...","empty":"No chat history to export","pdfNotSupported":"PDF export is not supported in this browser","success":"Chat exported to PDF successfully","error":"Failed to export chat to PDF. Please try again."},"write_and_speak":{"micButtonPopover":"Click the button to speak","micButtonPopoverListening":"Click the button to stop speak","stopRecording":"Stop recording","sendRecording":"Send voice message","recordingInProgress":"Recording in progress","pageInstructExplanation":"To teach me new things click on the INSTRUCT ME button to get started","pageTryMeExplanation":"To start talking to me click on the START button","pagePrivacyExplanation":"The conversations are visible by the author of the agent","aiDisclaimer":"The agent may make mistakes. Please verify the answers.","downloadChat":"Download chat","pagePrivacyExplanationList":{"allConversations":"All conversations with this agent are visible to the author of the agent","anonymousUser":"For anonymous users: the author will see the content of the conversation and your IP address","registeredUser":"For registered users: the author will see the content of the conversation and your username","contentAndUsername":"The author can see the content, your username and your IP address","contentAndIpAddress":"The author can see the content and your IP address","authorUsesInfo":"The author uses this information to improve the features of the agent and to provide you with a better service."},"instructButton":"INSTRUCT ME","tryMeButton":"START","resumeButton":"RESUME","chatHistory":"Chat history","chatHistoryDescription":"Show the chat history with this agent","loadingChatHistory":"Loading chat history...","noChatHistoryAvailable":"No chat history available","noResultsFound":"No results found for \\"{{searchText}}\\"","searchInChatHistory":"Search conversations","filters":"Filters","latestFirst":"Latest first","oldestFirst":"Oldest first","exportChat":"Export Chat","conversationStartedLabel":"Conversation started","settingsHeaderLabel":"Setup here if you want to set the continuous speech, and change the silence seconds if you want to customize them.","continuousSpeechLabel":"Continuous speech","continuousSpeechDisabled":"Continuous speech disabled because the agent is in mute mode","holdToSpeak":"Hold to speak","releaseToEndListening":"Release to end listening","pressAndHoldToSpeak":"Press and hold to speak","microphoneMode":"Microphone mode","hideEmissionsLabel":"Hide text emitted by the agent","showMessageConsumptionLabel":"Show message consumption","secondsLabel":"Set seconds","controlsPosition":"Controls position","avatarControls":"Avatar controls","height":"Height","depth":"Depth","avatarType":"Avatar type","suggestions":"Use the arrow keys to adjust the avatar height\\nUse +/- to adjust the avatar depth","blob":"Blob","avatar3d":"3D Avatar","zoomed":"Zoomed","normal":"Normal","far":"Far","enablePositionControls":"Enable position controls","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","requirePositionHelp":"To talk to {{name}} you have to decide whether to provide your position or not. This is because different answers that it can provide you may depend on where you are.","dontWantToProvidePosition":"Skip location","requireLoginHelp":"To talk to {{name}} you need to log in with your account first.","skipLocationTitle":"No map location will be saved.","locationSaved":"Your location was saved.","locationSavedWithPlace":"Your location was saved: {{place}}","locationSkippedConfirm":"You\'ll continue without sharing your location.","placeSelected":"Place selected: {{place}}","locationPermissionDenied":"Location access was denied. Allow location in your browser settings, or pick a place on the map.","locationUnavailable":"Your position could not be determined. Try again or search for a place.","locationRequestTimedOut":"Location request timed out. Try again or search for a place.","locationErrorGeneric":"Something went wrong while getting your location.","attachmentsLabel":"Enrich your message","image":"image","images":"images","file":"file","files":"files","function":"function","functions":"functions","iWantToTalkToIn":"I want to talk to {{name}} in","chatLanguageLabel":"Choose the conversation language","chatResumed":"Conversation resumed successfully.","message":"message","messages":"messages","page":"Page {{current}} of {{total}}","downloadThisConversation":"Download this conversation","downloadAllConversations":"Download all conversations","conversationsCount_one":"{{count}} conversation","conversationsCount_other":"{{count}} conversations","shownOfTotal":"Showing {{shown}} of {{total}}","loadMore":"Load more","backToConversationList":"Back to the conversation list","thisWeek":"This week"},"chatResume":{"resume":"Resume conversation"},"artifact":{"close":"Close","size":"Size","updated":"updated","updateFailed":"Update could not be applied","updateFailedHint":"The patch did not match the current content. Ask to rewrite the artifact.","generated":"Generated","download":"Download","print":"Print","external":"Open in a new window","type":"Type","fullscreen":"Fullscreen","exitFullscreen":"Exit fullscreen","generatedAt":"Generated at","copy":"Copy","open":"Open","code":"Code","source":"Source","preview":"Preview","resizeHandle":"Resize artifact panel","copied":"Copied!","error":"Error","generatingPdf":"Generating PDF...","copying":"Copying...","moreCopyOptions":"More copy options","copyAs":"Copy as","downloadAsMarkdown":"Download as Markdown","downloadRawMarkdownText":"Download raw markdown text","downloadAsPdf":"Download as PDF","exportAsPdfDocument":"Export as PDF document","downloadAsHtml":"Download as HTML","downloadFormattedHtml":"Download formatted HTML","viewMode":"View Mode","codeMode":"Code Mode","refresh":"Refresh","share":"Share","downloadAsJson":"Download as JSON","downloadJsonData":"Download JSON data","downloadAsPng":"Download as PNG","downloadPngImage":"Download PNG image","downloadAsJpeg":"Download as JPEG","downloadJpegImage":"Download JPEG image","downloadAsGif":"Download as GIF","downloadGifImage":"Download GIF image","downloadAsWebp":"Download as WebP","downloadWebpImage":"Download WebP image","copyAsSvg":"Copy as SVG","copySvgSourceCode":"Copy SVG source code","copyAsPlainText":"Copy as Plain Text","copyAsText":"Copy as text","copyAsLanguage":"Copy as {{language}}","copyLanguageCode":"Copy {{language}} code","copyWithoutSyntaxHighlighting":"Copy without syntax highlighting","copyTextContent":"Copy text content","pdfExportNotSupported":"PDF export is not supported in this browser","popupBlocked":"Popup blocked! Please enable popups to print.","safariPdfInstructions":"PDF export opened in new window. Please use Cmd+P (Mac) or Ctrl+P (Windows) to print and save as PDF."},"upload":{"loginRequired":"Login required","pastedText":"pasted-text","uploadNotification":"Upload Failed","loginRequiredDescription":"Please login to upload images","uploadFiles":"Upload files (drag and drop)","uploadFilesOrImages":"Upload files or images","uploadFilesWithShortcut":"{{shortcut}}+O to open file chooser","uploadImages":"Upload images","replace":"Replace","maxImagesReached":"You can upload up to {{max}} images","maxDocumentsReached":"You can upload up to {{max}} documents","remaining":"remaining","lastDocumentSlot":"Upload last document","uploadDocuments":"Upload documents","maxReached":"Max limit reached","imageTitle":"Image title: {{title}}","titleHelp":"Adding a descriptive title helps the AI provide more context and appropriate responses.","titlePlaceholder":"Enter image title","apiClientNotConfigured":"API client not configured properly for media upload","fileReadingFailed":"File reading failed","uploadFailed":"Upload failed","uploadSuccess":"Upload success","titleImage":"Add an image title","uploadSuccessDescription":"The file has been uploaded successfully","titleImageUpload":"Upload images","partialUpload":"Only {{uploaded}} images on {{total}} will be uploaded. Maximum {{max}} images allowed.","maxImages":"Maximum {{max}} images allowed.","upload":"Upload","dragAndDropFiles":"Drag and drop files here to add them to the chat","pasteMaxAttachmentsReached":"Maximum {{max}} attachments. Remove one to add this as a file.","pasteContentTooLong":"Pasted content is too long (max {{size}}KB). Shorten or split it.","pasteContentExceedsLimit":"Pasted content exceeds the size limit. Try shortening the text or splitting it into smaller parts.","pasteAddedAsAttachment":"Pasted content added as attachment","contextSizeExceedsLimit":"Context size exceeds the limit. Try reducing the number of files or content in the conversation.","filesNotAddedMaxAllowed":"{{count}} file(s) not added (maximum {{max}} files allowed).","documentsNotAddedMaxAllowed":"{{count}} document(s) not added (maximum {{max}} files allowed).","imagesNotAddedMaxAllowed":"{{count}} image(s) not added (maximum {{max}} files allowed).","documentsNotAddedContextSize":"{{count}} document(s) not added (context size limit).","partialAssetUploadWarning":"Some file links could not be uploaded, but the document was added anyway.","anonymousRetentionNotice":"Note: uploaded files are retained for a maximum of 24 hours."},"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 an agent 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 agent became more evolved with {{points}} points, look at the","statistics":"statistics"},"login":{"login":"Login","title":"Login to your account","loggingIn":"Logging you in…","logout":"Logout","user":"User","loggedDrawerTitle":"Hi, {{name}}!","userNameRequired":"Username required","userName":"Username","userNamePlaceholder":"Enter username","loginDrawerTitle":"Login","signupDrawerTitle":"Sign up","newUserSignUp":"New user?","signUp":"Sign up!","alreadyHaveAnAccount":"Already have an account?","backToLogin":"Back to login","registrationDisabled":"Registration is disabled","contactAdmin":"Contact the administrator to request access","userNameOrEmail":"Username or email","email":"Email","emailFormatError":"Please, insert a valid email","username":"Username","usernameContainsReservedWord":"Username contains a reserved word, please choose another one","usernameFormatError":"Username must be at least 3 characters long and contain only letters, numbers and _","otpCode":"Verification code","resendVerificationCode":"Resend code","resentVerificationCode":"Confirmation code sent! Please check your email.","welcomeTitle":"Welcome back","welcomeDescription":"Enter your 4-digit verification code to continue to your account","otpTitle":"Enter verification code","otpDescription":"Enter the 4-digit code you generated in your account","otpStep1":"Click the button below to open your account","otpStep2":"Generate a 4-digit verification code (valid for 5 minutes)","otpStep3":"Return here and enter the code","startOtpLogin":"Start verification","generateOtp":"Generate code","otpTimer":"Code expires in {{time}}","otpInvalidFormat":"Please enter a valid 4-digit code","otpInvalid":"Invalid verification code","otpError":"Error validating code. Please try again.","otpSuccess":"Login successful!","otpEmailTitle":"Enter your email","otpEmailDescription":"Enter your email address to receive a verification code","otpCodeDescription":"Enter the 4-digit code sent to {{email}}","emailPlaceholder":"Enter your email","sendOtp":"Send the code","resendOtp":"Resend","resendOtpIn":"Resend in {{seconds}}s","resendOtpPrompt":"Didn\'t arrive? Resend in {{seconds}} s","resendOtpQuestion":"Didn\'t arrive?","resending":"Resending...","backToEmail":"Back to email","editEmail":"Edit","otpSentToPrefix":"We sent a 4-digit code to","otpCodeShort":"Code","loginBenefitLine1":"{{memoriName}} can show you the chat history, which can be resumed at any time.","loginBenefit":"{{memoriName}} can show you the chat history, which can be resumed at any time.","passwordlessHint":"We\'ll send you a 4-digit code. No password to remember.","defaultAgentName":"the agent","otpSent":"Verification code sent!","otpResent":"Code resent successfully!","otpSendError":"Error sending code. Please try again.","emailRequired":"Email required","emailInvalid":"Please enter a valid email address","userNotFound":"User not found","otpNotFound":"Verification code not found","otpExpired":"Verification code has expired","otpMissing":"Verification code is required","otpAttemptsExceeded":"Too many attempts. Request a new verification code.","otpSuccessMessage":"Verification successful! Redirecting...","otpSuccessDescription":"Your account has been verified successfully. You will be redirected shortly.","otpHelp":"Enter the 4-digit code from your email","emailHelp":"We\'ll send you a verification code","userFetchError":"Error loading user data. Please try again.","otpStep1Title":"Enter Email","otpStep2Title":"Check Email","otpStep3Title":"Enter Code","featureFast":"Fast","featureSecure":"Secure","featureMobile":"Mobile","password":"Password","newPassword":"New password","confirmPassword":"Confirm Password","currentPassword":"Current password","passwordMatchingError":"Passwords do not match.","passwordFormatError":"Password must be at least 8 characters long and contain at least a number, an upper case letter, a lower case letter and a symbol","pwdWeak":"Weak","pwdAcceptable":"Acceptable","pwdStrong":"Strong","mustChangePassword":"You must change your password","passwordChange":"Change password","emailChange":"Change email","avatarChange":"Change avatar","avatarUploadSuccess":"Profile picture updated.","underage":"You must be at least {{age}} years old to sign up.","optional":"Optional","birthDate":"Birth date","birthDatePlaceholder":"DD/MM/YYYY","birthDateHelper":"We ask for your birth date only to enable or disable functionalities that have age restrictions","missingData":"Missing information","missingDataHelper":"We know that this is a bit annoying, but we need some more information 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 agent\'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","editAccount":"Edit account","save":"Save","welcomeUser":"Welcome User","verified":"Verified","premiumUser":"Premium","quickActions":"Quick Actions","editProfile":"Edit Profile","notifications":"Notifications","help":"Help","logoutConfirm":"Are you sure you want to logout?","comingSoon":"Coming soon!","accountOverview":"Account Overview","notSet":"Not set","accepted":"Accepted","pending":"Pending","termsStatus":"Terms Status","enabled":"Enabled","disabled":"Disabled","advancedFeatures":"Advanced Features","successfullyLoggedIn":"{{username}} has successfully logged in"},"chatLogs":{"llm":"LLM","model":"Model","provider":"Provider","tokens":"Tokens","input":"Input","output":"Output","cacheRead":"Cache read","cacheWrite":"Cache write","duration":"Duration","energy":"Energy","co2":"CO2","water":"Water","usageBadgesHint":"Click one of these buttons to show more information","totalChatConsumptionTitle":"Total Chat Consumption","modelUsage":"Model usage","environmentalImpact":"Environmental impact","impactComparisonUnavailable":"Indicative comparison unavailable.","impactComparisonEnergy":"Indicative comparison: roughly like keeping a 10 W LED bulb on for {{duration}}.","impactComparisonCo2":"Indicative comparison: about {{distance}} traveled by an average gasoline car.","impactComparisonWater":"Indicative comparison: about {{count}} drops of water.","energyImpactDescription":"This value estimates the electrical energy needed to generate the model response. It helps compare prompts, models, and strategies even when a single message has a very small impact.","co2ImpactDescription":"CO2 equivalent represents the estimated climate impact of the message. Converting consumption into emissions helps understand AI impact with comparable metrics.","waterImpactDescription":"This indicator shows the estimated water footprint associated with processing the message. It includes water indirectly used by the energy and infrastructure supporting computation.","approximateValuesTooltip":"These values are approximate.","anyMessage":"Any message","atLeast":"At least {{count}} messages","atLeast1":"At least 1 message","atLeast2":"At least 2 messages","atLeast3":"At least 3 messages","atLeast5":"At least 5 messages","atLeast10":"At least 10 messages","atLeast15":"At least 15 messages","atLeast20":"At least 20 messages","customMinimumMessages":"Customize the number of messages"},"success":"Success","Error":"Error","internal server error":"Oupsie, sorry... Something went wrong on the server","error":"Error","error.loading":"Error while loading content.","error.generic":"Oupsie, sorry... something went wrong.","error.serverNotResponding":"We are doing maintenance or releasing updates. Please try again later.","error.notFound":"Oupsie, we didn\'t find the page you were looking for.","error.goBackTo":"You can try to go back to the","error.reloadPage":"Reload the page","error.tryAgain":"Try again","error.unauthorized":"You are unauthorized to view this content.","error.unprocessableEntity":"Error while processing the request. Check the data you entered.","errors":{"TENANT_NOT_FOUND":"Tenant not found","TENANT_REGISTRATION_DISABLED":"Registration on this platform is disabled","TENANT_MISSING_NAME":"Tenant: name missing","TENANT_MAX_USERS_REACHED":"Maximum number of users reached","TENANT_MAX_ADMINS_REACHED":"Maximum number of admin users reached","TENANT_ALREADY_EXISTS":"Tenant already exists","TENANT_MISSING_DESCRIPTION":"Tenant: description missing","TENANT_CANT_SET_COMPLETION_PROVIDER":"Tenant: can\'t set completion provider","TENANT_INVALID_TYPE":"Tenant: invalid type","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 agents","USER_MAX_MEMORI_REACHED":"Maximum number of agents reached","USER_TOO_MANY_ATTEMPTS":"Too many attempts","USER_MUST_ACCEPT_TNC_AND_PP":"You must accept the terms and conditions","USER_BIRTH_DATE_CANT_BE_CHANGED":"Date of birth cannot be changed","USER_CANT_SET_COMPLETION_PROVIDER":"User: not allowed to manage completion provider","USER_CANT_ENABLE_DEEP_THOUGHT":"User: not enabled to manage Deep Thought","USER_CANT_ENABLE_DCM_INTEGRATION":"User: not enabled to manage DCM integration","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"User: not allowed to manage chaining or expert group","USER_CREATION_BILLING_DENIED_PERMISSION":"You don\'t have enough credits to create an agent","USER_HAS_ONE_OR_MORE_COMPLETION_CONFIGS":"The user has one or more completion configurations","USER_CANT_BE_DELETED":"User can\'t be deleted","USER_ORDER_BY_INVALID":"Order by invalid","MEMORI_NOT_FOUND":"Agent not found","MEMORI_NOT_ACCESSIBLE":"Agent not accessible","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Only owner can change tag or pin","SESSION_NOT_FOUND":"Session not found","SESSION_IS_NOT_ADMINISTRATIVE":"Non-administrative session","SESSION_EXPIRED":"Session expired","speechMissingSession":"Speech needs an active session","speechInvalidSession":"This session is not valid","speechTenantMismatch":"Speech is not available on this site","speechRateLimited":"Too many speech requests. Wait a moment and try again.","SESSION_OTP_NOT_FOUND":"Verification code not found","SESSION_OTP_EXPIRED":"Verification code has expired","SESSION_OTP_INVALID":"Invalid verification code","SESSION_OTP_ATTEMPTS_EXCEEDED":"Too many attempts. Request a new verification code.","MEMORI_MISSING_CONFIGURATION":"Agent: missing configuration","MEMORI_CONFIGURATION_NOT_FOUND":"Agent: configuration not found","MEMORI_INVALID_PRIVACY_TYPE":"Agent: invalid privacy type","MEMORI_MISSING_PASSWORD":"Agent: missing password","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Agent: total number of invalid recovery tokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Agent: minimum number of invalid recovery tokens","MEMORI_INVALID_VOICE_TYPE":"Agent: invalid voice type","MEMORI_MISSING_NAME":"Agent: missing name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Agent: missing password or recovery token","MEMORI_INVALID_ID":"Agent: invalid ID","MEMORI_NAME_ALREADY_USED":"Agent name already in use","MEMORI_INVALID_PIN":"Agent: Invalid PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Agent: TAG and PIN change require separate operations","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Agent: no password required when public","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Deep Thought requires completions to be enabled","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"The expert group requires completions to be enabled","MEMORI_INVALID_COMPLETION_CONFIG":"Agent: invalid completions configuration","MEMORI_MACRO_FUNCTIONS_REQUIRES_COMPLETIONS":"Macro functions requires completions to be enabled","MEMORI_BLOCKING_DATE_MISSING_OR_WRONG":"Agent: blocking date missing or wrong","MEMORI_LIST_FILTER_NOT_SPECIFIED":"Agent: list filter not specified","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":"Agent: configuration cannot be changed","MEMORI_MISSING_NEW_PASSWORD":"Agent: new password missing","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Feature requires subscription","INTEGRATION_NOT_FOUND":"Integration not found","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Invalid date from format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Invalid date to format","MEMORI_SESSION_NOT_FOUND":"Session not found","MEMORI_SESSION_DOESNT_ACCEPT_MEDIA":"Session doesn\'t accept media","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","ASSET_MALWARE_SCAN_THREATS_FOUND":"Asset: found malware threats","INVITATION_NOT_FOUND":"Invitation not found","INVITATION_NOT_ACCESSIBLE":"Invitation not accessible","INVITATION_ALREADY_ACCEPTED":"Invitation already accepted","INVITATION_ALREADY_REJECTED":"Invitation already rejected","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation: missing destination email","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation: destination email invalid","INVITATION_MISSING_TAG":"Invitation: missing tag","INVITATION_MISSING_PIN":"Invitation: PIN missing","INVITATION_INVALID_PIN":"Invitation: invalid PIN","INVITATION_INVALID_TYPE":"Invitation: invalid type","INVITATION_MISSING_DESTINATION_NAME":"Invitation: destination name missing","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation: tag and pin can\'t be changed","INVITATION_CANT_BE_CHANGED":"Intation: can\'t be changed","ACTIONLOG_INVALID_USER_ID":"Invalid user ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","ACTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","CONSUMPTIONLOG_INVALID_TYPE":"Invalid log type","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","CONSUMPTIONLOG_INVALID_USER_ID":"Invalid user ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifications: Invalid chat log extraction period","BROADCAST_NOT_ALLOWED":"Broadcast not allowed","INVALID_NOTIFICATION_TYPE":"Invalid notification type","NOTIFICATION_NOT_FOUND":"Notification not found","INVALID_NOTIFICATION_FILTER":"Invalid notification filter","INVALID_NOTIFICATION_PERIOD":"Invalid notification period","PROCESS_INVALID_TYPE":"Invalid process type","PROCESS_ALREADY_RUNNING":"Process already running","PROCESS_NOT_FOUND":"Process not found","IMPORTCSV_MISSING_ROWS":"CSV import: missing rows","IMPORTCSV_MISSING_CSV":"CSV Import: Missing CSV","IMPORTCSV_MISSING_SEPARATOR":"CSV import: missing separator","IMPORTCSV_INVALID_SEPARATOR":"CSV import: invalid separator","IMPORTCSV_MISSING_HEADERS":"CSV import: missing headers","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV import: missing title variant separator","IMPORTCSV_INVALID_RECEIVER_ID":"CSV import: invalid receiver ID","IMPORTCSV_INVALID_MEDIA_LINK":"CSV import: invalid media link","IMPORTCSV_INVALID_LINK_TITLE_HANDLING":"CSV import: invalid link title","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"CSV import: undetectable character encoding","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"CSV Import: Cannot import to Secret Memories","IMPORTTXT_MISSING_ROWS":"Importing TXT: missing rows","IMPORTTXT_INVALID_GRANULARITY":"Import TXT: invalid granularity","IMPORTTXT_INVALID_RECEIVER_ID":"Import TXT: invalid receiver ID","IMPORTTXT_INVALID_MEDIA_LINK":"Import TXT: invalid media link","IMPORTTXT_INVALID_LINK_TITLE_HANDLING":"Import TXT: invalid link title","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"TXT import: undetectable character encoding","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"TXT Import: Cannot import to Secret Memories","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Import TXT: import limit exceeded","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Import TXT: import on GPT-4 requires API key","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Import TXT: Import requires a paying plan","IMPORTTXT_BILLING_DENIED_PERMISSION":"Import TXT: you don\'t have enough credits for the operation","IMPORT_MISSING_ROWS":"Import: missing rows","IMPORT_CANT_IMPORT_TO_SECRET_MEMORI":"Import: can\'t import to Secret Memories","IMPORTMEMORI_INVALID_MEMORI_SPECS":"Import MEMORI: invalid memory specs","IMPORT_MISSING_JSONL":"Import: missing JSONL","IMPORTMEMORI_INVALID_SPECS":"Import MEMORI: invalid specs","EXPORT_MISSING_PASSWORD":"Export: missing password","EXPORTCSV_MISSING_CSV_SPECS":"CSV export: missing CSV specifications","EXPORTCSV_MISSING_SEPARATOR":"CSV export: missing separator","EXPORTCSV_INVALID_SEPARATOR":"CSV export: invalid separator","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV export: missing title variant separator","EXPORTCSV_MISSING_NEW_LINE_CHAR":"CSV export: missing newline character","EXPORTCSV_INVALID_NEW_LINE_CHAR":"CSV export: invalid newline character","EXPORTCSV_MISSING_PASSWORD":"CSV export: missing password","EXPORTJSONL_MISSING_JSONL_SPECS":"JSONL export: missing JSONL specifications","EXPORTJSONL_MISSING_PLATFORM":"JSONL export: missing platform","EXPORTJSONL_INVALID_PLATFORM":"JSONL export: invalid platform","EXPORTJSONL_MISSING_PASSWORD":"JSONL export: missing password","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"JSONL Export: Export requires a paid plan","ANALYSIS_MISSING_QUERY":"Analysis: missing query","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analysis: Unable to analyze Secret Memories","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analysis: matching user query requires Deep Thinking","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Badge assignment: incorrect or missing credentials","BADGE_ASSIGNMENT_MISSING_REF_ID":"Badge assignment: ref ID missing","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Badge assignment: result not found","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Badge assignment: Missing assertion URL","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Badge Assignment: Missing Badge URL","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Badge assignment: missing issuer URL","BADGE_ASSIGNMENT_INVALID_URL":"Badge assignment: Invalid URL","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Badge assignment: missing recipient","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Badge assignment: unknown recipient type","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Badge assignment: missing recipient identity","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Badge assignment: missing recipient hash type","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Badge assignment: recipient hash type unknown","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Badge assignment: incorrect recipient identity","BADGE_NOT_FOUND":"Badge not found","OUTCOME_NO_DCM_CONFIGURED":"Outcome: no DCM configured","OUTCOME_USER_BADGES_DISABLED":"Outcome: user badges disabled","COMPLETION_CONFIG_MISSING_NAME":"Completions configuration: missing name","COMPLETION_CONFIG_MISSING_PROVIDER":"Completions configuration: missing provider","COMPLETION_CONFIG_MISSING_ENDPOINT":"Completions configuration: missing endpoint","COMPLETION_CONFIG_MISSING_API_KEY":"Completions configuration: missing API key","COMPLETION_CONFIG_MISSING_MODEL":"Completions configuration: missing model","COMPLETION_CONFIG_NO_PURPOSE_SPECIFIED":"Completions configuration: at least one completions type must be specified","COMPLETION_CONFIG_INVALID_NAME":"Completions configuration: invalid name","COMPLETION_CONFIG_INVALID_PURPOSE":"Completions configuration: invalid completions type","COMPLETION_CONFIG_INVALID_ENDPOINT":"Completions configuration: invalid endpoint","COMPLETION_CONFIG_INCONSISTENT_ENDPOINT":"Completions configuration: inconsistent endpoint","COMPLETION_CONFIG_INVALID_PROVIDER":"Completions configuration: invalid provider","COMPLETION_CONFIG_NOT_FOUND":"Completions configuration: not found","COMPLETION_CONFIG_NOT_ACCESSIBLE":"Completions configuration: not accessible","COMPLETION_CONFIG_NAME_RESERVED":"Completions configuration: name reserved","COMPLETION_CONFIG_NAME_ALREADY_EXISTS":"Completions configuration: name already exists","COMPLETION_CONFIG_VISIBILITY_CHANGE_NOT_ALLOWED":"Completions configuration: visibility change not allowed","COMPLETION_CONFIG_MISSING_MANDATORY_PREFIX":"Completions configuration: missing mandatory prefix","COMPLETION_CONFIG_VISIBILITY_NOT_PERMITTED":"Completions configuration: visibility not permitted","COMPLETION_CONFIG_USE_AS_DEFAULT_NOT_PERMITTED":"Completions configuration: use as default not permitted","COMPLETION_CONFIG_USE_AS_DEFAULT_REQUIRES_TENANT_VISIBILITY":"Completions configuration: use as default requires tenant visibility","COMPLETION_CONFIG_CHARGEABLE_NOT_PERMITTED":"Completions configuration: chargeable not permitted","COMPLETION_CONFIG_INVALID_APPLY_TO":"Completions configuration: apply to invalid","COMPLETION_CONFIG_APPLY_TO_TENANT_NOT_ALLOWED":"Completions configuration: apply to tenant not allowed","TRUSTED_APPLICATION_NOT_FOUND":"Trusted application not found","TRUSTED_APPLICATION_NOT_ACCESSIBLE":"Trusted application not accessible","TRUSTED_APPLICATION_NAME_REQUIRED":"Trusted application: name required","TRUSTED_APPLICATION_TOKEN_REQUIRED":"Trusted application: token required","TRUSTED_APPLICATION_NAME_ALREADY_EXISTS":"Trusted application: name already exists","TRUSTED_APPLICATION_INVALID_TOKEN":"Trusted application: invalid token"}}');var Xj={};Xj=JSON.parse('{"yes":"Oui","no":"Non","confirm":"Confirmer","apply":"Appliquer","cancel":"Annuler","show":"Montrer","hide":"Cacher","send":"Envoyer","scrollToLatest":"Aller au dernier message","scrollToContinueReading":"Faites défiler pour continuer à lire","close":"Fermer","clearHistory":"Effacer la conversation","clearHistoryDone":"Conversation effacée.","moreInfo":"Plus d\'informations","back":"Retour","edit":"Modifier","delete":"Supprimer","loading":"Chargement","expand":"Développer","collapse":"Réduire","expandable":{"expand":"Développer"},"fullscreenEnter":"Entrez en plein écran","fullscreenExit":"Quitter le plein écran","center":"Centre","bottom":"Bas","hidden":"Caché","day":"Jour","month":"Mois","year":"Année","placeholder":"Faites une question","createdAt":"Date de création","all":"Tous","today":"Aujourd\'hui","date":"Date de naissance","yesterday":"Hier","last_7_days":"7 derniers jours","copied":"Copié !","missingData":"Informations manquantes","last_30_days":"30 derniers jours","selected":"Choisi","page":"page","actions":"Actes","next":"Suivant","previous":"Précédent","copy":"Copie","copyRawCode":"Copier le code brut","feedback":"Commentaires","feedbackThankYou":"Merci pour votre retour.","copyFailed":"Impossible de copier","functionCache":"Cache des fonctions","copyToClipboard":"Copier dans le presse-papier","showOriginalText":"Afficher l\'original","showTranslatedText":"Afficher la traduction","exactPosition":"Position exacte","uncertain":"Incertain","question":"Question","nothingFound":"Rien trouvé","venue":"Lieu","searchVenue":"Rechercher un lieu…","popularLanguages":"Populaires","allLanguages":"Toutes les langues","memoriBlockedTitle":"Bloqué","memoriBlockedUntil":"Agent bloqué jusqu\'à {{date}}","memoriBlockedAnon":"Actuellement \\"{{name}}\\"Je ne peux pas répondre, reviens ici {{date}}","memoriBlockedReasonExceedChats":"car il a dépassé le seuil mensuel de chats autorisés.","memoriBlockedGiverHelper":"Vous pouvez toujours le gérer en tant qu\'administrateur, mais les autres utilisateurs ne pourront pas interagir avec lui.","generatedByAI":"Réponse générée par l\'IA, peut occasionnellement générer des informations incorrectes","aiGeneratedNote":"L\'agent peut faire des erreurs. Assurez-vous de vérifier les informations importantes.","reasoning":"Réflexion...","thinking":"Réflexion","thought":"Réflexion","thoughtFor":"Réfléchi pendant {{count}} s","whyThisAnswer":"D\'où vient cette réponse","whyThisAnswerHelper":"Cette réponse a été générée automatiquement par une intelligence artificielle basée sur ces contenus vérifiés.","whyThisAnswerDescription":"Les contenus de la base de connaissances consultés par l\'agent pour répondre.","whyThisAnswerYouAsked":"Vous avez demandé","whyThisAnswerUserAsked":"Question de l\'utilisateur","whyThisAnswerAgentReplied":"L\'agent a répondu","whyThisAnswerShowFull":"Afficher la réponse complète","whyThisAnswerContentsUsed":"Contenus utilisés","whyThisAnswerOpen":"Ouvrir","whyThisAnswerDisclaimer":"La réponse a été rédigée par l\'agent à partir de ces contenus : elle peut contenir des erreurs ou des reformulations. Vérifiez les informations importantes à la source.","whyThisAnswerEmptyTitle":"Aucun contenu consulté","whyThisAnswerEmptyDescription":"Pour cette question, l\'agent n\'a trouvé aucune correspondance dans la base de connaissances : il a répondu uniquement d\'après ses instructions.","whyThisAnswerEmptyAuthorDescription":"La question n\'a produit aucune correspondance. Si elle devrait en avoir, ajoutez un contenu qui la couvre.","whyThisAnswerAddContent":"Ajouter à la base de connaissances","whyThisAnswerConfidenceHigh":"Correspondance élevée","whyThisAnswerConfidenceMedium":"Correspondance partielle","whyThisAnswerConfidenceLow":"Correspondance faible","whyThisAnswerTypeQuestion":"Question et réponse","whyThisAnswerTypeDocument":"Document","whyThisAnswerTypeWebsite":"Site web","whyThisAnswerTypeStory":"Récit","whyThisAnswerSourcesCount_one":"{{count}} source","whyThisAnswerSourcesCount_other":"{{count}} sources","whyThisAnswerNoSources":"Aucune source","receiverLabel":"Assigné à","completionsEnabled":"L\'IA avancée peut répondre avec des réponses générées automatiquement qui peuvent parfois contenir des informations incorrectes","completionProviderDown":"Ce Agent est intégré à une IA générative de {{provider}}, mais il est actuellement indisponible. ","completionProviderMajorOutage":"Ce Agent est intégré à une IA générative de {{provider}}, mais il est actuellement indisponible. Cette fonctionnalité ne sera pas disponible tant que le service ne sera pas restauré.","completionProviderPartialOutage":"Ce Agent est intégré à une IA générative de {{provider}}, mais il est actuellement indisponible. Cette fonctionnalité ne sera pas disponible tant que le service ne sera pas restauré.","completionProviderDegraded":"Ce Agent est intégré à une IA générative de {{provider}}, mais il est actuellement indisponible. Cette fonctionnalité ne sera pas disponible tant que le service ne sera pas restauré.","completionProviderFallbackName":"un prestataire externe","completionProviderCheckStatusPage":"Vérifier la page d\'état","boardOfExperts":"Conseil d\'experts","birthDate":"Date de naissance","birthDateHelper":"Nous demandons votre date de naissance uniquement pour activer ou désactiver les fonctionnalités qui ont des restrictions d\'âge","underage":"Vous devez être au moins {{age}} ans pour s\'inscrire.","underageTwinSession":"Vous devez être au moins {{age}} ans pour interagir avec ce Agent.","errorFetchingSession":"Erreur lors du chargement de la session","errorGettingReferralURL":"Erreur lors du chargement du référent","errorReopeningSession":"Erreur lors de la re-ouverture de la session","sessionExpiredReopening":"Session expirée, réouverture en cours","ageVerification":"Vérification de l\'âge","ageVerificationText":"Pour interagir avec ce Agent, vous devez être au minimum {{minAge}} ans.","ageVerificationSuccess":"Âge vérifié avec succès.","nsfw":"NSFW : Ce jumeau contient du contenu pour adultes","deepThought":"Pensée profonde","deepThoughtWhatIs":"Qu\'est-ce que Deep Thought ?","deepThoughtHelper":"Deep Thought est une fonctionnalité avancée de l\'IA qui vous permettra d\'exploiter pleinement vos conversations en les gardant une trace. ","deepThoughtDisclaimerTitle":"Pensée profonde activée","deepThoughtDisclaimer":"Deep Thought est une fonctionnalité avancée de l\'IA qui vous permettra d\'exploiter pleinement vos conversations en les gardant une trace. ","deepThoughtPreDisclaimerUnlogged":"Connectez-vous pour activer Deep Thought.","deepThoughtPreDisclaimerNotAllowed":"Deep Thought est désactivé car vous n\'avez pas consenti à son utilisation, vous pouvez le modifier à tout moment dans les paramètres de votre compte.","notEnoughCredits":"L\'auteur de ce Agent n\'a pas suffisamment de crédits pour répondre à votre question.","creditsCheckFailed":"Impossible de vérifier les crédits de cet agent. Réessayez plus tard ou contactez son auteur.","confirmDialog":{"title":"Voulez-vous quitter cette page ?","message":"Les modifications que vous avez apportées seront perdues."},"knownFacts":{"title":"Faits connus","description":"Ce que {{memoriName}} retient de vous. Vous pouvez supprimer chaque entrée.","type":"Taper","typeShortTerm":"Court terme","typeLongTerm":"Long terme","typeHelper":"Types :\\n","text":"Texte","searchPlaceholder":"Rechercher parmi les faits","select":"Sélectionner","loadMore":"Charger plus","factsCount_one":"{{count}} fait","factsCount_other":"{{count}} faits","shownOfTotal":"{{shown}} sur {{total}} affichés","emptyTitle":"Aucun fait pour le moment","emptyDescription":"Au fil de la conversation, l\'agent note ici ce qu\'il apprend sur vous. Vous pourrez le supprimer à tout moment.","deleteLabel":"Supprimer ce fait","deleteSuccess":"Fait connu supprimé","deleteConfirmTitle":"Supprimer un fait connu","deleteConfirmMessage":"Êtes-vous sûr de vouloir supprimer ce fait connu ?","deleteSelectedConfirmTitle":"Supprimer les faits connus sélectionnés","deleteSelectedConfirmMessage":"Etes-vous sûr de vouloir supprimer les faits connus sélectionnés ?","selected_one":"{{count}} fait sélectionné","selected_other":"{{count}} faits sélectionnés","selectedRows_one":"{{count}} ligne sélectionnée","selectedRows_other":"{{count}} lignes sélectionnées"},"auth":{"title":"Authentification","description":"Cet agent est protégé. Saisissez le mot de passe pour continuer.","useRecoveryTokens":"Utiliser des jetons de récupération","tokens":"Jetons","addToken":"Ajouter un jeton","invalidCredentials":"Identifiants invalides","usePassword":"Utiliser le mot de passe","atLeast":"Au moins"},"widget":{"instruct":"Instruire","test":"Tester","sound":"Son","soundOff":"Son désactivé","position":"Préférences de position","settings":"Paramètres","share":"Partager","shareChat":"Partager le chat","sendOnKeypress":"Appuyez sur Entrée pour envoyer","sendOnClick":"Cliquez sur Envoyer","boardOfExperts":"Conseil d\'experts","showExpertsInTheBoard":"Afficher les experts dans ce conseil","expertsInTheBoard":"Experts dans ce conseil","goToIntegrationsToCustomizeAvatar":"Pour personnaliser l\'avatar, allez dans Partager et personnalisez la page publique","chatAssistantStatus":"Actif • Répond en quelques secondes","agentStatusListening":"à l\'écoute","agentStatusSpeaking":"parle","agentStatusProcessing":"en traitement","shareLocation":"Partager la position","shareLocationHint":"Obtenez des réponses adaptées à votre position","shareLocationAria":"Partager la position avec l\'assistant","knownFactsHint":"Ce que je retiens à votre sujet","aiConsumption":"Utilisation de l\'IA","editPositionAria":"Modifier la position","positionResolving":"Résolution de l\'adresse…","geocodingFailed":"Impossible de déterminer l\'adresse. Réessayez ou recherchez manuellement.","positionUnavailableManual":"Position indisponible. Saisissez-la manuellement.","positionSharingEnabled":"Position partagée.","headerHistory":"Historique","headerProfile":"Profil","headerLogin":"Connexion","downloadQrCode":"Télécharger le QR Code","expandToImmersive":"Agrandir pour une vue immersive","moreActions":"Plus d\'actions","mobileSession":{"session":"Session","sessionInfo":"Infos de session","copyLinkOrDownload":"Copier le lien ou télécharger","currentlyOff":"Actuellement désactivé","whatIKnowAboutYou":"Détails des informations partagées entre vous et {{memoriName}}","locationTracking":"Suivi de position","locationStatus":"Statut","useCurrentPosition":"Utiliser la position actuelle","disableLocationSharing":"Désactiver le partage de position","openKnownFacts":"Ouvrir tous les faits connus","knownFactsMessages":"{{count}} messages dans la session en cours"}},"exportChatHistory":{"exportPDF":"Exporter le chat en PDF","exporting":"Exportation en cours...","empty":"Aucun historique de chat à exporter","pdfNotSupported":"L\'exportation PDF n\'est pas prise en charge dans ce navigateur","success":"Chat exporté en PDF avec succès","error":"Échec de l\'exportation du chat en PDF. Veuillez réessayer."},"write_and_speak":{"conversationStartedLabel":"Conversation démarrée","micButtonPopover":"Cliquez sur le bouton pour parler","micButtonPopoverListening":"Cliquez sur le bouton pour arrêter de parler","stopRecording":"Arrêter l\'enregistrement","sendRecording":"Envoyer le message vocal","recordingInProgress":"Enregistrement en cours","pageInstructExplanation":"Pour m\'apprendre de nouvelles choses, cliquez sur le bouton INSTRUCTEZ-MOI pour commencer","pageTryMeExplanation":"Pour commencer à parler avec moi, cliquez sur le bouton START","pagePrivacyExplanation":"Les conversations sont visibles par l\'auteur de l\'agent","pagePrivacyExplanationTooltip":"En commençant la conversation, nous vous informons que :\\n\\n- Toutes les conversations avec cet agent sont visibles par l\'auteur de l\'agent\\n- Si vous utilisez la chat comme utilisateur anonyme, l\'auteur pourra voir le contenu de la conversation et votre adresse IP\\n- Si vous utilisez la chat comme utilisateur enregistré (connecté), l\'auteur pourra voir le contenu de la conversation et votre nom d\'utilisateur\\n- L\'auteur utilise ces informations pour améliorer les fonctionnalités de l\'agent et pour vous fournir un meilleur service\\n- En continuant la conversation, vous acceptez ces conditions.","pagePrivacyExplanationList":{"allConversations":"Toutes les conversations avec cet agent sont visibles par l\'auteur de l\'agent","anonymousUser":"Pour les utilisateurs anonymes : l\'auteur verra le contenu de la conversation et votre adresse IP","registeredUser":"Pour les utilisateurs enregistrés : l\'auteur verra le contenu de la conversation et votre nom d\'utilisateur","contentAndUsername":"L\'auteur peut voir le contenu, votre nom d\'utilisateur et votre adresse IP","contentAndIpAddress":"L\'auteur peut voir le contenu et votre adresse IP","authorUsesInfo":"L\'auteur utilise ces informations pour améliorer les fonctionnalités de l\'agent et pour vous fournir un meilleur service."},"aiDisclaimer":"L\'agent peut commettre des erreurs. Veuillez vérifier les réponses.","downloadChat":"Télécharger le chat","instructButton":"INSTRUCTEZ-MOI","tryMeButton":"COMMENCER","resumeButton":"RÉSUMER","chatHistory":"Historique des discussions","chatHistoryDescription":"Afficher l\'historique des discussions avec cet agent","loadingChatHistory":"Chargement de l\'historique des discussions...","noChatHistoryAvailable":"Aucun historique des discussions disponible","noResultsFound":"Aucun résultat trouvé pour \\"{{searchText}}\\"","searchInChatHistory":"Rechercher dans les conversations","filters":"Filtres","latestFirst":"Plus récents d\'abord","oldestFirst":"Plus anciens d\'abord","exportChat":"Exporter le Chat","settingsHeaderLabel":"Configurez ici si vous souhaitez définir la mémoire comme parole continue et modifiez les secondes de silence si vous souhaitez les personnaliser.","continuousSpeechLabel":"Discours continu","continuousSpeechDisabled":"Discours continu désactivé car l\'agente est en mode muté","holdToSpeak":"Attends pour parler","releaseToEndListening":"Relâcher pour terminer l\'écoute","pressAndHoldToSpeak":"Appuyez et maintenez pour parler","microphoneMode":"Mode micro","hideEmissionsLabel":"Masquer le texte émis par le Agent","showMessageConsumptionLabel":"Afficher la consommation par message","secondsLabel":"Régler les secondes","controlsPosition":"Position des commandes","tryMeHeaderLabel":"ESSAYER","unknownPosition":"Position inconnue","fieldPlace":"Écrivez le lieu (par exemple « Milano »)","showMapLinkFor":"Afficher la position sur la carte","useMyPosition":"Utiliser ma position","myPosition":"Votre poste","updatingPosition":"Mise à jour du poste...","placeNotFound":"Lieu introuvable !","requirePosition":"Insérez votre position avant de commencer","requirePositionHelp":"Pour parler à {{name}} vous devez décider si vous souhaitez ou non fournir votre poste. ","dontWantToProvidePosition":"Continuer sans lieu","requireLoginHelp":"Pour parler à {{name}}, vous devez d\'abord vous connecter à votre compte.","skipLocationTitle":"Aucune position ne sera enregistrée sur la carte.","locationSaved":"Votre position a été enregistrée.","locationSavedWithPlace":"Votre position a été enregistrée : {{place}}","locationSkippedConfirm":"Vous continuerez sans partager votre position.","placeSelected":"Lieu sélectionné : {{place}}","locationPermissionDenied":"L\'accès à la position a été refusé. Autorisez-la dans les paramètres du navigateur ou choisissez un lieu sur la carte.","locationUnavailable":"Impossible de déterminer votre position. Réessayez ou recherchez un lieu.","locationRequestTimedOut":"La demande de position a expiré. Réessayez ou recherchez un lieu.","locationErrorGeneric":"Un problème est survenu lors de l\'obtention de votre position.","attachmentsLabel":"Enrichissez votre message","image":"image","images":"images","file":"fichier","files":"fichiers","function":"fonction","functions":"fonctions","iWantToTalkToIn":"je veux parler à {{name}} dans","chatLanguageLabel":"Choisissez la langue de la conversation","chatResumed":"Conversation reprise avec succès.","message":"message","messages":"messages","page":"Page {{current}} de {{total}}","downloadThisConversation":"Télécharger cette conversation","downloadAllConversations":"Télécharger toutes les conversations","conversationsCount_one":"{{count}} conversation","conversationsCount_other":"{{count}} conversations","shownOfTotal":"{{shown}} sur {{total}} affichées","loadMore":"Charger plus","backToConversationList":"Retour à la liste des conversations","thisWeek":"Cette semaine"},"chatResume":{"resume":"Reprendre la conversation"},"artifact":{"close":"Fermer","size":"Taille","updated":"mis à jour","updateFailed":"Mise à jour non appliquée","updateFailedHint":"Le correctif ne correspond pas au contenu actuel. Demandez de réécrire l\'artifact.","generated":"Généré","download":"Télécharger","print":"Imprimer","external":"Ouvrir dans une nouvelle fenêtre","type":"Type","fullscreen":"Plein écran","exitFullscreen":"Quitter le plein écran","copy":"Copier","generatedAt":"Généré le","open":"Ouvrir","code":"Code","source":"Source","preview":"Aperçu","resizeHandle":"Redimensionner le panneau artifact","copied":"Copié !","error":"Erreur","generatingPdf":"Génération du PDF...","copying":"Copie en cours...","moreCopyOptions":"Plus d\'options de copie","copyAs":"Copier en tant que","downloadAsMarkdown":"Télécharger en Markdown","downloadRawMarkdownText":"Télécharger le texte markdown brut","downloadAsPdf":"Télécharger en PDF","exportAsPdfDocument":"Exporter en document PDF","downloadAsHtml":"Télécharger en HTML","downloadFormattedHtml":"Télécharger le HTML formaté","viewMode":"Mode Affichage","codeMode":"Mode Code","refresh":"Actualiser","share":"Partager","downloadAsJson":"Télécharger en JSON","downloadJsonData":"Télécharger les données JSON","downloadAsPng":"Télécharger en PNG","downloadPngImage":"Télécharger l\'image PNG","downloadAsJpeg":"Télécharger en JPEG","downloadJpegImage":"Télécharger l\'image JPEG","downloadAsGif":"Télécharger en GIF","downloadGifImage":"Télécharger l\'image GIF","downloadAsWebp":"Télécharger en WebP","downloadWebpImage":"Télécharger l\'image WebP","copyAsSvg":"Copier en SVG","copySvgSourceCode":"Copier le code source SVG","copyAsPlainText":"Copier en texte brut","copyAsText":"Copier en texte","copyAsLanguage":"Copier en {{language}}","copyLanguageCode":"Copier le code {{language}}","copyWithoutSyntaxHighlighting":"Copier sans coloration syntaxique","copyTextContent":"Copier le contenu texte","pdfExportNotSupported":"L\'exportation PDF n\'est pas prise en charge dans ce navigateur","popupBlocked":"Popup bloqué ! Veuillez activer les popups pour imprimer.","safariPdfInstructions":"Export PDF ouvert dans une nouvelle fenêtre. Veuillez utiliser Cmd+P (Mac) ou Ctrl+P (Windows) pour imprimer et sauvegarder en PDF."},"upload":{"loginRequired":"Connexion requise","pastedText":"texte-collé","uploadNotification":"Échec du téléchargement","loginRequiredDescription":"Veuillez vous connecter pour télécharger des images","uploadFiles":"Télécharger des fichiers (drag and drop)","uploadFilesOrImages":"Télécharger des fichiers ou des images","uploadFilesWithShortcut":"{{shortcut}}+O pour ouvrir le sélecteur de fichiers","uploadImages":"Télécharger des images","titleImage":"Ajouter un titre à l\'image","uploadDocuments":"Télécharger des documents","replace":"Remplacer","remaining":"restant","maxReached":"Limite atteinte","maxImagesReached":"Vous pouvez télécharger jusqu\'à {{max}} images","apiClientNotConfigured":"API client non configuré correctement pour le téléchargement de médias","fileReadingFailed":"Échec de la lecture du fichier","uploadFailed":"Échec du téléchargement","uploadSuccess":"Téléchargement réussi","uploadSuccessDescription":"Le fichier a été téléchargé avec succès","dragAndDropFiles":"Glissez et déposez les fichiers ici pour les ajouter à la chat","contextSizeExceedsLimit":"La taille du contexte dépasse la limite. Essayez de réduire le nombre de fichiers ou le contenu de la conversation.","filesNotAddedMaxAllowed":"{{count}} fichier(s) non ajouté(s) (maximum {{max}} fichiers autorisés).","documentsNotAddedMaxAllowed":"{{count}} document(s) non ajouté(s) (maximum {{max}} fichiers autorisés).","imagesNotAddedMaxAllowed":"{{count}} image(s) non ajoutée(s) (maximum {{max}} fichiers autorisés).","documentsNotAddedContextSize":"{{count}} document(s) non ajouté(s) (limite de taille du contexte).","partialAssetUploadWarning":"Certains liens de fichier n\'ont pas pu être téléversés, mais le document a été ajouté quand même.","anonymousRetentionNotice":"Remarque : les fichiers téléversés sont conservés pendant un maximum de 24 heures."},"media":{"title":"Titre","editAttributes":"Modifier les attributs du média","uploadMimeTypeNotAllowed":"Le type de fichier n\'est pas autorisé","uploadSizeLimitMessage":"La taille téléchargée est trop grande (max {{size}}Mo)","uploadWrongResolutionMessage":"La résolution doit être {{width}}x{{height}} pixels","memoriNameAlreadyUsed":"Vous avez déjà un jumeau portant ce nom","uploadHelperImages":"Téléchargez un fichier avec l\'extension png, jpg, jpeg ou gif, et ayant au maximum une taille de {{size}}Mo","uploadHelper":"Téléchargez un fichier ayant au maximum une taille de {{size}}Mo","uploadError":"Échec du téléchargement","square":"carré","scaleRatio":"Rapport d\'échelle","addMediaLabel":"Ajouter un média","insertThisMediaMsg":"Insérez ces médias","mediaUploadMessage":"Cliquez pour charger un nouveau média","addLinkLabel":"Ajouter un lien","linkKey":"URL","linkValue":"Titre du lien","insertThisLink":"Insérer un lien vers {{url}} avec titre {{title}}"},"gamification":{"level":"Niveau","points":"points","memoriReachedLevel":"est devenu plus évolué et a atteint le niveau","levelGoToStatistics":"{{Agent}} est au niveau {{level}} avec {{points}} points. ","congratulationsNewLevel":"Félicitations, vous avez atteint un nouveau niveau !","congratulationsNewLevelDescription":"Votre Agent est devenu plus évolué avec {{points}} points, regardez le","statistics":"statistiques"},"login":{"login":"Se connecter","title":"Se connecter à votre compte","loggingIn":"Connexion en cours…","logout":"Déconnexion","user":"Utilisateur","loggedDrawerTitle":"Salut, {{name}}!","userNameRequired":"Nom d\'utilisateur requis","userName":"Nom d\'utilisateur","userNamePlaceholder":"Inserisci le nom d\'utilisateur","loginDrawerTitle":"Se connecter","signupDrawerTitle":"S\'inscrire","newUserSignUp":"Nouvel utilisateur ?","signUp":"S\'inscrire!","alreadyHaveAnAccount":"Vous avez déjà un compte ?","backToLogin":"Retour à la connexion","registrationDisabled":"L\'inscription est désactivée","contactAdmin":"Contacter l\'administrateur pour demander l\'accès","userNameOrEmail":"Nom d\'utilisateur ou email","email":"E-mail","emailFormatError":"Veuillez insérer un email valide","username":"Nom d\'utilisateur","usernameContainsReservedWord":"Le nom d\'utilisateur contient un mot réservé, veuillez en choisir un autre","usernameFormatError":"Le nom d\'utilisateur doit comporter au moins 3 caractères et contenir uniquement des lettres, des chiffres et _","otpCode":"Le code de vérification","resendVerificationCode":"Renvoyer le code","resentVerificationCode":"Code de confirmation envoyé ! ","welcomeTitle":"Bon retour","welcomeDescription":"Entrez votre code de vérification à 4 chiffres pour continuer vers votre compte","otpTitle":"Entrez le code de vérification","otpDescription":"Entrez le code à 4 chiffres que vous avez généré dans votre compte","otpStep1":"Cliquez sur le bouton ci-dessous pour ouvrir votre compte","otpStep2":"Générez un code de vérification à 4 chiffres (valide pendant 5 minutes)","otpStep3":"Revenez ici et entrez le code","startOtpLogin":"Commencer la vérification","generateOtp":"Générer le code","otpTimer":"Le code expire dans {{time}}","otpInvalidFormat":"Veuillez entrer un code valide à 4 chiffres","otpInvalid":"Code de vérification invalide","otpError":"Erreur lors de la validation du code. Veuillez réessayer.","otpSuccess":"Connexion réussie !","otpEmailTitle":"Entrez votre email","otpEmailDescription":"Entrez votre adresse email pour recevoir un code de vérification","otpCodeDescription":"Entrez le code à 4 chiffres envoyé à {{email}}","emailPlaceholder":"Entrez votre email","sendOtp":"Envoyer le code","resendOtp":"Renvoyer","resendOtpIn":"Renvoyer dans {{seconds}}s","resendOtpPrompt":"Pas reçu ? Renvoyer dans {{seconds}} s","resendOtpQuestion":"Pas reçu ?","resending":"Envoi en cours...","backToEmail":"Retour à l\'email","editEmail":"Modifier","otpSentToPrefix":"Nous avons envoyé un code à 4 chiffres à","otpCodeShort":"Code","loginBenefitLine1":"{{memoriName}} peut vous montrer l\'historique de chat, qui peut être repris à tout moment.","loginBenefit":"{{memoriName}} peut vous montrer l\'historique de chat, qui peut être repris à tout moment.","passwordlessHint":"Nous vous envoyons un code à 4 chiffres. Aucun mot de passe à retenir.","defaultAgentName":"l\'agent","otpSent":"Code de vérification envoyé !","otpResent":"Code renvoyé avec succès !","otpSendError":"Erreur lors de l\'envoi du code. Veuillez réessayer.","emailRequired":"Email requis","emailInvalid":"Veuillez entrer une adresse email valide","otpNotFound":"Code de vérification introuvable","otpExpired":"Le code de vérification a expiré","otpMissing":"Le code de vérification est requis","otpAttemptsExceeded":"Trop de tentatives. Demandez un nouveau code de vérification.","otpSuccessMessage":"Vérification réussie ! Redirection...","otpSuccessDescription":"Votre compte a été vérifié avec succès. Vous allez être redirigé sous peu.","otpHelp":"Entrez le code à 4 chiffres de votre email","emailHelp":"Nous vous enverrons un code de vérification","userFetchError":"Erreur lors du chargement des données utilisateur. Veuillez réessayer.","otpStep1Title":"Entrez l\'Email","otpStep2Title":"Vérifiez l\'Email","otpStep3Title":"Entrez le Code","featureFast":"Rapide","featureSecure":"Sécurisé","featureMobile":"Mobile","password":"Mot de passe","newPassword":"Nouveau mot de passe","confirmPassword":"Confirmez le mot de passe","currentPassword":"Mot de passe actuel","passwordMatchingError":"Les mots de passe ne correspondent pas.","passwordFormatError":"Le mot de passe doit comporter au moins 8 caractères et contenir au moins un chiffre, une lettre majuscule, une lettre minuscule et un symbole.","pwdWeak":"Faible","pwdAcceptable":"Acceptable","pwdStrong":"Fort","mustChangePassword":"Vous devez changer votre mot de passe","passwordChange":"Changer le mot de passe","emailChange":"Changer d\'e-mail","avatarChange":"Changer d\'avatar","avatarUploadSuccess":"Photo de profil mise à jour.","underage":"Vous devez être au moins {{age}} ans pour s\'inscrire.","optional":"Facultatif","birthDate":"Date de naissance","birthDatePlaceholder":"JJ/MM/AAAA","birthDateHelper":"Nous demandons votre date de naissance uniquement pour activer ou désactiver les fonctionnalités qui ont des restrictions d\'âge","missingData":"Informations manquantes","missingDataHelper":"Nous savons que c\'est un peu ennuyeux, mais nous avons besoin de plus d\'informations pour finaliser votre inscription.","goToAccountToChangeYourPreferences":"Vous pouvez modifier votre choix à tout moment depuis la page de votre compte.","deepThoughtExplaination":"Deep Thought est une fonctionnalité avancée de l\'IA qui vous permettra d\'exploiter pleinement vos conversations en les gardant une trace. ","tnCAndPPAcceptedHelper":"Depuis votre dernière connexion, les conditions générales et la politique de confidentialité ont changé. ","privacyLabel":"J\'ai lu et accepté le","privacyAndCookiePolicy":"Politique de confidentialité et de cookies","and":"et","termsOfService":"Conditions d\'utilisation","pAndCUAccepted":"J\'accepte les conditions d\'utilisation de Deep Thought","editAccount":"Modifier le compte","save":"Sauvegarder","successfullyLoggedIn":"{{username}} s\'est connecté avec succès"},"chatLogs":{"llm":"LLM","model":"Modèle","provider":"Fournisseur","tokens":"Tokens","input":"Entrée","output":"Sortie","cacheRead":"Lecture cache","cacheWrite":"Écriture cache","duration":"Durée","energy":"Énergie","co2":"CO2","water":"Eau","usageBadgesHint":"Cliquez sur un de ces boutons pour afficher plus d\'informations","totalChatConsumptionTitle":"Consommation Totale du Chat","modelUsage":"Utilisation du modèle","environmentalImpact":"Impact environnemental","impactComparisonUnavailable":"Comparaison indicative non disponible.","impactComparisonEnergy":"Comparaison indicative : environ comme laisser allumee une ampoule LED de 10 W pendant {{duration}}.","impactComparisonCo2":"Comparaison indicative : environ {{distance}} parcourus en voiture essence moyenne.","impactComparisonWater":"Comparaison indicative : environ {{count}} gouttes d\'eau.","energyImpactDescription":"Cette valeur estime l\'energie electrique necessaire pour generer la reponse du modele. Elle permet de comparer prompts, modeles et strategies meme quand l\'impact d\'un seul message est tres faible.","co2ImpactDescription":"Le CO2 equivalent represente l\'impact climatique estime du message. Traduire la consommation en emissions aide a comprendre le poids environnemental d\'une reponse IA avec des mesures comparables.","waterImpactDescription":"Cet indicateur montre l\'empreinte hydrique estimee associee au traitement du message. Il inclut l\'eau utilisee indirectement par l\'energie et l\'infrastructure qui soutiennent le calcul.","approximateValuesTooltip":"Ces valeurs sont approximatives.","anyMessage":"Tout message","atLeast":"Au moins {{count}} messages","atLeast1":"Au moins 1 message","atLeast2":"Au moins 2 messages","atLeast3":"Au moins 3 messages","atLeast5":"Au moins 5 messages","atLeast10":"Au moins 10 messages","atLeast15":"Au moins 15 messages","atLeast20":"Au moins 20 messages","customMinimumMessages":"Personnaliser le nombre de messages"},"success":"Succès","Error":"Erreur","internal server error":"Oupsie, désolé... Quelque chose s\'est mal passé sur le serveur","error":"Erreur","error.loading":"Erreur lors du chargement du contenu.","error.generic":"Oupsie, désolé... quelque chose s\'est mal passé.","error.serverNotResponding":"Nous effectuons une maintenance ou publions des mises à jour. ","error.notFound":"Oupsie, nous n\'avons pas trouvé la page que vous cherchiez.","error.goBackTo":"Vous pouvez essayer de revenir au","error.reloadPage":"Recharger la page","error.tryAgain":"Essayer à nouveau","error.unauthorized":"Vous n\'êtes pas autorisé à consulter ce contenu.","error.unprocessableEntity":"Erreur lors du traitement de la demande. ","errors":{"TENANT_NOT_FOUND":"Locataire introuvable","TENANT_REGISTRATION_DISABLED":"L\'inscription sur cette plateforme est désactivée","TENANT_MISSING_NAME":"Locataire : nom manquant","TENANT_MAX_USERS_REACHED":"Nombre maximum d\'utilisateurs atteint","TENANT_MAX_ADMINS_REACHED":"Nombre maximum d\'utilisateurs administrateurs atteint","TENANT_ALREADY_EXISTS":"Le locataire existe déjà","TENANT_MISSING_DESCRIPTION":"Locataire : description manquante","TENANT_CANT_SET_COMPLETION_PROVIDER":"Locataire : impossible de définir le fournisseur de complétion","TENANT_INVALID_TYPE":"Locataire : type non valide","USER_NOT_CONFIRMED":"L\'utilisateur n\'est toujours pas confirmé","USER_NOT_FOUND":"Utilisateur introuvable","USER_OR_PASSWORD_INVALID":"Utilisateur ou mot de passe invalide","USER_MUST_CHANGE_PASSWORD":"Vous devez changer votre mot de passe","USER_MUST_ENTER_VERIFICATION_CODE":"Vous devez entrer le code de vérification","USER_MISSING_TENANT":"Utilisateur : locataire manquant","USER_MISSING_NAME":"Utilisateur : le nom est manquant","USER_MISSING_PASSWORD":"Utilisateur : mot de passe manquant","USER_MISSING_EMAIL":"Utilisateur : E-mail manquant","USER_MISSING_VERIFICATION_CODE":"Utilisateur : Code de vérification manquant","USER_NAME_ALREADY_USED":"Nom d\'utilisateur déjà utilisé","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"Le mot de passe ne répond pas aux règles de sécurité","USER_EMAIL_ALREADY_USED":"E-mail déjà utilisé","USER_EMAIL_INVALID":"E-mail invalide","USER_VERIFICATION_CODE_INVALID":"Code de vérification invalide","USER_MISSING_NAME_OR_EMAIL":"Nom d\'utilisateur ou e-mail manquant","USER_NAME_INVALID":"Nom d\'utilisateur invalide","USER_HAS_ONE_OR_MORE_MEMORI":"L\'utilisateur possède une ou plusieurs mémoires","USER_MISSING_NEW_PASSWORD":"Utilisateur : nouveau mot de passe manquant","USER_NOTHING_TO_DO":"Rien à faire","USER_CANT_CREATE_MEMORI":"L\'utilisateur n\'est pas autorisé à créer des Agent","USER_MAX_MEMORI_REACHED":"Nombre maximum de Agent atteint","USER_ORDER_BY_INVALID":"Ordre par non valide","USER_TOO_MANY_ATTEMPTS":"Trop de tentatives","USER_MUST_ACCEPT_TNC_AND_PP":"Vous devez accepter les termes et conditions","USER_BIRTH_DATE_CANT_BE_CHANGED":"La date de naissance ne peut pas être modifiée","USER_CANT_SET_COMPLETION_PROVIDER":"Utilisateur : non autorisé à gérer le fournisseur de complétion","USER_CANT_ENABLE_DEEP_THOUGHT":"Utilisateur : non autorisé à gérer Deep Thought","USER_CANT_ENABLE_DCM_INTEGRATION":"Utilisateur : non autorisé à gérer l\'intégration DCM","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"Utilisateur : non autorisé à gérer des chaînages ou des groupes d\'experts","USER_CREATION_BILLING_DENIED_PERMISSION":"Vous n\'avez pas assez de crédits pour créer un Agent","USER_HAS_ONE_OR_MORE_COMPLETION_CONFIGS":"L\'utilisateur dispose d\'une ou plusieurs configurations de complétion","USER_CANT_BE_DELETED":"L\'utilisateur ne peut pas être supprimé","MEMORI_NOT_FOUND":"Mémoire introuvable","MEMORI_NOT_ACCESSIBLE":"Mémoires non accessibles","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Seul le propriétaire peut modifier le tag ou le code PIN","SESSION_NOT_FOUND":"Séance introuvable","SESSION_IS_NOT_ADMINISTRATIVE":"Séance non administrative","SESSION_EXPIRED":"Session expirée","speechMissingSession":"La voix nécessite une session active","speechInvalidSession":"Session non valide","speechTenantMismatch":"La voix n\'est pas disponible sur ce site","speechRateLimited":"Trop de requêtes vocales. Patientez un instant et réessayez.","SESSION_OTP_NOT_FOUND":"Code de vérification introuvable","SESSION_OTP_EXPIRED":"Le code de vérification a expiré","SESSION_OTP_INVALID":"Code de vérification invalide","SESSION_OTP_ATTEMPTS_EXCEEDED":"Trop de tentatives. Demandez un nouveau code de vérification.","MEMORI_MISSING_CONFIGURATION":"Agent : configuration manquante","MEMORI_CONFIGURATION_NOT_FOUND":"Agent : configuration introuvable","MEMORI_INVALID_PRIVACY_TYPE":"Agent : type de confidentialité non valide","MEMORI_MISSING_PASSWORD":"Agent : mot de passe manquant","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Agent : nombre total de jetons de récupération invalides","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Agent : nombre minimum de jetons de récupération invalides","MEMORI_INVALID_VOICE_TYPE":"Agent : type de voix invalide","MEMORI_MISSING_NAME":"Jumeau : nom manquant","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Agent : mot de passe ou jeton de récupération manquant","MEMORI_INVALID_ID":"Jumeau : pièce d\'identité invalide","MEMORI_NAME_ALREADY_USED":"Nom jumeau déjà utilisé","MEMORI_INVALID_PIN":"Agent : code PIN invalide","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Agent : le changement de TAG et de PIN nécessite des opérations distinctes","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Agent : aucun mot de passe requis lorsqu\'il est public","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Deep Thought nécessite que les complétions soient activées","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"Le groupe d\'experts exige que les complétions soient activées","MEMORI_INVALID_COMPLETION_CONFIG":"Agent : configuration des complétions non valide","MEMORI_MACRO_FUNCTIONS_REQUIRES_COMPLETIONS":"Macro fonctions requiert que les complétions soient activées","MEMORI_BLOCKING_DATE_MISSING_OR_WRONG":"Gemmeau : date de blocage manquante ou incorrecte","MEMORI_LIST_FILTER_NOT_SPECIFIED":"Gemmeau : filtre non spécifié","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transfert : utilisateur de destination manquant","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transfert : ID utilisateur de destination non valide","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transfert : données utilisateur de destination non valides","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfert : rien à faire","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Mémoires : la configuration ne peut pas être modifiée","MEMORI_MISSING_NEW_PASSWORD":"Souvenirs : nouveau mot de passe manquant","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"La fonctionnalité nécessite un abonnement","MEMORI_SESSION_NOT_FOUND":"Séance introuvable","MEMORI_SESSION_DOESNT_ACCEPT_MEDIA":"Séance ne pas accepter les médias","INTEGRATION_NOT_FOUND":"Intégration introuvable","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Date invalide du format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Date à formater invalide","INTEGRATION_INVALID_TYPE":"Type d\'intégration invalide","INTEGRATION_ALREADY_EXISTS":"L\'intégration existe déjà","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Les mémoires non publiques ne peuvent pas être intégrées","INTEGRATION_MISSING_INVOCATION_TEXT":"Intégration : texte d\'invocation manquant","INTEGRATION_MISSING_DEVICE_EMAILS":"Intégration : e-mail de l\'appareil manquant","INTEGRATION_MEMORI_IS_EMPTY":"Les mémoires vides ne peuvent pas être intégrées","INTEGRATION_MISSING_PRIVACY_POLICY":"Intégration : politique de confidentialité manquante","INTEGRATION_MISSING_CATEGORY":"Catégorie d\'intégration manquante","INTEGRATION_MISSING_DESCRIPTION":"Description de l\'intégration manquante","INTEGRATION_INVALID_INVOCATION_TEXT":"Texte d\'appel invalide","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home n\'est plus disponible","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Le téléchargement nécessite un codage en plusieurs parties","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Téléchargement : limite de type de contenu manquante","UPLOAD_MAX_LENGTH_EXCEEDED":"Téléchargement : taille maximale dépassée","UPLOAD_FILE_IS_EMPTY":"Télécharger : fichier vide","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Téléchargement : type de fichier ou signature non valide","UPLOAD_MISSING_FILE_NAME":"Télécharger : nom de fichier manquant","UPLOAD_INVALID_MEMORY_ID":"Télécharger : ID de contenu invalide","UPLOAD_MISSING_FILE_CONTENT":"Télécharger : contenu du fichier manquant","ASSET_NOT_FOUND":"Actif introuvable","ASSET_NOT_ACCESSIBLE":"Actif non accessible","ASSET_MISSING_SESSION_ID":"Élément : ID de session manquant","ASSET_INVALID_FILE_NAME":"Élément : nom de fichier non valide","ASSET_MALWARE_SCAN_THREATS_FOUND":"Élément : menaces de scan de malware trouvées","INVITATION_NOT_FOUND":"Invitation introuvable","INVITATION_NOT_ACCESSIBLE":"Invitation non accessible","INVITATION_ALREADY_ACCEPTED":"Invitation déjà acceptée","INVITATION_ALREADY_REJECTED":"Invitation déjà rejetée","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation : e-mail de destination manquant","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation : e-mail de destination invalide","INVITATION_MISSING_TAG":"Invitation : étiquette manquante","INVITATION_MISSING_PIN":"Invitation : code PIN manquant","INVITATION_INVALID_PIN":"Invitation : code PIN invalide","INVITATION_INVALID_TYPE":"Invitation : type non valide","INVITATION_MISSING_DESTINATION_NAME":"Invitation : le nom de la destination est manquant","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation : le tag et le code PIN ne peuvent pas être modifiés","INVITATION_CANT_BE_CHANGED":"Intation : ne peut pas être modifié","ACTIONLOG_INVALID_USER_ID":"ID utilisateur invalide","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date de : format non valide","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date de : format non valide","ACTIONLOG_INVALID_MEMORI_ID":"Identifiant Agent invalide","CONSUMPTIONLOG_INVALID_TYPE":"Type de journal invalide","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date de : format non valide","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date de : format non valide","CONSUMPTIONLOG_INVALID_USER_ID":"ID utilisateur invalide","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Identifiant Agent invalide","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifications : période d\'extraction du journal de discussion non valide","BROADCAST_NOT_ALLOWED":"Broadcast non autorisé","INVALID_NOTIFICATION_TYPE":"Type de notification non valide","NOTIFICATION_NOT_FOUND":"Notification introuvable","INVALID_NOTIFICATION_FILTER":"Filtre de notification non valide","INVALID_NOTIFICATION_PERIOD":"Période de notification non valide","PROCESS_INVALID_TYPE":"Type de processus invalide","PROCESS_ALREADY_RUNNING":"Processus déjà en cours","PROCESS_NOT_FOUND":"Processus introuvable","IMPORTCSV_MISSING_ROWS":"Import CSV : lignes manquantes","IMPORTCSV_MISSING_CSV":"Importation CSV : CSV manquant","IMPORTCSV_MISSING_SEPARATOR":"Import CSV : séparateur manquant","IMPORTCSV_INVALID_SEPARATOR":"Importation CSV : séparateur non valide","IMPORTCSV_MISSING_HEADERS":"Import CSV : en-têtes manquants","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Import CSV : séparateur de variante de titre manquant","IMPORTCSV_INVALID_RECEIVER_ID":"Importation CSV : ID de destinataire non valide","IMPORTCSV_INVALID_MEDIA_LINK":"Importation CSV : lien média non valide","IMPORTCSV_INVALID_LINK_TITLE_HANDLING":"Importation CSV : titre du lien invalide","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"Import CSV : encodage de caractères indétectable","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"Importation CSV : impossible d\'importer dans les mémoires secrètes","IMPORTTXT_MISSING_ROWS":"Importation de TXT : lignes manquantes","IMPORTTXT_INVALID_GRANULARITY":"Importer TXT : granularité invalide","IMPORTTXT_INVALID_RECEIVER_ID":"Importer TXT : ID de destinataire invalide","IMPORTTXT_INVALID_MEDIA_LINK":"Importer TXT : lien média non valide","IMPORTTXT_INVALID_LINK_TITLE_HANDLING":"Importer TXT : titre du lien invalide","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"Import TXT : encodage de caractères indétectable","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"Importation TXT : impossible d\'importer vers les mémoires secrètes","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Importer TXT : limite d\'importation dépassée","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Importer TXT : l\'importation sur GPT-4 nécessite une clé API","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Importer TXT : l\'importation nécessite un forfait payant","IMPORTTXT_BILLING_DENIED_PERMISSION":"Importer TXT : vous n\'avez pas assez de crédits pour l\'opération","IMPORT_MISSING_ROWS":"Importation : lignes manquantes","IMPORT_CANT_IMPORT_TO_SECRET_MEMORI":"Importation : impossible d\'importer vers les mémoires secrètes","IMPORTMEMORI_INVALID_MEMORI_SPECS":"Importation MEMORI : spécifications de mémoire non valides","IMPORT_MISSING_JSONL":"Importation : JSONL manquant","IMPORTMEMORI_INVALID_SPECS":"Importation MEMORI : spécifications non valides","EXPORT_MISSING_PASSWORD":"Exportation : mot de passe manquant","EXPORTCSV_MISSING_CSV_SPECS":"Exportation CSV : spécifications CSV manquantes","EXPORTCSV_MISSING_SEPARATOR":"Export CSV : séparateur manquant","EXPORTCSV_INVALID_SEPARATOR":"Exportation CSV : séparateur non valide","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Exportation CSV : séparateur de variante de titre manquant","EXPORTCSV_MISSING_NEW_LINE_CHAR":"Exportation CSV : caractère de nouvelle ligne manquant","EXPORTCSV_INVALID_NEW_LINE_CHAR":"Exportation CSV : caractère de nouvelle ligne non valide","EXPORTCSV_MISSING_PASSWORD":"Export CSV : mot de passe manquant","EXPORTJSONL_MISSING_JSONL_SPECS":"Export JSONL : spécifications JSONL manquantes","EXPORTJSONL_MISSING_PLATFORM":"Export JSONL : plateforme manquante","EXPORTJSONL_INVALID_PLATFORM":"Export JSONL : plateforme non valide","EXPORTJSONL_MISSING_PASSWORD":"Export JSONL : mot de passe manquant","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"Exportation JSONL : l\'exportation nécessite un forfait payant","ANALYSIS_MISSING_QUERY":"Analyse : requête manquante","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analyse : impossible d\'analyser les souvenirs secrets","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analyse : la correspondance avec la requête de l\'utilisateur nécessite une réflexion approfondie","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Attribution des badges : identifiants incorrects ou manquants","BADGE_ASSIGNMENT_MISSING_REF_ID":"Affectation du badge : ID de référence manquant","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Attribution des badges : résultat introuvable","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Attribution du badge : URL d\'assertion manquante","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Attribution du badge : URL du badge manquante","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Attribution du badge : URL de l\'émetteur manquante","BADGE_ASSIGNMENT_INVALID_URL":"Attribution du badge : URL invalide","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Affectation du badge : destinataire manquant","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Attribution du badge : type de destinataire inconnu","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Attribution du badge : identité du destinataire manquante","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Attribution du badge : type de hachage du destinataire manquant","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Attribution du badge : type de hachage du destinataire inconnu","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Attribution du badge : identité du destinataire incorrecte","BADGE_NOT_FOUND":"Badge introuvable","OUTCOME_NO_DCM_CONFIGURED":"Résultat : aucun DCM configuré","OUTCOME_USER_BADGES_DISABLED":"Résultat : badges utilisateur désactivés","COMPLETION_CONFIG_MISSING_NAME":"Configuration des complétions : nom manquant","COMPLETION_CONFIG_MISSING_PROVIDER":"Configuration des complétions : fournisseur manquant","COMPLETION_CONFIG_MISSING_ENDPOINT":"Configuration des complétions : point de terminaison manquant","COMPLETION_CONFIG_MISSING_API_KEY":"Configuration des complétions : clé API manquante","COMPLETION_CONFIG_MISSING_MODEL":"Configuration des complétions : modèle manquant","COMPLETION_CONFIG_NO_PURPOSE_SPECIFIED":"Configuration des complétions : au moins un type de complétions doit être spécifié","COMPLETION_CONFIG_INVALID_NAME":"Configuration des complétions: nom non valide","COMPLETION_CONFIG_INVALID_PURPOSE":"Configuration des complétions : type de complétions non valide","COMPLETION_CONFIG_INVALID_ENDPOINT":"Configuration des achèvements : point de terminaison non valide","COMPLETION_CONFIG_INCONSISTENT_ENDPOINT":"Configuration des complétions : point de terminaison incohérent","COMPLETION_CONFIG_INVALID_PROVIDER":"Configuration des complétions : fournisseur non valide","COMPLETION_CONFIG_NOT_FOUND":"Configuration des complétions : introuvable","COMPLETION_CONFIG_NOT_ACCESSIBLE":"Configuration des complétions : non accessible","COMPLETION_CONFIG_NAME_RESERVED":"Configuration des complétions : nom réservé","COMPLETION_CONFIG_NAME_ALREADY_EXISTS":"Configuration des complétions : le nom existe déjà","COMPLETION_CONFIG_VISIBILITY_CHANGE_NOT_ALLOWED":"Configuration des complétions : changement de visibilité non autorisé","COMPLETION_CONFIG_MISSING_MANDATORY_PREFIX":"Configuration des complétions : préfixe obligatoire manquant","COMPLETION_CONFIG_VISIBILITY_NOT_PERMITTED":"Configuration des complétions : visibilité non autorisée","COMPLETION_CONFIG_USE_AS_DEFAULT_NOT_PERMITTED":"Configuration des complétions : utilisation comme défaut non autorisée","COMPLETION_CONFIG_USE_AS_DEFAULT_REQUIRES_TENANT_VISIBILITY":"Configuration des complétions : utilisation comme défaut nécessite la visibilité du locataire","COMPLETION_CONFIG_CHARGEABLE_NOT_PERMITTED":"Configuration des complétions : chargeable non autorisé","COMPLETION_CONFIG_INVALID_APPLY_TO":"Configuration des complétions : apply to non valide","COMPLETION_CONFIG_APPLY_TO_TENANT_NOT_ALLOWED":"Configuration des complétions : apply to tenant non autorisé","TRUSTED_APPLICATION_NOT_FOUND":"Application de confiance introuvable","TRUSTED_APPLICATION_NOT_ACCESSIBLE":"Application de confiance non accessible","TRUSTED_APPLICATION_ALREADY_EXISTS":"Application de confiance existe déjà","TRUSTED_APPLICATION_MISSING_NAME":"Application de confiance : nom manquant","TRUSTED_APPLICATION_MISSING_DESCRIPTION":"Application de confiance : description manquante","TRUSTED_APPLICATION_MISSING_ICON":"Application de confiance : icône manquante","TRUSTED_APPLICATION_MISSING_URL":"Application de confiance : URL manquante"}}');var Xz={};Xz=JSON.parse('{"yes":"Ja","no":"NEIN","confirm":"Bestätigen","apply":"Anwenden","cancel":"Stornieren","show":"Zeigen","hide":"Verstecken","send":"Schicken","scrollToLatest":"Zum neuesten Beitrag","scrollToContinueReading":"Scrollen, um weiterzulesen","close":"Schließen","clearHistory":"Chat leeren","clearHistoryDone":"Chat geleert.","moreInfo":"Mehr Informationen","back":"Zurück","edit":"Bearbeiten","delete":"Löschen","loading":"Laden","expand":"Expandieren","collapse":"Einklappen","expandable":{"expand":"Expandieren"},"fullscreenEnter":"Geben Sie den Vollbildmodus ein","fullscreenExit":"Beenden Sie den Vollbildmodus","center":"Center","bottom":"Unten","hidden":"Versteckt","all":"Alle","today":"Heute","yesterday":"Gestern","last_7_days":"Letzte 7 Tage","last_30_days":"Letzte 30 Tage","missingData":"Fehlende Informationen","date":"Geburtsdatum","day":"Tag","copied":"Kopiert!","placeholder":"Stellen Sie eine Frage","month":"Monat","year":"Jahr","createdAt":"Erstellungsdatum","selected":"Ausgewählt","page":"Seite","actions":"Aktionen","next":"Nächste","previous":"Vorherige","copy":"Kopie","copyRawCode":"Rohcode kopieren","feedback":"Feedback","feedbackThankYou":"Vielen Dank für Ihr Feedback.","copyFailed":"Kopieren nicht möglich","functionCache":"Funktionscache","copyToClipboard":"In die Zwischenablage kopieren","showOriginalText":"Original anzeigen","showTranslatedText":"Übersetzung anzeigen","exactPosition":"Genaue Position","uncertain":"Unsicher","question":"Frage","nothingFound":"Nichts gefunden","venue":"Veranstaltungsort","searchVenue":"Nach einem Ort suchen…","privacyPolicy":"Datenschutzbestimmungen","popularLanguages":"Beliebt","allLanguages":"Alle Sprachen","memoriBlockedTitle":"Blockiert","memoriBlockedUntil":"Agent blockiert bis {{date}}","memoriBlockedAnon":"Momentan \\"{{name}}„Kann nicht antworten, komm hierher zurück {{date}}","memoriBlockedReasonExceedChats":"weil der monatliche Schwellenwert für erlaubte Chats überschritten wurde.","memoriBlockedGiverHelper":"Sie können es weiterhin als Administrator verwalten, andere Benutzer können jedoch nicht damit interagieren.","generatedByAI":"Von KI generierte Antworten können gelegentlich falsche Informationen generieren","aiGeneratedNote":"Der Agent kann Fehler machen. Stellen Sie sicher, dass Sie wichtige Informationen überprüfen.","reasoning":"Überlegung...","thinking":"Denke nach","thought":"Überlegung","thoughtFor":"Nachgedacht für {{count}} s","whyThisAnswer":"Woher kommt diese Antwort","whyThisAnswerHelper":"Diese Antwort wurde automatisch von einer künstlichen Intelligenz auf Basis dieser verifizierten Inhalte generiert.","whyThisAnswerDescription":"Inhalte der Wissensbasis, die der Agent für die Antwort konsultiert hat.","whyThisAnswerYouAsked":"Sie haben gefragt","whyThisAnswerUserAsked":"Frage des Nutzers","whyThisAnswerAgentReplied":"Der Agent hat geantwortet","whyThisAnswerShowFull":"Vollständige Antwort anzeigen","whyThisAnswerContentsUsed":"Verwendete Inhalte","whyThisAnswerOpen":"Öffnen","whyThisAnswerDisclaimer":"Die Antwort wurde vom Agenten aus diesen Inhalten geschrieben: sie kann Fehler oder Umformulierungen enthalten. Prüfen Sie wichtige Informationen an der Quelle.","whyThisAnswerEmptyTitle":"Keine Inhalte konsultiert","whyThisAnswerEmptyDescription":"Für diese Frage hat der Agent keine Treffer in der Wissensbasis gefunden: er hat nur nach seinen Anweisungen geantwortet.","whyThisAnswerEmptyAuthorDescription":"Die Frage hat keine Treffer ergeben. Falls sie welche haben sollte, fügen Sie einen passenden Inhalt hinzu.","whyThisAnswerAddContent":"Zur Wissensbasis hinzufügen","whyThisAnswerConfidenceHigh":"Starke Übereinstimmung","whyThisAnswerConfidenceMedium":"Teilweise Übereinstimmung","whyThisAnswerConfidenceLow":"Schwache Übereinstimmung","whyThisAnswerTypeQuestion":"Frage und Antwort","whyThisAnswerTypeDocument":"Dokument","whyThisAnswerTypeWebsite":"Website","whyThisAnswerTypeStory":"Geschichte","whyThisAnswerSourcesCount_one":"{{count}} Quelle","whyThisAnswerSourcesCount_other":"{{count}} Quellen","whyThisAnswerNoSources":"Keine Quellen","receiverLabel":"Zugewiesen an","completionsEnabled":"Fortschrittliche KI kann mit automatisch generierten Antworten reagieren, die manchmal falsche Informationen enthalten können","completionProviderDown":"Dieser Zwilling ist mit einer generativen KI von integriert {{provider}}, aber es ist derzeit nicht verfügbar. ","completionProviderMajorOutage":"Dieser Zwilling ist mit einer generativen KI von integriert {{provider}}, aber es ist derzeit nicht verfügbar. Diese Funktion wird nicht verfügbar sein, bis der Service wiederhergestellt ist.","completionProviderPartialOutage":"Dieser Zwilling ist mit einer generativen KI von integriert {{provider}}, aber es ist derzeit nicht verfügbar. Diese Funktion wird nicht verfügbar sein, bis der Service wiederhergestellt ist.","completionProviderDegraded":"Dieser Zwilling ist mit einer generativen KI von integriert {{provider}}, aber es ist derzeit nicht verfügbar. Diese Funktion wird nicht verfügbar sein, bis der Service wiederhergestellt ist.","completionProviderFallbackName":"ein externer Anbieter","completionProviderCheckStatusPage":"Überprüfen Sie die Statusseite","boardOfExperts":"Expertengremium","birthDate":"Geburtsdatum","birthDateHelper":"Wir fragen nur nach Ihrem Geburtsdatum, um Funktionen zu aktivieren oder zu deaktivieren, für die Altersbeschränkungen gelten","underage":"Das müssen Sie mindestens sein {{age}} Jahre alt, um sich anzumelden.","underageTwinSession":"Das müssen Sie mindestens sein {{age}} Jahre alt, um mit diesem Zwilling zu interagieren.","errorFetchingSession":"Fehler beim Laden der Sitzung","errorGettingReferralURL":"Fehler beim Laden des Referrals","errorReopeningSession":"Fehler beim erneuten Öffnen der Sitzung","sessionExpiredReopening":"Sitzung abgelaufen, Sitzung wird neu geöffnet","ageVerification":"Altersüberprüfung","ageVerificationText":"Um mit diesem Zwilling interagieren zu können, müssen Sie mindestens sein {{minAge}} Jahre alt.","ageVerificationSuccess":"Altersprüfung bestanden mit Erfolg.","nsfw":"NSFW: Dieser Agent enthält Inhalte für Erwachsene","deepThought":"Tiefer Gedanke","deepThoughtWhatIs":"Was ist Deep Thought?","deepThoughtHelper":"Deep Thought ist eine erweiterte Funktion der KI, die es Ihnen ermöglicht, Ihre Gespräche voll auszuschöpfen, indem Sie sie verfolgen. ","deepThoughtDisclaimerTitle":"Deep Thought aktiviert","deepThoughtDisclaimer":"Deep Thought ist eine erweiterte Funktion der KI, die es Ihnen ermöglicht, Ihre Gespräche voll auszuschöpfen, indem Sie sie verfolgen. ","deepThoughtPreDisclaimerUnlogged":"Melden Sie sich an, um Deep Thought zu aktivieren.","deepThoughtPreDisclaimerNotAllowed":"Deep Thought ist deaktiviert, da Sie der Nutzung nicht zugestimmt haben. Sie können dies jederzeit in Ihren Kontoeinstellungen ändern.","notEnoughCredits":"Der Autor dieses Zwillings verfügt nicht über genügend Credits, um Ihre Frage zu beantworten.","creditsCheckFailed":"Die Credits dieses Agenten konnten nicht überprüft werden. Bitte versuche es später erneut oder kontaktiere den Autor.","confirmDialog":{"title":"Möchten Sie diese Seite verlassen?","message":"Die Änderungen, die Sie vorgenommen haben, werden verloren."},"knownFacts":{"title":"Bekannte Fakten","description":"Was {{memoriName}} über Sie merkt. Sie können jeden Eintrag löschen.","type":"Typ","typeShortTerm":"Kurzfristig","typeLongTerm":"Langfristig","typeHelper":"Typen:\\n","text":"Text","searchPlaceholder":"Fakten durchsuchen","select":"Auswählen","loadMore":"Weitere laden","factsCount_one":"{{count}} Fakt","factsCount_other":"{{count}} Fakten","shownOfTotal":"{{shown}} von {{total}} angezeigt","emptyTitle":"Noch keine Fakten","emptyDescription":"Während Sie sprechen, notiert der Agent hier, was er über Sie lernt. Sie können es jederzeit löschen.","deleteLabel":"Diesen Fakt löschen","deleteSuccess":"Bekannte Tatsache gelöscht","deleteConfirmTitle":"Bekannte Tatsache löschen","deleteConfirmMessage":"Sind Sie sicher, dass Sie diese bekannte Tatsache löschen möchten?","deleteSelectedConfirmTitle":"Ausgewählte bekannte Fakten löschen","deleteSelectedConfirmMessage":"Sind Sie sicher, dass Sie die ausgewählten bekannten Fakten löschen möchten?","selected_one":"{{count}} Fakt ausgewählt","selected_other":"{{count}} Fakten ausgewählt","selectedRows_one":"{{count}} Zeile ausgewählt","selectedRows_other":"{{count}} Zeilen ausgewählt"},"auth":{"title":"Authentifizierung","description":"Dieser Agent ist geschützt. Gib das Passwort ein, um fortzufahren.","useRecoveryTokens":"Verwenden Sie Wiederherstellungstoken","tokens":"Token","addToken":"Token hinzufügen","usePassword":"Passwort verwenden","passwordRequired":"Passwort erforderlich","invalidCredentials":"Ungültige Zugangsdaten","atLeast":"Mindestens"},"widget":{"instruct":"Anleiten","test":"Testen","sound":"Ton","soundOff":"Ton aus","position":"Positionspräferenzen","settings":"Einstellungen","share":"Teilen","shareChat":"Chat teilen","sendOnKeypress":"Drücken Sie Enter zum Senden","sendOnClick":"Klicken Sie auf Senden","boardOfExperts":"Expertenrat","showExpertsInTheBoard":"Experten in diesem Rat anzeigen","expertsInTheBoard":"Experten in diesem Rat","goToIntegrationsToCustomizeAvatar":"Um den Avatar anzupassen, gehen Sie zu \\"Teilen\\" und passen Sie die öffentliche Seite an","chatAssistantStatus":"Aktiv • Antwortet in wenigen Sekunden","agentStatusListening":"hört zu","agentStatusSpeaking":"spricht","agentStatusProcessing":"verarbeitet","shareLocation":"Standort teilen","shareLocationHint":"Erhalte Antworten passend zu deinem Standort","shareLocationAria":"Standort mit dem Assistenten teilen","knownFactsHint":"Was ich mir über dich merke","aiConsumption":"KI-Verbrauch","editPositionAria":"Standort bearbeiten","positionResolving":"Adresse wird ermittelt…","geocodingFailed":"Adresse konnte nicht ermittelt werden. Bitte erneut versuchen oder manuell suchen.","positionUnavailableManual":"Standort nicht verfügbar. Bitte manuell eingeben.","positionSharingEnabled":"Standort geteilt.","headerHistory":"Verlauf","headerProfile":"Profil","headerLogin":"Anmelden","downloadQrCode":"QR-Code herunterladen","expandToImmersive":"Zum immersivem Ansichtsmodus erweitern","moreActions":"Weitere Aktionen","mobileSession":{"session":"Session","sessionInfo":"Sitzungsinfo","copyLinkOrDownload":"Link kopieren oder herunterladen","currentlyOff":"Derzeit deaktiviert","whatIKnowAboutYou":"Details der Informationen, die zwischen Ihnen und {{memoriName}} geteilt werden","locationTracking":"Standortverfolgung","locationStatus":"Status","useCurrentPosition":"Aktuelle Position verwenden","disableLocationSharing":"Standortfreigabe deaktivieren","openKnownFacts":"Alle bekannten Fakten öffnen","knownFactsMessages":"{{count}} Nachrichten in der aktuellen Session"}},"exportChatHistory":{"exportPDF":"Chat als PDF exportieren","exporting":"Exportiere...","empty":"Kein Chatverlauf zum Exportieren","pdfNotSupported":"PDF-Export wird in diesem Browser nicht unterstützt","success":"Chat erfolgreich als PDF exportiert","error":"Fehler beim Exportieren des Chats als PDF. Bitte versuchen Sie es erneut."},"write_and_speak":{"micButtonPopover":"Klicken Sie auf die Schaltfläche, um zu sprechen","micButtonPopoverListening":"Klicken Sie auf die Schaltfläche, um das Sprechen zu stoppen","stopRecording":"Aufnahme beenden","sendRecording":"Sprachnachricht senden","recordingInProgress":"Aufnahme läuft","pageInstructExplanation":"Um mir neue Dinge beizubringen, klicken Sie auf die Schaltfläche \\"ANLEITEN\\", um zu beginnen","pageTryMeExplanation":"Um mit mir zu beginnen, klicken Sie auf die Schaltfläche START","pagePrivacyExplanation":"Die Konversationen sind sichtbar von dem Autor des Agenten","aiDisclaimer":"Der Agent kann Fehler machen. Bitte überprüfen Sie die Antworten.","downloadChat":"Chat herunterladen","pagePrivacyExplanationList":{"allConversations":"Alle Konversationen mit diesem Agenten sind sichtbar von dem Autor des Agenten","anonymousUser":"Für anonyme Benutzer: der Autor wird den Inhalt der Konversation und Ihre IP-Adresse sehen","registeredUser":"Für registrierte Benutzer: der Autor wird den Inhalt der Konversation und Ihren Benutzernamen sehen","contentAndUsername":"Der Autor kann den Inhalt, Ihren Benutzernamen und Ihre IP-Adresse sehen","contentAndIpAddress":"Der Autor kann den Inhalt und Ihre IP-Adresse sehen","authorUsesInfo":"Der Autor verwendet diese Informationen, um die Funktionen des Agenten zu verbessern und Ihnen einen besseren Service anzubieten."},"instructButton":"WEISE MICH AN","tryMeButton":"START","resumeButton":"FORTSETZEN","chatHistory":"Chatverlauf","chatHistoryDescription":"Chatverlauf mit diesem Agenten anzeigen","loadingChatHistory":"Chatverlauf wird geladen...","noChatHistoryAvailable":"Kein Chatverlauf verfügbar","noResultsFound":"Keine Ergebnisse gefunden für \\"{{searchText}}\\"","searchInChatHistory":"Unterhaltungen durchsuchen","filters":"Filter","latestFirst":"Neueste zuerst","oldestFirst":"Älteste zuerst","exportChat":"Chat exportieren","conversationStartedLabel":"Unterhaltung gestartet","settingsHeaderLabel":"Richten Sie hier ein, wenn Sie die Agent als Dauerrede einstellen möchten, und ändern Sie die Stillesekunden, wenn Sie sie anpassen möchten.","continuousSpeechLabel":"Kontinuierliche Rede","continuousSpeechDisabled":"Kontinuierliche Rede deaktiviert, da der Agent im Stummschaltmodus ist","holdToSpeak":"Halten Sie gedrückt, um zu sprechen","releaseToEndListening":"Lassen Sie los, um das Hören zu beenden","pressAndHoldToSpeak":"Zum Sprechen gedrückt halten","microphoneMode":"Mikrofonmodus","hideEmissionsLabel":"Vom Zwilling ausgegebenen Text ausblenden","showMessageConsumptionLabel":"Verbrauch pro Nachricht anzeigen","secondsLabel":"Sekunden einstellen","controlsPosition":"Steuert die Position","tryMeHeaderLabel":"VERSUCHEN","unknownPosition":"Unbekannte Position","fieldPlace":"Geben Sie den Ort ein (z. B. \\"Mailand\\")","showMapLinkFor":"Zeigen Sie die Position auf der Karte an","useMyPosition":"Nutzen Sie meine Position","myPosition":"Ihre Position","updatingPosition":"Position wird aktualisiert...","placeNotFound":"Ort nicht gefunden!","requirePosition":"Geben Sie vor dem Start Ihre Position ein","requirePositionHelp":"Zum Reden {{name}} Sie müssen entscheiden, ob Sie Ihre Position angeben oder nicht. ","dontWantToProvidePosition":"Ohne Standort fortfahren","requireLoginHelp":"Um mit {{name}} zu sprechen, musst du dich zuerst mit deinem Konto anmelden.","skipLocationTitle":"Es wird kein Standort auf der Karte gespeichert.","locationSaved":"Ihr Standort wurde gespeichert.","locationSavedWithPlace":"Ihr Standort wurde gespeichert: {{place}}","locationSkippedConfirm":"Sie machen ohne Standortfreigabe weiter.","placeSelected":"Ort ausgewählt: {{place}}","locationPermissionDenied":"Standortzugriff wurde verweigert. Erlauben Sie den Standort in den Browsereinstellungen oder wählen Sie einen Ort auf der Karte.","locationUnavailable":"Ihre Position konnte nicht ermittelt werden. Versuchen Sie es erneut oder suchen Sie einen Ort.","locationRequestTimedOut":"Standortanfrage hat das Zeitlimit überschritten. Versuchen Sie es erneut oder suchen Sie einen Ort.","locationErrorGeneric":"Beim Abrufen Ihres Standorts ist etwas schiefgelaufen.","attachmentsLabel":"Bereichern Sie Ihre Botschaft","image":"Bild","images":"Bilder","file":"Datei","files":"Dateien","function":"Funktion","functions":"Funktionen","iWantToTalkToIn":"Ich möchte mit reden {{name}} In","chatLanguageLabel":"Wählen Sie die Sprache der Unterhaltung","chatResumed":"Unterhaltung erfolgreich fortgesetzt.","message":"nachricht","messages":"nachrichten","page":"Seite {{current}} von {{total}}","downloadThisConversation":"Diese Unterhaltung herunterladen","downloadAllConversations":"Alle Unterhaltungen herunterladen","conversationsCount_one":"{{count}} Unterhaltung","conversationsCount_other":"{{count}} Unterhaltungen","shownOfTotal":"{{shown}} von {{total}} angezeigt","loadMore":"Weitere laden","backToConversationList":"Zurück zur Unterhaltungsliste","thisWeek":"Diese Woche"},"chatResume":{"resume":"Unterhaltung fortsetzen"},"artifact":{"close":"Schließen","size":"Größe","updated":"aktualisiert","updateFailed":"Update konnte nicht angewendet werden","updateFailedHint":"Der Patch stimmt nicht mit dem aktuellen Inhalt überein. Bitten Sie um ein Neuschreiben des Artifacts.","generated":"Generiert","download":"Herunterladen","print":"Drucken","external":"In neuem Fenster öffnen","type":"Typ","fullscreen":"Vollbild","exitFullscreen":"Vollbild beenden","copy":"Kopieren","generatedAt":"Generiert am","open":"Öffnen","code":"Code","source":"Quelle","preview":"Vorschau","resizeHandle":"Artifact-Panel skalieren","copied":"Kopiert!","error":"Fehler","generatingPdf":"PDF wird generiert...","copying":"Kopiere...","moreCopyOptions":"Weitere Kopieroptionen","copyAs":"Kopieren als","downloadAsMarkdown":"Als Markdown herunterladen","downloadRawMarkdownText":"Rohmarkdown-Text herunterladen","downloadAsPdf":"Als PDF herunterladen","exportAsPdfDocument":"Als PDF-Dokument exportieren","downloadAsHtml":"Als HTML herunterladen","downloadFormattedHtml":"Formatiertes HTML herunterladen","viewMode":"Ansichtsmodus","codeMode":"Code-Modus","refresh":"Aktualisieren","share":"Teilen","downloadAsJson":"Als JSON herunterladen","downloadJsonData":"JSON-Daten herunterladen","downloadAsPng":"Als PNG herunterladen","downloadPngImage":"PNG-Bild herunterladen","downloadAsJpeg":"Als JPEG herunterladen","downloadJpegImage":"JPEG-Bild herunterladen","downloadAsGif":"Als GIF herunterladen","downloadGifImage":"GIF-Bild herunterladen","downloadAsWebp":"Als WebP herunterladen","downloadWebpImage":"WebP-Bild herunterladen","copyAsSvg":"Als SVG kopieren","copySvgSourceCode":"SVG-Quellcode kopieren","copyAsPlainText":"Als Klartext kopieren","copyAsText":"Als Text kopieren","copyAsLanguage":"Als {{language}} kopieren","copyLanguageCode":"{{language}}-Code kopieren","copyWithoutSyntaxHighlighting":"Ohne Syntaxhervorhebung kopieren","copyTextContent":"Textinhalt kopieren","pdfExportNotSupported":"PDF-Export wird in diesem Browser nicht unterstützt","popupBlocked":"Popup blockiert! Bitte aktivieren Sie Popups zum Drucken.","safariPdfInstructions":"PDF-Export in neuem Fenster geöffnet. Bitte verwenden Sie Cmd+P (Mac) oder Strg+P (Windows) zum Drucken und als PDF speichern."},"upload":{"loginRequired":"Login erforderlich","pastedText":"text-eingefügt","uploadNotification":"Hochladen fehlgeschlagen","loginRequiredDescription":"Bitte melden Sie sich an, um Bilder hochzuladen","uploadFiles":"Dateien hochladen (drag and drop)","uploadFilesOrImages":"Dateien oder Bilder hochladen","uploadFilesWithShortcut":"{{shortcut}}+O zum Öffnen des Datei-Selektors","uploadImages":"Bilder hochladen","titleImage":"Bildtitel hinzufügen","uploadDocuments":"Dokumente hochladen","replace":"Ersetzen","remaining":"verbleibend","maxReached":"Maximal erreicht","apiClientNotConfigured":"Client API nicht korrekt konfiguriert für das Hochladen von Medien","fileReadingFailed":"Datei lesen fehlgeschlagen","uploadFailed":"Hochladen fehlgeschlagen","uploadSuccess":"Hochladen erfolgreich","uploadSuccessDescription":"Die Datei wurde erfolgreich hochgeladen","maxImagesReached":"Sie können bis zu {{max}} Bilder hochladen","dragAndDropFiles":"Ziehen Sie Dateien hierher, um sie zur Chat hinzuzufügen","contextSizeExceedsLimit":"Die Kontextgröße überschreitet das Limit. Reduzieren Sie die Anzahl der Dateien oder den Inhalt der Konversation.","filesNotAddedMaxAllowed":"{{count}} Datei(en) nicht hinzugefügt (maximal {{max}} Dateien erlaubt).","documentsNotAddedMaxAllowed":"{{count}} Dokument(e) nicht hinzugefügt (maximal {{max}} Dateien erlaubt).","imagesNotAddedMaxAllowed":"{{count}} Bild(er) nicht hinzugefügt (maximal {{max}} Dateien erlaubt).","documentsNotAddedContextSize":"{{count}} Dokument(e) nicht hinzugefügt (Kontextgrößen-Limit).","partialAssetUploadWarning":"Einige Dateilinks konnten nicht hochgeladen werden, aber das Dokument wurde trotzdem hinzugefügt.","anonymousRetentionNotice":"Hinweis: Hochgeladene Dateien werden maximal 24 Stunden gespeichert."},"media":{"title":"Titel","editAttributes":"Medienattribute bearbeiten","uploadMimeTypeNotAllowed":"Der Dateityp ist nicht zulässig","uploadSizeLimitMessage":"Die hochgeladene Größe ist zu groß (max {{size}}MB)","uploadWrongResolutionMessage":"Die Auflösung muss sein {{width}}X{{height}} Pixel","memoriNameAlreadyUsed":"Du hast bereits einen Zwilling mit diesem Namen","uploadHelperImages":"Laden Sie eine Datei mit der Erweiterung PNG, JPG, JPEG oder GIF hoch und darf maximal eine Größe von haben {{size}}MB","uploadHelper":"Laden Sie eine Datei mit einer maximalen Größe von hoch {{size}}MB","uploadError":"Der Upload ist fehlgeschlagen","square":"Quadrat","scaleRatio":"Maßstabsverhältnis","addMediaLabel":"Fügen Sie ein Medium hinzu","insertThisMediaMsg":"Legen Sie diese Medien ein","mediaUploadMessage":"Klicken Sie hier, um ein neues Medium zu laden","addLinkLabel":"Fügen Sie einen Link hinzu","linkKey":"URL","linkValue":"Linktitel","insertThisLink":"Fügen Sie einen Link ein {{url}} mit Titel {{title}}"},"gamification":{"level":"Ebene","points":"Punkte","memoriReachedLevel":"entwickelte sich weiter und erreichte ein höheres Niveau","levelGoToStatistics":"{{memori}} ist auf gleicher Höhe {{level}} mit {{points}} Punkte. ","congratulationsNewLevel":"Herzlichen Glückwunsch, Sie haben ein neues Level erreicht!","congratulationsNewLevelDescription":"Ihre Agent wurden mit weiterentwickelt {{points}} Punkte, schauen Sie sich die an","statistics":"Statistiken"},"login":{"login":"Login","title":"Login zu Ihrem Konto","loggingIn":"Anmeldung läuft…","logout":"Abmelden","user":"Benutzer","loggedDrawerTitle":"Hallo, {{name}}!","userNameRequired":"Benutzername erforderlich","userName":"Benutzername","userNamePlaceholder":"Geben Sie den Benutzernamen ein","loginDrawerTitle":"Login","signupDrawerTitle":"Melden Sie sich an","newUserSignUp":"Neuer Benutzer?","signUp":"Melden Sie sich an!","alreadyHaveAnAccount":"Sie haben bereits ein Konto?","backToLogin":"Zurück zum Login","registrationDisabled":"Die Registrierung ist deaktiviert","contactAdmin":"Wenden Sie sich an den Administrator, um Zugriff anzufordern","userNameOrEmail":"Benutzername oder E-Mail","email":"E-Mail","emailFormatError":"Bitte geben Sie eine gültige E-Mail-Adresse ein","username":"Benutzername","usernameContainsReservedWord":"Der Benutzername enthält ein reserviertes Wort. Bitte wählen Sie ein anderes","usernameFormatError":"Der Benutzername muss mindestens 3 Zeichen lang sein und darf nur Buchstaben, Zahlen und _ enthalten.","otpCode":"Bestätigungscode","resendVerificationCode":"Code erneut senden","resentVerificationCode":"Bestätigungscode gesendet! ","welcomeTitle":"Willkommen zurück","welcomeDescription":"Geben Sie Ihren 4-stelligen Bestätigungscode ein, um zu Ihrem Konto fortzufahren","otpTitle":"Bestätigungscode eingeben","otpDescription":"Geben Sie den 4-stelligen Code ein, den Sie in Ihrem Konto generiert haben","otpStep1":"Klicken Sie auf die Schaltfläche unten, um Ihr Konto zu öffnen","otpStep2":"Generieren Sie einen 4-stelligen Bestätigungscode (5 Minuten gültig)","otpStep3":"Kehren Sie hierher zurück und geben Sie den Code ein","startOtpLogin":"Verifizierung starten","generateOtp":"Code generieren","otpTimer":"Code läuft in {{time}} ab","otpInvalidFormat":"Bitte geben Sie einen gültigen 4-stelligen Code ein","otpInvalid":"Ungültiger Bestätigungscode","otpExpired":"Der Bestätigungscode ist abgelaufen","otpError":"Fehler bei der Code-Validierung. Bitte versuchen Sie es erneut.","otpSuccess":"Anmeldung erfolgreich!","otpAttemptsExceeded":"Zu viele Versuche. Fordern Sie einen neuen Bestätigungscode an.","resendOtpIn":"Erneut senden in {{seconds}}s","resendOtpPrompt":"Nicht angekommen? Erneut senden in {{seconds}} s","resendOtpQuestion":"Nicht angekommen?","resendOtp":"Erneut senden","editEmail":"Bearbeiten","otpSentToPrefix":"Wir haben einen 4-stelligen Code gesendet an","otpCodeShort":"Code","loginBenefitLine1":"{{memoriName}} kann Ihnen den Chatverlauf zeigen, der jederzeit fortgesetzt werden kann.","loginBenefit":"{{memoriName}} kann Ihnen den Chatverlauf zeigen, der jederzeit fortgesetzt werden kann.","passwordlessHint":"Wir senden Ihnen einen 4-stelligen Code. Kein Passwort nötig.","defaultAgentName":"der Agent","sendOtp":"Code senden","password":"Passwort","newPassword":"Neues Passwort","confirmPassword":"Passwort bestätigen","currentPassword":"Aktuelles Passwort","passwordMatchingError":"Passwörter stimmen nicht überein.","passwordFormatError":"Das Passwort muss mindestens 8 Zeichen lang sein und mindestens eine Zahl, einen Großbuchstaben, einen Kleinbuchstaben und ein Symbol enthalten","pwdWeak":"Schwach","pwdAcceptable":"Akzeptabel","pwdStrong":"Stark","mustChangePassword":"Sie müssen Ihr Passwort ändern","passwordChange":"Kennwort ändern","emailChange":"E-Mail ändern","avatarChange":"Avatar ändern","avatarUploadSuccess":"Profilbild aktualisiert.","underage":"Das müssen Sie mindestens sein {{age}} Jahre alt, um sich anzumelden.","optional":"Optional","birthDate":"Geburtsdatum","birthDatePlaceholder":"TT.MM.JJJJ","birthDateHelper":"Wir fragen nur nach Ihrem Geburtsdatum, um Funktionen zu aktivieren oder zu deaktivieren, für die Altersbeschränkungen gelten","missingData":"Fehlende Informationen","missingDataHelper":"Wir wissen, dass dies etwas nervig ist, benötigen jedoch noch einige weitere Informationen, um Ihre Registrierung abzuschließen.","goToAccountToChangeYourPreferences":"Sie können Ihre Auswahl jederzeit auf Ihrer Kontoseite ändern.","deepThoughtExplaination":"Deep Thought ist eine erweiterte Funktion der KI, die es Ihnen ermöglicht, Ihre Gespräche voll auszuschöpfen, indem Sie sie verfolgen. ","tnCAndPPAcceptedHelper":"Seit Ihrer letzten Anmeldung haben sich die AGB und Datenschutzbestimmungen geändert. ","privacyLabel":"Ich habe die gelesen und akzeptiert","privacyAndCookiePolicy":"Datenschutz und Cookie-Richtlinie","and":"Und","termsOfService":"Nutzungsbedingungen","pAndCUAccepted":"Ich akzeptiere die Nutzungsbedingungen von Deep Thought","editAccount":"Konto bearbeiten","save":"Speichern","successfullyLoggedIn":"{{username}} hat sich erfolgreich angemeldet"},"chatLogs":{"llm":"LLM","model":"Modell","provider":"Anbieter","tokens":"Tokens","input":"Eingabe","output":"Ausgabe","cacheRead":"Cache lesen","cacheWrite":"Cache schreiben","duration":"Dauer","energy":"Energie","co2":"CO2","water":"Wasser","usageBadgesHint":"Klicke auf einen dieser Buttons, um mehr Informationen zu sehen","totalChatConsumptionTitle":"Gesamter Chat-Verbrauch","modelUsage":"Modellnutzung","environmentalImpact":"Umweltbelastung","impactComparisonUnavailable":"Indikativer Vergleich nicht verfuegbar.","impactComparisonEnergy":"Indikativer Vergleich: in etwa wie eine 10-W-LED-Lampe fuer {{duration}} eingeschaltet lassen.","impactComparisonCo2":"Indikativer Vergleich: etwa {{distance}} mit einem durchschnittlichen Benzinauto gefahren.","impactComparisonWater":"Indikativer Vergleich: etwa {{count}} Wassertropfen.","energyImpactDescription":"Dieser Wert schaetzt die elektrische Energie, die zur Erzeugung der Modellantwort benoetigt wird. Er hilft, Prompts, Modelle und Strategien zu vergleichen, auch wenn eine einzelne Nachricht nur sehr geringe Auswirkungen hat.","co2ImpactDescription":"CO2-Aequivalent steht fuer die geschaetzten Klimaauswirkungen der Nachricht. Die Umrechnung des Verbrauchs in Emissionen hilft, die Umweltauswirkungen einer KI-Antwort mit vergleichbaren Kennzahlen zu verstehen.","waterImpactDescription":"Dieser Indikator zeigt den geschaetzten Wasserfussabdruck der Nachrichtenverarbeitung. Er umfasst Wasser, das indirekt in Energie und Infrastruktur eingesetzt wird, die die Berechnung ermoeglichen.","approximateValuesTooltip":"Diese Werte sind ungefaehr.","anyMessage":"Jede Nachricht","atLeast":"Mindestens {{count}} Nachrichten","atLeast1":"Mindestens 1 Nachricht","atLeast2":"Mindestens 2 Nachrichten","atLeast3":"Mindestens 3 Nachrichten","atLeast5":"Mindestens 5 Nachrichten","atLeast10":"Mindestens 10 Nachrichten","atLeast15":"Mindestens 15 Nachrichten","atLeast20":"Mindestens 20 Nachrichten","customMinimumMessages":"Anpassen Sie die Anzahl der Nachrichten"},"success":"Erfolg","Error":"Fehler","internal server error":"Oupsie, tut mir leid... Auf dem Server ist ein Fehler aufgetreten","error":"Fehler","error.loading":"Fehler beim Laden des Inhalts.","error.generic":"Oupsie, tut mir leid ... etwas ist schief gelaufen.","error.serverNotResponding":"Wir führen Wartungsarbeiten durch oder veröffentlichen Updates. ","error.notFound":"Oupsie, wir haben die von Ihnen gesuchte Seite nicht gefunden.","error.goBackTo":"Sie können versuchen, dorthin zurückzukehren","error.reloadPage":"Laden Sie die Seite neu","error.tryAgain":"Versuchen Sie es erneut","error.unauthorized":"Es ist Ihnen nicht gestattet, diesen Inhalt anzuzeigen.","error.unprocessableEntity":"Fehler beim Verarbeiten der Anfrage. ","errors":{"TENANT_NOT_FOUND":"Mieter nicht gefunden","TENANT_REGISTRATION_DISABLED":"Die Registrierung auf dieser Plattform ist deaktiviert","TENANT_MISSING_NAME":"Mieter: Name fehlt","TENANT_MAX_USERS_REACHED":"Maximale Anzahl Benutzer erreicht","TENANT_MAX_ADMINS_REACHED":"Maximale Anzahl an Admin-Benutzern erreicht","TENANT_ALREADY_EXISTS":"Mieter existiert bereits","TENANT_MISSING_DESCRIPTION":"Mieter: Beschreibung fehlt","TENANT_CANT_SET_COMPLETION_PROVIDER":"Mandant: Abschlussanbieter kann nicht festgelegt werden","TENANT_INVALID_TYPE":"Mandant: ungültiger Typ","USER_NOT_CONFIRMED":"Benutzer noch nicht bestätigt","USER_NOT_FOUND":"Benutzer nicht gefunden","USER_OR_PASSWORD_INVALID":"Ungültiger Benutzer oder Passwort","USER_MUST_CHANGE_PASSWORD":"Sie müssen Ihr Passwort ändern","USER_MUST_ENTER_VERIFICATION_CODE":"Sie müssen den Bestätigungscode eingeben","USER_MISSING_TENANT":"Benutzer: Mieter fehlt","USER_MISSING_NAME":"Benutzer: Name fehlt","USER_MISSING_PASSWORD":"Benutzer: Passwort fehlt","USER_MISSING_EMAIL":"Benutzer: Fehlende E-Mail","USER_MISSING_VERIFICATION_CODE":"Benutzer: Fehlender Bestätigungscode","USER_NAME_ALREADY_USED":"Benutzername wird bereits verwendet","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"Das Passwort entspricht nicht den Sicherheitsregeln","USER_EMAIL_ALREADY_USED":"E-Mail wird bereits verwendet","USER_EMAIL_INVALID":"Ungültige E-Mail","USER_VERIFICATION_CODE_INVALID":"Ungültiger Bestätigungscode","USER_MISSING_NAME_OR_EMAIL":"Benutzername oder E-Mail fehlen","USER_NAME_INVALID":"Ungültiger Benutzername","USER_HAS_ONE_OR_MORE_MEMORI":"Der Benutzer verfügt über eine oder mehrere Erinnerungen","USER_MISSING_NEW_PASSWORD":"Benutzer: Neues Passwort fehlt","USER_NOTHING_TO_DO":"Nichts zu tun","USER_CANT_CREATE_MEMORI":"Benutzer darf Agent nicht erstellen","USER_MAX_MEMORI_REACHED":"Maximale Anzahl an Agent erreicht","USER_TOO_MANY_ATTEMPTS":"Zu viele Versuche","USER_MUST_ACCEPT_TNC_AND_PP":"Sie müssen die Allgemeinen Geschäftsbedingungen akzeptieren","USER_BIRTH_DATE_CANT_BE_CHANGED":"Das Geburtsdatum kann nicht geändert werden","USER_CANT_SET_COMPLETION_PROVIDER":"Benutzer: darf den Vervollständigungsanbieter nicht verwalten","USER_CANT_ENABLE_DEEP_THOUGHT":"Benutzer: nicht für die Verwaltung von Deep Thought aktiviert","USER_CANT_ENABLE_DCM_INTEGRATION":"Benutzer: nicht für die Verwaltung der DCM-Integration aktiviert","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"Benutzer: darf die Verkettung oder Expertengruppe nicht verwalten","USER_CREATION_BILLING_DENIED_PERMISSION":"Sie haben nicht genügend Credits, um einen Zwilling zu erstellen","USER_HAS_ONE_OR_MORE_COMPLETION_CONFIGS":"Der Benutzer verfügt über eine oder mehrere Abschlusskonfigurationen","USER_CANT_BE_DELETED":"Benutzer kann nicht gelöscht werden","USER_ORDER_BY_INVALID":"Ungültige Sortierreihenfolge","MEMORI_NOT_FOUND":"Erinnerungen nicht gefunden","MEMORI_NOT_ACCESSIBLE":"Agent nicht zugänglich","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Nur der Eigentümer kann das Tag oder die PIN ändern","SESSION_NOT_FOUND":"Sitzung nicht gefunden","SESSION_IS_NOT_ADMINISTRATIVE":"Nicht-administrative Sitzung","SESSION_EXPIRED":"Sitzung abgelaufen","speechMissingSession":"Sprache benötigt eine aktive Sitzung","speechInvalidSession":"Sitzung ungültig","speechTenantMismatch":"Sprache ist auf dieser Website nicht verfügbar","speechRateLimited":"Zu viele Sprachanfragen. Bitte kurz warten und erneut versuchen.","SESSION_OTP_NOT_FOUND":"Bestätigungscode nicht gefunden","SESSION_OTP_EXPIRED":"Der Bestätigungscode ist abgelaufen","SESSION_OTP_INVALID":"Ungültiger Bestätigungscode","SESSION_OTP_ATTEMPTS_EXCEEDED":"Zu viele Versuche. Fordern Sie einen neuen Bestätigungscode an.","MEMORI_MISSING_CONFIGURATION":"Zwilling: fehlende Konfiguration","MEMORI_CONFIGURATION_NOT_FOUND":"Zwilling: Konfiguration nicht gefunden","MEMORI_INVALID_PRIVACY_TYPE":"Agent: ungültiger Datenschutztyp","MEMORI_MISSING_PASSWORD":"Zwilling: Passwort fehlt","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Agent: Gesamtzahl ungültiger Wiederherstellungstokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Agent: Mindestanzahl ungültiger Wiederherstellungstokens","MEMORI_INVALID_VOICE_TYPE":"Zwilling: ungültiger Stimmtyp","MEMORI_MISSING_NAME":"Zwilling: fehlender Name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Zwilling: Fehlendes Passwort oder Wiederherstellungstoken","MEMORI_INVALID_ID":"Zwilling: ungültige ID","MEMORI_NAME_ALREADY_USED":"Zwillingsname wird bereits verwendet","MEMORI_INVALID_PIN":"Zwilling: Ungültige PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Zwilling: TAG- und PIN-Änderung erfordern separate Vorgänge","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Zwilling: Im öffentlichen Zustand ist kein Passwort erforderlich","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Für \\"Deep Thought\\" müssen Vervollständigungen aktiviert sein","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"Für die Expertengruppe müssen Vervollständigungen aktiviert sein","MEMORI_INVALID_COMPLETION_CONFIG":"Zwilling: Ungültige Abschlusskonfiguration","MEMORI_MACRO_FUNCTIONS_REQUIRES_COMPLETIONS":"Für die Makrofunktionen müssen Vervollständigungen aktiviert sein","MEMORI_BLOCKING_DATE_MISSING_OR_WRONG":"Zwilling: fehlende oder falsche Blockierungsdatum","MEMORI_LIST_FILTER_NOT_SPECIFIED":"Zwilling: fehlender Filter","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Übertragung: Zielbenutzer fehlt","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Übertragung: Ungültige Zielbenutzer-ID","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Übertragung: Ungültige Zielbenutzerdaten","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfer: nichts zu tun","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Speicher: Konfiguration kann nicht geändert werden","MEMORI_MISSING_NEW_PASSWORD":"Erinnerungen: Neues Passwort fehlt","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Für die Funktion ist ein Abonnement erforderlich","INTEGRATION_NOT_FOUND":"Integration nicht gefunden","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Ungültiges Datum aus Format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Ungültiges Datum zum Formatieren","MEMORI_SESSION_NOT_FOUND":"Sitzung nicht gefunden","MEMORI_SESSION_DOESNT_ACCEPT_MEDIA":"Sitzung akzeptiert keine Medien","INTEGRATION_INVALID_TYPE":"Ungültiger Integrationstyp","INTEGRATION_ALREADY_EXISTS":"Die Integration ist bereits vorhanden","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Nicht-öffentliche Erinnerungen können nicht integriert werden","INTEGRATION_MISSING_INVOCATION_TEXT":"Integration: fehlender Aufruftext","INTEGRATION_MISSING_DEVICE_EMAILS":"Integration: Fehlende Geräte-E-Mail","INTEGRATION_MEMORI_IS_EMPTY":"Leere Erinnerungen können nicht integriert werden","INTEGRATION_MISSING_PRIVACY_POLICY":"Integration: Datenschutzrichtlinie fehlt","INTEGRATION_MISSING_CATEGORY":"Integrationskategorie fehlt","INTEGRATION_MISSING_DESCRIPTION":"Fehlende Integrationsbeschreibung","INTEGRATION_INVALID_INVOCATION_TEXT":"Ungültiger Aufruftext","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home nicht mehr verfügbar","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Für den Upload ist eine mehrteilige Kodierung erforderlich","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Hochladen: Inhaltstypgrenze fehlt","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: Maximale Größe überschritten","UPLOAD_FILE_IS_EMPTY":"Hochladen: leere Datei","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Hochladen: Ungültiger Dateityp oder ungültige Signatur","UPLOAD_MISSING_FILE_NAME":"Hochladen: Dateiname fehlt","UPLOAD_INVALID_MEMORY_ID":"Hochladen: Ungültige Inhalts-ID","UPLOAD_MISSING_FILE_CONTENT":"Hochladen: Dateiinhalt fehlt","ASSET_NOT_FOUND":"Asset nicht gefunden","ASSET_NOT_ACCESSIBLE":"Asset nicht zugänglich","ASSET_MISSING_SESSION_ID":"Asset: Sitzungs-ID fehlt","ASSET_INVALID_FILE_NAME":"Asset: ungültiger Dateiname","ASSET_MALWARE_SCAN_THREATS_FOUND":"Asset: malware scan threats found","INVITATION_NOT_FOUND":"Einladung nicht gefunden","INVITATION_NOT_ACCESSIBLE":"Einladung nicht zugänglich","INVITATION_ALREADY_ACCEPTED":"Einladung bereits angenommen","INVITATION_ALREADY_REJECTED":"Einladung bereits abgelehnt","INVITATION_MISSING_DESTINATION_EMAIL":"Einladung: Ziel-E-Mail fehlt","INVITATION_DESTINATION_EMAIL_INVALID":"Einladung: Ziel-E-Mail-Adresse ungültig","INVITATION_MISSING_TAG":"Einladung: Tag fehlt","INVITATION_MISSING_PIN":"Einladung: PIN fehlt","INVITATION_INVALID_PIN":"Einladung: ungültige PIN","INVITATION_INVALID_TYPE":"Einladung: ungültiger Typ","INVITATION_MISSING_DESTINATION_NAME":"Einladung: Zielname fehlt","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Einladung: Tag und Pin können nicht geändert werden","INVITATION_CANT_BE_CHANGED":"Absicht: kann nicht geändert werden","ACTIONLOG_INVALID_USER_ID":"Ungültige Benutzer-ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Datum von: ungültiges Format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Datum bis: ungültiges Format","ACTIONLOG_INVALID_MEMORI_ID":"Ungültige Memori-ID","CONSUMPTIONLOG_INVALID_TYPE":"Ungültiger Protokolltyp","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Datum von: ungültiges Format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Datum bis: ungültiges Format","CONSUMPTIONLOG_INVALID_USER_ID":"Ungültige Benutzer-ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Ungültige Memori-ID","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Benachrichtigungen: Ungültiger Chat-Protokoll-Extraktionszeitraum","BROADCAST_NOT_ALLOWED":"Broadcast nicht erlaubt","INVALID_NOTIFICATION_TYPE":"Ungültiger Benachrichtigungstyp","NOTIFICATION_NOT_FOUND":"Benachrichtigung nicht gefunden","INVALID_NOTIFICATION_FILTER":"Ungültiger Benachrichtigungsfilter","INVALID_NOTIFICATION_PERIOD":"Ungültiger Benachrichtigungszeitraum","PROCESS_INVALID_TYPE":"Ungültiger Prozesstyp","PROCESS_ALREADY_RUNNING":"Prozess läuft bereits","PROCESS_NOT_FOUND":"Prozess nicht gefunden","IMPORTCSV_MISSING_ROWS":"CSV-Import: fehlende Zeilen","IMPORTCSV_MISSING_CSV":"CSV-Import: CSV fehlt","IMPORTCSV_MISSING_SEPARATOR":"CSV-Import: fehlendes Trennzeichen","IMPORTCSV_INVALID_SEPARATOR":"CSV-Import: Ungültiges Trennzeichen","IMPORTCSV_MISSING_HEADERS":"CSV-Import: fehlende Header","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV-Import: Titelvariantentrennzeichen fehlt","IMPORTCSV_INVALID_RECEIVER_ID":"CSV-Import: ungültige Empfänger-ID","IMPORTCSV_INVALID_MEDIA_LINK":"CSV-Import: Ungültiger Medienlink","IMPORTCSV_INVALID_LINK_TITLE_HANDLING":"CSV-Import: Ungültiger Linktitel","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"CSV-Import: Nicht erkennbare Zeichenkodierung","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"CSV-Import: Der Import in Secret Memories ist nicht möglich","IMPORTTXT_MISSING_ROWS":"TXT wird importiert: Zeilen fehlen","IMPORTTXT_INVALID_GRANULARITY":"TXT importieren: ungültige Granularität","IMPORTTXT_INVALID_RECEIVER_ID":"TXT importieren: ungültige Empfänger-ID","IMPORTTXT_INVALID_MEDIA_LINK":"TXT importieren: Ungültiger Medienlink","IMPORTTXT_INVALID_LINK_TITLE_HANDLING":"TXT importieren: ungültiger Linktitel","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"TXT-Import: Nicht erkennbare Zeichenkodierung","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"TXT-Import: Der Import in Secret Memories ist nicht möglich","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"TXT importieren: Importlimit überschritten","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"TXT importieren: Für den Import auf GPT-4 ist ein API-Schlüssel erforderlich","IMPORTTXT_IMPORT_REQUIRES_PAYING":"TXT importieren: Für den Import ist ein kostenpflichtiger Plan erforderlich","IMPORTTXT_BILLING_DENIED_PERMISSION":"TXT importieren: Sie haben nicht genügend Credits für den Vorgang","IMPORT_MISSING_ROWS":"Import: fehlende Zeilen","IMPORT_CANT_IMPORT_TO_SECRET_MEMORI":"Import: Der Import in Secret Memories ist nicht möglich","IMPORTMEMORI_INVALID_MEMORI_SPECS":"Import MEMORI: ungültige Agentenspezifikationen","IMPORT_MISSING_JSONL":"Import: JSONL fehlt","IMPORTMEMORI_INVALID_SPECS":"Import MEMORI: ungültige Spezifikationen","EXPORT_MISSING_PASSWORD":"Export: Passwort fehlt","EXPORTCSV_MISSING_CSV_SPECS":"CSV-Export: CSV-Spezifikationen fehlen","EXPORTCSV_MISSING_SEPARATOR":"CSV-Export: fehlendes Trennzeichen","EXPORTCSV_INVALID_SEPARATOR":"CSV-Export: Ungültiges Trennzeichen","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV-Export: fehlendes Titelvarianten-Trennzeichen","EXPORTCSV_MISSING_NEW_LINE_CHAR":"CSV-Export: Fehlendes Zeilenumbruchzeichen","EXPORTCSV_INVALID_NEW_LINE_CHAR":"CSV-Export: Ungültiges Zeilenumbruchzeichen","EXPORTCSV_MISSING_PASSWORD":"CSV-Export: Passwort fehlt","EXPORTJSONL_MISSING_JSONL_SPECS":"JSONL-Export: JSONL-Spezifikationen fehlen","EXPORTJSONL_MISSING_PLATFORM":"JSONL-Export: fehlende Plattform","EXPORTJSONL_INVALID_PLATFORM":"JSONL-Export: ungültige Plattform","EXPORTJSONL_MISSING_PASSWORD":"JSONL-Export: Passwort fehlt","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"JSONL-Export: Für den Export ist ein kostenpflichtiger Plan erforderlich","ANALYSIS_MISSING_QUERY":"Analyse: fehlende Abfrage","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analyse: Geheime Erinnerungen können nicht analysiert werden","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analyse: Passende Benutzeranfragen erfordern tiefes Denken","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Ausweiszuweisung: falsche oder fehlende Zugangsdaten","BADGE_ASSIGNMENT_MISSING_REF_ID":"Badge-Zuordnung: Referenz-ID fehlt","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Badge-Zuweisung: Ergebnis nicht gefunden","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Badge-Zuweisung: Fehlende Behauptungs-URL","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Badge-Zuweisung: Badge-URL fehlt","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Badge-Zuweisung: Aussteller-URL fehlt","BADGE_ASSIGNMENT_INVALID_URL":"Badge-Zuweisung: Ungültige URL","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Ausweiszuordnung: fehlender Empfänger","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Badge-Zuordnung: unbekannter Empfängertyp","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Ausweiszuordnung: Empfängeridentität fehlt","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Badge-Zuweisung: Empfänger-Hash-Typ fehlt","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Badge-Zuweisung: Empfänger-Hash-Typ unbekannt","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Badge-Zuordnung: Falsche Empfängeridentität","BADGE_NOT_FOUND":"Abzeichen nicht gefunden","OUTCOME_NO_DCM_CONFIGURED":"Ergebnis: kein DCM konfiguriert","OUTCOME_USER_BADGES_DISABLED":"Ergebnis: Benutzerausweise deaktiviert","COMPLETION_CONFIG_MISSING_NAME":"Vervollständigungskonfiguration: Name fehlt","COMPLETION_CONFIG_MISSING_PROVIDER":"Vervollständigungskonfiguration: fehlender Anbieter","COMPLETION_CONFIG_MISSING_ENDPOINT":"Abschlusskonfiguration: fehlender Endpunkt","COMPLETION_CONFIG_MISSING_API_KEY":"Vervollständigungskonfiguration: fehlender API-Schlüssel","COMPLETION_CONFIG_MISSING_MODEL":"Vervollständigungskonfiguration: fehlendes Modell","COMPLETION_CONFIG_NO_PURPOSE_SPECIFIED":"Vervollständigungskonfiguration: Es muss mindestens ein Vervollständigungstyp angegeben werden","COMPLETION_CONFIG_INVALID_NAME":"Vervollständigungskonfiguration: ungültiger Name","COMPLETION_CONFIG_INVALID_PURPOSE":"Vervollständigungskonfiguration: Ungültiger Vervollständigungstyp","COMPLETION_CONFIG_INVALID_ENDPOINT":"Abschlusskonfiguration: Ungültiger Endpunkt","COMPLETION_CONFIG_INCONSISTENT_ENDPOINT":"Abschlusskonfiguration: inkonsistenter Endpunkt","COMPLETION_CONFIG_INVALID_PROVIDER":"Vervollständigungskonfiguration: ungültiger Anbieter","COMPLETION_CONFIG_NOT_FOUND":"Vervollständigungskonfiguration: nicht gefunden","COMPLETION_CONFIG_NOT_ACCESSIBLE":"Vervollständigungskonfiguration: nicht zugänglich","COMPLETION_CONFIG_NAME_RESERVED":"Vervollständigungskonfiguration: Name reserviert","COMPLETION_CONFIG_NAME_ALREADY_EXISTS":"Vervollständigungskonfiguration: Name existiert bereits","COMPLETION_CONFIG_VISIBILITY_CHANGE_NOT_ALLOWED":"Vervollständigungskonfiguration: Änderung der Sichtbarkeit nicht zulässig","COMPLETION_CONFIG_MISSING_MANDATORY_PREFIX":"Vervollständigungskonfiguration: Pflichtpräfix fehlt","COMPLETION_CONFIG_VISIBILITY_NOT_PERMITTED":"Vervollständigungskonfiguration: Sichtbarkeit nicht erlaubt","COMPLETION_CONFIG_USE_AS_DEFAULT_NOT_PERMITTED":"Vervollständigungskonfiguration: Verwendung als Standard nicht erlaubt","COMPLETION_CONFIG_USE_AS_DEFAULT_REQUIRES_TENANT_VISIBILITY":"Vervollständigungskonfiguration: Verwendung als Standard erfordert Mandantensichtbarkeit","COMPLETION_CONFIG_CHARGEABLE_NOT_PERMITTED":"Vervollständigungskonfiguration: Chargeable nicht erlaubt","COMPLETION_CONFIG_INVALID_APPLY_TO":"Vervollständigungskonfiguration: Ungültige Anwendung","COMPLETION_CONFIG_APPLY_TO_TENANT_NOT_ALLOWED":"Vervollständigungskonfiguration: Anwendung auf Mandant nicht erlaubt","TRUSTED_APPLICATION_NOT_FOUND":"Vertrauenswürdige Anwendung nicht gefunden","TRUSTED_APPLICATION_NOT_ACCESSIBLE":"Vertrauenswürdige Anwendung nicht zugänglich","TRUSTED_APPLICATION_NAME_REQUIRED":"Vertrauenswürdige Anwendung: Name erforderlich","TRUSTED_APPLICATION_TOKEN_REQUIRED":"Vertrauenswürdige Anwendung: Token erforderlich","TRUSTED_APPLICATION_NAME_ALREADY_EXISTS":"Vertrauenswürdige Anwendung: Name existiert bereits","TRUSTED_APPLICATION_INVALID_TOKEN":"Vertrauenswürdige Anwendung: Ungültiger Token"}}');var XH={};XH=JSON.parse('{"yes":"Sí","no":"No","confirm":"Confirmar","apply":"Aplicar","cancel":"Cancelar","show":"Espectáculo","hide":"Esconder","send":"Enviar","scrollToLatest":"Ir al último mensaje","scrollToContinueReading":"Desplázate para seguir leyendo","close":"Cerrar","clearHistory":"Borrar chat","clearHistoryDone":"Chat borrado.","moreInfo":"Más información","back":"Volver","edit":"Editar","delete":"Borrar","loading":"Cargando","expand":"Expandir","collapse":"Contraer","expandable":{"expand":"Expandir"},"fullscreenEnter":"Entrar en pantalla completa","fullscreenExit":"Salir de pantalla completa","center":"Centro","bottom":"Abajo","hidden":"Oculto","day":"Día","all":"Todos","today":"Hoy","yesterday":"Ayer","last_7_days":"Últimos 7 días","last_30_days":"Últimos 30 días","placeholder":"Haz una pregunta","date":"Fecha de nacimiento","month":"Mes","copied":"¡Copiado!","missingData":"Información faltante","year":"Año","createdAt":"Fecha de creación","selected":"Seleccionado","page":"página","actions":"Comportamiento","next":"Próximo","previous":"Anterior","copy":"Copiar","copyRawCode":"Copiar código sin formato","feedback":"Comentarios","feedbackThankYou":"Gracias por tus comentarios.","copyFailed":"No se pudo copiar","functionCache":"Caché de funciones","copyToClipboard":"Copiar al portapapeles","showOriginalText":"Mostrar original","showTranslatedText":"Mostrar traducción","exactPosition":"Posición exacta","uncertain":"Incierto","question":"Pregunta","nothingFound":"No se encontró nada","venue":"Evento","searchVenue":"Buscar un lugar…","privacyPolicy":"Política de privacidad","popularLanguages":"Populares","allLanguages":"Todos los idiomas","memoriBlockedTitle":"Obstruido","memoriBlockedUntil":"Agent bloqueado hasta {{date}}","memoriBlockedAnon":"Actualmente \\"{{name}}\\"No puedo responder, vuelve aquí. {{date}}","memoriBlockedReasonExceedChats":"porque ha superado el umbral mensual de chats permitidos.","memoriBlockedGiverHelper":"Aún podrás administrarlo como administrador, pero otros usuarios no podrán interactuar con él.","generatedByAI":"La respuesta generada por IA, ocasionalmente puede generar información incorrecta","aiGeneratedNote":"El agente puede hacer errores. Asegúrate de verificar información importante.","reasoning":"Pensamiento...","thinking":"Pensando","thought":"Pensamiento","thoughtFor":"Pensado durante {{count}} s","whyThisAnswer":"De dónde viene esta respuesta","whyThisAnswerHelper":"Esta respuesta fue generada automáticamente por una inteligencia artificial basada en estos contenidos verificados.","whyThisAnswerDescription":"Los contenidos de la base de conocimiento que el agente consultó para responder.","whyThisAnswerYouAsked":"Has preguntado","whyThisAnswerUserAsked":"Pregunta del usuario","whyThisAnswerAgentReplied":"El agente ha respondido","whyThisAnswerShowFull":"Mostrar la respuesta completa","whyThisAnswerContentsUsed":"Contenidos usados","whyThisAnswerOpen":"Abrir","whyThisAnswerDisclaimer":"La respuesta la ha escrito el agente a partir de estos contenidos: puede contener errores o reformulaciones. Verifica la información importante en la fuente.","whyThisAnswerEmptyTitle":"Ningún contenido consultado","whyThisAnswerEmptyDescription":"Para esta pregunta el agente no encontró coincidencias en la base de conocimiento: ha respondido solo según sus instrucciones.","whyThisAnswerEmptyAuthorDescription":"La pregunta no produjo coincidencias. Si debería tenerlas, añade un contenido que la cubra.","whyThisAnswerAddContent":"Añadir a la base de conocimiento","whyThisAnswerConfidenceHigh":"Coincidencia alta","whyThisAnswerConfidenceMedium":"Coincidencia parcial","whyThisAnswerConfidenceLow":"Coincidencia débil","whyThisAnswerTypeQuestion":"Pregunta y respuesta","whyThisAnswerTypeDocument":"Documento","whyThisAnswerTypeWebsite":"Sitio web","whyThisAnswerTypeStory":"Relato","whyThisAnswerSourcesCount_one":"{{count}} fuente","whyThisAnswerSourcesCount_other":"{{count}} fuentes","whyThisAnswerNoSources":"Ninguna fuente","receiverLabel":"Asignado a","completionsEnabled":"La IA avanzada puede responder con respuestas generadas automáticamente que a veces pueden contener información incorrecta.","completionProviderDown":"Este Agent está integrado con una IA generativa de {{provider}}, pero actualmente no está disponible. ","completionProviderMajorOutage":"Este Agent está integrado con una IA generativa de {{provider}}, pero al momento no está disponible. No será posible utilizar esta funcionalidad hasta que el servicio se restaure.","completionProviderPartialOutage":"Este Agent está integrado con una IA generativa de {{provider}}, pero está experimentando interrupciones parciales. Algunas funcionalidades pueden no estar disponibles o funcionar de manera no óptima.","completionProviderDegraded":"Este Agent está integrado con una IA generativa de {{provider}}, pero está funcionando más lentamente de lo normal. Las respuestas pueden tomar más tiempo o ser menos precisas.","completionProviderFallbackName":"un proveedor externo","completionProviderCheckStatusPage":"Comprobar página de estado","boardOfExperts":"junta de expertos","birthDate":"Fecha de nacimiento","birthDateHelper":"Solicitamos tu fecha de nacimiento únicamente para habilitar o deshabilitar funcionalidades que tienen restricciones de edad.","underage":"Debes ser al menos {{age}} años para inscribirse.","underageTwinSession":"Debes ser al menos {{age}} años para interactuar con este gemelo.","errorFetchingSession":"Error durante el cargamento de la sesión","errorGettingReferralURL":"Error durante el cargamento del référent","errorReopeningSession":"Error durante el re-abrir la sesión","sessionExpiredReopening":"Sesión expirada, reabriendo sesión","ageVerification":"Verificación de edad","ageVerificationText":"Para interactuar con este Gemelo, debes tener al menos {{minAge}} años.","ageVerificationSuccess":"Edad verificada con éxito.","nsfw":"NSFW: Este gemelo contiene contenido para adultos","deepThought":"pensamiento profundo","deepThoughtWhatIs":"¿Qué es Deep Thought?","deepThoughtHelper":"Deep Thought es una característica avanzada de la IA que te permitirá explotar al máximo tus conversaciones al realizar un seguimiento de ellas. ","deepThoughtDisclaimerTitle":"Pensamiento profundo habilitado","deepThoughtDisclaimer":"Deep Thought es una característica avanzada de la IA que te permitirá explotar al máximo tus conversaciones al realizar un seguimiento de ellas. ","deepThoughtPreDisclaimerUnlogged":"Inicie sesión para habilitar Pensamiento profundo.","deepThoughtPreDisclaimerNotAllowed":"Deep Thought está deshabilitado porque usted no dio su consentimiento para su uso; puede cambiar esto en cualquier momento en la configuración de su cuenta.","notEnoughCredits":"El autor de este Gemelo no tiene suficientes créditos para responder a tu pregunta.","creditsCheckFailed":"No ha sido posible verificar los créditos de este agente. Inténtalo más tarde o contacta con su autor.","confirmDialog":{"title":"¿Quieres salir de esta página?","message":"Los cambios que has realizado se perderán."},"knownFacts":{"title":"Hechos conocidos","description":"Lo que {{memoriName}} recuerda de ti. Puedes eliminar cada entrada.","type":"Tipo","typeShortTerm":"Corto plazo","typeLongTerm":"Largo plazo","typeHelper":"Tipos:\\n","text":"Texto","searchPlaceholder":"Buscar entre los hechos","select":"Seleccionar","loadMore":"Cargar más","factsCount_one":"{{count}} hecho","factsCount_other":"{{count}} hechos","shownOfTotal":"Mostrados {{shown}} de {{total}}","emptyTitle":"Todavía no hay hechos","emptyDescription":"A medida que habláis, el agente anota aquí lo que aprende sobre ti. Podrás eliminarlo en cualquier momento.","deleteLabel":"Eliminar este hecho","deleteSuccess":"Hecho conocido eliminado","deleteConfirmTitle":"Eliminar hecho conocido","deleteConfirmMessage":"¿Está seguro de que desea eliminar este hecho conocido?","deleteSelectedConfirmTitle":"Eliminar hechos conocidos seleccionados","deleteSelectedConfirmMessage":"¿Está seguro de que desea eliminar los hechos conocidos seleccionados?","selected_one":"{{count}} hecho seleccionado","selected_other":"{{count}} hechos seleccionados","selectedRows_one":"{{count}} fila seleccionada","selectedRows_other":"{{count}} filas seleccionadas"},"auth":{"title":"Autenticación","description":"Este agente está protegido. Introduce la contraseña para continuar.","useRecoveryTokens":"Utilice tokens de recuperación","tokens":"Fichas","addToken":"Agregar token","usePassword":"Usar contraseña","passwordRequired":"Contraseña obligatoria","invalidCredentials":"Credenciales no válidas","atLeast":"Al menos"},"widget":{"instruct":"Instruir","test":"Probar","sound":"Sonido","soundOff":"Sonido desactivado","position":"Preferencias de posición","settings":"Ajustes","share":"Compartir","shareChat":"Compartir chat","sendOnKeypress":"Presiona Enter para enviar","sendOnClick":"Haz clic en Enviar","boardOfExperts":"Panel de expertos","showExpertsInTheBoard":"Mostrar expertos en este panel","expertsInTheBoard":"Expertos en este panel","goToIntegrationsToCustomizeAvatar":"Para personalizar el avatar, ve a Compartir y personaliza la página pública","chatAssistantStatus":"Activa • Responde en pocos segundos","agentStatusListening":"escuchando","agentStatusSpeaking":"hablando","agentStatusProcessing":"procesando","shareLocation":"Compartir ubicación","shareLocationHint":"Recibe respuestas adaptadas a dónde estás","shareLocationAria":"Compartir ubicación con el asistente","knownFactsHint":"Lo que recuerdo sobre ti","aiConsumption":"Consumo de IA","editPositionAria":"Editar ubicación","positionResolving":"Obteniendo dirección…","geocodingFailed":"No se pudo obtener la dirección. Inténtalo de nuevo o busca manualmente.","positionUnavailableManual":"Ubicación no disponible. Introdúcela manualmente.","positionSharingEnabled":"Ubicación compartida.","headerHistory":"Historial","headerProfile":"Perfil","headerLogin":"Iniciar sesión","expandToImmersive":"Expandir para vista inmersiva","moreActions":"Más acciones","mobileSession":{"session":"Sesión","sessionInfo":"Información de la sesión","copyLinkOrDownload":"Copiar enlace o descargar","currentlyOff":"Actualmente desactivado","whatIKnowAboutYou":"Detalles de la información compartida entre usted y {{memoriName}}","locationTracking":"Seguimiento de ubicación","locationStatus":"Estado","useCurrentPosition":"Usar ubicación actual","disableLocationSharing":"Desactivar uso compartido de ubicación","openKnownFacts":"Abrir todos los hechos conocidos","knownFactsMessages":"{{count}} mensajes en la sesión actual"}},"exportChatHistory":{"exportPDF":"Exportar chat como PDF","exporting":"Exportando...","empty":"No hay historial de chat para exportar","pdfNotSupported":"La exportación PDF no es compatible con este navegador","success":"Chat exportado a PDF exitosamente","error":"Error al exportar el chat a PDF. Por favor, inténtalo de nuevo."},"write_and_speak":{"micButtonPopover":"Haga clic en el botón para hablar","micButtonPopoverListening":"Haga clic en el botón para dejar de hablar.","stopRecording":"Detener grabación","sendRecording":"Enviar mensaje de voz","recordingInProgress":"Grabación en curso","pageInstructExplanation":"Para enseñarme cosas nuevas, haga clic en el botón INSTRUIRME para comenzar.","pageTryMeExplanation":"Para empezar a conversar conmigo haga clic en el botón INICIO","pagePrivacyExplanation":"Las conversaciones son visibles por el autor del agente","pagePrivacyExplanationList":{"allConversations":"Todas las conversaciones con este agente son visibles por el autor del agente","anonymousUser":"Para usuarios anónimos: el autor verá el contenido de la conversación y su dirección IP","registeredUser":"Para usuarios registrados: el autor verá el contenido de la conversación y su nombre de usuario","contentAndUsername":"El autor puede ver el contenido, tu nombre de usuario y tu dirección IP","contentAndIpAddress":"El autor puede ver el contenido y tu dirección IP","authorUsesInfo":"El autor utiliza estas informaciones para mejorar las funciones del agente y para ofrecerte un mejor servicio."},"instructButton":"INSTRUÍME","aiDisclaimer":"El agente puede cometer errores. Por favor, verifica las respuestas.","downloadChat":"Descargar chat","tryMeButton":"COMENZAR","resumeButton":"CONTINUAR","chatHistory":"Historial de chat","chatHistoryDescription":"Mostrar el historial de chat con este agente","loadingChatHistory":"Cargando historial de chat...","noChatHistoryAvailable":"No hay historial de chat disponible","noResultsFound":"No se encontraron resultados para \\"{{searchText}}\\"","searchInChatHistory":"Buscar en las conversaciones","filters":"Filtros","latestFirst":"Más recientes primero","oldestFirst":"Más antiguos primero","exportChat":"Exportar Chat","conversationStartedLabel":"Conversación iniciada","settingsHeaderLabel":"Configure aquí si desea configurar la memoria como voz continua y cambie los segundos de silencio si desea personalizarlos.","continuousSpeechLabel":"discurso continuo","continuousSpeechDisabled":"Discurso continuo deshabilitado porque el agente está en modo silencioso","holdToSpeak":"Mantenga para hablar","releaseToEndListening":"Suelte para finalizar la escucha","pressAndHoldToSpeak":"Mantenga presionado para hablar","microphoneMode":"Modo micrófono","hideEmissionsLabel":"Ocultar texto emitido por el Agent","showMessageConsumptionLabel":"Mostrar consumo por mensaje","secondsLabel":"Establecer segundos","controlsPosition":"Posición de los controles","tryMeHeaderLabel":"INTENTAR","unknownPosition":"Posición desconocida","fieldPlace":"Escribe el lugar (por ejemplo, \'Milano\')","showMapLinkFor":"Mostrar la posición en el mapa.","useMyPosition":"Usa mi posición","myPosition":"Tu posición","updatingPosition":"Actualizando posición...","placeNotFound":"¡Lugar no encontrado!","requirePosition":"Inserte su posición antes de comenzar","requirePositionHelp":"para hablar con {{name}} usted tiene que decidir si proporciona su puesto o no. ","dontWantToProvidePosition":"Continuar sin ubicación","requireLoginHelp":"Para hablar con {{name}} primero debes iniciar sesión con tu cuenta.","skipLocationTitle":"No se guardará ninguna ubicación en el mapa.","locationSaved":"Tu ubicación se guardó.","locationSavedWithPlace":"Tu ubicación se guardó: {{place}}","locationSkippedConfirm":"Continuarás sin compartir tu ubicación.","placeSelected":"Lugar seleccionado: {{place}}","locationPermissionDenied":"Se denegó el acceso a la ubicación. Permítela en la configuración del navegador o elige un lugar en el mapa.","locationUnavailable":"No se pudo determinar tu posición. Inténtalo de nuevo o busca un lugar.","locationRequestTimedOut":"La solicitud de ubicación expiró. Inténtalo de nuevo o busca un lugar.","locationErrorGeneric":"Algo salió mal al obtener tu ubicación.","attachmentsLabel":"Enriquece tu mensaje","image":"imagen","images":"imagenes","file":"archivo","files":"archivos","function":"función","functions":"funciones","iWantToTalkToIn":"quiero hablar con {{name}} en","chatLanguageLabel":"Elige el idioma de la conversación","chatResumed":"Conversación reanudada correctamente.","message":"mensaje","messages":"mensajes","downloadThisConversation":"Descargar esta conversación","downloadAllConversations":"Descargar todas las conversaciones","conversationsCount_one":"{{count}} conversación","conversationsCount_other":"{{count}} conversaciones","shownOfTotal":"Mostradas {{shown}} de {{total}}","loadMore":"Cargar más","backToConversationList":"Volver a la lista de conversaciones","thisWeek":"Esta semana","page":"Página {{current}} de {{total}}"},"chatResume":{"resume":"Reanudar la conversación"},"artifact":{"close":"Cerrar","size":"Tamaño","updated":"actualizado","updateFailed":"No se pudo aplicar la actualización","updateFailedHint":"El parche no coincide con el contenido actual. Pide reescribir el artifact.","generated":"Generado","download":"Descargar","print":"Imprimir","external":"Abrir en una nueva ventana","type":"Tipo","fullscreen":"Pantalla completa","exitFullscreen":"Salir de pantalla completa","copy":"Copiar","generatedAt":"Generado el","open":"Abrir","code":"Código","source":"Fuente","preview":"Vista previa","resizeHandle":"Redimensionar el panel de artifact","copied":"¡Copiado!","error":"Error","generatingPdf":"Generando PDF...","copying":"Copiando...","moreCopyOptions":"Más opciones de copia","copyAs":"Copiar como","downloadAsMarkdown":"Descargar como Markdown","downloadRawMarkdownText":"Descargar texto markdown sin formato","downloadAsPdf":"Descargar como PDF","exportAsPdfDocument":"Exportar como documento PDF","downloadAsHtml":"Descargar como HTML","downloadFormattedHtml":"Descargar HTML formateado","viewMode":"Modo Vista","codeMode":"Modo Código","refresh":"Actualizar","share":"Compartir","downloadAsJson":"Descargar como JSON","downloadJsonData":"Descargar datos JSON","downloadAsPng":"Descargar como PNG","downloadPngImage":"Descargar imagen PNG","downloadAsJpeg":"Descargar como JPEG","downloadJpegImage":"Descargar imagen JPEG","downloadAsGif":"Descargar como GIF","downloadGifImage":"Descargar imagen GIF","downloadAsWebp":"Descargar como WebP","downloadWebpImage":"Descargar imagen WebP","copyAsSvg":"Copiar como SVG","copySvgSourceCode":"Copiar código fuente SVG","copyAsPlainText":"Copiar como texto plano","copyAsText":"Copiar como texto","copyAsLanguage":"Copiar como {{language}}","copyLanguageCode":"Copiar código {{language}}","copyWithoutSyntaxHighlighting":"Copiar sin resaltado de sintaxis","copyTextContent":"Copiar contenido de texto","pdfExportNotSupported":"La exportación PDF no es compatible con este navegador","popupBlocked":"¡Popup bloqueado! Por favor, habilita los popups para imprimir.","safariPdfInstructions":"Exportación PDF abierta en nueva ventana. Por favor, usa Cmd+P (Mac) o Ctrl+P (Windows) para imprimir y guardar como PDF."},"upload":{"loginRequired":"Connexion requise","pastedText":"texto-pegado","uploadNotification":"Échec del téléchargement","loginRequiredDescription":"Veuillez vous connecter pour télécharger des images","uploadFiles":"Télécharger des fichiers (drag and drop)","uploadFilesOrImages":"Subir archivos o imágenes","uploadFilesWithShortcut":"{{shortcut}}+O para abrir el selector de archivos","uploadImages":"Télécharger des images","titleImage":"Añadir un título a la imagen","uploadDocuments":"Télécharger des documents","apiClientNotConfigured":"API client non configuré correctement pour le téléchargement de médias","fileReadingFailed":"Échec de la lecture du fichier","uploadFailed":"Échec du téléchargement","uploadSuccess":"Téléchargement réussi","uploadSuccessDescription":"Le fichier a été téléchargé avec succès","replace":"Remplacer","maxImagesReached":"Vous pouvez télécharger jusqu\'à {{max}} images","remaining":"restant","maxReached":"Limite atteinte","dragAndDropFiles":"Arrastre y suelte los archivos aquí para agregarlos a la chat","contextSizeExceedsLimit":"El tamaño del contexto supera el límite. Intenta reducir el número de archivos o el contenido de la conversación.","filesNotAddedMaxAllowed":"{{count}} archivo(s) no añadido(s) (máximo {{max}} archivos permitidos).","documentsNotAddedMaxAllowed":"{{count}} documento(s) no añadido(s) (máximo {{max}} archivos permitidos).","imagesNotAddedMaxAllowed":"{{count}} imagen(es) no añadida(s) (máximo {{max}} archivos permitidos).","documentsNotAddedContextSize":"{{count}} documento(s) no añadido(s) (límite de tamaño de contexto).","partialAssetUploadWarning":"No se pudieron cargar algunos enlaces del archivo, pero el documento se agregó igualmente.","anonymousRetentionNotice":"Nota: los archivos cargados se conservan durante un máximo de 24 horas."},"media":{"title":"Título","editAttributes":"Editar atributos de medios","uploadMimeTypeNotAllowed":"El tipo de archivo no está permitido.","uploadSizeLimitMessage":"El tamaño subido es demasiado grande (máx. {{size}}MEGABYTE)","uploadWrongResolutionMessage":"La resolución debe ser {{width}}incógnita{{height}} píxel","memoriNameAlreadyUsed":"Ya tienes un gemelo con este nombre.","uploadHelperImages":"Sube un archivo con extensión png, jpg, jpeg o gif, y que tenga como máximo un tamaño de {{size}}MEGABYTE","uploadHelper":"Cargue un archivo que tenga como máximo un tamaño de {{size}}MEGABYTE","uploadError":"Error al subir","square":"cuadrado","scaleRatio":"Relación de escala","addMediaLabel":"Agregar un medio","insertThisMediaMsg":"Inserte estos medios","mediaUploadMessage":"Haga clic para cargar un nuevo medio","addLinkLabel":"Agregar un enlace","linkKey":"URL","linkValue":"Título del enlace","insertThisLink":"Insertar un enlace a {{url}} con titulo {{title}}"},"gamification":{"level":"Nivel","points":"agujas","memoriReachedLevel":"se volvió más evolucionado y alcanzó el nivel","levelGoToStatistics":"{{Agent}} esta al nivel {{level}} con {{points}} agujas. ","congratulationsNewLevel":"¡Felicitaciones, has alcanzado un nuevo nivel!","congratulationsNewLevelDescription":"Tu Agent se volvió más evolucionado con {{points}} puntos, mira el","statistics":"estadística"},"login":{"login":"Acceso","title":"Iniciar sesión en tu cuenta","loggingIn":"Iniciando sesión…","logout":"Cerrar sesión","user":"Usuario","loggedDrawerTitle":"Hola, {{name}}!","loginDrawerTitle":"Acceso","userNameRequired":"Nombre de usuario requerido","userName":"Nombre de usuario","userNamePlaceholder":"Ingrese el nombre de usuario","signupDrawerTitle":"Inscribirse","newUserSignUp":"¿Nuevo usuario?","signUp":"¡Inscribirse!","alreadyHaveAnAccount":"¿Ya tienes una cuenta?","backToLogin":"Volver a iniciar sesión","registrationDisabled":"El registro está deshabilitado","contactAdmin":"Póngase en contacto con el administrador para solicitar acceso","userNameOrEmail":"Nombre de usuario o correo electrónico","email":"Correo electrónico","emailFormatError":"Por favor, inserte un correo electrónico válido","username":"Nombre de usuario","usernameContainsReservedWord":"El nombre de usuario contiene una palabra reservada, elija otra","usernameFormatError":"El nombre de usuario debe tener al menos 3 caracteres y contener solo letras, números y _","otpCode":"Código de verificación","resendVerificationCode":"Reenviar código","resentVerificationCode":"¡Código de confirmación enviado! ","welcomeTitle":"Bienvenido de nuevo","welcomeDescription":"Ingresa tu código de verificación de 4 dígitos para continuar a tu cuenta","otpTitle":"Ingresa el código de verificación","otpDescription":"Ingresa el código de 4 dígitos que generaste en tu cuenta","otpStep1":"Haz clic en el botón de abajo para abrir tu cuenta","otpStep2":"Genera un código de verificación de 4 dígitos (válido por 5 minutos)","otpStep3":"Regresa aquí e ingresa el código","startOtpLogin":"Iniciar verificación","generateOtp":"Generar código","otpTimer":"El código expira en {{time}}","otpInvalidFormat":"Por favor ingresa un código válido de 4 dígitos","otpInvalid":"Código de verificación inválido","otpError":"Error al validar el código. Por favor intenta de nuevo.","otpSuccess":"¡Inicio de sesión exitoso!","otpEmailTitle":"Ingresa tu email","otpEmailDescription":"Ingresa tu dirección de email para recibir un código de verificación","otpCodeDescription":"Ingresa el código de 4 dígitos enviado a {{email}}","emailPlaceholder":"Ingresa tu email","sendOtp":"Enviar el código","resendOtp":"Reenviar","resendOtpIn":"Reenviar en {{seconds}}s","resendOtpPrompt":"¿No llegó? Reenviar en {{seconds}} s","resendOtpQuestion":"¿No llegó?","resending":"Reenviando...","backToEmail":"Volver al email","editEmail":"Editar","otpSentToPrefix":"Hemos enviado un código de 4 dígitos a","otpCodeShort":"Código","loginBenefitLine1":"{{memoriName}} puede mostrarte el historial de chat, que se puede reanudar en cualquier momento.","loginBenefit":"{{memoriName}} puede mostrarte el historial de chat, que se puede reanudar en cualquier momento.","passwordlessHint":"Te enviamos un código de 4 dígitos. Sin contraseña que recordar.","defaultAgentName":"el agente","otpSent":"¡Código de verificación enviado!","otpResent":"¡Código reenviado exitosamente!","otpSendError":"Error al enviar el código. Por favor intenta de nuevo.","emailRequired":"Email requerido","emailInvalid":"Por favor ingresa una dirección de email válida","otpNotFound":"Código de verificación no encontrado","otpExpired":"El código de verificación ha expirado","otpMissing":"El código de verificación es requerido","otpAttemptsExceeded":"Demasiados intentos. Solicita un nuevo código de verificación.","otpSuccessMessage":"¡Verificación exitosa! Redirigiendo...","otpSuccessDescription":"Tu cuenta ha sido verificada exitosamente. Serás redirigido en breve.","otpHelp":"Ingresa el código de 4 dígitos de tu email","emailHelp":"Te enviaremos un código de verificación","userFetchError":"Error al cargar los datos del usuario. Por favor intenta de nuevo.","otpStep1Title":"Ingresa Email","otpStep2Title":"Revisa Email","otpStep3Title":"Ingresa Código","featureFast":"Rápido","featureSecure":"Seguro","featureMobile":"Móvil","password":"Contraseña","newPassword":"Nueva contraseña","confirmPassword":"confirmar Contraseña","currentPassword":"Contraseña actual","passwordMatchingError":"Las contraseñas no coinciden.","passwordFormatError":"La contraseña debe tener al menos 8 caracteres y contener al menos un número, una letra mayúscula, una letra minúscula y un símbolo.","pwdWeak":"Débil","pwdAcceptable":"Aceptable","pwdStrong":"Fuerte","mustChangePassword":"Debes cambiar tu contraseña","passwordChange":"Cambiar la contraseña","emailChange":"Cambiar correo electrónico","avatarChange":"Cambiar avatar","avatarUploadSuccess":"Foto de perfil actualizada.","underage":"Debes ser al menos {{age}} años para inscribirse.","optional":"Opcional","birthDate":"Fecha de nacimiento","birthDatePlaceholder":"DD/MM/AAAA","birthDateHelper":"Solicitamos tu fecha de nacimiento únicamente para habilitar o deshabilitar funcionalidades que tienen restricciones de edad.","missingData":"Información faltante","missingDataHelper":"Sabemos que esto es un poco molesto, pero necesitamos más información para completar tu registro.","goToAccountToChangeYourPreferences":"Puede cambiar su elección en cualquier momento desde la página de su Cuenta.","deepThoughtExplaination":"Deep Thought es una característica avanzada de la IA que te permitirá explotar al máximo tus conversaciones al realizar un seguimiento de ellas. ","tnCAndPPAcceptedHelper":"Desde su último inicio de sesión, los Términos y condiciones y la Política de privacidad han cambiado. ","privacyLabel":"He leído y acepto el","privacyAndCookiePolicy":"Política de privacidad y cookies","and":"y","termsOfService":"Términos de servicio","pAndCUAccepted":"Acepto los términos de servicio sobre Deep Thought","editAccount":"Editar cuenta","save":"Ahorrar","successfullyLoggedIn":"{{username}} ha iniciado sesión correctamente"},"chatLogs":{"llm":"LLM","model":"Modelo","provider":"Proveedor","tokens":"Tokens","input":"Entrada","output":"Salida","cacheRead":"Lectura de caché","cacheWrite":"Escritura de caché","duration":"Duración","energy":"Energía","co2":"CO2","water":"Agua","usageBadgesHint":"Haz clic en uno de estos botones para ver más información","totalChatConsumptionTitle":"Consumo Total del Chat","modelUsage":"Uso del modelo","environmentalImpact":"Impacto ambiental","impactComparisonUnavailable":"Comparacion indicativa no disponible.","impactComparisonEnergy":"Comparacion indicativa: aproximadamente como mantener encendida una bombilla LED de 10 W durante {{duration}}.","impactComparisonCo2":"Comparacion indicativa: aproximadamente {{distance}} recorridos en un coche de gasolina promedio.","impactComparisonWater":"Comparacion indicativa: aproximadamente {{count}} gotas de agua.","energyImpactDescription":"Este valor estima la energia electrica necesaria para generar la respuesta del modelo. Sirve para comparar prompts, modelos y estrategias incluso cuando un solo mensaje tiene un impacto muy pequeno.","co2ImpactDescription":"El CO2 equivalente representa el impacto climatico estimado del mensaje. Traducir el consumo a emisiones ayuda a entender cuanto pesa una respuesta de IA en el medioambiente con metricas comparables.","waterImpactDescription":"Este indicador muestra la huella hidrica estimada asociada al procesamiento del mensaje. Incluye el agua utilizada indirectamente en la energia y en la infraestructura que soporta el calculo.","approximateValuesTooltip":"Estos valores son aproximados.","anyMessage":"Cualquier mensaje","atLeast":"Al menos {{count}} mensajes","atLeast1":"Al menos 1 mensaje","atLeast2":"Al menos 2 mensajes","atLeast3":"Al menos 3 mensajes","atLeast5":"Al menos 5 mensajes","atLeast10":"Al menos 10 mensajes","atLeast15":"Al menos 15 mensajes","atLeast20":"Al menos 20 mensajes","customMinimumMessages":"Personalizar el número de mensajes"},"success":"Éxito","Error":"Error","internal server error":"Oupsie, lo siento... Algo salió mal en el servidor.","error":"Error","error.loading":"Error al cargar contenido.","error.generic":"Oupsie, lo siento... algo salió mal.","error.serverNotResponding":"Estamos realizando mantenimiento o lanzando actualizaciones. ","error.notFound":"Oupsie, no encontramos la página que buscabas.","error.goBackTo":"Puedes intentar volver al","error.reloadPage":"recargar la pagina","error.tryAgain":"Intentar otra vez","error.unauthorized":"No estás autorizado a ver este contenido.","error.unprocessableEntity":"Error al procesar la solicitud. ","errors":{"TENANT_NOT_FOUND":"Inquilino no encontrado","TENANT_REGISTRATION_DISABLED":"El registro en esta plataforma está deshabilitado","TENANT_MISSING_NAME":"Inquilino: falta el nombre","TENANT_MAX_USERS_REACHED":"Número máximo de usuarios alcanzado","TENANT_MAX_ADMINS_REACHED":"Número máximo de usuarios administradores alcanzado","TENANT_ALREADY_EXISTS":"El inquilino ya existe","TENANT_MISSING_DESCRIPTION":"Inquilino: falta descripción","TENANT_CANT_SET_COMPLETION_PROVIDER":"Inquilino: no se puede configurar el proveedor de finalización","TENANT_INVALID_TYPE":"Inquilino: tipo no válido","USER_NOT_CONFIRMED":"Usuario aún no confirmado","USER_NOT_FOUND":"Usuario no encontrado","USER_OR_PASSWORD_INVALID":"Usuario o contraseña no válidos","USER_MUST_CHANGE_PASSWORD":"Debes cambiar tu contraseña","USER_MUST_ENTER_VERIFICATION_CODE":"Debes ingresar el código de verificación","USER_MISSING_TENANT":"Usuario: inquilino desaparecido","USER_MISSING_NAME":"Usuario: falta el nombre","USER_MISSING_PASSWORD":"Usuario: falta contraseña","USER_MISSING_EMAIL":"Usuario: Falta correo electrónico","USER_MISSING_VERIFICATION_CODE":"Usuario: Falta el código de verificación","USER_NAME_ALREADY_USED":"Nombre de usuario ya en uso","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"La contraseña no cumple con las reglas de seguridad.","USER_EMAIL_ALREADY_USED":"Correo electrónico ya en uso","USER_EMAIL_INVALID":"Correo electrónico no válido","USER_VERIFICATION_CODE_INVALID":"Código de verificación no válido","USER_MISSING_NAME_OR_EMAIL":"Falta nombre de usuario o correo electrónico","USER_NAME_INVALID":"Nombre de usuario no válido","USER_HAS_ONE_OR_MORE_MEMORI":"El usuario tiene uno o más recuerdos.","USER_MISSING_NEW_PASSWORD":"Usuario: falta nueva contraseña","USER_NOTHING_TO_DO":"Nada que hacer","USER_CANT_CREATE_MEMORI":"Usuario no autorizado a crear Agent","USER_MAX_MEMORI_REACHED":"Número máximo de Agent alcanzado","USER_TOO_MANY_ATTEMPTS":"demasiados intentos","USER_MUST_ACCEPT_TNC_AND_PP":"Debes aceptar los términos y condiciones.","USER_BIRTH_DATE_CANT_BE_CHANGED":"La fecha de nacimiento no se puede cambiar.","USER_CANT_SET_COMPLETION_PROVIDER":"Usuario: no tiene permiso para gestionar el proveedor de finalización","USER_CANT_ENABLE_DEEP_THOUGHT":"Usuario: no habilitado para gestionar Deep Thought","USER_CANT_ENABLE_DCM_INTEGRATION":"Usuario: no habilitado para gestionar la integración de DCM","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"Usuario: no se le permite gestionar encadenamiento o grupo de expertos","USER_CREATION_BILLING_DENIED_PERMISSION":"No tienes suficientes créditos para crear un gemelo","USER_HAS_ONE_OR_MORE_COMPLETION_CONFIGS":"El usuario tiene una o más configuraciones de finalización.","USER_CANT_BE_DELETED":"Usuario: no se puede eliminar","USER_ORDER_BY_INVALID":"Orden por no válido","MEMORI_NOT_FOUND":"Memoria no encontrada","MEMORI_NOT_ACCESSIBLE":"Memorias no accesibles","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Sólo el propietario puede cambiar la etiqueta o el pin","SESSION_NOT_FOUND":"Sesión no encontrada","SESSION_IS_NOT_ADMINISTRATIVE":"Sesión no administrativa","SESSION_EXPIRED":"La sesión expiró","speechMissingSession":"La voz requiere una sesión activa","speechInvalidSession":"La sesión no es válida","speechTenantMismatch":"La voz no está disponible en este sitio","speechRateLimited":"Demasiadas solicitudes de voz. Espera un momento e inténtalo de nuevo.","SESSION_OTP_NOT_FOUND":"Código de verificación no encontrado","SESSION_OTP_EXPIRED":"El código de verificación ha expirado","SESSION_OTP_INVALID":"Código de verificación inválido","SESSION_OTP_ATTEMPTS_EXCEEDED":"Demasiados intentos. Solicita un nuevo código de verificación.","MEMORI_MISSING_CONFIGURATION":"Gemelo: falta configuración","MEMORI_CONFIGURATION_NOT_FOUND":"Gemelo: configuración no encontrada","MEMORI_INVALID_PRIVACY_TYPE":"Gemelo: tipo de privacidad no válido","MEMORI_MISSING_PASSWORD":"Gemelo: falta contraseña","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Gemelo: número total de tokens de recuperación no válidos","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Gemelo: número mínimo de tokens de recuperación no válidos","MEMORI_INVALID_VOICE_TYPE":"Gemelo: tipo de voz no válido","MEMORI_MISSING_NAME":"Gemelo: falta nombre","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Gemelo: falta contraseña o token de recuperación","MEMORI_INVALID_ID":"Gemelo: identificación no válida","MEMORI_NAME_ALREADY_USED":"Nombre gemelo ya en uso","MEMORI_INVALID_PIN":"Gemelo: PIN no válido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Gemelo: el cambio de TAG y PIN requiere operaciones separadas","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Agent: no se requiere contraseña cuando es público","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Deep Thought requiere que las completaciones estén habilitadas","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"El grupo de expertos requiere que se habiliten las completaciones.","MEMORI_INVALID_COMPLETION_CONFIG":"Gemelo: configuración de finalizaciones no válidas","MEMORI_MACRO_FUNCTIONS_REQUIRES_COMPLETIONS":"Macro funciones requiere que se habiliten las finalizaciones","MEMORI_BLOCKING_DATE_MISSING_OR_WRONG":"Gemelo: fecha de bloqueo faltante o incorrecta","MEMORI_LIST_FILTER_NOT_SPECIFIED":"Gemelo: filtro no especificado","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transferencia: falta usuario de destino","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transferencia: ID de usuario de destino no válido","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transferencia: datos de usuario de destino no válidos","MEMORI_TRANSFER_NOTHING_TO_DO":"Transferencia: nada que hacer","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memorias: la configuración no se puede cambiar","MEMORI_MISSING_NEW_PASSWORD":"Recuerdos: falta nueva contraseña","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"La función requiere suscripción","INTEGRATION_NOT_FOUND":"Integración no encontrada","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Fecha no válida del formato","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Fecha no válida para formatear","MEMORI_SESSION_NOT_FOUND":"Sesión no encontrada","MEMORI_SESSION_DOESNT_ACCEPT_MEDIA":"Sesión no acepta medios","INTEGRATION_INVALID_TYPE":"Tipo de integración no válido","INTEGRATION_ALREADY_EXISTS":"La integración ya existe","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Las memorias no públicas no se pueden integrar","INTEGRATION_MISSING_INVOCATION_TEXT":"Integración: falta texto de invocación","INTEGRATION_MISSING_DEVICE_EMAILS":"Integración: correo electrónico del dispositivo perdido","INTEGRATION_MEMORI_IS_EMPTY":"Los recuerdos vacíos no se pueden integrar","INTEGRATION_MISSING_PRIVACY_POLICY":"Integración: falta la política de privacidad","INTEGRATION_MISSING_CATEGORY":"Falta categoría de integración","INTEGRATION_MISSING_DESCRIPTION":"Falta descripción de integración","INTEGRATION_INVALID_INVOCATION_TEXT":"Texto de invocación no válido","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home ya no está disponible","UPLOAD_REQUIRES_MULTIPART_ENCODING":"La carga requiere codificación multiparte","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: falta límite de tipo de contenido","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: se superó el tamaño máximo","UPLOAD_FILE_IS_EMPTY":"Upload: archivo vacío","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: tipo de archivo o firma no válidos","UPLOAD_MISSING_FILE_NAME":"Upload: falta el nombre del archivo","UPLOAD_INVALID_MEMORY_ID":"Upload: ID de contenido no válido","UPLOAD_MISSING_FILE_CONTENT":"Upload: Falta contenido del archivo","ASSET_NOT_FOUND":"Asset no encontrado","ASSET_NOT_ACCESSIBLE":"Asset no accesible","ASSET_MISSING_SESSION_ID":"Asset: ID de sesión faltante","ASSET_INVALID_FILE_NAME":"Asset: nombre de archivo no válido","ASSET_MALWARE_SCAN_THREATS_FOUND":"Asset: encontró amenazas de malware","INVITATION_NOT_FOUND":"Invitación no encontrada","INVITATION_NOT_ACCESSIBLE":"Invitación no accesible","INVITATION_ALREADY_ACCEPTED":"Invitación ya aceptada","INVITATION_ALREADY_REJECTED":"Invitación ya rechazada","INVITATION_MISSING_DESTINATION_EMAIL":"Invitación: falta el correo electrónico de destino","INVITATION_DESTINATION_EMAIL_INVALID":"Invitación: correo electrónico de destino no válido","INVITATION_MISSING_TAG":"Invitación: falta etiqueta","INVITATION_MISSING_PIN":"Invitación: falta el PIN","INVITATION_INVALID_PIN":"Invitación: PIN no válido","INVITATION_INVALID_TYPE":"Invitación: tipo no válido","INVITATION_MISSING_DESTINATION_NAME":"Invitación: falta el nombre del destino","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitación: la etiqueta y el pin no se pueden cambiar","INVITATION_CANT_BE_CHANGED":"Intación: no se puede cambiar","ACTIONLOG_INVALID_USER_ID":"ID de usuario no válido","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Fecha de: formato no válido","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Fecha hasta: formato no válido","ACTIONLOG_INVALID_MEMORI_ID":"ID de memoria no válida","CONSUMPTIONLOG_INVALID_TYPE":"Tipo de registro no válido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Fecha de: formato no válido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Fecha hasta: formato no válido","CONSUMPTIONLOG_INVALID_USER_ID":"ID de usuario no válido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"ID de memoria no válida","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notificaciones: Período de extracción del registro de chat no válido","BROADCAST_NOT_ALLOWED":"Broadcast no permitido","INVALID_NOTIFICATION_TYPE":"Tipo de notificación no válido","NOTIFICATION_NOT_FOUND":"Notificación no encontrada","INVALID_NOTIFICATION_FILTER":"Filtro de notificación no válido","INVALID_NOTIFICATION_PERIOD":"Período de notificación no válido","PROCESS_INVALID_TYPE":"Tipo de proceso no válido","PROCESS_ALREADY_RUNNING":"Proceso ya en ejecución","PROCESS_NOT_FOUND":"Proceso no encontrado","IMPORTCSV_MISSING_ROWS":"Importación CSV: filas faltantes","IMPORTCSV_MISSING_CSV":"Importación CSV: Falta CSV","IMPORTCSV_MISSING_SEPARATOR":"Importación CSV: falta separador","IMPORTCSV_INVALID_SEPARATOR":"Importación CSV: separador no válido","IMPORTCSV_MISSING_HEADERS":"Importación CSV: faltan encabezados","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Importación CSV: falta el separador de variante de título","IMPORTCSV_INVALID_RECEIVER_ID":"Importación CSV: ID de receptor no válido","IMPORTCSV_INVALID_MEDIA_LINK":"Importación CSV: enlace multimedia no válido","IMPORTCSV_INVALID_LINK_TITLE_HANDLING":"Importación CSV: título del enlace no válido","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"Importación CSV: codificación de caracteres indetectable","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"Importación CSV: no se puede importar a Secret Memories","IMPORTTXT_MISSING_ROWS":"Importando TXT: filas faltantes","IMPORTTXT_INVALID_GRANULARITY":"Importar TXT: granularidad no válida","IMPORTTXT_INVALID_RECEIVER_ID":"Importar TXT: ID de receptor no válido","IMPORTTXT_INVALID_MEDIA_LINK":"Importar TXT: enlace multimedia no válido","IMPORTTXT_INVALID_LINK_TITLE_HANDLING":"Importar TXT: título del enlace no válido","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"Importación TXT: codificación de caracteres indetectable","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"Importación TXT: No se puede importar a Secret Memories","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Importar TXT: límite de importación excedido","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Importar TXT: la importación en GPT-4 requiere una clave API","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Importar TXT: la importación requiere un plan de pago","IMPORTTXT_BILLING_DENIED_PERMISSION":"Importar TXT: no tienes suficientes créditos para la operación","IMPORT_MISSING_ROWS":"Importar: filas faltantes","IMPORT_CANT_IMPORT_TO_SECRET_MEMORI":"Importar: no se puede importar a Secret Memories","IMPORTMEMORI_INVALID_MEMORI_SPECS":"Importar MEMORI: especificaciones de memoria no válidas","IMPORT_MISSING_JSONL":"Importar: faltan JSONL","IMPORTMEMORI_INVALID_SPECS":"Importar MEMORI: especificaciones no válidas","EXPORT_MISSING_PASSWORD":"Exportar: falta contraseña","EXPORTCSV_MISSING_CSV_SPECS":"Exportación CSV: faltan especificaciones CSV","EXPORTCSV_MISSING_SEPARATOR":"Exportación CSV: falta separador","EXPORTCSV_INVALID_SEPARATOR":"Exportación CSV: separador no válido","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Exportación CSV: falta el separador de variante de título","EXPORTCSV_MISSING_NEW_LINE_CHAR":"Exportación CSV: falta un carácter de nueva línea","EXPORTCSV_INVALID_NEW_LINE_CHAR":"Exportación CSV: carácter de nueva línea no válido","EXPORTCSV_MISSING_PASSWORD":"Exportación CSV: falta contraseña","EXPORTJSONL_MISSING_JSONL_SPECS":"Exportación JSONL: faltan especificaciones JSONL","EXPORTJSONL_MISSING_PLATFORM":"Exportación JSONL: plataforma faltante","EXPORTJSONL_INVALID_PLATFORM":"Exportación JSONL: plataforma no válida","EXPORTJSONL_MISSING_PASSWORD":"Exportación JSONL: falta contraseña","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"Exportación JSONL: la exportación requiere un plan pago","ANALYSIS_MISSING_QUERY":"Análisis: consulta faltante","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Análisis: No se pueden analizar recuerdos secretos","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Análisis: hacer coincidir la consulta del usuario requiere un pensamiento profundo","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Asignación de insignia: credenciales incorrectas o faltantes","BADGE_ASSIGNMENT_MISSING_REF_ID":"Asignación de insignia: falta el ID de referencia","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Asignación de insignia: resultado no encontrado","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Asignación de insignia: falta la URL de aserción","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Asignación de insignia: URL de insignia faltante","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Asignación de insignia: falta la URL del emisor","BADGE_ASSIGNMENT_INVALID_URL":"Asignación de insignia: URL no válida","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Asignación de insignia: destinatario faltante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Asignación de insignia: tipo de destinatario desconocido","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Asignación de insignia: falta la identidad del destinatario","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Asignación de insignia: falta el tipo de hash del destinatario","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Asignación de insignia: tipo de hash del destinatario desconocido","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Asignación de insignia: identidad del destinatario incorrecta","BADGE_NOT_FOUND":"Insignia no encontrada","OUTCOME_NO_DCM_CONFIGURED":"Resultado: no hay ningún DCM configurado","OUTCOME_USER_BADGES_DISABLED":"Resultado: insignias de usuario deshabilitadas","COMPLETION_CONFIG_MISSING_NAME":"Configuración de terminaciones: falta nombre","COMPLETION_CONFIG_MISSING_PROVIDER":"Configuración de terminaciones: falta proveedor","COMPLETION_CONFIG_MISSING_ENDPOINT":"Configuración de terminaciones: falta punto final","COMPLETION_CONFIG_MISSING_API_KEY":"Configuración de terminaciones: falta clave API","COMPLETION_CONFIG_MISSING_MODEL":"Configuración de terminaciones: modelo faltante","COMPLETION_CONFIG_NO_PURPOSE_SPECIFIED":"Configuración de terminaciones: se debe especificar al menos un tipo de terminaciones","COMPLETION_CONFIG_INVALID_NAME":"Configuración de terminaciones: nombre no válido","COMPLETION_CONFIG_INVALID_PURPOSE":"Configuración de terminaciones: tipo de terminaciones no válidas","COMPLETION_CONFIG_INVALID_ENDPOINT":"Configuración de terminaciones: punto final no válido","COMPLETION_CONFIG_INCONSISTENT_ENDPOINT":"Configuración de terminaciones: punto final inconsistente","COMPLETION_CONFIG_INVALID_PROVIDER":"Configuración de terminaciones: proveedor no válido","COMPLETION_CONFIG_NOT_FOUND":"Configuración de terminaciones: no encontrada","COMPLETION_CONFIG_NOT_ACCESSIBLE":"Configuración de terminaciones: no accesible","COMPLETION_CONFIG_NAME_RESERVED":"Configuración de terminaciones: nombre reservado","COMPLETION_CONFIG_NAME_ALREADY_EXISTS":"Configuración de terminaciones: el nombre ya existe","COMPLETION_CONFIG_VISIBILITY_CHANGE_NOT_ALLOWED":"Configuración de terminaciones: cambio de visibilidad no permitido","COMPLETION_CONFIG_MISSING_MANDATORY_PREFIX":"Configuración de terminaciones: prefijo obligatorio faltante","COMPLETION_CONFIG_VISIBILITY_NOT_PERMITTED":"Configuración de terminaciones: visibilidad no permitida","COMPLETION_CONFIG_USE_AS_DEFAULT_NOT_PERMITTED":"Configuración de terminaciones: uso como predeterminado no permitido","COMPLETION_CONFIG_USE_AS_DEFAULT_REQUIRES_TENANT_VISIBILITY":"Configuración de terminaciones: uso como predeterminado requiere visibilidad del inquilino","COMPLETION_CONFIG_CHARGEABLE_NOT_PERMITTED":"Configuración de terminaciones: chargeable no permitido","COMPLETION_CONFIG_INVALID_APPLY_TO":"Configuración de terminaciones: apply to no válido","COMPLETION_CONFIG_APPLY_TO_TENANT_NOT_ALLOWED":"Configuración de terminaciones: apply to tenant no permitido","TRUSTED_APPLICATION_NOT_FOUND":"Aplicación de confianza no encontrada","TRUSTED_APPLICATION_NOT_ACCESSIBLE":"Aplicación de confianza no accesible","TRUSTED_APPLICATION_NAME_REQUIRED":"Aplicación de confianza: nombre requerido","TRUSTED_APPLICATION_TOKEN_REQUIRED":"Aplicación de confianza: token requerido","TRUSTED_APPLICATION_NAME_ALREADY_EXISTS":"Aplicación de confianza: nombre ya existe","TRUSTED_APPLICATION_INVALID_TOKEN":"Aplicación de confianza: token no válido"}}');let XG={en:{translation:b(XU)},it:{translation:b(XF)},es:{translation:b(XH)},fr:{translation:b(Xj)},de:{translation:b(Xz)}},XV=(0,ap.createInstance)({resources:XG,lng:"en",fallbackLng:"it",supportedLngs:["en","it","fr","es","de"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});XV.init(),function(e){let t=(void 0)??"translation";for(let n of Object.keys(hm)){let r=hm[n],i=hf[n],a=hg[n],o=hv[n];e.addResourceBundle(n,t,{table:r,expandable:i,alert:a,overlay:o},!0,!0)}}(XV);var XW=({children:e})=>(0,eh.jsx)(i8,{i18n:XV,children:e});let Xq=e=>{var t;return e?null==(t=null==e?void 0:e.split(","))?void 0:t.reduce((e,t)=>{let[n,r]=t.split(":").map(e=>e.trim());return{...e,[n]:r}},{}):{}},X$=({ownerUserName:e,ownerUserID:t,memoriName:n,memoriID:r,integration:i,integrationID:a,tenantID:o,secretToken:s,sessionID:l,layout:u,customLayout:c,showShare:d,showCopyButton:h,showTranslationOriginal:p,showSettings:m,showTypingText:f,showClear:g,showExperts:v,showOnlyLastMessages:y,showInputs:b=!0,showDates:_=!1,showContextPerLine:x=!1,showMessageConsumption:w,showUpload:S,showLogin:E,showReasoning:A,show3dAvatar:T,avatar3dHidden:I,height:C="100%",baseURL:M,apiURL:N="https://backend.memori.ai",engineURL:R="https://engine.memori.ai",tag:O,pin:P,context:k,initialQuestion:D,showChatHistory:B,uiLang:F,spokenLang:U,multilingual:j,authToken:z,enableAudio:H,defaultSpeakerActive:G=!0,disableTextEnteredEvents:V=!1,onStateChange:W,additionalInfo:q,customMediaRenderer:$,additionalSettings:J,userAvatar:K,useMathFormatting:Y=!1,autoStart:X,applyVarsToRoot:Z=!1,__WEBCOMPONENT__:Q=!1,maxTotalMessagePayload:ee,maxTextareaCharacters:et})=>{var en,er,ei,ea,eo,es,el,eu;let[ec,ed]=(0,em.useState)(),[ep,ef]=(0,em.useState)(),[eg,ev]=(0,em.useState)(),[ey,eb]=(0,em.useState)(),{t:e_}=tA();if(!(r&&t||n&&e))throw Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");let ex=e3(N,R),ew=(0,em.useCallback)(async()=>{let e=M||(o.startsWith("https://")?o:`https://${o}`);try{let t=await fetch(`${e}/api/speechkey?tenant=${o}`,{method:"GET",headers:{"Content-Type":"application/json"}}),n=await t.json();n.provider?ev(n.provider):console.warn("Provider not found in speech key response")}catch(e){console.error("Error fetching speech key:",e)}},[M,o]);(0,em.useEffect)(()=>{ew()},[]);let eS=(0,em.useCallback)(async()=>{if(r&&t){let{memori:e,...n}=await ex.backend.getMemoriByUserAndId(o,t,r);0===n.resultCode&&e?ed(e):console.error("[MEMORI]",n,e)}else if(n&&e){let{memori:r,...i}=await ex.backend.getMemori(o,e,n);0===i.resultCode&&r?(!r.ownerUserID&&t&&(r.ownerUserID=t),ed(r)):console.error("[MEMORI]",i,r)}},[r,t,n,e,o]);(0,em.useEffect)(()=>{eS()},[eS,o]);let eE=(0,em.useCallback)(async()=>{let{tenant:e,...t}=await ex.backend.tenant.getTenant(o);e&&0===t.resultCode?ef(e):console.debug("[TENANT]",t,e)},[o,N]);(0,em.useEffect)(()=>{eE()},[eE]),(0,em.useEffect)(()=>{let e=document.querySelector(`memori-client[memoriname="${null==ec?void 0:ec.name}"]`)||document.querySelector(`memori-client[memoriid="${null==ec?void 0:ec.memoriID}"]`)||document.querySelector("memori-client");if(!e)return;let t=new MutationObserver((e,t)=>{for(let t of e)if("attributes"===t.type){let e="MEMORI-CLIENT"===t.target.nodeName?t.target:t.target.parentElement,n=e.getAttribute("sessionid")||void 0;e&&n&&eb(n)}});return t.observe(e,{attributes:!0,childList:!1,subtree:!1}),()=>{t.disconnect()}},[]),(0,em.useEffect)(()=>{if(F)XV.changeLanguage(F.toLowerCase());else{let{lng:e,fallbackLng:t}=(()=>{let 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"}})();XV.changeLanguage(e).catch(()=>{XV.changeLanguage(t)})}},[F]);let eA=null!=i?i:null==(en=null==ec?void 0:ec.integrations)?void 0:en.find(e=>a?e.integrationID===a:!!e.publish&&"LANDING_EXPERIENCE"===e.type),eT=((e,t=!1)=>{try{return JSON.parse(e)}catch(n){return t?e:null}})(null!=(er=null==eA?void 0:eA.customData)?er:"{}"),eI=[null==ep?void 0:ep.name,...(null==ep?void 0:ep.aliases)||[],...eT.whiteListedDomains||[]];if((null==(ei=null==eT?void 0:eT.whiteListedDomains)?void 0:ei.length)&&"u">typeof window&&!eI.some(e=>new RegExp(e).test(window.location.hostname)))return null;let eC=null!=(ea=eT.ignoreClientAttributes)&&ea?{initialContextVars:Xq(eT.contextVars),initialQuestion:eT.initialQuestion,showLogin:(null==ec?void 0:ec.enableDeepThought)||void 0,memoriLang:null==(es=null==(eo=null==ec?void 0:ec.culture)?void 0:eo.split("-"))?void 0:es[0],uiLang:F,spokenLang:U,autoStart:"HIDDEN_CHAT"===u||"WEBSITE_ASSISTANT"!==u&&X}:{...O&&P?{personification:{tag:O,pin:P}}:{},multilingual:j,showCopyButton:h,showTranslationOriginal:p,showSettings:m,showChatHistory:B,showShare:d,showTypingText:f,showClear:g,showExperts:v,showLogin:null!=E?E:(null==ec?void 0:ec.enableDeepThought)||void 0,showUpload:S,showReasoning:A,showContextPerLine:x,showMessageConsumption:w,initialContextVars:null!=k?k:Xq(eT.contextVars),initialQuestion:null!=D?D:eT.initialQuestion,autoStart:"WEBSITE_ASSISTANT"!==u&&(void 0!==X?X:"HIDDEN_CHAT"===u||X),enableAudio:H,defaultSpeakerActive:G,useMathFormatting:Y,memoriLang:null==(eu=null==(el=null==ec?void 0:ec.culture)?void 0:el.split("-"))?void 0:eu[0],uiLang:F,spokenLang:U},[eM,eN]=(0,em.useState)(!1),eR=(0,em.useCallback)(()=>{var e;if(((null==ec?void 0:ec.memoriID)||r)&&!eM){let t=null==window?void 0:window.location.origin;if(!t||t.includes("localhost")||t.includes("memori-ai.github.io"))return void eN(!0);eN(!0),fetch("https://pulse.aisuru.com/post",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pulse:{clientType:Q?"memori-webcomponent":"memori-react",clientVersion:"v9.0.5",userAgent:navigator.userAgent,language:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,memoriID:null!=(e=null==ec?void 0:ec.memoriID)?e:r,tenant:o,referrer:t}})})}},[null==ec?void 0:ec.memoriID,r,o,Q,eM]);return(0,em.useEffect)(()=>{eR()},[eR]),(0,eh.jsx)(XW,{children:(0,eh.jsx)(v7,{defaultDuration:5e3,children:(0,eh.jsx)(q7,{children:(0,eh.jsx)(e7,{children:ec?(0,eh.jsx)(XB,{layout:u,customLayout:c,height:C,baseUrl:M||(o.startsWith("https://")||o.startsWith("http://")?o:`https://${o}`),apiURL:N,engineURL:R,memori:{...ec,secretToken:s},__WEBCOMPONENT__:Q,ownerUserName:null!=e?e:ec.ownerUserName,ownerUserID:null!=t?t:ec.ownerUserID,tenant:ep,tenantID:o,sessionID:null!=l?l:ey,secret:s,ttsProvider:eg||"azure",integration:eA,authToken:z,onStateChange:W,additionalInfo:q,customMediaRenderer:$,additionalSettings:J,userAvatar:K,applyVarsToRoot:Z,maxTotalMessagePayload:ee,maxTextareaCharacters:et,disableTextEnteredEvents:V,show3dAvatar:T,avatar3dHidden:I,...eC,showOnlyLastMessages:y,showInputs:b,showDates:_}):(0,eh.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,eh.jsxs)("p",{style:{textAlign:"center",margin:"2rem auto",textTransform:"capitalize"},children:[e_("loading")||"Loading","..."]})})})})})})};X$.propTypes={memoriName:(b(ef)).string,memoriID:(b(ef)).string,ownerUserName:(b(ef)).string,ownerUserID:(b(ef)).string,integrationID:(b(ef)).string,integration:(b(ef)).any,tenantID:(b(ef)).string.isRequired,secretToken:(b(ef)).string,sessionID:(b(ef)).string,layout:(b(ef)).oneOf(["DEFAULT","FULLPAGE","TOTEM","WEBSITE_ASSISTANT","CHAT","HIDDEN_CHAT","ZOOMED_FULL_BODY"]),customLayout:(b(ef)).any,showShare:(b(ef)).bool,showCopyButton:(b(ef)).bool,showTranslationOriginal:(b(ef)).bool,showInputs:(b(ef)).bool,showDates:(b(ef)).bool,showContextPerLine:(b(ef)).bool,showMessageConsumption:(b(ef)).bool,showSettings:(b(ef)).bool,showClear:(b(ef)).bool,showExperts:(b(ef)).bool,showOnlyLastMessages:(b(ef)).bool,showTypingText:(b(ef)).bool,showLogin:(b(ef)).bool,showUpload:(b(ef)).bool,showReasoning:(b(ef)).bool,show3dAvatar:(b(ef)).bool,avatar3dHidden:(b(ef)).bool,height:(b(ef)).oneOfType([(b(ef)).string,(b(ef)).number]),baseURL:(b(ef)).string,apiURL:(b(ef)).string,engineURL:(b(ef)).string,tag:(b(ef)).string,pin:(b(ef)).string,context:(b(ef)).objectOf((b(ef)).any),initialQuestion:(b(ef)).string,uiLang:(b(ef)).oneOf(["en","it","fr","es","de","EN","IT","FR","ES","DE"]),spokenLang:(b(ef)).string,multilingual:(b(ef)).bool,authToken:(b(ef)).string,enableAudio:(b(ef)).bool,defaultSpeakerActive:(b(ef)).bool,disableTextEnteredEvents:(b(ef)).bool,onStateChange:(b(ef)).func,additionalInfo:(b(ef)).objectOf((b(ef)).any),customMediaRenderer:(b(ef)).func,additionalSettings:(b(ef)).any,userAvatar:(b(ef)).oneOfType([(b(ef)).string,(b(ef)).any]),useMathFormatting:(b(ef)).bool,autoStart:(b(ef)).bool,applyVarsToRoot:(b(ef)).bool,maxTotalMessagePayload:(b(ef)).number,maxTextareaCharacters:(b(ef)).number};let XJ=e=>{try{return JSON.parse(e)}catch(e){return null}},XK=(e,t="100%")=>{e.style.display="block",e.style.width="100%",e.style.height=t,e.style.minHeight="0"};class XY extends HTMLElement{connectedCallback(){let e=document.createElement("div"),t=document.createElement("div");t.setAttribute("id","memori-root"),this.style.display="block",XK(e),XK(t),(this.hasAttribute("height")||"CHAT"===this.getAttribute("layout"))&&XK(this,this.getAttribute("height")||"100%"),e.appendChild(t),this.appendChild(e);let n=Object.keys(X$.propTypes).reduce((e,t)=>(this.hasAttribute(t)&&(e[t]=this.getAttribute(t),("true"===e[t]||"false"===e[t])&&(e[t]="true"===e[t])),e),{}),r=this.getAttribute("tenantId"),i=this.getAttribute("context"),a=i?.split(",")?.reduce((e,t)=>{let[n,r]=t.split(":").map(e=>e.trim());return{...e,[n]:r}},{}),o=XJ(this.getAttribute("additionalInfo")||"{}")||{},s=this.getAttribute("integration"),l=s&&XJ(s)||void 0,u=this.getAttribute("apiURL")||void 0;u&&"backend.memori.ai"===new URL(u).hostname&&(u="https://backend-proxy.aisuru.com"),r?(b(ep)).render((0,eh.jsx)(X$,{...n,apiURL:u,context:a,tenantID:r,additionalInfo:o,integration:l,__WEBCOMPONENT__:!0}),t):console.error("No tenantId attribute found")}}customElements.define("memori-client",XY)})();
1101
+ `,r6=(null==tP?void 0:tP.showAIicon)===void 0||(null==tP?void 0:tP.showAIicon),r8=!!(null!=I?I:null==tP?void 0:tP.showUpload),r7=!!(null!=N?N:null==tP?void 0:tP.showReasoning),r9=(e6=null==tP?void 0:tP.showMessageConsumption,!!(null!=x?x:e6)),ie=(null==tP?void 0:tP.showWhyThisAnswer)===void 0||(null==tP?void 0:tP.showWhyThisAnswer),[it,ir]=(0,em.useState)(!1);(0,em.useEffect)(()=>{(window.innerWidth>=768&&"FULLPAGE"===nr||"FULLPAGE"!==nr)&&ir(!0)},[]),(0,em.useEffect)(()=>{if(null==tP?void 0:tP.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",tP.seoTitle),document.head.append(e)}if(null==tP?void 0:tP.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",tP.seoDescription),document.head.append(e)}if(null==tP?void 0:tP.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",tP.seoUrl),document.head.append(e)}let t=H||e.avatarURL;if((null==tP?void 0:tP.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}},[tP,e.avatarURL,H]);let ii=(e,t=0)=>{if(K)return;let{text:n,waitForPrevious:r,hidden:i,typingText:a,useLoaderTextAsMsg:o,hasBatchQueued:s}=e.detail;n&&(r&&!rI&&(nL||ne.current.size>0)&&t<30?setTimeout(()=>{ia.current(e,t+1)},1e3):(rA(),n5(n,void 0,void 0,void 0,void 0,i,a,o,s)))},ia=(0,em.useRef)(ii);ia.current=ii,(0,em.useEffect)(()=>{if(K)return;let e=e=>ia.current(e);return document.addEventListener("MemoriTextEntered",e),()=>{document.removeEventListener("MemoriTextEntered",e)}},[K]);let io=(0,em.useCallback)(async(t,n=!1,r,i)=>{var a,o,s,l,u,c,d,h,p,m,f,g,v,y,b,_,x,w,S,E;let A=r?void 0:(null==t?void 0:t.sessionID)||rn,T=r?void 0:(null==t?void 0:t.dialogState)||ro;tG(!0),nu(!1);let I=[],C=qP("birthDate",void 0),M=n7||C||(null==tN?void 0:tN.birthDate);!M&&er&&(G||i)&&(M="1970-01-01T10:24:03.845Z");let N=qP("position",void 0);if(er&&(w=!!e.needsPosition,S=!!(nV||N),w&&!S||(E=!!e.requireLoginToken,E&&!tB)))return void tG(!1);if(!await ix({notify:!0})){tG(!1),t5(!1);return}if(A||!n8||M)if((A||"PUBLIC"===e.privacyType||nz()||nU)&&(A||!tV))if(!A||n){if(tW(!1),tq.current)return;tq.current=!0;try{let t=await rc({memoriID:e.engineMemoriID,password:nz(),tag:null==W?void 0:W.tag,pin:null==W?void 0:W.pin,continueFromChatLogID:null==r?void 0:r.chatLogID,initialContextVars:{LANG:t1,PATHNAME:null==(a=window.location.pathname)?void 0:a.toUpperCase(),ROUTE:(null==(l=null==(s=null==(o=window.location.pathname)?void 0:o.split("/"))?void 0:s.pop())?void 0:l.toUpperCase())||"",...(!r?U:r.lines[r.lines.length-1].contextVars)||{}},initialQuestion:r?void 0:j,birthDate:M,additionalInfo:{...X||{},loginToken:tO(),language:(null!=(d=null!=t1?t1:null==(c=null==(u=e.culture)?void 0:u.split("-"))?void 0:c[0])?d:"IT").toLowerCase(),timeZoneOffset:new Date().getTimezoneOffset().toString()}});if((null==t?void 0:t.sessionID)&&tU.current){ts(t.sessionID),ra(void 0),t5(!1),tG(!1);return}if(null==t?void 0:t.dialogState)if(r){let e=r.lines.map((e,t)=>{var n,r;return{text:e.text,media:null==(r=null==(n=e.media)?void 0:n.filter(e=>kq.includes(e.mimeType)))?void 0:r.map(e=>({mediumID:`${t}-${e.mimeType}`,...e})),fromUser:e.inbound,llmUsage:e.llmUsage,timestamp:e.timestamp,emitter:e.emitter}});if(I=null!=e?e:[],tQ.toUpperCase()!==t1.toUpperCase()&&t0)try{I=await Promise.all(e.map(async e=>"originalText"in e&&e.originalText?e:{...e,originalText:e.text,text:(await GP(e.text,t1,tQ,D)).text}))}catch(e){}n1(I),n6(t.dialogState,t1,void 0,!0).finally(()=>{rN(!0),tG(!1)})}else n1([]),await rz(t.dialogState,t1),rN(!0),tG(!1);else(null==t?void 0:t.resultCode)===0?(tq.current=!1,await io(t||void 0)):(t5(!1),tG(!1))}finally{tq.current=!1}return}else if(G||i){let t=null!=i?i:G,{currentState:n,...r}=await tp(t);if(0!==r.resultCode||!n){let{chatLogs:e}=await tf(t,t);ra(void 0),await io(void 0,!0,null==e?void 0:e[0]);return}if(n1([]),W&&n.currentTag!==W.tag)try{await rp(e.engineMemoriID,t,"-");let n=await rp(e.engineMemoriID,t,W.tag,W.pin);if(n&&0===n.resultCode)await rz(n.currentState,t1),tG(!1);else throw Error("No session")}catch(e){rd(!0,nz(),void 0,W.tag,W.pin,{LANG:t1,PATHNAME:null==(h=window.location.pathname)?void 0:h.toUpperCase(),ROUTE:(null==(f=null==(m=null==(p=window.location.pathname)?void 0:p.split("/"))?void 0:m.pop())?void 0:f.toUpperCase())||"",...U||{}},j,M).then(()=>{rN(!0),tG(!1)})}else if(!W&&(null==n?void 0:n.currentTag)&&(null==n?void 0:n.currentTag)!==kK&&(null==n?void 0:n.currentTag)!=="-")try{await rp(e.engineMemoriID,t,"-");let n=await rp(e.engineMemoriID,t,kK);if(n&&0===n.resultCode)await rz(n.currentState,t1),tG(!1);else throw Error("No session")}catch(e){rd(!0,nz(),void 0,void 0,void 0,{LANG:t1,PATHNAME:null==(g=window.location.pathname)?void 0:g.toUpperCase(),ROUTE:(null==(b=null==(y=null==(v=window.location.pathname)?void 0:v.split("/"))?void 0:y.pop())?void 0:b.toUpperCase())||"",...U||{}},j,M).then(()=>{rN(!0),tG(!1)})}else{try{let{chatLogs:e}=await tf(t,t),n=null==(_=null==e?void 0:e[0])?void 0:_.lines.map((e,t)=>{var n,r;return{text:e.text,media:null==(r=null==(n=e.media)?void 0:n.filter(e=>kq.includes(e.mimeType)))?void 0:r.map(e=>({mediumID:`${t}-${e.mimeType}`,...e})),fromUser:e.inbound,llmUsage:e.llmUsage,timestamp:e.timestamp,emitter:e.emitter}});if(I=null!=n?n:[],tQ.toUpperCase()!==t1.toUpperCase()&&t0)try{I=await Promise.all(n.map(async e=>({...e,originalText:e.text,text:(await GP(e.text,t1,tQ,D)).text})))}catch(e){}n1(I)}catch(e){}if((null==I?void 0:I.length)&&I.length>1||!j)rN(!0),tG(!1),await rz(n,t1,void 0,!!(null==I?void 0:I.length));else{I=[],n1([]);let n=nJ(nV),r=await tl({sessionId:t,text:j,...e.needsDateTime&&{dateUTC:null!=(x=i5.utc().toISO())?x:void 0},...void 0!==n&&{place:n}});if(500===r.resultCode&&r.resultMessage)return void n1(e=>[...e,{text:"Error: "+r.resultMessage,emitter:"system",fromUser:!1,initial:!1,contextVars:{},date:new Date().toISOString()}]);let i=XD(r);if(0===r.resultCode&&i){t8(!0);try{let e=await r$(i);0===e.resultCode&&e.currentState&&(await rz(e.currentState,t1,void 0,!1),tG(!1))}catch(e){XL("onClickStart NATS wait failed",e),t8(!1),t9(void 0)}}else 0===r.resultCode&&XL("onClickStart enter-text missing correlationID",r)}}}else n1([]),await rz(T,t1),tG(!1);else{nG("password"),tG(!1);return}else{rt(!0),tG(!1);return}},[k,nB,e,nU,n7,rn,t1,nV,tB]),is=(0,em.useCallback)(e=>{let t=!!(rn&&rM),n=!!(nV||qP("position",void 0));nd(r=>((function(e,t,n,r=!1,i=!0){return e&&!t&&!!n&&!r&&i})(r,e,er,t,n)&&queueMicrotask(()=>{io()}),e||queueMicrotask(()=>{np(!1)}),e))},[er,io,rn,rM,nV]),[il,iu]=(0,em.useState)(!1),ic="WEBSITE_ASSISTANT"===nr||"HIDDEN_CHAT"===nr,id=(0,em.useRef)(!1);(0,em.useEffect)(()=>{var t,n;let r=qP("position",void 0),i=!!(nV||r);id.current||tH||tq.current||rn||!er||ic&&!il||tZ||(t=!!e.needsPosition,t&&!i)||(n=!!e.requireLoginToken,n&&!tB)||(id.current=!0,io())},[tH,er,ic,il,rn,tZ,nV,e.needsPosition,e.requireLoginToken,tB]),(0,em.useEffect)(()=>{var t;let n=document.querySelector(`memori-client[memoriname="${e.name}"]`)||document.querySelector(`memori-client[memoriid="${e.memoriID}"]`)||document.querySelector("memori-client");if(!n)return;let r=null!=(t=null==X?void 0:X.loginToken)?t:q,i=n.getAttribute("authtoken")||void 0;i&&!r&&(tI(i),tC.current=i);let a=e=>{var t;let n="MEMORI-CLIENT"===e.nodeName?e:null!=(t=e.closest("memori-client"))?t:e.parentElement,r=(null==n?void 0:n.getAttribute("authtoken"))||void 0;tI(r),tC.current=r},o=new MutationObserver(e=>{var t;for(let n of e)"attributes"===n.type&&(null==(t=n.attributeName)?void 0:t.toLowerCase())==="authtoken"&&a(n.target)});return o.observe(n,{attributes:!0,childList:!1,subtree:!1}),()=>{o.disconnect()}},[e.name,e.memoriID,null==X?void 0:X.loginToken,q]);let[ih,ip]=(0,em.useState)(),im=(0,em.useCallback)(async()=>{if(rn&&(null==e?void 0:e.enableBoardOfExperts))try{let{experts:e,count:t,...n}=await tm(rn);0===n.resultCode&&ip(e)}catch(e){}},[rn,null==e?void 0:e.enableBoardOfExperts]);(0,em.useEffect)(()=>{im()},[rn,im]);let ig=e.enableDeepThought&&!!tE&&!!(null==tN?void 0:tN.userID)&&(null==tN?void 0:tN.pAndCUAccepted),iv=(0,em.useCallback)(()=>{tK(!1),nG(null),e9(v9({description:e8("notEnoughCredits"),severity:"error"}))},[e9,e8]),iy=(0,em.useCallback)(()=>{nG(null),e9(v9({description:e8("creditsCheckFailed"),severity:"error"}))},[e9,e8]),ib=null!=n?n:e.ownerUserID,i_=e.engineMemoriID,ix=(0,em.useCallback)(async e=>{if(!(null==V?void 0:V.billingDelegation))return!0;try{let t=await Jj({operation:ig?"dt_session_creation":"session_creation",baseUrl:D,userID:ib,engineMemoriID:i_,tenant:r});if(tX(!1),t.enough)return tK(!0),!0;return(null==e?void 0:e.notify)?iv():tK(!1),!1}catch(t){if(XL("checkCredits failed",t),!(t instanceof JU&&(void 0===t.status||t.status>=400&&t.status<500)))return!0;return tX(!0),(null==e?void 0:e.notify)&&iy(),!1}},[D,ig,iv,iy,ib,i_,null==V?void 0:V.billingDelegation,r]);(0,em.useEffect)(()=>{(null==V?void 0:V.billingDelegation)&&ix()},[null==V?void 0:V.billingDelegation,ig,ix]),(0,em.useEffect)(()=>{if(et)return;let e=()=>{rn&&ts(rn)};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e),e()}},[rn]);let iw=void 0===C?!("WEBSITE_ASSISTANT"===nr&&tL):!C,iS=!(null==V?void 0:V.ssoLogin)&&tD,iE={memori:{...e,ownerUserID:null!=(eP=null!=(eO=e.ownerUserID)?eO:n)?eP:void 0},apiClient:ta,tenant:V,history:n0,showShare:null!=(ek=null!=h?h:null==tP?void 0:tP.showShare)?ek:"WEBSITE_ASSISTANT"!==nr,position:nV,layout:nr,additionalSettings:Z,setVenue:nK,positionPopoverOpen:nc,setPositionPopoverOpen:is,autoStartPositionGeolocation:nh,setShowSettingsDrawer:nf,setShowKnownFactsDrawer:nb,setShowExpertsDrawer:nx,enableAudio:!!z&&(null==(eL=null!=$?$:null==tP?void 0:tP.enableAudio)||eL),speakerMuted:null!=rI&&rI,setSpeakerMuted:e=>{rC(e)},setShowChatHistoryDrawer:nv,showSettings:null==(eD=null!=w?w:null==tP?void 0:tP.showSettings)||eD,showChatHistory:null==(eB=null!=M?M:null==tP?void 0:tP.showChatHistory)||eB,showMessageConsumption:r9,hasUserActivatedSpeak:rM,showReload:"TOTEM"===nr,showClear:null!=(eF=null!=E?E:null==tP?void 0:tP.showClear)&&eF,showExperts:null!=(eU=null!=A?A:null==tP?void 0:tP.showExperts)&&eU,clearHistory:()=>n1(e=>e.slice(-1)),showLogin:iS,setShowLoginDrawer:tz,loginToken:tE,user:tN,sessionID:rn,baseUrl:D,onLogout:()=>{tE&&ta.backend.pwlUserLogout(tE).then(()=>{tz(!1),tR(void 0),tI(void 0),tC.current=void 0,qL("loginToken")})}},iA={memori:e,integration:l,integrationConfig:tP,tenant:V,instruct:tg,avatar3dVisible:it,setAvatar3dVisible:ir,hasUserActivatedSpeak:rM,isPlayingAudio:rT&&!rI&&(null==(ej=null!=$?$:null==tP?void 0:tP.enableAudio)||ej),loading:!!t6,baseUrl:D,apiUrl:ta.constants.BACKEND_URL,enablePositionControls:nC,setEnablePositionControls:nM,avatarType:nN},iT={memori:e,tenant:V,language:tQ,userLang:t1,setUserLang:t2,baseUrl:D,apiUrl:ta.constants.BACKEND_URL,position:nV,setVenue:nK,openPositionPopover:()=>{is(!0)},integrationConfig:tP,instruct:tg,sessionId:rn,clickedStart:tH,isMultilanguageEnabled:t0,onClickStart:io,isUserLoggedIn:tB,hasInitialSession:!!G,notEnoughCredits:t$&&!tJ,creditsCheckFailed:t$&&tY,showLogin:iS,setShowLoginDrawer:tz,showChatHistory:"WEBSITE_ASSISTANT"!==nr&&(null==(ez=null!=M?M:null==tP?void 0:tP.showChatHistory)||ez),setShowChatHistoryDrawer:nv,user:tN},iI={memori:e,sessionID:rn||"",tenant:V,translateTo:t0&&t1.toUpperCase()!==(null==(eq=null!=(eW=null!=(eV=null==(eG=null==(eH=e.culture)?void 0:eH.split("-"))?void 0:eG[0])?eV:e7.language)?eW:"IT")?void 0:eq.toUpperCase())?t1:void 0,baseUrl:D,apiUrl:ta.constants.BACKEND_URL,layout:u,memoriTyping:t6,typingText:t7,showTypingText:null!=(e$=null!=S?S:null==tP?void 0:tP.showTypingText)&&e$,history:iw?n0:n0.slice(-2),authToken:tO(),dialogState:ro,pushMessage:n2,simulateUserPrompt:(e,t)=>{rA(),n5(e,void 0,void 0,!1,t)},showDates:y,showContextPerLine:_,showMessageConsumption:r9,showAIicon:r6,showUpload:r8,showReasoning:r7,showWhyThisAnswer:ie,showCopyButton:null==(eJ=null!=f?f:null==tP?void 0:tP.showCopyButton)||eJ,showTranslationOriginal:null!=(eK=null!=g?g:null==tP?void 0:tP.showTranslationOriginal)&&eK,client:ta,instruct:tg,preview:p,sendOnEnter:rY,setSendOnEnter:rX,microphoneMode:nw?"CONTINUOUS":"HOLD_TO_TALK",attachmentsMenuOpen:rZ,setAttachmentsMenuOpen:rQ,showInputs:v&&(e0=!!e.requireLoginToken,!e0||!!tB),showMicrophone:!!z&&(null==(eY=null!=$?$:null==tP?void 0:tP.enableAudio)||eY),showFunctionCache:ea,userMessage:nY,onChangeUserMessage:e=>{e&&"\n"!==e&&""!==e.trim()?(nX(e),rv()):nX("")},sendMessage:(e,t)=>{rA(),rU(),nu(!0),n5(e,t),nX("")},onMediumSelectedState:e=>{n6(e,t1,void 0,!0)},stopListening:e=>{e&&rL&&(rP.current=e),rU()},audioStream:rD,startListening:()=>(nu(!1),rF()),stopAudio:rA,listening:rL,transcribing:"processing"===rB,setEnableFocusChatInput:tb,isPlayingAudio:rT,customMediaRenderer:Q,user:tN,userAvatar:ee,experts:ih,useMathFormatting:t3,maxTotalMessagePayload:eo,maxTextareaCharacters:es,isChatlogPanel:(null==tP?void 0:tP.artifactChatLogPanel)===!0,globalBackground:r0||void 0},iC=(0,eh.jsx)("div",{className:"memori--global-background no-background-image"}),iM=l&&(Object.keys(r1).length>0||(null==tP?void 0:tP.blurBackground)===!1)?(0,eh.jsx)("style",{dangerouslySetInnerHTML:{__html:r5}}):null,iN=(0,eh.jsx)($9,{tenant:V,userLang:t1,integrationID:null==l?void 0:l.integrationID,memoriHash:`${e.ownerTenantName}-${e.ownerUserName}-${e.name}`}),iR=c||("TOTEM"===nr?JE:"CHAT"===nr?JA:"FULLPAGE"===nr?JS:"WEBSITE_ASSISTANT"===nr?JR:"HIDDEN_CHAT"===nr?JO:"ZOOMED_FULL_BODY"===nr?JP:JS),iO=(null==tP?void 0:tP.theme)==="light"||(null==tP?void 0:tP.theme)==="dark"?tP.theme:"light";return(0,eh.jsx)("div",{ref:tx,className:(b(tT))("memori","memori-widget",`memori-layout-${String(nr).toLowerCase()}`,`memori-controls-${String(nT).toLowerCase()}`,`memori--avatar-${(null==tP?void 0:tP.avatar)||"default"}`,{"memori--auto-start":er&&!tZ&&(e1=!!e.needsPosition,e2=!!nV,!e1||!!e2)&&(e4=!!e.requireLoginToken,!e4||!!tB),"memori--preview":p,"memori--embed":m,"memori--with-integration":l,"memori--with-speechkey":!!z,"memori--active":rM,"memori--hide-emissions":nO,"memori--has-active-session":!!rn}),"data-theme":iO,"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":rn,"data-memori-integration":null==l?void 0:l.integrationID,"data-memori-engine-state":JSON.stringify({...ro,sessionID:rn}),style:{height:null!=P?P:"100%"},children:(0,eh.jsxs)(v5,{container:t_,clipContainer:tw,theme:iO,zIndexBase:1e4*("WEBSITE_ASSISTANT"===nr),children:[(0,eh.jsx)(v8,{placement:"top-end"}),(0,eh.jsxs)("div",{ref:tS,className:"memori-widget__surface",children:[(0,eh.jsx)(iR,{Header:$8,headerProps:iE,Avatar:$e,avatarProps:iA,Chat:Vx,chatProps:iI,StartPanel:VN,startPanelProps:iT,integrationStyle:iM,integrationBackground:iC,poweredBy:iN,autoStart:er,onSidebarToggle:iu,sessionId:rn,hasUserActivatedSpeak:rM,loading:t4,show3dAvatar:tL,avatar3dHidden:!tL,totemContentMaxWidth:null==tP?void 0:tP.totemContentMaxWidth,sideDrawerOpen:!!ng||!!ny||!!n_}),(0,eh.jsx)(tn,{pushMessage:e=>{n1(t=>{if(!t.length)return t;let n=t[t.length-1];if(!n||n.fromUser)return t;let r={...n,text:n.text+e.text};return[...t.slice(0,-1),r]})}}),(0,eh.jsx)("audio",{id:"memori-audio",style:{display:"none"},src:"https://aisuru.com/intro.mp3"}),tt&&(0,eh.jsx)(wb,{withModal:!0,pwdOrTokens:nH,openModal:!!nH,setPwdOrTokens:nG,showTokens:"SECRET"===e.privacyType,onFinish:e=>{var t,n,r,i;return e.password&&nF(e.password),e.password&&(d=e.password),e.tokens&&nj(e.tokens),rd(!rn,e.password,e.tokens,null==W?void 0:W.tag,null==W?void 0:W.pin,{LANG:t1,PATHNAME:null==(t=window.location.pathname)?void 0:t.toUpperCase(),ROUTE:(null==(i=null==(r=null==(n=window.location.pathname)?void 0:n.split("/"))?void 0:r.pop())?void 0:i.toUpperCase())||"",...U||{}},j,n7).then(e=>{if(!(null==e?void 0:e.sessionID))throw Error("AUTH_FAILED");nG(null),(null==e?void 0:e.dialogState)?rN(!0):io(e)}).catch(e=>{throw e instanceof Error&&"AUTH_FAILED"===e.message||tW(!0),e})},minimumNumberOfRecoveryTokens:null!=(eX=null==e?void 0:e.minimumNumberOfRecoveryTokens)?eX:1}),tt&&(0,eh.jsx)(Jn,{visible:re,minAge:n8,onClose:e=>{var t,n,r,i;e?(n9(e),qk("birthDate",e),rd(!rn,nz(),nU,null==W?void 0:W.tag,null==W?void 0:W.pin,{LANG:t1,PATHNAME:null==(t=window.location.pathname)?void 0:t.toUpperCase(),ROUTE:(null==(i=null==(r=null==(n=window.location.pathname)?void 0:n.split("/"))?void 0:r.pop())?void 0:i.toUpperCase())||"",...U||{}},j,e).then(e=>{rt(!1),nG(null),io(e||void 0)}).catch(()=>{rt(!1),tW(!0)})):(rt(!1),tG(!1))}}),nm&&(0,eh.jsx)(Jr,{layout:nr,open:!!nm,onClose:()=>nf(!1),microphoneMode:nw?"CONTINUOUS":"HOLD_TO_TALK",continuousSpeechTimeout:nE,setMicrophoneMode:e=>nS("CONTINUOUS"===e),setContinuousSpeechTimeout:nA,controlsPosition:nT,setControlsPosition:nI,hideEmissions:nO,setHideEmissions:nP,avatarType:nN,setAvatarType:nR,enablePositionControls:nC,setEnablePositionControls:nM,isAvatar3d:!!(null==tP?void 0:tP.avatarURL),additionalSettings:Z,speakerMuted:rI}),ng&&(0,eh.jsx)(J4,{open:!!ng,onClose:()=>nv(!1),resumeSession:e=>{n4(e.chatLogID),io(void 0,!1,e),nv(!1)},apiClient:ta,sessionId:rn||"",memori:e,baseUrl:D,history:n0,apiUrl:ta.constants.BACKEND_URL,loginToken:tE,language:tQ,userLang:t1,isMultilanguageEnabled:t0,showFunctionCache:ea,showMessageConsumption:r9}),ny&&rn&&(0,eh.jsx)(Jl,{apiClient:ta,memori:e,sessionID:rn,visible:ny,closeDrawer:()=>nb(!1)}),n_&&!!ih&&(0,eh.jsx)(Ju,{apiUrl:ta.constants.BACKEND_URL,baseUrl:D,tenant:V,experts:ih,open:n_,onClose:()=>nx(!1)}),tj&&(null==V?void 0:V.name)&&(0,eh.jsx)(Jc,{tenant:V,apiClient:ta,open:!!tj,user:tN,loginToken:tE,memoriName:null==e?void 0:e.name,onClose:()=>tz(!1),modalClassName:"WEBSITE_ASSISTANT"===nr?"memori-modal--above-website-assistant":void 0,onLogin:(e,t)=>{var n,r,i,a;rd(!1,nz(),[],null==W?void 0:W.tag,null==W?void 0:W.pin,{LANG:t1,PATHNAME:null==(n=window.location.pathname)?void 0:n.toUpperCase(),ROUTE:(null==(a=null==(i=null==(r=window.location.pathname)?void 0:r.split("/"))?void 0:i.pop())?void 0:a.toUpperCase())||"",...U||{}},void 0,n7,{loginToken:t},void 0,rn).then(n=>{var r,i;if(tz(!1),tR(e),tI(t),tC.current=t,qk("loginToken",t),(null==n?void 0:n.sessionID)&&n.sessionID!==rn&&(null==n?void 0:n.dialogState)){let t=(null==e?void 0:e.userName)||e8("login.user");n2({text:"",emitter:n.dialogState.emitter,media:null!=(i=null!=(r=n.dialogState.emittedMedia)?r:n.dialogState.media)?i:[],fromUser:!1,initial:e8("login.successfullyLoggedIn",{username:t}),contextVars:{...n.dialogState.contextVars||{},LOGIN_STATUS:"success"},date:n.dialogState.currentDate,placeName:n.dialogState.currentPlaceName,placeLatitude:n.dialogState.currentLatitude,placeLongitude:n.dialogState.currentLongitude,placeUncertaintyKm:n.dialogState.currentUncertaintyKm,tag:n.dialogState.currentTag,memoryTags:n.dialogState.memoryTags}),ru(n.dialogState)}})},setUser:tR,onLogout:()=>{tE&&ta.backend.pwlUserLogout(tE).then(()=>{tz(!1),tR(void 0),tI(void 0),tC.current=void 0,qL("loginToken")})}})]})]})})},ap=ec("HPg7A"),XU={};XU=JSON.parse('{"yes":"Si","no":"No","confirm":"Conferma","apply":"Applica","cancel":"Annulla","show":"Mostra","hide":"Nascondi","send":"Invia","scrollToLatest":"Vai all\'ultimo messaggio","scrollToContinueReading":"Scorri per continuare a leggere","close":"Chiudi","clearHistory":"Cancella chat","clearHistoryDone":"Chat cancellata.","moreInfo":"Ulteriori informazioni","back":"Indietro","edit":"Modifica","delete":"Elimina","loading":"Caricamento","expand":"Espandi","collapse":"Riduci","expandable":{"expand":"Espandi"},"fullscreenEnter":"Passa a schermo intero","fullscreenExit":"Esci da schermo intero","center":"Centro","bottom":"In basso","hidden":"Nascosto","day":"Giorno","month":"Mese","year":"Anno","dayPlaceholder":"GG","monthPlaceholder":"MM","yearPlaceholder":"AAAA","createdAt":"Data creazione","selected":"Selezionati","page":"pagina","actions":"Azioni","next":"Successivo","all":"Tutti","copied":"Copiato!","today":"Oggi","yesterday":"Ieri","date":"Data di nascita","last_7_days":"Ultimi 7 giorni","last_30_days":"Ultimi 30 giorni","previous":"Precedente","placeholder":"Fai una domanda","copy":"Copia","copyRawCode":"Copia codice sorgente","feedback":"Feedback","feedbackThankYou":"Grazie per il feedback.","copyFailed":"Impossibile copiare","functionCache":"Cache delle funzioni","copyToClipboard":"Copia negli appunti","showOriginalText":"Mostra originale","showTranslatedText":"Mostra traduzione","exactPosition":"Posizione esatta","uncertain":"Incertezza","question":"Domanda","nothingFound":"Nessun risultato","venue":"Luogo","searchVenue":"Cerca un luogo…","privacyPolicy":"Informativa sulla privacy","popularLanguages":"Popolari","allLanguages":"Tutte le lingue","memoriBlockedTitle":"Bloccato","memoriBlockedUntil":"Agente 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","aiGeneratedNote":"L\'agente può commettere errori. Assicurati di verificare le informazioni importanti.","reasoning":"Ragionamento...","thinking":"Sto ragionando","thought":"Ragionamento","thoughtFor":"Ragionato per {{count}}s","whyThisAnswer":"Da dove viene questa risposta","whyThisAnswerHelper":"Questa risposta è stata generata automaticamente da un\'intelligenza artificiale sulla base di questi contenuti verificati.","whyThisAnswerDescription":"I contenuti della base di conoscenza che l\'agente ha consultato per rispondere.","whyThisAnswerYouAsked":"Hai chiesto","whyThisAnswerUserAsked":"Domanda dell\'utente","whyThisAnswerAgentReplied":"L\'agente ha risposto","whyThisAnswerShowFull":"Mostra la risposta completa","whyThisAnswerContentsUsed":"Contenuti usati","whyThisAnswerOpen":"Apri","whyThisAnswerDisclaimer":"La risposta è stata scritta dall\'agente a partire da questi contenuti: può contenere errori o riformulazioni. Verifica le informazioni importanti alla fonte.","whyThisAnswerEmptyTitle":"Nessun contenuto consultato","whyThisAnswerEmptyDescription":"Per questa domanda l\'agente non ha trovato corrispondenze nella base di conoscenza: ha risposto solo in base alle proprie istruzioni.","whyThisAnswerEmptyAuthorDescription":"La domanda non ha prodotto corrispondenze. Se dovrebbe averne, aggiungi un contenuto che la copra.","whyThisAnswerAddContent":"Aggiungi alla base di conoscenza","whyThisAnswerConfidenceHigh":"Corrispondenza alta","whyThisAnswerConfidenceMedium":"Corrispondenza parziale","whyThisAnswerConfidenceLow":"Corrispondenza debole","whyThisAnswerTypeQuestion":"Domanda e risposta","whyThisAnswerTypeDocument":"Documento","whyThisAnswerTypeWebsite":"Sito web","whyThisAnswerTypeStory":"Racconto","whyThisAnswerSourcesCount_one":"{{count}} fonte","whyThisAnswerSourcesCount_other":"{{count}} fonti","whyThisAnswerNoSources":"Nessuna fonte","receiverLabel":"Assegnato a","missingData":"Informazioni mancanti","completionsEnabled":"IA evoluta, può rispondere con risposte generate automaticamente che talvolta potrebbero contenere informazioni non corrette","completionProviderDown":"Questo agente è integrato con una IA generativa di {{provider}}, ma al momento non è disponibile. Riprova più tardi.","completionProviderMajorOutage":"Questo agente è integrato con una IA generativa di {{provider}}, ma al momento non è disponibile. Non sarà possibile utilizzare questa funzionalità finché il servizio non viene ripristinato.","completionProviderPartialOutage":"Questo agente è integrato con una IA generativa di {{provider}}, ma sta riscontrando interruzioni parziali. Alcune funzionalità potrebbero non essere disponibili o funzionare in modo non ottimale.","completionProviderDegraded":"Questo agente è integrato con una IA generativa di {{provider}}, ma sta funzionando più lentamente del normale. Le risposte potrebbero richiedere più tempo o essere meno precise.","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 agente.","errorFetchingSession":"Errore durante il caricamento della sessione","errorGettingReferralURL":"Errore durante il caricamento del riferimento","errorReopeningSession":"Errore durante il riapertura della sessione","sessionExpiredReopening":"Sessione scaduta, riapertura in corso","ageVerification":"Verifica dell\'età","ageVerificationText":"Per interagire con questo agente, devi aver almeno {{minAge}} anni.","ageVerificationSuccess":"Età verificata con successo.","nsfw":"NSFW: Questo agente contiene contenuti per adulti","deepThought":"Pensiero profondo","deepThoughtWhatIs":"Cos\'è 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.","notEnoughCredits":"L\'autore di questo agente non ha abbastanza crediti per rispondere alla tua domanda.","creditsCheckFailed":"Non è stato possibile verificare i crediti di questo agente. Riprova più tardi o contatta il suo autore.","confirmDialog":{"title":"Confermi di voler lasciare questa pagina?","message":"Le modifiche non salvate andranno perse."},"knownFacts":{"title":"Fatti noti","description":"Quello che {{memoriName}} ricorda di te. Puoi eliminare ogni voce.","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","searchPlaceholder":"Cerca fra i fatti","select":"Seleziona","loadMore":"Carica altri","factsCount_one":"{{count}} fatto","factsCount_other":"{{count}} fatti","shownOfTotal":"Mostrati {{shown}} di {{total}}","emptyTitle":"Nessun fatto ancora","emptyDescription":"Man mano che parlate, l\'agente annota qui quello che impara su di te. Potrai cancellarlo in qualsiasi momento.","deleteLabel":"Elimina questo fatto","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?","selected_one":"{{count}} fatto selezionato","selected_other":"{{count}} fatti selezionati","selectedRows_one":"{{count}} riga selezionata","selectedRows_other":"{{count}} righe selezionate"},"auth":{"title":"Autenticazione","description":"Questo agente è protetto. Inserisci la password per continuare.","useRecoveryTokens":"Utilizza i token di recupero","tokens":"Token","addToken":"Aggiungi token","usePassword":"Utilizza la password","invalidCredentials":"Credenziali non valide","privateSecretMissing":"Questo agente è privato e il secret token non è disponibile. Accedi con un account autorizzato.","atLeast":"Almeno"},"widget":{"instruct":"Istruisci","test":"Prova","sound":"Audio","soundOff":"Audio disattivato","position":"Preferenze posizione","settings":"Impostazioni","share":"Condividi","shareChat":"Condividi chat","sendOnKeypress":"Premi Invio per inviare","sendOnClick":"Clicca su Invia","boardOfExperts":"Board di esperti","showExpertsInTheBoard":"Mostra esperti in questa board","expertsInTheBoard":"Esperti in questa board","goToIntegrationsToCustomizeAvatar":"Per personalizzare l\'avatar, vai a Condividimi e configura la pagina pubblica","chatAssistantStatus":"Attiva • Risponde in pochi secondi","agentStatusListening":"in ascolto","agentStatusSpeaking":"sta parlando","agentStatusProcessing":"in elaborazione","shareLocation":"Condividi posizione","shareLocationHint":"Ricevi risposte in base a dove ti trovi","shareLocationAria":"Condividi la posizione con l\'assistente","knownFactsHint":"Le informazioni che ricordo su di te","aiConsumption":"Consumi AI","editPositionAria":"Modifica posizione","positionResolving":"Ricerca indirizzo…","geocodingFailed":"Impossibile ottenere l\'indirizzo. Riprova o cerca manualmente.","positionUnavailableManual":"Posizione non disponibile. Inseriscila manualmente.","positionSharingEnabled":"Posizione condivisa.","headerHistory":"Cronologia","headerProfile":"Profilo","headerLogin":"Accedi","downloadQrCode":"Scarica QR Code","expandToImmersive":"Espandi per vista immersiva","moreActions":"Altre azioni","mobileSession":{"session":"Sessione","sessionInfo":"Info sessione","copyLinkOrDownload":"Copia link o scarica","currentlyOff":"Attualmente disattivato","whatIKnowAboutYou":"Dettagli delle informazioni condivise tra te e {{memoriName}}","locationTracking":"Tracciamento posizione","locationStatus":"Stato","useCurrentPosition":"Usa posizione attuale","disableLocationSharing":"Disattiva condivisione posizione","openKnownFacts":"Apri tutti i fatti noti","knownFactsMessages":"{{count}} messaggi nella sessione corrente"}},"exportChatHistory":{"exportPDF":"Esporta chat come PDF","exporting":"Esportazione in corso...","empty":"Nessuna cronologia chat da esportare","pdfNotSupported":"L\'esportazione PDF non è supportata in questo browser","success":"Chat esportata in PDF con successo","error":"Impossibile esportare la chat in PDF. Riprova."},"write_and_speak":{"micButtonPopover":"Premi il pulsante per parlare","micButtonPopoverListening":"Premi il pulsante per smettere di parlare","stopRecording":"Interrompi registrazione","sendRecording":"Invia messaggio vocale","recordingInProgress":"Registrazione in corso","pageInstructExplanation":"Per insegnarmi nuove cose clicca sul pulsante ISTRUISCIMI per cominciare","pageTryMeExplanation":"Per iniziare a conversare clicca sul pulsante INIZIAMO","pagePrivacyExplanation":"Le conversazioni sono visibili all\'autore dell\'agente","aiDisclaimer":"L\'agente può commettere errori. Assicurati di verificare le risposte.","downloadChat":"Scarica chat","pagePrivacyExplanationList":{"allConversations":"Tutte le conversazioni con questo agente sono visibili all\'autore dell\'agente","anonymousUser":"Per utenti anonimi: l\'autore vedrà il contenuto e l\'indirizzo IP","registeredUser":"Per utenti registrati: l\'autore vedrà il contenuto e il nome utente","contentAndUsername":"L\'autore può vedere il contenuto, il tuo nome utente e il tuo indirizzo IP","contentAndIpAddress":"L\'autore può vedere il contenuto e il tuo indirizzo IP","authorUsesInfo":"L\'autore utilizza queste informazioni per migliorare le funzionalità dell\'agente."},"instructButton":"ISTRUISCIMI","tryMeButton":"INIZIAMO","resumeButton":"RIPRENDI","chatHistory":"Cronologia chat","chatHistoryDescription":"Mostra la cronologia chat con questo agente","loadingChatHistory":"Caricamento cronologia chat...","noChatHistoryAvailable":"Nessuna cronologia chat disponibile","noResultsFound":"Nessun risultato trovato per \\"{{searchText}}\\"","searchInChatHistory":"Cerca nelle conversazioni","filters":"Filtri","latestFirst":"Più recenti prima","oldestFirst":"Più vecchi prima","exportChat":"Esporta 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 se vuoi impostare una conversazione continua. Setta i secondi di silenzio prima dell\'invio.","continuousSpeechLabel":"Conversazione continua","continuousSpeechDisabled":"Conversazione continua disabilitata poichè l\'agente è in modalità muta","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 dall\'agente","showMessageConsumptionLabel":"Mostra consumo per messaggio","secondsLabel":"Secondi","controlsPosition":"Posizione dei controlli","avatarControls":"Controlli Avatar","height":"Altezza","depth":"Profondità","avatarType":"Tipo Avatar","blob":"Blob","avatar3d":"Avatar 3D","zoomed":"Vicino","normal":"Normale","far":"Lontano","suggestions":"Usa le frecce per regolare l\'altezza dell\'avatar\\nUsa +/- per regolare la profondità dell\'avatar","enablePositionControls":"Abilita controlli posizione","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!","requirePositionHelp":"Per parlare con {{name}} devi decidere se fornire o meno la tua posizione. Questo perchè diverse risposte che potrà fornirti potrebbero dipendere da dove ti trovi.","dontWantToProvidePosition":"Continua senza posizione","requireLoginHelp":"Per parlare con {{name}} devi prima accedere con il tuo account.","skipLocationTitle":"Non verrà salvata alcuna posizione sulla mappa.","locationSaved":"La tua posizione è stata salvata.","locationSavedWithPlace":"La tua posizione è stata salvata: {{place}}","locationSkippedConfirm":"Continuerai senza condividere la posizione.","placeSelected":"Luogo selezionato: {{place}}","locationPermissionDenied":"Accesso alla posizione negato. Abilitalo nelle impostazioni del browser oppure scegli un luogo sulla mappa.","locationUnavailable":"Non è stato possibile rilevare la tua posizione. Riprova o cerca un luogo.","locationRequestTimedOut":"Richiesta di posizione scaduta. Riprova o cerca un luogo.","locationErrorGeneric":"Si è verificato un problema durante il recupero della posizione.","attachmentsLabel":"Arricchisci il tuo messaggio","image":"immagine","images":"immagini","file":"file","files":"file","function":"funzione","functions":"funzioni","iWantToTalkToIn":"Voglio parlare con {{name}} in","chatLanguageLabel":"Scegli la lingua della conversazione","chatResumed":"Chat ripresa con successo.","message":"messaggio","messages":"messaggi","page":"Pagina {{current}} di {{total}}","downloadThisConversation":"Scarica questa conversazione","downloadAllConversations":"Scarica tutte le conversazioni","conversationsCount_one":"{{count}} conversazione","conversationsCount_other":"{{count}} conversazioni","shownOfTotal":"Mostrate {{shown}} di {{total}}","loadMore":"Carica altre","backToConversationList":"Torna all\'elenco delle conversazioni","thisWeek":"Questa settimana"},"chatResume":{"resume":"Riprendi la conversazione"},"artifact":{"close":"Chiudi","size":"Dimensione","updated":"aggiornato","updateFailed":"Aggiornamento non applicato","updateFailedHint":"Il patch non corrisponde al contenuto attuale. Chiedi di riscrivere l\'artifact.","generated":"Generato","download":"Scarica","print":"Stampa","external":"Apri in una nuova finestra","type":"Tipo","fullscreen":"Schermo intero","exitFullscreen":"Esci da schermo intero","copy":"Copia","generatedAt":"Generato il","open":"Apri","code":"Codice","source":"Sorgente","preview":"Anteprima","resizeHandle":"Ridimensiona il pannello artifact","copied":"Copiato!","error":"Errore","generatingPdf":"Generazione PDF...","copying":"Copia in corso...","moreCopyOptions":"Altre opzioni di copia","copyAs":"Copia come","downloadAsMarkdown":"Scarica come Markdown","downloadRawMarkdownText":"Scarica testo markdown grezzo","downloadAsPdf":"Scarica come PDF","exportAsPdfDocument":"Esporta come documento PDF","downloadAsHtml":"Scarica come HTML","downloadFormattedHtml":"Scarica HTML formattato","viewMode":"Modalità Visualizzazione","codeMode":"Modalità Codice","refresh":"Aggiorna","share":"Condividi","downloadAsJson":"Scarica come JSON","downloadJsonData":"Scarica dati JSON","downloadAsPng":"Scarica come PNG","downloadPngImage":"Scarica immagine PNG","downloadAsJpeg":"Scarica come JPEG","downloadJpegImage":"Scarica immagine JPEG","downloadAsGif":"Scarica come GIF","downloadGifImage":"Scarica immagine GIF","downloadAsWebp":"Scarica come WebP","downloadWebpImage":"Scarica immagine WebP","copyAsSvg":"Copia come SVG","copySvgSourceCode":"Copia codice sorgente SVG","copyAsPlainText":"Copia come testo normale","copyAsText":"Copia come testo","copyAsLanguage":"Copia come {{language}}","copyLanguageCode":"Copia codice {{language}}","copyWithoutSyntaxHighlighting":"Copia senza evidenziazione sintassi","copyTextContent":"Copia contenuto testo","pdfExportNotSupported":"L\'esportazione PDF non è supportata in questo browser","popupBlocked":"Popup bloccato! Abilita i popup per stampare.","safariPdfInstructions":"Esportazione PDF aperta in una nuova finestra. Usa Cmd+P (Mac) o Ctrl+P (Windows) per stampare e salvare come PDF."},"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 Agente 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}}"},"upload":{"loginRequired":"Login richiesto","pastedText":"testo-copiato","uploadNotification":"Upload Fallito","loginRequiredDescription":"Per caricare immagini, devi prima accedere","uploadFiles":"Carica file (drag and drop)","uploadFilesOrImages":"Carica file o immagini","uploadFilesWithShortcut":"{{shortcut}}+O per aprire il selettore file","uploadImages":"Carica immagini","lastDocumentSlot":"Carica ultimo documento","uploadDocuments":"Carica documenti","maxDocumentsReached":"Puoi caricare fino a {{max}} documenti","replace":"Sostituisci documento","maxImagesReached":"Puoi caricare fino a {{max}} immagini","apiClientNotConfigured":"Client API non configurato correttamente per il caricamento di media","fileReadingFailed":"Lettura del file fallita","uploadFailed":"Caricamento fallito","uploadSuccess":"Caricamento riuscito","remaining":"rimanenti","maxReached":"Limite raggiunto","titleImage":"Aggiungi un titolo all\'immagine","titleImageUpload":"Carica immagini","titleHelp":"Aggiungi un titolo descrittivo per aiutare l\'AI a fornire risposte più appropriate.","titlePlaceholder":"Inserisci il titolo dell\'immagine","uploadSuccessDescription":"Il file è stato caricato con successo","partialUpload":"Solo {{uploaded}} immagini su {{total}} immagini saranno caricate. Massimo {{max}} immagini consentite.","cancel":"Annulla","dragAndDropFiles":"Trascina qui i file per aggiungerli alla chat","pasteMaxAttachmentsReached":"Massimo {{max}} allegati. Rimuovine uno per aggiungere questo come file.","pasteContentTooLong":"Il testo incollato è troppo lungo (max {{size}}KB). Accorcialo o dividilo.","pasteContentExceedsLimit":"Il contenuto incollato supera il limite di dimensione. Prova ad accorciare il testo o a dividerlo in parti più piccole.","pasteAddedAsAttachment":"Testo incollato aggiunto come allegato","filesNotAddedMaxAllowed":"{{count}} file non aggiunto/i (massimo {{max}} file consentiti).","documentsNotAddedMaxAllowed":"{{count}} documento/i non aggiunto/i (massimo {{max}} file consentiti).","imagesNotAddedMaxAllowed":"{{count}} immagine/i non aggiunta/e (massimo {{max}} file consentiti).","documentsNotAddedContextSize":"{{count}} documento/i non aggiunto/i (limite dimensione contesto).","partialAssetUploadWarning":"Alcuni link del file non sono stati caricati, ma il documento è stato aggiunto comunque.","anonymousRetentionNotice":"Nota: i file caricati vengono conservati per massimo 24 ore."},"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 agente è diventato più evoluto con {{points}} punti, guarda le","statistics":"statistiche"},"login":{"login":"Accedi","title":"Accedi al tuo account","loggingIn":"Accesso in corso…","logout":"Esci","userNameRequired":"Il nome utente è obbligatorio","userName":"Nome utente","userNamePlaceholder":"Inserisci il nome utente","user":"Utente","loggedDrawerTitle":"Ciao, {{name}}!","loginDrawerTitle":"Accedi","signupDrawerTitle":"Registrati","newUserSignUp":"Sei un nuovo utente?","signUp":"Registrati!","alreadyHaveAnAccount":"Hai già un account?","backToLogin":"Torna al login","registrationDisabled":"La registrazione è disabilitata.","contactAdmin":"Contatta l\'amministratore per richiedere l\'accesso","userNameOrEmail":"Nome utente o email","email":"Email","emailFormatError":"Per favore, inserisci una mail valida","username":"Nome utente","usernameContainsReservedWord":"Il nome utente contiene una parola riservata, per favore cambia il nome utente","usernameFormatError":"Il nome utente deve essere lungo almeno 3 caratteri e può contenere solo lettere, numeri e _","otpCode":"Codice di verifica","resendVerificationCode":"Invia di nuovo","resentVerificationCode":"Codice di verifica inviato! Controlla la tua mail.","welcomeTitle":"Bentornato","welcomeDescription":"Inserisci il tuo codice di verifica a 4 cifre per continuare al tuo account","otpTitle":"Inserisci il codice di verifica","otpDescription":"Inserisci il codice a 4 cifre che hai generato nel tuo account","otpStep1":"Clicca il pulsante qui sotto per aprire il tuo account","otpStep2":"Genera un codice di verifica a 4 cifre (valido per 5 minuti)","otpStep3":"Torna qui e inserisci il codice","startOtpLogin":"Inizia verifica","generateOtp":"Genera codice","otpTimer":"Il codice scade tra {{time}}","otpInvalidFormat":"Inserisci un codice valido a 4 cifre","otpInvalid":"Codice di verifica non valido","otpError":"Errore nella validazione del codice. Riprova.","otpSuccess":"Login effettuato con successo!","otpEmailTitle":"Inserisci la tua email","otpEmailDescription":"Inserisci il tuo indirizzo email per ricevere un codice di verifica","otpCodeDescription":"Inserisci il codice a 4 cifre inviato a {{email}}","emailPlaceholder":"Inserisci la tua email","sendOtp":"Invia il codice","resendOtp":"Reinvia","resendOtpIn":"Reinvia tra {{seconds}}s","resendOtpPrompt":"Non è arrivato? Reinvia tra {{seconds}} s","resendOtpQuestion":"Non è arrivato?","resending":"Invio in corso...","backToEmail":"Torna all\'email","editEmail":"Modifica","otpSentToPrefix":"Abbiamo mandato un codice di 4 cifre a","otpCodeShort":"Codice","loginBenefitLine1":"{{memoriName}} ti mostra la cronologia delle chat, che puoi riprendere in qualsiasi momento.","loginBenefit":"{{memoriName}} ti mostra la cronologia delle chat, che puoi riprendere in qualsiasi momento.","passwordlessHint":"Ti mandiamo un codice di 4 cifre. Nessuna password da ricordare.","defaultAgentName":"l\'agente","otpSent":"Codice di verifica inviato!","otpResent":"Codice reinviato con successo!","otpSendError":"Errore nell\'invio del codice. Riprova.","emailRequired":"Email richiesta","emailInvalid":"Inserisci un indirizzo email valido","userNotFound":"Utente non trovato","otpNotFound":"Codice di verifica non trovato","otpExpired":"Il codice di verifica è scaduto","otpMissing":"Il codice di verifica è richiesto","otpAttemptsExceeded":"Troppi tentativi. Richiedi un nuovo codice di verifica.","otpSuccessMessage":"Verifica completata! Reindirizzamento...","otpSuccessDescription":"Il tuo account è stato verificato con successo. Sarai reindirizzato a breve.","otpHelp":"Inserisci il codice a 4 cifre dalla tua email","emailHelp":"Ti invieremo un codice di verifica","userFetchError":"Errore nel caricamento dei dati utente. Riprova.","otpStep1Title":"Inserisci Email","otpStep2Title":"Controlla Email","otpStep3Title":"Inserisci Codice","featureFast":"Veloce","featureSecure":"Sicuro","featureMobile":"Mobile","quickActions":"Azioni rapide","verified":"Verificato","termsStatus":"Stato dei termini","enabled":"Abilitato","disabled":"Disabilitato","advancedFeatures":"Funzionalità avanzate","help":"Aiuto","editProfile":"Modifica profilo","notifications":"Notifiche","logoutConfirm":"Sei sicuro di voler uscire?","comingSoon":"Presto disponibile!","accountOverview":"Panoramica account","notSet":"Non impostato","accepted":"Accettato","password":"Password","newPassword":"Nuova password","confirmPassword":"Conferma la password","currentPassword":"Password attuale","passwordMatchingError":"Le password non coincidono.","passwordFormatError":"La password deve essere lunga almeno 8 caratteri e contenere almeno un numero, una lettera maiuscola, una minuscola e un simbolo","pwdWeak":"Debole","pwdAcceptable":"Accettabile","pwdStrong":"Forte","mustChangePassword":"Devi cambiare la password","passwordChange":"Cambio password","emailChange":"Cambio email","avatarChange":"Cambio avatar","avatarUploadSuccess":"Immagine del profilo aggiornata.","underage":"Devi avere almeno {{age}} anni per registrarti.","optional":"opzionale","birthDate":"Data di nascita","birthDatePlaceholder":"GG/MM/AAAA","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 dell\'agente 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","editAccount":"Modifica account","save":"Salva","successfullyLoggedIn":"{{username}} ha effettuato l\'accesso con successo"},"chatLogs":{"llm":"LLM","model":"Modello","provider":"Provider","tokens":"Token","input":"Input","output":"Output","cacheRead":"Cache read","cacheWrite":"Cache write","duration":"Durata","energy":"Energia","co2":"CO2","water":"Acqua","usageBadgesHint":"Clicca uno di questi pulsanti per mostrare maggiori informazioni","totalChatConsumptionTitle":"Consumo Totale Chat","modelUsage":"Utilizzo del modello","environmentalImpact":"Impatto ambientale","impactComparisonUnavailable":"Confronto indicativo non disponibile.","impactComparisonEnergy":"Confronto indicativo: circa quanto tenere accesa una lampadina LED da 10 W per {{duration}}.","impactComparisonCo2":"Confronto indicativo: circa {{distance}} percorsi in auto a benzina media.","impactComparisonWater":"Confronto indicativo: circa {{count}} gocce d\'acqua.","energyImpactDescription":"Questo valore stima l\'energia elettrica necessaria per generare la risposta del modello. Serve a confrontare prompt, modelli e strategie diverse anche quando il singolo messaggio ha un impatto molto piccolo.","co2ImpactDescription":"La CO2 equivalente rappresenta l\'impatto climatico stimato del messaggio. Tradurre il consumo in emissioni aiuta a capire quanto una risposta AI pesa sull\'ambiente in termini comparabili.","waterImpactDescription":"Questo indicatore mostra l\'impronta idrica stimata associata all\'elaborazione del messaggio. Include l\'acqua impiegata indirettamente nell\'energia e nell\'infrastruttura che supportano il calcolo.","approximateValuesTooltip":"Questi valori sono approssimativi.","atLeast":"Almeno {{count}} messaggi","anyMessage":"Qualunque messaggio","atLeast1":"Almeno 1 messaggio","atLeast2":"Almeno 2 messaggi","atLeast3":"Almeno 3 messaggi","atLeast5":"Almeno 5 messaggi","atLeast10":"Almeno 10 messaggi","atLeast15":"Almeno 15 messaggi","atLeast20":"Almeno 20 messaggi","customMinimumMessages":"Personalizza il numero di messaggi"},"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.emptyPasswordPublic":"Impossibile aprire la sessione: il motore richiede una password, ma questo agente è pubblico.","error.goBackTo":"Prova a tornare alla","error.reloadPage":"Ricarica la pagina","error.tryAgain":"Riprova","error.unauthorized":"Non sei autorizzato a visualizzare questo contenuto.","errors":{"TENANT_NOT_FOUND":"Tenant non trovato","TENANT_REGISTRATION_DISABLED":"La registrazione su questa piattaforma è disabilitata","TENANT_MISSING_NAME":"Tenant: nome mancante","TENANT_MAX_USERS_REACHED":"Numero massimo di utenti raggiunto","TENANT_MAX_ADMINS_REACHED":"Numero massimo di utenti amministratori raggiunto","TENANT_ALREADY_EXISTS":"Tenant già esistente","TENANT_MISSING_DESCRIPTION":"Tenant: descrizione mancante","TENANT_CANT_SET_COMPLETION_PROVIDER":"Tenant: non abilitato a gestire il provider di completamento","TENANT_INVALID_TYPE":"Tenant: tipo non valido","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ù Agenti","USER_MISSING_NEW_PASSWORD":"Utente: nuova password mancante","USER_NOTHING_TO_DO":"Niente da fare","USER_CANT_CREATE_MEMORI":"Utente non abilitato a creare Agenti","USER_MAX_MEMORI_REACHED":"Massimo numero di Agenti raggiunto","USER_TOO_MANY_ATTEMPTS":"Troppi tentativi","USER_MUST_ACCEPT_TNC_AND_PP":"Devi accettare i termini e le condizioni","USER_BIRTH_DATE_CANT_BE_CHANGED":"Data di nascita non può essere cambiata","USER_CANT_SET_COMPLETION_PROVIDER":"Utente: non abilitato a gestire il provider di completamento","USER_CANT_ENABLE_DEEP_THOUGHT":"Utente: non abilitato a gestire Pensiero Profondo","USER_CANT_ENABLE_DCM_INTEGRATION":"Utente: non abilitato a gestire l\'integrazione con DCM","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"Utente: non abilitato a gestire la concatenazione o il gruppo di esperti","USER_CREATION_BILLING_DENIED_PERMISSION":"Non hai crediti sufficienti per creare un agente","USER_HAS_ONE_OR_MORE_COMPLETION_CONFIGS":"L\'utente ha una o più configurazioni completions","USER_CANT_BE_DELETED":"Utente non può essere cancellato","USER_ORDER_BY_INVALID":"Ordine non valido","MEMORI_NOT_FOUND":"Agente non trovato","MEMORI_NOT_ACCESSIBLE":"Agente non accessibile","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Solo il proprietario può cambiare il tag e il pin","SESSION_NOT_FOUND":"Sessione non trovata","SESSION_IS_NOT_ADMINISTRATIVE":"Sessione non amministrativa","SESSION_EXPIRED":"Sessione scaduta","speechMissingSession":"La voce richiede una sessione attiva","speechInvalidSession":"Sessione non valida","speechTenantMismatch":"La voce non è disponibile su questo sito","speechRateLimited":"Troppe richieste vocali. Attendi un momento e riprova.","SESSION_OTP_NOT_FOUND":"Codice di verifica non trovato","SESSION_OTP_EXPIRED":"Il codice di verifica è scaduto","SESSION_OTP_INVALID":"Codice di verifica non valido","SESSION_OTP_ATTEMPTS_EXCEEDED":"Troppi tentativi. Richiedi un nuovo codice di verifica.","MEMORI_MISSING_CONFIGURATION":"Agente: configurazione mancante","MEMORI_CONFIGURATION_NOT_FOUND":"Agente: configurazione non trovata","MEMORI_INVALID_PRIVACY_TYPE":"Agente: tipo di privacy non valido","MEMORI_MISSING_PASSWORD":"Agente: password mancante","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Agente: numero totale di token di recupero non valido","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Agente: numero minimo di token di recupero non valido","MEMORI_INVALID_VOICE_TYPE":"Agente: tipo di voce non valido","MEMORI_MISSING_NAME":"Agente: nome mancante","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Agente: password o token di recupero mancanti","MEMORI_INVALID_ID":"Agente: ID non valido","MEMORI_NAME_ALREADY_USED":"Nome Agente già in uso","MEMORI_INVALID_PIN":"Agente: PIN non valido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Agente: cambio TAG e PIN richiedono operazioni separate","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Agente: password non richiesta su agente pubblico","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Pensiero Profondo richiede l\'abilitazione delle completions","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"Il gruppo di esperti richiede l\'abilitazione delle completions","MEMORI_INVALID_COMPLETION_CONFIG":"Agente: configurazione completions non valida","MEMORI_MACRO_FUNCTIONS_REQUIRES_COMPLETIONS":"Macro funzioni richiede l\'abilitazione delle completions","MEMORI_BLOCKING_DATE_MISSING_OR_WRONG":"Agente: data di blocco mancante o non valida","MEMORI_LIST_FILTER_NOT_SPECIFIED":"Agente: filtro non specificato","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":"Agente: la configurazione non può essere modificata","MEMORI_MISSING_NEW_PASSWORD":"Agente: nuova password mancante","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","MEMORI_SESSION_NOT_FOUND":"Sessione non trovata","MEMORI_SESSION_DOESNT_ACCEPT_MEDIA":"Sessione non accetta media","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Agente: funzionalità richiede un abbonamento","INTEGRATION_NOT_FOUND":"Integrazione non trovata","INTEGRATION_INVALID_TYPE":"Tipo integrazione non valido","INTEGRATION_ALREADY_EXISTS":"Integrazione già esistente","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Agenti 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":"Agenti 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","ASSET_MALWARE_SCAN_THREATS_FOUND":"Asset: la scansione ha trovato minaccia malware","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 agente non valido","CONSUMPTIONLOG_INVALID_TYPE":"Tipo di log non valido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","CONSUMPTIONLOG_INVALID_USER_ID":"ID utente non valido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Memori ID non valido","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifiche: Periodo di estrazione chatlog non valido","BROADCAST_NOT_ALLOWED":"Broadcast non consentito","INVALID_NOTIFICATION_TYPE":"Tipo notifica non valido","NOTIFICATION_NOT_FOUND":"Notifica non trovata","INVALID_NOTIFICATION_FILTER":"Filtro notifica non valido","INVALID_NOTIFICATION_PERIOD":"Periodo notifica non valido","PROCESS_INVALID_TYPE":"Tipo di processo non valido","PROCESS_ALREADY_RUNNING":"Processo già in esecuzione","PROCESS_NOT_FOUND":"Processo non trovato","IMPORTCSV_MISSING_ROWS":"Importazione CSV: righe mancanti","IMPORTCSV_MISSING_CSV":"Importazione CSV: CSV mancante","IMPORTCSV_MISSING_SEPARATOR":"Importazione CSV: separatore mancante","IMPORTCSV_INVALID_SEPARATOR":"Importazione CSV: separatore non valido","IMPORTCSV_MISSING_HEADERS":"Importazione CSV: intestazioni mancanti","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Importazione CSV: separatore varianti titolo mancante","IMPORTCSV_INVALID_RECEIVER_ID":"Importazione CSV: ID receiver non valido","IMPORTCSV_INVALID_MEDIA_LINK":"Importazione CSV: link media non valido","IMPORTCSV_INVALID_LINK_TITLE_HANDLING":"Importazione CSV: titolo link non valido","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"Importazione CSV: encoding caratteri non rilevabile","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione CSV: impossibile importare in agenti segreti","IMPORTTXT_MISSING_ROWS":"Importazione TXT: righe mancanti","IMPORTTXT_INVALID_GRANULARITY":"Importazione TXT: granularità non valida","IMPORTTXT_INVALID_RECEIVER_ID":"Importazione TXT: ID receiver non valido","IMPORTTXT_INVALID_MEDIA_LINK":"Importazione TXT: link media non valido","IMPORTTXT_INVALID_LINK_TITLE_HANDLING":"Importazione TXT: titolo link non valido","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"Importazione TXT: encoding caratteri non rilevabile","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione TXT: impossibile importare in agenti segreti","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Importazione TXT: limite importazione superato","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Importazione TXT: importazione su GPT-4 richiede API key","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Importazione TXT: importazione richiede un piano a pagamento","IMPORTTXT_BILLING_DENIED_PERMISSION":"Importazione TXT: non hai crediti sufficienti per l\'operazione","IMPORT_MISSING_ROWS":"Importazione: righe mancanti","IMPORT_CANT_IMPORT_TO_SECRET_MEMORI":"Importazione: impossibile importare in agenti segreti","IMPORTMEMORI_INVALID_MEMORI_SPECS":"Importazione MEMORI: specifiche agente non valide","IMPORT_MISSING_JSONL":"Importazione MEMORI: JSONL mancante","IMPORTMEMORI_INVALID_SPECS":"Importazione MEMORI: specifiche non valide","EXPORT_MISSING_PASSWORD":"Esportazione: password mancante","EXPORTCSV_MISSING_CSV_SPECS":"Esportazione CSV: specifiche CSV mancanti","EXPORTCSV_MISSING_SEPARATOR":"Esportazione CSV: separatore mancante","EXPORTCSV_INVALID_SEPARATOR":"Esportazione CSV: separatore non valido","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Esportazione CSV: separatore varianti titolo mancante","EXPORTCSV_MISSING_NEW_LINE_CHAR":"Esportazione CSV: carattere di nuova riga mancante","EXPORTCSV_INVALID_NEW_LINE_CHAR":"Esportazione CSV: carattere di nuova riga non valido","EXPORTCSV_MISSING_PASSWORD":"Esportazione CSV: password mancante","EXPORTJSONL_MISSING_JSONL_SPECS":"Esportazione JSONL: specifiche JSONL mancanti","EXPORTJSONL_MISSING_PLATFORM":"Esportazione JSONL: piattaforma mancante","EXPORTJSONL_INVALID_PLATFORM":"Esportazione JSONL: piattaforma non valida","EXPORTJSONL_MISSING_PASSWORD":"Esportazione JSONL: password mancante","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"Esportazione JSONL: esportazione richiede un piano a pagamento","ANALYSIS_MISSING_QUERY":"Analisi: query mancante","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analisi: impossibile analizzare agenti segreti","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analisi: corrispondenza query utente richiede Pensiero Profondo","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Assegnazione badge: credenziali errate o mancanti","BADGE_ASSIGNMENT_MISSING_REF_ID":"Assegnazione badge: ID ref mancante","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Assegnazione badge: esito non trovato","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Assegnazione badge: URL di asserzione mancante","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Assegnazione badge: URL badge mancante","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Assegnazione badge: URL issuer mancante","BADGE_ASSIGNMENT_INVALID_URL":"Assegnazione badge: URL non valido","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Assegnazione badge: destinatario mancante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Assegnazione badge: tipo destinatario sconosciuto","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Assegnazione badge: identità destinatario mancante","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Assegnazione badge: tipo hash destinatario mancante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Assegnazione badge: tipo hash destinatario sconosciuto","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Assegnazione badge: identità destinatario errata","BADGE_NOT_FOUND":"Badge non trovato","OUTCOME_NO_DCM_CONFIGURED":"Outcome: nessun DCM configurato","OUTCOME_USER_BADGES_DISABLED":"Outcome: badge utente disabilitati","COMPLETION_CONFIG_MISSING_NAME":"Configurazione completions: nome mancante","COMPLETION_CONFIG_MISSING_PROVIDER":"Configurazione completions: provider mancante","COMPLETION_CONFIG_MISSING_ENDPOINT":"Configurazione completions: endpoint mancante","COMPLETION_CONFIG_MISSING_API_KEY":"Configurazione completions: API key mancante","COMPLETION_CONFIG_MISSING_MODEL":"Configurazione completions: modello mancante","COMPLETION_CONFIG_NO_PURPOSE_SPECIFIED":"Configurazione completions: almeno un tipo di completions deve essere specificato","COMPLETION_CONFIG_INVALID_NAME":"Configurazione completions: nome non valido","COMPLETION_CONFIG_INVALID_PURPOSE":"Configurazione completions: tipo di completions non valido","COMPLETION_CONFIG_INVALID_ENDPOINT":"Configurazione completions: endpoint non valido","COMPLETION_CONFIG_INCONSISTENT_ENDPOINT":"Configurazione completions: endpoint incoerente","COMPLETION_CONFIG_INVALID_PROVIDER":"Configurazione completions: provider non valido","COMPLETION_CONFIG_NOT_FOUND":"Configurazione completions: non trovata","COMPLETION_CONFIG_NOT_ACCESSIBLE":"Configurazione completions: non accessibile","COMPLETION_CONFIG_NAME_RESERVED":"Configurazione completions: nome riservato","COMPLETION_CONFIG_NAME_ALREADY_EXISTS":"Configurazione completions: nome già esistente","COMPLETION_CONFIG_VISIBILITY_CHANGE_NOT_ALLOWED":"Configurazione completions: cambiamento visibilità non consentito","COMPLETION_CONFIG_MISSING_MANDATORY_PREFIX":"Configurazione completions: prefisso obbligatorio mancante","COMPLETION_CONFIG_VISIBILITY_NOT_PERMITTED":"Configurazione completions: visibilità non consentita","COMPLETION_CONFIG_USE_AS_DEFAULT_NOT_PERMITTED":"Configurazione completions: uso come default non consentito","COMPLETION_CONFIG_USE_AS_DEFAULT_REQUIRES_TENANT_VISIBILITY":"Configurazione completions: uso come default richiede visibilità tenant","COMPLETION_CONFIG_CHARGEABLE_NOT_PERMITTED":"Configurazione completions: chargeable non consentito","COMPLETION_CONFIG_INVALID_APPLY_TO":"Configurazione completions: apply to non valido","COMPLETION_CONFIG_APPLY_TO_TENANT_NOT_ALLOWED":"Configurazione completions: apply to tenant non consentito","TRUSTED_APPLICATION_NOT_FOUND":"Applicazione trusted non trovata","TRUSTED_APPLICATION_NOT_ACCESSIBLE":"Applicazione trusted non accessibile","TRUSTED_APPLICATION_NAME_REQUIRED":"Applicazione trusted: nome richiesto","TRUSTED_APPLICATION_TOKEN_REQUIRED":"Applicazione trusted: token richiesto","TRUSTED_APPLICATION_NAME_ALREADY_EXISTS":"Applicazione trusted: nome già esistente","TRUSTED_APPLICATION_INVALID_TOKEN":"Applicazione trusted: token non valido"}}');var Xj={};Xj=JSON.parse('{"yes":"Yes","no":"No","confirm":"Confirm","apply":"Apply","cancel":"Cancel","show":"Show","hide":"Hide","send":"Send","scrollToLatest":"Scroll to latest","scrollToContinueReading":"Scroll to continue reading","close":"Close","clearHistory":"Clear chat","clearHistoryDone":"Chat cleared.","moreInfo":"More info","back":"Back","edit":"Edit","delete":"Delete","loading":"Loading","expand":"Expand","collapse":"Collapse","expandable":{"expand":"Expand"},"fullscreenEnter":"Enter fullscreen","fullscreenExit":"Exit fullscreen","center":"Center","bottom":"Bottom","hidden":"Hidden","day":"Day","all":"All","today":"Today","yesterday":"Yesterday","placeholder":"Ask a question","last_7_days":"Last 7 days","last_30_days":"Last 30 days","month":"Month","copied":"Copied!","year":"Year","dayPlaceholder":"DD","monthPlaceholder":"MM","yearPlaceholder":"YYYY","createdAt":"Creation date","date":"Birth date","selected":"Selected","page":"page","actions":"Actions","next":"Next","previous":"Previous","copy":"Copy","copyRawCode":"Copy raw code","feedback":"Feedback","feedbackThankYou":"Thank you for your feedback.","copyFailed":"Could not copy","functionCache":"Function cache","copyToClipboard":"Copy to clipboard","showOriginalText":"Show original","showTranslatedText":"Show translation","exactPosition":"Exact position","uncertain":"Uncertain","question":"Question","nothingFound":"Nothing found","venue":"Venue","searchVenue":"Search for a place…","privacyPolicy":"Privacy policy","popularLanguages":"Popular","allLanguages":"All Languages","memoriBlockedTitle":"Blocked","memoriBlockedUntil":"Agent 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","aiGeneratedNote":"The agent may make mistakes. Make sure to verify important information.","reasoning":"Reasoning...","thinking":"Thinking","thought":"Thought","thoughtFor":"Thought for {{count}}s","whyThisAnswer":"Where this answer comes from","whyThisAnswerHelper":"This answer was generated automatically by an artificial intelligence based on these verified contents.","whyThisAnswerDescription":"Knowledge-base contents the agent consulted to reply.","whyThisAnswerYouAsked":"You asked","whyThisAnswerUserAsked":"The user asked","whyThisAnswerAgentReplied":"The agent replied","whyThisAnswerShowFull":"Show the full answer","whyThisAnswerContentsUsed":"Contents used","whyThisAnswerOpen":"Open","whyThisAnswerDisclaimer":"The agent wrote this answer from these contents: it may contain errors or rephrasings. Check important information at the source.","whyThisAnswerEmptyTitle":"No contents consulted","whyThisAnswerEmptyDescription":"For this question the agent found no matches in the knowledge base: it replied from its instructions only.","whyThisAnswerEmptyAuthorDescription":"The question produced no matches. If it should have, add a content that covers it.","whyThisAnswerAddContent":"Add to the knowledge base","whyThisAnswerConfidenceHigh":"Strong match","whyThisAnswerConfidenceMedium":"Partial match","whyThisAnswerConfidenceLow":"Weak match","whyThisAnswerTypeQuestion":"Question and answer","whyThisAnswerTypeDocument":"Document","whyThisAnswerTypeWebsite":"Website","whyThisAnswerTypeStory":"Story","whyThisAnswerSourcesCount_one":"{{count}} source","whyThisAnswerSourcesCount_other":"{{count}} sources","whyThisAnswerNoSources":"No sources","receiverLabel":"Assigned to","completionsEnabled":"Advanced AI, can respond with automatically generated answers that may sometimes contain incorrect information","completionProviderDown":"This agent is integrated with a generative AI from {{provider}}, but it is currently unavailable. Try again later.","completionProviderMajorOutage":"This agent is integrated with a generative AI from {{provider}}, but it is completely down. This feature will not be available until the service is restored.","completionProviderPartialOutage":"This agent is integrated with a generative AI from {{provider}}, but it is experiencing partial outages. Some features may be unavailable or perform poorly.","completionProviderDegraded":"This agent is integrated with a generative AI from {{provider}}, but it is performing slower than usual. Responses may take longer or be less accurate.","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 agent.","errorFetchingSession":"Error during session loading","errorGettingReferralURL":"Error during referral loading","errorReopeningSession":"Error during session reopening","sessionExpiredReopening":"Session expired, reopening session","ageVerification":"Age verification","ageVerificationText":"To interact with this agent, you must be at least {{minAge}} years old.","ageVerificationSuccess":"Age verified with success.","nsfw":"NSFW: This agent contains adult contents","deepThought":"Deep Thought","deepThoughtWhatIs":"What is 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 agent\'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.","notEnoughCredits":"The author of this agent does not have enough credits to answer your question.","creditsCheckFailed":"We couldn\'t verify the credits for this agent. Please try again later or contact its author.","confirmDialog":{"title":"Do you want to leave this page?","message":"The changes you made will be lost."},"knownFacts":{"title":"Known facts","description":"What {{memoriName}} remembers about you. You can delete each entry.","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","searchPlaceholder":"Search known facts","select":"Select","loadMore":"Load more","factsCount_one":"{{count}} fact","factsCount_other":"{{count}} facts","shownOfTotal":"Showing {{shown}} of {{total}}","emptyTitle":"No facts yet","emptyDescription":"As you talk, the agent notes here what it learns about you. You can delete it at any time.","deleteLabel":"Delete this fact","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?","selected_one":"{{count}} fact selected","selected_other":"{{count}} facts selected","selectedRows_one":"{{count}} row selected","selectedRows_other":"{{count}} rows selected"},"auth":{"title":"Authentication","description":"This agent is protected. Enter the password to continue.","useRecoveryTokens":"Use recovery tokens","tokens":"Tokens","addToken":"Add token","usePassword":"Use password","passwordRequired":"Password required","invalidCredentials":"Invalid credentials","privateSecretMissing":"This agent is private and its secret token is not available. Sign in with an account that can open it.","atLeast":"At least"},"widget":{"instruct":"Instruct","test":"Test","sound":"Audio","soundOff":"Audio off","position":"Position preferences","settings":"Settings","share":"Share","shareChat":"Share chat","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","chatAssistantStatus":"Active • Replies in a few seconds","agentStatusListening":"listening","agentStatusSpeaking":"speaking","agentStatusProcessing":"processing","shareLocation":"Share location","shareLocationHint":"Get answers tailored to where you are","shareLocationAria":"Share location with the assistant","knownFactsHint":"What I remember about you","aiConsumption":"AI usage","editPositionAria":"Edit location","positionResolving":"Resolving address…","geocodingFailed":"Could not resolve the address. Try again or search manually.","positionUnavailableManual":"Location unavailable. Please enter it manually.","positionSharingEnabled":"Location shared.","headerHistory":"History","headerProfile":"Profile","headerLogin":"Log in","downloadQrCode":"Download QR Code","expandToImmersive":"Expand to immersive view","moreActions":"More actions","mobileSession":{"session":"Session","sessionInfo":"Session info","copyLinkOrDownload":"Copy link or download","currentlyOff":"Currently off","whatIKnowAboutYou":"Details of the information shared between you and {{memoriName}}","locationTracking":"Location tracking","locationStatus":"Status","useCurrentPosition":"Use current position","disableLocationSharing":"Disable location sharing","openKnownFacts":"Open full known facts","knownFactsMessages":"{{count}} messages in current session"}},"exportChatHistory":{"exportPDF":"Export chat as PDF","exporting":"Exporting...","empty":"No chat history to export","pdfNotSupported":"PDF export is not supported in this browser","success":"Chat exported to PDF successfully","error":"Failed to export chat to PDF. Please try again."},"write_and_speak":{"micButtonPopover":"Click the button to speak","micButtonPopoverListening":"Click the button to stop speak","stopRecording":"Stop recording","sendRecording":"Send voice message","recordingInProgress":"Recording in progress","pageInstructExplanation":"To teach me new things click on the INSTRUCT ME button to get started","pageTryMeExplanation":"To start talking to me click on the START button","pagePrivacyExplanation":"The conversations are visible by the author of the agent","aiDisclaimer":"The agent may make mistakes. Please verify the answers.","downloadChat":"Download chat","pagePrivacyExplanationList":{"allConversations":"All conversations with this agent are visible to the author of the agent","anonymousUser":"For anonymous users: the author will see the content of the conversation and your IP address","registeredUser":"For registered users: the author will see the content of the conversation and your username","contentAndUsername":"The author can see the content, your username and your IP address","contentAndIpAddress":"The author can see the content and your IP address","authorUsesInfo":"The author uses this information to improve the features of the agent and to provide you with a better service."},"instructButton":"INSTRUCT ME","tryMeButton":"START","resumeButton":"RESUME","chatHistory":"Chat history","chatHistoryDescription":"Show the chat history with this agent","loadingChatHistory":"Loading chat history...","noChatHistoryAvailable":"No chat history available","noResultsFound":"No results found for \\"{{searchText}}\\"","searchInChatHistory":"Search conversations","filters":"Filters","latestFirst":"Latest first","oldestFirst":"Oldest first","exportChat":"Export Chat","conversationStartedLabel":"Conversation started","settingsHeaderLabel":"Setup here if you want to set the continuous speech, and change the silence seconds if you want to customize them.","continuousSpeechLabel":"Continuous speech","continuousSpeechDisabled":"Continuous speech disabled because the agent is in mute mode","holdToSpeak":"Hold to speak","releaseToEndListening":"Release to end listening","pressAndHoldToSpeak":"Press and hold to speak","microphoneMode":"Microphone mode","hideEmissionsLabel":"Hide text emitted by the agent","showMessageConsumptionLabel":"Show message consumption","secondsLabel":"Set seconds","controlsPosition":"Controls position","avatarControls":"Avatar controls","height":"Height","depth":"Depth","avatarType":"Avatar type","suggestions":"Use the arrow keys to adjust the avatar height\\nUse +/- to adjust the avatar depth","blob":"Blob","avatar3d":"3D Avatar","zoomed":"Zoomed","normal":"Normal","far":"Far","enablePositionControls":"Enable position controls","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","requirePositionHelp":"To talk to {{name}} you have to decide whether to provide your position or not. This is because different answers that it can provide you may depend on where you are.","dontWantToProvidePosition":"Skip location","requireLoginHelp":"To talk to {{name}} you need to log in with your account first.","skipLocationTitle":"No map location will be saved.","locationSaved":"Your location was saved.","locationSavedWithPlace":"Your location was saved: {{place}}","locationSkippedConfirm":"You\'ll continue without sharing your location.","placeSelected":"Place selected: {{place}}","locationPermissionDenied":"Location access was denied. Allow location in your browser settings, or pick a place on the map.","locationUnavailable":"Your position could not be determined. Try again or search for a place.","locationRequestTimedOut":"Location request timed out. Try again or search for a place.","locationErrorGeneric":"Something went wrong while getting your location.","attachmentsLabel":"Enrich your message","image":"image","images":"images","file":"file","files":"files","function":"function","functions":"functions","iWantToTalkToIn":"I want to talk to {{name}} in","chatLanguageLabel":"Choose the conversation language","chatResumed":"Conversation resumed successfully.","message":"message","messages":"messages","page":"Page {{current}} of {{total}}","downloadThisConversation":"Download this conversation","downloadAllConversations":"Download all conversations","conversationsCount_one":"{{count}} conversation","conversationsCount_other":"{{count}} conversations","shownOfTotal":"Showing {{shown}} of {{total}}","loadMore":"Load more","backToConversationList":"Back to the conversation list","thisWeek":"This week"},"chatResume":{"resume":"Resume conversation"},"artifact":{"close":"Close","size":"Size","updated":"updated","updateFailed":"Update could not be applied","updateFailedHint":"The patch did not match the current content. Ask to rewrite the artifact.","generated":"Generated","download":"Download","print":"Print","external":"Open in a new window","type":"Type","fullscreen":"Fullscreen","exitFullscreen":"Exit fullscreen","generatedAt":"Generated at","copy":"Copy","open":"Open","code":"Code","source":"Source","preview":"Preview","resizeHandle":"Resize artifact panel","copied":"Copied!","error":"Error","generatingPdf":"Generating PDF...","copying":"Copying...","moreCopyOptions":"More copy options","copyAs":"Copy as","downloadAsMarkdown":"Download as Markdown","downloadRawMarkdownText":"Download raw markdown text","downloadAsPdf":"Download as PDF","exportAsPdfDocument":"Export as PDF document","downloadAsHtml":"Download as HTML","downloadFormattedHtml":"Download formatted HTML","viewMode":"View Mode","codeMode":"Code Mode","refresh":"Refresh","share":"Share","downloadAsJson":"Download as JSON","downloadJsonData":"Download JSON data","downloadAsPng":"Download as PNG","downloadPngImage":"Download PNG image","downloadAsJpeg":"Download as JPEG","downloadJpegImage":"Download JPEG image","downloadAsGif":"Download as GIF","downloadGifImage":"Download GIF image","downloadAsWebp":"Download as WebP","downloadWebpImage":"Download WebP image","copyAsSvg":"Copy as SVG","copySvgSourceCode":"Copy SVG source code","copyAsPlainText":"Copy as Plain Text","copyAsText":"Copy as text","copyAsLanguage":"Copy as {{language}}","copyLanguageCode":"Copy {{language}} code","copyWithoutSyntaxHighlighting":"Copy without syntax highlighting","copyTextContent":"Copy text content","pdfExportNotSupported":"PDF export is not supported in this browser","popupBlocked":"Popup blocked! Please enable popups to print.","safariPdfInstructions":"PDF export opened in new window. Please use Cmd+P (Mac) or Ctrl+P (Windows) to print and save as PDF."},"upload":{"loginRequired":"Login required","pastedText":"pasted-text","uploadNotification":"Upload Failed","loginRequiredDescription":"Please login to upload images","uploadFiles":"Upload files (drag and drop)","uploadFilesOrImages":"Upload files or images","uploadFilesWithShortcut":"{{shortcut}}+O to open file chooser","uploadImages":"Upload images","replace":"Replace","maxImagesReached":"You can upload up to {{max}} images","maxDocumentsReached":"You can upload up to {{max}} documents","remaining":"remaining","lastDocumentSlot":"Upload last document","uploadDocuments":"Upload documents","maxReached":"Max limit reached","imageTitle":"Image title: {{title}}","titleHelp":"Adding a descriptive title helps the AI provide more context and appropriate responses.","titlePlaceholder":"Enter image title","apiClientNotConfigured":"API client not configured properly for media upload","fileReadingFailed":"File reading failed","uploadFailed":"Upload failed","uploadSuccess":"Upload success","titleImage":"Add an image title","uploadSuccessDescription":"The file has been uploaded successfully","titleImageUpload":"Upload images","partialUpload":"Only {{uploaded}} images on {{total}} will be uploaded. Maximum {{max}} images allowed.","maxImages":"Maximum {{max}} images allowed.","upload":"Upload","dragAndDropFiles":"Drag and drop files here to add them to the chat","pasteMaxAttachmentsReached":"Maximum {{max}} attachments. Remove one to add this as a file.","pasteContentTooLong":"Pasted content is too long (max {{size}}KB). Shorten or split it.","pasteContentExceedsLimit":"Pasted content exceeds the size limit. Try shortening the text or splitting it into smaller parts.","pasteAddedAsAttachment":"Pasted content added as attachment","contextSizeExceedsLimit":"Context size exceeds the limit. Try reducing the number of files or content in the conversation.","filesNotAddedMaxAllowed":"{{count}} file(s) not added (maximum {{max}} files allowed).","documentsNotAddedMaxAllowed":"{{count}} document(s) not added (maximum {{max}} files allowed).","imagesNotAddedMaxAllowed":"{{count}} image(s) not added (maximum {{max}} files allowed).","documentsNotAddedContextSize":"{{count}} document(s) not added (context size limit).","partialAssetUploadWarning":"Some file links could not be uploaded, but the document was added anyway.","anonymousRetentionNotice":"Note: uploaded files are retained for a maximum of 24 hours."},"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 an agent 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 agent became more evolved with {{points}} points, look at the","statistics":"statistics"},"login":{"login":"Login","title":"Login to your account","loggingIn":"Logging you in…","logout":"Logout","user":"User","loggedDrawerTitle":"Hi, {{name}}!","userNameRequired":"Username required","userName":"Username","userNamePlaceholder":"Enter username","loginDrawerTitle":"Login","signupDrawerTitle":"Sign up","newUserSignUp":"New user?","signUp":"Sign up!","alreadyHaveAnAccount":"Already have an account?","backToLogin":"Back to login","registrationDisabled":"Registration is disabled","contactAdmin":"Contact the administrator to request access","userNameOrEmail":"Username or email","email":"Email","emailFormatError":"Please, insert a valid email","username":"Username","usernameContainsReservedWord":"Username contains a reserved word, please choose another one","usernameFormatError":"Username must be at least 3 characters long and contain only letters, numbers and _","otpCode":"Verification code","resendVerificationCode":"Resend code","resentVerificationCode":"Confirmation code sent! Please check your email.","welcomeTitle":"Welcome back","welcomeDescription":"Enter your 4-digit verification code to continue to your account","otpTitle":"Enter verification code","otpDescription":"Enter the 4-digit code you generated in your account","otpStep1":"Click the button below to open your account","otpStep2":"Generate a 4-digit verification code (valid for 5 minutes)","otpStep3":"Return here and enter the code","startOtpLogin":"Start verification","generateOtp":"Generate code","otpTimer":"Code expires in {{time}}","otpInvalidFormat":"Please enter a valid 4-digit code","otpInvalid":"Invalid verification code","otpError":"Error validating code. Please try again.","otpSuccess":"Login successful!","otpEmailTitle":"Enter your email","otpEmailDescription":"Enter your email address to receive a verification code","otpCodeDescription":"Enter the 4-digit code sent to {{email}}","emailPlaceholder":"Enter your email","sendOtp":"Send the code","resendOtp":"Resend","resendOtpIn":"Resend in {{seconds}}s","resendOtpPrompt":"Didn\'t arrive? Resend in {{seconds}} s","resendOtpQuestion":"Didn\'t arrive?","resending":"Resending...","backToEmail":"Back to email","editEmail":"Edit","otpSentToPrefix":"We sent a 4-digit code to","otpCodeShort":"Code","loginBenefitLine1":"{{memoriName}} can show you the chat history, which can be resumed at any time.","loginBenefit":"{{memoriName}} can show you the chat history, which can be resumed at any time.","passwordlessHint":"We\'ll send you a 4-digit code. No password to remember.","defaultAgentName":"the agent","otpSent":"Verification code sent!","otpResent":"Code resent successfully!","otpSendError":"Error sending code. Please try again.","emailRequired":"Email required","emailInvalid":"Please enter a valid email address","userNotFound":"User not found","otpNotFound":"Verification code not found","otpExpired":"Verification code has expired","otpMissing":"Verification code is required","otpAttemptsExceeded":"Too many attempts. Request a new verification code.","otpSuccessMessage":"Verification successful! Redirecting...","otpSuccessDescription":"Your account has been verified successfully. You will be redirected shortly.","otpHelp":"Enter the 4-digit code from your email","emailHelp":"We\'ll send you a verification code","userFetchError":"Error loading user data. Please try again.","otpStep1Title":"Enter Email","otpStep2Title":"Check Email","otpStep3Title":"Enter Code","featureFast":"Fast","featureSecure":"Secure","featureMobile":"Mobile","password":"Password","newPassword":"New password","confirmPassword":"Confirm Password","currentPassword":"Current password","passwordMatchingError":"Passwords do not match.","passwordFormatError":"Password must be at least 8 characters long and contain at least a number, an upper case letter, a lower case letter and a symbol","pwdWeak":"Weak","pwdAcceptable":"Acceptable","pwdStrong":"Strong","mustChangePassword":"You must change your password","passwordChange":"Change password","emailChange":"Change email","avatarChange":"Change avatar","avatarUploadSuccess":"Profile picture updated.","underage":"You must be at least {{age}} years old to sign up.","optional":"Optional","birthDate":"Birth date","birthDatePlaceholder":"DD/MM/YYYY","birthDateHelper":"We ask for your birth date only to enable or disable functionalities that have age restrictions","missingData":"Missing information","missingDataHelper":"We know that this is a bit annoying, but we need some more information 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 agent\'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","editAccount":"Edit account","save":"Save","welcomeUser":"Welcome User","verified":"Verified","premiumUser":"Premium","quickActions":"Quick Actions","editProfile":"Edit Profile","notifications":"Notifications","help":"Help","logoutConfirm":"Are you sure you want to logout?","comingSoon":"Coming soon!","accountOverview":"Account Overview","notSet":"Not set","accepted":"Accepted","pending":"Pending","termsStatus":"Terms Status","enabled":"Enabled","disabled":"Disabled","advancedFeatures":"Advanced Features","successfullyLoggedIn":"{{username}} has successfully logged in"},"chatLogs":{"llm":"LLM","model":"Model","provider":"Provider","tokens":"Tokens","input":"Input","output":"Output","cacheRead":"Cache read","cacheWrite":"Cache write","duration":"Duration","energy":"Energy","co2":"CO2","water":"Water","usageBadgesHint":"Click one of these buttons to show more information","totalChatConsumptionTitle":"Total Chat Consumption","modelUsage":"Model usage","environmentalImpact":"Environmental impact","impactComparisonUnavailable":"Indicative comparison unavailable.","impactComparisonEnergy":"Indicative comparison: roughly like keeping a 10 W LED bulb on for {{duration}}.","impactComparisonCo2":"Indicative comparison: about {{distance}} traveled by an average gasoline car.","impactComparisonWater":"Indicative comparison: about {{count}} drops of water.","energyImpactDescription":"This value estimates the electrical energy needed to generate the model response. It helps compare prompts, models, and strategies even when a single message has a very small impact.","co2ImpactDescription":"CO2 equivalent represents the estimated climate impact of the message. Converting consumption into emissions helps understand AI impact with comparable metrics.","waterImpactDescription":"This indicator shows the estimated water footprint associated with processing the message. It includes water indirectly used by the energy and infrastructure supporting computation.","approximateValuesTooltip":"These values are approximate.","anyMessage":"Any message","atLeast":"At least {{count}} messages","atLeast1":"At least 1 message","atLeast2":"At least 2 messages","atLeast3":"At least 3 messages","atLeast5":"At least 5 messages","atLeast10":"At least 10 messages","atLeast15":"At least 15 messages","atLeast20":"At least 20 messages","customMinimumMessages":"Customize the number of messages"},"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.","error.emptyPasswordPublic":"The session could not be opened: the engine requires a password, but this agent is public.","errors":{"TENANT_NOT_FOUND":"Tenant not found","TENANT_REGISTRATION_DISABLED":"Registration on this platform is disabled","TENANT_MISSING_NAME":"Tenant: name missing","TENANT_MAX_USERS_REACHED":"Maximum number of users reached","TENANT_MAX_ADMINS_REACHED":"Maximum number of admin users reached","TENANT_ALREADY_EXISTS":"Tenant already exists","TENANT_MISSING_DESCRIPTION":"Tenant: description missing","TENANT_CANT_SET_COMPLETION_PROVIDER":"Tenant: can\'t set completion provider","TENANT_INVALID_TYPE":"Tenant: invalid type","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 agents","USER_MAX_MEMORI_REACHED":"Maximum number of agents reached","USER_TOO_MANY_ATTEMPTS":"Too many attempts","USER_MUST_ACCEPT_TNC_AND_PP":"You must accept the terms and conditions","USER_BIRTH_DATE_CANT_BE_CHANGED":"Date of birth cannot be changed","USER_CANT_SET_COMPLETION_PROVIDER":"User: not allowed to manage completion provider","USER_CANT_ENABLE_DEEP_THOUGHT":"User: not enabled to manage Deep Thought","USER_CANT_ENABLE_DCM_INTEGRATION":"User: not enabled to manage DCM integration","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"User: not allowed to manage chaining or expert group","USER_CREATION_BILLING_DENIED_PERMISSION":"You don\'t have enough credits to create an agent","USER_HAS_ONE_OR_MORE_COMPLETION_CONFIGS":"The user has one or more completion configurations","USER_CANT_BE_DELETED":"User can\'t be deleted","USER_ORDER_BY_INVALID":"Order by invalid","MEMORI_NOT_FOUND":"Agent not found","MEMORI_NOT_ACCESSIBLE":"Agent not accessible","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Only owner can change tag or pin","SESSION_NOT_FOUND":"Session not found","SESSION_IS_NOT_ADMINISTRATIVE":"Non-administrative session","SESSION_EXPIRED":"Session expired","speechMissingSession":"Speech needs an active session","speechInvalidSession":"This session is not valid","speechTenantMismatch":"Speech is not available on this site","speechRateLimited":"Too many speech requests. Wait a moment and try again.","SESSION_OTP_NOT_FOUND":"Verification code not found","SESSION_OTP_EXPIRED":"Verification code has expired","SESSION_OTP_INVALID":"Invalid verification code","SESSION_OTP_ATTEMPTS_EXCEEDED":"Too many attempts. Request a new verification code.","MEMORI_MISSING_CONFIGURATION":"Agent: missing configuration","MEMORI_CONFIGURATION_NOT_FOUND":"Agent: configuration not found","MEMORI_INVALID_PRIVACY_TYPE":"Agent: invalid privacy type","MEMORI_MISSING_PASSWORD":"Agent: missing password","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Agent: total number of invalid recovery tokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Agent: minimum number of invalid recovery tokens","MEMORI_INVALID_VOICE_TYPE":"Agent: invalid voice type","MEMORI_MISSING_NAME":"Agent: missing name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Agent: missing password or recovery token","MEMORI_INVALID_ID":"Agent: invalid ID","MEMORI_NAME_ALREADY_USED":"Agent name already in use","MEMORI_INVALID_PIN":"Agent: Invalid PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Agent: TAG and PIN change require separate operations","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Agent: no password required when public","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Deep Thought requires completions to be enabled","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"The expert group requires completions to be enabled","MEMORI_INVALID_COMPLETION_CONFIG":"Agent: invalid completions configuration","MEMORI_MACRO_FUNCTIONS_REQUIRES_COMPLETIONS":"Macro functions requires completions to be enabled","MEMORI_BLOCKING_DATE_MISSING_OR_WRONG":"Agent: blocking date missing or wrong","MEMORI_LIST_FILTER_NOT_SPECIFIED":"Agent: list filter not specified","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":"Agent: configuration cannot be changed","MEMORI_MISSING_NEW_PASSWORD":"Agent: new password missing","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Feature requires subscription","INTEGRATION_NOT_FOUND":"Integration not found","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Invalid date from format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Invalid date to format","MEMORI_SESSION_NOT_FOUND":"Session not found","MEMORI_SESSION_DOESNT_ACCEPT_MEDIA":"Session doesn\'t accept media","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","ASSET_MALWARE_SCAN_THREATS_FOUND":"Asset: found malware threats","INVITATION_NOT_FOUND":"Invitation not found","INVITATION_NOT_ACCESSIBLE":"Invitation not accessible","INVITATION_ALREADY_ACCEPTED":"Invitation already accepted","INVITATION_ALREADY_REJECTED":"Invitation already rejected","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation: missing destination email","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation: destination email invalid","INVITATION_MISSING_TAG":"Invitation: missing tag","INVITATION_MISSING_PIN":"Invitation: PIN missing","INVITATION_INVALID_PIN":"Invitation: invalid PIN","INVITATION_INVALID_TYPE":"Invitation: invalid type","INVITATION_MISSING_DESTINATION_NAME":"Invitation: destination name missing","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation: tag and pin can\'t be changed","INVITATION_CANT_BE_CHANGED":"Intation: can\'t be changed","ACTIONLOG_INVALID_USER_ID":"Invalid user ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","ACTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","CONSUMPTIONLOG_INVALID_TYPE":"Invalid log type","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","CONSUMPTIONLOG_INVALID_USER_ID":"Invalid user ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifications: Invalid chat log extraction period","BROADCAST_NOT_ALLOWED":"Broadcast not allowed","INVALID_NOTIFICATION_TYPE":"Invalid notification type","NOTIFICATION_NOT_FOUND":"Notification not found","INVALID_NOTIFICATION_FILTER":"Invalid notification filter","INVALID_NOTIFICATION_PERIOD":"Invalid notification period","PROCESS_INVALID_TYPE":"Invalid process type","PROCESS_ALREADY_RUNNING":"Process already running","PROCESS_NOT_FOUND":"Process not found","IMPORTCSV_MISSING_ROWS":"CSV import: missing rows","IMPORTCSV_MISSING_CSV":"CSV Import: Missing CSV","IMPORTCSV_MISSING_SEPARATOR":"CSV import: missing separator","IMPORTCSV_INVALID_SEPARATOR":"CSV import: invalid separator","IMPORTCSV_MISSING_HEADERS":"CSV import: missing headers","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV import: missing title variant separator","IMPORTCSV_INVALID_RECEIVER_ID":"CSV import: invalid receiver ID","IMPORTCSV_INVALID_MEDIA_LINK":"CSV import: invalid media link","IMPORTCSV_INVALID_LINK_TITLE_HANDLING":"CSV import: invalid link title","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"CSV import: undetectable character encoding","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"CSV Import: Cannot import to Secret Memories","IMPORTTXT_MISSING_ROWS":"Importing TXT: missing rows","IMPORTTXT_INVALID_GRANULARITY":"Import TXT: invalid granularity","IMPORTTXT_INVALID_RECEIVER_ID":"Import TXT: invalid receiver ID","IMPORTTXT_INVALID_MEDIA_LINK":"Import TXT: invalid media link","IMPORTTXT_INVALID_LINK_TITLE_HANDLING":"Import TXT: invalid link title","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"TXT import: undetectable character encoding","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"TXT Import: Cannot import to Secret Memories","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Import TXT: import limit exceeded","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Import TXT: import on GPT-4 requires API key","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Import TXT: Import requires a paying plan","IMPORTTXT_BILLING_DENIED_PERMISSION":"Import TXT: you don\'t have enough credits for the operation","IMPORT_MISSING_ROWS":"Import: missing rows","IMPORT_CANT_IMPORT_TO_SECRET_MEMORI":"Import: can\'t import to Secret Memories","IMPORTMEMORI_INVALID_MEMORI_SPECS":"Import MEMORI: invalid memory specs","IMPORT_MISSING_JSONL":"Import: missing JSONL","IMPORTMEMORI_INVALID_SPECS":"Import MEMORI: invalid specs","EXPORT_MISSING_PASSWORD":"Export: missing password","EXPORTCSV_MISSING_CSV_SPECS":"CSV export: missing CSV specifications","EXPORTCSV_MISSING_SEPARATOR":"CSV export: missing separator","EXPORTCSV_INVALID_SEPARATOR":"CSV export: invalid separator","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV export: missing title variant separator","EXPORTCSV_MISSING_NEW_LINE_CHAR":"CSV export: missing newline character","EXPORTCSV_INVALID_NEW_LINE_CHAR":"CSV export: invalid newline character","EXPORTCSV_MISSING_PASSWORD":"CSV export: missing password","EXPORTJSONL_MISSING_JSONL_SPECS":"JSONL export: missing JSONL specifications","EXPORTJSONL_MISSING_PLATFORM":"JSONL export: missing platform","EXPORTJSONL_INVALID_PLATFORM":"JSONL export: invalid platform","EXPORTJSONL_MISSING_PASSWORD":"JSONL export: missing password","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"JSONL Export: Export requires a paid plan","ANALYSIS_MISSING_QUERY":"Analysis: missing query","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analysis: Unable to analyze Secret Memories","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analysis: matching user query requires Deep Thinking","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Badge assignment: incorrect or missing credentials","BADGE_ASSIGNMENT_MISSING_REF_ID":"Badge assignment: ref ID missing","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Badge assignment: result not found","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Badge assignment: Missing assertion URL","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Badge Assignment: Missing Badge URL","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Badge assignment: missing issuer URL","BADGE_ASSIGNMENT_INVALID_URL":"Badge assignment: Invalid URL","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Badge assignment: missing recipient","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Badge assignment: unknown recipient type","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Badge assignment: missing recipient identity","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Badge assignment: missing recipient hash type","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Badge assignment: recipient hash type unknown","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Badge assignment: incorrect recipient identity","BADGE_NOT_FOUND":"Badge not found","OUTCOME_NO_DCM_CONFIGURED":"Outcome: no DCM configured","OUTCOME_USER_BADGES_DISABLED":"Outcome: user badges disabled","COMPLETION_CONFIG_MISSING_NAME":"Completions configuration: missing name","COMPLETION_CONFIG_MISSING_PROVIDER":"Completions configuration: missing provider","COMPLETION_CONFIG_MISSING_ENDPOINT":"Completions configuration: missing endpoint","COMPLETION_CONFIG_MISSING_API_KEY":"Completions configuration: missing API key","COMPLETION_CONFIG_MISSING_MODEL":"Completions configuration: missing model","COMPLETION_CONFIG_NO_PURPOSE_SPECIFIED":"Completions configuration: at least one completions type must be specified","COMPLETION_CONFIG_INVALID_NAME":"Completions configuration: invalid name","COMPLETION_CONFIG_INVALID_PURPOSE":"Completions configuration: invalid completions type","COMPLETION_CONFIG_INVALID_ENDPOINT":"Completions configuration: invalid endpoint","COMPLETION_CONFIG_INCONSISTENT_ENDPOINT":"Completions configuration: inconsistent endpoint","COMPLETION_CONFIG_INVALID_PROVIDER":"Completions configuration: invalid provider","COMPLETION_CONFIG_NOT_FOUND":"Completions configuration: not found","COMPLETION_CONFIG_NOT_ACCESSIBLE":"Completions configuration: not accessible","COMPLETION_CONFIG_NAME_RESERVED":"Completions configuration: name reserved","COMPLETION_CONFIG_NAME_ALREADY_EXISTS":"Completions configuration: name already exists","COMPLETION_CONFIG_VISIBILITY_CHANGE_NOT_ALLOWED":"Completions configuration: visibility change not allowed","COMPLETION_CONFIG_MISSING_MANDATORY_PREFIX":"Completions configuration: missing mandatory prefix","COMPLETION_CONFIG_VISIBILITY_NOT_PERMITTED":"Completions configuration: visibility not permitted","COMPLETION_CONFIG_USE_AS_DEFAULT_NOT_PERMITTED":"Completions configuration: use as default not permitted","COMPLETION_CONFIG_USE_AS_DEFAULT_REQUIRES_TENANT_VISIBILITY":"Completions configuration: use as default requires tenant visibility","COMPLETION_CONFIG_CHARGEABLE_NOT_PERMITTED":"Completions configuration: chargeable not permitted","COMPLETION_CONFIG_INVALID_APPLY_TO":"Completions configuration: apply to invalid","COMPLETION_CONFIG_APPLY_TO_TENANT_NOT_ALLOWED":"Completions configuration: apply to tenant not allowed","TRUSTED_APPLICATION_NOT_FOUND":"Trusted application not found","TRUSTED_APPLICATION_NOT_ACCESSIBLE":"Trusted application not accessible","TRUSTED_APPLICATION_NAME_REQUIRED":"Trusted application: name required","TRUSTED_APPLICATION_TOKEN_REQUIRED":"Trusted application: token required","TRUSTED_APPLICATION_NAME_ALREADY_EXISTS":"Trusted application: name already exists","TRUSTED_APPLICATION_INVALID_TOKEN":"Trusted application: invalid token"}}');var Xz={};Xz=JSON.parse('{"yes":"Oui","no":"Non","confirm":"Confirmer","apply":"Appliquer","cancel":"Annuler","show":"Montrer","hide":"Cacher","send":"Envoyer","scrollToLatest":"Aller au dernier message","scrollToContinueReading":"Faites défiler pour continuer à lire","close":"Fermer","clearHistory":"Effacer la conversation","clearHistoryDone":"Conversation effacée.","moreInfo":"Plus d\'informations","back":"Retour","edit":"Modifier","delete":"Supprimer","loading":"Chargement","expand":"Développer","collapse":"Réduire","expandable":{"expand":"Développer"},"fullscreenEnter":"Entrez en plein écran","fullscreenExit":"Quitter le plein écran","center":"Centre","bottom":"Bas","hidden":"Caché","day":"Jour","month":"Mois","year":"Année","placeholder":"Faites une question","createdAt":"Date de création","all":"Tous","today":"Aujourd\'hui","date":"Date de naissance","yesterday":"Hier","last_7_days":"7 derniers jours","copied":"Copié !","missingData":"Informations manquantes","last_30_days":"30 derniers jours","selected":"Choisi","page":"page","actions":"Actes","next":"Suivant","previous":"Précédent","copy":"Copie","copyRawCode":"Copier le code brut","feedback":"Commentaires","feedbackThankYou":"Merci pour votre retour.","copyFailed":"Impossible de copier","functionCache":"Cache des fonctions","copyToClipboard":"Copier dans le presse-papier","showOriginalText":"Afficher l\'original","showTranslatedText":"Afficher la traduction","exactPosition":"Position exacte","uncertain":"Incertain","question":"Question","nothingFound":"Rien trouvé","venue":"Lieu","searchVenue":"Rechercher un lieu…","popularLanguages":"Populaires","allLanguages":"Toutes les langues","memoriBlockedTitle":"Bloqué","memoriBlockedUntil":"Agent bloqué jusqu\'à {{date}}","memoriBlockedAnon":"Actuellement \\"{{name}}\\"Je ne peux pas répondre, reviens ici {{date}}","memoriBlockedReasonExceedChats":"car il a dépassé le seuil mensuel de chats autorisés.","memoriBlockedGiverHelper":"Vous pouvez toujours le gérer en tant qu\'administrateur, mais les autres utilisateurs ne pourront pas interagir avec lui.","generatedByAI":"Réponse générée par l\'IA, peut occasionnellement générer des informations incorrectes","aiGeneratedNote":"L\'agent peut faire des erreurs. Assurez-vous de vérifier les informations importantes.","reasoning":"Réflexion...","thinking":"Réflexion","thought":"Réflexion","thoughtFor":"Réfléchi pendant {{count}} s","whyThisAnswer":"D\'où vient cette réponse","whyThisAnswerHelper":"Cette réponse a été générée automatiquement par une intelligence artificielle basée sur ces contenus vérifiés.","whyThisAnswerDescription":"Les contenus de la base de connaissances consultés par l\'agent pour répondre.","whyThisAnswerYouAsked":"Vous avez demandé","whyThisAnswerUserAsked":"Question de l\'utilisateur","whyThisAnswerAgentReplied":"L\'agent a répondu","whyThisAnswerShowFull":"Afficher la réponse complète","whyThisAnswerContentsUsed":"Contenus utilisés","whyThisAnswerOpen":"Ouvrir","whyThisAnswerDisclaimer":"La réponse a été rédigée par l\'agent à partir de ces contenus : elle peut contenir des erreurs ou des reformulations. Vérifiez les informations importantes à la source.","whyThisAnswerEmptyTitle":"Aucun contenu consulté","whyThisAnswerEmptyDescription":"Pour cette question, l\'agent n\'a trouvé aucune correspondance dans la base de connaissances : il a répondu uniquement d\'après ses instructions.","whyThisAnswerEmptyAuthorDescription":"La question n\'a produit aucune correspondance. Si elle devrait en avoir, ajoutez un contenu qui la couvre.","whyThisAnswerAddContent":"Ajouter à la base de connaissances","whyThisAnswerConfidenceHigh":"Correspondance élevée","whyThisAnswerConfidenceMedium":"Correspondance partielle","whyThisAnswerConfidenceLow":"Correspondance faible","whyThisAnswerTypeQuestion":"Question et réponse","whyThisAnswerTypeDocument":"Document","whyThisAnswerTypeWebsite":"Site web","whyThisAnswerTypeStory":"Récit","whyThisAnswerSourcesCount_one":"{{count}} source","whyThisAnswerSourcesCount_other":"{{count}} sources","whyThisAnswerNoSources":"Aucune source","receiverLabel":"Assigné à","completionsEnabled":"L\'IA avancée peut répondre avec des réponses générées automatiquement qui peuvent parfois contenir des informations incorrectes","completionProviderDown":"Ce Agent est intégré à une IA générative de {{provider}}, mais il est actuellement indisponible. ","completionProviderMajorOutage":"Ce Agent est intégré à une IA générative de {{provider}}, mais il est actuellement indisponible. Cette fonctionnalité ne sera pas disponible tant que le service ne sera pas restauré.","completionProviderPartialOutage":"Ce Agent est intégré à une IA générative de {{provider}}, mais il est actuellement indisponible. Cette fonctionnalité ne sera pas disponible tant que le service ne sera pas restauré.","completionProviderDegraded":"Ce Agent est intégré à une IA générative de {{provider}}, mais il est actuellement indisponible. Cette fonctionnalité ne sera pas disponible tant que le service ne sera pas restauré.","completionProviderFallbackName":"un prestataire externe","completionProviderCheckStatusPage":"Vérifier la page d\'état","boardOfExperts":"Conseil d\'experts","birthDate":"Date de naissance","birthDateHelper":"Nous demandons votre date de naissance uniquement pour activer ou désactiver les fonctionnalités qui ont des restrictions d\'âge","underage":"Vous devez être au moins {{age}} ans pour s\'inscrire.","underageTwinSession":"Vous devez être au moins {{age}} ans pour interagir avec ce Agent.","errorFetchingSession":"Erreur lors du chargement de la session","errorGettingReferralURL":"Erreur lors du chargement du référent","errorReopeningSession":"Erreur lors de la re-ouverture de la session","sessionExpiredReopening":"Session expirée, réouverture en cours","ageVerification":"Vérification de l\'âge","ageVerificationText":"Pour interagir avec ce Agent, vous devez être au minimum {{minAge}} ans.","ageVerificationSuccess":"Âge vérifié avec succès.","nsfw":"NSFW : Ce jumeau contient du contenu pour adultes","deepThought":"Pensée profonde","deepThoughtWhatIs":"Qu\'est-ce que Deep Thought ?","deepThoughtHelper":"Deep Thought est une fonctionnalité avancée de l\'IA qui vous permettra d\'exploiter pleinement vos conversations en les gardant une trace. ","deepThoughtDisclaimerTitle":"Pensée profonde activée","deepThoughtDisclaimer":"Deep Thought est une fonctionnalité avancée de l\'IA qui vous permettra d\'exploiter pleinement vos conversations en les gardant une trace. ","deepThoughtPreDisclaimerUnlogged":"Connectez-vous pour activer Deep Thought.","deepThoughtPreDisclaimerNotAllowed":"Deep Thought est désactivé car vous n\'avez pas consenti à son utilisation, vous pouvez le modifier à tout moment dans les paramètres de votre compte.","notEnoughCredits":"L\'auteur de ce Agent n\'a pas suffisamment de crédits pour répondre à votre question.","creditsCheckFailed":"Impossible de vérifier les crédits de cet agent. Réessayez plus tard ou contactez son auteur.","confirmDialog":{"title":"Voulez-vous quitter cette page ?","message":"Les modifications que vous avez apportées seront perdues."},"knownFacts":{"title":"Faits connus","description":"Ce que {{memoriName}} retient de vous. Vous pouvez supprimer chaque entrée.","type":"Taper","typeShortTerm":"Court terme","typeLongTerm":"Long terme","typeHelper":"Types :\\n","text":"Texte","searchPlaceholder":"Rechercher parmi les faits","select":"Sélectionner","loadMore":"Charger plus","factsCount_one":"{{count}} fait","factsCount_other":"{{count}} faits","shownOfTotal":"{{shown}} sur {{total}} affichés","emptyTitle":"Aucun fait pour le moment","emptyDescription":"Au fil de la conversation, l\'agent note ici ce qu\'il apprend sur vous. Vous pourrez le supprimer à tout moment.","deleteLabel":"Supprimer ce fait","deleteSuccess":"Fait connu supprimé","deleteConfirmTitle":"Supprimer un fait connu","deleteConfirmMessage":"Êtes-vous sûr de vouloir supprimer ce fait connu ?","deleteSelectedConfirmTitle":"Supprimer les faits connus sélectionnés","deleteSelectedConfirmMessage":"Etes-vous sûr de vouloir supprimer les faits connus sélectionnés ?","selected_one":"{{count}} fait sélectionné","selected_other":"{{count}} faits sélectionnés","selectedRows_one":"{{count}} ligne sélectionnée","selectedRows_other":"{{count}} lignes sélectionnées"},"auth":{"title":"Authentification","description":"Cet agent est protégé. Saisissez le mot de passe pour continuer.","useRecoveryTokens":"Utiliser des jetons de récupération","tokens":"Jetons","addToken":"Ajouter un jeton","invalidCredentials":"Identifiants invalides","privateSecretMissing":"Cet agent est privé et son jeton secret n\'est pas disponible. Connectez-vous avec un compte autorisé.","usePassword":"Utiliser le mot de passe","atLeast":"Au moins"},"widget":{"instruct":"Instruire","test":"Tester","sound":"Son","soundOff":"Son désactivé","position":"Préférences de position","settings":"Paramètres","share":"Partager","shareChat":"Partager le chat","sendOnKeypress":"Appuyez sur Entrée pour envoyer","sendOnClick":"Cliquez sur Envoyer","boardOfExperts":"Conseil d\'experts","showExpertsInTheBoard":"Afficher les experts dans ce conseil","expertsInTheBoard":"Experts dans ce conseil","goToIntegrationsToCustomizeAvatar":"Pour personnaliser l\'avatar, allez dans Partager et personnalisez la page publique","chatAssistantStatus":"Actif • Répond en quelques secondes","agentStatusListening":"à l\'écoute","agentStatusSpeaking":"parle","agentStatusProcessing":"en traitement","shareLocation":"Partager la position","shareLocationHint":"Obtenez des réponses adaptées à votre position","shareLocationAria":"Partager la position avec l\'assistant","knownFactsHint":"Ce que je retiens à votre sujet","aiConsumption":"Utilisation de l\'IA","editPositionAria":"Modifier la position","positionResolving":"Résolution de l\'adresse…","geocodingFailed":"Impossible de déterminer l\'adresse. Réessayez ou recherchez manuellement.","positionUnavailableManual":"Position indisponible. Saisissez-la manuellement.","positionSharingEnabled":"Position partagée.","headerHistory":"Historique","headerProfile":"Profil","headerLogin":"Connexion","downloadQrCode":"Télécharger le QR Code","expandToImmersive":"Agrandir pour une vue immersive","moreActions":"Plus d\'actions","mobileSession":{"session":"Session","sessionInfo":"Infos de session","copyLinkOrDownload":"Copier le lien ou télécharger","currentlyOff":"Actuellement désactivé","whatIKnowAboutYou":"Détails des informations partagées entre vous et {{memoriName}}","locationTracking":"Suivi de position","locationStatus":"Statut","useCurrentPosition":"Utiliser la position actuelle","disableLocationSharing":"Désactiver le partage de position","openKnownFacts":"Ouvrir tous les faits connus","knownFactsMessages":"{{count}} messages dans la session en cours"}},"exportChatHistory":{"exportPDF":"Exporter le chat en PDF","exporting":"Exportation en cours...","empty":"Aucun historique de chat à exporter","pdfNotSupported":"L\'exportation PDF n\'est pas prise en charge dans ce navigateur","success":"Chat exporté en PDF avec succès","error":"Échec de l\'exportation du chat en PDF. Veuillez réessayer."},"write_and_speak":{"conversationStartedLabel":"Conversation démarrée","micButtonPopover":"Cliquez sur le bouton pour parler","micButtonPopoverListening":"Cliquez sur le bouton pour arrêter de parler","stopRecording":"Arrêter l\'enregistrement","sendRecording":"Envoyer le message vocal","recordingInProgress":"Enregistrement en cours","pageInstructExplanation":"Pour m\'apprendre de nouvelles choses, cliquez sur le bouton INSTRUCTEZ-MOI pour commencer","pageTryMeExplanation":"Pour commencer à parler avec moi, cliquez sur le bouton START","pagePrivacyExplanation":"Les conversations sont visibles par l\'auteur de l\'agent","pagePrivacyExplanationTooltip":"En commençant la conversation, nous vous informons que :\\n\\n- Toutes les conversations avec cet agent sont visibles par l\'auteur de l\'agent\\n- Si vous utilisez la chat comme utilisateur anonyme, l\'auteur pourra voir le contenu de la conversation et votre adresse IP\\n- Si vous utilisez la chat comme utilisateur enregistré (connecté), l\'auteur pourra voir le contenu de la conversation et votre nom d\'utilisateur\\n- L\'auteur utilise ces informations pour améliorer les fonctionnalités de l\'agent et pour vous fournir un meilleur service\\n- En continuant la conversation, vous acceptez ces conditions.","pagePrivacyExplanationList":{"allConversations":"Toutes les conversations avec cet agent sont visibles par l\'auteur de l\'agent","anonymousUser":"Pour les utilisateurs anonymes : l\'auteur verra le contenu de la conversation et votre adresse IP","registeredUser":"Pour les utilisateurs enregistrés : l\'auteur verra le contenu de la conversation et votre nom d\'utilisateur","contentAndUsername":"L\'auteur peut voir le contenu, votre nom d\'utilisateur et votre adresse IP","contentAndIpAddress":"L\'auteur peut voir le contenu et votre adresse IP","authorUsesInfo":"L\'auteur utilise ces informations pour améliorer les fonctionnalités de l\'agent et pour vous fournir un meilleur service."},"aiDisclaimer":"L\'agent peut commettre des erreurs. Veuillez vérifier les réponses.","downloadChat":"Télécharger le chat","instructButton":"INSTRUCTEZ-MOI","tryMeButton":"COMMENCER","resumeButton":"RÉSUMER","chatHistory":"Historique des discussions","chatHistoryDescription":"Afficher l\'historique des discussions avec cet agent","loadingChatHistory":"Chargement de l\'historique des discussions...","noChatHistoryAvailable":"Aucun historique des discussions disponible","noResultsFound":"Aucun résultat trouvé pour \\"{{searchText}}\\"","searchInChatHistory":"Rechercher dans les conversations","filters":"Filtres","latestFirst":"Plus récents d\'abord","oldestFirst":"Plus anciens d\'abord","exportChat":"Exporter le Chat","settingsHeaderLabel":"Configurez ici si vous souhaitez définir la mémoire comme parole continue et modifiez les secondes de silence si vous souhaitez les personnaliser.","continuousSpeechLabel":"Discours continu","continuousSpeechDisabled":"Discours continu désactivé car l\'agente est en mode muté","holdToSpeak":"Attends pour parler","releaseToEndListening":"Relâcher pour terminer l\'écoute","pressAndHoldToSpeak":"Appuyez et maintenez pour parler","microphoneMode":"Mode micro","hideEmissionsLabel":"Masquer le texte émis par le Agent","showMessageConsumptionLabel":"Afficher la consommation par message","secondsLabel":"Régler les secondes","controlsPosition":"Position des commandes","tryMeHeaderLabel":"ESSAYER","unknownPosition":"Position inconnue","fieldPlace":"Écrivez le lieu (par exemple « Milano »)","showMapLinkFor":"Afficher la position sur la carte","useMyPosition":"Utiliser ma position","myPosition":"Votre poste","updatingPosition":"Mise à jour du poste...","placeNotFound":"Lieu introuvable !","requirePosition":"Insérez votre position avant de commencer","requirePositionHelp":"Pour parler à {{name}} vous devez décider si vous souhaitez ou non fournir votre poste. ","dontWantToProvidePosition":"Continuer sans lieu","requireLoginHelp":"Pour parler à {{name}}, vous devez d\'abord vous connecter à votre compte.","skipLocationTitle":"Aucune position ne sera enregistrée sur la carte.","locationSaved":"Votre position a été enregistrée.","locationSavedWithPlace":"Votre position a été enregistrée : {{place}}","locationSkippedConfirm":"Vous continuerez sans partager votre position.","placeSelected":"Lieu sélectionné : {{place}}","locationPermissionDenied":"L\'accès à la position a été refusé. Autorisez-la dans les paramètres du navigateur ou choisissez un lieu sur la carte.","locationUnavailable":"Impossible de déterminer votre position. Réessayez ou recherchez un lieu.","locationRequestTimedOut":"La demande de position a expiré. Réessayez ou recherchez un lieu.","locationErrorGeneric":"Un problème est survenu lors de l\'obtention de votre position.","attachmentsLabel":"Enrichissez votre message","image":"image","images":"images","file":"fichier","files":"fichiers","function":"fonction","functions":"fonctions","iWantToTalkToIn":"je veux parler à {{name}} dans","chatLanguageLabel":"Choisissez la langue de la conversation","chatResumed":"Conversation reprise avec succès.","message":"message","messages":"messages","page":"Page {{current}} de {{total}}","downloadThisConversation":"Télécharger cette conversation","downloadAllConversations":"Télécharger toutes les conversations","conversationsCount_one":"{{count}} conversation","conversationsCount_other":"{{count}} conversations","shownOfTotal":"{{shown}} sur {{total}} affichées","loadMore":"Charger plus","backToConversationList":"Retour à la liste des conversations","thisWeek":"Cette semaine"},"chatResume":{"resume":"Reprendre la conversation"},"artifact":{"close":"Fermer","size":"Taille","updated":"mis à jour","updateFailed":"Mise à jour non appliquée","updateFailedHint":"Le correctif ne correspond pas au contenu actuel. Demandez de réécrire l\'artifact.","generated":"Généré","download":"Télécharger","print":"Imprimer","external":"Ouvrir dans une nouvelle fenêtre","type":"Type","fullscreen":"Plein écran","exitFullscreen":"Quitter le plein écran","copy":"Copier","generatedAt":"Généré le","open":"Ouvrir","code":"Code","source":"Source","preview":"Aperçu","resizeHandle":"Redimensionner le panneau artifact","copied":"Copié !","error":"Erreur","generatingPdf":"Génération du PDF...","copying":"Copie en cours...","moreCopyOptions":"Plus d\'options de copie","copyAs":"Copier en tant que","downloadAsMarkdown":"Télécharger en Markdown","downloadRawMarkdownText":"Télécharger le texte markdown brut","downloadAsPdf":"Télécharger en PDF","exportAsPdfDocument":"Exporter en document PDF","downloadAsHtml":"Télécharger en HTML","downloadFormattedHtml":"Télécharger le HTML formaté","viewMode":"Mode Affichage","codeMode":"Mode Code","refresh":"Actualiser","share":"Partager","downloadAsJson":"Télécharger en JSON","downloadJsonData":"Télécharger les données JSON","downloadAsPng":"Télécharger en PNG","downloadPngImage":"Télécharger l\'image PNG","downloadAsJpeg":"Télécharger en JPEG","downloadJpegImage":"Télécharger l\'image JPEG","downloadAsGif":"Télécharger en GIF","downloadGifImage":"Télécharger l\'image GIF","downloadAsWebp":"Télécharger en WebP","downloadWebpImage":"Télécharger l\'image WebP","copyAsSvg":"Copier en SVG","copySvgSourceCode":"Copier le code source SVG","copyAsPlainText":"Copier en texte brut","copyAsText":"Copier en texte","copyAsLanguage":"Copier en {{language}}","copyLanguageCode":"Copier le code {{language}}","copyWithoutSyntaxHighlighting":"Copier sans coloration syntaxique","copyTextContent":"Copier le contenu texte","pdfExportNotSupported":"L\'exportation PDF n\'est pas prise en charge dans ce navigateur","popupBlocked":"Popup bloqué ! Veuillez activer les popups pour imprimer.","safariPdfInstructions":"Export PDF ouvert dans une nouvelle fenêtre. Veuillez utiliser Cmd+P (Mac) ou Ctrl+P (Windows) pour imprimer et sauvegarder en PDF."},"upload":{"loginRequired":"Connexion requise","pastedText":"texte-collé","uploadNotification":"Échec du téléchargement","loginRequiredDescription":"Veuillez vous connecter pour télécharger des images","uploadFiles":"Télécharger des fichiers (drag and drop)","uploadFilesOrImages":"Télécharger des fichiers ou des images","uploadFilesWithShortcut":"{{shortcut}}+O pour ouvrir le sélecteur de fichiers","uploadImages":"Télécharger des images","titleImage":"Ajouter un titre à l\'image","uploadDocuments":"Télécharger des documents","replace":"Remplacer","remaining":"restant","maxReached":"Limite atteinte","maxImagesReached":"Vous pouvez télécharger jusqu\'à {{max}} images","apiClientNotConfigured":"API client non configuré correctement pour le téléchargement de médias","fileReadingFailed":"Échec de la lecture du fichier","uploadFailed":"Échec du téléchargement","uploadSuccess":"Téléchargement réussi","uploadSuccessDescription":"Le fichier a été téléchargé avec succès","dragAndDropFiles":"Glissez et déposez les fichiers ici pour les ajouter à la chat","contextSizeExceedsLimit":"La taille du contexte dépasse la limite. Essayez de réduire le nombre de fichiers ou le contenu de la conversation.","filesNotAddedMaxAllowed":"{{count}} fichier(s) non ajouté(s) (maximum {{max}} fichiers autorisés).","documentsNotAddedMaxAllowed":"{{count}} document(s) non ajouté(s) (maximum {{max}} fichiers autorisés).","imagesNotAddedMaxAllowed":"{{count}} image(s) non ajoutée(s) (maximum {{max}} fichiers autorisés).","documentsNotAddedContextSize":"{{count}} document(s) non ajouté(s) (limite de taille du contexte).","partialAssetUploadWarning":"Certains liens de fichier n\'ont pas pu être téléversés, mais le document a été ajouté quand même.","anonymousRetentionNotice":"Remarque : les fichiers téléversés sont conservés pendant un maximum de 24 heures."},"media":{"title":"Titre","editAttributes":"Modifier les attributs du média","uploadMimeTypeNotAllowed":"Le type de fichier n\'est pas autorisé","uploadSizeLimitMessage":"La taille téléchargée est trop grande (max {{size}}Mo)","uploadWrongResolutionMessage":"La résolution doit être {{width}}x{{height}} pixels","memoriNameAlreadyUsed":"Vous avez déjà un jumeau portant ce nom","uploadHelperImages":"Téléchargez un fichier avec l\'extension png, jpg, jpeg ou gif, et ayant au maximum une taille de {{size}}Mo","uploadHelper":"Téléchargez un fichier ayant au maximum une taille de {{size}}Mo","uploadError":"Échec du téléchargement","square":"carré","scaleRatio":"Rapport d\'échelle","addMediaLabel":"Ajouter un média","insertThisMediaMsg":"Insérez ces médias","mediaUploadMessage":"Cliquez pour charger un nouveau média","addLinkLabel":"Ajouter un lien","linkKey":"URL","linkValue":"Titre du lien","insertThisLink":"Insérer un lien vers {{url}} avec titre {{title}}"},"gamification":{"level":"Niveau","points":"points","memoriReachedLevel":"est devenu plus évolué et a atteint le niveau","levelGoToStatistics":"{{Agent}} est au niveau {{level}} avec {{points}} points. ","congratulationsNewLevel":"Félicitations, vous avez atteint un nouveau niveau !","congratulationsNewLevelDescription":"Votre Agent est devenu plus évolué avec {{points}} points, regardez le","statistics":"statistiques"},"login":{"login":"Se connecter","title":"Se connecter à votre compte","loggingIn":"Connexion en cours…","logout":"Déconnexion","user":"Utilisateur","loggedDrawerTitle":"Salut, {{name}}!","userNameRequired":"Nom d\'utilisateur requis","userName":"Nom d\'utilisateur","userNamePlaceholder":"Inserisci le nom d\'utilisateur","loginDrawerTitle":"Se connecter","signupDrawerTitle":"S\'inscrire","newUserSignUp":"Nouvel utilisateur ?","signUp":"S\'inscrire!","alreadyHaveAnAccount":"Vous avez déjà un compte ?","backToLogin":"Retour à la connexion","registrationDisabled":"L\'inscription est désactivée","contactAdmin":"Contacter l\'administrateur pour demander l\'accès","userNameOrEmail":"Nom d\'utilisateur ou email","email":"E-mail","emailFormatError":"Veuillez insérer un email valide","username":"Nom d\'utilisateur","usernameContainsReservedWord":"Le nom d\'utilisateur contient un mot réservé, veuillez en choisir un autre","usernameFormatError":"Le nom d\'utilisateur doit comporter au moins 3 caractères et contenir uniquement des lettres, des chiffres et _","otpCode":"Le code de vérification","resendVerificationCode":"Renvoyer le code","resentVerificationCode":"Code de confirmation envoyé ! ","welcomeTitle":"Bon retour","welcomeDescription":"Entrez votre code de vérification à 4 chiffres pour continuer vers votre compte","otpTitle":"Entrez le code de vérification","otpDescription":"Entrez le code à 4 chiffres que vous avez généré dans votre compte","otpStep1":"Cliquez sur le bouton ci-dessous pour ouvrir votre compte","otpStep2":"Générez un code de vérification à 4 chiffres (valide pendant 5 minutes)","otpStep3":"Revenez ici et entrez le code","startOtpLogin":"Commencer la vérification","generateOtp":"Générer le code","otpTimer":"Le code expire dans {{time}}","otpInvalidFormat":"Veuillez entrer un code valide à 4 chiffres","otpInvalid":"Code de vérification invalide","otpError":"Erreur lors de la validation du code. Veuillez réessayer.","otpSuccess":"Connexion réussie !","otpEmailTitle":"Entrez votre email","otpEmailDescription":"Entrez votre adresse email pour recevoir un code de vérification","otpCodeDescription":"Entrez le code à 4 chiffres envoyé à {{email}}","emailPlaceholder":"Entrez votre email","sendOtp":"Envoyer le code","resendOtp":"Renvoyer","resendOtpIn":"Renvoyer dans {{seconds}}s","resendOtpPrompt":"Pas reçu ? Renvoyer dans {{seconds}} s","resendOtpQuestion":"Pas reçu ?","resending":"Envoi en cours...","backToEmail":"Retour à l\'email","editEmail":"Modifier","otpSentToPrefix":"Nous avons envoyé un code à 4 chiffres à","otpCodeShort":"Code","loginBenefitLine1":"{{memoriName}} peut vous montrer l\'historique de chat, qui peut être repris à tout moment.","loginBenefit":"{{memoriName}} peut vous montrer l\'historique de chat, qui peut être repris à tout moment.","passwordlessHint":"Nous vous envoyons un code à 4 chiffres. Aucun mot de passe à retenir.","defaultAgentName":"l\'agent","otpSent":"Code de vérification envoyé !","otpResent":"Code renvoyé avec succès !","otpSendError":"Erreur lors de l\'envoi du code. Veuillez réessayer.","emailRequired":"Email requis","emailInvalid":"Veuillez entrer une adresse email valide","otpNotFound":"Code de vérification introuvable","otpExpired":"Le code de vérification a expiré","otpMissing":"Le code de vérification est requis","otpAttemptsExceeded":"Trop de tentatives. Demandez un nouveau code de vérification.","otpSuccessMessage":"Vérification réussie ! Redirection...","otpSuccessDescription":"Votre compte a été vérifié avec succès. Vous allez être redirigé sous peu.","otpHelp":"Entrez le code à 4 chiffres de votre email","emailHelp":"Nous vous enverrons un code de vérification","userFetchError":"Erreur lors du chargement des données utilisateur. Veuillez réessayer.","otpStep1Title":"Entrez l\'Email","otpStep2Title":"Vérifiez l\'Email","otpStep3Title":"Entrez le Code","featureFast":"Rapide","featureSecure":"Sécurisé","featureMobile":"Mobile","password":"Mot de passe","newPassword":"Nouveau mot de passe","confirmPassword":"Confirmez le mot de passe","currentPassword":"Mot de passe actuel","passwordMatchingError":"Les mots de passe ne correspondent pas.","passwordFormatError":"Le mot de passe doit comporter au moins 8 caractères et contenir au moins un chiffre, une lettre majuscule, une lettre minuscule et un symbole.","pwdWeak":"Faible","pwdAcceptable":"Acceptable","pwdStrong":"Fort","mustChangePassword":"Vous devez changer votre mot de passe","passwordChange":"Changer le mot de passe","emailChange":"Changer d\'e-mail","avatarChange":"Changer d\'avatar","avatarUploadSuccess":"Photo de profil mise à jour.","underage":"Vous devez être au moins {{age}} ans pour s\'inscrire.","optional":"Facultatif","birthDate":"Date de naissance","birthDatePlaceholder":"JJ/MM/AAAA","birthDateHelper":"Nous demandons votre date de naissance uniquement pour activer ou désactiver les fonctionnalités qui ont des restrictions d\'âge","missingData":"Informations manquantes","missingDataHelper":"Nous savons que c\'est un peu ennuyeux, mais nous avons besoin de plus d\'informations pour finaliser votre inscription.","goToAccountToChangeYourPreferences":"Vous pouvez modifier votre choix à tout moment depuis la page de votre compte.","deepThoughtExplaination":"Deep Thought est une fonctionnalité avancée de l\'IA qui vous permettra d\'exploiter pleinement vos conversations en les gardant une trace. ","tnCAndPPAcceptedHelper":"Depuis votre dernière connexion, les conditions générales et la politique de confidentialité ont changé. ","privacyLabel":"J\'ai lu et accepté le","privacyAndCookiePolicy":"Politique de confidentialité et de cookies","and":"et","termsOfService":"Conditions d\'utilisation","pAndCUAccepted":"J\'accepte les conditions d\'utilisation de Deep Thought","editAccount":"Modifier le compte","save":"Sauvegarder","successfullyLoggedIn":"{{username}} s\'est connecté avec succès"},"chatLogs":{"llm":"LLM","model":"Modèle","provider":"Fournisseur","tokens":"Tokens","input":"Entrée","output":"Sortie","cacheRead":"Lecture cache","cacheWrite":"Écriture cache","duration":"Durée","energy":"Énergie","co2":"CO2","water":"Eau","usageBadgesHint":"Cliquez sur un de ces boutons pour afficher plus d\'informations","totalChatConsumptionTitle":"Consommation Totale du Chat","modelUsage":"Utilisation du modèle","environmentalImpact":"Impact environnemental","impactComparisonUnavailable":"Comparaison indicative non disponible.","impactComparisonEnergy":"Comparaison indicative : environ comme laisser allumee une ampoule LED de 10 W pendant {{duration}}.","impactComparisonCo2":"Comparaison indicative : environ {{distance}} parcourus en voiture essence moyenne.","impactComparisonWater":"Comparaison indicative : environ {{count}} gouttes d\'eau.","energyImpactDescription":"Cette valeur estime l\'energie electrique necessaire pour generer la reponse du modele. Elle permet de comparer prompts, modeles et strategies meme quand l\'impact d\'un seul message est tres faible.","co2ImpactDescription":"Le CO2 equivalent represente l\'impact climatique estime du message. Traduire la consommation en emissions aide a comprendre le poids environnemental d\'une reponse IA avec des mesures comparables.","waterImpactDescription":"Cet indicateur montre l\'empreinte hydrique estimee associee au traitement du message. Il inclut l\'eau utilisee indirectement par l\'energie et l\'infrastructure qui soutiennent le calcul.","approximateValuesTooltip":"Ces valeurs sont approximatives.","anyMessage":"Tout message","atLeast":"Au moins {{count}} messages","atLeast1":"Au moins 1 message","atLeast2":"Au moins 2 messages","atLeast3":"Au moins 3 messages","atLeast5":"Au moins 5 messages","atLeast10":"Au moins 10 messages","atLeast15":"Au moins 15 messages","atLeast20":"Au moins 20 messages","customMinimumMessages":"Personnaliser le nombre de messages"},"success":"Succès","Error":"Erreur","internal server error":"Oupsie, désolé... Quelque chose s\'est mal passé sur le serveur","error":"Erreur","error.loading":"Erreur lors du chargement du contenu.","error.generic":"Oupsie, désolé... quelque chose s\'est mal passé.","error.serverNotResponding":"Nous effectuons une maintenance ou publions des mises à jour. ","error.notFound":"Oupsie, nous n\'avons pas trouvé la page que vous cherchiez.","error.goBackTo":"Vous pouvez essayer de revenir au","error.reloadPage":"Recharger la page","error.tryAgain":"Essayer à nouveau","error.unauthorized":"Vous n\'êtes pas autorisé à consulter ce contenu.","error.unprocessableEntity":"Erreur lors du traitement de la demande. ","error.emptyPasswordPublic":"Impossible d\'ouvrir la session : le moteur exige un mot de passe, mais cet agent est public.","errors":{"TENANT_NOT_FOUND":"Locataire introuvable","TENANT_REGISTRATION_DISABLED":"L\'inscription sur cette plateforme est désactivée","TENANT_MISSING_NAME":"Locataire : nom manquant","TENANT_MAX_USERS_REACHED":"Nombre maximum d\'utilisateurs atteint","TENANT_MAX_ADMINS_REACHED":"Nombre maximum d\'utilisateurs administrateurs atteint","TENANT_ALREADY_EXISTS":"Le locataire existe déjà","TENANT_MISSING_DESCRIPTION":"Locataire : description manquante","TENANT_CANT_SET_COMPLETION_PROVIDER":"Locataire : impossible de définir le fournisseur de complétion","TENANT_INVALID_TYPE":"Locataire : type non valide","USER_NOT_CONFIRMED":"L\'utilisateur n\'est toujours pas confirmé","USER_NOT_FOUND":"Utilisateur introuvable","USER_OR_PASSWORD_INVALID":"Utilisateur ou mot de passe invalide","USER_MUST_CHANGE_PASSWORD":"Vous devez changer votre mot de passe","USER_MUST_ENTER_VERIFICATION_CODE":"Vous devez entrer le code de vérification","USER_MISSING_TENANT":"Utilisateur : locataire manquant","USER_MISSING_NAME":"Utilisateur : le nom est manquant","USER_MISSING_PASSWORD":"Utilisateur : mot de passe manquant","USER_MISSING_EMAIL":"Utilisateur : E-mail manquant","USER_MISSING_VERIFICATION_CODE":"Utilisateur : Code de vérification manquant","USER_NAME_ALREADY_USED":"Nom d\'utilisateur déjà utilisé","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"Le mot de passe ne répond pas aux règles de sécurité","USER_EMAIL_ALREADY_USED":"E-mail déjà utilisé","USER_EMAIL_INVALID":"E-mail invalide","USER_VERIFICATION_CODE_INVALID":"Code de vérification invalide","USER_MISSING_NAME_OR_EMAIL":"Nom d\'utilisateur ou e-mail manquant","USER_NAME_INVALID":"Nom d\'utilisateur invalide","USER_HAS_ONE_OR_MORE_MEMORI":"L\'utilisateur possède une ou plusieurs mémoires","USER_MISSING_NEW_PASSWORD":"Utilisateur : nouveau mot de passe manquant","USER_NOTHING_TO_DO":"Rien à faire","USER_CANT_CREATE_MEMORI":"L\'utilisateur n\'est pas autorisé à créer des Agent","USER_MAX_MEMORI_REACHED":"Nombre maximum de Agent atteint","USER_ORDER_BY_INVALID":"Ordre par non valide","USER_TOO_MANY_ATTEMPTS":"Trop de tentatives","USER_MUST_ACCEPT_TNC_AND_PP":"Vous devez accepter les termes et conditions","USER_BIRTH_DATE_CANT_BE_CHANGED":"La date de naissance ne peut pas être modifiée","USER_CANT_SET_COMPLETION_PROVIDER":"Utilisateur : non autorisé à gérer le fournisseur de complétion","USER_CANT_ENABLE_DEEP_THOUGHT":"Utilisateur : non autorisé à gérer Deep Thought","USER_CANT_ENABLE_DCM_INTEGRATION":"Utilisateur : non autorisé à gérer l\'intégration DCM","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"Utilisateur : non autorisé à gérer des chaînages ou des groupes d\'experts","USER_CREATION_BILLING_DENIED_PERMISSION":"Vous n\'avez pas assez de crédits pour créer un Agent","USER_HAS_ONE_OR_MORE_COMPLETION_CONFIGS":"L\'utilisateur dispose d\'une ou plusieurs configurations de complétion","USER_CANT_BE_DELETED":"L\'utilisateur ne peut pas être supprimé","MEMORI_NOT_FOUND":"Mémoire introuvable","MEMORI_NOT_ACCESSIBLE":"Mémoires non accessibles","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Seul le propriétaire peut modifier le tag ou le code PIN","SESSION_NOT_FOUND":"Séance introuvable","SESSION_IS_NOT_ADMINISTRATIVE":"Séance non administrative","SESSION_EXPIRED":"Session expirée","speechMissingSession":"La voix nécessite une session active","speechInvalidSession":"Session non valide","speechTenantMismatch":"La voix n\'est pas disponible sur ce site","speechRateLimited":"Trop de requêtes vocales. Patientez un instant et réessayez.","SESSION_OTP_NOT_FOUND":"Code de vérification introuvable","SESSION_OTP_EXPIRED":"Le code de vérification a expiré","SESSION_OTP_INVALID":"Code de vérification invalide","SESSION_OTP_ATTEMPTS_EXCEEDED":"Trop de tentatives. Demandez un nouveau code de vérification.","MEMORI_MISSING_CONFIGURATION":"Agent : configuration manquante","MEMORI_CONFIGURATION_NOT_FOUND":"Agent : configuration introuvable","MEMORI_INVALID_PRIVACY_TYPE":"Agent : type de confidentialité non valide","MEMORI_MISSING_PASSWORD":"Agent : mot de passe manquant","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Agent : nombre total de jetons de récupération invalides","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Agent : nombre minimum de jetons de récupération invalides","MEMORI_INVALID_VOICE_TYPE":"Agent : type de voix invalide","MEMORI_MISSING_NAME":"Jumeau : nom manquant","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Agent : mot de passe ou jeton de récupération manquant","MEMORI_INVALID_ID":"Jumeau : pièce d\'identité invalide","MEMORI_NAME_ALREADY_USED":"Nom jumeau déjà utilisé","MEMORI_INVALID_PIN":"Agent : code PIN invalide","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Agent : le changement de TAG et de PIN nécessite des opérations distinctes","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Agent : aucun mot de passe requis lorsqu\'il est public","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Deep Thought nécessite que les complétions soient activées","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"Le groupe d\'experts exige que les complétions soient activées","MEMORI_INVALID_COMPLETION_CONFIG":"Agent : configuration des complétions non valide","MEMORI_MACRO_FUNCTIONS_REQUIRES_COMPLETIONS":"Macro fonctions requiert que les complétions soient activées","MEMORI_BLOCKING_DATE_MISSING_OR_WRONG":"Gemmeau : date de blocage manquante ou incorrecte","MEMORI_LIST_FILTER_NOT_SPECIFIED":"Gemmeau : filtre non spécifié","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transfert : utilisateur de destination manquant","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transfert : ID utilisateur de destination non valide","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transfert : données utilisateur de destination non valides","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfert : rien à faire","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Mémoires : la configuration ne peut pas être modifiée","MEMORI_MISSING_NEW_PASSWORD":"Souvenirs : nouveau mot de passe manquant","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"La fonctionnalité nécessite un abonnement","MEMORI_SESSION_NOT_FOUND":"Séance introuvable","MEMORI_SESSION_DOESNT_ACCEPT_MEDIA":"Séance ne pas accepter les médias","INTEGRATION_NOT_FOUND":"Intégration introuvable","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Date invalide du format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Date à formater invalide","INTEGRATION_INVALID_TYPE":"Type d\'intégration invalide","INTEGRATION_ALREADY_EXISTS":"L\'intégration existe déjà","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Les mémoires non publiques ne peuvent pas être intégrées","INTEGRATION_MISSING_INVOCATION_TEXT":"Intégration : texte d\'invocation manquant","INTEGRATION_MISSING_DEVICE_EMAILS":"Intégration : e-mail de l\'appareil manquant","INTEGRATION_MEMORI_IS_EMPTY":"Les mémoires vides ne peuvent pas être intégrées","INTEGRATION_MISSING_PRIVACY_POLICY":"Intégration : politique de confidentialité manquante","INTEGRATION_MISSING_CATEGORY":"Catégorie d\'intégration manquante","INTEGRATION_MISSING_DESCRIPTION":"Description de l\'intégration manquante","INTEGRATION_INVALID_INVOCATION_TEXT":"Texte d\'appel invalide","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home n\'est plus disponible","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Le téléchargement nécessite un codage en plusieurs parties","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Téléchargement : limite de type de contenu manquante","UPLOAD_MAX_LENGTH_EXCEEDED":"Téléchargement : taille maximale dépassée","UPLOAD_FILE_IS_EMPTY":"Télécharger : fichier vide","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Téléchargement : type de fichier ou signature non valide","UPLOAD_MISSING_FILE_NAME":"Télécharger : nom de fichier manquant","UPLOAD_INVALID_MEMORY_ID":"Télécharger : ID de contenu invalide","UPLOAD_MISSING_FILE_CONTENT":"Télécharger : contenu du fichier manquant","ASSET_NOT_FOUND":"Actif introuvable","ASSET_NOT_ACCESSIBLE":"Actif non accessible","ASSET_MISSING_SESSION_ID":"Élément : ID de session manquant","ASSET_INVALID_FILE_NAME":"Élément : nom de fichier non valide","ASSET_MALWARE_SCAN_THREATS_FOUND":"Élément : menaces de scan de malware trouvées","INVITATION_NOT_FOUND":"Invitation introuvable","INVITATION_NOT_ACCESSIBLE":"Invitation non accessible","INVITATION_ALREADY_ACCEPTED":"Invitation déjà acceptée","INVITATION_ALREADY_REJECTED":"Invitation déjà rejetée","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation : e-mail de destination manquant","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation : e-mail de destination invalide","INVITATION_MISSING_TAG":"Invitation : étiquette manquante","INVITATION_MISSING_PIN":"Invitation : code PIN manquant","INVITATION_INVALID_PIN":"Invitation : code PIN invalide","INVITATION_INVALID_TYPE":"Invitation : type non valide","INVITATION_MISSING_DESTINATION_NAME":"Invitation : le nom de la destination est manquant","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation : le tag et le code PIN ne peuvent pas être modifiés","INVITATION_CANT_BE_CHANGED":"Intation : ne peut pas être modifié","ACTIONLOG_INVALID_USER_ID":"ID utilisateur invalide","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date de : format non valide","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date de : format non valide","ACTIONLOG_INVALID_MEMORI_ID":"Identifiant Agent invalide","CONSUMPTIONLOG_INVALID_TYPE":"Type de journal invalide","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date de : format non valide","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date de : format non valide","CONSUMPTIONLOG_INVALID_USER_ID":"ID utilisateur invalide","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Identifiant Agent invalide","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notifications : période d\'extraction du journal de discussion non valide","BROADCAST_NOT_ALLOWED":"Broadcast non autorisé","INVALID_NOTIFICATION_TYPE":"Type de notification non valide","NOTIFICATION_NOT_FOUND":"Notification introuvable","INVALID_NOTIFICATION_FILTER":"Filtre de notification non valide","INVALID_NOTIFICATION_PERIOD":"Période de notification non valide","PROCESS_INVALID_TYPE":"Type de processus invalide","PROCESS_ALREADY_RUNNING":"Processus déjà en cours","PROCESS_NOT_FOUND":"Processus introuvable","IMPORTCSV_MISSING_ROWS":"Import CSV : lignes manquantes","IMPORTCSV_MISSING_CSV":"Importation CSV : CSV manquant","IMPORTCSV_MISSING_SEPARATOR":"Import CSV : séparateur manquant","IMPORTCSV_INVALID_SEPARATOR":"Importation CSV : séparateur non valide","IMPORTCSV_MISSING_HEADERS":"Import CSV : en-têtes manquants","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Import CSV : séparateur de variante de titre manquant","IMPORTCSV_INVALID_RECEIVER_ID":"Importation CSV : ID de destinataire non valide","IMPORTCSV_INVALID_MEDIA_LINK":"Importation CSV : lien média non valide","IMPORTCSV_INVALID_LINK_TITLE_HANDLING":"Importation CSV : titre du lien invalide","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"Import CSV : encodage de caractères indétectable","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"Importation CSV : impossible d\'importer dans les mémoires secrètes","IMPORTTXT_MISSING_ROWS":"Importation de TXT : lignes manquantes","IMPORTTXT_INVALID_GRANULARITY":"Importer TXT : granularité invalide","IMPORTTXT_INVALID_RECEIVER_ID":"Importer TXT : ID de destinataire invalide","IMPORTTXT_INVALID_MEDIA_LINK":"Importer TXT : lien média non valide","IMPORTTXT_INVALID_LINK_TITLE_HANDLING":"Importer TXT : titre du lien invalide","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"Import TXT : encodage de caractères indétectable","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"Importation TXT : impossible d\'importer vers les mémoires secrètes","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Importer TXT : limite d\'importation dépassée","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Importer TXT : l\'importation sur GPT-4 nécessite une clé API","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Importer TXT : l\'importation nécessite un forfait payant","IMPORTTXT_BILLING_DENIED_PERMISSION":"Importer TXT : vous n\'avez pas assez de crédits pour l\'opération","IMPORT_MISSING_ROWS":"Importation : lignes manquantes","IMPORT_CANT_IMPORT_TO_SECRET_MEMORI":"Importation : impossible d\'importer vers les mémoires secrètes","IMPORTMEMORI_INVALID_MEMORI_SPECS":"Importation MEMORI : spécifications de mémoire non valides","IMPORT_MISSING_JSONL":"Importation : JSONL manquant","IMPORTMEMORI_INVALID_SPECS":"Importation MEMORI : spécifications non valides","EXPORT_MISSING_PASSWORD":"Exportation : mot de passe manquant","EXPORTCSV_MISSING_CSV_SPECS":"Exportation CSV : spécifications CSV manquantes","EXPORTCSV_MISSING_SEPARATOR":"Export CSV : séparateur manquant","EXPORTCSV_INVALID_SEPARATOR":"Exportation CSV : séparateur non valide","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Exportation CSV : séparateur de variante de titre manquant","EXPORTCSV_MISSING_NEW_LINE_CHAR":"Exportation CSV : caractère de nouvelle ligne manquant","EXPORTCSV_INVALID_NEW_LINE_CHAR":"Exportation CSV : caractère de nouvelle ligne non valide","EXPORTCSV_MISSING_PASSWORD":"Export CSV : mot de passe manquant","EXPORTJSONL_MISSING_JSONL_SPECS":"Export JSONL : spécifications JSONL manquantes","EXPORTJSONL_MISSING_PLATFORM":"Export JSONL : plateforme manquante","EXPORTJSONL_INVALID_PLATFORM":"Export JSONL : plateforme non valide","EXPORTJSONL_MISSING_PASSWORD":"Export JSONL : mot de passe manquant","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"Exportation JSONL : l\'exportation nécessite un forfait payant","ANALYSIS_MISSING_QUERY":"Analyse : requête manquante","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analyse : impossible d\'analyser les souvenirs secrets","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analyse : la correspondance avec la requête de l\'utilisateur nécessite une réflexion approfondie","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Attribution des badges : identifiants incorrects ou manquants","BADGE_ASSIGNMENT_MISSING_REF_ID":"Affectation du badge : ID de référence manquant","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Attribution des badges : résultat introuvable","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Attribution du badge : URL d\'assertion manquante","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Attribution du badge : URL du badge manquante","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Attribution du badge : URL de l\'émetteur manquante","BADGE_ASSIGNMENT_INVALID_URL":"Attribution du badge : URL invalide","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Affectation du badge : destinataire manquant","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Attribution du badge : type de destinataire inconnu","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Attribution du badge : identité du destinataire manquante","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Attribution du badge : type de hachage du destinataire manquant","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Attribution du badge : type de hachage du destinataire inconnu","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Attribution du badge : identité du destinataire incorrecte","BADGE_NOT_FOUND":"Badge introuvable","OUTCOME_NO_DCM_CONFIGURED":"Résultat : aucun DCM configuré","OUTCOME_USER_BADGES_DISABLED":"Résultat : badges utilisateur désactivés","COMPLETION_CONFIG_MISSING_NAME":"Configuration des complétions : nom manquant","COMPLETION_CONFIG_MISSING_PROVIDER":"Configuration des complétions : fournisseur manquant","COMPLETION_CONFIG_MISSING_ENDPOINT":"Configuration des complétions : point de terminaison manquant","COMPLETION_CONFIG_MISSING_API_KEY":"Configuration des complétions : clé API manquante","COMPLETION_CONFIG_MISSING_MODEL":"Configuration des complétions : modèle manquant","COMPLETION_CONFIG_NO_PURPOSE_SPECIFIED":"Configuration des complétions : au moins un type de complétions doit être spécifié","COMPLETION_CONFIG_INVALID_NAME":"Configuration des complétions: nom non valide","COMPLETION_CONFIG_INVALID_PURPOSE":"Configuration des complétions : type de complétions non valide","COMPLETION_CONFIG_INVALID_ENDPOINT":"Configuration des achèvements : point de terminaison non valide","COMPLETION_CONFIG_INCONSISTENT_ENDPOINT":"Configuration des complétions : point de terminaison incohérent","COMPLETION_CONFIG_INVALID_PROVIDER":"Configuration des complétions : fournisseur non valide","COMPLETION_CONFIG_NOT_FOUND":"Configuration des complétions : introuvable","COMPLETION_CONFIG_NOT_ACCESSIBLE":"Configuration des complétions : non accessible","COMPLETION_CONFIG_NAME_RESERVED":"Configuration des complétions : nom réservé","COMPLETION_CONFIG_NAME_ALREADY_EXISTS":"Configuration des complétions : le nom existe déjà","COMPLETION_CONFIG_VISIBILITY_CHANGE_NOT_ALLOWED":"Configuration des complétions : changement de visibilité non autorisé","COMPLETION_CONFIG_MISSING_MANDATORY_PREFIX":"Configuration des complétions : préfixe obligatoire manquant","COMPLETION_CONFIG_VISIBILITY_NOT_PERMITTED":"Configuration des complétions : visibilité non autorisée","COMPLETION_CONFIG_USE_AS_DEFAULT_NOT_PERMITTED":"Configuration des complétions : utilisation comme défaut non autorisée","COMPLETION_CONFIG_USE_AS_DEFAULT_REQUIRES_TENANT_VISIBILITY":"Configuration des complétions : utilisation comme défaut nécessite la visibilité du locataire","COMPLETION_CONFIG_CHARGEABLE_NOT_PERMITTED":"Configuration des complétions : chargeable non autorisé","COMPLETION_CONFIG_INVALID_APPLY_TO":"Configuration des complétions : apply to non valide","COMPLETION_CONFIG_APPLY_TO_TENANT_NOT_ALLOWED":"Configuration des complétions : apply to tenant non autorisé","TRUSTED_APPLICATION_NOT_FOUND":"Application de confiance introuvable","TRUSTED_APPLICATION_NOT_ACCESSIBLE":"Application de confiance non accessible","TRUSTED_APPLICATION_ALREADY_EXISTS":"Application de confiance existe déjà","TRUSTED_APPLICATION_MISSING_NAME":"Application de confiance : nom manquant","TRUSTED_APPLICATION_MISSING_DESCRIPTION":"Application de confiance : description manquante","TRUSTED_APPLICATION_MISSING_ICON":"Application de confiance : icône manquante","TRUSTED_APPLICATION_MISSING_URL":"Application de confiance : URL manquante"}}');var XH={};XH=JSON.parse('{"yes":"Ja","no":"NEIN","confirm":"Bestätigen","apply":"Anwenden","cancel":"Stornieren","show":"Zeigen","hide":"Verstecken","send":"Schicken","scrollToLatest":"Zum neuesten Beitrag","scrollToContinueReading":"Scrollen, um weiterzulesen","close":"Schließen","clearHistory":"Chat leeren","clearHistoryDone":"Chat geleert.","moreInfo":"Mehr Informationen","back":"Zurück","edit":"Bearbeiten","delete":"Löschen","loading":"Laden","expand":"Expandieren","collapse":"Einklappen","expandable":{"expand":"Expandieren"},"fullscreenEnter":"Geben Sie den Vollbildmodus ein","fullscreenExit":"Beenden Sie den Vollbildmodus","center":"Center","bottom":"Unten","hidden":"Versteckt","all":"Alle","today":"Heute","yesterday":"Gestern","last_7_days":"Letzte 7 Tage","last_30_days":"Letzte 30 Tage","missingData":"Fehlende Informationen","date":"Geburtsdatum","day":"Tag","copied":"Kopiert!","placeholder":"Stellen Sie eine Frage","month":"Monat","year":"Jahr","createdAt":"Erstellungsdatum","selected":"Ausgewählt","page":"Seite","actions":"Aktionen","next":"Nächste","previous":"Vorherige","copy":"Kopie","copyRawCode":"Rohcode kopieren","feedback":"Feedback","feedbackThankYou":"Vielen Dank für Ihr Feedback.","copyFailed":"Kopieren nicht möglich","functionCache":"Funktionscache","copyToClipboard":"In die Zwischenablage kopieren","showOriginalText":"Original anzeigen","showTranslatedText":"Übersetzung anzeigen","exactPosition":"Genaue Position","uncertain":"Unsicher","question":"Frage","nothingFound":"Nichts gefunden","venue":"Veranstaltungsort","searchVenue":"Nach einem Ort suchen…","privacyPolicy":"Datenschutzbestimmungen","popularLanguages":"Beliebt","allLanguages":"Alle Sprachen","memoriBlockedTitle":"Blockiert","memoriBlockedUntil":"Agent blockiert bis {{date}}","memoriBlockedAnon":"Momentan \\"{{name}}„Kann nicht antworten, komm hierher zurück {{date}}","memoriBlockedReasonExceedChats":"weil der monatliche Schwellenwert für erlaubte Chats überschritten wurde.","memoriBlockedGiverHelper":"Sie können es weiterhin als Administrator verwalten, andere Benutzer können jedoch nicht damit interagieren.","generatedByAI":"Von KI generierte Antworten können gelegentlich falsche Informationen generieren","aiGeneratedNote":"Der Agent kann Fehler machen. Stellen Sie sicher, dass Sie wichtige Informationen überprüfen.","reasoning":"Überlegung...","thinking":"Denke nach","thought":"Überlegung","thoughtFor":"Nachgedacht für {{count}} s","whyThisAnswer":"Woher kommt diese Antwort","whyThisAnswerHelper":"Diese Antwort wurde automatisch von einer künstlichen Intelligenz auf Basis dieser verifizierten Inhalte generiert.","whyThisAnswerDescription":"Inhalte der Wissensbasis, die der Agent für die Antwort konsultiert hat.","whyThisAnswerYouAsked":"Sie haben gefragt","whyThisAnswerUserAsked":"Frage des Nutzers","whyThisAnswerAgentReplied":"Der Agent hat geantwortet","whyThisAnswerShowFull":"Vollständige Antwort anzeigen","whyThisAnswerContentsUsed":"Verwendete Inhalte","whyThisAnswerOpen":"Öffnen","whyThisAnswerDisclaimer":"Die Antwort wurde vom Agenten aus diesen Inhalten geschrieben: sie kann Fehler oder Umformulierungen enthalten. Prüfen Sie wichtige Informationen an der Quelle.","whyThisAnswerEmptyTitle":"Keine Inhalte konsultiert","whyThisAnswerEmptyDescription":"Für diese Frage hat der Agent keine Treffer in der Wissensbasis gefunden: er hat nur nach seinen Anweisungen geantwortet.","whyThisAnswerEmptyAuthorDescription":"Die Frage hat keine Treffer ergeben. Falls sie welche haben sollte, fügen Sie einen passenden Inhalt hinzu.","whyThisAnswerAddContent":"Zur Wissensbasis hinzufügen","whyThisAnswerConfidenceHigh":"Starke Übereinstimmung","whyThisAnswerConfidenceMedium":"Teilweise Übereinstimmung","whyThisAnswerConfidenceLow":"Schwache Übereinstimmung","whyThisAnswerTypeQuestion":"Frage und Antwort","whyThisAnswerTypeDocument":"Dokument","whyThisAnswerTypeWebsite":"Website","whyThisAnswerTypeStory":"Geschichte","whyThisAnswerSourcesCount_one":"{{count}} Quelle","whyThisAnswerSourcesCount_other":"{{count}} Quellen","whyThisAnswerNoSources":"Keine Quellen","receiverLabel":"Zugewiesen an","completionsEnabled":"Fortschrittliche KI kann mit automatisch generierten Antworten reagieren, die manchmal falsche Informationen enthalten können","completionProviderDown":"Dieser Zwilling ist mit einer generativen KI von integriert {{provider}}, aber es ist derzeit nicht verfügbar. ","completionProviderMajorOutage":"Dieser Zwilling ist mit einer generativen KI von integriert {{provider}}, aber es ist derzeit nicht verfügbar. Diese Funktion wird nicht verfügbar sein, bis der Service wiederhergestellt ist.","completionProviderPartialOutage":"Dieser Zwilling ist mit einer generativen KI von integriert {{provider}}, aber es ist derzeit nicht verfügbar. Diese Funktion wird nicht verfügbar sein, bis der Service wiederhergestellt ist.","completionProviderDegraded":"Dieser Zwilling ist mit einer generativen KI von integriert {{provider}}, aber es ist derzeit nicht verfügbar. Diese Funktion wird nicht verfügbar sein, bis der Service wiederhergestellt ist.","completionProviderFallbackName":"ein externer Anbieter","completionProviderCheckStatusPage":"Überprüfen Sie die Statusseite","boardOfExperts":"Expertengremium","birthDate":"Geburtsdatum","birthDateHelper":"Wir fragen nur nach Ihrem Geburtsdatum, um Funktionen zu aktivieren oder zu deaktivieren, für die Altersbeschränkungen gelten","underage":"Das müssen Sie mindestens sein {{age}} Jahre alt, um sich anzumelden.","underageTwinSession":"Das müssen Sie mindestens sein {{age}} Jahre alt, um mit diesem Zwilling zu interagieren.","errorFetchingSession":"Fehler beim Laden der Sitzung","errorGettingReferralURL":"Fehler beim Laden des Referrals","errorReopeningSession":"Fehler beim erneuten Öffnen der Sitzung","sessionExpiredReopening":"Sitzung abgelaufen, Sitzung wird neu geöffnet","ageVerification":"Altersüberprüfung","ageVerificationText":"Um mit diesem Zwilling interagieren zu können, müssen Sie mindestens sein {{minAge}} Jahre alt.","ageVerificationSuccess":"Altersprüfung bestanden mit Erfolg.","nsfw":"NSFW: Dieser Agent enthält Inhalte für Erwachsene","deepThought":"Tiefer Gedanke","deepThoughtWhatIs":"Was ist Deep Thought?","deepThoughtHelper":"Deep Thought ist eine erweiterte Funktion der KI, die es Ihnen ermöglicht, Ihre Gespräche voll auszuschöpfen, indem Sie sie verfolgen. ","deepThoughtDisclaimerTitle":"Deep Thought aktiviert","deepThoughtDisclaimer":"Deep Thought ist eine erweiterte Funktion der KI, die es Ihnen ermöglicht, Ihre Gespräche voll auszuschöpfen, indem Sie sie verfolgen. ","deepThoughtPreDisclaimerUnlogged":"Melden Sie sich an, um Deep Thought zu aktivieren.","deepThoughtPreDisclaimerNotAllowed":"Deep Thought ist deaktiviert, da Sie der Nutzung nicht zugestimmt haben. Sie können dies jederzeit in Ihren Kontoeinstellungen ändern.","notEnoughCredits":"Der Autor dieses Zwillings verfügt nicht über genügend Credits, um Ihre Frage zu beantworten.","creditsCheckFailed":"Die Credits dieses Agenten konnten nicht überprüft werden. Bitte versuche es später erneut oder kontaktiere den Autor.","confirmDialog":{"title":"Möchten Sie diese Seite verlassen?","message":"Die Änderungen, die Sie vorgenommen haben, werden verloren."},"knownFacts":{"title":"Bekannte Fakten","description":"Was {{memoriName}} über Sie merkt. Sie können jeden Eintrag löschen.","type":"Typ","typeShortTerm":"Kurzfristig","typeLongTerm":"Langfristig","typeHelper":"Typen:\\n","text":"Text","searchPlaceholder":"Fakten durchsuchen","select":"Auswählen","loadMore":"Weitere laden","factsCount_one":"{{count}} Fakt","factsCount_other":"{{count}} Fakten","shownOfTotal":"{{shown}} von {{total}} angezeigt","emptyTitle":"Noch keine Fakten","emptyDescription":"Während Sie sprechen, notiert der Agent hier, was er über Sie lernt. Sie können es jederzeit löschen.","deleteLabel":"Diesen Fakt löschen","deleteSuccess":"Bekannte Tatsache gelöscht","deleteConfirmTitle":"Bekannte Tatsache löschen","deleteConfirmMessage":"Sind Sie sicher, dass Sie diese bekannte Tatsache löschen möchten?","deleteSelectedConfirmTitle":"Ausgewählte bekannte Fakten löschen","deleteSelectedConfirmMessage":"Sind Sie sicher, dass Sie die ausgewählten bekannten Fakten löschen möchten?","selected_one":"{{count}} Fakt ausgewählt","selected_other":"{{count}} Fakten ausgewählt","selectedRows_one":"{{count}} Zeile ausgewählt","selectedRows_other":"{{count}} Zeilen ausgewählt"},"auth":{"title":"Authentifizierung","description":"Dieser Agent ist geschützt. Gib das Passwort ein, um fortzufahren.","useRecoveryTokens":"Verwenden Sie Wiederherstellungstoken","tokens":"Token","addToken":"Token hinzufügen","usePassword":"Passwort verwenden","passwordRequired":"Passwort erforderlich","invalidCredentials":"Ungültige Zugangsdaten","privateSecretMissing":"Dieser Agent ist privat und sein Secret-Token ist nicht verfügbar. Melde dich mit einem berechtigten Konto an.","atLeast":"Mindestens"},"widget":{"instruct":"Anleiten","test":"Testen","sound":"Ton","soundOff":"Ton aus","position":"Positionspräferenzen","settings":"Einstellungen","share":"Teilen","shareChat":"Chat teilen","sendOnKeypress":"Drücken Sie Enter zum Senden","sendOnClick":"Klicken Sie auf Senden","boardOfExperts":"Expertenrat","showExpertsInTheBoard":"Experten in diesem Rat anzeigen","expertsInTheBoard":"Experten in diesem Rat","goToIntegrationsToCustomizeAvatar":"Um den Avatar anzupassen, gehen Sie zu \\"Teilen\\" und passen Sie die öffentliche Seite an","chatAssistantStatus":"Aktiv • Antwortet in wenigen Sekunden","agentStatusListening":"hört zu","agentStatusSpeaking":"spricht","agentStatusProcessing":"verarbeitet","shareLocation":"Standort teilen","shareLocationHint":"Erhalte Antworten passend zu deinem Standort","shareLocationAria":"Standort mit dem Assistenten teilen","knownFactsHint":"Was ich mir über dich merke","aiConsumption":"KI-Verbrauch","editPositionAria":"Standort bearbeiten","positionResolving":"Adresse wird ermittelt…","geocodingFailed":"Adresse konnte nicht ermittelt werden. Bitte erneut versuchen oder manuell suchen.","positionUnavailableManual":"Standort nicht verfügbar. Bitte manuell eingeben.","positionSharingEnabled":"Standort geteilt.","headerHistory":"Verlauf","headerProfile":"Profil","headerLogin":"Anmelden","downloadQrCode":"QR-Code herunterladen","expandToImmersive":"Zum immersivem Ansichtsmodus erweitern","moreActions":"Weitere Aktionen","mobileSession":{"session":"Session","sessionInfo":"Sitzungsinfo","copyLinkOrDownload":"Link kopieren oder herunterladen","currentlyOff":"Derzeit deaktiviert","whatIKnowAboutYou":"Details der Informationen, die zwischen Ihnen und {{memoriName}} geteilt werden","locationTracking":"Standortverfolgung","locationStatus":"Status","useCurrentPosition":"Aktuelle Position verwenden","disableLocationSharing":"Standortfreigabe deaktivieren","openKnownFacts":"Alle bekannten Fakten öffnen","knownFactsMessages":"{{count}} Nachrichten in der aktuellen Session"}},"exportChatHistory":{"exportPDF":"Chat als PDF exportieren","exporting":"Exportiere...","empty":"Kein Chatverlauf zum Exportieren","pdfNotSupported":"PDF-Export wird in diesem Browser nicht unterstützt","success":"Chat erfolgreich als PDF exportiert","error":"Fehler beim Exportieren des Chats als PDF. Bitte versuchen Sie es erneut."},"write_and_speak":{"micButtonPopover":"Klicken Sie auf die Schaltfläche, um zu sprechen","micButtonPopoverListening":"Klicken Sie auf die Schaltfläche, um das Sprechen zu stoppen","stopRecording":"Aufnahme beenden","sendRecording":"Sprachnachricht senden","recordingInProgress":"Aufnahme läuft","pageInstructExplanation":"Um mir neue Dinge beizubringen, klicken Sie auf die Schaltfläche \\"ANLEITEN\\", um zu beginnen","pageTryMeExplanation":"Um mit mir zu beginnen, klicken Sie auf die Schaltfläche START","pagePrivacyExplanation":"Die Konversationen sind sichtbar von dem Autor des Agenten","aiDisclaimer":"Der Agent kann Fehler machen. Bitte überprüfen Sie die Antworten.","downloadChat":"Chat herunterladen","pagePrivacyExplanationList":{"allConversations":"Alle Konversationen mit diesem Agenten sind sichtbar von dem Autor des Agenten","anonymousUser":"Für anonyme Benutzer: der Autor wird den Inhalt der Konversation und Ihre IP-Adresse sehen","registeredUser":"Für registrierte Benutzer: der Autor wird den Inhalt der Konversation und Ihren Benutzernamen sehen","contentAndUsername":"Der Autor kann den Inhalt, Ihren Benutzernamen und Ihre IP-Adresse sehen","contentAndIpAddress":"Der Autor kann den Inhalt und Ihre IP-Adresse sehen","authorUsesInfo":"Der Autor verwendet diese Informationen, um die Funktionen des Agenten zu verbessern und Ihnen einen besseren Service anzubieten."},"instructButton":"WEISE MICH AN","tryMeButton":"START","resumeButton":"FORTSETZEN","chatHistory":"Chatverlauf","chatHistoryDescription":"Chatverlauf mit diesem Agenten anzeigen","loadingChatHistory":"Chatverlauf wird geladen...","noChatHistoryAvailable":"Kein Chatverlauf verfügbar","noResultsFound":"Keine Ergebnisse gefunden für \\"{{searchText}}\\"","searchInChatHistory":"Unterhaltungen durchsuchen","filters":"Filter","latestFirst":"Neueste zuerst","oldestFirst":"Älteste zuerst","exportChat":"Chat exportieren","conversationStartedLabel":"Unterhaltung gestartet","settingsHeaderLabel":"Richten Sie hier ein, wenn Sie die Agent als Dauerrede einstellen möchten, und ändern Sie die Stillesekunden, wenn Sie sie anpassen möchten.","continuousSpeechLabel":"Kontinuierliche Rede","continuousSpeechDisabled":"Kontinuierliche Rede deaktiviert, da der Agent im Stummschaltmodus ist","holdToSpeak":"Halten Sie gedrückt, um zu sprechen","releaseToEndListening":"Lassen Sie los, um das Hören zu beenden","pressAndHoldToSpeak":"Zum Sprechen gedrückt halten","microphoneMode":"Mikrofonmodus","hideEmissionsLabel":"Vom Zwilling ausgegebenen Text ausblenden","showMessageConsumptionLabel":"Verbrauch pro Nachricht anzeigen","secondsLabel":"Sekunden einstellen","controlsPosition":"Steuert die Position","tryMeHeaderLabel":"VERSUCHEN","unknownPosition":"Unbekannte Position","fieldPlace":"Geben Sie den Ort ein (z. B. \\"Mailand\\")","showMapLinkFor":"Zeigen Sie die Position auf der Karte an","useMyPosition":"Nutzen Sie meine Position","myPosition":"Ihre Position","updatingPosition":"Position wird aktualisiert...","placeNotFound":"Ort nicht gefunden!","requirePosition":"Geben Sie vor dem Start Ihre Position ein","requirePositionHelp":"Zum Reden {{name}} Sie müssen entscheiden, ob Sie Ihre Position angeben oder nicht. ","dontWantToProvidePosition":"Ohne Standort fortfahren","requireLoginHelp":"Um mit {{name}} zu sprechen, musst du dich zuerst mit deinem Konto anmelden.","skipLocationTitle":"Es wird kein Standort auf der Karte gespeichert.","locationSaved":"Ihr Standort wurde gespeichert.","locationSavedWithPlace":"Ihr Standort wurde gespeichert: {{place}}","locationSkippedConfirm":"Sie machen ohne Standortfreigabe weiter.","placeSelected":"Ort ausgewählt: {{place}}","locationPermissionDenied":"Standortzugriff wurde verweigert. Erlauben Sie den Standort in den Browsereinstellungen oder wählen Sie einen Ort auf der Karte.","locationUnavailable":"Ihre Position konnte nicht ermittelt werden. Versuchen Sie es erneut oder suchen Sie einen Ort.","locationRequestTimedOut":"Standortanfrage hat das Zeitlimit überschritten. Versuchen Sie es erneut oder suchen Sie einen Ort.","locationErrorGeneric":"Beim Abrufen Ihres Standorts ist etwas schiefgelaufen.","attachmentsLabel":"Bereichern Sie Ihre Botschaft","image":"Bild","images":"Bilder","file":"Datei","files":"Dateien","function":"Funktion","functions":"Funktionen","iWantToTalkToIn":"Ich möchte mit reden {{name}} In","chatLanguageLabel":"Wählen Sie die Sprache der Unterhaltung","chatResumed":"Unterhaltung erfolgreich fortgesetzt.","message":"nachricht","messages":"nachrichten","page":"Seite {{current}} von {{total}}","downloadThisConversation":"Diese Unterhaltung herunterladen","downloadAllConversations":"Alle Unterhaltungen herunterladen","conversationsCount_one":"{{count}} Unterhaltung","conversationsCount_other":"{{count}} Unterhaltungen","shownOfTotal":"{{shown}} von {{total}} angezeigt","loadMore":"Weitere laden","backToConversationList":"Zurück zur Unterhaltungsliste","thisWeek":"Diese Woche"},"chatResume":{"resume":"Unterhaltung fortsetzen"},"artifact":{"close":"Schließen","size":"Größe","updated":"aktualisiert","updateFailed":"Update konnte nicht angewendet werden","updateFailedHint":"Der Patch stimmt nicht mit dem aktuellen Inhalt überein. Bitten Sie um ein Neuschreiben des Artifacts.","generated":"Generiert","download":"Herunterladen","print":"Drucken","external":"In neuem Fenster öffnen","type":"Typ","fullscreen":"Vollbild","exitFullscreen":"Vollbild beenden","copy":"Kopieren","generatedAt":"Generiert am","open":"Öffnen","code":"Code","source":"Quelle","preview":"Vorschau","resizeHandle":"Artifact-Panel skalieren","copied":"Kopiert!","error":"Fehler","generatingPdf":"PDF wird generiert...","copying":"Kopiere...","moreCopyOptions":"Weitere Kopieroptionen","copyAs":"Kopieren als","downloadAsMarkdown":"Als Markdown herunterladen","downloadRawMarkdownText":"Rohmarkdown-Text herunterladen","downloadAsPdf":"Als PDF herunterladen","exportAsPdfDocument":"Als PDF-Dokument exportieren","downloadAsHtml":"Als HTML herunterladen","downloadFormattedHtml":"Formatiertes HTML herunterladen","viewMode":"Ansichtsmodus","codeMode":"Code-Modus","refresh":"Aktualisieren","share":"Teilen","downloadAsJson":"Als JSON herunterladen","downloadJsonData":"JSON-Daten herunterladen","downloadAsPng":"Als PNG herunterladen","downloadPngImage":"PNG-Bild herunterladen","downloadAsJpeg":"Als JPEG herunterladen","downloadJpegImage":"JPEG-Bild herunterladen","downloadAsGif":"Als GIF herunterladen","downloadGifImage":"GIF-Bild herunterladen","downloadAsWebp":"Als WebP herunterladen","downloadWebpImage":"WebP-Bild herunterladen","copyAsSvg":"Als SVG kopieren","copySvgSourceCode":"SVG-Quellcode kopieren","copyAsPlainText":"Als Klartext kopieren","copyAsText":"Als Text kopieren","copyAsLanguage":"Als {{language}} kopieren","copyLanguageCode":"{{language}}-Code kopieren","copyWithoutSyntaxHighlighting":"Ohne Syntaxhervorhebung kopieren","copyTextContent":"Textinhalt kopieren","pdfExportNotSupported":"PDF-Export wird in diesem Browser nicht unterstützt","popupBlocked":"Popup blockiert! Bitte aktivieren Sie Popups zum Drucken.","safariPdfInstructions":"PDF-Export in neuem Fenster geöffnet. Bitte verwenden Sie Cmd+P (Mac) oder Strg+P (Windows) zum Drucken und als PDF speichern."},"upload":{"loginRequired":"Login erforderlich","pastedText":"text-eingefügt","uploadNotification":"Hochladen fehlgeschlagen","loginRequiredDescription":"Bitte melden Sie sich an, um Bilder hochzuladen","uploadFiles":"Dateien hochladen (drag and drop)","uploadFilesOrImages":"Dateien oder Bilder hochladen","uploadFilesWithShortcut":"{{shortcut}}+O zum Öffnen des Datei-Selektors","uploadImages":"Bilder hochladen","titleImage":"Bildtitel hinzufügen","uploadDocuments":"Dokumente hochladen","replace":"Ersetzen","remaining":"verbleibend","maxReached":"Maximal erreicht","apiClientNotConfigured":"Client API nicht korrekt konfiguriert für das Hochladen von Medien","fileReadingFailed":"Datei lesen fehlgeschlagen","uploadFailed":"Hochladen fehlgeschlagen","uploadSuccess":"Hochladen erfolgreich","uploadSuccessDescription":"Die Datei wurde erfolgreich hochgeladen","maxImagesReached":"Sie können bis zu {{max}} Bilder hochladen","dragAndDropFiles":"Ziehen Sie Dateien hierher, um sie zur Chat hinzuzufügen","contextSizeExceedsLimit":"Die Kontextgröße überschreitet das Limit. Reduzieren Sie die Anzahl der Dateien oder den Inhalt der Konversation.","filesNotAddedMaxAllowed":"{{count}} Datei(en) nicht hinzugefügt (maximal {{max}} Dateien erlaubt).","documentsNotAddedMaxAllowed":"{{count}} Dokument(e) nicht hinzugefügt (maximal {{max}} Dateien erlaubt).","imagesNotAddedMaxAllowed":"{{count}} Bild(er) nicht hinzugefügt (maximal {{max}} Dateien erlaubt).","documentsNotAddedContextSize":"{{count}} Dokument(e) nicht hinzugefügt (Kontextgrößen-Limit).","partialAssetUploadWarning":"Einige Dateilinks konnten nicht hochgeladen werden, aber das Dokument wurde trotzdem hinzugefügt.","anonymousRetentionNotice":"Hinweis: Hochgeladene Dateien werden maximal 24 Stunden gespeichert."},"media":{"title":"Titel","editAttributes":"Medienattribute bearbeiten","uploadMimeTypeNotAllowed":"Der Dateityp ist nicht zulässig","uploadSizeLimitMessage":"Die hochgeladene Größe ist zu groß (max {{size}}MB)","uploadWrongResolutionMessage":"Die Auflösung muss sein {{width}}X{{height}} Pixel","memoriNameAlreadyUsed":"Du hast bereits einen Zwilling mit diesem Namen","uploadHelperImages":"Laden Sie eine Datei mit der Erweiterung PNG, JPG, JPEG oder GIF hoch und darf maximal eine Größe von haben {{size}}MB","uploadHelper":"Laden Sie eine Datei mit einer maximalen Größe von hoch {{size}}MB","uploadError":"Der Upload ist fehlgeschlagen","square":"Quadrat","scaleRatio":"Maßstabsverhältnis","addMediaLabel":"Fügen Sie ein Medium hinzu","insertThisMediaMsg":"Legen Sie diese Medien ein","mediaUploadMessage":"Klicken Sie hier, um ein neues Medium zu laden","addLinkLabel":"Fügen Sie einen Link hinzu","linkKey":"URL","linkValue":"Linktitel","insertThisLink":"Fügen Sie einen Link ein {{url}} mit Titel {{title}}"},"gamification":{"level":"Ebene","points":"Punkte","memoriReachedLevel":"entwickelte sich weiter und erreichte ein höheres Niveau","levelGoToStatistics":"{{memori}} ist auf gleicher Höhe {{level}} mit {{points}} Punkte. ","congratulationsNewLevel":"Herzlichen Glückwunsch, Sie haben ein neues Level erreicht!","congratulationsNewLevelDescription":"Ihre Agent wurden mit weiterentwickelt {{points}} Punkte, schauen Sie sich die an","statistics":"Statistiken"},"login":{"login":"Login","title":"Login zu Ihrem Konto","loggingIn":"Anmeldung läuft…","logout":"Abmelden","user":"Benutzer","loggedDrawerTitle":"Hallo, {{name}}!","userNameRequired":"Benutzername erforderlich","userName":"Benutzername","userNamePlaceholder":"Geben Sie den Benutzernamen ein","loginDrawerTitle":"Login","signupDrawerTitle":"Melden Sie sich an","newUserSignUp":"Neuer Benutzer?","signUp":"Melden Sie sich an!","alreadyHaveAnAccount":"Sie haben bereits ein Konto?","backToLogin":"Zurück zum Login","registrationDisabled":"Die Registrierung ist deaktiviert","contactAdmin":"Wenden Sie sich an den Administrator, um Zugriff anzufordern","userNameOrEmail":"Benutzername oder E-Mail","email":"E-Mail","emailFormatError":"Bitte geben Sie eine gültige E-Mail-Adresse ein","username":"Benutzername","usernameContainsReservedWord":"Der Benutzername enthält ein reserviertes Wort. Bitte wählen Sie ein anderes","usernameFormatError":"Der Benutzername muss mindestens 3 Zeichen lang sein und darf nur Buchstaben, Zahlen und _ enthalten.","otpCode":"Bestätigungscode","resendVerificationCode":"Code erneut senden","resentVerificationCode":"Bestätigungscode gesendet! ","welcomeTitle":"Willkommen zurück","welcomeDescription":"Geben Sie Ihren 4-stelligen Bestätigungscode ein, um zu Ihrem Konto fortzufahren","otpTitle":"Bestätigungscode eingeben","otpDescription":"Geben Sie den 4-stelligen Code ein, den Sie in Ihrem Konto generiert haben","otpStep1":"Klicken Sie auf die Schaltfläche unten, um Ihr Konto zu öffnen","otpStep2":"Generieren Sie einen 4-stelligen Bestätigungscode (5 Minuten gültig)","otpStep3":"Kehren Sie hierher zurück und geben Sie den Code ein","startOtpLogin":"Verifizierung starten","generateOtp":"Code generieren","otpTimer":"Code läuft in {{time}} ab","otpInvalidFormat":"Bitte geben Sie einen gültigen 4-stelligen Code ein","otpInvalid":"Ungültiger Bestätigungscode","otpExpired":"Der Bestätigungscode ist abgelaufen","otpError":"Fehler bei der Code-Validierung. Bitte versuchen Sie es erneut.","otpSuccess":"Anmeldung erfolgreich!","otpAttemptsExceeded":"Zu viele Versuche. Fordern Sie einen neuen Bestätigungscode an.","resendOtpIn":"Erneut senden in {{seconds}}s","resendOtpPrompt":"Nicht angekommen? Erneut senden in {{seconds}} s","resendOtpQuestion":"Nicht angekommen?","resendOtp":"Erneut senden","editEmail":"Bearbeiten","otpSentToPrefix":"Wir haben einen 4-stelligen Code gesendet an","otpCodeShort":"Code","loginBenefitLine1":"{{memoriName}} kann Ihnen den Chatverlauf zeigen, der jederzeit fortgesetzt werden kann.","loginBenefit":"{{memoriName}} kann Ihnen den Chatverlauf zeigen, der jederzeit fortgesetzt werden kann.","passwordlessHint":"Wir senden Ihnen einen 4-stelligen Code. Kein Passwort nötig.","defaultAgentName":"der Agent","sendOtp":"Code senden","password":"Passwort","newPassword":"Neues Passwort","confirmPassword":"Passwort bestätigen","currentPassword":"Aktuelles Passwort","passwordMatchingError":"Passwörter stimmen nicht überein.","passwordFormatError":"Das Passwort muss mindestens 8 Zeichen lang sein und mindestens eine Zahl, einen Großbuchstaben, einen Kleinbuchstaben und ein Symbol enthalten","pwdWeak":"Schwach","pwdAcceptable":"Akzeptabel","pwdStrong":"Stark","mustChangePassword":"Sie müssen Ihr Passwort ändern","passwordChange":"Kennwort ändern","emailChange":"E-Mail ändern","avatarChange":"Avatar ändern","avatarUploadSuccess":"Profilbild aktualisiert.","underage":"Das müssen Sie mindestens sein {{age}} Jahre alt, um sich anzumelden.","optional":"Optional","birthDate":"Geburtsdatum","birthDatePlaceholder":"TT.MM.JJJJ","birthDateHelper":"Wir fragen nur nach Ihrem Geburtsdatum, um Funktionen zu aktivieren oder zu deaktivieren, für die Altersbeschränkungen gelten","missingData":"Fehlende Informationen","missingDataHelper":"Wir wissen, dass dies etwas nervig ist, benötigen jedoch noch einige weitere Informationen, um Ihre Registrierung abzuschließen.","goToAccountToChangeYourPreferences":"Sie können Ihre Auswahl jederzeit auf Ihrer Kontoseite ändern.","deepThoughtExplaination":"Deep Thought ist eine erweiterte Funktion der KI, die es Ihnen ermöglicht, Ihre Gespräche voll auszuschöpfen, indem Sie sie verfolgen. ","tnCAndPPAcceptedHelper":"Seit Ihrer letzten Anmeldung haben sich die AGB und Datenschutzbestimmungen geändert. ","privacyLabel":"Ich habe die gelesen und akzeptiert","privacyAndCookiePolicy":"Datenschutz und Cookie-Richtlinie","and":"Und","termsOfService":"Nutzungsbedingungen","pAndCUAccepted":"Ich akzeptiere die Nutzungsbedingungen von Deep Thought","editAccount":"Konto bearbeiten","save":"Speichern","successfullyLoggedIn":"{{username}} hat sich erfolgreich angemeldet"},"chatLogs":{"llm":"LLM","model":"Modell","provider":"Anbieter","tokens":"Tokens","input":"Eingabe","output":"Ausgabe","cacheRead":"Cache lesen","cacheWrite":"Cache schreiben","duration":"Dauer","energy":"Energie","co2":"CO2","water":"Wasser","usageBadgesHint":"Klicke auf einen dieser Buttons, um mehr Informationen zu sehen","totalChatConsumptionTitle":"Gesamter Chat-Verbrauch","modelUsage":"Modellnutzung","environmentalImpact":"Umweltbelastung","impactComparisonUnavailable":"Indikativer Vergleich nicht verfuegbar.","impactComparisonEnergy":"Indikativer Vergleich: in etwa wie eine 10-W-LED-Lampe fuer {{duration}} eingeschaltet lassen.","impactComparisonCo2":"Indikativer Vergleich: etwa {{distance}} mit einem durchschnittlichen Benzinauto gefahren.","impactComparisonWater":"Indikativer Vergleich: etwa {{count}} Wassertropfen.","energyImpactDescription":"Dieser Wert schaetzt die elektrische Energie, die zur Erzeugung der Modellantwort benoetigt wird. Er hilft, Prompts, Modelle und Strategien zu vergleichen, auch wenn eine einzelne Nachricht nur sehr geringe Auswirkungen hat.","co2ImpactDescription":"CO2-Aequivalent steht fuer die geschaetzten Klimaauswirkungen der Nachricht. Die Umrechnung des Verbrauchs in Emissionen hilft, die Umweltauswirkungen einer KI-Antwort mit vergleichbaren Kennzahlen zu verstehen.","waterImpactDescription":"Dieser Indikator zeigt den geschaetzten Wasserfussabdruck der Nachrichtenverarbeitung. Er umfasst Wasser, das indirekt in Energie und Infrastruktur eingesetzt wird, die die Berechnung ermoeglichen.","approximateValuesTooltip":"Diese Werte sind ungefaehr.","anyMessage":"Jede Nachricht","atLeast":"Mindestens {{count}} Nachrichten","atLeast1":"Mindestens 1 Nachricht","atLeast2":"Mindestens 2 Nachrichten","atLeast3":"Mindestens 3 Nachrichten","atLeast5":"Mindestens 5 Nachrichten","atLeast10":"Mindestens 10 Nachrichten","atLeast15":"Mindestens 15 Nachrichten","atLeast20":"Mindestens 20 Nachrichten","customMinimumMessages":"Anpassen Sie die Anzahl der Nachrichten"},"success":"Erfolg","Error":"Fehler","internal server error":"Oupsie, tut mir leid... Auf dem Server ist ein Fehler aufgetreten","error":"Fehler","error.loading":"Fehler beim Laden des Inhalts.","error.generic":"Oupsie, tut mir leid ... etwas ist schief gelaufen.","error.serverNotResponding":"Wir führen Wartungsarbeiten durch oder veröffentlichen Updates. ","error.notFound":"Oupsie, wir haben die von Ihnen gesuchte Seite nicht gefunden.","error.goBackTo":"Sie können versuchen, dorthin zurückzukehren","error.reloadPage":"Laden Sie die Seite neu","error.tryAgain":"Versuchen Sie es erneut","error.unauthorized":"Es ist Ihnen nicht gestattet, diesen Inhalt anzuzeigen.","error.unprocessableEntity":"Fehler beim Verarbeiten der Anfrage. ","error.emptyPasswordPublic":"Die Sitzung konnte nicht geöffnet werden: die Engine verlangt ein Passwort, aber dieser Agent ist öffentlich.","errors":{"TENANT_NOT_FOUND":"Mieter nicht gefunden","TENANT_REGISTRATION_DISABLED":"Die Registrierung auf dieser Plattform ist deaktiviert","TENANT_MISSING_NAME":"Mieter: Name fehlt","TENANT_MAX_USERS_REACHED":"Maximale Anzahl Benutzer erreicht","TENANT_MAX_ADMINS_REACHED":"Maximale Anzahl an Admin-Benutzern erreicht","TENANT_ALREADY_EXISTS":"Mieter existiert bereits","TENANT_MISSING_DESCRIPTION":"Mieter: Beschreibung fehlt","TENANT_CANT_SET_COMPLETION_PROVIDER":"Mandant: Abschlussanbieter kann nicht festgelegt werden","TENANT_INVALID_TYPE":"Mandant: ungültiger Typ","USER_NOT_CONFIRMED":"Benutzer noch nicht bestätigt","USER_NOT_FOUND":"Benutzer nicht gefunden","USER_OR_PASSWORD_INVALID":"Ungültiger Benutzer oder Passwort","USER_MUST_CHANGE_PASSWORD":"Sie müssen Ihr Passwort ändern","USER_MUST_ENTER_VERIFICATION_CODE":"Sie müssen den Bestätigungscode eingeben","USER_MISSING_TENANT":"Benutzer: Mieter fehlt","USER_MISSING_NAME":"Benutzer: Name fehlt","USER_MISSING_PASSWORD":"Benutzer: Passwort fehlt","USER_MISSING_EMAIL":"Benutzer: Fehlende E-Mail","USER_MISSING_VERIFICATION_CODE":"Benutzer: Fehlender Bestätigungscode","USER_NAME_ALREADY_USED":"Benutzername wird bereits verwendet","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"Das Passwort entspricht nicht den Sicherheitsregeln","USER_EMAIL_ALREADY_USED":"E-Mail wird bereits verwendet","USER_EMAIL_INVALID":"Ungültige E-Mail","USER_VERIFICATION_CODE_INVALID":"Ungültiger Bestätigungscode","USER_MISSING_NAME_OR_EMAIL":"Benutzername oder E-Mail fehlen","USER_NAME_INVALID":"Ungültiger Benutzername","USER_HAS_ONE_OR_MORE_MEMORI":"Der Benutzer verfügt über eine oder mehrere Erinnerungen","USER_MISSING_NEW_PASSWORD":"Benutzer: Neues Passwort fehlt","USER_NOTHING_TO_DO":"Nichts zu tun","USER_CANT_CREATE_MEMORI":"Benutzer darf Agent nicht erstellen","USER_MAX_MEMORI_REACHED":"Maximale Anzahl an Agent erreicht","USER_TOO_MANY_ATTEMPTS":"Zu viele Versuche","USER_MUST_ACCEPT_TNC_AND_PP":"Sie müssen die Allgemeinen Geschäftsbedingungen akzeptieren","USER_BIRTH_DATE_CANT_BE_CHANGED":"Das Geburtsdatum kann nicht geändert werden","USER_CANT_SET_COMPLETION_PROVIDER":"Benutzer: darf den Vervollständigungsanbieter nicht verwalten","USER_CANT_ENABLE_DEEP_THOUGHT":"Benutzer: nicht für die Verwaltung von Deep Thought aktiviert","USER_CANT_ENABLE_DCM_INTEGRATION":"Benutzer: nicht für die Verwaltung der DCM-Integration aktiviert","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"Benutzer: darf die Verkettung oder Expertengruppe nicht verwalten","USER_CREATION_BILLING_DENIED_PERMISSION":"Sie haben nicht genügend Credits, um einen Zwilling zu erstellen","USER_HAS_ONE_OR_MORE_COMPLETION_CONFIGS":"Der Benutzer verfügt über eine oder mehrere Abschlusskonfigurationen","USER_CANT_BE_DELETED":"Benutzer kann nicht gelöscht werden","USER_ORDER_BY_INVALID":"Ungültige Sortierreihenfolge","MEMORI_NOT_FOUND":"Erinnerungen nicht gefunden","MEMORI_NOT_ACCESSIBLE":"Agent nicht zugänglich","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Nur der Eigentümer kann das Tag oder die PIN ändern","SESSION_NOT_FOUND":"Sitzung nicht gefunden","SESSION_IS_NOT_ADMINISTRATIVE":"Nicht-administrative Sitzung","SESSION_EXPIRED":"Sitzung abgelaufen","speechMissingSession":"Sprache benötigt eine aktive Sitzung","speechInvalidSession":"Sitzung ungültig","speechTenantMismatch":"Sprache ist auf dieser Website nicht verfügbar","speechRateLimited":"Zu viele Sprachanfragen. Bitte kurz warten und erneut versuchen.","SESSION_OTP_NOT_FOUND":"Bestätigungscode nicht gefunden","SESSION_OTP_EXPIRED":"Der Bestätigungscode ist abgelaufen","SESSION_OTP_INVALID":"Ungültiger Bestätigungscode","SESSION_OTP_ATTEMPTS_EXCEEDED":"Zu viele Versuche. Fordern Sie einen neuen Bestätigungscode an.","MEMORI_MISSING_CONFIGURATION":"Zwilling: fehlende Konfiguration","MEMORI_CONFIGURATION_NOT_FOUND":"Zwilling: Konfiguration nicht gefunden","MEMORI_INVALID_PRIVACY_TYPE":"Agent: ungültiger Datenschutztyp","MEMORI_MISSING_PASSWORD":"Zwilling: Passwort fehlt","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Agent: Gesamtzahl ungültiger Wiederherstellungstokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Agent: Mindestanzahl ungültiger Wiederherstellungstokens","MEMORI_INVALID_VOICE_TYPE":"Zwilling: ungültiger Stimmtyp","MEMORI_MISSING_NAME":"Zwilling: fehlender Name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Zwilling: Fehlendes Passwort oder Wiederherstellungstoken","MEMORI_INVALID_ID":"Zwilling: ungültige ID","MEMORI_NAME_ALREADY_USED":"Zwillingsname wird bereits verwendet","MEMORI_INVALID_PIN":"Zwilling: Ungültige PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Zwilling: TAG- und PIN-Änderung erfordern separate Vorgänge","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Zwilling: Im öffentlichen Zustand ist kein Passwort erforderlich","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Für \\"Deep Thought\\" müssen Vervollständigungen aktiviert sein","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"Für die Expertengruppe müssen Vervollständigungen aktiviert sein","MEMORI_INVALID_COMPLETION_CONFIG":"Zwilling: Ungültige Abschlusskonfiguration","MEMORI_MACRO_FUNCTIONS_REQUIRES_COMPLETIONS":"Für die Makrofunktionen müssen Vervollständigungen aktiviert sein","MEMORI_BLOCKING_DATE_MISSING_OR_WRONG":"Zwilling: fehlende oder falsche Blockierungsdatum","MEMORI_LIST_FILTER_NOT_SPECIFIED":"Zwilling: fehlender Filter","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Übertragung: Zielbenutzer fehlt","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Übertragung: Ungültige Zielbenutzer-ID","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Übertragung: Ungültige Zielbenutzerdaten","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfer: nichts zu tun","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Speicher: Konfiguration kann nicht geändert werden","MEMORI_MISSING_NEW_PASSWORD":"Erinnerungen: Neues Passwort fehlt","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"Für die Funktion ist ein Abonnement erforderlich","INTEGRATION_NOT_FOUND":"Integration nicht gefunden","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Ungültiges Datum aus Format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Ungültiges Datum zum Formatieren","MEMORI_SESSION_NOT_FOUND":"Sitzung nicht gefunden","MEMORI_SESSION_DOESNT_ACCEPT_MEDIA":"Sitzung akzeptiert keine Medien","INTEGRATION_INVALID_TYPE":"Ungültiger Integrationstyp","INTEGRATION_ALREADY_EXISTS":"Die Integration ist bereits vorhanden","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Nicht-öffentliche Erinnerungen können nicht integriert werden","INTEGRATION_MISSING_INVOCATION_TEXT":"Integration: fehlender Aufruftext","INTEGRATION_MISSING_DEVICE_EMAILS":"Integration: Fehlende Geräte-E-Mail","INTEGRATION_MEMORI_IS_EMPTY":"Leere Erinnerungen können nicht integriert werden","INTEGRATION_MISSING_PRIVACY_POLICY":"Integration: Datenschutzrichtlinie fehlt","INTEGRATION_MISSING_CATEGORY":"Integrationskategorie fehlt","INTEGRATION_MISSING_DESCRIPTION":"Fehlende Integrationsbeschreibung","INTEGRATION_INVALID_INVOCATION_TEXT":"Ungültiger Aufruftext","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home nicht mehr verfügbar","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Für den Upload ist eine mehrteilige Kodierung erforderlich","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Hochladen: Inhaltstypgrenze fehlt","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: Maximale Größe überschritten","UPLOAD_FILE_IS_EMPTY":"Hochladen: leere Datei","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Hochladen: Ungültiger Dateityp oder ungültige Signatur","UPLOAD_MISSING_FILE_NAME":"Hochladen: Dateiname fehlt","UPLOAD_INVALID_MEMORY_ID":"Hochladen: Ungültige Inhalts-ID","UPLOAD_MISSING_FILE_CONTENT":"Hochladen: Dateiinhalt fehlt","ASSET_NOT_FOUND":"Asset nicht gefunden","ASSET_NOT_ACCESSIBLE":"Asset nicht zugänglich","ASSET_MISSING_SESSION_ID":"Asset: Sitzungs-ID fehlt","ASSET_INVALID_FILE_NAME":"Asset: ungültiger Dateiname","ASSET_MALWARE_SCAN_THREATS_FOUND":"Asset: malware scan threats found","INVITATION_NOT_FOUND":"Einladung nicht gefunden","INVITATION_NOT_ACCESSIBLE":"Einladung nicht zugänglich","INVITATION_ALREADY_ACCEPTED":"Einladung bereits angenommen","INVITATION_ALREADY_REJECTED":"Einladung bereits abgelehnt","INVITATION_MISSING_DESTINATION_EMAIL":"Einladung: Ziel-E-Mail fehlt","INVITATION_DESTINATION_EMAIL_INVALID":"Einladung: Ziel-E-Mail-Adresse ungültig","INVITATION_MISSING_TAG":"Einladung: Tag fehlt","INVITATION_MISSING_PIN":"Einladung: PIN fehlt","INVITATION_INVALID_PIN":"Einladung: ungültige PIN","INVITATION_INVALID_TYPE":"Einladung: ungültiger Typ","INVITATION_MISSING_DESTINATION_NAME":"Einladung: Zielname fehlt","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Einladung: Tag und Pin können nicht geändert werden","INVITATION_CANT_BE_CHANGED":"Absicht: kann nicht geändert werden","ACTIONLOG_INVALID_USER_ID":"Ungültige Benutzer-ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Datum von: ungültiges Format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Datum bis: ungültiges Format","ACTIONLOG_INVALID_MEMORI_ID":"Ungültige Memori-ID","CONSUMPTIONLOG_INVALID_TYPE":"Ungültiger Protokolltyp","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Datum von: ungültiges Format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Datum bis: ungültiges Format","CONSUMPTIONLOG_INVALID_USER_ID":"Ungültige Benutzer-ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Ungültige Memori-ID","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Benachrichtigungen: Ungültiger Chat-Protokoll-Extraktionszeitraum","BROADCAST_NOT_ALLOWED":"Broadcast nicht erlaubt","INVALID_NOTIFICATION_TYPE":"Ungültiger Benachrichtigungstyp","NOTIFICATION_NOT_FOUND":"Benachrichtigung nicht gefunden","INVALID_NOTIFICATION_FILTER":"Ungültiger Benachrichtigungsfilter","INVALID_NOTIFICATION_PERIOD":"Ungültiger Benachrichtigungszeitraum","PROCESS_INVALID_TYPE":"Ungültiger Prozesstyp","PROCESS_ALREADY_RUNNING":"Prozess läuft bereits","PROCESS_NOT_FOUND":"Prozess nicht gefunden","IMPORTCSV_MISSING_ROWS":"CSV-Import: fehlende Zeilen","IMPORTCSV_MISSING_CSV":"CSV-Import: CSV fehlt","IMPORTCSV_MISSING_SEPARATOR":"CSV-Import: fehlendes Trennzeichen","IMPORTCSV_INVALID_SEPARATOR":"CSV-Import: Ungültiges Trennzeichen","IMPORTCSV_MISSING_HEADERS":"CSV-Import: fehlende Header","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV-Import: Titelvariantentrennzeichen fehlt","IMPORTCSV_INVALID_RECEIVER_ID":"CSV-Import: ungültige Empfänger-ID","IMPORTCSV_INVALID_MEDIA_LINK":"CSV-Import: Ungültiger Medienlink","IMPORTCSV_INVALID_LINK_TITLE_HANDLING":"CSV-Import: Ungültiger Linktitel","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"CSV-Import: Nicht erkennbare Zeichenkodierung","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"CSV-Import: Der Import in Secret Memories ist nicht möglich","IMPORTTXT_MISSING_ROWS":"TXT wird importiert: Zeilen fehlen","IMPORTTXT_INVALID_GRANULARITY":"TXT importieren: ungültige Granularität","IMPORTTXT_INVALID_RECEIVER_ID":"TXT importieren: ungültige Empfänger-ID","IMPORTTXT_INVALID_MEDIA_LINK":"TXT importieren: Ungültiger Medienlink","IMPORTTXT_INVALID_LINK_TITLE_HANDLING":"TXT importieren: ungültiger Linktitel","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"TXT-Import: Nicht erkennbare Zeichenkodierung","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"TXT-Import: Der Import in Secret Memories ist nicht möglich","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"TXT importieren: Importlimit überschritten","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"TXT importieren: Für den Import auf GPT-4 ist ein API-Schlüssel erforderlich","IMPORTTXT_IMPORT_REQUIRES_PAYING":"TXT importieren: Für den Import ist ein kostenpflichtiger Plan erforderlich","IMPORTTXT_BILLING_DENIED_PERMISSION":"TXT importieren: Sie haben nicht genügend Credits für den Vorgang","IMPORT_MISSING_ROWS":"Import: fehlende Zeilen","IMPORT_CANT_IMPORT_TO_SECRET_MEMORI":"Import: Der Import in Secret Memories ist nicht möglich","IMPORTMEMORI_INVALID_MEMORI_SPECS":"Import MEMORI: ungültige Agentenspezifikationen","IMPORT_MISSING_JSONL":"Import: JSONL fehlt","IMPORTMEMORI_INVALID_SPECS":"Import MEMORI: ungültige Spezifikationen","EXPORT_MISSING_PASSWORD":"Export: Passwort fehlt","EXPORTCSV_MISSING_CSV_SPECS":"CSV-Export: CSV-Spezifikationen fehlen","EXPORTCSV_MISSING_SEPARATOR":"CSV-Export: fehlendes Trennzeichen","EXPORTCSV_INVALID_SEPARATOR":"CSV-Export: Ungültiges Trennzeichen","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"CSV-Export: fehlendes Titelvarianten-Trennzeichen","EXPORTCSV_MISSING_NEW_LINE_CHAR":"CSV-Export: Fehlendes Zeilenumbruchzeichen","EXPORTCSV_INVALID_NEW_LINE_CHAR":"CSV-Export: Ungültiges Zeilenumbruchzeichen","EXPORTCSV_MISSING_PASSWORD":"CSV-Export: Passwort fehlt","EXPORTJSONL_MISSING_JSONL_SPECS":"JSONL-Export: JSONL-Spezifikationen fehlen","EXPORTJSONL_MISSING_PLATFORM":"JSONL-Export: fehlende Plattform","EXPORTJSONL_INVALID_PLATFORM":"JSONL-Export: ungültige Plattform","EXPORTJSONL_MISSING_PASSWORD":"JSONL-Export: Passwort fehlt","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"JSONL-Export: Für den Export ist ein kostenpflichtiger Plan erforderlich","ANALYSIS_MISSING_QUERY":"Analyse: fehlende Abfrage","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Analyse: Geheime Erinnerungen können nicht analysiert werden","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Analyse: Passende Benutzeranfragen erfordern tiefes Denken","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Ausweiszuweisung: falsche oder fehlende Zugangsdaten","BADGE_ASSIGNMENT_MISSING_REF_ID":"Badge-Zuordnung: Referenz-ID fehlt","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Badge-Zuweisung: Ergebnis nicht gefunden","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Badge-Zuweisung: Fehlende Behauptungs-URL","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Badge-Zuweisung: Badge-URL fehlt","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Badge-Zuweisung: Aussteller-URL fehlt","BADGE_ASSIGNMENT_INVALID_URL":"Badge-Zuweisung: Ungültige URL","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Ausweiszuordnung: fehlender Empfänger","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Badge-Zuordnung: unbekannter Empfängertyp","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Ausweiszuordnung: Empfängeridentität fehlt","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Badge-Zuweisung: Empfänger-Hash-Typ fehlt","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Badge-Zuweisung: Empfänger-Hash-Typ unbekannt","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Badge-Zuordnung: Falsche Empfängeridentität","BADGE_NOT_FOUND":"Abzeichen nicht gefunden","OUTCOME_NO_DCM_CONFIGURED":"Ergebnis: kein DCM konfiguriert","OUTCOME_USER_BADGES_DISABLED":"Ergebnis: Benutzerausweise deaktiviert","COMPLETION_CONFIG_MISSING_NAME":"Vervollständigungskonfiguration: Name fehlt","COMPLETION_CONFIG_MISSING_PROVIDER":"Vervollständigungskonfiguration: fehlender Anbieter","COMPLETION_CONFIG_MISSING_ENDPOINT":"Abschlusskonfiguration: fehlender Endpunkt","COMPLETION_CONFIG_MISSING_API_KEY":"Vervollständigungskonfiguration: fehlender API-Schlüssel","COMPLETION_CONFIG_MISSING_MODEL":"Vervollständigungskonfiguration: fehlendes Modell","COMPLETION_CONFIG_NO_PURPOSE_SPECIFIED":"Vervollständigungskonfiguration: Es muss mindestens ein Vervollständigungstyp angegeben werden","COMPLETION_CONFIG_INVALID_NAME":"Vervollständigungskonfiguration: ungültiger Name","COMPLETION_CONFIG_INVALID_PURPOSE":"Vervollständigungskonfiguration: Ungültiger Vervollständigungstyp","COMPLETION_CONFIG_INVALID_ENDPOINT":"Abschlusskonfiguration: Ungültiger Endpunkt","COMPLETION_CONFIG_INCONSISTENT_ENDPOINT":"Abschlusskonfiguration: inkonsistenter Endpunkt","COMPLETION_CONFIG_INVALID_PROVIDER":"Vervollständigungskonfiguration: ungültiger Anbieter","COMPLETION_CONFIG_NOT_FOUND":"Vervollständigungskonfiguration: nicht gefunden","COMPLETION_CONFIG_NOT_ACCESSIBLE":"Vervollständigungskonfiguration: nicht zugänglich","COMPLETION_CONFIG_NAME_RESERVED":"Vervollständigungskonfiguration: Name reserviert","COMPLETION_CONFIG_NAME_ALREADY_EXISTS":"Vervollständigungskonfiguration: Name existiert bereits","COMPLETION_CONFIG_VISIBILITY_CHANGE_NOT_ALLOWED":"Vervollständigungskonfiguration: Änderung der Sichtbarkeit nicht zulässig","COMPLETION_CONFIG_MISSING_MANDATORY_PREFIX":"Vervollständigungskonfiguration: Pflichtpräfix fehlt","COMPLETION_CONFIG_VISIBILITY_NOT_PERMITTED":"Vervollständigungskonfiguration: Sichtbarkeit nicht erlaubt","COMPLETION_CONFIG_USE_AS_DEFAULT_NOT_PERMITTED":"Vervollständigungskonfiguration: Verwendung als Standard nicht erlaubt","COMPLETION_CONFIG_USE_AS_DEFAULT_REQUIRES_TENANT_VISIBILITY":"Vervollständigungskonfiguration: Verwendung als Standard erfordert Mandantensichtbarkeit","COMPLETION_CONFIG_CHARGEABLE_NOT_PERMITTED":"Vervollständigungskonfiguration: Chargeable nicht erlaubt","COMPLETION_CONFIG_INVALID_APPLY_TO":"Vervollständigungskonfiguration: Ungültige Anwendung","COMPLETION_CONFIG_APPLY_TO_TENANT_NOT_ALLOWED":"Vervollständigungskonfiguration: Anwendung auf Mandant nicht erlaubt","TRUSTED_APPLICATION_NOT_FOUND":"Vertrauenswürdige Anwendung nicht gefunden","TRUSTED_APPLICATION_NOT_ACCESSIBLE":"Vertrauenswürdige Anwendung nicht zugänglich","TRUSTED_APPLICATION_NAME_REQUIRED":"Vertrauenswürdige Anwendung: Name erforderlich","TRUSTED_APPLICATION_TOKEN_REQUIRED":"Vertrauenswürdige Anwendung: Token erforderlich","TRUSTED_APPLICATION_NAME_ALREADY_EXISTS":"Vertrauenswürdige Anwendung: Name existiert bereits","TRUSTED_APPLICATION_INVALID_TOKEN":"Vertrauenswürdige Anwendung: Ungültiger Token"}}');var XG={};XG=JSON.parse('{"yes":"Sí","no":"No","confirm":"Confirmar","apply":"Aplicar","cancel":"Cancelar","show":"Espectáculo","hide":"Esconder","send":"Enviar","scrollToLatest":"Ir al último mensaje","scrollToContinueReading":"Desplázate para seguir leyendo","close":"Cerrar","clearHistory":"Borrar chat","clearHistoryDone":"Chat borrado.","moreInfo":"Más información","back":"Volver","edit":"Editar","delete":"Borrar","loading":"Cargando","expand":"Expandir","collapse":"Contraer","expandable":{"expand":"Expandir"},"fullscreenEnter":"Entrar en pantalla completa","fullscreenExit":"Salir de pantalla completa","center":"Centro","bottom":"Abajo","hidden":"Oculto","day":"Día","all":"Todos","today":"Hoy","yesterday":"Ayer","last_7_days":"Últimos 7 días","last_30_days":"Últimos 30 días","placeholder":"Haz una pregunta","date":"Fecha de nacimiento","month":"Mes","copied":"¡Copiado!","missingData":"Información faltante","year":"Año","createdAt":"Fecha de creación","selected":"Seleccionado","page":"página","actions":"Comportamiento","next":"Próximo","previous":"Anterior","copy":"Copiar","copyRawCode":"Copiar código sin formato","feedback":"Comentarios","feedbackThankYou":"Gracias por tus comentarios.","copyFailed":"No se pudo copiar","functionCache":"Caché de funciones","copyToClipboard":"Copiar al portapapeles","showOriginalText":"Mostrar original","showTranslatedText":"Mostrar traducción","exactPosition":"Posición exacta","uncertain":"Incierto","question":"Pregunta","nothingFound":"No se encontró nada","venue":"Evento","searchVenue":"Buscar un lugar…","privacyPolicy":"Política de privacidad","popularLanguages":"Populares","allLanguages":"Todos los idiomas","memoriBlockedTitle":"Obstruido","memoriBlockedUntil":"Agent bloqueado hasta {{date}}","memoriBlockedAnon":"Actualmente \\"{{name}}\\"No puedo responder, vuelve aquí. {{date}}","memoriBlockedReasonExceedChats":"porque ha superado el umbral mensual de chats permitidos.","memoriBlockedGiverHelper":"Aún podrás administrarlo como administrador, pero otros usuarios no podrán interactuar con él.","generatedByAI":"La respuesta generada por IA, ocasionalmente puede generar información incorrecta","aiGeneratedNote":"El agente puede hacer errores. Asegúrate de verificar información importante.","reasoning":"Pensamiento...","thinking":"Pensando","thought":"Pensamiento","thoughtFor":"Pensado durante {{count}} s","whyThisAnswer":"De dónde viene esta respuesta","whyThisAnswerHelper":"Esta respuesta fue generada automáticamente por una inteligencia artificial basada en estos contenidos verificados.","whyThisAnswerDescription":"Los contenidos de la base de conocimiento que el agente consultó para responder.","whyThisAnswerYouAsked":"Has preguntado","whyThisAnswerUserAsked":"Pregunta del usuario","whyThisAnswerAgentReplied":"El agente ha respondido","whyThisAnswerShowFull":"Mostrar la respuesta completa","whyThisAnswerContentsUsed":"Contenidos usados","whyThisAnswerOpen":"Abrir","whyThisAnswerDisclaimer":"La respuesta la ha escrito el agente a partir de estos contenidos: puede contener errores o reformulaciones. Verifica la información importante en la fuente.","whyThisAnswerEmptyTitle":"Ningún contenido consultado","whyThisAnswerEmptyDescription":"Para esta pregunta el agente no encontró coincidencias en la base de conocimiento: ha respondido solo según sus instrucciones.","whyThisAnswerEmptyAuthorDescription":"La pregunta no produjo coincidencias. Si debería tenerlas, añade un contenido que la cubra.","whyThisAnswerAddContent":"Añadir a la base de conocimiento","whyThisAnswerConfidenceHigh":"Coincidencia alta","whyThisAnswerConfidenceMedium":"Coincidencia parcial","whyThisAnswerConfidenceLow":"Coincidencia débil","whyThisAnswerTypeQuestion":"Pregunta y respuesta","whyThisAnswerTypeDocument":"Documento","whyThisAnswerTypeWebsite":"Sitio web","whyThisAnswerTypeStory":"Relato","whyThisAnswerSourcesCount_one":"{{count}} fuente","whyThisAnswerSourcesCount_other":"{{count}} fuentes","whyThisAnswerNoSources":"Ninguna fuente","receiverLabel":"Asignado a","completionsEnabled":"La IA avanzada puede responder con respuestas generadas automáticamente que a veces pueden contener información incorrecta.","completionProviderDown":"Este Agent está integrado con una IA generativa de {{provider}}, pero actualmente no está disponible. ","completionProviderMajorOutage":"Este Agent está integrado con una IA generativa de {{provider}}, pero al momento no está disponible. No será posible utilizar esta funcionalidad hasta que el servicio se restaure.","completionProviderPartialOutage":"Este Agent está integrado con una IA generativa de {{provider}}, pero está experimentando interrupciones parciales. Algunas funcionalidades pueden no estar disponibles o funcionar de manera no óptima.","completionProviderDegraded":"Este Agent está integrado con una IA generativa de {{provider}}, pero está funcionando más lentamente de lo normal. Las respuestas pueden tomar más tiempo o ser menos precisas.","completionProviderFallbackName":"un proveedor externo","completionProviderCheckStatusPage":"Comprobar página de estado","boardOfExperts":"junta de expertos","birthDate":"Fecha de nacimiento","birthDateHelper":"Solicitamos tu fecha de nacimiento únicamente para habilitar o deshabilitar funcionalidades que tienen restricciones de edad.","underage":"Debes ser al menos {{age}} años para inscribirse.","underageTwinSession":"Debes ser al menos {{age}} años para interactuar con este gemelo.","errorFetchingSession":"Error durante el cargamento de la sesión","errorGettingReferralURL":"Error durante el cargamento del référent","errorReopeningSession":"Error durante el re-abrir la sesión","sessionExpiredReopening":"Sesión expirada, reabriendo sesión","ageVerification":"Verificación de edad","ageVerificationText":"Para interactuar con este Gemelo, debes tener al menos {{minAge}} años.","ageVerificationSuccess":"Edad verificada con éxito.","nsfw":"NSFW: Este gemelo contiene contenido para adultos","deepThought":"pensamiento profundo","deepThoughtWhatIs":"¿Qué es Deep Thought?","deepThoughtHelper":"Deep Thought es una característica avanzada de la IA que te permitirá explotar al máximo tus conversaciones al realizar un seguimiento de ellas. ","deepThoughtDisclaimerTitle":"Pensamiento profundo habilitado","deepThoughtDisclaimer":"Deep Thought es una característica avanzada de la IA que te permitirá explotar al máximo tus conversaciones al realizar un seguimiento de ellas. ","deepThoughtPreDisclaimerUnlogged":"Inicie sesión para habilitar Pensamiento profundo.","deepThoughtPreDisclaimerNotAllowed":"Deep Thought está deshabilitado porque usted no dio su consentimiento para su uso; puede cambiar esto en cualquier momento en la configuración de su cuenta.","notEnoughCredits":"El autor de este Gemelo no tiene suficientes créditos para responder a tu pregunta.","creditsCheckFailed":"No ha sido posible verificar los créditos de este agente. Inténtalo más tarde o contacta con su autor.","confirmDialog":{"title":"¿Quieres salir de esta página?","message":"Los cambios que has realizado se perderán."},"knownFacts":{"title":"Hechos conocidos","description":"Lo que {{memoriName}} recuerda de ti. Puedes eliminar cada entrada.","type":"Tipo","typeShortTerm":"Corto plazo","typeLongTerm":"Largo plazo","typeHelper":"Tipos:\\n","text":"Texto","searchPlaceholder":"Buscar entre los hechos","select":"Seleccionar","loadMore":"Cargar más","factsCount_one":"{{count}} hecho","factsCount_other":"{{count}} hechos","shownOfTotal":"Mostrados {{shown}} de {{total}}","emptyTitle":"Todavía no hay hechos","emptyDescription":"A medida que habláis, el agente anota aquí lo que aprende sobre ti. Podrás eliminarlo en cualquier momento.","deleteLabel":"Eliminar este hecho","deleteSuccess":"Hecho conocido eliminado","deleteConfirmTitle":"Eliminar hecho conocido","deleteConfirmMessage":"¿Está seguro de que desea eliminar este hecho conocido?","deleteSelectedConfirmTitle":"Eliminar hechos conocidos seleccionados","deleteSelectedConfirmMessage":"¿Está seguro de que desea eliminar los hechos conocidos seleccionados?","selected_one":"{{count}} hecho seleccionado","selected_other":"{{count}} hechos seleccionados","selectedRows_one":"{{count}} fila seleccionada","selectedRows_other":"{{count}} filas seleccionadas"},"auth":{"title":"Autenticación","description":"Este agente está protegido. Introduce la contraseña para continuar.","useRecoveryTokens":"Utilice tokens de recuperación","tokens":"Fichas","addToken":"Agregar token","usePassword":"Usar contraseña","passwordRequired":"Contraseña obligatoria","invalidCredentials":"Credenciales no válidas","privateSecretMissing":"Este agente es privado y su token secreto no está disponible. Inicia sesión con una cuenta autorizada.","atLeast":"Al menos"},"widget":{"instruct":"Instruir","test":"Probar","sound":"Sonido","soundOff":"Sonido desactivado","position":"Preferencias de posición","settings":"Ajustes","share":"Compartir","shareChat":"Compartir chat","sendOnKeypress":"Presiona Enter para enviar","sendOnClick":"Haz clic en Enviar","boardOfExperts":"Panel de expertos","showExpertsInTheBoard":"Mostrar expertos en este panel","expertsInTheBoard":"Expertos en este panel","goToIntegrationsToCustomizeAvatar":"Para personalizar el avatar, ve a Compartir y personaliza la página pública","chatAssistantStatus":"Activa • Responde en pocos segundos","agentStatusListening":"escuchando","agentStatusSpeaking":"hablando","agentStatusProcessing":"procesando","shareLocation":"Compartir ubicación","shareLocationHint":"Recibe respuestas adaptadas a dónde estás","shareLocationAria":"Compartir ubicación con el asistente","knownFactsHint":"Lo que recuerdo sobre ti","aiConsumption":"Consumo de IA","editPositionAria":"Editar ubicación","positionResolving":"Obteniendo dirección…","geocodingFailed":"No se pudo obtener la dirección. Inténtalo de nuevo o busca manualmente.","positionUnavailableManual":"Ubicación no disponible. Introdúcela manualmente.","positionSharingEnabled":"Ubicación compartida.","headerHistory":"Historial","headerProfile":"Perfil","headerLogin":"Iniciar sesión","expandToImmersive":"Expandir para vista inmersiva","moreActions":"Más acciones","mobileSession":{"session":"Sesión","sessionInfo":"Información de la sesión","copyLinkOrDownload":"Copiar enlace o descargar","currentlyOff":"Actualmente desactivado","whatIKnowAboutYou":"Detalles de la información compartida entre usted y {{memoriName}}","locationTracking":"Seguimiento de ubicación","locationStatus":"Estado","useCurrentPosition":"Usar ubicación actual","disableLocationSharing":"Desactivar uso compartido de ubicación","openKnownFacts":"Abrir todos los hechos conocidos","knownFactsMessages":"{{count}} mensajes en la sesión actual"}},"exportChatHistory":{"exportPDF":"Exportar chat como PDF","exporting":"Exportando...","empty":"No hay historial de chat para exportar","pdfNotSupported":"La exportación PDF no es compatible con este navegador","success":"Chat exportado a PDF exitosamente","error":"Error al exportar el chat a PDF. Por favor, inténtalo de nuevo."},"write_and_speak":{"micButtonPopover":"Haga clic en el botón para hablar","micButtonPopoverListening":"Haga clic en el botón para dejar de hablar.","stopRecording":"Detener grabación","sendRecording":"Enviar mensaje de voz","recordingInProgress":"Grabación en curso","pageInstructExplanation":"Para enseñarme cosas nuevas, haga clic en el botón INSTRUIRME para comenzar.","pageTryMeExplanation":"Para empezar a conversar conmigo haga clic en el botón INICIO","pagePrivacyExplanation":"Las conversaciones son visibles por el autor del agente","pagePrivacyExplanationList":{"allConversations":"Todas las conversaciones con este agente son visibles por el autor del agente","anonymousUser":"Para usuarios anónimos: el autor verá el contenido de la conversación y su dirección IP","registeredUser":"Para usuarios registrados: el autor verá el contenido de la conversación y su nombre de usuario","contentAndUsername":"El autor puede ver el contenido, tu nombre de usuario y tu dirección IP","contentAndIpAddress":"El autor puede ver el contenido y tu dirección IP","authorUsesInfo":"El autor utiliza estas informaciones para mejorar las funciones del agente y para ofrecerte un mejor servicio."},"instructButton":"INSTRUÍME","aiDisclaimer":"El agente puede cometer errores. Por favor, verifica las respuestas.","downloadChat":"Descargar chat","tryMeButton":"COMENZAR","resumeButton":"CONTINUAR","chatHistory":"Historial de chat","chatHistoryDescription":"Mostrar el historial de chat con este agente","loadingChatHistory":"Cargando historial de chat...","noChatHistoryAvailable":"No hay historial de chat disponible","noResultsFound":"No se encontraron resultados para \\"{{searchText}}\\"","searchInChatHistory":"Buscar en las conversaciones","filters":"Filtros","latestFirst":"Más recientes primero","oldestFirst":"Más antiguos primero","exportChat":"Exportar Chat","conversationStartedLabel":"Conversación iniciada","settingsHeaderLabel":"Configure aquí si desea configurar la memoria como voz continua y cambie los segundos de silencio si desea personalizarlos.","continuousSpeechLabel":"discurso continuo","continuousSpeechDisabled":"Discurso continuo deshabilitado porque el agente está en modo silencioso","holdToSpeak":"Mantenga para hablar","releaseToEndListening":"Suelte para finalizar la escucha","pressAndHoldToSpeak":"Mantenga presionado para hablar","microphoneMode":"Modo micrófono","hideEmissionsLabel":"Ocultar texto emitido por el Agent","showMessageConsumptionLabel":"Mostrar consumo por mensaje","secondsLabel":"Establecer segundos","controlsPosition":"Posición de los controles","tryMeHeaderLabel":"INTENTAR","unknownPosition":"Posición desconocida","fieldPlace":"Escribe el lugar (por ejemplo, \'Milano\')","showMapLinkFor":"Mostrar la posición en el mapa.","useMyPosition":"Usa mi posición","myPosition":"Tu posición","updatingPosition":"Actualizando posición...","placeNotFound":"¡Lugar no encontrado!","requirePosition":"Inserte su posición antes de comenzar","requirePositionHelp":"para hablar con {{name}} usted tiene que decidir si proporciona su puesto o no. ","dontWantToProvidePosition":"Continuar sin ubicación","requireLoginHelp":"Para hablar con {{name}} primero debes iniciar sesión con tu cuenta.","skipLocationTitle":"No se guardará ninguna ubicación en el mapa.","locationSaved":"Tu ubicación se guardó.","locationSavedWithPlace":"Tu ubicación se guardó: {{place}}","locationSkippedConfirm":"Continuarás sin compartir tu ubicación.","placeSelected":"Lugar seleccionado: {{place}}","locationPermissionDenied":"Se denegó el acceso a la ubicación. Permítela en la configuración del navegador o elige un lugar en el mapa.","locationUnavailable":"No se pudo determinar tu posición. Inténtalo de nuevo o busca un lugar.","locationRequestTimedOut":"La solicitud de ubicación expiró. Inténtalo de nuevo o busca un lugar.","locationErrorGeneric":"Algo salió mal al obtener tu ubicación.","attachmentsLabel":"Enriquece tu mensaje","image":"imagen","images":"imagenes","file":"archivo","files":"archivos","function":"función","functions":"funciones","iWantToTalkToIn":"quiero hablar con {{name}} en","chatLanguageLabel":"Elige el idioma de la conversación","chatResumed":"Conversación reanudada correctamente.","message":"mensaje","messages":"mensajes","downloadThisConversation":"Descargar esta conversación","downloadAllConversations":"Descargar todas las conversaciones","conversationsCount_one":"{{count}} conversación","conversationsCount_other":"{{count}} conversaciones","shownOfTotal":"Mostradas {{shown}} de {{total}}","loadMore":"Cargar más","backToConversationList":"Volver a la lista de conversaciones","thisWeek":"Esta semana","page":"Página {{current}} de {{total}}"},"chatResume":{"resume":"Reanudar la conversación"},"artifact":{"close":"Cerrar","size":"Tamaño","updated":"actualizado","updateFailed":"No se pudo aplicar la actualización","updateFailedHint":"El parche no coincide con el contenido actual. Pide reescribir el artifact.","generated":"Generado","download":"Descargar","print":"Imprimir","external":"Abrir en una nueva ventana","type":"Tipo","fullscreen":"Pantalla completa","exitFullscreen":"Salir de pantalla completa","copy":"Copiar","generatedAt":"Generado el","open":"Abrir","code":"Código","source":"Fuente","preview":"Vista previa","resizeHandle":"Redimensionar el panel de artifact","copied":"¡Copiado!","error":"Error","generatingPdf":"Generando PDF...","copying":"Copiando...","moreCopyOptions":"Más opciones de copia","copyAs":"Copiar como","downloadAsMarkdown":"Descargar como Markdown","downloadRawMarkdownText":"Descargar texto markdown sin formato","downloadAsPdf":"Descargar como PDF","exportAsPdfDocument":"Exportar como documento PDF","downloadAsHtml":"Descargar como HTML","downloadFormattedHtml":"Descargar HTML formateado","viewMode":"Modo Vista","codeMode":"Modo Código","refresh":"Actualizar","share":"Compartir","downloadAsJson":"Descargar como JSON","downloadJsonData":"Descargar datos JSON","downloadAsPng":"Descargar como PNG","downloadPngImage":"Descargar imagen PNG","downloadAsJpeg":"Descargar como JPEG","downloadJpegImage":"Descargar imagen JPEG","downloadAsGif":"Descargar como GIF","downloadGifImage":"Descargar imagen GIF","downloadAsWebp":"Descargar como WebP","downloadWebpImage":"Descargar imagen WebP","copyAsSvg":"Copiar como SVG","copySvgSourceCode":"Copiar código fuente SVG","copyAsPlainText":"Copiar como texto plano","copyAsText":"Copiar como texto","copyAsLanguage":"Copiar como {{language}}","copyLanguageCode":"Copiar código {{language}}","copyWithoutSyntaxHighlighting":"Copiar sin resaltado de sintaxis","copyTextContent":"Copiar contenido de texto","pdfExportNotSupported":"La exportación PDF no es compatible con este navegador","popupBlocked":"¡Popup bloqueado! Por favor, habilita los popups para imprimir.","safariPdfInstructions":"Exportación PDF abierta en nueva ventana. Por favor, usa Cmd+P (Mac) o Ctrl+P (Windows) para imprimir y guardar como PDF."},"upload":{"loginRequired":"Connexion requise","pastedText":"texto-pegado","uploadNotification":"Échec del téléchargement","loginRequiredDescription":"Veuillez vous connecter pour télécharger des images","uploadFiles":"Télécharger des fichiers (drag and drop)","uploadFilesOrImages":"Subir archivos o imágenes","uploadFilesWithShortcut":"{{shortcut}}+O para abrir el selector de archivos","uploadImages":"Télécharger des images","titleImage":"Añadir un título a la imagen","uploadDocuments":"Télécharger des documents","apiClientNotConfigured":"API client non configuré correctement pour le téléchargement de médias","fileReadingFailed":"Échec de la lecture du fichier","uploadFailed":"Échec du téléchargement","uploadSuccess":"Téléchargement réussi","uploadSuccessDescription":"Le fichier a été téléchargé avec succès","replace":"Remplacer","maxImagesReached":"Vous pouvez télécharger jusqu\'à {{max}} images","remaining":"restant","maxReached":"Limite atteinte","dragAndDropFiles":"Arrastre y suelte los archivos aquí para agregarlos a la chat","contextSizeExceedsLimit":"El tamaño del contexto supera el límite. Intenta reducir el número de archivos o el contenido de la conversación.","filesNotAddedMaxAllowed":"{{count}} archivo(s) no añadido(s) (máximo {{max}} archivos permitidos).","documentsNotAddedMaxAllowed":"{{count}} documento(s) no añadido(s) (máximo {{max}} archivos permitidos).","imagesNotAddedMaxAllowed":"{{count}} imagen(es) no añadida(s) (máximo {{max}} archivos permitidos).","documentsNotAddedContextSize":"{{count}} documento(s) no añadido(s) (límite de tamaño de contexto).","partialAssetUploadWarning":"No se pudieron cargar algunos enlaces del archivo, pero el documento se agregó igualmente.","anonymousRetentionNotice":"Nota: los archivos cargados se conservan durante un máximo de 24 horas."},"media":{"title":"Título","editAttributes":"Editar atributos de medios","uploadMimeTypeNotAllowed":"El tipo de archivo no está permitido.","uploadSizeLimitMessage":"El tamaño subido es demasiado grande (máx. {{size}}MEGABYTE)","uploadWrongResolutionMessage":"La resolución debe ser {{width}}incógnita{{height}} píxel","memoriNameAlreadyUsed":"Ya tienes un gemelo con este nombre.","uploadHelperImages":"Sube un archivo con extensión png, jpg, jpeg o gif, y que tenga como máximo un tamaño de {{size}}MEGABYTE","uploadHelper":"Cargue un archivo que tenga como máximo un tamaño de {{size}}MEGABYTE","uploadError":"Error al subir","square":"cuadrado","scaleRatio":"Relación de escala","addMediaLabel":"Agregar un medio","insertThisMediaMsg":"Inserte estos medios","mediaUploadMessage":"Haga clic para cargar un nuevo medio","addLinkLabel":"Agregar un enlace","linkKey":"URL","linkValue":"Título del enlace","insertThisLink":"Insertar un enlace a {{url}} con titulo {{title}}"},"gamification":{"level":"Nivel","points":"agujas","memoriReachedLevel":"se volvió más evolucionado y alcanzó el nivel","levelGoToStatistics":"{{Agent}} esta al nivel {{level}} con {{points}} agujas. ","congratulationsNewLevel":"¡Felicitaciones, has alcanzado un nuevo nivel!","congratulationsNewLevelDescription":"Tu Agent se volvió más evolucionado con {{points}} puntos, mira el","statistics":"estadística"},"login":{"login":"Acceso","title":"Iniciar sesión en tu cuenta","loggingIn":"Iniciando sesión…","logout":"Cerrar sesión","user":"Usuario","loggedDrawerTitle":"Hola, {{name}}!","loginDrawerTitle":"Acceso","userNameRequired":"Nombre de usuario requerido","userName":"Nombre de usuario","userNamePlaceholder":"Ingrese el nombre de usuario","signupDrawerTitle":"Inscribirse","newUserSignUp":"¿Nuevo usuario?","signUp":"¡Inscribirse!","alreadyHaveAnAccount":"¿Ya tienes una cuenta?","backToLogin":"Volver a iniciar sesión","registrationDisabled":"El registro está deshabilitado","contactAdmin":"Póngase en contacto con el administrador para solicitar acceso","userNameOrEmail":"Nombre de usuario o correo electrónico","email":"Correo electrónico","emailFormatError":"Por favor, inserte un correo electrónico válido","username":"Nombre de usuario","usernameContainsReservedWord":"El nombre de usuario contiene una palabra reservada, elija otra","usernameFormatError":"El nombre de usuario debe tener al menos 3 caracteres y contener solo letras, números y _","otpCode":"Código de verificación","resendVerificationCode":"Reenviar código","resentVerificationCode":"¡Código de confirmación enviado! ","welcomeTitle":"Bienvenido de nuevo","welcomeDescription":"Ingresa tu código de verificación de 4 dígitos para continuar a tu cuenta","otpTitle":"Ingresa el código de verificación","otpDescription":"Ingresa el código de 4 dígitos que generaste en tu cuenta","otpStep1":"Haz clic en el botón de abajo para abrir tu cuenta","otpStep2":"Genera un código de verificación de 4 dígitos (válido por 5 minutos)","otpStep3":"Regresa aquí e ingresa el código","startOtpLogin":"Iniciar verificación","generateOtp":"Generar código","otpTimer":"El código expira en {{time}}","otpInvalidFormat":"Por favor ingresa un código válido de 4 dígitos","otpInvalid":"Código de verificación inválido","otpError":"Error al validar el código. Por favor intenta de nuevo.","otpSuccess":"¡Inicio de sesión exitoso!","otpEmailTitle":"Ingresa tu email","otpEmailDescription":"Ingresa tu dirección de email para recibir un código de verificación","otpCodeDescription":"Ingresa el código de 4 dígitos enviado a {{email}}","emailPlaceholder":"Ingresa tu email","sendOtp":"Enviar el código","resendOtp":"Reenviar","resendOtpIn":"Reenviar en {{seconds}}s","resendOtpPrompt":"¿No llegó? Reenviar en {{seconds}} s","resendOtpQuestion":"¿No llegó?","resending":"Reenviando...","backToEmail":"Volver al email","editEmail":"Editar","otpSentToPrefix":"Hemos enviado un código de 4 dígitos a","otpCodeShort":"Código","loginBenefitLine1":"{{memoriName}} puede mostrarte el historial de chat, que se puede reanudar en cualquier momento.","loginBenefit":"{{memoriName}} puede mostrarte el historial de chat, que se puede reanudar en cualquier momento.","passwordlessHint":"Te enviamos un código de 4 dígitos. Sin contraseña que recordar.","defaultAgentName":"el agente","otpSent":"¡Código de verificación enviado!","otpResent":"¡Código reenviado exitosamente!","otpSendError":"Error al enviar el código. Por favor intenta de nuevo.","emailRequired":"Email requerido","emailInvalid":"Por favor ingresa una dirección de email válida","otpNotFound":"Código de verificación no encontrado","otpExpired":"El código de verificación ha expirado","otpMissing":"El código de verificación es requerido","otpAttemptsExceeded":"Demasiados intentos. Solicita un nuevo código de verificación.","otpSuccessMessage":"¡Verificación exitosa! Redirigiendo...","otpSuccessDescription":"Tu cuenta ha sido verificada exitosamente. Serás redirigido en breve.","otpHelp":"Ingresa el código de 4 dígitos de tu email","emailHelp":"Te enviaremos un código de verificación","userFetchError":"Error al cargar los datos del usuario. Por favor intenta de nuevo.","otpStep1Title":"Ingresa Email","otpStep2Title":"Revisa Email","otpStep3Title":"Ingresa Código","featureFast":"Rápido","featureSecure":"Seguro","featureMobile":"Móvil","password":"Contraseña","newPassword":"Nueva contraseña","confirmPassword":"confirmar Contraseña","currentPassword":"Contraseña actual","passwordMatchingError":"Las contraseñas no coinciden.","passwordFormatError":"La contraseña debe tener al menos 8 caracteres y contener al menos un número, una letra mayúscula, una letra minúscula y un símbolo.","pwdWeak":"Débil","pwdAcceptable":"Aceptable","pwdStrong":"Fuerte","mustChangePassword":"Debes cambiar tu contraseña","passwordChange":"Cambiar la contraseña","emailChange":"Cambiar correo electrónico","avatarChange":"Cambiar avatar","avatarUploadSuccess":"Foto de perfil actualizada.","underage":"Debes ser al menos {{age}} años para inscribirse.","optional":"Opcional","birthDate":"Fecha de nacimiento","birthDatePlaceholder":"DD/MM/AAAA","birthDateHelper":"Solicitamos tu fecha de nacimiento únicamente para habilitar o deshabilitar funcionalidades que tienen restricciones de edad.","missingData":"Información faltante","missingDataHelper":"Sabemos que esto es un poco molesto, pero necesitamos más información para completar tu registro.","goToAccountToChangeYourPreferences":"Puede cambiar su elección en cualquier momento desde la página de su Cuenta.","deepThoughtExplaination":"Deep Thought es una característica avanzada de la IA que te permitirá explotar al máximo tus conversaciones al realizar un seguimiento de ellas. ","tnCAndPPAcceptedHelper":"Desde su último inicio de sesión, los Términos y condiciones y la Política de privacidad han cambiado. ","privacyLabel":"He leído y acepto el","privacyAndCookiePolicy":"Política de privacidad y cookies","and":"y","termsOfService":"Términos de servicio","pAndCUAccepted":"Acepto los términos de servicio sobre Deep Thought","editAccount":"Editar cuenta","save":"Ahorrar","successfullyLoggedIn":"{{username}} ha iniciado sesión correctamente"},"chatLogs":{"llm":"LLM","model":"Modelo","provider":"Proveedor","tokens":"Tokens","input":"Entrada","output":"Salida","cacheRead":"Lectura de caché","cacheWrite":"Escritura de caché","duration":"Duración","energy":"Energía","co2":"CO2","water":"Agua","usageBadgesHint":"Haz clic en uno de estos botones para ver más información","totalChatConsumptionTitle":"Consumo Total del Chat","modelUsage":"Uso del modelo","environmentalImpact":"Impacto ambiental","impactComparisonUnavailable":"Comparacion indicativa no disponible.","impactComparisonEnergy":"Comparacion indicativa: aproximadamente como mantener encendida una bombilla LED de 10 W durante {{duration}}.","impactComparisonCo2":"Comparacion indicativa: aproximadamente {{distance}} recorridos en un coche de gasolina promedio.","impactComparisonWater":"Comparacion indicativa: aproximadamente {{count}} gotas de agua.","energyImpactDescription":"Este valor estima la energia electrica necesaria para generar la respuesta del modelo. Sirve para comparar prompts, modelos y estrategias incluso cuando un solo mensaje tiene un impacto muy pequeno.","co2ImpactDescription":"El CO2 equivalente representa el impacto climatico estimado del mensaje. Traducir el consumo a emisiones ayuda a entender cuanto pesa una respuesta de IA en el medioambiente con metricas comparables.","waterImpactDescription":"Este indicador muestra la huella hidrica estimada asociada al procesamiento del mensaje. Incluye el agua utilizada indirectamente en la energia y en la infraestructura que soporta el calculo.","approximateValuesTooltip":"Estos valores son aproximados.","anyMessage":"Cualquier mensaje","atLeast":"Al menos {{count}} mensajes","atLeast1":"Al menos 1 mensaje","atLeast2":"Al menos 2 mensajes","atLeast3":"Al menos 3 mensajes","atLeast5":"Al menos 5 mensajes","atLeast10":"Al menos 10 mensajes","atLeast15":"Al menos 15 mensajes","atLeast20":"Al menos 20 mensajes","customMinimumMessages":"Personalizar el número de mensajes"},"success":"Éxito","Error":"Error","internal server error":"Oupsie, lo siento... Algo salió mal en el servidor.","error":"Error","error.loading":"Error al cargar contenido.","error.generic":"Oupsie, lo siento... algo salió mal.","error.serverNotResponding":"Estamos realizando mantenimiento o lanzando actualizaciones. ","error.notFound":"Oupsie, no encontramos la página que buscabas.","error.goBackTo":"Puedes intentar volver al","error.reloadPage":"recargar la pagina","error.tryAgain":"Intentar otra vez","error.unauthorized":"No estás autorizado a ver este contenido.","error.unprocessableEntity":"Error al procesar la solicitud. ","error.emptyPasswordPublic":"No se pudo abrir la sesión: el motor requiere una contraseña, pero este agente es público.","errors":{"TENANT_NOT_FOUND":"Inquilino no encontrado","TENANT_REGISTRATION_DISABLED":"El registro en esta plataforma está deshabilitado","TENANT_MISSING_NAME":"Inquilino: falta el nombre","TENANT_MAX_USERS_REACHED":"Número máximo de usuarios alcanzado","TENANT_MAX_ADMINS_REACHED":"Número máximo de usuarios administradores alcanzado","TENANT_ALREADY_EXISTS":"El inquilino ya existe","TENANT_MISSING_DESCRIPTION":"Inquilino: falta descripción","TENANT_CANT_SET_COMPLETION_PROVIDER":"Inquilino: no se puede configurar el proveedor de finalización","TENANT_INVALID_TYPE":"Inquilino: tipo no válido","USER_NOT_CONFIRMED":"Usuario aún no confirmado","USER_NOT_FOUND":"Usuario no encontrado","USER_OR_PASSWORD_INVALID":"Usuario o contraseña no válidos","USER_MUST_CHANGE_PASSWORD":"Debes cambiar tu contraseña","USER_MUST_ENTER_VERIFICATION_CODE":"Debes ingresar el código de verificación","USER_MISSING_TENANT":"Usuario: inquilino desaparecido","USER_MISSING_NAME":"Usuario: falta el nombre","USER_MISSING_PASSWORD":"Usuario: falta contraseña","USER_MISSING_EMAIL":"Usuario: Falta correo electrónico","USER_MISSING_VERIFICATION_CODE":"Usuario: Falta el código de verificación","USER_NAME_ALREADY_USED":"Nombre de usuario ya en uso","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"La contraseña no cumple con las reglas de seguridad.","USER_EMAIL_ALREADY_USED":"Correo electrónico ya en uso","USER_EMAIL_INVALID":"Correo electrónico no válido","USER_VERIFICATION_CODE_INVALID":"Código de verificación no válido","USER_MISSING_NAME_OR_EMAIL":"Falta nombre de usuario o correo electrónico","USER_NAME_INVALID":"Nombre de usuario no válido","USER_HAS_ONE_OR_MORE_MEMORI":"El usuario tiene uno o más recuerdos.","USER_MISSING_NEW_PASSWORD":"Usuario: falta nueva contraseña","USER_NOTHING_TO_DO":"Nada que hacer","USER_CANT_CREATE_MEMORI":"Usuario no autorizado a crear Agent","USER_MAX_MEMORI_REACHED":"Número máximo de Agent alcanzado","USER_TOO_MANY_ATTEMPTS":"demasiados intentos","USER_MUST_ACCEPT_TNC_AND_PP":"Debes aceptar los términos y condiciones.","USER_BIRTH_DATE_CANT_BE_CHANGED":"La fecha de nacimiento no se puede cambiar.","USER_CANT_SET_COMPLETION_PROVIDER":"Usuario: no tiene permiso para gestionar el proveedor de finalización","USER_CANT_ENABLE_DEEP_THOUGHT":"Usuario: no habilitado para gestionar Deep Thought","USER_CANT_ENABLE_DCM_INTEGRATION":"Usuario: no habilitado para gestionar la integración de DCM","USER_CANT_ENABLE_CHAINING_OR_BOARD_OF_EXPERTS":"Usuario: no se le permite gestionar encadenamiento o grupo de expertos","USER_CREATION_BILLING_DENIED_PERMISSION":"No tienes suficientes créditos para crear un gemelo","USER_HAS_ONE_OR_MORE_COMPLETION_CONFIGS":"El usuario tiene una o más configuraciones de finalización.","USER_CANT_BE_DELETED":"Usuario: no se puede eliminar","USER_ORDER_BY_INVALID":"Orden por no válido","MEMORI_NOT_FOUND":"Memoria no encontrada","MEMORI_NOT_ACCESSIBLE":"Memorias no accesibles","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Sólo el propietario puede cambiar la etiqueta o el pin","SESSION_NOT_FOUND":"Sesión no encontrada","SESSION_IS_NOT_ADMINISTRATIVE":"Sesión no administrativa","SESSION_EXPIRED":"La sesión expiró","speechMissingSession":"La voz requiere una sesión activa","speechInvalidSession":"La sesión no es válida","speechTenantMismatch":"La voz no está disponible en este sitio","speechRateLimited":"Demasiadas solicitudes de voz. Espera un momento e inténtalo de nuevo.","SESSION_OTP_NOT_FOUND":"Código de verificación no encontrado","SESSION_OTP_EXPIRED":"El código de verificación ha expirado","SESSION_OTP_INVALID":"Código de verificación inválido","SESSION_OTP_ATTEMPTS_EXCEEDED":"Demasiados intentos. Solicita un nuevo código de verificación.","MEMORI_MISSING_CONFIGURATION":"Gemelo: falta configuración","MEMORI_CONFIGURATION_NOT_FOUND":"Gemelo: configuración no encontrada","MEMORI_INVALID_PRIVACY_TYPE":"Gemelo: tipo de privacidad no válido","MEMORI_MISSING_PASSWORD":"Gemelo: falta contraseña","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Gemelo: número total de tokens de recuperación no válidos","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Gemelo: número mínimo de tokens de recuperación no válidos","MEMORI_INVALID_VOICE_TYPE":"Gemelo: tipo de voz no válido","MEMORI_MISSING_NAME":"Gemelo: falta nombre","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Gemelo: falta contraseña o token de recuperación","MEMORI_INVALID_ID":"Gemelo: identificación no válida","MEMORI_NAME_ALREADY_USED":"Nombre gemelo ya en uso","MEMORI_INVALID_PIN":"Gemelo: PIN no válido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Gemelo: el cambio de TAG y PIN requiere operaciones separadas","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Agent: no se requiere contraseña cuando es público","MEMORI_DEEP_THOUGHT_REQUIRES_COMPLETIONS":"Deep Thought requiere que las completaciones estén habilitadas","MEMORI_BOARD_OF_EXPERTS_REQUIRES_COMPLETIONS":"El grupo de expertos requiere que se habiliten las completaciones.","MEMORI_INVALID_COMPLETION_CONFIG":"Gemelo: configuración de finalizaciones no válidas","MEMORI_MACRO_FUNCTIONS_REQUIRES_COMPLETIONS":"Macro funciones requiere que se habiliten las finalizaciones","MEMORI_BLOCKING_DATE_MISSING_OR_WRONG":"Gemelo: fecha de bloqueo faltante o incorrecta","MEMORI_LIST_FILTER_NOT_SPECIFIED":"Gemelo: filtro no especificado","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transferencia: falta usuario de destino","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transferencia: ID de usuario de destino no válido","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transferencia: datos de usuario de destino no válidos","MEMORI_TRANSFER_NOTHING_TO_DO":"Transferencia: nada que hacer","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memorias: la configuración no se puede cambiar","MEMORI_MISSING_NEW_PASSWORD":"Recuerdos: falta nueva contraseña","MEMORI_FEATURE_REQUIRES_SUBSCRIPTION":"La función requiere suscripción","INTEGRATION_NOT_FOUND":"Integración no encontrada","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Fecha no válida del formato","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Fecha no válida para formatear","MEMORI_SESSION_NOT_FOUND":"Sesión no encontrada","MEMORI_SESSION_DOESNT_ACCEPT_MEDIA":"Sesión no acepta medios","INTEGRATION_INVALID_TYPE":"Tipo de integración no válido","INTEGRATION_ALREADY_EXISTS":"La integración ya existe","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Las memorias no públicas no se pueden integrar","INTEGRATION_MISSING_INVOCATION_TEXT":"Integración: falta texto de invocación","INTEGRATION_MISSING_DEVICE_EMAILS":"Integración: correo electrónico del dispositivo perdido","INTEGRATION_MEMORI_IS_EMPTY":"Los recuerdos vacíos no se pueden integrar","INTEGRATION_MISSING_PRIVACY_POLICY":"Integración: falta la política de privacidad","INTEGRATION_MISSING_CATEGORY":"Falta categoría de integración","INTEGRATION_MISSING_DESCRIPTION":"Falta descripción de integración","INTEGRATION_INVALID_INVOCATION_TEXT":"Texto de invocación no válido","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home ya no está disponible","UPLOAD_REQUIRES_MULTIPART_ENCODING":"La carga requiere codificación multiparte","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: falta límite de tipo de contenido","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: se superó el tamaño máximo","UPLOAD_FILE_IS_EMPTY":"Upload: archivo vacío","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: tipo de archivo o firma no válidos","UPLOAD_MISSING_FILE_NAME":"Upload: falta el nombre del archivo","UPLOAD_INVALID_MEMORY_ID":"Upload: ID de contenido no válido","UPLOAD_MISSING_FILE_CONTENT":"Upload: Falta contenido del archivo","ASSET_NOT_FOUND":"Asset no encontrado","ASSET_NOT_ACCESSIBLE":"Asset no accesible","ASSET_MISSING_SESSION_ID":"Asset: ID de sesión faltante","ASSET_INVALID_FILE_NAME":"Asset: nombre de archivo no válido","ASSET_MALWARE_SCAN_THREATS_FOUND":"Asset: encontró amenazas de malware","INVITATION_NOT_FOUND":"Invitación no encontrada","INVITATION_NOT_ACCESSIBLE":"Invitación no accesible","INVITATION_ALREADY_ACCEPTED":"Invitación ya aceptada","INVITATION_ALREADY_REJECTED":"Invitación ya rechazada","INVITATION_MISSING_DESTINATION_EMAIL":"Invitación: falta el correo electrónico de destino","INVITATION_DESTINATION_EMAIL_INVALID":"Invitación: correo electrónico de destino no válido","INVITATION_MISSING_TAG":"Invitación: falta etiqueta","INVITATION_MISSING_PIN":"Invitación: falta el PIN","INVITATION_INVALID_PIN":"Invitación: PIN no válido","INVITATION_INVALID_TYPE":"Invitación: tipo no válido","INVITATION_MISSING_DESTINATION_NAME":"Invitación: falta el nombre del destino","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitación: la etiqueta y el pin no se pueden cambiar","INVITATION_CANT_BE_CHANGED":"Intación: no se puede cambiar","ACTIONLOG_INVALID_USER_ID":"ID de usuario no válido","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Fecha de: formato no válido","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Fecha hasta: formato no válido","ACTIONLOG_INVALID_MEMORI_ID":"ID de memoria no válida","CONSUMPTIONLOG_INVALID_TYPE":"Tipo de registro no válido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Fecha de: formato no válido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Fecha hasta: formato no válido","CONSUMPTIONLOG_INVALID_USER_ID":"ID de usuario no válido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"ID de memoria no válida","NOTIFICATIONPREFS_INVALID_CHATLOG_EXTRACTION_PERIOD":"Notificaciones: Período de extracción del registro de chat no válido","BROADCAST_NOT_ALLOWED":"Broadcast no permitido","INVALID_NOTIFICATION_TYPE":"Tipo de notificación no válido","NOTIFICATION_NOT_FOUND":"Notificación no encontrada","INVALID_NOTIFICATION_FILTER":"Filtro de notificación no válido","INVALID_NOTIFICATION_PERIOD":"Período de notificación no válido","PROCESS_INVALID_TYPE":"Tipo de proceso no válido","PROCESS_ALREADY_RUNNING":"Proceso ya en ejecución","PROCESS_NOT_FOUND":"Proceso no encontrado","IMPORTCSV_MISSING_ROWS":"Importación CSV: filas faltantes","IMPORTCSV_MISSING_CSV":"Importación CSV: Falta CSV","IMPORTCSV_MISSING_SEPARATOR":"Importación CSV: falta separador","IMPORTCSV_INVALID_SEPARATOR":"Importación CSV: separador no válido","IMPORTCSV_MISSING_HEADERS":"Importación CSV: faltan encabezados","IMPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Importación CSV: falta el separador de variante de título","IMPORTCSV_INVALID_RECEIVER_ID":"Importación CSV: ID de receptor no válido","IMPORTCSV_INVALID_MEDIA_LINK":"Importación CSV: enlace multimedia no válido","IMPORTCSV_INVALID_LINK_TITLE_HANDLING":"Importación CSV: título del enlace no válido","IMPORTCSV_UNDETECTABLE_CHAR_ENCODING":"Importación CSV: codificación de caracteres indetectable","IMPORTCSV_CANT_IMPORT_TO_SECRET_MEMORI":"Importación CSV: no se puede importar a Secret Memories","IMPORTTXT_MISSING_ROWS":"Importando TXT: filas faltantes","IMPORTTXT_INVALID_GRANULARITY":"Importar TXT: granularidad no válida","IMPORTTXT_INVALID_RECEIVER_ID":"Importar TXT: ID de receptor no válido","IMPORTTXT_INVALID_MEDIA_LINK":"Importar TXT: enlace multimedia no válido","IMPORTTXT_INVALID_LINK_TITLE_HANDLING":"Importar TXT: título del enlace no válido","IMPORTTXT_UNDETECTABLE_CHAR_ENCODING":"Importación TXT: codificación de caracteres indetectable","IMPORTTXT_CANT_IMPORT_TO_SECRET_MEMORI":"Importación TXT: No se puede importar a Secret Memories","IMPORTTXT_IMPORT_LIMIT_EXCEEDED":"Importar TXT: límite de importación excedido","IMPORTTXT_IMPORT_ON_GPT4_REQUIRES_API_KEY":"Importar TXT: la importación en GPT-4 requiere una clave API","IMPORTTXT_IMPORT_REQUIRES_PAYING":"Importar TXT: la importación requiere un plan de pago","IMPORTTXT_BILLING_DENIED_PERMISSION":"Importar TXT: no tienes suficientes créditos para la operación","IMPORT_MISSING_ROWS":"Importar: filas faltantes","IMPORT_CANT_IMPORT_TO_SECRET_MEMORI":"Importar: no se puede importar a Secret Memories","IMPORTMEMORI_INVALID_MEMORI_SPECS":"Importar MEMORI: especificaciones de memoria no válidas","IMPORT_MISSING_JSONL":"Importar: faltan JSONL","IMPORTMEMORI_INVALID_SPECS":"Importar MEMORI: especificaciones no válidas","EXPORT_MISSING_PASSWORD":"Exportar: falta contraseña","EXPORTCSV_MISSING_CSV_SPECS":"Exportación CSV: faltan especificaciones CSV","EXPORTCSV_MISSING_SEPARATOR":"Exportación CSV: falta separador","EXPORTCSV_INVALID_SEPARATOR":"Exportación CSV: separador no válido","EXPORTCSV_MISSING_TITLE_VARIANT_SEPARATOR":"Exportación CSV: falta el separador de variante de título","EXPORTCSV_MISSING_NEW_LINE_CHAR":"Exportación CSV: falta un carácter de nueva línea","EXPORTCSV_INVALID_NEW_LINE_CHAR":"Exportación CSV: carácter de nueva línea no válido","EXPORTCSV_MISSING_PASSWORD":"Exportación CSV: falta contraseña","EXPORTJSONL_MISSING_JSONL_SPECS":"Exportación JSONL: faltan especificaciones JSONL","EXPORTJSONL_MISSING_PLATFORM":"Exportación JSONL: plataforma faltante","EXPORTJSONL_INVALID_PLATFORM":"Exportación JSONL: plataforma no válida","EXPORTJSONL_MISSING_PASSWORD":"Exportación JSONL: falta contraseña","EXPORTJSONL_EXPORT_REQUIRES_PAYING":"Exportación JSONL: la exportación requiere un plan pago","ANALYSIS_MISSING_QUERY":"Análisis: consulta faltante","ANALYSIS_CANT_ANALYZE_SECRET_MEMORI":"Análisis: No se pueden analizar recuerdos secretos","ANALYSIS_USER_QUERY_MATCH_REQUIRES_DEEP_THOUGHT":"Análisis: hacer coincidir la consulta del usuario requiere un pensamiento profundo","BADGE_ASSIGNMENT_WRONG_OR_MISSING_CREDENTIALS":"Asignación de insignia: credenciales incorrectas o faltantes","BADGE_ASSIGNMENT_MISSING_REF_ID":"Asignación de insignia: falta el ID de referencia","BADGE_ASSIGNMENT_OUTCOME_NOT_FOUND":"Asignación de insignia: resultado no encontrado","BADGE_ASSIGNMENT_MISSING_ASSERTION_URL":"Asignación de insignia: falta la URL de aserción","BADGE_ASSIGNMENT_MISSING_BADGE_URL":"Asignación de insignia: URL de insignia faltante","BADGE_ASSIGNMENT_MISSING_ISSUER_URL":"Asignación de insignia: falta la URL del emisor","BADGE_ASSIGNMENT_INVALID_URL":"Asignación de insignia: URL no válida","BADGE_ASSIGNMENT_MISSING_RECIPIENT":"Asignación de insignia: destinatario faltante","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_TYPE":"Asignación de insignia: tipo de destinatario desconocido","BADGE_ASSIGNMENT_MISSING_RECIPIENT_IDENTITY":"Asignación de insignia: falta la identidad del destinatario","BADGE_ASSIGNMENT_MISSING_RECIPIENT_HASH_TYPE":"Asignación de insignia: falta el tipo de hash del destinatario","BADGE_ASSIGNMENT_UNKNOWN_RECIPIENT_HASH_TYPE":"Asignación de insignia: tipo de hash del destinatario desconocido","BADGE_ASSIGNMENT_WRONG_RECIPIENT_IDENTITY":"Asignación de insignia: identidad del destinatario incorrecta","BADGE_NOT_FOUND":"Insignia no encontrada","OUTCOME_NO_DCM_CONFIGURED":"Resultado: no hay ningún DCM configurado","OUTCOME_USER_BADGES_DISABLED":"Resultado: insignias de usuario deshabilitadas","COMPLETION_CONFIG_MISSING_NAME":"Configuración de terminaciones: falta nombre","COMPLETION_CONFIG_MISSING_PROVIDER":"Configuración de terminaciones: falta proveedor","COMPLETION_CONFIG_MISSING_ENDPOINT":"Configuración de terminaciones: falta punto final","COMPLETION_CONFIG_MISSING_API_KEY":"Configuración de terminaciones: falta clave API","COMPLETION_CONFIG_MISSING_MODEL":"Configuración de terminaciones: modelo faltante","COMPLETION_CONFIG_NO_PURPOSE_SPECIFIED":"Configuración de terminaciones: se debe especificar al menos un tipo de terminaciones","COMPLETION_CONFIG_INVALID_NAME":"Configuración de terminaciones: nombre no válido","COMPLETION_CONFIG_INVALID_PURPOSE":"Configuración de terminaciones: tipo de terminaciones no válidas","COMPLETION_CONFIG_INVALID_ENDPOINT":"Configuración de terminaciones: punto final no válido","COMPLETION_CONFIG_INCONSISTENT_ENDPOINT":"Configuración de terminaciones: punto final inconsistente","COMPLETION_CONFIG_INVALID_PROVIDER":"Configuración de terminaciones: proveedor no válido","COMPLETION_CONFIG_NOT_FOUND":"Configuración de terminaciones: no encontrada","COMPLETION_CONFIG_NOT_ACCESSIBLE":"Configuración de terminaciones: no accesible","COMPLETION_CONFIG_NAME_RESERVED":"Configuración de terminaciones: nombre reservado","COMPLETION_CONFIG_NAME_ALREADY_EXISTS":"Configuración de terminaciones: el nombre ya existe","COMPLETION_CONFIG_VISIBILITY_CHANGE_NOT_ALLOWED":"Configuración de terminaciones: cambio de visibilidad no permitido","COMPLETION_CONFIG_MISSING_MANDATORY_PREFIX":"Configuración de terminaciones: prefijo obligatorio faltante","COMPLETION_CONFIG_VISIBILITY_NOT_PERMITTED":"Configuración de terminaciones: visibilidad no permitida","COMPLETION_CONFIG_USE_AS_DEFAULT_NOT_PERMITTED":"Configuración de terminaciones: uso como predeterminado no permitido","COMPLETION_CONFIG_USE_AS_DEFAULT_REQUIRES_TENANT_VISIBILITY":"Configuración de terminaciones: uso como predeterminado requiere visibilidad del inquilino","COMPLETION_CONFIG_CHARGEABLE_NOT_PERMITTED":"Configuración de terminaciones: chargeable no permitido","COMPLETION_CONFIG_INVALID_APPLY_TO":"Configuración de terminaciones: apply to no válido","COMPLETION_CONFIG_APPLY_TO_TENANT_NOT_ALLOWED":"Configuración de terminaciones: apply to tenant no permitido","TRUSTED_APPLICATION_NOT_FOUND":"Aplicación de confianza no encontrada","TRUSTED_APPLICATION_NOT_ACCESSIBLE":"Aplicación de confianza no accesible","TRUSTED_APPLICATION_NAME_REQUIRED":"Aplicación de confianza: nombre requerido","TRUSTED_APPLICATION_TOKEN_REQUIRED":"Aplicación de confianza: token requerido","TRUSTED_APPLICATION_NAME_ALREADY_EXISTS":"Aplicación de confianza: nombre ya existe","TRUSTED_APPLICATION_INVALID_TOKEN":"Aplicación de confianza: token no válido"}}');let XV={en:{translation:b(Xj)},it:{translation:b(XU)},es:{translation:b(XG)},fr:{translation:b(Xz)},de:{translation:b(XH)}},XW=(0,ap.createInstance)({resources:XV,lng:"en",fallbackLng:"it",supportedLngs:["en","it","fr","es","de"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});XW.init(),function(e){let t=(void 0)??"translation";for(let n of Object.keys(hm)){let r=hm[n],i=hf[n],a=hg[n],o=hv[n];e.addResourceBundle(n,t,{table:r,expandable:i,alert:a,overlay:o},!0,!0)}}(XW);var Xq=({children:e})=>(0,eh.jsx)(i8,{i18n:XW,children:e});let X$=e=>{var t;return e?null==(t=null==e?void 0:e.split(","))?void 0:t.reduce((e,t)=>{let[n,r]=t.split(":").map(e=>e.trim());return{...e,[n]:r}},{}):{}},XJ=({ownerUserName:e,ownerUserID:t,memoriName:n,memoriID:r,integration:i,integrationID:a,tenantID:o,secretToken:s,sessionID:l,layout:u,customLayout:c,showShare:d,showCopyButton:h,showTranslationOriginal:p,showSettings:m,showTypingText:f,showClear:g,showExperts:v,showOnlyLastMessages:y,showInputs:b=!0,showDates:_=!1,showContextPerLine:x=!1,showMessageConsumption:w,showUpload:S,showLogin:E,showReasoning:A,show3dAvatar:T,avatar3dHidden:I,height:C="100%",baseURL:M,apiURL:N="https://backend.memori.ai",engineURL:R="https://engine.memori.ai",tag:O,pin:P,context:k,initialQuestion:D,showChatHistory:B,uiLang:F,spokenLang:U,multilingual:j,authToken:z,enableAudio:H,defaultSpeakerActive:G=!0,disableTextEnteredEvents:V=!1,onStateChange:W,additionalInfo:q,customMediaRenderer:$,additionalSettings:J,userAvatar:K,useMathFormatting:Y=!1,autoStart:X,applyVarsToRoot:Z=!1,__WEBCOMPONENT__:Q=!1,maxTotalMessagePayload:ee,maxTextareaCharacters:et})=>{var en,er,ei,ea,eo,es,el,eu;let[ec,ed]=(0,em.useState)(),[ep,ef]=(0,em.useState)(),[eg,ev]=(0,em.useState)(),[ey,eb]=(0,em.useState)(),{t:e_}=tA();if(!(r&&t||n&&e))throw Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");let ex=e3(N,R),ew=(0,em.useCallback)(async()=>{let e=M||(o.startsWith("https://")?o:`https://${o}`);try{let t=await fetch(`${e}/api/speechkey?tenant=${o}`,{method:"GET",headers:{"Content-Type":"application/json"}}),n=await t.json();n.provider?ev(n.provider):console.warn("Provider not found in speech key response")}catch(e){console.error("Error fetching speech key:",e)}},[M,o]);(0,em.useEffect)(()=>{ew()},[]);let eS=(0,em.useCallback)(async()=>{if(r&&t){let{memori:e,...n}=await ex.backend.getMemoriByUserAndId(o,t,r,z);0===n.resultCode&&e?ed(e):console.error("[MEMORI]",n,e)}else if(n&&e){let{memori:r,...i}=await ex.backend.getMemori(o,e,n,z);0===i.resultCode&&r?(!r.ownerUserID&&t&&(r.ownerUserID=t),ed(r)):console.error("[MEMORI]",i,r)}},[r,t,n,e,o,z]);(0,em.useEffect)(()=>{eS()},[eS,o]);let eE=(0,em.useCallback)(async()=>{let{tenant:e,...t}=await ex.backend.tenant.getTenant(o);e&&0===t.resultCode?ef(e):console.debug("[TENANT]",t,e)},[o,N]);(0,em.useEffect)(()=>{eE()},[eE]),(0,em.useEffect)(()=>{let e=document.querySelector(`memori-client[memoriname="${null==ec?void 0:ec.name}"]`)||document.querySelector(`memori-client[memoriid="${null==ec?void 0:ec.memoriID}"]`)||document.querySelector("memori-client");if(!e)return;let t=new MutationObserver((e,t)=>{for(let t of e)if("attributes"===t.type){let e="MEMORI-CLIENT"===t.target.nodeName?t.target:t.target.parentElement,n=e.getAttribute("sessionid")||void 0;e&&n&&eb(n)}});return t.observe(e,{attributes:!0,childList:!1,subtree:!1}),()=>{t.disconnect()}},[]),(0,em.useEffect)(()=>{if(F)XW.changeLanguage(F.toLowerCase());else{let{lng:e,fallbackLng:t}=(()=>{let 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"}})();XW.changeLanguage(e).catch(()=>{XW.changeLanguage(t)})}},[F]);let eA=null!=i?i:null==(en=null==ec?void 0:ec.integrations)?void 0:en.find(e=>a?e.integrationID===a:!!e.publish&&"LANDING_EXPERIENCE"===e.type),eT=((e,t=!1)=>{try{return JSON.parse(e)}catch(n){return t?e:null}})(null!=(er=null==eA?void 0:eA.customData)?er:"{}"),eI=[null==ep?void 0:ep.name,...(null==ep?void 0:ep.aliases)||[],...eT.whiteListedDomains||[]];if((null==(ei=null==eT?void 0:eT.whiteListedDomains)?void 0:ei.length)&&"u">typeof window&&!eI.some(e=>new RegExp(e).test(window.location.hostname)))return null;let eC=null!=(ea=eT.ignoreClientAttributes)&&ea?{initialContextVars:X$(eT.contextVars),initialQuestion:eT.initialQuestion,showLogin:(null==ec?void 0:ec.enableDeepThought)||void 0,memoriLang:null==(es=null==(eo=null==ec?void 0:ec.culture)?void 0:eo.split("-"))?void 0:es[0],uiLang:F,spokenLang:U,autoStart:"HIDDEN_CHAT"===u||"WEBSITE_ASSISTANT"!==u&&X}:{...O&&P?{personification:{tag:O,pin:P}}:{},multilingual:j,showCopyButton:h,showTranslationOriginal:p,showSettings:m,showChatHistory:B,showShare:d,showTypingText:f,showClear:g,showExperts:v,showLogin:null!=E?E:(null==ec?void 0:ec.enableDeepThought)||void 0,showUpload:S,showReasoning:A,showContextPerLine:x,showMessageConsumption:w,initialContextVars:null!=k?k:X$(eT.contextVars),initialQuestion:null!=D?D:eT.initialQuestion,autoStart:"WEBSITE_ASSISTANT"!==u&&(void 0!==X?X:"HIDDEN_CHAT"===u||X),enableAudio:H,defaultSpeakerActive:G,useMathFormatting:Y,memoriLang:null==(eu=null==(el=null==ec?void 0:ec.culture)?void 0:el.split("-"))?void 0:eu[0],uiLang:F,spokenLang:U},[eM,eN]=(0,em.useState)(!1),eR=(0,em.useCallback)(()=>{var e;if(((null==ec?void 0:ec.memoriID)||r)&&!eM){let t=null==window?void 0:window.location.origin;if(!t||t.includes("localhost")||t.includes("memori-ai.github.io"))return void eN(!0);eN(!0),fetch("https://pulse.aisuru.com/post",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pulse:{clientType:Q?"memori-webcomponent":"memori-react",clientVersion:"v9.0.6",userAgent:navigator.userAgent,language:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,memoriID:null!=(e=null==ec?void 0:ec.memoriID)?e:r,tenant:o,referrer:t}})})}},[null==ec?void 0:ec.memoriID,r,o,Q,eM]);(0,em.useEffect)(()=>{eR()},[eR]);let eO=s||(null==ec?void 0:ec.secretToken)||(null==ec?void 0:ec.password);return(0,eh.jsx)(Xq,{children:(0,eh.jsx)(v7,{defaultDuration:5e3,children:(0,eh.jsx)(q7,{children:(0,eh.jsx)(e7,{children:ec?(0,eh.jsx)(XF,{layout:u,customLayout:c,height:C,baseUrl:M||(o.startsWith("https://")||o.startsWith("http://")?o:`https://${o}`),apiURL:N,engineURL:R,memori:{...ec,secretToken:eO},__WEBCOMPONENT__:Q,ownerUserName:null!=e?e:ec.ownerUserName,ownerUserID:null!=t?t:ec.ownerUserID,tenant:ep,tenantID:o,sessionID:null!=l?l:ey,secret:eO,ttsProvider:eg||"azure",integration:eA,authToken:z,onStateChange:W,additionalInfo:q,customMediaRenderer:$,additionalSettings:J,userAvatar:K,applyVarsToRoot:Z,maxTotalMessagePayload:ee,maxTextareaCharacters:et,disableTextEnteredEvents:V,show3dAvatar:T,avatar3dHidden:I,...eC,showOnlyLastMessages:y,showInputs:b,showDates:_}):(0,eh.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:(0,eh.jsxs)("p",{style:{textAlign:"center",margin:"2rem auto",textTransform:"capitalize"},children:[e_("loading")||"Loading","..."]})})})})})})};XJ.propTypes={memoriName:(b(ef)).string,memoriID:(b(ef)).string,ownerUserName:(b(ef)).string,ownerUserID:(b(ef)).string,integrationID:(b(ef)).string,integration:(b(ef)).any,tenantID:(b(ef)).string.isRequired,secretToken:(b(ef)).string,sessionID:(b(ef)).string,layout:(b(ef)).oneOf(["DEFAULT","FULLPAGE","TOTEM","WEBSITE_ASSISTANT","CHAT","HIDDEN_CHAT","ZOOMED_FULL_BODY"]),customLayout:(b(ef)).any,showShare:(b(ef)).bool,showCopyButton:(b(ef)).bool,showTranslationOriginal:(b(ef)).bool,showInputs:(b(ef)).bool,showDates:(b(ef)).bool,showContextPerLine:(b(ef)).bool,showMessageConsumption:(b(ef)).bool,showSettings:(b(ef)).bool,showClear:(b(ef)).bool,showExperts:(b(ef)).bool,showOnlyLastMessages:(b(ef)).bool,showTypingText:(b(ef)).bool,showLogin:(b(ef)).bool,showUpload:(b(ef)).bool,showReasoning:(b(ef)).bool,show3dAvatar:(b(ef)).bool,avatar3dHidden:(b(ef)).bool,height:(b(ef)).oneOfType([(b(ef)).string,(b(ef)).number]),baseURL:(b(ef)).string,apiURL:(b(ef)).string,engineURL:(b(ef)).string,tag:(b(ef)).string,pin:(b(ef)).string,context:(b(ef)).objectOf((b(ef)).any),initialQuestion:(b(ef)).string,uiLang:(b(ef)).oneOf(["en","it","fr","es","de","EN","IT","FR","ES","DE"]),spokenLang:(b(ef)).string,multilingual:(b(ef)).bool,authToken:(b(ef)).string,enableAudio:(b(ef)).bool,defaultSpeakerActive:(b(ef)).bool,disableTextEnteredEvents:(b(ef)).bool,onStateChange:(b(ef)).func,additionalInfo:(b(ef)).objectOf((b(ef)).any),customMediaRenderer:(b(ef)).func,additionalSettings:(b(ef)).any,userAvatar:(b(ef)).oneOfType([(b(ef)).string,(b(ef)).any]),useMathFormatting:(b(ef)).bool,autoStart:(b(ef)).bool,applyVarsToRoot:(b(ef)).bool,maxTotalMessagePayload:(b(ef)).number,maxTextareaCharacters:(b(ef)).number};let XK=e=>{try{return JSON.parse(e)}catch(e){return null}},XY=(e,t="100%")=>{e.style.display="block",e.style.width="100%",e.style.height=t,e.style.minHeight="0"};class XX extends HTMLElement{connectedCallback(){let e=document.createElement("div"),t=document.createElement("div");t.setAttribute("id","memori-root"),this.style.display="block",XY(e),XY(t),(this.hasAttribute("height")||"CHAT"===this.getAttribute("layout"))&&XY(this,this.getAttribute("height")||"100%"),e.appendChild(t),this.appendChild(e);let n=Object.keys(XJ.propTypes).reduce((e,t)=>(this.hasAttribute(t)&&(e[t]=this.getAttribute(t),("true"===e[t]||"false"===e[t])&&(e[t]="true"===e[t])),e),{}),r=this.getAttribute("tenantId"),i=this.getAttribute("context"),a=i?.split(",")?.reduce((e,t)=>{let[n,r]=t.split(":").map(e=>e.trim());return{...e,[n]:r}},{}),o=XK(this.getAttribute("additionalInfo")||"{}")||{},s=this.getAttribute("integration"),l=s&&XK(s)||void 0,u=this.getAttribute("apiURL")||void 0;u&&"backend.memori.ai"===new URL(u).hostname&&(u="https://backend-proxy.aisuru.com"),r?(b(ep)).render((0,eh.jsx)(XJ,{...n,apiURL:u,context:a,tenantID:r,additionalInfo:o,integration:l,__WEBCOMPONENT__:!0}),t):console.error("No tenantId attribute found")}}customElements.define("memori-client",XX)})();